tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsdelf...@apache.org
Subject svn commit: r533382 [2/2] - in /incubator/tuscany/java/sca: itest/contribution/src/test/java/org/apache/tuscany/sca/test/contribution/ modules/assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/ modules/assembly-xml/src/test/java/org/apache/tus...
Date Sat, 28 Apr 2007 16:18:46 GMT
Added: incubator/tuscany/java/sca/modules/core-spring/src/test/resources/org/apache/tuscany/core/spring/InnerCalculator.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core-spring/src/test/resources/org/apache/tuscany/core/spring/InnerCalculator.composite?view=auto&rev=533382
==============================================================================
--- incubator/tuscany/java/sca/modules/core-spring/src/test/resources/org/apache/tuscany/core/spring/InnerCalculator.composite
(added)
+++ incubator/tuscany/java/sca/modules/core-spring/src/test/resources/org/apache/tuscany/core/spring/InnerCalculator.composite
Sat Apr 28 09:18:40 2007
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+	xmlns:calc="http://calc"
+	targetNamespace="http://calc"
+	name="InnerCalculator">
+
+    <service name="CalculatorService" promote="CalculatorServiceComponent">
+        <interface.java interface="calculator.CalculatorService"/>
+    </service>
+
+    <component name="CalculatorServiceComponent">
+		<implementation.java class="calculator.CalculatorServiceImpl"/>
+        <reference name="addService" target="AddServiceComponent"/>
+        <reference name="subtractService" target="SubtractServiceComponent"/>
+        <reference name="multiplyService" target="MultiplyServiceComponent"/>
+        <reference name="divideService" target="DivideServiceComponent"/>
+    </component>
+
+	<reference name="addService" promote="CalculatorServiceComponent/addService">
+	<reference name="subtractService" promote="CalculatorServiceComponent/subtractService">
+	<reference name="multiplyService" promote="CalculatorServiceComponent/multiplyService">
+	<reference name="divideService" promote="CalculatorServiceComponent/divideService">
+
+</composite>

Propchange: incubator/tuscany/java/sca/modules/core-spring/src/test/resources/org/apache/tuscany/core/spring/InnerCalculator.composite
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/core-spring/src/test/resources/org/apache/tuscany/core/spring/InnerCalculator.composite
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/core-spring/src/test/resources/org/apache/tuscany/core/spring/InnerOperations.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core-spring/src/test/resources/org/apache/tuscany/core/spring/InnerOperations.composite?view=auto&rev=533382
==============================================================================
--- incubator/tuscany/java/sca/modules/core-spring/src/test/resources/org/apache/tuscany/core/spring/InnerOperations.composite
(added)
+++ incubator/tuscany/java/sca/modules/core-spring/src/test/resources/org/apache/tuscany/core/spring/InnerOperations.composite
Sat Apr 28 09:18:40 2007
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+	xmlns:calc="http://calc"
+	targetNamespace="http://calc"
+	name="InnerOperations">
+
+    <service name="AddService" promote="AddServiceComponent">
+        <interface.java interface="calculator.AddService"/>
+    </service>
+
+    <service name="SubtractService" promote="SubtractServiceComponent">
+        <interface.java interface="calculator.SubtractService"/>
+    </service>
+
+    <service name="MultiplyService" promote="MultiplyServiceComponent">
+        <interface.java interface="calculator.MultiplyService"/>
+    </service>
+
+    <service name="DivideService" promote="DivideServiceComponent">
+        <interface.java interface="calculator.DivideService"/>
+    </service>
+
+    <component name="AddServiceComponent">
+        <implementation.java class="calculator.AddServiceImpl"/>
+    </component>
+
+    <component name="SubtractServiceComponent">
+        <implementation.java class="calculator.SubtractServiceImpl"/>
+    </component>
+
+    <component name="MultiplyServiceComponent">
+        <implementation.java class="calculator.MultiplyServiceImpl"/>
+    </component>
+
+    <component name="DivideServiceComponent">
+        <implementation.java class="calculator.DivideServiceImpl"/>
+    </component>
+
+</composite>

