Author: lmandel
Date: Tue Feb 12 18:24:26 2008
New Revision: 627224

URL: http://svn.apache.org/viewvc?rev=627224&view=rev
Log:
[WODEN-199] Corrected Interface1009 tests.

Modified:
    
webservices/woden/branches/woden62/test/org/apache/woden/internal/wsdl20/assertions/TestInterface1009.java

Modified: 
webservices/woden/branches/woden62/test/org/apache/woden/internal/wsdl20/assertions/TestInterface1009.java
URL: 
http://svn.apache.org/viewvc/webservices/woden/branches/woden62/test/org/apache/woden/internal/wsdl20/assertions/TestInterface1009.java?rev=627224&r1=627223&r2=627224&view=diff
==============================================================================
--- 
webservices/woden/branches/woden62/test/org/apache/woden/internal/wsdl20/assertions/TestInterface1009.java
 (original)
+++ 
webservices/woden/branches/woden62/test/org/apache/woden/internal/wsdl20/assertions/TestInterface1009.java
 Tue Feb 12 18:24:26 2008
@@ -43,7 +43,6 @@
        private ErrorReporter reporter;
        private TestErrorHandler handler;
        
-       @Override
        protected void setUp() throws Exception {
            try {
                factory = WSDLFactory.newInstance();
@@ -57,21 +56,32 @@
        }
 
        /**
-        * Test that the assertion returns true for an interface that 
+        * Test that the assertion passes for an interface that 
         * extends no other interfaces.
         */
        public void testNoInterfaceExtension() {
                DescriptionElement descEl = factory.newDescription();
                Description descComp = descEl.toComponent();
+               try {
+                       descEl.setTargetNamespace(new 
URI("http://testnamespace";));
+               } catch(URISyntaxException e) {
+                       // Do nothing.
+               }
+               
                InterfaceImpl interfac = 
(InterfaceImpl)descEl.addInterfaceElement();
                interfac.setName(new NCName("name"));
-               if(!assertion.validate(interfac, reporter)) {
-                       fail("Assertion Interface1009 false for an interface 
that extends no other interfaces.");
+               
+               // init Interface's ref to its Description, needed for 
interface extension.
+               descComp.getInterfaces();
+               
+               assertion.validate(interfac, reporter);
+               if(handler.errorMessageHasBeenReported()) {
+                       fail("Assertion Interface1009 fails incorrectly for an 
interface that extends no other interfaces.");
                }
        }
        
        /**
-        * Test that the assertion returns false if the interface is in the 
direct list.
+        * Test that the assertion fails if the interface is in the direct list.
         */
        public void testInterfaceExtendsItselfDirectly() {
                DescriptionElement descEl = factory.newDescription();
@@ -90,13 +100,14 @@
            // init Interface's ref to its Description, needed for interface 
extension.
            descComp.getInterfaces(); 
                  
-           if(assertion.validate(interfac, reporter)) {
-               fail("Assertion Interface1009 returned true for an interface 
that directly extends itself.");
+           assertion.validate(interfac, reporter);
+           if(!handler.errorMessageHasBeenReported()) {
+               fail("Assertion Interface1009 passes incorrectly for an 
interface that directly extends itself.");
            }
        }
        
        /**
-        * Test that the assertion returns false if the interface is in the 
indirect list.
+        * Test that the assertion fails if the interface is in the indirect 
list.
         */
        public void testInterfaceExtendsItselfIndirectly() {
                DescriptionElement descEl = factory.newDescription();
@@ -117,13 +128,14 @@
                // init Interface's ref to its Description, needed for 
interface extension.
                descComp.getInterfaces(); 
                  
-               if(assertion.validate(interfac, reporter)) {
-                       fail("Assertion Interface1009 returned true for an 
interface that indirectly extends itself.");
+               assertion.validate(interfac, reporter);
+               if(!handler.errorMessageHasBeenReported()) {
+                       fail("Assertion Interface1009 passes incorrectly for an 
interface that indirectly extends itself.");
                }
        }
        
        /**
-        * Test that the assertion returns true if the interface is not 
+        * Test that the assertion passes if the interface is not 
         * in the direct or indirect list of extended interfaces.
         */
        public void testInterfaceExtendsOtherInterfaces() {
@@ -158,9 +170,10 @@
                
                // init Interface's ref to its Description, needed for 
interface extension.
                descComp.getInterfaces(); 
-                 
-               if(!assertion.validate(interfac, reporter)) {
-                       fail("Assertion Interface1009 returned false for an 
interface that is not in the list of exteneded interfaces.");
+               assertion.validate(interfac, reporter);
+               
+               if(handler.errorMessageHasBeenReported()) {
+                       fail("Assertion Interface1009 fails incorrectly for an 
interface that is not in the list of exteneded interfaces.");
                }
        }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to