commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r1226097 - /commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/tree/TestNodeAddData.java
Date Sat, 31 Dec 2011 15:16:03 GMT
Author: oheger
Date: Sat Dec 31 15:16:02 2011
New Revision: 1226097

URL: http://svn.apache.org/viewvc?rev=1226097&view=rev
Log:
Converted tests to JUnit 4, fixed warnings.

Modified:
    commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/tree/TestNodeAddData.java

Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/tree/TestNodeAddData.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/tree/TestNodeAddData.java?rev=1226097&r1=1226096&r2=1226097&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/tree/TestNodeAddData.java
(original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/tree/TestNodeAddData.java
Sat Dec 31 15:16:02 2011
@@ -16,16 +16,26 @@
  */
 package org.apache.commons.configuration.tree;
 
+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 java.util.List;
 
-import junit.framework.TestCase;
+import org.junit.Before;
+import org.junit.Test;
 
 /**
  * Test class for NodeAddData.
  *
- * @author Oliver Heger
+ * @author <a
+ * href="http://commons.apache.org/configuration/team-list.html">Commons
+ * Configuration team</a>
+ * @version $Id$
  */
-public class TestNodeAddData extends TestCase
+public class TestNodeAddData
 {
     /** Constant for the default parent node used for testing. */
     private static final ConfigurationNode TEST_PARENT = new DefaultConfigurationNode(
@@ -43,15 +53,16 @@ public class TestNodeAddData extends Tes
     /** The object to be tested. */
     NodeAddData addData;
 
-    protected void setUp() throws Exception
+    @Before
+    public void setUp() throws Exception
     {
-        super.setUp();
         addData = new NodeAddData(TEST_PARENT, TEST_NODENAME);
     }
 
     /**
-     * Tests the default values of an unitialized instance.
+     * Tests the default values of an uninitialized instance.
      */
+    @Test
     public void testUninitialized()
     {
         addData = new NodeAddData();
@@ -64,6 +75,7 @@ public class TestNodeAddData extends Tes
     /**
      * Tests the constructor that initializes the most important fields.
      */
+    @Test
     public void testInitialized()
     {
         assertSame("Wrong parent", TEST_PARENT, addData.getParent());
@@ -75,6 +87,7 @@ public class TestNodeAddData extends Tes
     /**
      * Tests adding path nodes.
      */
+    @Test
     public void testAddPathNode()
     {
         for (int i = 0; i < PATH_NODE_COUNT; i++)
@@ -82,7 +95,7 @@ public class TestNodeAddData extends Tes
             addData.addPathNode(PATH_NODE_NAME + i);
         }
 
-        List nodes = addData.getPathNodes();
+        List<String> nodes = addData.getPathNodes();
         assertEquals("Incorrect number of path nodes", PATH_NODE_COUNT, nodes
                 .size());
         for (int i = 0; i < PATH_NODE_COUNT; i++)



Mime
View raw message