tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sl...@apache.org
Subject svn commit: r747952 - in /tuscany/branches/sca-java-1.x: itest/validation/src/main/resources/bindingjms/UnexpectedElement/ itest/validation/src/test/java/calculator/warning/ itest/validation/src/test/java/interfacewsdl/xml/ modules/assembly-xml/src/mai...
Date Wed, 25 Feb 2009 23:03:50 GMT
Author: slaws
Date: Wed Feb 25 23:03:49 2009
New Revision: 747952

URL: http://svn.apache.org/viewvc?rev=747952&view=rev
Log:
Correct the type of message that CompositeProcessor reports for a CompositeReadException and
correct a few tests to take account of this and another couple of exception funnies. 

Modified:
    tuscany/branches/sca-java-1.x/itest/validation/src/main/resources/bindingjms/UnexpectedElement/service.composite
    tuscany/branches/sca-java-1.x/itest/validation/src/test/java/calculator/warning/DuplicateReferenceNameTestCase.java
    tuscany/branches/sca-java-1.x/itest/validation/src/test/java/interfacewsdl/xml/InvalidWSDLInterfaceAttrTestCase.java
    tuscany/branches/sca-java-1.x/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java

Modified: tuscany/branches/sca-java-1.x/itest/validation/src/main/resources/bindingjms/UnexpectedElement/service.composite
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/itest/validation/src/main/resources/bindingjms/UnexpectedElement/service.composite?rev=747952&r1=747951&r2=747952&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/itest/validation/src/main/resources/bindingjms/UnexpectedElement/service.composite
(original)
+++ tuscany/branches/sca-java-1.x/itest/validation/src/main/resources/bindingjms/UnexpectedElement/service.composite
Wed Feb 25 23:03:49 2009
@@ -18,6 +18,7 @@
  * under the License.    
  -->
 <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+           targetNamespace="http://test"
            name="RPCComposite">
 
     <component name="HelloWorldService">
@@ -31,6 +32,7 @@
                <resourceAdapter name="resource">
                   <property name="resourceName" type="jms"/>
                </resourceAdapter>
+               <UnexpectedElement/>
             </binding.jms>  
         </service> 
     </component>       

Modified: tuscany/branches/sca-java-1.x/itest/validation/src/test/java/calculator/warning/DuplicateReferenceNameTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/itest/validation/src/test/java/calculator/warning/DuplicateReferenceNameTestCase.java?rev=747952&r1=747951&r2=747952&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/itest/validation/src/test/java/calculator/warning/DuplicateReferenceNameTestCase.java
(original)
+++ tuscany/branches/sca-java-1.x/itest/validation/src/test/java/calculator/warning/DuplicateReferenceNameTestCase.java
Wed Feb 25 23:03:49 2009
@@ -33,6 +33,7 @@
 import org.apache.tuscany.sca.node.SCANode;
 import org.apache.tuscany.sca.node.SCANodeFactory;
 import org.apache.tuscany.sca.node.impl.NodeImpl;
+import org.osoa.sca.ServiceRuntimeException;
 
 /**
  * This shows how to test the Calculator service component.
@@ -41,31 +42,32 @@
 
     private CalculatorService calculatorService;
     private SCANode node;
+    private boolean duplicateReferenceException = false;
 
     @Override
     protected void setUp() throws Exception {
-        SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
-        node = nodeFactory.createSCANode(new File("src/main/resources/DuplicateReferenceName/Calculator.composite").toURL().toString(),
-        		                 new SCAContribution("TestContribution", 
-        		                                     new File("src/main/resources/DuplicateReferenceName").toURL().toString()));
-        node.start();
-        calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+        try {
+            SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
+            node = nodeFactory.createSCANode(new File("src/main/resources/DuplicateReferenceName/Calculator.composite").toURL().toString(),
+            		                 new SCAContribution("TestContribution", 
+            		                                     new File("src/main/resources/DuplicateReferenceName").toURL().toString()));
+            node.start();
+            calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+        } catch (ServiceRuntimeException ex) {
+            if (ex.getMessage().equals("org.osoa.sca.ServiceRuntimeException: Duplicate component
reference name: Component = CalculatorServiceComponent Reference = addService")){
+                duplicateReferenceException = true;
+            }
+        }
     }
 
     @Override
     protected void tearDown() throws Exception {
-        node.stop();
+        if (node != null){
+            node.stop();
+        }
     }
 
     public void testCalculator() throws Exception {
-        ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry();
-        UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
-        MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
-        Monitor monitor = monitorFactory.createMonitor();
-        Problem problem = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
-        
-        assertNotNull(problem);
-        assertEquals("DuplicateComponentReferenceName", problem.getMessageId());
- 
+        assertTrue(duplicateReferenceException); 
     }
 }

Modified: tuscany/branches/sca-java-1.x/itest/validation/src/test/java/interfacewsdl/xml/InvalidWSDLInterfaceAttrTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/itest/validation/src/test/java/interfacewsdl/xml/InvalidWSDLInterfaceAttrTestCase.java?rev=747952&r1=747951&r2=747952&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/itest/validation/src/test/java/interfacewsdl/xml/InvalidWSDLInterfaceAttrTestCase.java
(original)
+++ tuscany/branches/sca-java-1.x/itest/validation/src/test/java/interfacewsdl/xml/InvalidWSDLInterfaceAttrTestCase.java
Wed Feb 25 23:03:49 2009
@@ -52,7 +52,7 @@
 
     public void testCalculator() {
     	Monitor monitor = customDomain.getMonitorInstance();
-    	Problem problem = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
+    	Problem problem = ((DefaultMonitorImpl)monitor).getProblems().get(0);
         
     	assertNotNull(problem);
         assertEquals("InvalidWSDLInterfaceAttr", problem.getMessageId());  

Modified: tuscany/branches/sca-java-1.x/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java?rev=747952&r1=747951&r2=747952&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java
(original)
+++ tuscany/branches/sca-java-1.x/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java
Wed Feb 25 23:03:49 2009
@@ -575,7 +575,7 @@
         }
         catch (XMLStreamException e) {
             ContributionReadException ex = new ContributionReadException(e);
-            error("XMLStreamException", reader, ex);
+            error("ContributionReadException", reader, ex);
         }
         
         return composite;



Mime
View raw message