tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsdelf...@apache.org
Subject svn commit: r533012 - in /incubator/tuscany/java/sca: itest/contribution/src/test/java/org/apache/tuscany/sca/test/contribution/ modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/ modules/contribution/src/main/java/org/apache/tuscany/c...
Date Fri, 27 Apr 2007 08:19:36 GMT
Author: jsdelfino
Date: Fri Apr 27 01:19:35 2007
New Revision: 533012

URL: http://svn.apache.org/viewvc?view=rev&rev=533012
Log:
Added support for resolving classes to the DefaultArtifactResolver.

Added:
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/resolver/ClassReference.java
  (with props)
Modified:
    incubator/tuscany/java/sca/itest/contribution/src/test/java/org/apache/tuscany/sca/test/contribution/ContributionServiceTestCase.java
    incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/ReadAllTestCase.java
    incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/ReadDocumentTestCase.java
    incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/ResolveTestCase.java
    incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/WireTestCase.java
    incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/WriteAllTestCase.java
    incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/resolver/DefaultArtifactResolver.java
    incubator/tuscany/java/sca/modules/core-spring/src/test/java/test/application/context/TestRuntimeContext.java
    incubator/tuscany/java/sca/modules/core-spring/src/test/java/test/model/variant/VariantRuntimeContext.java
    incubator/tuscany/java/sca/modules/databinding-sdo/src/test/java/org/apache/tuscany/databinding/sdo/ImportSDOProcessorTestCase.java
    incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/host/embedded/impl/SimpleRuntimeImpl.java
    incubator/tuscany/java/sca/modules/implementation-java-xml/src/test/java/org/apache/tuscany/implementation/java/xml/ReadTestCase.java
    incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/introspect/DefaultWSDLInterfaceIntrospectorTestCase.java
    incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/introspect/WSDLOperationTestCase.java
    incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java

Modified: incubator/tuscany/java/sca/itest/contribution/src/test/java/org/apache/tuscany/sca/test/contribution/ContributionServiceTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/contribution/src/test/java/org/apache/tuscany/sca/test/contribution/ContributionServiceTestCase.java?view=diff&rev=533012&r1=533011&r2=533012
==============================================================================
--- incubator/tuscany/java/sca/itest/contribution/src/test/java/org/apache/tuscany/sca/test/contribution/ContributionServiceTestCase.java
(original)
+++ incubator/tuscany/java/sca/itest/contribution/src/test/java/org/apache/tuscany/sca/test/contribution/ContributionServiceTestCase.java
Fri Apr 27 01:19:35 2007
@@ -96,7 +96,7 @@
         ContributionRepository repository = new ContributionRepositoryImpl("target");
         
         // Create an artifact resolver and contribution service
-        DefaultArtifactResolver artifactResolver = new DefaultArtifactResolver();
+        DefaultArtifactResolver artifactResolver = new DefaultArtifactResolver(getClass().getClassLoader());
         this.contributionService = new ContributionServiceImpl(repository, packageProcessors,
                                                                               documentProcessors,
artifactResolver);
     }

