cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject [1/5] Apply JUnit4 instead of JUnit3 in cayenne-server
Date Sun, 02 Nov 2014 07:22:12 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master 5043aeb29 -> 4fb3e9e7e


http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/remote/service/BaseRemoteServiceTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/remote/service/BaseRemoteServiceTest.java
b/cayenne-server/src/test/java/org/apache/cayenne/remote/service/BaseRemoteServiceTest.java
index 0bafe51..c1703be 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/remote/service/BaseRemoteServiceTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/remote/service/BaseRemoteServiceTest.java
@@ -18,11 +18,6 @@
  ****************************************************************/
 package org.apache.cayenne.remote.service;
 
-import java.util.HashMap;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.DataChannel;
 import org.apache.cayenne.ObjectContext;
@@ -33,9 +28,18 @@ import org.apache.cayenne.query.Query;
 import org.apache.cayenne.remote.QueryMessage;
 import org.apache.cayenne.remote.RemoteSession;
 import org.apache.cayenne.util.Util;
+import org.junit.Test;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.fail;
 
-public class BaseRemoteServiceTest extends TestCase {
+public class BaseRemoteServiceTest {
 
+    @Test
     public void testConstructor() throws Exception {
 
         Map<String, String> map = new HashMap<String, String>();
@@ -76,6 +80,7 @@ public class BaseRemoteServiceTest extends TestCase {
 
     }
 
+    @Test
     public void testProcessMessageExceptionSerializability() throws Throwable {
 
         Map<String, String> map = new HashMap<String, String>();

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/remote/service/DispatchHelperTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/remote/service/DispatchHelperTest.java
b/cayenne-server/src/test/java/org/apache/cayenne/remote/service/DispatchHelperTest.java
index f4cd1b2..e4b01fe 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/remote/service/DispatchHelperTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/remote/service/DispatchHelperTest.java
@@ -19,17 +19,20 @@
 
 package org.apache.cayenne.remote.service;
 
-import static org.mockito.Mockito.mock;
-import junit.framework.TestCase;
-
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.MockDataChannel;
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.remote.BootstrapMessage;
 import org.apache.cayenne.remote.ClientMessage;
+import org.junit.Test;
+
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.fail;
+import static org.mockito.Mockito.mock;
 
-public class DispatchHelperTest extends TestCase {
+public class DispatchHelperTest {
 
+    @Test
     public void testBootstrapMessage() {
         EntityResolver resolver = new EntityResolver();
         MockDataChannel channel = new MockDataChannel(resolver);
@@ -38,6 +41,7 @@ public class DispatchHelperTest extends TestCase {
                 new BootstrapMessage()));
     }
 
+    @Test
     public void testUnknownMessage() {
         try {
             DispatchHelper.dispatch(new MockDataChannel(), mock(ClientMessage.class));

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/resource/ClassLoaderResourceLocatorTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/resource/ClassLoaderResourceLocatorTest.java
b/cayenne-server/src/test/java/org/apache/cayenne/resource/ClassLoaderResourceLocatorTest.java
index 3796695..6ef1800 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/resource/ClassLoaderResourceLocatorTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/resource/ClassLoaderResourceLocatorTest.java
@@ -18,14 +18,18 @@
  ****************************************************************/
 package org.apache.cayenne.resource;
 
-import java.util.Collection;
+import org.apache.cayenne.di.spi.DefaultClassLoaderManager;
+import org.junit.Test;
 
-import junit.framework.TestCase;
+import java.util.Collection;
 
-import org.apache.cayenne.di.spi.DefaultClassLoaderManager;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
-public class ClassLoaderResourceLocatorTest extends TestCase {
+public class ClassLoaderResourceLocatorTest {
 
+    @Test
     public void testFindResources() {
         ClassLoaderResourceLocator locator = new ClassLoaderResourceLocator(new DefaultClassLoaderManager());
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/resource/FilesystemResourceLocatorTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/resource/FilesystemResourceLocatorTest.java
b/cayenne-server/src/test/java/org/apache/cayenne/resource/FilesystemResourceLocatorTest.java
index 69e11c1..bdbeaad 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/resource/FilesystemResourceLocatorTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/resource/FilesystemResourceLocatorTest.java
@@ -18,18 +18,21 @@
  ****************************************************************/
 package org.apache.cayenne.resource;
 
+import org.apache.cayenne.test.file.FileUtil;
+import org.junit.Test;
+
 import java.io.File;
 import java.io.FileOutputStream;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 
-import junit.framework.TestCase;
-
-import org.apache.cayenne.test.file.FileUtil;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
 
-public class FilesystemResourceLocatorTest extends TestCase {
+public class FilesystemResourceLocatorTest {
 
+    @Test
     public void testArrayConstructor() {
         FilesystemResourceLocator l1 = new FilesystemResourceLocator();
         assertEquals(1, l1.roots.length);
@@ -45,6 +48,7 @@ public class FilesystemResourceLocatorTest extends TestCase {
         assertEquals(new File(base, "f2"), l2.roots[1]);
     }
 
+    @Test
     public void testCollectionConstructor() {
         FilesystemResourceLocator l1 = new FilesystemResourceLocator(Collections
                 .<File> emptyList());
@@ -62,6 +66,7 @@ public class FilesystemResourceLocatorTest extends TestCase {
         assertEquals(new File(base, "f2"), l2.roots[1]);
     }
 
+    @Test
     public void testFindResources() throws Exception {
 
         File base = new File(FileUtil.baseTestDirectory(), getClass().getName());

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/resource/URLResourceTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/resource/URLResourceTest.java
b/cayenne-server/src/test/java/org/apache/cayenne/resource/URLResourceTest.java
index 627dac9..388f2c8 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/resource/URLResourceTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/resource/URLResourceTest.java
@@ -18,21 +18,24 @@
  ****************************************************************/
 package org.apache.cayenne.resource;
 
-import java.net.URL;
+import org.junit.Test;
 
-import org.apache.cayenne.resource.Resource;
-import org.apache.cayenne.resource.URLResource;
+import java.net.URL;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertSame;
 
-public class URLResourceTest extends TestCase {
+public class URLResourceTest {
 
+    @Test
     public void testURL() throws Exception {
         URL url = new URL("http://cayenne.apache.org");
         URLResource resource = new URLResource(url);
         assertSame(url, resource.getURL());
     }
 
+    @Test
     public void testGetRelativeResource() throws Exception {
         URL url = new URL("http://cayenne.apache.org");
         URLResource resource = new URLResource(url);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/unit/jira/CAY_10062004_ExpTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/unit/jira/CAY_10062004_ExpTest.java
b/cayenne-server/src/test/java/org/apache/cayenne/unit/jira/CAY_10062004_ExpTest.java
index c9bf727..b5195e6 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/unit/jira/CAY_10062004_ExpTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/unit/jira/CAY_10062004_ExpTest.java
@@ -19,14 +19,16 @@
 
 package org.apache.cayenne.unit.jira;
 
-import junit.framework.TestCase;
-
 import org.apache.cayenne.exp.Expression;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
 
 /**
  */
-public class CAY_10062004_ExpTest extends TestCase {
+public class CAY_10062004_ExpTest {
 
+    @Test
     public void testDeepCopy() throws Exception {
 
         Expression parsed = Expression
@@ -37,6 +39,7 @@ public class CAY_10062004_ExpTest extends TestCase {
         assertEquals(parsed.toString(), finalExpression.toString());
     }
 
+    @Test
     public void testAndExpOrExp() throws Exception {
 
         Expression parsed = Expression

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/unit/jira/CAY_743Test.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/unit/jira/CAY_743Test.java b/cayenne-server/src/test/java/org/apache/cayenne/unit/jira/CAY_743Test.java
index f9b8e81..ffea9c6 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/unit/jira/CAY_743Test.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/unit/jira/CAY_743Test.java
@@ -18,17 +18,20 @@
  ****************************************************************/
 package org.apache.cayenne.unit.jira;
 
-import junit.framework.TestCase;
-
 import org.apache.cayenne.access.DataDomain;
 import org.apache.cayenne.configuration.server.ServerModule;
 import org.apache.cayenne.di.DIBootstrap;
 import org.apache.cayenne.di.Injector;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.ObjEntity;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertSame;
 
-public class CAY_743Test extends TestCase {
+public class CAY_743Test {
 
+    @Test
     public void testLoad2MapsWithCrossMapInheritance() throws Exception {
 
         Injector injector = DIBootstrap.createInjector(new ServerModule(

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/util/Base64CodecTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/util/Base64CodecTest.java b/cayenne-server/src/test/java/org/apache/cayenne/util/Base64CodecTest.java
index aebb944..492652a 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/util/Base64CodecTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/util/Base64CodecTest.java
@@ -19,22 +19,26 @@
 
 package org.apache.cayenne.util;
 
+import org.junit.Test;
+
 import java.util.Arrays;
 import java.util.Random;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 /**
  * <i>Just like Base64 codec, this test case is borrowed from Apache.</i>
  * 
  */
-public class Base64CodecTest extends TestCase {
+public class Base64CodecTest {
 
     private Random _random = new Random();
 
     /**
      * Test the Base64 implementation
      */
+    @Test
     public void testBase64() {
         String content = "Hello World";
         String encodedContent;
@@ -45,6 +49,7 @@ public class Base64CodecTest extends TestCase {
     /**
      * Tests conditional true branch for "marker0" test.
      */
+    @Test
     public void testDecodePadMarkerIndex2() {
         assertEquals("A", new String(Base64Codec.decodeBase64("QQ==".getBytes())));
     }
@@ -52,22 +57,26 @@ public class Base64CodecTest extends TestCase {
     /**
      * Tests conditional branches for "marker1" test.
      */
+    @Test
     public void testDecodePadMarkerIndex3() {
         assertEquals("AA", new String(Base64Codec.decodeBase64("QUE=".getBytes())));
         assertEquals("AAA", new String(Base64Codec.decodeBase64("QUFB".getBytes())));
     }
 
+    @Test
     public void testDecodePadOnly() {
         assertTrue(Base64Codec.decodeBase64("====".getBytes()).length == 0);
         assertEquals("", new String(Base64Codec.decodeBase64("====".getBytes())));
     }
 
+    @Test
     public void testDecodePadOnlyChunked() {
         assertTrue(Base64Codec.decodeBase64("====\n".getBytes()).length == 0);
         assertEquals("", new String(Base64Codec.decodeBase64("====\n".getBytes())));
     }
 
     // encode/decode random arrays from size 0 to size 11
+    @Test
     public void testEncodeDecodeSmall() {
         for (int i = 0; i < 12; i++) {
             byte[] data = new byte[i];
@@ -83,6 +92,7 @@ public class Base64CodecTest extends TestCase {
     }
 
     // encode/decode a large random array
+    @Test
     public void testEncodeDecodeRandom() {
         for (int i = 1; i < 5; i++) {
             byte[] data = new byte[this.getRandom().nextInt(10000) + 1];
@@ -97,6 +107,7 @@ public class Base64CodecTest extends TestCase {
     /**
      * Tests RFC 2045 section 2.1 CRLF definition.
      */
+    @Test
     public void testRfc2045Section2Dot1CrLfDefinition() {
         assertTrue(Arrays.equals(new byte[] {
                 13, 10
@@ -106,10 +117,12 @@ public class Base64CodecTest extends TestCase {
     /**
      * Tests RFC 2045 section 6.8 chuck size definition.
      */
+    @Test
     public void testRfc2045Section6Dot8ChunkSizeDefinition() {
         assertEquals(76, Base64Codec.CHUNK_SIZE);
     }
 
+    @Test
     public void testSingletons() {
         assertEquals("AA==", new String(Base64Codec.encodeBase64(new byte[] {
             (byte) 0
@@ -428,6 +441,7 @@ public class Base64CodecTest extends TestCase {
         })));
     }
 
+    @Test
     public void testSingletonsChunked() {
         assertEquals("AA==\r\n", new String(Base64Codec.encodeBase64Chunked(new byte[] {
             (byte) 0
@@ -746,6 +760,7 @@ public class Base64CodecTest extends TestCase {
         })));
     }
 
+    @Test
     public void testTriplets() {
         assertEquals("AAAA", new String(Base64Codec.encodeBase64(new byte[] {
                 (byte) 0, (byte) 0, (byte) 0
@@ -941,6 +956,7 @@ public class Base64CodecTest extends TestCase {
         })));
     }
 
+    @Test
     public void testTripletsChunked() {
         assertEquals("AAAA\r\n", new String(Base64Codec.encodeBase64Chunked(new byte[] {
                 (byte) 0, (byte) 0, (byte) 0
@@ -1136,6 +1152,7 @@ public class Base64CodecTest extends TestCase {
         })));
     }
 
+    @Test
     public void testKnownEncodings() {
         assertEquals(
                 "VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wZWQgb3ZlciB0aGUgbGF6eSBkb2dzLg==",
@@ -1171,6 +1188,7 @@ public class Base64CodecTest extends TestCase {
                 new String(Base64Codec.encodeBase64("xyzzy!".getBytes())));
     }
 
+    @Test
     public void testKnownDecodings() {
         assertEquals(
                 "The quick brown fox jumped over the lazy dogs.",
@@ -1200,6 +1218,7 @@ public class Base64CodecTest extends TestCase {
                 new String(Base64Codec.decodeBase64("eHl6enkh".getBytes())));
     }
 
+    @Test
     public void testIgnoringNonBase64InDecode() throws Exception {
         assertEquals(
                 "The quick brown fox jumped over the lazy dogs.",
@@ -1209,6 +1228,7 @@ public class Base64CodecTest extends TestCase {
                                         .getBytes())));
     }
 
+    @Test
     public void testDecodeWithWhitespace() throws Exception {
 
         String orig = "I am a late night coder.";
@@ -1229,6 +1249,7 @@ public class Base64CodecTest extends TestCase {
         assertTrue("Dest string doesn't equals the original", dest.equals(orig));
     }
 
+    @Test
     public void testDiscardWhitespace() throws Exception {
 
         String orig = "I am a late night coder.";

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/util/GenericResponseTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/util/GenericResponseTest.java
b/cayenne-server/src/test/java/org/apache/cayenne/util/GenericResponseTest.java
index be77718..fe12ca7 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/util/GenericResponseTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/util/GenericResponseTest.java
@@ -19,14 +19,20 @@
 
 package org.apache.cayenne.util;
 
+import org.junit.Test;
+
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 
-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;
 
-public class GenericResponseTest extends TestCase {
+public class GenericResponseTest {
 
+    @Test
     public void testCreation() throws Exception {
         List list = new ArrayList();
         list.add(new HashMap());
@@ -52,6 +58,7 @@ public class GenericResponseTest extends TestCase {
         assertFalse(r.next());
     }
 
+    @Test
     public void testSerialization() throws Exception {
         List list = new ArrayList();
         list.add(new HashMap());

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/util/IDUtilTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/util/IDUtilTest.java b/cayenne-server/src/test/java/org/apache/cayenne/util/IDUtilTest.java
index 72feb9b..a00ea41 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/util/IDUtilTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/util/IDUtilTest.java
@@ -20,14 +20,18 @@
 
 package org.apache.cayenne.util;
 
-import junit.framework.TestCase;
-
 import org.apache.cayenne.access.types.ByteArrayTypeTest;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
 
 /**
  */
-public class IDUtilTest extends TestCase {
+public class IDUtilTest {
 
+    @Test
     public void testPseudoUniqueByteSequence1() throws Exception {
         try {
             IDUtil.pseudoUniqueByteSequence(10);
@@ -37,6 +41,7 @@ public class IDUtilTest extends TestCase {
         }
     }
 
+    @Test
     public void testPseudoUniqueByteSequence2() throws Exception {
         byte[] byte16 = IDUtil.pseudoUniqueByteSequence(16);
         assertNotNull(byte16);
@@ -52,6 +57,7 @@ public class IDUtilTest extends TestCase {
         }
     }
 
+    @Test
     public void testPseudoUniqueByteSequence3() throws Exception {
         byte[] byte17 = IDUtil.pseudoUniqueByteSequence(17);
         assertNotNull(byte17);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/util/IndexPropertyListTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/util/IndexPropertyListTest.java
b/cayenne-server/src/test/java/org/apache/cayenne/util/IndexPropertyListTest.java
index 9e6d63d..803ac1f 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/util/IndexPropertyListTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/util/IndexPropertyListTest.java
@@ -19,14 +19,18 @@
 
 package org.apache.cayenne.util;
 
+import org.junit.Test;
+
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
-public class IndexPropertyListTest extends TestCase {
+public class IndexPropertyListTest {
 
+    @Test
     public void testSort() {
 
         IndexedObject o1 = new IndexedObject(1);
@@ -55,6 +59,7 @@ public class IndexPropertyListTest extends TestCase {
         assertEquals(o1, indexedUnsortedList.get(3));
     }
 
+    @Test
     public void testAppend() {
         IndexedObject o1 = new IndexedObject(1);
         IndexedObject o2 = new IndexedObject(2);
@@ -72,6 +77,7 @@ public class IndexPropertyListTest extends TestCase {
         assertTrue(o4.getOrder() < o5.getOrder());
     }
 
+    @Test
     public void testInsert() {
         IndexedObject o1 = new IndexedObject(1);
         IndexedObject o2 = new IndexedObject(2);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/util/InvocationTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/util/InvocationTest.java b/cayenne-server/src/test/java/org/apache/cayenne/util/InvocationTest.java
index 016a520..e5f9d33 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/util/InvocationTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/util/InvocationTest.java
@@ -20,59 +20,71 @@
 
 package org.apache.cayenne.util;
 
+import org.junit.Test;
+
 import java.util.HashSet;
 import java.util.Set;
 
-import junit.framework.Assert;
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
-public class InvocationTest extends TestCase {
-	private String _methodName = "myListenerMethod";
+public class InvocationTest {
+	
+    private String _methodName = "myListenerMethod";
 
+    @Test
 	public void testEqualsReflexive() throws NoSuchMethodException {
 		Invocation inv0 = new Invocation(this, _methodName);		
 
-		Assert.assertEquals(inv0, inv0);
+		assertEquals(inv0, inv0);
 	}
 
+    @Test
 	public void testEqualsSymmetric() throws NoSuchMethodException {
 		Invocation inv01 = new Invocation(this, _methodName);
 		Invocation inv02 = new Invocation(this, _methodName);
 		
-		Assert.assertEquals(inv01, inv02);
-		Assert.assertEquals(inv02, inv01);
+		assertEquals(inv01, inv02);
+		assertEquals(inv02, inv01);
 	}
 
+    @Test
 	public void testEqualsTransitive() throws NoSuchMethodException {
 		Invocation inv01 = new Invocation(this, _methodName);
 		Invocation inv02 = new Invocation(this, _methodName);
 		Invocation inv03 = new Invocation(this, _methodName);
 		
-		Assert.assertEquals(inv01, inv02);
-		Assert.assertEquals(inv02, inv03);
-		Assert.assertEquals(inv01, inv03);
+		assertEquals(inv01, inv02);
+		assertEquals(inv02, inv03);
+		assertEquals(inv01, inv03);
 	}
 
+    @Test
 	public void testEqualsNull() throws NoSuchMethodException {
 		Invocation inv0 = new Invocation(this, _methodName);
 
-		Assert.assertTrue(inv0.equals(null) == false);
+		assertTrue(inv0.equals(null) == false);
 	}
 
+    @Test
 	public void testEqualsDifferentMethods() throws NoSuchMethodException  {
 		Invocation inv0 = new Invocation(this, _methodName);
 		Invocation inv1 = new Invocation(this, _methodName, new Class[]{Object.class});
 
-		Assert.assertTrue(inv0.equals(inv1) == false);
+		assertTrue(inv0.equals(inv1) == false);
 	}
 
+    @Test
 	public void testEqualsNoVsOneArg() throws NoSuchMethodException {
 		Invocation inv0 = new Invocation(this, _methodName);
 		Invocation inv1 = new Invocation(this, _methodName, new Class[]{Object.class});
 
-		Assert.assertTrue(inv0.equals(inv1) == false);
+		assertTrue(inv0.equals(inv1) == false);
 	}
 
+    @Test
 	public void testAddToSet() throws NoSuchMethodException {
 		HashSet set = new HashSet();
 		
@@ -81,9 +93,10 @@ public class InvocationTest extends TestCase {
 		set.add(inv0);
 		set.add(inv0);
 
-		Assert.assertEquals(1, set.size());
+		assertEquals(1, set.size());
 	}
 
+    @Test
 	public void testAddTwo() throws NoSuchMethodException {
 		Set set = new HashSet();
 		
@@ -93,57 +106,63 @@ public class InvocationTest extends TestCase {
 		set.add(inv01);
 		set.add(inv02);
 
-		Assert.assertEquals(1, set.size());
+		assertEquals(1, set.size());
 	}
 
+    @Test
 	public void testEmptyParamTypes() throws NoSuchMethodException {
 		try {
 			new Invocation(this, _methodName, new Class[]{});
-			Assert.fail();
+			fail();
 		}
 		catch (IllegalArgumentException ex) {
 			// expected
 		}
 	}
 
+    @Test
 	public void testNullParamTypes0() throws NoSuchMethodException {
 		try {
 			new Invocation(this, _methodName, new Class[]{null});
-			Assert.fail();
+			fail();
 		}
 		catch (IllegalArgumentException ex) {
 			// expected
 		}
 	}
 
+    @Test
 	public void testNullParamTypes1() throws NoSuchMethodException {
 		try {
 			new Invocation(this, _methodName, new Class[]{String.class, null});
-			Assert.fail();
+			fail();
 		}
 		catch (IllegalArgumentException ex) {
 			// expected
 		}
 	}
 
+    @Test
 	public void testFireNoArgument() throws NoSuchMethodException {
 		Invocation inv0 = new Invocation(this, _methodName);
 
-		Assert.assertTrue(inv0.fire());
+		assertTrue(inv0.fire());
 	}
 
+    @Test
 	public void testFireOneArgument() throws NoSuchMethodException {
 		Invocation inv1 = new Invocation(this, _methodName, new Class[]{Object.class});
 
-		Assert.assertTrue(inv1.fire("foo"));
+		assertTrue(inv1.fire("foo"));
 	}
 
+    @Test
 	public void testFireWrongArgumentCount0() throws Exception {
 		Invocation inv0 = new Invocation(this, _methodName);
 
 		try {
 			inv0.fire("foo");
-			Assert.fail();
+			fail();
 		}
 
 		catch (IllegalArgumentException ex) {
@@ -151,12 +170,13 @@ public class InvocationTest extends TestCase {
 		}
 	}
 
+    @Test
 	public void testFireWrongArgumentCount1() throws Exception {
 		Invocation inv1 = new Invocation(this, _methodName, new Class[]{Object.class});
 
 		try {
 			inv1.fire();
-			Assert.fail();
+			fail();
 		}
 
 		catch (IllegalArgumentException ex) {
@@ -164,12 +184,13 @@ public class InvocationTest extends TestCase {
 		}
 	}
 
+    @Test
 	public void testFireWrongArgumentCount2() throws Exception {
 		Invocation inv1 = new Invocation(this, _methodName, new Class[]{Object.class});
 
 		try {
 			inv1.fire(new Object[]{"foo", "bar"});
-			Assert.fail();
+			fail();
 		}
 
 		catch (IllegalArgumentException ex) {
@@ -177,12 +198,13 @@ public class InvocationTest extends TestCase {
 		}
 	}
 
+    @Test
 	public void testFireNullArgArray() throws Exception {
 		Invocation inv1 = new Invocation(this, _methodName, new Class[]{Object.class});
 
 		try {
 			inv1.fire(null);
-			Assert.fail();
+			fail();
 		}
 
 		catch (IllegalArgumentException ex) {
@@ -190,6 +212,7 @@ public class InvocationTest extends TestCase {
 		}
 	}
 
+    @Test
 	public void testGarbageCollection() throws NoSuchMethodException {
 		// create an invocation with an listener that will be garbage collected
 		Invocation inv0 = new Invocation(new String(), "toString");
@@ -198,7 +221,7 @@ public class InvocationTest extends TestCase {
 		System.gc();
 		System.gc();
 
-		Assert.assertFalse(inv0.fire());
+		assertFalse(inv0.fire());
 	}
 
 	

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/util/ListResponseTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/util/ListResponseTest.java b/cayenne-server/src/test/java/org/apache/cayenne/util/ListResponseTest.java
index 9f2c35b..1c35160 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/util/ListResponseTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/util/ListResponseTest.java
@@ -19,12 +19,19 @@
 
 package org.apache.cayenne.util;
 
+import org.junit.Test;
+
 import java.util.List;
 
-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.assertSame;
+import static org.junit.Assert.assertTrue;
 
-public class ListResponseTest extends TestCase {
+public class ListResponseTest {
 
+    @Test
     public void testCreation() throws Exception {
 
         Object object = new Object();
@@ -47,6 +54,7 @@ public class ListResponseTest extends TestCase {
         assertSame(currentList, r.firstList());
     }
 
+    @Test
     public void testSerialization() throws Exception {
 
         ListResponse r = new ListResponse(new Integer(67));

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/util/NameConverterTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/util/NameConverterTest.java b/cayenne-server/src/test/java/org/apache/cayenne/util/NameConverterTest.java
index bcb53d6..61b7e5f 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/util/NameConverterTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/util/NameConverterTest.java
@@ -19,11 +19,14 @@
 
 package org.apache.cayenne.util;
 
-import junit.framework.TestCase;
 import org.apache.cayenne.map.naming.NameConverter;
+import org.junit.Test;
 
-public class NameConverterTest extends TestCase {
+import static org.junit.Assert.assertEquals;
 
+public class NameConverterTest {
+
+    @Test
     public void testUnderscoredToJava1() throws Exception {
         String expected = "ClassNameIdentifier";
         assertEquals(expected, NameConverter.underscoredToJava(
@@ -31,6 +34,7 @@ public class NameConverterTest extends TestCase {
                 true));
     }
 
+    @Test
     public void testUnderscoredToJava2() throws Exception {
         String expected = "propNameIdentifier123";
         assertEquals(expected, NameConverter.underscoredToJava(
@@ -38,62 +42,75 @@ public class NameConverterTest extends TestCase {
                 false));
     }
 
+    @Test
     public void testUnderscoredToJava3() throws Exception {
         String expected = "lastName";
         assertEquals(expected, NameConverter.underscoredToJava("lastName", false));
     }
 
+    @Test
     public void testUnderscoredToJava4() throws Exception {
         String expected = "lastName";
         assertEquals(expected, NameConverter.underscoredToJava("LastName", false));
     }
 
+    @Test
     public void testUnderscoredToJava5() throws Exception {
         String expected = "LastName";
         assertEquals(expected, NameConverter.underscoredToJava("LastName", true));
     }
 
+    @Test
     public void testUnderscoredToJavaSpecialChars() throws Exception {
         assertEquals("ABCpoundXyz", NameConverter.underscoredToJava("ABC#_XYZ", true));
     }
 
+    @Test
     public void testJavaToUnderscored1() throws Exception {
         String expected = "LAST_NAME";
         assertEquals(expected, NameConverter.javaToUnderscored("LastName"));
     }
 
+    @Test
     public void testJavaToUnderscored2() throws Exception {
         String expected = "A_CLASS";
         assertEquals(expected, NameConverter.javaToUnderscored("aClass"));
     }
 
+    @Test
     public void testJavaToUnderscored3() throws Exception {
         String expected = "VAR_A";
         assertEquals(expected, NameConverter.javaToUnderscored("varA"));
     }
 
+    @Test
     public void testJavaToUnderscored4() throws Exception {
         String expected = "LAST_NAME";
         assertEquals(expected, NameConverter.javaToUnderscored("LAST_NAME"));
     }
 
+    @Test
     public void testJavaToUnderscored5() throws Exception {
         String expected = "ABC_A";
         assertEquals(expected, NameConverter.javaToUnderscored("abc_A"));
     }
 
+    @Test
     public void testJavaToUnderscored6() throws Exception {
         String expected = "A123";
         assertEquals(expected, NameConverter.javaToUnderscored("a123"));
     }
 
+    @Test
     public void testJavaToUnderscored7() throws Exception {
         String expected = "AB_CDEF";
         assertEquals(expected, NameConverter.javaToUnderscored("abCDEF"));
     }
 
+    @Test
     public void testJavaToUnderscored8() throws Exception {
         String expected = "AB_CE";
         assertEquals(expected, NameConverter.javaToUnderscored("abCe"));
     }
+
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/util/PersistentObjectHolderTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/util/PersistentObjectHolderTest.java
b/cayenne-server/src/test/java/org/apache/cayenne/util/PersistentObjectHolderTest.java
index 6ff87ad..ca9080b 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/util/PersistentObjectHolderTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/util/PersistentObjectHolderTest.java
@@ -19,16 +19,21 @@
 
 package org.apache.cayenne.util;
 
-import static org.mockito.Mockito.mock;
-import junit.framework.TestCase;
-
 import org.apache.cayenne.ObjectContext;
 import org.apache.cayenne.PersistenceState;
 import org.apache.cayenne.testdo.mt.ClientMtTable1;
 import org.apache.cayenne.testdo.mt.ClientMtTable2;
+import org.junit.Test;
+
+import static org.junit.Assert.assertFalse;
+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 PersistentObjectHolderTest extends TestCase {
+public class PersistentObjectHolderTest {
 
+    @Test
     public void testSetInitialValue() {
 
         ObjectContext context = mock(ObjectContext.class);
@@ -47,6 +52,7 @@ public class PersistentObjectHolderTest extends TestCase {
         assertSame(o1, holder.value);
     }
 
+    @Test
     public void testInvalidate() {
         ObjectContext context = mock(ObjectContext.class);
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/util/RegexUtilTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/util/RegexUtilTest.java b/cayenne-server/src/test/java/org/apache/cayenne/util/RegexUtilTest.java
index f3620bd..3bb9a2e 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/util/RegexUtilTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/util/RegexUtilTest.java
@@ -19,10 +19,15 @@
 
 package org.apache.cayenne.util;
 
-import junit.framework.TestCase;
+import org.junit.Test;
 
-public class RegexUtilTest extends TestCase {
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
+public class RegexUtilTest {
+
+    @Test
     public void testSubstBackslashes() {
         assertTrue(RegexUtil.BACKSLASH.matcher("\\").find());
         assertTrue(RegexUtil.BACKSLASH.matcher("abc\\").find());
@@ -37,6 +42,7 @@ public class RegexUtilTest extends TestCase {
         assertEquals("/ab/c", RegexUtil.substBackslashes("\\ab\\c"));
     }
 
+    @Test
     public void testGetPackagePath() {
         assertTrue(RegexUtil.DOT.matcher(".").find());
         assertTrue(RegexUtil.DOT.matcher("abc.aa.aa").find());

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/util/UtilTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/util/UtilTest.java b/cayenne-server/src/test/java/org/apache/cayenne/util/UtilTest.java
index d4c3fb5..40e3d4b 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/util/UtilTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/util/UtilTest.java
@@ -19,22 +19,30 @@
 
 package org.apache.cayenne.util;
 
+import org.apache.cayenne.CayenneException;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
 import java.io.File;
 import java.io.FileWriter;
 import java.util.Map;
 
-import junit.framework.TestCase;
-
-import org.apache.cayenne.CayenneException;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
-public class UtilTest extends TestCase {
+public class UtilTest {
 
     private File fTmpFileInCurrentDir;
     private String fTmpFileName;
     private File fTmpFileCopy;
 
-    @Override
-    protected void setUp() throws Exception {
+    @Before
+    public void setUp() throws Exception {
         fTmpFileName = "." + File.separator + System.currentTimeMillis() + ".tmp";
 
         fTmpFileInCurrentDir = new File(fTmpFileName);
@@ -47,8 +55,8 @@ public class UtilTest extends TestCase {
         fTmpFileCopy = new File(fTmpFileName + ".copy");
     }
 
-    @Override
-    protected void tearDown() throws Exception {
+    @After
+    public void tearDown() throws Exception {
         if (!fTmpFileInCurrentDir.delete())
             throw new Exception("Error deleting temporary file: " + fTmpFileInCurrentDir);
 
@@ -57,6 +65,7 @@ public class UtilTest extends TestCase {
 
     }
 
+    @Test
     public void testGetJavaClass() throws Exception {
         assertEquals(byte.class.getName(), Util.getJavaClass("byte").getName());
         assertEquals(byte[].class.getName(), Util.getJavaClass("byte[]").getName());
@@ -68,6 +77,7 @@ public class UtilTest extends TestCase {
                 Util.getJavaClass(getClass().getName() + "[]").getName());
     }
 
+    @Test
     public void testToMap() {
         Object[] keys = new Object[] {
                 "a", "b"
@@ -102,6 +112,7 @@ public class UtilTest extends TestCase {
         }
     }
 
+    @Test
     public void testStripLineBreaks() {
 
         // no breaks
@@ -121,6 +132,7 @@ public class UtilTest extends TestCase {
         assertEquals("aCbCc", Util.stripLineBreaks("a\nb\nc", 'C'));
     }
 
+    @Test
     public void testCloneViaSerialization() throws Exception {
         // need a special subclass of Object to make "clone" method public
         MockSerializable o1 = new MockSerializable();
@@ -129,11 +141,13 @@ public class UtilTest extends TestCase {
         assertTrue(o1 != o2);
     }
 
+    @Test
     public void testPackagePath1() throws Exception {
         String expectedPath = "org/apache/cayenne/util";
         assertEquals(expectedPath, Util.getPackagePath(UtilTest.class.getName()));
     }
 
+    @Test
     public void testPackagePath2() throws Exception {
         // inner class
         class TmpTest extends Object {
@@ -143,28 +157,34 @@ public class UtilTest extends TestCase {
         assertEquals(expectedPath, Util.getPackagePath(TmpTest.class.getName()));
     }
 
+    @Test
     public void testPackagePath3() throws Exception {
         assertEquals("", Util.getPackagePath("ClassWithNoPackage"));
     }
 
+    @Test
     public void testIsEmptyString1() throws Exception {
         assertTrue(Util.isEmptyString(""));
     }
 
+    @Test
     public void testIsEmptyString2() throws Exception {
         assertFalse(Util.isEmptyString("  "));
     }
 
+    @Test
     public void testIsEmptyString3() throws Exception {
         assertTrue(Util.isEmptyString(null));
     }
 
+    @Test
     public void testBackslashFix() throws Exception {
         String strBefore = "abcd\\12345\\";
         String strAfter = "abcd/12345/";
         assertEquals(strAfter, Util.substBackslashes(strBefore));
     }
 
+    @Test
     public void testNullSafeEquals() throws Exception {
         // need a special subclass of Object to make "clone" method public
         class CloneableObject implements Cloneable {
@@ -199,67 +219,80 @@ public class UtilTest extends TestCase {
         assertTrue(Util.nullSafeEquals(null, null));
     }
 
+    @Test
     public void testExtractFileExtension1() throws Exception {
         String fullName = "n.ext";
         assertEquals("ext", Util.extractFileExtension(fullName));
     }
 
+    @Test
     public void testExtractFileExtension2() throws Exception {
         String fullName = "n";
         assertNull(Util.extractFileExtension(fullName));
     }
 
+    @Test
     public void testExtractFileExtension3() throws Exception {
         String fullName = ".ext";
         assertNull(Util.extractFileExtension(fullName));
     }
 
+    @Test
     public void testStripFileExtension1() throws Exception {
         String fullName = "n.ext";
         assertEquals("n", Util.stripFileExtension(fullName));
     }
 
+    @Test
     public void testStripFileExtension2() throws Exception {
         String fullName = "n";
         assertEquals("n", Util.stripFileExtension(fullName));
     }
 
+    @Test
     public void testStripFileExtension3() throws Exception {
         String fullName = ".ext";
         assertEquals(".ext", Util.stripFileExtension(fullName));
     }
 
+    @Test
     public void testEncodeXmlAttribute1() throws Exception {
         String unencoded = "normalstring";
         assertEquals(unencoded, Util.encodeXmlAttribute(unencoded));
     }
 
+    @Test
     public void testEncodeXmlAttribute2() throws Exception {
         String unencoded = "<a>";
         assertEquals("&lt;a&gt;", Util.encodeXmlAttribute(unencoded));
     }
 
+    @Test
     public void testEncodeXmlAttribute3() throws Exception {
         String unencoded = "a&b";
         assertEquals("a&amp;b", Util.encodeXmlAttribute(unencoded));
     }
 
+    @Test
     public void testUnwindException1() throws Exception {
         Throwable e = new Throwable();
         assertSame(e, Util.unwindException(e));
     }
 
+    @Test
     public void testUnwindException2() throws Exception {
         CayenneException e = new CayenneException();
         assertSame(e, Util.unwindException(e));
     }
 
+    @Test
     public void testUnwindException3() throws Exception {
         Throwable root = new Throwable();
         CayenneException e = new CayenneException(root);
         assertSame(root, Util.unwindException(e));
     }
 
+    @Test
     public void testPrettyTrim1() throws Exception {
         // size is too short, must throw
         try {
@@ -270,6 +303,7 @@ public class UtilTest extends TestCase {
         }
     }
 
+    @Test
     public void testPrettyTrim2() throws Exception {
         assertEquals("123", Util.prettyTrim("123", 6));
         assertEquals("123456", Util.prettyTrim("123456", 6));

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/util/concurrentlinkedhashmap/ConcurrentLinkedHashMapTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/util/concurrentlinkedhashmap/ConcurrentLinkedHashMapTest.java
b/cayenne-server/src/test/java/org/apache/cayenne/util/concurrentlinkedhashmap/ConcurrentLinkedHashMapTest.java
index b6365ef..9b84b9f 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/util/concurrentlinkedhashmap/ConcurrentLinkedHashMapTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/util/concurrentlinkedhashmap/ConcurrentLinkedHashMapTest.java
@@ -18,10 +18,14 @@
  ****************************************************************/
 package org.apache.cayenne.util.concurrentlinkedhashmap;
 
-import junit.framework.TestCase;
+import org.junit.Test;
 
-public class ConcurrentLinkedHashMapTest extends TestCase {
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
 
+public class ConcurrentLinkedHashMapTest {
+
+    @Test
     public void testPutGet() {
         ConcurrentLinkedHashMap<String, Object> m = new ConcurrentLinkedHashMap.Builder<String,
Object>()
                 .maximumWeightedCapacity(10)
@@ -38,6 +42,7 @@ public class ConcurrentLinkedHashMapTest extends TestCase {
         assertEquals(200, m.get("k2"));
     }
 
+    @Test
     public void testLRU() {
         ConcurrentLinkedHashMap<String, Object> m = new ConcurrentLinkedHashMap.Builder<String,
Object>()
                 .maximumWeightedCapacity(5)

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/validation/BeanValidationFailureTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/validation/BeanValidationFailureTest.java
b/cayenne-server/src/test/java/org/apache/cayenne/validation/BeanValidationFailureTest.java
index 9328f3c..91c40dd 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/validation/BeanValidationFailureTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/validation/BeanValidationFailureTest.java
@@ -19,10 +19,14 @@
 
 package org.apache.cayenne.validation;
 
-import junit.framework.TestCase;
+import org.junit.Test;
 
-public class BeanValidationFailureTest extends TestCase {
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
 
+public class BeanValidationFailureTest {
+
+    @Test
     public void testValidateJavaClassName() {
 
         Object source = new Object();

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/validation/ValidationExceptionTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/validation/ValidationExceptionTest.java
b/cayenne-server/src/test/java/org/apache/cayenne/validation/ValidationExceptionTest.java
index 45bb60e..f765bae 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/validation/ValidationExceptionTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/validation/ValidationExceptionTest.java
@@ -18,11 +18,14 @@
  ****************************************************************/
 package org.apache.cayenne.validation;
 
-import junit.framework.TestCase;
+import org.junit.Test;
 
+import static org.junit.Assert.assertTrue;
 
-public class ValidationExceptionTest extends TestCase {
 
+public class ValidationExceptionTest {
+
+    @Test
     public void testValidationExceptionValidationResult() {
         ValidationResult valResult = new ValidationResult();
         String message = "Error message with a % literal (should be escaped)";

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f6640dd9/cayenne-server/src/test/java/org/apache/cayenne/validation/ValidationResultTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/validation/ValidationResultTest.java
b/cayenne-server/src/test/java/org/apache/cayenne/validation/ValidationResultTest.java
index 56d5161..dc266aa 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/validation/ValidationResultTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/validation/ValidationResultTest.java
@@ -19,24 +19,29 @@
 
 package org.apache.cayenne.validation;
 
-import junit.framework.TestCase;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 /**
  */
-public class ValidationResultTest extends TestCase {
+public class ValidationResultTest {
 
     private ValidationResult res;
 
     private Object obj1;
     private Object obj2;
 
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
+    @Before
+    public void setUp() throws Exception {
         obj1 = new Object();
         obj2 = new Object();
     }
 
+    @Test
     public void testHasFailures() {
         res = new ValidationResult();
         res.addFailure(new BeanValidationFailure(obj1, "obj1 1", "mes obj1 1"));
@@ -45,6 +50,7 @@ public class ValidationResultTest extends TestCase {
         assertFalse(res.hasFailures(obj2));
     }
 
+    @Test
     public void testGetFailures() {
         res = new ValidationResult();
         res.addFailure(new BeanValidationFailure(obj1, "obj1 1", "mes obj1 1"));
@@ -56,6 +62,7 @@ public class ValidationResultTest extends TestCase {
         assertEquals(3, res.getFailures().size());
     }
 
+    @Test
     public void testEmpty() {
         res = new ValidationResult();
         assertFalse(res.hasFailures());


Mime
View raw message