You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by js...@apache.org on 2005/05/07 01:00:00 UTC

svn commit: r168979 - /incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ConstraintTest.java

Author: jsong
Date: Fri May  6 16:00:00 2005
New Revision: 168979

URL: http://svn.apache.org/viewcvs?rev=168979&view=rev
Log:
Update detailed tests for controls property constraint.

Modified:
    incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ConstraintTest.java

Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ConstraintTest.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ConstraintTest.java?rev=168979&r1=168978&r2=168979&view=diff
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ConstraintTest.java (original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ConstraintTest.java Fri May  6 16:00:00 2005
@@ -14,13 +14,16 @@
 import org.apache.beehive.test.tools.milton.common.Report;
 import org.apache.beehive.test.tools.mantis.annotations.tch.Freq;
 import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
-
-import org.apache.beehive.controls.runtime.bean.AnnotationConstraintValidator;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Misc;
 
 /**
- * Test objective: to trigger runtime validation for property constraint rule.
- * Condition: According to dev, runtime validation is trigger when all properties are set.
+ * Property membership rules are not validated at runtime.
+ * Membership rules are validated at build time, when controls are instantiated declaratively.
+ * These test should be replaced with build time negative tests.
  */
+@Freq("detailed")
+@Status("inactive")
+@Misc("Propperty membership rules are not validated in runtime.")
 public class ConstraintTest extends TestCase
 {
     public ConstraintTest( String s ) { super( s ); }
@@ -34,8 +37,7 @@
     {
         return new TestBeanContext();
     }
-	@Freq("detailed")
-	@Status("inactive")
+
 	public void testRule_AT_LEAST_ONE()throws Exception{
 
 		Report report=new Report();
@@ -49,7 +51,7 @@
 		if ((usprice==null)&&(caprice==null)&&(euprice==null))
 			fail("Rule AT_LEAST_ONE is not enforced");
 	}
-	@Freq("detailed")
+
 	public void testRule_AT_MOST_ONE()throws Exception{
 
 		Report report=new Report();
@@ -60,7 +62,6 @@
 		try{
 			book.setCoverlanguage("English");
 			book.setContentlanguage("French");
-			//This should trigger AnnotationConstraintValidator.validateMembership by setting ALL the properties
 			book.setAuthorlanguage("Spanish");
 
 			fail("No runtime exception caught when AT_MOST_ONE is violated at runtime");
@@ -68,10 +69,10 @@
 		}
 		catch(Exception e){
 			e.printStackTrace();
-			//runtime exception caught, test passes
+			//when catching a membership constaint exception, test passes
 		}
 	}
-	@Freq("detailed")
+
 	public void testRule_EXACTLY_ONE()throws Exception{
 
 		Report report=new Report();
@@ -80,22 +81,19 @@
 			"org.apache.beehive.controls.test.controls.property.constraint.BookControlBean");
 
 		try{
-			book.setTitle("Book Title");
-			//This should cause runtime exception by violating EXACT_ONE rule
-			book.setSubject("Book Subject");
-			//Problem: rule validation is triggered BEFORE all properties is set
-			//book.setContent("Book content");
+			book.setTitle("Title");
+			book.setSubject("Subject");
+			book.setContent("content");
 
 			fail("No runtime exception caught when EXACT_ONE is violated at runtime");
 
 		}
 		catch(Exception e){
 			e.printStackTrace();
-			//runtime exception caught, test passes
+			//when catching a membership constaint exception, test passes
 		}
 	}
-	@Freq("detailed")
-	@Status("inactive")
+
 	public void testRule_ALL_IF_ANY()throws Exception{
 
 		Report report=new Report();