(no commit message)
authorErik Brakkee <erik@brakkee.org>
Fri, 30 Apr 2010 19:05:13 +0000 (19:05 +0000)
committerErik Brakkee <erik@brakkee.org>
Fri, 30 Apr 2010 19:05:13 +0000 (19:05 +0000)
30 files changed:
security/impl/src/main/java/org/wamblee/security/authorization/AuthorizationRule.java
security/impl/src/main/java/org/wamblee/security/authorization/AuthorizationService.java
security/impl/src/main/java/org/wamblee/security/authorization/DefaultAuthorizationService.java
security/impl/src/main/java/org/wamblee/security/authorization/GroupUserCondition.java
security/impl/src/main/java/org/wamblee/security/authorization/IsaOperationCondition.java
security/impl/src/main/java/org/wamblee/security/authorization/OperationCondition.java
security/impl/src/main/java/org/wamblee/security/authorization/PathCondition.java
security/impl/src/main/java/org/wamblee/security/authorization/RegexpPathCondition.java
security/impl/src/main/java/org/wamblee/security/authorization/UrlAuthorizationRule.java
security/impl/src/main/java/org/wamblee/security/authorization/UserCondition.java
security/impl/src/main/java/org/wamblee/usermgt/Group.java
security/impl/src/main/java/org/wamblee/usermgt/User.java
security/impl/src/test/java/org/wamblee/usermgt/InMemoryGroupSetTest.java
security/jpatest/src/main/java/org/wamblee/security/authorization/hibernate/PersistentAuthorizationService.java
security/jpatest/src/main/java/org/wamblee/usermgt/UserGroupRepositoryComponent.java
security/jpatest/src/test/java/org/wamblee/security/authorization/hibernate/PersistentAuthorizationServiceTest.java
security/jpatest/src/test/java/org/wamblee/usermgt/jpa/JpaGroupSetTest.java
support/general/src/main/java/org/wamblee/io/SimpleProcess.java
support/general/src/main/java/org/wamblee/persistence/PersistentFactory.java
support/general/src/test/java/org/wamblee/concurrency/ReadWriteLockTest.java
support/general/src/test/java/org/wamblee/io/TestData.java
support/general/src/test/java/org/wamblee/xml/XslTransformerTest.java
support/spring/src/main/java/org/wamblee/general/spring/SpringBeanFactory.java
test/enterprise/src/main/java/org/wamblee/support/jndi/StubInitialContextFactory.java
test/enterprise/src/main/java/org/wamblee/support/persistence/ExternalDatabase.java
test/enterprise/src/main/java/org/wamblee/support/persistence/TransactionProxyFactory.java
test/enterprise/src/test/java/org/wamblee/support/ThreadSpecificProxyFactoryTest.java
test/enterprise/src/test/java/org/wamblee/support/persistence/MyEntityExampleTestBase.java
test/hibernate/src/test/java/org/wamblee/support/persistence/hibernate/DatabaseUtilsTest.java
test/hibernate/src/test/java/org/wamblee/support/persistence/hibernate/MyEntityExampleTest.java

index 4e0f5641fe43b21b2f758421419b6aa78ba35926..a4654cb0c237b43faa24c8e31885daa0260edf87 100644 (file)
@@ -25,8 +25,6 @@ import javax.persistence.InheritanceType;
 import javax.persistence.Table;
 import javax.persistence.Version;
 
-import org.wamblee.persistence.Persistent;
-
 import org.wamblee.usermgt.User;
 
 /**
index 6bb5db27308af2e655ba06ed272fd40a4d0de1d7..13f4a105a085e9435f51f2688967c5daa2a1ab1e 100644 (file)
  */ 
 package org.wamblee.security.authorization;
 
-import org.wamblee.persistence.Persistent;
+import javax.persistence.DiscriminatorColumn;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Inheritance;
+import javax.persistence.InheritanceType;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.Table;
+import javax.persistence.Version;
+
+import org.wamblee.usermgt.UserAccessor;
 
 /**
  * Service to determine if access to a certain resource is allowed.
  * 
  * @author Erik Brakkee
  */
