/[Apache-SVN]/jakarta/commons/proper/resources/trunk/src/test/org/apache/commons/resources/impl/BasicMessageTestCase.java
ViewVC logotype

Diff of /jakarta/commons/proper/resources/trunk/src/test/org/apache/commons/resources/impl/BasicMessageTestCase.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- jakarta/commons/proper/resources/trunk/src/test/org/apache/commons/resources/impl/BasicMessageTestCase.java	2005/05/13 18:31:02	170066
+++ jakarta/commons/proper/resources/trunk/src/test/org/apache/commons/resources/impl/BasicMessageTestCase.java	2005/05/13 18:32:13	170067
@@ -38,6 +38,8 @@ public class BasicMessageTestCase extend
     
     protected BasicMessage amWithOneValue = null;
     
+    protected BasicMessage amWithMultipleValues = null;
+    
     /**
      * Defines the testcase name for JUnit.
      *
@@ -70,6 +72,9 @@ public class BasicMessageTestCase extend
         amWithNoValue = new BasicMessage("amWithNoValue");
         amWithOneValue =
             new BasicMessage("amWithOneValue", new String("stringValue"));
+        amWithMultipleValues =
+            new BasicMessage("amWithOneValue", 
+					new String[]{"stringValue1", "stringValue2", "stringValue3"});
     }
 
     public void tearDown() {
@@ -77,6 +82,8 @@ public class BasicMessageTestCase extend
     }
     
     public void testBasicMessageWithNoValue() {
+		
+		
         assertTrue(
             "testBasicMessageWithNoValue value is not null",
             amWithNoValue.getValues() == null);
@@ -84,6 +91,13 @@ public class BasicMessageTestCase extend
         assertTrue(
             "testBasicMessageWithNoValue key is not amWithNoValue",
             amWithNoValue.getKey() == "amWithNoValue");
+		
+		amWithNoValue = new BasicMessage();
+
+        assertNull(
+	            "testBasicMessageWithNoValue value is not null",
+	            amWithNoValue.getValues());
+		
     }
 
     public void testBasicMessageWithAStringValue() {
@@ -99,5 +113,11 @@ public class BasicMessageTestCase extend
         assertTrue(
             "testBasicMessageWithAStringValue key is not amWithOneValue",
             amWithOneValue.getKey() == "amWithOneValue");
+		
+		assertEquals("Test toString", amWithOneValue.toString(), "amWithOneValue[stringValue]");
+		
+		assertEquals("Test toString() (multiple)", 
+				amWithMultipleValues.toString(), "amWithOneValue[stringValue1, stringValue2, stringValue3]");
+		
     }
 }
\ No newline at end of file

 

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26