You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by oh...@apache.org on 2011/12/29 22:11:03 UTC
svn commit: r1225658 -
/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/interpol/TestEnvironmentLookup.java
Author: oheger
Date: Thu Dec 29 21:11:03 2011
New Revision: 1225658
URL: http://svn.apache.org/viewvc?rev=1225658&view=rev
Log:
Converted tests to JUnit 4, fixed warnings.
Modified:
commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/interpol/TestEnvironmentLookup.java
Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/interpol/TestEnvironmentLookup.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/interpol/TestEnvironmentLookup.java?rev=1225658&r1=1225657&r2=1225658&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/interpol/TestEnvironmentLookup.java (original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/interpol/TestEnvironmentLookup.java Thu Dec 29 21:11:03 2011
@@ -16,11 +16,14 @@
*/
package org.apache.commons.configuration.interpol;
-import java.util.Iterator;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
-import junit.framework.TestCase;
+import java.util.Iterator;
import org.apache.commons.configuration.EnvironmentConfiguration;
+import org.junit.Before;
+import org.junit.Test;
/**
* Test class for EnvironmentLookup.
@@ -30,26 +33,27 @@ import org.apache.commons.configuration.
* Configuration team</a>
* @version $Id$
*/
-public class TestEnvironmentLookup extends TestCase
+public class TestEnvironmentLookup
{
/** The lookup to be tested. */
private EnvironmentLookup lookup;
- protected void setUp() throws Exception
+ @Before
+ public void setUp() throws Exception
{
- super.setUp();
lookup = new EnvironmentLookup();
}
/**
* Tests whether environment variables can be queried.
*/
+ @Test
public void testLookup()
{
EnvironmentConfiguration envConf = new EnvironmentConfiguration();
- for (Iterator it = envConf.getKeys(); it.hasNext();)
+ for (Iterator<String> it = envConf.getKeys(); it.hasNext();)
{
- String var = (String) it.next();
+ String var = it.next();
assertEquals("Wrong value for " + var, envConf.getString(var),
lookup.lookup(var));
}
@@ -58,6 +62,7 @@ public class TestEnvironmentLookup exten
/**
* Tries to lookup a non existing property.
*/
+ @Test
public void testLookupNonExisting()
{
assertNull("Got result for non existing environment variable", lookup