-public interface AuthorizationService extends Persistent {
+@Entity
+@Table(name = "SEC_AUTH_SVC")
+@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
+@DiscriminatorColumn(name = "TYPE")
+@NamedQueries( 
+    @NamedQuery(name = AuthorizationService.QUERY_FIND_BY_NAME, 
+        query = "select s from AuthorizationService s where s.name = :" +
+        AuthorizationService.NAME_PARAM)
+        )
+public abstract class AuthorizationService {
+    public static final String QUERY_FIND_BY_NAME = "AuthorizationService.findByName";
+    public static final String NAME_PARAM = "name";
+    
+    @Id
+    @GeneratedValue(strategy = GenerationType.AUTO)
+    private Long primaryKey;
+
+    @Version
+    private int version;
+    
+    public AuthorizationService() { 
+        // Empty. 
+    }
+    
+    public AuthorizationService(AuthorizationService aSvc) { 
+        primaryKey = aSvc.primaryKey;
+        version = aSvc.version;
+    }
+    
     /**
      * Checks whether an operation is allowed on a resource.
      * 
@@ -33,16 +74,16 @@ public interface AuthorizationService extends Persistent {
      * 
      * @return Checks whether the operation is allowed on a resource.
      */
-    boolean isAllowed(Object aResource, Operation aOperation);
+    public abstract boolean isAllowed(Object aResource, Operation aOperation);
 
-    <T> T check(T aResource, Operation aOperation);
+    public abstract <T> T check(T aResource, Operation aOperation);
 
     /**
      * Gets the authorization rules.
      * 
      * @return Rules.
      */
-    AuthorizationRule[] getRules();
+    public abstract AuthorizationRule[] getRules();
 
     /**
      * Appends a new authorization rule to the end.
@@ -50,7 +91,7 @@ public interface AuthorizationService extends Persistent {
      * @param aRule
      *            Rule to append.
      */
-    void appendRule(AuthorizationRule aRule);
+    public abstract void appendRule(AuthorizationRule aRule);
 
     /**
      * Removes a rule.
@@ -58,7 +99,7 @@ public interface AuthorizationService extends Persistent {
      * @param aIndex
      *            Index of the rule to remove.
      */
-    void removeRule(int aIndex);
+    public abstract void removeRule(int aIndex);
 
     /**
      * Inserts a rule.
@@ -68,5 +109,12 @@ public interface AuthorizationService extends Persistent {
      * @param aRule
      *            Rule to insert.
      */
-    void insertRuleAfter(int aIndex, AuthorizationRule aRule);
+    public abstract void insertRuleAfter(int aIndex, AuthorizationRule aRule);
+
+    /**
+     * Sets the user accessor so that the authorization service can get access to the logged in 
+     * user. 
+     * @param aUserAccessor User accessor.
+     */
+    public abstract void setUserAccessor(UserAccessor aUserAccessor);
 }
index 048d66cc924ed2b27a0606ad5ba290f7e5c07339..a086ab477844e3b0cec84900a4138b9446d9f4bf 100644 (file)
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- */ 
+ */
 package org.wamblee.security.authorization;
 
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
 
-import org.wamblee.security.AbstractPersistent;
 import org.wamblee.usermgt.User;
 import org.wamblee.usermgt.UserAccessor;
 
-import java.util.ArrayList;
-import java.util.List;
-
 /**
  * Default implementation of an authorization service. To determine whether
  * access to a resource is allowed, the service consults a number of
@@ -33,8 +34,11 @@ import java.util.List;
  * 
  * @author Erik Brakkee
  */
-public class DefaultAuthorizationService extends AbstractPersistent implements
-    AuthorizationService {
+@Entity
+@DiscriminatorValue("DEFAULT")
+public class DefaultAuthorizationService extends AuthorizationService {
+    
+    
     /**
      * List of ordered authorization rules.
      */
@@ -79,6 +83,7 @@ public class DefaultAuthorizationService extends AbstractPersistent implements
      * @param aUserAccessor
      *            User accessor.
      */
+    @Override
     public void setUserAccessor(UserAccessor aUserAccessor) {
         userAccessor = aUserAccessor;
     }
index d4cde7f20caa49228c397ce3658b2d460c567c0f..78367db118b7d89a3913e39c16bc721ac6ac355e 100644 (file)
@@ -20,9 +20,9 @@ import javax.persistence.Column;
 import javax.persistence.DiscriminatorValue;
 import javax.persistence.Entity;
 
-import org.wamblee.security.AbstractPersistent;
 import org.wamblee.usermgt.User;
 
+
 /**
  * Checks if a user against a specific group.
  * 
index 4e927437ffaf8877776cd1c800c6d540c43d34ed..9d2b6cb7f00c6d483591fa3f666c2769d53b7b14 100644 (file)
@@ -21,8 +21,6 @@ import javax.persistence.Column;
 import javax.persistence.DiscriminatorValue;
 import javax.persistence.Entity;
 
-import org.wamblee.security.AbstractPersistent;
-
 /**
  * Determiens if an operation is a subclass of a specified operation.
  */
index 3e8f8fb48c01515271b478ea012e5f2da04bb38d..34d026dc14938e84ed4c1439c1dbb9580d4c8d93 100644 (file)
@@ -25,8 +25,6 @@ import javax.persistence.InheritanceType;
 import javax.persistence.Table;
 import javax.persistence.Version;
 
-import org.wamblee.persistence.Persistent;
-
 /**
  * Checks if an operation matches a condition.
  * 
index b1c6670a932dcdf4f51a1a79c8e4eab358db6c0d..51b97f5f2a0cf2c7ffcbd4d32ab8d4b3028e5695 100644 (file)
@@ -25,8 +25,6 @@ import javax.persistence.InheritanceType;
 import javax.persistence.Table;
 import javax.persistence.Version;
 
-import org.wamblee.persistence.Persistent;
-
 /**
  * Checks if a path satisfies a condition.
  * 
index e1fa87d4aa2aca21ab5fe0fbced8e9d58ee3f189..fe58cfc72d23e91f7423ccc5e4593e0a27caec33 100644 (file)
@@ -18,8 +18,6 @@ package org.wamblee.security.authorization;
 import javax.persistence.DiscriminatorValue;
 import javax.persistence.Entity;
 
-import org.wamblee.security.AbstractPersistent;
-
 /**
  * Condition to check whether a path matches a given regula expression.
  * 
index 0ae744c464215ff0584e4da4a12683ef42751df1..c2834935a473d3967228cad0379e02fc582468b1 100644 (file)
  */ 
 package org.wamblee.security.authorization;
 
+import static org.wamblee.security.authorization.AuthorizationResult.*;
+
 import javax.persistence.Access;
 import javax.persistence.AccessType;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
-import javax.persistence.DiscriminatorValue;
 import javax.persistence.Entity;
 import javax.persistence.JoinColumn;
 import javax.persistence.ManyToOne;
 import javax.persistence.Transient;
 
 import org.apache.log4j.Logger;
-
-import static org.wamblee.security.authorization.AuthorizationResult.DENIED;
-import static org.wamblee.security.authorization.AuthorizationResult.GRANTED;
-import static org.wamblee.security.authorization.AuthorizationResult.UNDECIDED;
-import static org.wamblee.security.authorization.AuthorizationResult.UNSUPPORTED_RESOURCE;
-
-import org.wamblee.security.AbstractPersistent;
 import org.wamblee.usermgt.User;
 
 /**
index 293869b45edc00daaf26670a1f8f9016bdeb4fee..8b6eee9433bdabb29a463b55ab81a22c7ef422dc 100644 (file)
@@ -16,7 +16,6 @@
 package org.wamblee.security.authorization;
 
 import javax.persistence.DiscriminatorColumn;
-import javax.persistence.DiscriminatorType;
 import javax.persistence.Entity;
 import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
@@ -26,8 +25,6 @@ import javax.persistence.InheritanceType;
 import javax.persistence.Table;
 import javax.persistence.Version;
 
-import org.wamblee.persistence.Persistent;
-
 import org.wamblee.usermgt.User;
 
 /**
index ad3e3ec2edcab6d4ca14e444660f3cc097920d48..87ab4ac7c9cd980e8b311adbcde9fe78412a471c 100644 (file)
@@ -25,11 +25,8 @@ import javax.persistence.Id;
 import javax.persistence.NamedQueries;
 import javax.persistence.NamedQuery;
 import javax.persistence.Table;
-import javax.persistence.UniqueConstraint;
 import javax.persistence.Version;
 
-import org.wamblee.security.AbstractPersistent;
-
 /**
  * Represents a group.
  * 
index 00280bcc49bbbdba709e69d9de2d253950a6abfd..7462507a149bf9531926dcfb16f9ecba29b6a3d0 100644 (file)
  */
 package org.wamblee.usermgt;
 
-import org.wamblee.security.AbstractPersistent;
-import org.wamblee.security.encryption.MessageDigester;
-
-import org.wamblee.usermgt.UserMgtException.Reason;
-
 import java.io.Serializable;
-
 import java.util.Set;
 import java.util.TreeSet;
 
@@ -38,6 +32,9 @@ import javax.persistence.Table;
 import javax.persistence.Transient;
 import javax.persistence.Version;
 
+import org.wamblee.security.encryption.MessageDigester;
+import org.wamblee.usermgt.UserMgtException.Reason;
+
 /**
  * Represents a user. The methods for managing the groups of the user have
  * package scope. Managing the groups of the user should be done through the
index 49b631dffa943b8df24cbf86463d53d748c37629..9a52241f69f7c9cb7654eeb2d170b8d0c87d87ec 100644 (file)
  */ 
 package org.wamblee.usermgt;
 
-import junit.framework.TestCase;
-
-import java.sql.SQLException;
-
 import java.util.Set;
 
+import junit.framework.TestCase;
+
 /**
  * Tests the inmemory group set. Intended to be subclassed for other
  * implementations of group set.
index e7510bf9404c3d06eb51e4542900d5a005e28e1d..79c0a85dfc1ac3a4d9b0688f79546049c3791ebe 100644 (file)
  */ 
 package org.wamblee.security.authorization.hibernate;
 
-import org.springframework.orm.hibernate3.HibernateTemplate;
-
-import org.wamblee.persistence.hibernate.HibernateSupport;
+import java.util.List;
 
-import org.wamblee.security.AbstractPersistent;
+import org.springframework.orm.hibernate3.HibernateTemplate;
 import org.wamblee.security.authorization.AuthorizationRule;
 import org.wamblee.security.authorization.AuthorizationService;
 import org.wamblee.security.authorization.DefaultAuthorizationService;
 import org.wamblee.security.authorization.Operation;
-
 import org.wamblee.usermgt.UserAccessor;
 
-import java.util.List;
-
 /**
  * Authorization service with persistent storage. This is a wrapper for
  * {@link org.wamblee.security.authorization.DefaultAuthorizationService} which
@@ -36,8 +31,7 @@ import java.util.List;
  * 
  * @author Erik Brakkee
  */
-public class PersistentAuthorizationService extends AbstractPersistent
-    implements AuthorizationService {
+public class PersistentAuthorizationService extends AuthorizationService {
     /**
      * Name of query to find the service by name.
      */
@@ -100,6 +94,11 @@ public class PersistentAuthorizationService extends AbstractPersistent
         userAccessor = aAccessor;
         name = aName;
     }
+    
+    @Override
+    public void setUserAccessor(UserAccessor aUserAccessor) {
+        userAccessor = aUserAccessor;   
+    }
 
     /**
      * Initialize service if needed.
@@ -222,6 +221,6 @@ public class PersistentAuthorizationService extends AbstractPersistent
      * Saves any changes to the service state if necessary.
      */
     private void save() {
-        HibernateSupport.merge(template, service);
+       // HibernateSupport.merge(template, service);
     }
 }
index e133459f3fbaa640efb19abb02bb46c313eb4534..118da9891ebce9eacfd85a6a273c5915bb42eefa 100644 (file)
  */ 
 package org.wamblee.usermgt;
 
-import net.sf.ehcache.Ehcache;
+import java.util.HashMap;
+import java.util.Map;
 
 import org.hibernate.SessionFactory;
-
 import org.wamblee.cache.EhCache;
-
 import org.wamblee.system.core.DefaultProvidedInterface;
 import org.wamblee.system.core.DefaultRequiredInterface;
 import org.wamblee.system.core.ProvidedInterface;
 import org.wamblee.system.core.RequiredInterface;
 import org.wamblee.system.spring.SpringComponent;
 
-import java.util.HashMap;
-import java.util.Map;
-import java.util.TreeMap;
-
 /**
  * 
  * @author $author$
index 9ba63e3453037fe841bcb30bc351773e62cd2362..15fc40e2b43fef1532307f17a0343145e7a46a22 100644 (file)
  */ 
 package org.wamblee.security.authorization.hibernate;
 
-import org.apache.log4j.Logger;
+import java.sql.SQLException;
 
-import org.hibernate.annotations.AccessType;
+import org.apache.log4j.Logger;
 import org.hibernate.cfg.Configuration;
-
-import org.hibernate.dialect.MySQL5Dialect;
 import org.hibernate.dialect.MySQL5InnoDBDialect;
-
 import org.hibernate.tool.hbm2ddl.SchemaExport;
-
 import org.springframework.orm.hibernate3.HibernateTemplate;
-
-import org.wamblee.general.BeanKernel;
-
 import org.wamblee.security.authorization.AuthorizationService;
 import org.wamblee.security.authorization.AuthorizationServiceTest;
 import org.wamblee.security.authorization.TestUserAccessor;
-
 import org.wamblee.system.adapters.ClassConfiguration;
-import org.wamblee.system.adapters.ClassConfigurationTest;
 import org.wamblee.system.adapters.DefaultContainer;
 import org.wamblee.system.adapters.ObjectConfiguration;
 import org.wamblee.system.components.DatabaseComponentFactory;
 import org.wamblee.system.core.Scope;
 import org.wamblee.system.spring.component.DatabaseTesterComponent;
 import org.wamblee.system.spring.component.DatasourceComponent;
-
 import org.wamblee.usermgt.UserAccessor;
 import org.wamblee.usermgt.hibernate.AuthorizationComponent;
-import org.wamblee.usermgt.hibernate.HibernateUserAdministrationTest;
-import org.wamblee.usermgt.hibernate.UserAdministrationComponent;
-
-import java.sql.SQLException;
 
 /**
  * Unit test for the persistent authorization service.
index 49bb6c03a4ace73d8eca0382ad27e855bfc46fc1..4ece0ba43dcb239d3fa164ecfcce9e3d47242155 100644 (file)
@@ -2,11 +2,9 @@ package org.wamblee.usermgt.jpa;
 
 import java.sql.Connection;
 import java.sql.ResultSet;
-import java.sql.SQLException;
 
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.wamblee.support.persistence.JpaTester;
 import org.wamblee.support.persistence.TransactionProxyFactory;
 import org.wamblee.support.persistence.DatabaseUtils.JdbcUnitOfWork;
index f0090f53215c0d6af3a80228329eddaed930b97e..5e18b16cb7a97c7375fb4b0842e962f3a4c74680 100644 (file)
  */ 
 package org.wamblee.io;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.PrintStream;
 import java.io.StringWriter;
 import java.io.Writer;
 import java.util.Arrays;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 /**
  * 
  * @author $author$
index 7dfb460bc60e244242e65dec0a46c9a77bb47698..fddc76b9e7844377304aa045ac0957f7316a46b5 100644 (file)
@@ -18,7 +18,6 @@ package org.wamblee.persistence;
 import java.io.Serializable;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.List;
 import java.util.Map;
index 0cb27433d1f7dcbf7555e9ec195e45f609e00ea0..273abd0ed3039f44234f736cc00a306dd31d0b6c 100644 (file)
@@ -15,7 +15,6 @@
  */ 
 package org.wamblee.concurrency;
 
-import junit.framework.Assert;
 import junit.framework.TestCase;
 
 /**
index f34b0a00ebd3d6815e822ab99760a7384bd53b6c..f7e4b3dc16dbd99e7cf9a876d8381b56e8002ca7 100644 (file)
  */ 
 package org.wamblee.io;
 
-import junit.framework.Assert;
-
 import java.io.ByteArrayInputStream;
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.OutputStream;
 
-import java.nio.MappedByteBuffer;
-import java.nio.channels.FileChannel;
+import junit.framework.Assert;
 
 /**
  * TestData provides a convenient interface for managing test output files.
index 0c5c269732e8cf572c21c45967b42abadfad2e59..bf46528d4e31a4d304e23af7ca492510ad414fe4 100644 (file)
  */ 
 package org.wamblee.xml;
 
-import junit.framework.TestCase;
-
-import org.w3c.dom.Document;
-
-import org.wamblee.io.ClassPathResource;
-import org.wamblee.io.FileSystemUtils;
-import org.wamblee.io.InputResource;
-
 import java.io.ByteArrayOutputStream;
-import java.io.File;
 import java.io.IOException;
 
 import javax.xml.parsers.DocumentBuilder;
@@ -35,6 +26,13 @@ import javax.xml.transform.TransformerException;
 import javax.xml.transform.stream.StreamResult;
 import javax.xml.transform.stream.StreamSource;
 
+import junit.framework.TestCase;
+
+import org.w3c.dom.Document;
+import org.wamblee.io.ClassPathResource;
+import org.wamblee.io.FileSystemUtils;
+import org.wamblee.io.InputResource;
+
 /**
  * Tests the XSL transformer.
  * 
index a45ae3eb5b0b82f354363aa84a0f284b4f68c467..4ffb43ed1410d3bec9fcb10e9387150fcca5d403 100644 (file)
@@ -18,12 +18,9 @@ package org.wamblee.general.spring;
 import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.access.BeanFactoryLocator;
 import org.springframework.beans.factory.access.BeanFactoryReference;
-
 import org.springframework.context.access.ContextSingletonBeanFactoryLocator;
-
 import org.wamblee.general.BeanFactory;
 import org.wamblee.general.BeanFactoryException;
-import org.wamblee.general.BeanKernel;
 
 /**
  * Bean factory which uses Spring. This bean factory cannot be configured
index 8a9409d065c438b1e70f24e3277d23a57be4177d..d65968a21e5e22e00aad4e5999fb06522d97ac88 100644 (file)
  */ 
 package org.wamblee.support.jndi;
 
-import java.util.HashMap;
 import java.util.Hashtable;
-import java.util.Map;
 
 import javax.naming.Context;
-import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import javax.naming.spi.InitialContextFactory;
 
index b8167036cbfb3c60e40977f7a1634d1797c1f20b..32e469ea3a54f4be2bcc0ae9272d7d233986ff89 100644 (file)
  */ 
 package org.wamblee.support.persistence;
 
-import java.util.Arrays;
-import java.util.List;
 import java.util.logging.Logger;
 
 import javax.sql.DataSource;
 
-import org.apache.commons.dbcp.ConnectionFactory;
-import org.apache.commons.dbcp.DriverManagerConnectionFactory;
-import org.apache.commons.dbcp.PoolableConnectionFactory;
-import org.apache.commons.dbcp.PoolingDataSource;
-import org.apache.commons.pool.impl.GenericObjectPool;
-
 /**
  * Database that encapsulates connection to an external database. Database
  * connection details can be configured through system properties and
index d3d2884b79b5db87bcba6475455f9225d4a8bc3f..e56d34fa78e7ea94b8c3020a810eb82205d004cb 100644 (file)
@@ -20,7 +20,6 @@ import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
 
-import javax.management.RuntimeErrorException;
 import javax.persistence.EntityManager;
 
 import org.wamblee.support.ThreadSpecificProxyFactory;
index cb03843a0a46702a31ca8f6094a1433b88424621..0e9dbe48f0583b5c14773170cf77904d6857e810 100644 (file)
  */
 package org.wamblee.support;
 
-import javax.xml.ws.Holder;
+import static junit.framework.Assert.*;
+import static org.mockito.Matchers.*;
+import static org.mockito.Mockito.*;
 
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
-import static junit.framework.TestCase.*;
-import static org.mockito.Mockito.*;
 
 public class ThreadSpecificProxyFactoryTest {
 
index 7cb81a929dd9b6fc581db5b069a5076f21927766..dcefee59030887e23ff381a104e9f2592caadccf 100644 (file)
  */ 
 package org.wamblee.support.persistence;
 
+import static junit.framework.Assert.*;
+
 import javax.persistence.EntityManager;
-import javax.persistence.Persistence;
-import javax.sql.DataSource;
 
-import org.dbunit.DataSourceDatabaseTester;
-import org.dbunit.DatabaseTestCase;
 import org.dbunit.IDatabaseTester;
 import org.dbunit.dataset.ITable;
-import org.dbunit.dataset.filter.ITableFilterSimple;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
-import org.wamblee.support.persistence.DatabaseUtils;
-import org.wamblee.support.persistence.JpaBuilder;
-import org.wamblee.support.persistence.JpaTester;
 import org.wamblee.support.persistence.JpaBuilder.JpaUnitOfWork;
 
-import static junit.framework.Assert.*;
-
 /**
  * This class shows an example of how to test an entity using jpa.
  */
index 4032465ee40e8c6bb1f2e0e96b646f0034115774..6059c9563401bc8c61c1654608eb591c33201e4c 100644 (file)
  */ 
 package org.wamblee.support.persistence.hibernate;
 
-import static junit.framework.Assert.assertEquals;
-
-import org.dbunit.IDatabaseTester;
-
-import org.dbunit.dataset.ITable;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import org.wamblee.support.persistence.Database;
-import org.wamblee.support.persistence.DatabaseBuilder;
-import org.wamblee.support.persistence.DatabaseUtils;
 import org.wamblee.support.persistence.DatabaseUtilsTestBase;
-import org.wamblee.support.persistence.JpaBuilder;
-import org.wamblee.support.persistence.JpaBuilder.JpaUnitOfWork;
-import org.wamblee.support.persistence.PersistenceUnitDescription;
-
-import javax.persistence.EntityManager;
-
-import javax.sql.DataSource;
 
 /**
  * 
index 6e3e578bc99e08389036871e9327d54e31ba33af..3ac32a5dbc01a2a78ab5f5a5229e91d83ee69db4 100644 (file)
  */ 
 package org.wamblee.support.persistence.hibernate;
 
-import static junit.framework.Assert.*;
-
-import org.dbunit.DataSourceDatabaseTester;
-import org.dbunit.DatabaseTestCase;
-import org.dbunit.IDatabaseTester;
-
-import org.dbunit.dataset.ITable;
-import org.dbunit.dataset.filter.ITableFilterSimple;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import org.wamblee.support.persistence.DatabaseUtils;
-import org.wamblee.support.persistence.JpaBuilder;
-import org.wamblee.support.persistence.JpaBuilder.JpaUnitOfWork;
-import org.wamblee.support.persistence.JpaTester;
 import org.wamblee.support.persistence.MyEntityExampleTestBase;
 
-import javax.persistence.EntityManager;
-import javax.persistence.Persistence;
-
-import javax.sql.DataSource;
-
 /**
  * This class shows an example of how to test an entity using jpa.
  */