Propchange: incubator/tuscany/java/sca/modules/core-spring/src/test/resources/org/apache/tuscany/core/spring/InnerOperations.composite
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/core-spring/src/test/resources/org/apache/tuscany/core/spring/OuterCalculator.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core-spring/src/test/resources/org/apache/tuscany/core/spring/OuterCalculator.composite?view=auto&rev=533382
==============================================================================
--- incubator/tuscany/java/sca/modules/core-spring/src/test/resources/org/apache/tuscany/core/spring/OuterCalculator.composite
(added)
+++ incubator/tuscany/java/sca/modules/core-spring/src/test/resources/org/apache/tuscany/core/spring/OuterCalculator.composite
Sat Apr 28 09:18:40 2007
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+	xmlns:calc="http://calc"
+	targetNamespace="http://calc"
+	name="OuterCalculator">
+
+    <service name="CalculatorService" promote="CalculatorServiceComponent">
+        <interface.java interface="calculator.CalculatorService"/>
+    </service>
+
+    <component name="CalculatorServiceComponent">
+		<implementation.composite name="calc:InnerCalculator"/>
+        <reference name="addService" target="OperationsServiceComponent/AddService"/>
+        <reference name="subtractService" target="OperationsServiceComponent/SubtractService"/>
+        <reference name="multiplyService" target="OperationsServiceComponent/MultiplyService"/>
+        <reference name="divideService" target="OperationsServiceComponent/DivideService"/>
+    </component>
+
+    <component name="OperationsServiceComponent">
+		<implementation.composite name="calc:InnerOperations"/>
+    </component>
+
+</composite>

Propchange: incubator/tuscany/java/sca/modules/core-spring/src/test/resources/org/apache/tuscany/core/spring/OuterCalculator.composite
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/core-spring/src/test/resources/org/apache/tuscany/core/spring/OuterCalculator.composite
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/impl/SimpleRuntimeImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/impl/SimpleRuntimeImpl.java?view=diff&rev=533382&r1=533381&r2=533382
==============================================================================
--- incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/impl/SimpleRuntimeImpl.java
(original)
+++ incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/impl/SimpleRuntimeImpl.java
Sat Apr 28 09:18:40 2007
@@ -25,7 +25,11 @@
 import java.net.URL;
 import java.util.Collection;
 
+import javax.xml.stream.XMLInputFactory;
+
+import org.apache.tuscany.assembly.AssemblyFactory;
 import org.apache.tuscany.assembly.Composite;
+import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 import org.apache.tuscany.assembly.xml.ComponentTypeDocumentProcessor;
 import org.apache.tuscany.assembly.xml.ComponentTypeProcessor;
 import org.apache.tuscany.assembly.xml.CompositeDocumentProcessor;
@@ -55,6 +59,10 @@
 import org.apache.tuscany.core.monitor.NullMonitorFactory;
 import org.apache.tuscany.core.runtime.AbstractRuntime;
 import org.apache.tuscany.host.runtime.InitializationException;
+import org.apache.tuscany.interfacedef.InterfaceContractMapper;
+import org.apache.tuscany.interfacedef.impl.DefaultInterfaceContractMapper;
+import org.apache.tuscany.policy.PolicyFactory;
+import org.apache.tuscany.policy.impl.DefaultPolicyFactory;
 import org.apache.tuscany.spi.Scope;
 import org.apache.tuscany.spi.component.Component;
 import org.apache.tuscany.spi.component.ScopeContainer;
@@ -118,15 +126,21 @@
         extensionRegistry.addExtensionPoint(StAXArtifactProcessorExtensionPoint.class, staxProcessors);
         DefaultURLArtifactProcessorExtensionPoint documentProcessors = new DefaultURLArtifactProcessorExtensionPoint();
         extensionRegistry.addExtensionPoint(URLArtifactProcessorExtensionPoint.class, documentProcessors);
