This is the mail archive of the mauve-patches@sourceware.org mailing list for the Mauve project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: New tests for gnu/testlet/javax/print/attribute/SetOfIntegerSyntax


Hi,

I added a few new tests for SetOfIntegerSyntax.

2005-11-19 Wolfgang Baer <WBaer@gmx.de>

	* gnu/testlet/javax/print/attribute/SetOfIntegerSyntax/Simple.java:
	Corrected tags to JDK1.4.	
	(test): Added new tests for contains, constructor and normalization.

Regards,
Wolfgang


Index: gnu/testlet/javax/print/attribute/SetOfIntegerSyntax/Simple.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/print/attribute/SetOfIntegerSyntax/Simple.java,v
retrieving revision 1.2
diff -u -r1.2 Simple.java
--- gnu/testlet/javax/print/attribute/SetOfIntegerSyntax/Simple.java	19 Nov 2005 10:12:37 -0000	1.2
+++ gnu/testlet/javax/print/attribute/SetOfIntegerSyntax/Simple.java	19 Nov 2005 10:19:12 -0000
@@ -19,7 +19,7 @@
 
 */
 
-// Tags: JDK1.2
+// Tags: JDK1.4
 
 
 package gnu.testlet.javax.print.attribute.SetOfIntegerSyntax;
@@ -107,5 +107,88 @@
     harness.check(range.toString(), "1-5");
     harness.check(rangeTwo.toString(), "1-5,10-12");
 
+    harness.checkPoint("contains");
+    harness.check(single.contains(5));
+    harness.check(range.contains(2));
+    harness.check(rangeTwo.contains(12));
+    harness.check(single.contains(6), false);
+    harness.check(range.contains(6), false);
+    harness.check(rangeTwo.contains(8), false);
+
+    harness.checkPoint("constructors");
+    try
+      {
+        new Simple((String) null);
+        harness.check(true);
+      }
+    catch (NullPointerException e)
+      {
+        harness.check(false);
+      }
+
+    try
+      {
+        new Simple((int[][]) null);
+        harness.check(true);
+      }
+    catch (NullPointerException e)
+      {
+        harness.check(false);
+      }
+
+    try
+      {
+        new Simple(new int[][] { { 1, 5 }, null });
+        harness.check(false);
+      }
+    catch (NullPointerException e)
+      {
+        harness.check(true);
+      }
+
+    try
+      {
+        new Simple(new int[][] { null });
+        harness.check(false);
+      }
+    catch (NullPointerException e)
+      {
+        harness.check(true);
+      }
+
+    try
+      {
+        new Simple(new int[][] { { 1, 2, 3 } });
+        harness.check(false);
+      }
+    catch (IllegalArgumentException e)
+      {
+        harness.check(true);
+      }
+
+    try
+      {
+        new Simple(new int[][] { { -1, 2 } });
+        harness.check(false);
+      }
+    catch (IllegalArgumentException e)
+      {
+        harness.check(true);
+      }
+
+    try
+      {
+        new Simple(14, 12);
+        harness.check(true);
+      }
+    catch (NullPointerException e)
+      {
+        harness.check(false);
+      }
+
+    harness.checkPoint("normalization");
+    harness.check(new Simple("17- 99,1:3,12").toString(), "1-3,12,17-99");
+    harness.check(new Simple("17- 99,19-20,14-18").toString(), "14-99");
+
   }
 }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]