cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject [3/5] Apply JUnit4 instead of JUnit3 in cayenne-server
Date Sun, 02 Nov 2014 07:22:14 GMT
http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DataContextFactoryTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DataContextFactoryTest.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DataContextFactoryTest.java
index 72504d8..cdb7e6b 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DataContextFactoryTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DataContextFactoryTest.java
@@ -18,10 +18,6 @@
  ****************************************************************/
 package org.apache.cayenne.configuration.server;
 
-import java.util.Collections;
-
-import junit.framework.TestCase;
-
 import org.apache.cayenne.access.DataContext;
 import org.apache.cayenne.access.DataDomain;
 import org.apache.cayenne.access.DefaultObjectMapRetainStrategy;
@@ -44,9 +40,19 @@ import org.apache.cayenne.tx.DefaultTransactionFactory;
 import org.apache.cayenne.tx.DefaultTransactionManager;
 import org.apache.cayenne.tx.TransactionFactory;
 import org.apache.cayenne.tx.TransactionManager;
+import org.junit.Test;
+
+import java.util.Collections;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
-public class DataContextFactoryTest extends TestCase {
+public class DataContextFactoryTest {
 
+    @Test
     public void testCreateDataContextWithDedicatedCache() throws Exception {
 
         final EventManager eventManager = new MockEventManager();
@@ -84,6 +90,7 @@ public class DataContextFactoryTest extends TestCase {
                 domain.getSharedSnapshotCache());
     }
 
+    @Test
     public void testCreateDataContextValidation() throws Exception {
         final EventManager eventManager = new MockEventManager();
         final DataDomain domain = new DataDomain("d1");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java
index 13ff1c6..fbbbce9 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java
@@ -18,13 +18,6 @@
  ****************************************************************/
 package org.apache.cayenne.configuration.server;
 
-import static org.mockito.Mockito.mock;
-
-import java.util.Collection;
-import java.util.Collections;
-
-import junit.framework.TestCase;
-
 import org.apache.cayenne.ConfigurationException;
 import org.apache.cayenne.DataChannel;
 import org.apache.cayenne.access.DataDomain;
@@ -82,9 +75,21 @@ import org.apache.cayenne.resource.ClassLoaderResourceLocator;
 import org.apache.cayenne.resource.Resource;
 import org.apache.cayenne.resource.ResourceLocator;
 import org.apache.cayenne.resource.mock.MockResource;
+import org.junit.Test;
+
+import java.util.Collection;
+import java.util.Collections;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
 
-public class DataDomainProviderTest extends TestCase {
+public class DataDomainProviderTest {
 
+    @Test
     public void testGet() {
 
         // create dependencies

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DefaultDataSourceFactoryLoaderTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DefaultDataSourceFactoryLoaderTest.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DefaultDataSourceFactoryLoaderTest.java
index 8a4842e..0e7385d 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DefaultDataSourceFactoryLoaderTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DefaultDataSourceFactoryLoaderTest.java
@@ -18,10 +18,6 @@
  ****************************************************************/
 package org.apache.cayenne.configuration.server;
 
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-import junit.framework.TestCase;
-
 import org.apache.cayenne.configuration.Constants;
 import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.configuration.DataNodeDescriptor;
@@ -40,13 +36,22 @@ import org.apache.cayenne.log.CommonsJdbcEventLogger;
 import org.apache.cayenne.log.JdbcEventLogger;
 import org.apache.cayenne.resource.ResourceLocator;
 import org.apache.cayenne.resource.mock.MockResourceLocator;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
 
-public class DefaultDataSourceFactoryLoaderTest extends TestCase {
+public class DefaultDataSourceFactoryLoaderTest {
 
     private Injector injector;
 
-    @Override
-    protected void setUp() throws Exception {
+    @Before
+    public void setUp() throws Exception {
         Module testModule = new Module() {
 
             @Override
@@ -62,6 +67,7 @@ public class DefaultDataSourceFactoryLoaderTest extends TestCase {
         this.injector = DIBootstrap.createInjector(testModule);
     }
 
+    @Test
     public void testGetDataSourceFactory_Implicit() throws Exception {
 
         DataNodeDescriptor nodeDescriptor = new DataNodeDescriptor();
@@ -76,6 +82,7 @@ public class DefaultDataSourceFactoryLoaderTest extends TestCase {
         assertTrue(factory instanceof XMLPoolingDataSourceFactory);
     }
 
+    @Test
     public void testGetDataSourceFactory_Explicit() throws Exception {
 
         DataNodeDescriptor nodeDescriptor = new DataNodeDescriptor();
@@ -92,6 +99,7 @@ public class DefaultDataSourceFactoryLoaderTest extends TestCase {
                 ((MockDataSourceFactory1) factory).getInjector());
     }
 
+    @Test
     public void testGetDataSourceFactory_Property() throws Exception {
 
         final RuntimeProperties properties = mock(RuntimeProperties.class);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DefaultDbAdapterFactoryTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DefaultDbAdapterFactoryTest.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DefaultDbAdapterFactoryTest.java
index 4835ae6..45fad97 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DefaultDbAdapterFactoryTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DefaultDbAdapterFactoryTest.java
@@ -18,17 +18,8 @@
  ****************************************************************/
 package org.apache.cayenne.configuration.server;
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.sql.DatabaseMetaData;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
+import com.mockrunner.mock.jdbc.MockConnection;
+import com.mockrunner.mock.jdbc.MockDataSource;
 import org.apache.cayenne.access.translator.batch.BatchTranslatorFactory;
 import org.apache.cayenne.configuration.Constants;
 import org.apache.cayenne.configuration.DataNodeDescriptor;
@@ -50,12 +41,23 @@ import org.apache.cayenne.log.JdbcEventLogger;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.resource.ClassLoaderResourceLocator;
 import org.apache.cayenne.resource.ResourceLocator;
+import org.junit.Test;
 
-import com.mockrunner.mock.jdbc.MockConnection;
-import com.mockrunner.mock.jdbc.MockDataSource;
+import java.sql.DatabaseMetaData;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
 
-public class DefaultDbAdapterFactoryTest extends TestCase {
+public class DefaultDbAdapterFactoryTest {
 
+    @Test
     public void testCreatedAdapter_Auto() throws Exception {
 
         final DbAdapter adapter = mock(DbAdapter.class);
@@ -96,6 +98,7 @@ public class DefaultDbAdapterFactoryTest extends TestCase {
         assertEquals("XXXXX", createdAdapter.createTable(new DbEntity("Test")));
     }
 
+    @Test
     public void testCreatedAdapter_Generic() throws Exception {
 
         List<DbAdapterDetector> detectors = new ArrayList<DbAdapterDetector>();
@@ -128,6 +131,7 @@ public class DefaultDbAdapterFactoryTest extends TestCase {
         assertEquals("CREATE TABLE Test ()", createdAdapter.createTable(new DbEntity("Test")));
     }
 
+    @Test
     public void testCreatedAdapter_Custom() throws Exception {
 
         DataNodeDescriptor nodeDescriptor = new DataNodeDescriptor();
@@ -162,6 +166,7 @@ public class DefaultDbAdapterFactoryTest extends TestCase {
         assertTrue("Unexpected class: " + createdAdapter.getClass().getName(), createdAdapter instanceof SybaseAdapter);
     }
 
+    @Test
     public void testCreatedAdapter_AutoExplicit() throws Exception {
 
         final DbAdapter adapter = mock(DbAdapter.class);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/CayenneFilterTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/CayenneFilterTest.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/CayenneFilterTest.java
index f22ae1f..ab8c687 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/CayenneFilterTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/CayenneFilterTest.java
@@ -18,27 +18,31 @@
  ****************************************************************/
 package org.apache.cayenne.configuration.web;
 
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-
-import junit.framework.TestCase;
-
+import com.mockrunner.mock.web.MockFilterChain;
+import com.mockrunner.mock.web.MockFilterConfig;
+import com.mockrunner.mock.web.MockHttpServletRequest;
+import com.mockrunner.mock.web.MockHttpServletResponse;
+import com.mockrunner.mock.web.MockServletContext;
 import org.apache.cayenne.configuration.CayenneRuntime;
 import org.apache.cayenne.configuration.Constants;
 import org.apache.cayenne.configuration.ModuleCollection;
 import org.apache.cayenne.configuration.server.ServerModule;
 import org.apache.cayenne.di.Key;
 import org.apache.cayenne.di.Module;
+import org.junit.Test;
 
-import com.mockrunner.mock.web.MockFilterChain;
-import com.mockrunner.mock.web.MockFilterConfig;
-import com.mockrunner.mock.web.MockHttpServletRequest;
-import com.mockrunner.mock.web.MockHttpServletResponse;
-import com.mockrunner.mock.web.MockServletContext;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
-public class CayenneFilterTest extends TestCase {
+public class CayenneFilterTest {
 
+    @Test
 	public void testInitWithFilterName() throws Exception {
 
 		MockFilterConfig config = new MockFilterConfig();
@@ -61,6 +65,7 @@ public class CayenneFilterTest extends TestCase {
 		assertEquals(Arrays.asList("abc.xml"), locations);
 	}
 
+    @Test
 	public void testInitWithLocation() throws Exception {
 
 		MockFilterConfig config = new MockFilterConfig();
@@ -81,6 +86,7 @@ public class CayenneFilterTest extends TestCase {
 		assertEquals(Arrays.asList("xyz"), locations);
 	}
 
+    @Test
 	public void testInitWithStandardModules() throws Exception {
 
 		MockFilterConfig config = new MockFilterConfig();
@@ -112,6 +118,7 @@ public class CayenneFilterTest extends TestCase {
 		assertTrue(handler instanceof SessionContextRequestHandler);
 	}
 
+    @Test
 	public void testInitWithExtraModules() throws Exception {
 
 		MockFilterConfig config = new MockFilterConfig();
@@ -141,6 +148,7 @@ public class CayenneFilterTest extends TestCase {
 		assertTrue(handler instanceof MockRequestHandler);
 	}
 
+    @Test
 	public void testDoFilter() throws Exception {
 		MockFilterConfig config = new MockFilterConfig();
 		config.setFilterName("abc");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/ServletContextHandlerTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/ServletContextHandlerTest.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/ServletContextHandlerTest.java
index 2fa1d8e..c160ae8 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/ServletContextHandlerTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/ServletContextHandlerTest.java
@@ -18,9 +18,9 @@
  ****************************************************************/
 package org.apache.cayenne.configuration.web;
 
-import static org.mockito.Mockito.mock;
-import junit.framework.TestCase;
-
+import com.mockrunner.mock.web.MockHttpServletRequest;
+import com.mockrunner.mock.web.MockHttpServletResponse;
+import com.mockrunner.mock.web.MockHttpSession;
 import org.apache.cayenne.BaseContext;
 import org.apache.cayenne.DataChannel;
 import org.apache.cayenne.MockDataChannel;
@@ -30,13 +30,17 @@ import org.apache.cayenne.di.Binder;
 import org.apache.cayenne.di.DIBootstrap;
 import org.apache.cayenne.di.Injector;
 import org.apache.cayenne.di.Module;
+import org.junit.Test;
 
-import com.mockrunner.mock.web.MockHttpServletRequest;
-import com.mockrunner.mock.web.MockHttpServletResponse;
-import com.mockrunner.mock.web.MockHttpSession;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.fail;
+import static org.mockito.Mockito.mock;
 
-public class ServletContextHandlerTest extends TestCase {
+public class ServletContextHandlerTest {
 
+    @Test
     public void testRequestStart_bindContext() {
 
         Module module = new Module() {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/WebConfigurationTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/WebConfigurationTest.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/WebConfigurationTest.java
index 4c159d0..0183163 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/WebConfigurationTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/WebConfigurationTest.java
@@ -18,20 +18,24 @@
  ****************************************************************/
 package org.apache.cayenne.configuration.web;
 
+import com.mockrunner.mock.web.MockFilterConfig;
+import com.mockrunner.mock.web.MockServletConfig;
+import org.apache.cayenne.di.Binder;
+import org.apache.cayenne.di.Module;
+import org.junit.Test;
+
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.Map;
 
-import junit.framework.TestCase;
-
-import org.apache.cayenne.di.Binder;
-import org.apache.cayenne.di.Module;
-
-import com.mockrunner.mock.web.MockFilterConfig;
-import com.mockrunner.mock.web.MockServletConfig;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
 
-public class WebConfigurationTest extends TestCase {
+public class WebConfigurationTest {
 
+    @Test
     public void testFilterCreateModules_Standard() throws Exception {
 
         MockFilterConfig config = new MockFilterConfig();
@@ -57,6 +61,7 @@ public class WebConfigurationTest extends TestCase {
         assertSame(m2, it.next());
     }
 
+    @Test
     public void testFilterCreateModules_Extra() throws Exception {
 
         MockFilterConfig config = new MockFilterConfig();
@@ -90,6 +95,7 @@ public class WebConfigurationTest extends TestCase {
         assertTrue(it.next() instanceof MockModule2);
     }
 
+    @Test
     public void testServletCreateModules_Extra() throws Exception {
 
         MockServletConfig config = new MockServletConfig();
@@ -123,6 +129,7 @@ public class WebConfigurationTest extends TestCase {
         assertTrue(it.next() instanceof MockModule2);
     }
 
+    @Test
     public void testFilterConfigurationLocation_Name() {
         MockFilterConfig config1 = new MockFilterConfig();
         config1.setFilterName("cayenne-x");
@@ -143,6 +150,7 @@ public class WebConfigurationTest extends TestCase {
         assertEquals("a/b/c/cayenne-z.xml", configuration3.getConfigurationLocation());
     }
 
+    @Test
     public void testServletConfigurationLocation_Name() {
         MockServletConfig config1 = new MockServletConfig();
         config1.setServletName("cayenne-x");
@@ -163,6 +171,7 @@ public class WebConfigurationTest extends TestCase {
         assertEquals("a/b/c/cayenne-z.xml", configuration3.getConfigurationLocation());
     }
 
+    @Test
     public void testFilterConfigurationLocation_Parameter() {
         MockFilterConfig config1 = new MockFilterConfig();
         config1.setFilterName("cayenne-x");
@@ -174,6 +183,7 @@ public class WebConfigurationTest extends TestCase {
         assertEquals("cayenne-y.xml", configuration1.getConfigurationLocation());
     }
 
+    @Test
     public void testServletConfigurationLocation_Parameter() {
         MockServletConfig config1 = new MockServletConfig();
         config1.setServletName("cayenne-x");
@@ -185,6 +195,7 @@ public class WebConfigurationTest extends TestCase {
         assertEquals("cayenne-y.xml", configuration1.getConfigurationLocation());
     }
 
+    @Test
     public void testFilterParameters() {
         MockFilterConfig config1 = new MockFilterConfig();
         config1.setFilterName("cayenne-x");
@@ -204,6 +215,7 @@ public class WebConfigurationTest extends TestCase {
         assertEquals("xxx", parameters.get("test"));
     }
 
+    @Test
     public void testFilterOtherParameters() {
         MockFilterConfig config1 = new MockFilterConfig();
         config1.setFilterName("cayenne-x");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/WebModuleTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/WebModuleTest.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/WebModuleTest.java
index eabff28..0fd2ff2 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/WebModuleTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/WebModuleTest.java
@@ -20,11 +20,14 @@ package org.apache.cayenne.configuration.web;
 
 import org.apache.cayenne.di.Injector;
 import org.apache.cayenne.di.spi.DefaultInjector;
+import org.junit.Test;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertTrue;
 
-public class WebModuleTest extends TestCase {
+public class WebModuleTest {
 
+    @Test
     public void testBind_Scopes() {
 
         Injector injector = new DefaultInjector(new WebModule());

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/WebUtilTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/WebUtilTest.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/WebUtilTest.java
index d1fd3b7..5db0f43 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/WebUtilTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/WebUtilTest.java
@@ -18,16 +18,17 @@
  ****************************************************************/
 package org.apache.cayenne.configuration.web;
 
-import static org.mockito.Mockito.mock;
-
-import org.apache.cayenne.configuration.CayenneRuntime;
-
 import com.mockrunner.mock.web.MockServletContext;
+import org.apache.cayenne.configuration.CayenneRuntime;
+import org.junit.Test;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.mockito.Mockito.mock;
 
-public class WebUtilTest extends TestCase {
+public class WebUtilTest {
 
+    @Test
 	public void testGetCayenneRuntime() {
 		MockServletContext context = new MockServletContext();
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/conn/DataSourceInfoTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/conn/DataSourceInfoTest.java b/cayenne-server/src/test/java/org/apache/cayenne/conn/DataSourceInfoTest.java
index af182eb..e35fae5 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/conn/DataSourceInfoTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/conn/DataSourceInfoTest.java
@@ -19,15 +19,18 @@
 
 package org.apache.cayenne.conn;
 
-import junit.framework.TestCase;
-
 import org.apache.cayenne.util.Util;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
-public class DataSourceInfoTest extends TestCase {
+public class DataSourceInfoTest {
 
     private DataSourceInfo dsi;
 
-    @Override
+    @Before
     public void setUp() throws Exception {
         dsi = new DataSourceInfo();
         dsi.setUserName("a");
@@ -39,18 +42,21 @@ public class DataSourceInfoTest extends TestCase {
         dsi.setAdapterClassName("d");
     }
 
+    @Test
     public void testDefaultValues() throws java.lang.Exception {
         DataSourceInfo localDsi = new DataSourceInfo();
         assertEquals(1, localDsi.getMinConnections());
         assertTrue(localDsi.getMinConnections() <= localDsi.getMaxConnections());
     }
 
+    @Test
     public void testClone() throws java.lang.Exception {
         DataSourceInfo dsiClone = dsi.cloneInfo();
         assertEquals(dsi, dsiClone);
         assertTrue(dsi != dsiClone);
     }
 
+    @Test
     public void testSerialize() throws java.lang.Exception {
         DataSourceInfo dsiUnserialized = Util.cloneViaSerialization(dsi);
         assertEquals(dsi, dsiUnserialized);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/conn/DriverDataSourceTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/conn/DriverDataSourceTest.java b/cayenne-server/src/test/java/org/apache/cayenne/conn/DriverDataSourceTest.java
index f63b4c9..bd3ecd7 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/conn/DriverDataSourceTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/conn/DriverDataSourceTest.java
@@ -18,12 +18,16 @@
  ****************************************************************/
 package org.apache.cayenne.conn;
 
+import org.junit.Test;
+
 import java.sql.SQLException;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
 
-public class DriverDataSourceTest extends TestCase {
+public class DriverDataSourceTest {
 
+    @Test
     public void testLazyInstantiationOfDriverClass() {
         DriverDataSource dataSource = new DriverDataSource("does.not.exist.Driver", "jdbc:postgresql://localhost/database");
         assertNotNull(dataSource);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/conn/PooledConnectionImplTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/conn/PooledConnectionImplTest.java b/cayenne-server/src/test/java/org/apache/cayenne/conn/PooledConnectionImplTest.java
index 755dd53..e829372 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/conn/PooledConnectionImplTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/conn/PooledConnectionImplTest.java
@@ -19,10 +19,11 @@
 
 package org.apache.cayenne.conn;
 
-import junit.framework.TestCase;
+import org.junit.Test;
 
-public class PooledConnectionImplTest extends TestCase {
+public class PooledConnectionImplTest {
 
+    @Test
     public void testConnectionErrorNotificationConcurrency() throws Exception {
         // test a case when error notification is sent to connection
         // that has been removed from the pool, but when pool is still a 
@@ -36,6 +37,7 @@ public class PooledConnectionImplTest extends TestCase {
         con.connectionErrorNotification(new java.sql.SQLException("Bad SQL Exception.."));
     }
 
+    @Test
     public void testConnectionClosedNotificationConcurrency() throws Exception {
         // test a case when closed notification is sent to connection
         // that has been removed from the pool, but when pool is still a 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/dba/DefaultQuotingStrategyTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/dba/DefaultQuotingStrategyTest.java b/cayenne-server/src/test/java/org/apache/cayenne/dba/DefaultQuotingStrategyTest.java
index 7d825a7..27d725e 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/dba/DefaultQuotingStrategyTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/dba/DefaultQuotingStrategyTest.java
@@ -18,13 +18,15 @@
  ****************************************************************/
 package org.apache.cayenne.dba;
 
-import junit.framework.TestCase;
-
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.DbEntity;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
 
-public class DefaultQuotingStrategyTest extends TestCase {
+public class DefaultQuotingStrategyTest {
 
+    @Test
     public void testQuotedIdentifer() {
 
         DataMap dm = new DataMap();
@@ -38,6 +40,7 @@ public class DefaultQuotingStrategyTest extends TestCase {
         assertEquals("[c].[b].[a]", strategy.quotedIdentifier(de, "c", "b", "a"));
     }
 
+    @Test
     public void testUnQuotedIdentifer() {
 
         DataMap dm = new DataMap();

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/dba/oracle/OracleUtilDateTypeTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/dba/oracle/OracleUtilDateTypeTest.java b/cayenne-server/src/test/java/org/apache/cayenne/dba/oracle/OracleUtilDateTypeTest.java
index 1293135..1db9cb0 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/dba/oracle/OracleUtilDateTypeTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/dba/oracle/OracleUtilDateTypeTest.java
@@ -19,13 +19,17 @@
 
 package org.apache.cayenne.dba.oracle;
 
+import org.junit.Test;
+
 import java.util.Calendar;
 import java.util.Date;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
 
-public class OracleUtilDateTypeTest extends TestCase {
+public class OracleUtilDateTypeTest {
 
+    @Test
     public void testNormalizeDate() throws Exception {
         Date date = new Date();
         Date timeNormalized = new OracleUtilDateType().normalizeDate(date);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/ejbql/EJBQLExpressionTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/ejbql/EJBQLExpressionTest.java b/cayenne-server/src/test/java/org/apache/cayenne/ejbql/EJBQLExpressionTest.java
index c1a70b3..6dd0d9e 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/ejbql/EJBQLExpressionTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/ejbql/EJBQLExpressionTest.java
@@ -18,10 +18,14 @@
  ****************************************************************/
 package org.apache.cayenne.ejbql;
 
-import junit.framework.TestCase;
+import org.junit.Test;
 
-public class EJBQLExpressionTest extends TestCase {
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
 
+public class EJBQLExpressionTest {
+
+    @Test
     public void testDbPath() {
 
         EJBQLParser parser = EJBQLParserFactory.getParser();
@@ -31,6 +35,7 @@ public class EJBQLExpressionTest extends TestCase {
         assertNotNull(select);
     }
 
+    @Test
     public void testEnumPath() {
         EJBQLParser parser = EJBQLParserFactory.getParser();
 
@@ -42,7 +47,7 @@ public class EJBQLExpressionTest extends TestCase {
     /**
      * <p>This should not parse because there are multiple non-bracketed parameters.</p>
      */
-
+    @Test
     public void testInWithMultipleStringPositionalParameter_withoutBrackets() {
         EJBQLParser parser = EJBQLParserFactory.getParser();
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/ejbql/EJBQLParserFactoryTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/ejbql/EJBQLParserFactoryTest.java b/cayenne-server/src/test/java/org/apache/cayenne/ejbql/EJBQLParserFactoryTest.java
index ba6b39c..7d9e081 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/ejbql/EJBQLParserFactoryTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/ejbql/EJBQLParserFactoryTest.java
@@ -18,15 +18,19 @@
  ****************************************************************/
 package org.apache.cayenne.ejbql;
 
-import junit.framework.TestCase;
+import org.junit.Test;
 
-public class EJBQLParserFactoryTest extends TestCase {
+import static org.junit.Assert.assertNotNull;
 
+public class EJBQLParserFactoryTest {
+
+    @Test
     public void testGetParser() {
         EJBQLParser parser = EJBQLParserFactory.getParser();
         assertNotNull(parser);
     }
 
+    @Test
     public void testDefaultParser() {
         EJBQLParser parser = EJBQLParserFactory.getParser();
         EJBQLExpression parsedSelect = parser.parse("select a from b");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/ejbql/parser/EJBQLPathTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/ejbql/parser/EJBQLPathTest.java b/cayenne-server/src/test/java/org/apache/cayenne/ejbql/parser/EJBQLPathTest.java
index 0697c17..fad76ce 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/ejbql/parser/EJBQLPathTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/ejbql/parser/EJBQLPathTest.java
@@ -18,10 +18,13 @@
  ****************************************************************/
 package org.apache.cayenne.ejbql.parser;
 
-import junit.framework.TestCase;
+import org.junit.Test;
 
-public class EJBQLPathTest extends TestCase {
+import static org.junit.Assert.assertEquals;
 
+public class EJBQLPathTest {
+
+    @Test
     public void testGetAbsolutePath() {
         EJBQLPath path = new EJBQLPath(-1);
         EJBQLIdentifier id = new EJBQLIdentifier(-1);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/event/DefaultEventManagerTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/event/DefaultEventManagerTest.java b/cayenne-server/src/test/java/org/apache/cayenne/event/DefaultEventManagerTest.java
index d7e2e18..93f8a3f 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/event/DefaultEventManagerTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/event/DefaultEventManagerTest.java
@@ -19,15 +19,16 @@
 
 package org.apache.cayenne.event;
 
+import org.apache.cayenne.test.parallel.ParallelTestContainer;
+import org.junit.Before;
+import org.junit.Test;
+
 import java.util.EventListener;
 import java.util.EventObject;
 
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.apache.cayenne.test.parallel.ParallelTestContainer;
+import static org.junit.Assert.*;
 
-public class DefaultEventManagerTest extends TestCase implements EventListener {
+public class DefaultEventManagerTest implements EventListener {
 
     // used for counting received events on the class
     public static int numberOfReceivedEventsForClass;
@@ -38,13 +39,14 @@ public class DefaultEventManagerTest extends TestCase implements EventListener {
     // the event manager used for testing
     private EventManager eventManager;
 
-    @Override
+    @Before
     public void setUp() {
         eventManager = new DefaultEventManager();
         numberOfReceivedEvents = 0;
         numberOfReceivedEventsForClass = 0;
     }
 
+    @Test
     public void testSubjectListenerWouldRegisterListener() {
 
         MockListener listener = new MockListener(eventManager);
@@ -69,6 +71,7 @@ public class DefaultEventManagerTest extends TestCase implements EventListener {
         eventManager.postEvent(new EventObject(this), MockListener.mockSubject);
     }
 
+    @Test
     public void testObjectListenerWouldRegisterListener() {
 
         MockListener listener = new MockListener(eventManager, this);
@@ -95,11 +98,12 @@ public class DefaultEventManagerTest extends TestCase implements EventListener {
         eventManager.postEvent(new EventObject(this), MockListener.mockSubject);
     }
 
+    @Test
     public void testNullListener() {
         try {
             EventSubject subject = EventSubject.getSubject(this.getClass(), "hansi");
             eventManager.addListener(null, null, null, subject);
-            Assert.fail();
+            fail();
         }
 
         catch (IllegalArgumentException ia) {
@@ -107,11 +111,12 @@ public class DefaultEventManagerTest extends TestCase implements EventListener {
         }
     }
 
+    @Test
     public void testNullNotification() {
         // null notification
         try {
             eventManager.addListener(this, "testNullObserver", CayenneEvent.class, null);
-            Assert.fail();
+            fail();
         }
 
         catch (IllegalArgumentException e) {
@@ -122,7 +127,7 @@ public class DefaultEventManagerTest extends TestCase implements EventListener {
         try {
             EventSubject subject = EventSubject.getSubject(this.getClass(), "");
             eventManager.addListener(this, "testNullObserver", null, subject);
-            Assert.fail();
+            fail();
         }
 
         catch (IllegalArgumentException e) {
@@ -137,7 +142,7 @@ public class DefaultEventManagerTest extends TestCase implements EventListener {
                     "testNullObserver",
                     CayenneEvent.class,
                     subject);
-            Assert.fail();
+            fail();
         }
 
         catch (IllegalArgumentException e) {
@@ -145,6 +150,7 @@ public class DefaultEventManagerTest extends TestCase implements EventListener {
         }
     }
 
+    @Test
     public void testNonexistingMethod() {
         try {
             EventSubject subject = EventSubject.getSubject(this.getClass(), "hansi");
@@ -153,7 +159,7 @@ public class DefaultEventManagerTest extends TestCase implements EventListener {
                     "thisMethodDoesNotExist",
                     CayenneEvent.class,
                     subject);
-            Assert.fail();
+            fail();
         }
 
         catch (RuntimeException e) {
@@ -161,6 +167,7 @@ public class DefaultEventManagerTest extends TestCase implements EventListener {
         }
     }
 
+    @Test
     public void testInvalidArgumentTypes() {
         try {
             EventSubject subject = EventSubject.getSubject(this.getClass(), "hansi");
@@ -169,7 +176,7 @@ public class DefaultEventManagerTest extends TestCase implements EventListener {
                     "seeTheWrongMethod",
                     CayenneEvent.class,
                     subject);
-            Assert.fail();
+            fail();
         }
 
         catch (RuntimeException e) {
@@ -177,6 +184,7 @@ public class DefaultEventManagerTest extends TestCase implements EventListener {
         }
     }
 
+    @Test
     public void testNonretainedListener() {
         EventSubject subject = EventSubject.getSubject(this.getClass(), "XXX");
         eventManager.addListener(
@@ -190,9 +198,10 @@ public class DefaultEventManagerTest extends TestCase implements EventListener {
         System.gc();
 
         eventManager.postEvent(new CayenneEvent(this), subject);
-        Assert.assertEquals(0, numberOfReceivedEventsForClass);
+        assertEquals(0, numberOfReceivedEventsForClass);
     }
 
+    @Test
     public void testValidSubclassOfRegisteredEventClass() throws Exception {
         EventSubject subject = EventSubject.getSubject(this.getClass(), "XXX");
         eventManager.addListener(this, "seeNotification", CayenneEvent.class, subject);
@@ -201,6 +210,7 @@ public class DefaultEventManagerTest extends TestCase implements EventListener {
         assertReceivedEvents(1, this);
     }
 
+    @Test
     public void testWrongRegisteredEventClass() throws Exception {
         EventSubject subject = EventSubject.getSubject(this.getClass(), "XXX");
 
@@ -213,6 +223,7 @@ public class DefaultEventManagerTest extends TestCase implements EventListener {
         assertReceivedEvents(0, this);
     }
 
+    @Test
     public void testSuccessfulNotificationDefaultSender() throws Exception {
         DefaultEventManagerTest listener1 = this;
         DefaultEventManagerTest listener2 = new DefaultEventManagerTest();
@@ -236,6 +247,7 @@ public class DefaultEventManagerTest extends TestCase implements EventListener {
         assertReceivedEventsForClass(2);
     }
 
+    @Test
     public void testSuccessfulNotificationIndividualSender() throws Exception {
         EventSubject subject = EventSubject.getSubject(this.getClass(), "XXX");
         eventManager.addListener(
@@ -250,6 +262,7 @@ public class DefaultEventManagerTest extends TestCase implements EventListener {
         assertReceivedEventsForClass(1);
     }
 
+    @Test
     public void testSuccessfulNotificationIndividualSenderTwice() throws Exception {
         EventSubject subject = EventSubject.getSubject(this.getClass(), "XXX");
         eventManager.addListener(this, "seeNotification", CayenneEvent.class, subject);
@@ -265,6 +278,7 @@ public class DefaultEventManagerTest extends TestCase implements EventListener {
         assertReceivedEventsForClass(2);
     }
 
+    @Test
     public void testSuccessfulNotificationBothDefaultAndIndividualSender()
             throws Exception {
         DefaultEventManagerTest listener1 = this;
@@ -290,22 +304,26 @@ public class DefaultEventManagerTest extends TestCase implements EventListener {
         assertReceivedEventsForClass(2);
     }
 
+    @Test
     public void testRemoveOnEmptyList() {
         EventSubject subject = EventSubject.getSubject(this.getClass(), "XXX");
-        Assert.assertFalse(eventManager.removeListener(this, subject));
+        assertFalse(eventManager.removeListener(this, subject));
     }
 
+    @Test
     public void testRemoveOnNullSubject() {
-        Assert.assertFalse(eventManager.removeListener(this, null));
+        assertFalse(eventManager.removeListener(this, null));
     }
 
+    @Test
     public void testRemoveFromDefaultQueue() {
         EventSubject subject = EventSubject.getSubject(this.getClass(), "XXX");
         eventManager.addListener(this, "seeNotification", CayenneEvent.class, subject);
-        Assert.assertTrue(eventManager.removeListener(this, subject));
-        Assert.assertFalse(eventManager.removeListener(this));
+        assertTrue(eventManager.removeListener(this, subject));
+        assertFalse(eventManager.removeListener(this));
     }
 
+    @Test
     public void testRemoveSpecificQueue() {
         EventSubject subject = EventSubject.getSubject(this.getClass(), "XXX");
         eventManager.addListener(
@@ -314,10 +332,11 @@ public class DefaultEventManagerTest extends TestCase implements EventListener {
                 CayenneEvent.class,
                 subject,
                 this);
-        Assert.assertTrue(eventManager.removeListener(this, subject));
-        Assert.assertFalse(eventManager.removeListener(this));
+        assertTrue(eventManager.removeListener(this, subject));
+        assertFalse(eventManager.removeListener(this));
     }
 
+    @Test
     public void testRemoveSpecificSender() {
         EventSubject subject = EventSubject.getSubject(this.getClass(), "XXX");
         eventManager.addListener(
@@ -326,10 +345,11 @@ public class DefaultEventManagerTest extends TestCase implements EventListener {
                 CayenneEvent.class,
                 subject,
                 this);
-        Assert.assertTrue(eventManager.removeListener(this, subject, this));
-        Assert.assertFalse(eventManager.removeListener(this));
+        assertTrue(eventManager.removeListener(this, subject, this));
+        assertFalse(eventManager.removeListener(this));
     }
 
+    @Test
     public void testRemoveNullSender() {
         EventSubject subject = EventSubject.getSubject(this.getClass(), "XXX");
         eventManager.addListener(
@@ -338,10 +358,11 @@ public class DefaultEventManagerTest extends TestCase implements EventListener {
                 CayenneEvent.class,
                 subject,
                 this);
-        Assert.assertTrue(eventManager.removeListener(this, subject, null));
-        Assert.assertFalse(eventManager.removeListener(this));
+        assertTrue(eventManager.removeListener(this, subject, null));
+        assertFalse(eventManager.removeListener(this));
     }
 
+    @Test
     public void testRemoveNonexistingSender() {
         EventSubject subject = EventSubject.getSubject(this.getClass(), "XXX");
         eventManager.addListener(
@@ -350,10 +371,11 @@ public class DefaultEventManagerTest extends TestCase implements EventListener {
                 CayenneEvent.class,
                 subject,
                 this);
-        Assert.assertFalse(eventManager.removeListener(this, subject, "foo"));
-        Assert.assertTrue(eventManager.removeListener(this));
+        assertFalse(eventManager.removeListener(this, subject, "foo"));
+        assertTrue(eventManager.removeListener(this));
     }
 
+    @Test
     public void testRemoveAll() {
         EventSubject subject1 = EventSubject.getSubject(this.getClass(), "XXX1");
         EventSubject subject2 = EventSubject.getSubject(this.getClass(), "XXX2");
@@ -367,13 +389,14 @@ public class DefaultEventManagerTest extends TestCase implements EventListener {
                 subject3,
                 this);
 
-        Assert.assertTrue(eventManager.removeListener(this));
-        Assert.assertFalse(eventManager.removeListener(this));
-        Assert.assertFalse(eventManager.removeListener(this, subject1));
-        Assert.assertFalse(eventManager.removeListener(this, subject2));
-        Assert.assertFalse(eventManager.removeListener(this, subject3));
+        assertTrue(eventManager.removeListener(this));
+        assertFalse(eventManager.removeListener(this));
+        assertFalse(eventManager.removeListener(this, subject1));
+        assertFalse(eventManager.removeListener(this, subject2));
+        assertFalse(eventManager.removeListener(this, subject3));
     }
 
+    @Test
     public void testSubjectGarbageCollection() {
         EventSubject subject = EventSubject.getSubject(this.getClass(), "XXX");
         eventManager.addListener(this, "seeNotification", CayenneEvent.class, subject);
@@ -383,7 +406,7 @@ public class DefaultEventManagerTest extends TestCase implements EventListener {
         System.gc();
         System.gc();
 
-        Assert.assertFalse(eventManager.removeListener(this));
+        assertFalse(eventManager.removeListener(this));
     }
 
     // notification method

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/event/EventBridgeTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/event/EventBridgeTest.java b/cayenne-server/src/test/java/org/apache/cayenne/event/EventBridgeTest.java
index 818e780..dd76077 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/event/EventBridgeTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/event/EventBridgeTest.java
@@ -19,17 +19,22 @@
 
 package org.apache.cayenne.event;
 
-import java.util.Collection;
-
-import junit.framework.TestCase;
-
 import org.apache.cayenne.access.event.SnapshotEvent;
 import org.apache.cayenne.test.parallel.ParallelTestContainer;
+import org.junit.Test;
+
+import java.util.Collection;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
 
 /**
  */
-public class EventBridgeTest extends TestCase {
+public class EventBridgeTest {
 
+    @Test
     public void testConstructor() throws Exception {
         EventSubject local = EventSubject
                 .getSubject(EventBridgeTest.class, "testInstall");
@@ -42,6 +47,7 @@ public class EventBridgeTest extends TestCase {
         assertEquals(external, bridge.getExternalSubject());
     }
 
+    @Test
     public void testStartup() throws Exception {
         EventSubject local = EventSubject
                 .getSubject(EventBridgeTest.class, "testInstall");
@@ -64,6 +70,7 @@ public class EventBridgeTest extends TestCase {
         assertEquals(1, bridge.shutdownCalls);
     }
 
+    @Test
     public void testShutdown() throws Exception {
         EventSubject local = EventSubject
                 .getSubject(EventBridgeTest.class, "testInstall");
@@ -79,6 +86,7 @@ public class EventBridgeTest extends TestCase {
         assertEquals(1, bridge.shutdownCalls);
     }
 
+    @Test
     public void testSendExternalEvent() throws Exception {
 
         final EventSubject local = EventSubject.getSubject(

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/event/EventSubjectTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/event/EventSubjectTest.java b/cayenne-server/src/test/java/org/apache/cayenne/event/EventSubjectTest.java
index a3f8ae7..792a729 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/event/EventSubjectTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/event/EventSubjectTest.java
@@ -19,36 +19,42 @@
 
 package org.apache.cayenne.event;
 
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
 import org.apache.cayenne.util.Util;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.fail;
 
-public class EventSubjectTest extends TestCase {
+public class EventSubjectTest {
 
+    @Test
     public void testIllegalArguments() {
         try {
             EventSubject.getSubject(null, "Subject");
-            Assert.fail();
+            fail();
         } catch (IllegalArgumentException ex) {
             // OK
         }
 
         try {
             EventSubject.getSubject(Object.class, null);
-            Assert.fail();
+            fail();
         } catch (IllegalArgumentException ex) {
             // OK
         }
 
         try {
             EventSubject.getSubject(Object.class, "");
-            Assert.fail();
+            fail();
         } catch (IllegalArgumentException ex) {
             // OK
         }
     }
 
+    @Test
     public void testEqualityOfClonedSubjects() throws Exception {
         EventSubject s1 = EventSubject.getSubject(EventSubjectTest.class, "MySubject");
         EventSubject s2 = (EventSubject) Util.cloneViaSerialization(s1);
@@ -58,33 +64,38 @@ public class EventSubjectTest extends TestCase {
         assertEquals(s1.hashCode(), s2.hashCode());
     }
 
+    @Test
     public void testIdenticalSubject() {
         EventSubject s1 = EventSubject.getSubject(EventSubjectTest.class, "MySubject");
         EventSubject s2 = EventSubject.getSubject(EventSubjectTest.class, "MySubject");
-        Assert.assertSame(s1, s2);
+        assertSame(s1, s2);
     }
 
+    @Test
     public void testEqualityOfIdenticalSubjects() {
         EventSubject s1 = EventSubject.getSubject(EventSubjectTest.class, "MySubject");
         EventSubject s2 = EventSubject.getSubject(EventSubjectTest.class, "MySubject");
-        Assert.assertEquals(s1, s2);
+        assertEquals(s1, s2);
     }
 
+    @Test
     public void testEqualityOfSubjectsByDifferentOwner() {
         EventSubject s1 = EventSubject.getSubject(EventSubject.class, "MySubject");
         EventSubject s2 = EventSubject.getSubject(EventSubjectTest.class, "MySubject");
-        Assert.assertFalse(s1.equals(s2));
+        assertFalse(s1.equals(s2));
     }
 
+    @Test
     public void testEqualityOfSubjectsByDifferentTopic() {
         EventSubject s1 = EventSubject.getSubject(EventSubjectTest.class, "Subject1");
         EventSubject s2 = EventSubject.getSubject(EventSubjectTest.class, "Subject2");
-        Assert.assertFalse(s1.equals(s2));
+        assertFalse(s1.equals(s2));
     }
 
+    @Test
     public void testSubjectEqualsNull() {
         EventSubject s1 = EventSubject.getSubject(EventSubjectTest.class, "MySubject");
-        Assert.assertFalse(s1.equals(null));
+        assertFalse(s1.equals(null));
     }
 
     // TODO: (Andrus) This test can not be run reliably and in fact consistently

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/event/JGroupsBridgeFactoryTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/event/JGroupsBridgeFactoryTest.java b/cayenne-server/src/test/java/org/apache/cayenne/event/JGroupsBridgeFactoryTest.java
index 686fb3d..3a6b6c1 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/event/JGroupsBridgeFactoryTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/event/JGroupsBridgeFactoryTest.java
@@ -19,15 +19,18 @@
 
 package org.apache.cayenne.event;
 
+import org.junit.Test;
+
 import java.util.Collection;
 import java.util.Collections;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.*;
 
 /**
  */
-public class JGroupsBridgeFactoryTest extends TestCase {
+public class JGroupsBridgeFactoryTest {
 
+    @Test
     public void testCreateEventBridge() throws Exception {
         Collection subjects = Collections.singleton(new EventSubject("test"));
         EventBridge bridge = new JavaGroupsBridgeFactory().createEventBridge(

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/event/XMPPBridgeFactoryTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/event/XMPPBridgeFactoryTest.java b/cayenne-server/src/test/java/org/apache/cayenne/event/XMPPBridgeFactoryTest.java
index af6a696..4eac54a 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/event/XMPPBridgeFactoryTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/event/XMPPBridgeFactoryTest.java
@@ -19,15 +19,19 @@
 
 package org.apache.cayenne.event;
 
+import org.junit.Test;
+
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
-public class XMPPBridgeFactoryTest extends TestCase {
+public class XMPPBridgeFactoryTest {
 
+    @Test
     public void testCreateEventBridge() {
         XMPPBridgeFactory factory = new XMPPBridgeFactory();
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/event/XMPPBridgeTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/event/XMPPBridgeTest.java b/cayenne-server/src/test/java/org/apache/cayenne/event/XMPPBridgeTest.java
index 310828c..d3d0a80 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/event/XMPPBridgeTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/event/XMPPBridgeTest.java
@@ -19,15 +19,21 @@
 
 package org.apache.cayenne.event;
 
+import org.junit.Test;
+
 import java.util.HashMap;
 import java.util.Map;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
 /**
  */
-public class XMPPBridgeTest extends TestCase {
+public class XMPPBridgeTest {
 
+    @Test
     public void testEventSerialization() throws Exception {
         Map info = new HashMap();
         info.put("a", "b");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/exp/BooleanExpressionTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/exp/BooleanExpressionTest.java b/cayenne-server/src/test/java/org/apache/cayenne/exp/BooleanExpressionTest.java
index db76731..a305cf9 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/exp/BooleanExpressionTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/exp/BooleanExpressionTest.java
@@ -18,11 +18,15 @@
  ****************************************************************/
 package org.apache.cayenne.exp;
 
-import junit.framework.TestCase;
-
 import org.apache.cayenne.testdo.testmap.BooleanTestEntity;
+import org.junit.Test;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+public class BooleanExpressionTest {
 
-public class BooleanExpressionTest extends TestCase {
+    @Test
     public void testCAY1185() {
         Expression expTrue = Expression.fromString("booleanColumn = true");
         Expression expFalse = Expression.fromString("booleanColumn = false");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/exp/ExpressionEqualsTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/exp/ExpressionEqualsTest.java b/cayenne-server/src/test/java/org/apache/cayenne/exp/ExpressionEqualsTest.java
index 89af885..39ee644 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/exp/ExpressionEqualsTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/exp/ExpressionEqualsTest.java
@@ -19,12 +19,16 @@
 
 package org.apache.cayenne.exp;
 
-import junit.framework.TestCase;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 
 /**
  */
-public class ExpressionEqualsTest extends TestCase {
+public class ExpressionEqualsTest {
 
+    @Test
     public void testEquals3() throws Exception {
         Expression e1 = ExpressionFactory.matchExp("aa", "3");
         Expression e2 = ExpressionFactory.matchExp("aa", "3");
@@ -33,6 +37,7 @@ public class ExpressionEqualsTest extends TestCase {
         assertFalse(e2.equals(e3));
     }
 
+    @Test
     public void testEquals4() throws Exception {
         Expression e1 = ExpressionFactory.matchExp("aa", "3").andExp(
                 ExpressionFactory.matchExp("aa", "4"));

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/exp/ExpressionParameterTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/exp/ExpressionParameterTest.java b/cayenne-server/src/test/java/org/apache/cayenne/exp/ExpressionParameterTest.java
index 2b6752d..124952a 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/exp/ExpressionParameterTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/exp/ExpressionParameterTest.java
@@ -19,10 +19,13 @@
 
 package org.apache.cayenne.exp;
 
-import junit.framework.TestCase;
+import org.junit.Test;
 
-public class ExpressionParameterTest extends TestCase {
+import static org.junit.Assert.assertEquals;
 
+public class ExpressionParameterTest {
+
+    @Test
     public void testConstructor() throws Exception {
         ExpressionParameter p = new ExpressionParameter("abc");
         assertEquals("abc", p.getName());

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/exp/ExpressionTraversalTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/exp/ExpressionTraversalTest.java b/cayenne-server/src/test/java/org/apache/cayenne/exp/ExpressionTraversalTest.java
index 161effa..be442b7 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/exp/ExpressionTraversalTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/exp/ExpressionTraversalTest.java
@@ -19,25 +19,29 @@
 
 package org.apache.cayenne.exp;
 
-import junit.framework.TestCase;
+import org.junit.Before;
+import org.junit.Test;
 
-public class ExpressionTraversalTest extends TestCase {
+public class ExpressionTraversalTest {
 
     private TstTraversalHandler handler;
 
-    @Override
-    protected void setUp() throws Exception {
+    @Before
+    public void setUp() throws Exception {
         handler = new TstTraversalHandler();
     }
 
+    @Test
     public void testUnary() throws Exception {
         doExpressionTest(new TstUnaryExpSuite());
     }
 
+    @Test
     public void testBinary() throws Exception {
         doExpressionTest(new TstBinaryExpSuite());
     }
 
+    @Test
     public void testTernary() throws Exception {
         doExpressionTest(new TstTernaryExpSuite());
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/exp/PropertyTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/exp/PropertyTest.java b/cayenne-server/src/test/java/org/apache/cayenne/exp/PropertyTest.java
index 6bbd90d..7e262f9 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/exp/PropertyTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/exp/PropertyTest.java
@@ -18,17 +18,21 @@
  ****************************************************************/
 package org.apache.cayenne.exp;
 
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
 import org.apache.cayenne.reflect.TstJavaBean;
 import org.apache.cayenne.reflect.UnresolvablePathException;
 import org.apache.cayenne.util.Util;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
-public class PropertyTest extends TestCase {
+public class PropertyTest {
 
+    @Test
     public void testIn() {
         Property<String> p = new Property<String>("x.y");
 
@@ -41,14 +45,16 @@ public class PropertyTest extends TestCase {
         Expression e3 = p.in(Arrays.asList("a", "b"));
         assertEquals("x.y in (\"a\", \"b\")", e3.toString());
     }
-    
+
+    @Test
     public void testGetFrom() {
     	TstJavaBean bean = new TstJavaBean();
     	bean.setIntField(7);
     	final Property<Integer> INT_FIELD = new Property<Integer>("intField");
     	assertEquals(Integer.valueOf(7), INT_FIELD.getFrom(bean));
     }
-    
+
+    @Test
     public void testGetFromNestedProperty() {
     	TstJavaBean bean = new TstJavaBean();
     	TstJavaBean nestedBean = new TstJavaBean();
@@ -57,7 +63,8 @@ public class PropertyTest extends TestCase {
     	final Property<Integer> OBJECT_FIELD_INT_FIELD = new Property<Integer>("objectField.intField");
     	assertEquals(Integer.valueOf(7), OBJECT_FIELD_INT_FIELD.getFrom(bean));
     }
-    
+
+    @Test
     public void testGetFromNestedNull() {
     	TstJavaBean bean = new TstJavaBean();
     	bean.setObjectField(null);
@@ -72,7 +79,8 @@ public class PropertyTest extends TestCase {
     		}
     	}
     }
-    
+
+    @Test
     public void testGetFromAll() {
     	TstJavaBean bean = new TstJavaBean();
     	bean.setIntField(7);
@@ -85,14 +93,16 @@ public class PropertyTest extends TestCase {
     	final Property<Integer> INT_FIELD = new Property<Integer>("intField");
     	assertEquals(Arrays.asList(7, 8), INT_FIELD.getFromAll(beans));
     }
-    
+
+    @Test
     public void testSetIn() {
     	TstJavaBean bean = new TstJavaBean();
     	final Property<Integer> INT_FIELD = new Property<Integer>("intField");
     	INT_FIELD.setIn(bean, 7);
     	assertEquals(7, bean.getIntField());
     }
-    
+
+    @Test
     public void testSetInNestedProperty() {
     	TstJavaBean bean = new TstJavaBean();
     	bean.setObjectField(new TstJavaBean());
@@ -102,7 +112,8 @@ public class PropertyTest extends TestCase {
     	OBJECT_FIELD_INT_FIELD.setIn(bean, 7);
     	assertEquals(7, ((TstJavaBean)bean.getObjectField()).getIntField());
     }
-    
+
+    @Test
     public void testSetInNestedNull() {
     	TstJavaBean bean = new TstJavaBean();
     	bean.setObjectField(null);
@@ -117,7 +128,8 @@ public class PropertyTest extends TestCase {
     		}
     	}
     }
-    
+
+    @Test
     public void testSetInAll() {
     	TstJavaBean bean = new TstJavaBean();
     	TstJavaBean bean2 = new TstJavaBean();
@@ -128,7 +140,8 @@ public class PropertyTest extends TestCase {
     	assertEquals(7, bean.getIntField());
     	assertEquals(7, bean2.getIntField());
     }
-    
+
+    @Test
     public void testEquals() {
     	final Property<Integer> INT_FIELD = new Property<Integer>("intField");
     	final Property<Integer> INT_FIELD2 = new Property<Integer>("intField");
@@ -136,7 +149,8 @@ public class PropertyTest extends TestCase {
     	assertTrue(INT_FIELD != INT_FIELD2);
     	assertTrue(INT_FIELD.equals(INT_FIELD2));
     }
-    
+
+    @Test
     public void testHashCode() {
     	final Property<Integer> INT_FIELD  = new Property<Integer>("intField");
     	final Property<Integer> INT_FIELD2 = new Property<Integer>("intField");
@@ -145,7 +159,8 @@ public class PropertyTest extends TestCase {
     	assertTrue(INT_FIELD.hashCode() == INT_FIELD2.hashCode());
     	assertTrue(INT_FIELD.hashCode() != LONG_FIELD.hashCode());
     }
-    
+
+    @Test
     public void testOuter() {
         Property<String> inner = new Property<String>("xyz");
         assertEquals("xyz+", inner.outer().getName());

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ASTDbPathTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ASTDbPathTest.java b/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ASTDbPathTest.java
index a43ba7d..e09f539 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ASTDbPathTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ASTDbPathTest.java
@@ -18,16 +18,20 @@
  ****************************************************************/
 package org.apache.cayenne.exp.parser;
 
+import org.junit.Test;
+
 import java.io.IOException;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
 
-public class ASTDbPathTest extends TestCase {
+public class ASTDbPathTest {
 
+    @Test
     public void testToString() {
         assertEquals("db:x.y", new ASTDbPath("x.y").toString());
     }
 
+    @Test
     public void testAppendAsString() throws IOException {
         StringBuilder buffer = new StringBuilder();
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ASTLikeIgnoreCaseTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ASTLikeIgnoreCaseTest.java b/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ASTLikeIgnoreCaseTest.java
index 4d3c156..713e7d8 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ASTLikeIgnoreCaseTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ASTLikeIgnoreCaseTest.java
@@ -18,12 +18,15 @@
  ****************************************************************/
 package org.apache.cayenne.exp.parser;
 
-import junit.framework.TestCase;
-
 import org.apache.cayenne.exp.Expression;
 import org.apache.cayenne.exp.ExpressionFactory;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class ASTLikeIgnoreCaseTest {
 
-public class ASTLikeIgnoreCaseTest extends TestCase {
+    @Test
     public void testToEJBQL() {
         Expression like = ExpressionFactory.likeIgnoreCaseExp("a", "%b%");
         assertEquals(like.toEJBQL("p"), "upper(p.a) like '%B%'");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ASTListTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ASTListTest.java b/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ASTListTest.java
index 280d728..c62c373 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ASTListTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ASTListTest.java
@@ -18,20 +18,21 @@
  ****************************************************************/
 package org.apache.cayenne.exp.parser;
 
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
+import org.apache.cayenne.ObjectId;
+import org.apache.cayenne.Persistent;
+import org.junit.Test;
 
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
-import junit.framework.TestCase;
-
-import org.apache.cayenne.ObjectId;
-import org.apache.cayenne.Persistent;
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
 
-public class ASTListTest extends TestCase {
+public class ASTListTest {
 
+    @Test
 	public void testConstructorWithCollection() {
 		ObjectId objectId = new ObjectId("Artist", "ARTIST_ID", 1);
 		Persistent artist = mock(Persistent.class);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ASTObjPathTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ASTObjPathTest.java b/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ASTObjPathTest.java
index 90ab24e..72df7f9 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ASTObjPathTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ASTObjPathTest.java
@@ -18,16 +18,20 @@
  ****************************************************************/
 package org.apache.cayenne.exp.parser;
 
+import org.junit.Test;
+
 import java.io.IOException;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
 
-public class ASTObjPathTest extends TestCase {
+public class ASTObjPathTest {
 
+    @Test
     public void testToString() {
         assertEquals("x.y", new ASTObjPath("x.y").toString());
     }
 
+    @Test
     public void testEncodeAsString() throws IOException {
         StringBuilder buffer = new StringBuilder();
         new ASTObjPath("x.y").appendAsString(buffer);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/EvaluatorTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/EvaluatorTest.java b/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/EvaluatorTest.java
index 4a1c51f..2ae24dc 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/EvaluatorTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/EvaluatorTest.java
@@ -18,20 +18,24 @@
  ****************************************************************/
 package org.apache.cayenne.exp.parser;
 
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
+import org.apache.cayenne.ObjectId;
+import org.apache.cayenne.Persistent;
+import org.junit.Test;
 
 import java.math.BigDecimal;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.cayenne.ObjectId;
-import org.apache.cayenne.Persistent;
-
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
 
-public class EvaluatorTest extends TestCase {
+public class EvaluatorTest {
 
+    @Test
     public void testEvaluator_Null() {
         Evaluator e = Evaluator.evaluator(null);
         assertNotNull(e);
@@ -39,6 +43,7 @@ public class EvaluatorTest extends TestCase {
         assertFalse(e.eq(null, new Object()));
     }
 
+    @Test
     public void testEvaluator_Object() {
         Object o = new Object();
         Evaluator e = Evaluator.evaluator(o);
@@ -47,6 +52,7 @@ public class EvaluatorTest extends TestCase {
         assertFalse(e.eq(o, null));
     }
 
+    @Test
     public void testEvaluator_Number() {
 
         Evaluator e = Evaluator.evaluator(1);
@@ -57,6 +63,7 @@ public class EvaluatorTest extends TestCase {
         assertFalse(e.eq(1, 1.1));
     }
 
+    @Test
     public void testEvaluator_BigDecimal() {
         Object lhs = new BigDecimal("1.10");
         Evaluator e = Evaluator.evaluator(lhs);
@@ -68,6 +75,7 @@ public class EvaluatorTest extends TestCase {
         assertEquals(-1, c.intValue());
     }
 
+    @Test
     public void testEvaluator_Persistent() {
 
         ObjectId lhsId = new ObjectId("X", "k", 3);
@@ -94,6 +102,7 @@ public class EvaluatorTest extends TestCase {
         assertFalse(e.eq(lhs, 4));
     }
 
+    @Test
     public void testEvaluator_Persistent_StringId() {
 
         ObjectId lhsId = new ObjectId("X", "k", "A");
@@ -120,6 +129,7 @@ public class EvaluatorTest extends TestCase {
         assertFalse(e.eq(lhs, "B"));
     }
 
+    @Test
     public void testEvaluator_Persistent_MultiKey() {
 
         Map<String, Object> lhsIdMap = new HashMap<String, Object>();

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/graph/GraphMapTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/graph/GraphMapTest.java b/cayenne-server/src/test/java/org/apache/cayenne/graph/GraphMapTest.java
index b488182..7487d37 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/graph/GraphMapTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/graph/GraphMapTest.java
@@ -19,12 +19,19 @@
 
 package org.apache.cayenne.graph;
 
+import org.junit.Test;
+
 import java.util.Collection;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
-public class GraphMapTest extends TestCase {
+public class GraphMapTest {
 
+    @Test
     public void testRegisterNode() {
         GraphMap map = new GraphMap();
         Object node = new Object();
@@ -33,6 +40,7 @@ public class GraphMapTest extends TestCase {
         assertSame(node, map.getNode("key"));
     }
 
+    @Test
     public void testRegisteredNodes() {
         GraphMap map = new GraphMap();
         Object n1 = new Object();

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/graph/NodeDiffTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/graph/NodeDiffTest.java b/cayenne-server/src/test/java/org/apache/cayenne/graph/NodeDiffTest.java
index 7f0d011..bc07819 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/graph/NodeDiffTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/graph/NodeDiffTest.java
@@ -19,16 +19,21 @@
 
 package org.apache.cayenne.graph;
 
-import junit.framework.TestCase;
+import org.junit.Test;
 
-public class NodeDiffTest extends TestCase {
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
 
+public class NodeDiffTest {
+
+    @Test
     public void testGetNodeId() {
         Object id = new Object();
         NodeDiff diff = new MockNodeDiff(id);
         assertSame(id, diff.getNodeId());
     }
 
+    @Test
     public void testCompareTo() {
         NodeDiff d1 = new MockNodeDiff("x", 1);
         NodeDiff d2 = new MockNodeDiff("y", 2);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/log/CommonsJdbcEventLoggerTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/log/CommonsJdbcEventLoggerTest.java b/cayenne-server/src/test/java/org/apache/cayenne/log/CommonsJdbcEventLoggerTest.java
index d1fb2f9..7e421df 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/log/CommonsJdbcEventLoggerTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/log/CommonsJdbcEventLoggerTest.java
@@ -18,15 +18,18 @@
  ****************************************************************/
 package org.apache.cayenne.log;
 
-import java.util.Collections;
-
-import junit.framework.TestCase;
-
 import org.apache.cayenne.configuration.DefaultRuntimeProperties;
 import org.apache.cayenne.util.IDUtil;
+import org.junit.Test;
+
+import java.util.Collections;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
-public class CommonsJdbcEventLoggerTest extends TestCase {
+public class CommonsJdbcEventLoggerTest {
 
+    @Test
     public void testSqlLiteralForObject() throws Exception {
         StringBuilder buf = new StringBuilder();
 
@@ -35,6 +38,7 @@ public class CommonsJdbcEventLoggerTest extends TestCase {
         assertTrue(buf.length() > 0);
     }
 
+    @Test
     public void testAppendFormattedByte() throws Exception {
         assertFormatting((byte) 0, "00");
         assertFormatting((byte) 1, "01");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/map/AttributeTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/map/AttributeTest.java b/cayenne-server/src/test/java/org/apache/cayenne/map/AttributeTest.java
index daaee6c..757c57c 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/map/AttributeTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/map/AttributeTest.java
@@ -19,10 +19,14 @@
 
 package org.apache.cayenne.map;
 
-import junit.framework.TestCase;
+import org.junit.Test;
 
-public class AttributeTest extends TestCase {
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertSame;
 
+public class AttributeTest {
+
+    @Test
     public void testName() throws Exception {
         Attribute a = new MockAttribute();
 
@@ -31,6 +35,7 @@ public class AttributeTest extends TestCase {
         assertEquals(tstName, a.getName());
     }
 
+    @Test
     public void testEntity() throws Exception {
         Attribute a = new MockAttribute();
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/map/CallbackDescriptorTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/map/CallbackDescriptorTest.java b/cayenne-server/src/test/java/org/apache/cayenne/map/CallbackDescriptorTest.java
index aba916a..42ab4e5 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/map/CallbackDescriptorTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/map/CallbackDescriptorTest.java
@@ -18,15 +18,19 @@
  ****************************************************************/
 package org.apache.cayenne.map;
 
-import junit.framework.TestCase;
+import org.junit.Test;
 
-public class CallbackDescriptorTest extends TestCase {
+import static org.junit.Assert.assertEquals;
 
+public class CallbackDescriptorTest {
+
+    @Test
     public void testConstructor() {
         CallbackDescriptor m = new CallbackDescriptor(LifecycleEvent.POST_LOAD);
         assertEquals(LifecycleEvent.POST_LOAD, m.getCallbackType());
     }
 
+    @Test
     public void testAddCallbackMethod() {
         CallbackDescriptor m = new CallbackDescriptor(LifecycleEvent.POST_ADD);
         assertEquals(0, m.getCallbackMethods().size());

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/map/CallbackMapTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/map/CallbackMapTest.java b/cayenne-server/src/test/java/org/apache/cayenne/map/CallbackMapTest.java
index 1bac225..ce69ca3 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/map/CallbackMapTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/map/CallbackMapTest.java
@@ -18,10 +18,13 @@
  ****************************************************************/
 package org.apache.cayenne.map;
 
-import junit.framework.TestCase;
+import org.junit.Test;
 
-public class CallbackMapTest extends TestCase {
+import static org.junit.Assert.assertEquals;
 
+public class CallbackMapTest {
+
+    @Test
     public void testGetCallbacks() {
         CallbackDescriptor[] callbacks = new CallbackMap().getCallbacks();
         assertEquals(LifecycleEvent.values().length, callbacks.length);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/map/ClientObjectRelationshipTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/map/ClientObjectRelationshipTest.java b/cayenne-server/src/test/java/org/apache/cayenne/map/ClientObjectRelationshipTest.java
index 35fbd4e..21b9be6 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/map/ClientObjectRelationshipTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/map/ClientObjectRelationshipTest.java
@@ -19,12 +19,15 @@
 
 package org.apache.cayenne.map;
 
-import junit.framework.TestCase;
-
 import org.apache.cayenne.util.Util;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
 
-public class ClientObjectRelationshipTest extends TestCase {
+public class ClientObjectRelationshipTest {
 
+    @Test
     public void testSerializability() throws Exception {
 
         ClientObjRelationship r1 = new ClientObjRelationship("r1", "rr1", true, true);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/map/DataMapNamespaceTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/map/DataMapNamespaceTest.java b/cayenne-server/src/test/java/org/apache/cayenne/map/DataMapNamespaceTest.java
index 0e2e966..042b0cc 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/map/DataMapNamespaceTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/map/DataMapNamespaceTest.java
@@ -19,25 +19,29 @@
 
 package org.apache.cayenne.map;
 
-import junit.framework.TestCase;
-
 import org.apache.cayenne.query.MockQuery;
 import org.apache.cayenne.query.Query;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
 
 /**
  * Test case for recursive lookup of DataMap resources via a parent
  * namespace.
  * 
  */
-public class DataMapNamespaceTest extends TestCase {
+public class DataMapNamespaceTest {
+
     protected DataMap map;
 
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
+    @Before
+    public void setUp() throws Exception {
         map = new DataMap();
     }
 
+    @Test
     public void testNamespace() {
         assertNull(map.getNamespace());
 
@@ -49,6 +53,7 @@ public class DataMapNamespaceTest extends TestCase {
         assertNull(map.getNamespace());
     }
 
+    @Test
     public void testGetDbEntity()  {
         MockMappingNamespace namespace = new MockMappingNamespace();
         map.setNamespace(namespace);
@@ -66,6 +71,7 @@ public class DataMapNamespaceTest extends TestCase {
         assertSame(e1, map.getDbEntity("entity"));
     }
 
+    @Test
     public void testGetObjEntity() throws Exception {
         MockMappingNamespace namespace = new MockMappingNamespace();
         map.setNamespace(namespace);
@@ -83,6 +89,7 @@ public class DataMapNamespaceTest extends TestCase {
         assertSame(e1, map.getObjEntity("entity"));
     }
 
+    @Test
     public void testGetProcedure() throws Exception {
         MockMappingNamespace namespace = new MockMappingNamespace();
         map.setNamespace(namespace);
@@ -100,6 +107,7 @@ public class DataMapNamespaceTest extends TestCase {
         assertSame(p1, map.getProcedure("procedure"));
     }
 
+    @Test
     public void testGetQuery() throws Exception {
         MockMappingNamespace namespace = new MockMappingNamespace();
         map.setNamespace(namespace);


Mime
View raw message