commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r1225642 - /commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/beanutils/TestDefaultBeanFactory.java
Date Thu, 29 Dec 2011 20:31:38 GMT
Author: oheger
Date: Thu Dec 29 20:31:38 2011
New Revision: 1225642

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

Modified:
    commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/beanutils/TestDefaultBeanFactory.java

Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/beanutils/TestDefaultBeanFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/beanutils/TestDefaultBeanFactory.java?rev=1225642&r1=1225641&r2=1225642&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/beanutils/TestDefaultBeanFactory.java
(original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/beanutils/TestDefaultBeanFactory.java
Thu Dec 29 20:31:38 2011
@@ -16,34 +16,42 @@
  */
 package org.apache.commons.configuration.beanutils;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
 import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.commons.configuration.PropertiesConfiguration;
-
-import junit.framework.TestCase;
+import org.junit.Before;
+import org.junit.Test;
 
 /**
  * Test class for DefaultBeanFactory.
  *
  * @since 1.3
- * @author Oliver Heger
+ * @author <a
+ * href="http://commons.apache.org/configuration/team-list.html">Commons
+ * Configuration team</a>
  * @version $Id$
  */
-public class TestDefaultBeanFactory extends TestCase
+public class TestDefaultBeanFactory
 {
     /** The object to be tested. */
     DefaultBeanFactory factory;
 
-    protected void setUp() throws Exception
+    @Before
+    public void setUp() throws Exception
     {
-        super.setUp();
         factory = new DefaultBeanFactory();
     }
 
     /**
      * Tests obtaining the default class. This should be null.
      */
+    @Test
     public void testGetDefaultBeanClass()
     {
         assertNull("Default class is not null", factory.getDefaultBeanClass());
@@ -52,6 +60,7 @@ public class TestDefaultBeanFactory exte
     /**
      * Tests creating a bean.
      */
+    @Test
     public void testCreateBean() throws Exception
     {
         Object bean = factory.createBean(PropertiesConfiguration.class,
@@ -84,14 +93,14 @@ public class TestDefaultBeanFactory exte
             return null;
         }
 
-        public Map getBeanProperties()
+        public Map<String, Object> getBeanProperties()
         {
-            Map props = new HashMap();
+            Map<String, Object> props = new HashMap<String, Object>();
             props.put("throwExceptionOnMissing", Boolean.TRUE);
             return props;
         }
 
-        public Map getNestedBeanDeclarations()
+        public Map<String, Object> getNestedBeanDeclarations()
         {
             return null;
         }



Mime
View raw message