Modified: incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/ReadAllTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/ReadAllTestCase.java?view=diff&rev=533012&r1=533011&r2=533012
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/ReadAllTestCase.java
(original)
+++ incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/ReadAllTestCase.java
Fri Apr 27 01:19:35 2007
@@ -46,16 +46,20 @@
  */
 public class ReadAllTestCase extends TestCase {
     private DefaultStAXArtifactProcessorExtensionPoint staxProcessors;
+    private DefaultArtifactResolver resolver; 
 
     public void setUp() throws Exception {
         staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint();
         staxProcessors.addExtension(new CompositeProcessor(staxProcessors));
         staxProcessors.addExtension(new ComponentTypeProcessor(staxProcessors));
         staxProcessors.addExtension(new ConstrainingTypeProcessor(staxProcessors));
+
+        resolver = new DefaultArtifactResolver(getClass().getClassLoader());
     }
 
     public void tearDown() throws Exception {
         staxProcessors = null;
+        resolver = null;
     }
 
     public void testReadComposite() throws Exception {
@@ -144,7 +148,6 @@
     }
 
     public void testReadCompositeAndWireIt() throws Exception {
-        DefaultArtifactResolver resolver = new DefaultArtifactResolver();
 
         InputStream is = getClass().getResourceAsStream("TestAllDivide.composite");
         Composite included = staxProcessors.read(is, Composite.class);

Modified: incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/ReadDocumentTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/ReadDocumentTestCase.java?view=diff&rev=533012&r1=533011&r2=533012
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/ReadDocumentTestCase.java
(original)
+++ incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/ReadDocumentTestCase.java
Fri Apr 27 01:19:35 2007
@@ -37,6 +37,7 @@
 public class ReadDocumentTestCase extends TestCase {
 
     private DefaultURLArtifactProcessorExtensionPoint documentProcessors;
+    private DefaultArtifactResolver resolver; 
 
     public void setUp() throws Exception {
         documentProcessors = new DefaultURLArtifactProcessorExtensionPoint();
@@ -51,14 +52,16 @@
         documentProcessors.addExtension(new CompositeDocumentProcessor(staxProcessors));
         documentProcessors.addExtension(new ComponentTypeDocumentProcessor(staxProcessors));
         documentProcessors.addExtension(new ConstrainingTypeDocumentProcessor(staxProcessors));
+
+        resolver = new DefaultArtifactResolver(getClass().getClassLoader());
     }
 
     public void tearDown() throws Exception {
         documentProcessors = null;
+        resolver = null;
     }
 
     public void testResolveConstrainingType() throws Exception {
-        DefaultArtifactResolver resolver = new DefaultArtifactResolver();
         
         URL url = getClass().getResource("CalculatorComponent.constrainingType");
         ConstrainingType constrainingType = (ConstrainingType)documentProcessors.read(url);
@@ -76,8 +79,6 @@
     }
 
     public void testResolveComposite() throws Exception {
-        DefaultArtifactResolver resolver = new DefaultArtifactResolver();
-        
         URL url = getClass().getResource("Calculator.composite");
         Composite nestedComposite = (Composite)documentProcessors.read(url);
         assertNotNull(nestedComposite);

Modified: incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/ResolveTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/ResolveTestCase.java?view=diff&rev=533012&r1=533011&r2=533012
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/ResolveTestCase.java
(original)
+++ incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/ResolveTestCase.java
Fri Apr 27 01:19:35 2007
@@ -40,20 +40,21 @@
 
     private XMLInputFactory inputFactory;
     private DefaultStAXArtifactProcessorExtensionPoint staxProcessors;
+    private DefaultArtifactResolver resolver; 
 
     public void setUp() throws Exception {
         inputFactory = XMLInputFactory.newInstance();
         staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint();
+        resolver = new DefaultArtifactResolver(getClass().getClassLoader());
     }
 
     public void tearDown() throws Exception {
         inputFactory = null;
         staxProcessors = null;
+        resolver = null;
     }
 
     public void testResolveConstrainingType() throws Exception {
-        DefaultArtifactResolver resolver = new DefaultArtifactResolver();
-        
         InputStream is = getClass().getResourceAsStream("CalculatorComponent.constrainingType");
         ConstrainingTypeProcessor constrainingTypeReader = new ConstrainingTypeProcessor(staxProcessors);
         XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
@@ -76,8 +77,6 @@
     }
 
     public void testResolveComposite() throws Exception {
-        DefaultArtifactResolver resolver = new DefaultArtifactResolver();
-        
         InputStream is = getClass().getResourceAsStream("Calculator.composite");
         CompositeProcessor compositeReader = new CompositeProcessor(staxProcessors);
         XMLStreamReader reader = inputFactory.createXMLStreamReader(is);

Modified: incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/WireTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/WireTestCase.java?view=diff&rev=533012&r1=533011&r2=533012
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/WireTestCase.java
(original)
+++ incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/WireTestCase.java
Fri Apr 27 01:19:35 2007
@@ -40,20 +40,21 @@
 
     private XMLInputFactory inputFactory;
     private DefaultStAXArtifactProcessorExtensionPoint staxProcessors;
+    private DefaultArtifactResolver resolver; 
 
     public void setUp() throws Exception {
         inputFactory = XMLInputFactory.newInstance();
         staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint();
+        resolver = new DefaultArtifactResolver(getClass().getClassLoader());
     }
 
     public void tearDown() throws Exception {
         inputFactory = null;
         staxProcessors = null;
+        resolver = null;
     }
 
     public void testResolveConstrainingType() throws Exception {
-        DefaultArtifactResolver resolver = new DefaultArtifactResolver();
-        
         InputStream is = getClass().getResourceAsStream("CalculatorComponent.constrainingType");
         ConstrainingTypeProcessor constrainingTypeReader = new ConstrainingTypeProcessor(staxProcessors);
         XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
@@ -77,8 +78,6 @@
     }
 
     public void testResolveComposite() throws Exception {
-        DefaultArtifactResolver resolver = new DefaultArtifactResolver();
-        
         InputStream is = getClass().getResourceAsStream("Calculator.composite");
         CompositeProcessor compositeReader = new CompositeProcessor(staxProcessors);
         XMLStreamReader reader = inputFactory.createXMLStreamReader(is);

Modified: incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/WriteAllTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/WriteAllTestCase.java?view=diff&rev=533012&r1=533011&r2=533012
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/WriteAllTestCase.java
(original)
+++ incubator/tuscany/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/WriteAllTestCase.java
Fri Apr 27 01:19:35 2007
@@ -37,16 +37,19 @@
  */
 public class WriteAllTestCase extends TestCase {
     private DefaultStAXArtifactProcessorExtensionPoint staxProcessors;
+    private DefaultArtifactResolver resolver; 
 
     public void setUp() throws Exception {
         staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint();
         staxProcessors.addExtension(new CompositeProcessor(staxProcessors));
         staxProcessors.addExtension(new ComponentTypeProcessor(staxProcessors));
         staxProcessors.addExtension(new ConstrainingTypeProcessor(staxProcessors));
+        resolver = new DefaultArtifactResolver(getClass().getClassLoader());
     }
 
     public void tearDown() throws Exception {
         staxProcessors = null;
+        resolver = null;
     }
 
     public void testReadWriteComposite() throws Exception {
@@ -59,7 +62,7 @@
     public void testReadWireWriteComposite() throws Exception {
         InputStream is = getClass().getResourceAsStream("TestAllCalculator.composite");
         Composite composite = staxProcessors.read(is, Composite.class);
-        staxProcessors.resolve(composite, new DefaultArtifactResolver());
+        staxProcessors.resolve(composite, resolver);
         staxProcessors.wire(composite);
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
         staxProcessors.write(composite, bos);
@@ -68,7 +71,7 @@
     public void testReadWriteComponentType() throws Exception {
         InputStream is = getClass().getResourceAsStream("CalculatorImpl.componentType");
         ComponentType componentType = staxProcessors.read(is, ComponentType.class);
-        staxProcessors.resolve(componentType, new DefaultArtifactResolver());
+        staxProcessors.resolve(componentType, resolver);
         staxProcessors.wire(componentType);
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
         staxProcessors.write(componentType, bos);
@@ -77,7 +80,7 @@
     public void testReadWriteConstrainingType() throws Exception {
         InputStream is = getClass().getResourceAsStream("CalculatorComponent.constrainingType");
         ConstrainingType constrainingType = staxProcessors.read(is, ConstrainingType.class);
-        staxProcessors.resolve(constrainingType, new DefaultArtifactResolver());
+        staxProcessors.resolve(constrainingType, resolver);
         staxProcessors.wire(constrainingType);
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
         staxProcessors.write(constrainingType, bos);

Added: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/resolver/ClassReference.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/resolver/ClassReference.java?view=auto&rev=533012
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/resolver/ClassReference.java
(added)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/resolver/ClassReference.java
Fri Apr 27 01:19:35 2007
@@ -0,0 +1,97 @@
+/*
+ * 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.    
+ */
+
+package org.apache.tuscany.contribution.resolver;
+
+import java.lang.ref.WeakReference;
+
+/**
+ * A weak reference to a class, which should be used to register classes
+ * with an ArtifactResolver and resolve these classes later.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ClassReference {
+    
+    private WeakReference<Class> clazz;
+    private String className;
+
+    /**
+     * Constructs a new ClassReference.
+     * 
+     * @param clazz
+     */
+    public ClassReference(Class clazz) {
+        this.clazz = new WeakReference<Class>(clazz);
+        this.className = clazz.getName();
+    }
+    
+    /**
+     * Constructs a new ClassReference.
+     * 
+     * @param className
+     */
+    public ClassReference(String className) {
+        this.className = className;
+    }
+    
+    /**
+     * Get the referenced class.
+     * @return
+     */
+    public Class getJavaClass() {
+        return clazz.get();
+    }
+    
+    /**
+     * Get the referenced class name.
+     * @return
+     */
+    public String getClassName() {
+        return className;
+    }
+    
+    /**
+     * Returns true if the class reference is unresolved.
+     * 
+     * @return
+     */
+    boolean isUnresolved() {
+        return clazz == null;
+    }
+
+    @Override
+    public int hashCode() {
+        return className.hashCode();
+    }
+    
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        } else {
+            if (obj instanceof ClassReference) {
+                return className.equals(((ClassReference)obj).className);
+            } else {
+                return false;
+            }
+        }
+    }
+
+}

Propchange: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/resolver/ClassReference.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/resolver/ClassReference.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/resolver/DefaultArtifactResolver.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/resolver/DefaultArtifactResolver.java?view=diff&rev=533012&r1=533011&r2=533012
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/resolver/DefaultArtifactResolver.java
(original)
+++ incubator/tuscany/java/sca/modules/contribution/src/main/java/org/apache/tuscany/contribution/resolver/DefaultArtifactResolver.java
Fri Apr 27 01:19:35 2007
@@ -19,6 +19,7 @@
 
 package org.apache.tuscany.contribution.resolver;
 
+import java.lang.ref.WeakReference;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -31,7 +32,13 @@
 public class DefaultArtifactResolver implements ArtifactResolver {
     private static final long serialVersionUID = -7826976465762296634L;
     
-    private Map<Object, Object> map = new HashMap<Object, Object>(); 
+    private Map<Object, Object> map = new HashMap<Object, Object>();
+    
+    private WeakReference<ClassLoader> classLoader;
+    
+    public DefaultArtifactResolver(ClassLoader classLoader) {
+        this.classLoader = new WeakReference<ClassLoader>(classLoader);
+    }
 
     public <T> T resolve(Class<T> modelClass, T unresolved) {
         Object resolved = map.get(unresolved);
@@ -39,6 +46,27 @@
             
             // Return the resolved object
             return modelClass.cast(resolved);
+            
+        } else if (unresolved instanceof ClassReference) {
+            
+            // Load a class on demand
+            ClassReference classReference = (ClassReference)unresolved;
+            Class clazz;
+            try {
+                clazz = Class.forName(classReference.getClassName(), true, classLoader.get());
+            } catch (ClassNotFoundException e) {
+                
+                // Return the unresolved object
+                return unresolved;
+            }
+            
+            // Store a new ClassReference wrappering the loaded class
+            resolved = new ClassReference(clazz);
+            map.put(resolved, resolved);
+            
+            // Return the resolved ClassReference
+            return modelClass.cast(resolved);
+                
         } else {
             
             // Return the unresolved object

Modified: incubator/tuscany/java/sca/modules/core-spring/src/test/java/test/application/context/TestRuntimeContext.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core-spring/src/test/java/test/application/context/TestRuntimeContext.java?view=diff&rev=533012&r1=533011&r2=533012
==============================================================================
--- incubator/tuscany/java/sca/modules/core-spring/src/test/java/test/application/context/TestRuntimeContext.java
(original)
+++ incubator/tuscany/java/sca/modules/core-spring/src/test/java/test/application/context/TestRuntimeContext.java
Fri Apr 27 01:19:35 2007
@@ -53,11 +53,12 @@
         staxProcessors.addExtension(new JavaImplementationProcessor());
         
         // Create a resolver
-        DefaultArtifactResolver resolver = new DefaultArtifactResolver();
+        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+        DefaultArtifactResolver resolver = new DefaultArtifactResolver(classLoader);
 
         try {
             // Parse the composite file
-            InputStream is = getClass().getClassLoader().getResourceAsStream(compositeFile);
+            InputStream is = classLoader.getResourceAsStream(compositeFile);
             Composite composite = staxProcessors.read(is, Composite.class);
             resolver.add(composite);
             

Modified: incubator/tuscany/java/sca/modules/core-spring/src/test/java/test/model/variant/VariantRuntimeContext.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core-spring/src/test/java/test/model/variant/VariantRuntimeContext.java?view=diff&rev=533012&r1=533011&r2=533012
==============================================================================
--- incubator/tuscany/java/sca/modules/core-spring/src/test/java/test/model/variant/VariantRuntimeContext.java
(original)
+++ incubator/tuscany/java/sca/modules/core-spring/src/test/java/test/model/variant/VariantRuntimeContext.java
Fri Apr 27 01:19:35 2007
@@ -74,11 +74,12 @@
             assemblyFactory, policyFactory, javaImplementationFactory, new DefaultJavaClassIntrospector()));
         
         // Create a resolver
-        DefaultArtifactResolver resolver = new DefaultArtifactResolver();
+        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+        DefaultArtifactResolver resolver = new DefaultArtifactResolver(classLoader);
 
         try {
             // Parse the composite file
-            InputStream is = getClass().getClassLoader().getResourceAsStream(compositeFile);
+            InputStream is = classLoader.getResourceAsStream(compositeFile);
             Composite composite = staxProcessors.read(is, Composite.class);
             resolver.add(composite);
             

Modified: incubator/tuscany/java/sca/modules/databinding-sdo/src/test/java/org/apache/tuscany/databinding/sdo/ImportSDOProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/databinding-sdo/src/test/java/org/apache/tuscany/databinding/sdo/ImportSDOProcessorTestCase.java?view=diff&rev=533012&r1=533011&r2=533012
==============================================================================
--- incubator/tuscany/java/sca/modules/databinding-sdo/src/test/java/org/apache/tuscany/databinding/sdo/ImportSDOProcessorTestCase.java
(original)
+++ incubator/tuscany/java/sca/modules/databinding-sdo/src/test/java/org/apache/tuscany/databinding/sdo/ImportSDOProcessorTestCase.java
Fri Apr 27 01:19:35 2007
@@ -18,9 +18,6 @@
  */
 package org.apache.tuscany.databinding.sdo;
 
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-
 import java.io.StringReader;
 import java.net.URI;
 
@@ -31,7 +28,6 @@
 import junit.framework.TestCase;
 
 import org.apache.tuscany.contribution.resolver.DefaultArtifactResolver;
-import org.easymock.EasyMock;
 
 import com.example.ipo.sdo.SdoFactory;
 
@@ -64,7 +60,7 @@
         assertFalse(inited);
         ImportSDO importSDO = loader.read(reader);
         assertNotNull(importSDO);
-        loader.resolve(importSDO, new DefaultArtifactResolver());
+        loader.resolve(importSDO, new DefaultArtifactResolver(getClass().getClassLoader()));
         assertTrue(inited);
     }
 

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=533012&r1=533011&r2=533012
==============================================================================
--- 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
Fri Apr 27 01:19:35 2007
@@ -145,7 +145,7 @@
 
         // Create contribution service
         ContributionRepository repository = new ContributionRepositoryImpl("target");
-        DefaultArtifactResolver artifactResolver = new DefaultArtifactResolver();
+        DefaultArtifactResolver artifactResolver = new DefaultArtifactResolver(getHostClassLoader());
         ContributionService contributionService = new ContributionServiceImpl(repository,
packageProcessors,
                                                                               documentProcessors,
artifactResolver);
         initialize(extensionRegistry);

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=533012&r1=533011&r2=533012
==============================================================================
--- 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
Fri Apr 27 01:19:35 2007
@@ -80,7 +80,7 @@
         Composite composite = compositeProcessor.read(reader);
         assertNotNull(composite);
         
-        ArtifactResolver resolver = new DefaultArtifactResolver();
+        ArtifactResolver resolver = new DefaultArtifactResolver(getClass().getClassLoader());
         staxProcessors.resolve(composite, resolver);
 
         new CompositeUtil(composite).configure(new ArrayList<Base>());

Modified: incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/introspect/DefaultWSDLInterfaceIntrospectorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/introspect/DefaultWSDLInterfaceIntrospectorTestCase.java?view=diff&rev=533012&r1=533011&r2=533012
==============================================================================
--- incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/introspect/DefaultWSDLInterfaceIntrospectorTestCase.java
(original)
+++ incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/introspect/DefaultWSDLInterfaceIntrospectorTestCase.java
Fri Apr 27 01:19:35 2007
@@ -55,7 +55,7 @@
     protected void setUp() throws Exception {
         super.setUp();
         registry = new WSDLDocumentProcessor();
-        resolver = new DefaultArtifactResolver();
+        resolver = new DefaultArtifactResolver(getClass().getClassLoader());
         URL url = getClass().getResource("../xml/stockquote.wsdl");
         definition = registry.read(url);
         portType = definition.getDefinition().getPortType(PORTTYPE_NAME);

Modified: incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/introspect/WSDLOperationTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/introspect/WSDLOperationTestCase.java?view=diff&rev=533012&r1=533011&r2=533012
==============================================================================
--- incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/introspect/WSDLOperationTestCase.java
(original)
+++ incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/introspect/WSDLOperationTestCase.java
Fri Apr 27 01:19:35 2007
@@ -52,7 +52,7 @@
     protected void setUp() throws Exception {
         super.setUp();
         processor = new WSDLDocumentProcessor();
-        resolver = new DefaultArtifactResolver();
+        resolver = new DefaultArtifactResolver(getClass().getClassLoader());
     }
 
     public final void testWrappedOperation() throws Exception {

Modified: incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java?view=diff&rev=533012&r1=533011&r2=533012
==============================================================================
--- incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java
(original)
+++ incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java
Fri Apr 27 01:19:35 2007
@@ -48,7 +48,7 @@
     protected void setUp() throws Exception {
         super.setUp();
         registry = new WSDLDocumentProcessor();
-        resolver = new DefaultArtifactResolver();
+        resolver = new DefaultArtifactResolver(getClass().getClassLoader());
     }
 
     public final void testWrappedOperation() 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