Author: ebourg
Date: Fri Jun 19 09:27:20 2009
New Revision: 786425
URL: http://svn.apache.org/viewvc?rev=786425&view=rev
Log:
Removed the unnecessary constructors and suite() methods from the tests
Modified:
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestCatalogResolver.java
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestConfigurationMap.java
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestConfigurationSet.java
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestDynamicCombinedConfiguration.java
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestMultiFileHierarchicalConfiguration.java
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestPatternSubtreeConfiguration.java
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/combined/TestDynamicCombinedConfiguration.java
Modified:
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestCatalogResolver.java
URL:
http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestCatalogResolver.java?rev=786425&r1=786424&r2=786425&view=diff
==============================================================================
---
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestCatalogResolver.java
(original)
+++
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestCatalogResolver.java
Fri Jun 19 09:27:20 2009
@@ -14,18 +14,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package org.apache.commons.configuration2;
import junit.framework.TestCase;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.apache.commons.logging.LogFactory;
-import org.apache.commons.logging.Log;
import org.apache.commons.configuration2.resolver.CatalogResolver;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
-/**
- *
- */
public class TestCatalogResolver extends TestCase
{
private static final String CATALOG_FILES =
"target/test-classes/catalog.xml";
@@ -36,24 +32,6 @@
private CatalogResolver resolver;
private XMLConfiguration config;
- /**
- * Create the test case
- *
- * @param testName name of the test case
- */
- public TestCatalogResolver(String testName)
- {
- super(testName);
- }
-
- /**
- * @return the suite of tests being tested
- */
- public static Test suite()
- {
- return new TestSuite(TestCatalogResolver.class);
- }
-
protected void setUp() throws Exception
{
resolver = new CatalogResolver();
Modified:
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestConfigurationMap.java
URL:
http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestConfigurationMap.java?rev=786425&r1=786424&r2=786425&view=diff
==============================================================================
---
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestConfigurationMap.java
(original)
+++
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestConfigurationMap.java
Fri Jun 19 09:27:20 2009
@@ -17,19 +17,14 @@
package org.apache.commons.configuration2;
-import org.apache.commons.configuration2.ConfigurationMap;
-import org.apache.commons.configuration2.flat.BaseConfiguration;
-
-import junit.framework.Test;
import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import org.apache.commons.configuration2.flat.BaseConfiguration;
/**
* @author <a href="mailto:[email protected]">Ricardo
Gladwell</a>
*/
public class TestConfigurationMap extends TestCase
{
-
ConfigurationMap map;
String[] properties = {
@@ -44,43 +39,28 @@
Object[] values = {
Boolean.TRUE,
- new Double(Double.MAX_VALUE),
- new Float(Float.MAX_VALUE),
- new Integer(Integer.MAX_VALUE),
- new Long(Long.MAX_VALUE),
- new Short(Short.MAX_VALUE),
+ Double.MAX_VALUE,
+ Float.MAX_VALUE,
+ Integer.MAX_VALUE,
+ Long.MAX_VALUE,
+ Short.MAX_VALUE,
"This is a string"
};
/**
- * Construct a new instance of this test case.
- * @param name Name of the test case
- */
- public TestConfigurationMap(String name)
- {
- super(name);
- }
-
- /**
* Set up instance variables required by this test case.
*/
public void setUp() throws Exception
{
BaseConfiguration configuration = new BaseConfiguration();
- for(int i = 0; i < properties.length ; i++)
+ for (int i = 0; i < properties.length; i++)
+ {
configuration.setProperty(properties[i], values[i]);
+ }
map = new ConfigurationMap(configuration);
}
/**
- * Return the tests included in this test suite.
- */
- public static Test suite()
- {
- return (new TestSuite(TestConfigurationMap.class));
- }
-
- /**
* Tear down instance variables required by this test case.
*/
public void tearDown()
@@ -93,13 +73,14 @@
*/
public void testPut()
{
- for(int i = 0; i < properties.length; i++) {
+ for (int i = 0; i < properties.length; i++)
+ {
Object object = map.put(properties[i], values[i]);
- assertNotNull("Returned null from put.",object);
- assertEquals("Returned wrong result.",values[i],object);
+ assertNotNull("Returned null from put.", object);
+ assertEquals("Returned wrong result.", values[i], object);
object = map.get(properties[i]);
- assertNotNull("Returned null from get.",object);
- assertEquals("Returned wrong result.",values[i],object);
+ assertNotNull("Returned null from get.", object);
+ assertEquals("Returned wrong result.", values[i], object);
}
}
Modified:
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestConfigurationSet.java
URL:
http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestConfigurationSet.java?rev=786425&r1=786424&r2=786425&view=diff
==============================================================================
---
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestConfigurationSet.java
(original)
+++
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestConfigurationSet.java
Fri Jun 19 09:27:20 2009
@@ -14,17 +14,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package org.apache.commons.configuration2;
import java.util.Iterator;
import java.util.Map;
-import org.apache.commons.configuration2.ConfigurationMap;
-import org.apache.commons.configuration2.flat.BaseConfiguration;
-
-import junit.framework.Test;
import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import org.apache.commons.configuration2.flat.BaseConfiguration;
/**
* @author rgladwel
@@ -45,24 +42,15 @@
Object[] values = {
Boolean.TRUE,
- new Double(Double.MAX_VALUE),
- new Float(Float.MAX_VALUE),
- new Integer(Integer.MAX_VALUE),
- new Long(Long.MAX_VALUE),
- new Short(Short.MAX_VALUE),
+ Double.MAX_VALUE,
+ Float.MAX_VALUE,
+ Integer.MAX_VALUE,
+ Long.MAX_VALUE,
+ Short.MAX_VALUE,
"This is a string"
};
/**
- * Construct a new instance of this test case.
- * @param name Name of the test case
- */
- public TestConfigurationSet(String name)
- {
- super(name);
- }
-
- /**
* Set up instance variables required by this test case.
*/
public void setUp() throws Exception
@@ -74,14 +62,6 @@
}
/**
- * Return the tests included in this test suite.
- */
- public static Test suite()
- {
- return (new TestSuite(TestConfigurationSet.class));
- }
-
- /**
* Tear down instance variables required by this test case.
*/
public void tearDown()
Modified:
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestDynamicCombinedConfiguration.java
URL:
http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestDynamicCombinedConfiguration.java?rev=786425&r1=786424&r2=786425&view=diff
==============================================================================
---
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestDynamicCombinedConfiguration.java
(original)
+++
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestDynamicCombinedConfiguration.java
Fri Jun 19 09:27:20 2009
@@ -14,14 +14,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.commons.configuration2;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+package org.apache.commons.configuration2;
import java.io.File;
+import junit.framework.TestCase;
+
/**
*
*/
@@ -31,24 +30,6 @@
private static String PATTERN1 =
"target/test-classes/testMultiConfiguration_${sys:Id}.xml";
private static String DEFAULT_FILE =
"target/test-classes/testMultiConfiguration_default.xml";
- /**
- * Create the test case
- *
- * @param testName name of the test case
- */
- public TestDynamicCombinedConfiguration( String testName )
- {
- super( testName );
- }
-
- /**
- * @return the suite of tests being tested
- */
- public static Test suite()
- {
- return new TestSuite( TestDynamicCombinedConfiguration.class );
- }
-
public void testConfiguration() throws Exception
{
DynamicCombinedConfiguration config = new
DynamicCombinedConfiguration();
Modified:
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestMultiFileHierarchicalConfiguration.java
URL:
http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestMultiFileHierarchicalConfiguration.java?rev=786425&r1=786424&r2=786425&view=diff
==============================================================================
---
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestMultiFileHierarchicalConfiguration.java
(original)
+++
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestMultiFileHierarchicalConfiguration.java
Fri Jun 19 09:27:20 2009
@@ -14,39 +14,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package org.apache.commons.configuration2;
-import junit.framework.Test;
import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
import
org.apache.commons.configuration2.reloading.FileChangedReloadingStrategy;
/**
* Unit test for simple MultiConfigurationTest.
*/
-public class TestMultiFileHierarchicalConfiguration
- extends TestCase
+public class TestMultiFileHierarchicalConfiguration extends TestCase
{
private static String PATTERN1 =
"target/test-classes/testMultiConfiguration_${sys:Id}.xml";
-
- /**
- * Create the test case
- *
- * @param testName name of the test case
- */
- public TestMultiFileHierarchicalConfiguration( String testName )
- {
- super( testName );
- }
-
- /**
- * @return the suite of tests being tested
- */
- public static Test suite()
- {
- return new TestSuite( TestMultiFileHierarchicalConfiguration.class );
- }
/**
* Rigourous Test :-)
Modified:
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestPatternSubtreeConfiguration.java
URL:
http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestPatternSubtreeConfiguration.java?rev=786425&r1=786424&r2=786425&view=diff
==============================================================================
---
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestPatternSubtreeConfiguration.java
(original)
+++
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestPatternSubtreeConfiguration.java
Fri Jun 19 09:27:20 2009
@@ -14,16 +14,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package org.apache.commons.configuration2;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import java.io.File;
-import
org.apache.commons.configuration2.reloading.FileChangedReloadingStrategy;
+import junit.framework.TestCase;
import org.apache.commons.configuration2.expr.xpath.XPathExpressionEngine;
-
-import java.io.File;
+import
org.apache.commons.configuration2.reloading.FileChangedReloadingStrategy;
/**
* Unit test for simple MultiConfigurationTest.
@@ -34,24 +32,6 @@
private static String PATTERN = "businessclie...@name='${sys:Id}']";
private XMLConfiguration conf;
- /**
- * Create the test case
- *
- * @param testName name of the test case
- */
- public TestPatternSubtreeConfiguration( String testName )
- {
- super( testName );
- }
-
- /**
- * @return the suite of tests being tested
- */
- public static Test suite() throws Exception
- {
- return new TestSuite(TestPatternSubtreeConfiguration.class );
- }
-
protected void setUp() throws Exception
{
conf = new XMLConfiguration();
@@ -81,4 +61,4 @@
System.setProperty("Id", "1003");
assertTrue(config.getInt("rowsPerPage") == 35);
}
-}
\ No newline at end of file
+}
Modified:
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/combined/TestDynamicCombinedConfiguration.java
URL:
http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/combined/TestDynamicCombinedConfiguration.java?rev=786425&r1=786424&r2=786425&view=diff
==============================================================================
---
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/combined/TestDynamicCombinedConfiguration.java
(original)
+++
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/combined/TestDynamicCombinedConfiguration.java
Fri Jun 19 09:27:20 2009
@@ -17,10 +17,7 @@
package org.apache.commons.configuration2.combined;
-import junit.framework.Test;
-import junit.framework.TestSuite;
import junit.framework.TestCase;
-import org.apache.commons.configuration2.combined.DynamicCombinedConfiguration;
import org.apache.commons.configuration2.MultiFileHierarchicalConfiguration;
import org.apache.commons.configuration2.XMLConfiguration;
@@ -30,24 +27,6 @@
private static String PATTERN1 =
"target/test-classes/testMultiConfiguration_${sys:Id}.xml";
private static String DEFAULT_FILE =
"target/test-classes/testMultiConfiguration_default.xml";
- /**
- * Create the test case
- *
- * @param testName name of the test case
- */
- public TestDynamicCombinedConfiguration( String testName )
- {
- super( testName );
- }
-
- /**
- * @return the suite of tests being tested
- */
- public static Test suite()
- {
- return new TestSuite( TestDynamicCombinedConfiguration.class );
- }
-
public void testConfiguration() throws Exception
{
DynamicCombinedConfiguration config = new
DynamicCombinedConfiguration();