+        
+        // Create default factories
+        AssemblyFactory factory = new DefaultAssemblyFactory();
+        PolicyFactory policyFactory = new DefaultPolicyFactory();
+        InterfaceContractMapper mapper = new DefaultInterfaceContractMapper();
 
         // Register base artifact processors
-        staxProcessors.addExtension(new CompositeProcessor(staxProcessors));
-        staxProcessors.addExtension(new ComponentTypeProcessor(staxProcessors));
-        staxProcessors.addExtension(new ConstrainingTypeProcessor(staxProcessors));
-
-        documentProcessors.addExtension(new CompositeDocumentProcessor(staxProcessors));
-        documentProcessors.addExtension(new ComponentTypeDocumentProcessor(staxProcessors));
-        documentProcessors.addExtension(new ConstrainingTypeDocumentProcessor(staxProcessors));
+        staxProcessors.addExtension(new CompositeProcessor(factory, policyFactory, mapper,
staxProcessors));
+        staxProcessors.addExtension(new ComponentTypeProcessor(factory, policyFactory, staxProcessors));
+        staxProcessors.addExtension(new ConstrainingTypeProcessor(factory, policyFactory,
staxProcessors));
+
+        XMLInputFactory inputFactory = XMLInputFactory.newInstance();
+        documentProcessors.addExtension(new CompositeDocumentProcessor(staxProcessors, inputFactory));
+        documentProcessors.addExtension(new ComponentTypeDocumentProcessor(staxProcessors,
inputFactory));
+        documentProcessors.addExtension(new ConstrainingTypeDocumentProcessor(staxProcessors,
inputFactory));
 
         // Create package processor extension point
         PackageTypeDescriberImpl describer = new PackageTypeDescriberImpl();

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/xml/ReadTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/xml/ReadTestCase.java?view=diff&rev=533382&r1=533381&r2=533382
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/xml/ReadTestCase.java
(original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/xml/ReadTestCase.java
Sat Apr 28 09:18:40 2007
@@ -27,13 +27,19 @@
 
 import junit.framework.TestCase;
 
+import org.apache.tuscany.assembly.AssemblyFactory;
 import org.apache.tuscany.assembly.Base;
 import org.apache.tuscany.assembly.Composite;
+import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 import org.apache.tuscany.assembly.util.CompositeUtil;
 import org.apache.tuscany.assembly.xml.CompositeProcessor;
 import org.apache.tuscany.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
 import org.apache.tuscany.contribution.resolver.ArtifactResolver;
 import org.apache.tuscany.contribution.resolver.DefaultArtifactResolver;
+import org.apache.tuscany.interfacedef.InterfaceContractMapper;
+import org.apache.tuscany.interfacedef.impl.DefaultInterfaceContractMapper;
+import org.apache.tuscany.policy.PolicyFactory;
+import org.apache.tuscany.policy.impl.DefaultPolicyFactory;
 
 /**
  * Test reading Java implementations.
@@ -44,12 +50,18 @@
 
     XMLInputFactory inputFactory;
     DefaultStAXArtifactProcessorExtensionPoint staxProcessors;
+    private AssemblyFactory factory;
+    private PolicyFactory policyFactory;
+    private InterfaceContractMapper mapper;
     
     public void setUp() throws Exception {
+        factory = new DefaultAssemblyFactory();
+        policyFactory = new DefaultPolicyFactory();
+        mapper = new DefaultInterfaceContractMapper();
         inputFactory = XMLInputFactory.newInstance();
         staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint();
         
-        CompositeProcessor compositeProcessor = new CompositeProcessor(staxProcessors);
+        CompositeProcessor compositeProcessor = new CompositeProcessor(factory, policyFactory,
mapper, staxProcessors);
         staxProcessors.addExtension(compositeProcessor);
 
         JavaImplementationProcessor javaProcessor = new JavaImplementationProcessor();
@@ -59,25 +71,28 @@
     public void tearDown() throws Exception {
         inputFactory = null;
         staxProcessors = null;
+        policyFactory = null;
+        factory = null;
+        mapper = null;
     }
 
     public void testReadComposite() throws Exception {
-        CompositeProcessor compositeProcessor = new CompositeProcessor(staxProcessors);
+        CompositeProcessor compositeProcessor = new CompositeProcessor(factory, policyFactory,
mapper, staxProcessors);
         InputStream is = getClass().getResourceAsStream("Calculator.composite");
         XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
         Composite composite = compositeProcessor.read(reader);
         assertNotNull(composite);
 
-        CompositeUtil compositeUtil = new CompositeUtil();
+        CompositeUtil compositeUtil = new CompositeUtil(factory, mapper);
         compositeUtil.fuseIncludes(composite, new ArrayList<Base>());
         compositeUtil.configureComponents(composite, new ArrayList<Base>());
-        compositeUtil.wireReferences(composite, new ArrayList<Base>());
+        compositeUtil.wireComposite(composite, new ArrayList<Base>());
 
         //new PrintUtil(System.out).print(composite);
     }
 
     public void testReadAndResolveComposite() throws Exception {
-        CompositeProcessor compositeProcessor = new CompositeProcessor(staxProcessors);
+        CompositeProcessor compositeProcessor = new CompositeProcessor(factory, policyFactory,
mapper, staxProcessors);
         InputStream is = getClass().getResourceAsStream("Calculator.composite");
         XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
         Composite composite = compositeProcessor.read(reader);
@@ -86,10 +101,10 @@
         ArtifactResolver resolver = new DefaultArtifactResolver(getClass().getClassLoader());
         staxProcessors.resolve(composite, resolver);
 
-        CompositeUtil compositeUtil = new CompositeUtil();
+        CompositeUtil compositeUtil = new CompositeUtil(factory, mapper);
         compositeUtil.fuseIncludes(composite, new ArrayList<Base>());
         compositeUtil.configureComponents(composite, new ArrayList<Base>());
-        compositeUtil.wireReferences(composite, new ArrayList<Base>());
+        compositeUtil.wireComposite(composite, new ArrayList<Base>());
 
         //new PrintUtil(System.out).print(composite);
     }

Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/xml/WriteTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/xml/WriteTestCase.java?view=diff&rev=533382&r1=533381&r2=533382
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/xml/WriteTestCase.java
(original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/xml/WriteTestCase.java
Sat Apr 28 09:18:40 2007
@@ -26,11 +26,17 @@
 
 import junit.framework.TestCase;
 
+import org.apache.tuscany.assembly.AssemblyFactory;
 import org.apache.tuscany.assembly.Composite;
+import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 import org.apache.tuscany.assembly.xml.ComponentTypeProcessor;
 import org.apache.tuscany.assembly.xml.CompositeProcessor;
 import org.apache.tuscany.assembly.xml.ConstrainingTypeProcessor;
 import org.apache.tuscany.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.interfacedef.InterfaceContractMapper;
+import org.apache.tuscany.interfacedef.impl.DefaultInterfaceContractMapper;
+import org.apache.tuscany.policy.PolicyFactory;
+import org.apache.tuscany.policy.impl.DefaultPolicyFactory;
 
 /**
  * Test writing Java implementations.
@@ -41,14 +47,20 @@
 
     XMLInputFactory inputFactory;
     DefaultStAXArtifactProcessorExtensionPoint staxProcessors;
+    private AssemblyFactory factory;
+    private PolicyFactory policyFactory;
+    private InterfaceContractMapper mapper;
     
     public void setUp() throws Exception {
+        factory = new DefaultAssemblyFactory();
+        policyFactory = new DefaultPolicyFactory();
+        mapper = new DefaultInterfaceContractMapper();
         inputFactory = XMLInputFactory.newInstance();
         staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint();
 
-        staxProcessors.addExtension(new CompositeProcessor(staxProcessors));
-        staxProcessors.addExtension(new ComponentTypeProcessor(staxProcessors));
-        staxProcessors.addExtension(new ConstrainingTypeProcessor(staxProcessors));
+        staxProcessors.addExtension(new CompositeProcessor(factory, policyFactory, mapper,
staxProcessors));
+        staxProcessors.addExtension(new ComponentTypeProcessor(factory, policyFactory, staxProcessors));
+        staxProcessors.addExtension(new ConstrainingTypeProcessor(factory, policyFactory,
staxProcessors));
 
         JavaImplementationProcessor javaProcessor = new JavaImplementationProcessor();
         staxProcessors.addExtension(javaProcessor);
@@ -57,6 +69,9 @@
     public void tearDown() throws Exception {
         inputFactory = null;
         staxProcessors = null;
+        policyFactory = null;
+        factory = null;
+        mapper = null;
     }
 
     public void testReadWriteComposite() throws Exception {

Modified: incubator/tuscany/java/sca/modules/interface-java-xml/src/test/java/org/apache/tuscany/interfacedef/java/xml/ReadTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface-java-xml/src/test/java/org/apache/tuscany/interfacedef/java/xml/ReadTestCase.java?view=diff&rev=533382&r1=533381&r2=533382
==============================================================================
--- incubator/tuscany/java/sca/modules/interface-java-xml/src/test/java/org/apache/tuscany/interfacedef/java/xml/ReadTestCase.java
(original)
+++ incubator/tuscany/java/sca/modules/interface-java-xml/src/test/java/org/apache/tuscany/interfacedef/java/xml/ReadTestCase.java
Sat Apr 28 09:18:40 2007
@@ -27,15 +27,21 @@
 
 import junit.framework.TestCase;
 
+import org.apache.tuscany.assembly.AssemblyFactory;
 import org.apache.tuscany.assembly.Base;
 import org.apache.tuscany.assembly.ComponentType;
 import org.apache.tuscany.assembly.Composite;
 import org.apache.tuscany.assembly.ConstrainingType;
+import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 import org.apache.tuscany.assembly.util.CompositeUtil;
 import org.apache.tuscany.assembly.xml.ComponentTypeProcessor;
 import org.apache.tuscany.assembly.xml.CompositeProcessor;
 import org.apache.tuscany.assembly.xml.ConstrainingTypeProcessor;
 import org.apache.tuscany.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.interfacedef.InterfaceContractMapper;
+import org.apache.tuscany.interfacedef.impl.DefaultInterfaceContractMapper;
+import org.apache.tuscany.policy.PolicyFactory;
+import org.apache.tuscany.policy.impl.DefaultPolicyFactory;
 
 /**
  * Test reading Java interfaces.
@@ -46,8 +52,14 @@
 
     XMLInputFactory inputFactory;
     DefaultStAXArtifactProcessorExtensionPoint staxProcessors;
+    private AssemblyFactory factory;
+    private PolicyFactory policyFactory;
+    private InterfaceContractMapper mapper;
 
     public void setUp() throws Exception {
+        factory = new DefaultAssemblyFactory();
+        policyFactory = new DefaultPolicyFactory();
+        mapper = new DefaultInterfaceContractMapper();
         inputFactory = XMLInputFactory.newInstance();
         staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint();
 
@@ -58,10 +70,13 @@
     public void tearDown() throws Exception {
         inputFactory = null;
         staxProcessors = null;
+        policyFactory = null;
+        factory = null;
+        mapper = null;
     }
 
     public void testReadComponentType() throws Exception {
-        ComponentTypeProcessor componentTypeReader = new ComponentTypeProcessor(staxProcessors);
+        ComponentTypeProcessor componentTypeReader = new ComponentTypeProcessor(factory,
policyFactory, staxProcessors);
         InputStream is = getClass().getResourceAsStream("CalculatorImpl.componentType");
         XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
         ComponentType componentType = componentTypeReader.read(reader);
@@ -71,7 +86,7 @@
     }
 
     public void testReadConstrainingType() throws Exception {
-        ConstrainingTypeProcessor constrainingTypeProcessor = new ConstrainingTypeProcessor(staxProcessors);
+        ConstrainingTypeProcessor constrainingTypeProcessor = new ConstrainingTypeProcessor(factory,
policyFactory, staxProcessors);
         InputStream is = getClass().getResourceAsStream("CalculatorComponent.constrainingType");
         XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
         ConstrainingType constrainingType = constrainingTypeProcessor.read(reader);
@@ -81,16 +96,16 @@
     }
 
     public void testReadComposite() throws Exception {
-        CompositeProcessor compositeProcessor = new CompositeProcessor(staxProcessors);
+        CompositeProcessor compositeProcessor = new CompositeProcessor(factory, policyFactory,
mapper, staxProcessors);
         InputStream is = getClass().getResourceAsStream("Calculator.composite");
         XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
         Composite composite = compositeProcessor.read(reader);
         assertNotNull(composite);
 
-        CompositeUtil compositeUtil = new CompositeUtil();
+        CompositeUtil compositeUtil = new CompositeUtil(factory, mapper);
         compositeUtil.fuseIncludes(composite, new ArrayList<Base>());
         compositeUtil.configureComponents(composite, new ArrayList<Base>());
-        compositeUtil.wireReferences(composite, new ArrayList<Base>());
+        compositeUtil.wireComposite(composite, new ArrayList<Base>());
 
         //new PrintUtil(System.out).print(composite);
     }

Modified: incubator/tuscany/java/sca/modules/interface-java-xml/src/test/java/org/apache/tuscany/interfacedef/java/xml/WriteTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface-java-xml/src/test/java/org/apache/tuscany/interfacedef/java/xml/WriteTestCase.java?view=diff&rev=533382&r1=533381&r2=533382
==============================================================================
--- incubator/tuscany/java/sca/modules/interface-java-xml/src/test/java/org/apache/tuscany/interfacedef/java/xml/WriteTestCase.java
(original)
+++ incubator/tuscany/java/sca/modules/interface-java-xml/src/test/java/org/apache/tuscany/interfacedef/java/xml/WriteTestCase.java
Sat Apr 28 09:18:40 2007
@@ -26,13 +26,19 @@
 
 import junit.framework.TestCase;
 
+import org.apache.tuscany.assembly.AssemblyFactory;
 import org.apache.tuscany.assembly.ComponentType;
 import org.apache.tuscany.assembly.Composite;
 import org.apache.tuscany.assembly.ConstrainingType;
+import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 import org.apache.tuscany.assembly.xml.ComponentTypeProcessor;
 import org.apache.tuscany.assembly.xml.CompositeProcessor;
 import org.apache.tuscany.assembly.xml.ConstrainingTypeProcessor;
 import org.apache.tuscany.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.interfacedef.InterfaceContractMapper;
+import org.apache.tuscany.interfacedef.impl.DefaultInterfaceContractMapper;
+import org.apache.tuscany.policy.PolicyFactory;
+import org.apache.tuscany.policy.impl.DefaultPolicyFactory;
 
 /**
  * Test writing Java interfaces.
@@ -43,14 +49,20 @@
 
     XMLInputFactory inputFactory;
     DefaultStAXArtifactProcessorExtensionPoint staxProcessors;
+    private AssemblyFactory factory;
+    private PolicyFactory policyFactory;
+    private InterfaceContractMapper mapper;
 
     public void setUp() throws Exception {
+        factory = new DefaultAssemblyFactory();
+        policyFactory = new DefaultPolicyFactory();
+        mapper = new DefaultInterfaceContractMapper();
         inputFactory = XMLInputFactory.newInstance();
         staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint();
 
-        staxProcessors.addExtension(new CompositeProcessor(staxProcessors));
-        staxProcessors.addExtension(new ComponentTypeProcessor(staxProcessors));
-        staxProcessors.addExtension(new ConstrainingTypeProcessor(staxProcessors));
+        staxProcessors.addExtension(new CompositeProcessor(factory, policyFactory, mapper,
staxProcessors));
+        staxProcessors.addExtension(new ComponentTypeProcessor(factory, policyFactory, staxProcessors));
+        staxProcessors.addExtension(new ConstrainingTypeProcessor(factory, policyFactory,
staxProcessors));
 
         JavaInterfaceProcessor javaProcessor = new JavaInterfaceProcessor();
         staxProcessors.addExtension(javaProcessor);
@@ -59,6 +71,9 @@
     public void tearDown() throws Exception {
         inputFactory = null;
         staxProcessors = null;
+        policyFactory = null;
+        factory = null;
+        mapper = null;
     }
 
     public void testReadWriteComponentType() throws Exception {

Modified: incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/xml/ReadTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/xml/ReadTestCase.java?view=diff&rev=533382&r1=533381&r2=533382
==============================================================================
--- incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/xml/ReadTestCase.java
(original)
+++ incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/xml/ReadTestCase.java
Sat Apr 28 09:18:40 2007
@@ -27,15 +27,21 @@
 
 import junit.framework.TestCase;
 
+import org.apache.tuscany.assembly.AssemblyFactory;
 import org.apache.tuscany.assembly.Base;
 import org.apache.tuscany.assembly.ComponentType;
 import org.apache.tuscany.assembly.Composite;
 import org.apache.tuscany.assembly.ConstrainingType;
+import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 import org.apache.tuscany.assembly.util.CompositeUtil;
 import org.apache.tuscany.assembly.xml.ComponentTypeProcessor;
 import org.apache.tuscany.assembly.xml.CompositeProcessor;
 import org.apache.tuscany.assembly.xml.ConstrainingTypeProcessor;
 import org.apache.tuscany.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.interfacedef.InterfaceContractMapper;
+import org.apache.tuscany.interfacedef.impl.DefaultInterfaceContractMapper;
+import org.apache.tuscany.policy.PolicyFactory;
+import org.apache.tuscany.policy.impl.DefaultPolicyFactory;
 
 /**
  * Test reading WSDL interfaces.
@@ -46,8 +52,14 @@
 
     XMLInputFactory inputFactory;
     DefaultStAXArtifactProcessorExtensionPoint staxProcessors;
+    private AssemblyFactory factory;
+    private PolicyFactory policyFactory;
+    private InterfaceContractMapper mapper;
 
     public void setUp() throws Exception {
+        factory = new DefaultAssemblyFactory();
+        policyFactory = new DefaultPolicyFactory();
+        mapper = new DefaultInterfaceContractMapper();
         inputFactory = XMLInputFactory.newInstance();
         staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint();
 
@@ -58,10 +70,13 @@
     public void tearDown() throws Exception {
         inputFactory = null;
         staxProcessors = null;
+        policyFactory = null;
+        factory = null;
+        mapper = null;
     }
 
     public void testReadComponentType() throws Exception {
-        ComponentTypeProcessor componentTypeProcessor = new ComponentTypeProcessor(staxProcessors);
+        ComponentTypeProcessor componentTypeProcessor = new ComponentTypeProcessor(factory,
policyFactory, staxProcessors);
         InputStream is = getClass().getResourceAsStream("CalculatorImpl.componentType");
         XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
         ComponentType componentType = componentTypeProcessor.read(reader);
@@ -71,7 +86,7 @@
     }
 
     public void testReadConstrainingType() throws Exception {
-        ConstrainingTypeProcessor constrainingTypeProcessor = new ConstrainingTypeProcessor(staxProcessors);
+        ConstrainingTypeProcessor constrainingTypeProcessor = new ConstrainingTypeProcessor(factory,
policyFactory, staxProcessors);
         InputStream is = getClass().getResourceAsStream("CalculatorComponent.constrainingType");
         XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
         ConstrainingType constrainingType = constrainingTypeProcessor.read(reader);
@@ -81,16 +96,16 @@
     }
 
     public void testReadComposite() throws Exception {
-        CompositeProcessor compositeProcessor = new CompositeProcessor(staxProcessors);
+        CompositeProcessor compositeProcessor = new CompositeProcessor(factory, policyFactory,
mapper, staxProcessors);
         InputStream is = getClass().getResourceAsStream("Calculator.composite");
         XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
         Composite composite = compositeProcessor.read(reader);
         assertNotNull(composite);
 
-        CompositeUtil compositeUtil = new CompositeUtil();
+        CompositeUtil compositeUtil = new CompositeUtil(factory, mapper);
         compositeUtil.fuseIncludes(composite, new ArrayList<Base>());
         compositeUtil.configureComponents(composite, new ArrayList<Base>());
-        compositeUtil.wireReferences(composite, new ArrayList<Base>());
+        compositeUtil.wireComposite(composite, new ArrayList<Base>());
 
         //new PrintUtil(System.out).print(composite);
     }

Modified: incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/xml/WriteTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/xml/WriteTestCase.java?view=diff&rev=533382&r1=533381&r2=533382
==============================================================================
--- incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/xml/WriteTestCase.java
(original)
+++ incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/xml/WriteTestCase.java
Sat Apr 28 09:18:40 2007
@@ -26,13 +26,19 @@
 
 import junit.framework.TestCase;
 
+import org.apache.tuscany.assembly.AssemblyFactory;
 import org.apache.tuscany.assembly.ComponentType;
 import org.apache.tuscany.assembly.Composite;
 import org.apache.tuscany.assembly.ConstrainingType;
+import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 import org.apache.tuscany.assembly.xml.ComponentTypeProcessor;
 import org.apache.tuscany.assembly.xml.CompositeProcessor;
 import org.apache.tuscany.assembly.xml.ConstrainingTypeProcessor;
 import org.apache.tuscany.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.interfacedef.InterfaceContractMapper;
+import org.apache.tuscany.interfacedef.impl.DefaultInterfaceContractMapper;
+import org.apache.tuscany.policy.PolicyFactory;
+import org.apache.tuscany.policy.impl.DefaultPolicyFactory;
 
 /**
  * Test reading/write WSDL interfaces.
@@ -43,14 +49,20 @@
 
     XMLInputFactory inputFactory;
     DefaultStAXArtifactProcessorExtensionPoint staxProcessors;
+    private AssemblyFactory factory;
+    private PolicyFactory policyFactory;
+    private InterfaceContractMapper mapper;
 
     public void setUp() throws Exception {
+        factory = new DefaultAssemblyFactory();
+        policyFactory = new DefaultPolicyFactory();
+        mapper = new DefaultInterfaceContractMapper();
         inputFactory = XMLInputFactory.newInstance();
         staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint();
 
-        staxProcessors.addExtension(new CompositeProcessor(staxProcessors));
-        staxProcessors.addExtension(new ComponentTypeProcessor(staxProcessors));
-        staxProcessors.addExtension(new ConstrainingTypeProcessor(staxProcessors));
+        staxProcessors.addExtension(new CompositeProcessor(factory, policyFactory, mapper,
staxProcessors));
+        staxProcessors.addExtension(new ComponentTypeProcessor(factory, policyFactory, staxProcessors));
+        staxProcessors.addExtension(new ConstrainingTypeProcessor(factory, policyFactory,
staxProcessors));
 
         WSDLInterfaceProcessor wsdlProcessor = new WSDLInterfaceProcessor();
         staxProcessors.addExtension(wsdlProcessor);
@@ -59,6 +71,9 @@
     public void tearDown() throws Exception {
         inputFactory = null;
         staxProcessors = null;
+        policyFactory = null;
+        factory = null;
+        mapper = null;
     }
 
     public void testReadWriteComponentType() throws Exception {



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message