commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ep...@apache.org
Subject cvs commit: jakarta-commons-sandbox/configuration/src/test-cactus/org/apache/commons/configuration TestJNDIEnvironmentValues.java
Date Sat, 22 Mar 2003 05:19:01 GMT
epugh       2003/03/21 21:19:01

  Modified:    configuration/src/test-cactus/org/apache/commons/configuration
                        TestJNDIEnvironmentValues.java
  Log:
  Updated test case, shouldn't have been throwing an exception.
  
  Revision  Changes    Path
  1.2       +50 -47    jakarta-commons-sandbox/configuration/src/test-cactus/org/apache/commons/configuration/TestJNDIEnvironmentValues.java
  
  Index: TestJNDIEnvironmentValues.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/configuration/src/test-cactus/org/apache/commons/configuration/TestJNDIEnvironmentValues.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestJNDIEnvironmentValues.java	28 Feb 2003 20:28:08 -0000	1.1
  +++ TestJNDIEnvironmentValues.java	22 Mar 2003 05:19:01 -0000	1.2
  @@ -58,52 +58,55 @@
   
   import org.apache.cactus.ServletTestCase;
   
  -public class TestJNDIEnvironmentValues extends ServletTestCase {
  -	public TestJNDIEnvironmentValues(String testName) {
  -		super(testName);
  -	}
  -
  -	public void testSimpleGet() throws Exception {
  -		JNDIConfiguration conf = new JNDIConfiguration();
  -		conf.setPrefix("java:comp/env");
  -		String s = conf.getString("test/key");
  -		assertEquals("jndivalue", s);
  -	}
  -
  -	public void testSimpleGet2() throws Exception {
  -		JNDIConfiguration conf = new JNDIConfiguration();
  -		conf.setPrefix("java:comp");
  -		String s = conf.getString("env/test/key");
  -		assertEquals("jndivalue", s);
  -	}
  -
  -	public void testMoreGets() throws Exception {
  -		JNDIConfiguration conf = new JNDIConfiguration();
  -		conf.setPrefix("java:comp/env");
  -		String s = conf.getString("test/key");
  -		assertEquals("jndivalue", s);
  -		assertEquals("jndivalue2", conf.getString("test.key2"));
  -		assertEquals("80", conf.getString("test.short"));
  -	}
  -
  -	public void testGetMissingKey() throws Exception {
  -		JNDIConfiguration conf = new JNDIConfiguration();
  -		conf.setPrefix("java:comp/env");
  -		try {
  -
  -			String s = conf.getString("test/imaginarykey");
  -			fail("Should have caused a java.util.NoSuchElementException");
  -		} catch (java.util.NoSuchElementException nsee) {
  -
  -		}
  -	}
  -	public void testContainsKey() throws Exception {
  -		JNDIConfiguration conf = new JNDIConfiguration();
  -		conf.setPrefix("java:comp/env");
  -
  -		assertTrue(conf.containsKey("test/key"));
  -		
  -		assertFalse(conf.containsKey("test/imaginerykey"));
  +public class TestJNDIEnvironmentValues extends ServletTestCase
  +{
  +    public TestJNDIEnvironmentValues(String testName)
  +    {
  +        super(testName);
  +    }
  +
  +    public void testSimpleGet() throws Exception
  +    {
  +        JNDIConfiguration conf = new JNDIConfiguration();
  +        conf.setPrefix("java:comp/env");
  +        String s = conf.getString("test/key");
  +        assertEquals("jndivalue", s);
  +    }
  +
  +    public void testSimpleGet2() throws Exception
  +    {
  +        JNDIConfiguration conf = new JNDIConfiguration();
  +        conf.setPrefix("java:comp");
  +        String s = conf.getString("env/test/key");
  +        assertEquals("jndivalue", s);
  +    }
  +
  +    public void testMoreGets() throws Exception
  +    {
  +        JNDIConfiguration conf = new JNDIConfiguration();
  +        conf.setPrefix("java:comp/env");
  +        String s = conf.getString("test/key");
  +        assertEquals("jndivalue", s);
  +        assertEquals("jndivalue2", conf.getString("test.key2"));
  +        assertEquals("80", conf.getString("test.short"));
  +    }
  +
  +    public void testGetMissingKey() throws Exception
  +    {
  +        JNDIConfiguration conf = new JNDIConfiguration();
  +        conf.setPrefix("java:comp/env");
  +
  +        assertNull(conf.getString("test/imaginarykey"));
  +
  +    }
  +    public void testContainsKey() throws Exception
  +    {
  +        JNDIConfiguration conf = new JNDIConfiguration();
  +        conf.setPrefix("java:comp/env");
   
  -	}
  +        assertTrue(conf.containsKey("test/key"));
  +
  +        assertFalse(conf.containsKey("test/imaginerykey"));
  +
  +    }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message