Author: rfeng
Date: Thu Jan 15 16:52:30 2009
New Revision: 734877

URL: http://svn.apache.org/viewvc?rev=734877&view=rev
Log:
Bring up the equinox-based junit plugin for maven

Added:
    
tuscany/java/sca/samples/calculator-osgi/src/test/java/calculator/CalculatorTestCase.java
   (with props)
    
tuscany/java/sca/tools/maven/maven-osgi-junit/src/main/java/org/apache/tuscany/sca/
    
tuscany/java/sca/tools/maven/maven-osgi-junit/src/main/java/org/apache/tuscany/sca/equinox/
    
tuscany/java/sca/tools/maven/maven-osgi-junit/src/main/java/org/apache/tuscany/sca/equinox/junit/
    
tuscany/java/sca/tools/maven/maven-osgi-junit/src/main/java/org/apache/tuscany/sca/equinox/junit/plugin/
   (props changed)
      - copied from r734534, 
tuscany/java/sca/tools/maven/maven-osgi-junit/src/main/java/org/apache/tuscany/tools/sca/osgi/junit/plugin/
Removed:
    
tuscany/java/sca/tools/maven/maven-osgi-junit/src/main/java/org/apache/tuscany/tools/sca/osgi/junit/plugin/
Modified:
    
tuscany/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.java
    
tuscany/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java
    tuscany/java/sca/samples/calculator-osgi/pom.xml
    
tuscany/java/sca/tools/maven/maven-osgi-junit/src/main/java/org/apache/tuscany/sca/equinox/junit/plugin/OSGiJUnitMojo.java
    
tuscany/java/sca/tools/runtime-inspector/src/main/java/org/apache/tuscany/sca/tools/inspector/AssemblyInspector.java
    
tuscany/java/sca/tools/runtime-inspector/src/main/java/org/apache/tuscany/sca/tools/inspector/RegistryInspector.java
    
tuscany/java/sca/tools/runtime-inspector/src/main/java/org/apache/tuscany/sca/tools/inspector/RuntimeInspector.java

Modified: 
tuscany/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.java
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.java?rev=734877&r1=734876&r2=734877&view=diff
==============================================================================
--- 
tuscany/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.java
 (original)
+++ 
tuscany/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.java
 Thu Jan 15 16:52:30 2009
@@ -30,7 +30,10 @@
 import static 
org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.thisBundleLocation;
 
 import java.io.File;
+import java.io.FileNotFoundException;
 import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -55,12 +58,14 @@
     private BundleContext bundleContext;
     private Bundle launcherBundle;
     private boolean startedEclipse;
+    private Set<URL> dependencies;
     private List<String> bundleFiles =  new ArrayList<String>();
     private List<String> bundleNames =  new ArrayList<String>();
     private List<String> jarFiles = new ArrayList<String>();
     private Map<String, Bundle> allBundles = new HashMap<String, Bundle>();
     private List<Bundle> installedBundles = new ArrayList<Bundle>();
 
+    /*
     private final static String systemPackages =
             "org.osgi.framework; version=1.3.0,"
             + "org.osgi.service.packageadmin; version=1.2.0, "
@@ -113,6 +118,15 @@
             + "org.omg.PortableInterceptor, "
             + "org.omg.stub.java.rmi, "
             + "javax.rmi.CORBA";
+    */
+    public EquinoxHost() {
+        super();
+    }
+    
+    public EquinoxHost(Set<URL> dependencies) {
+        super();
+        this.dependencies = dependencies;
+    }
     
     /**
      * Start the Equinox host.
@@ -167,17 +181,7 @@
             
             // Determine the runtime classpath entries
             Set<URL> urls;
-            if (!startedEclipse) {
-                
-                // Use classpath entries from a distribution if there is one 
and the modules
-                // directories available in a dev environment for example
-                urls = runtimeClasspathEntries(true, false, true);
-            } else {
-                
-                // Use classpath entries from a distribution if there is one 
and the classpath
-                // entries on the current application's classloader
-                urls = runtimeClasspathEntries(true, true, false);
-            }
+            urls = findDependencies();
 
             // Sort out which are bundles (and not already installed) and 
which are just
             // regular JARs
@@ -325,6 +329,23 @@
         }
     }
 
+    private Set<URL> findDependencies() throws FileNotFoundException, 
URISyntaxException, MalformedURLException {
+        if (dependencies == null) {
+            if (!startedEclipse) {
+
+                // Use classpath entries from a distribution if there is one 
and the modules
+                // directories available in a dev environment for example
+                dependencies = runtimeClasspathEntries(true, false, true);
+            } else {
+
+                // Use classpath entries from a distribution if there is one 
and the classpath
+                // entries on the current application's classloader
+                dependencies = runtimeClasspathEntries(true, true, false);
+            }
+        }
+        return dependencies;
+    }
+
     /**
      * Stop the Equinox host.
      */

Modified: 
tuscany/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java?rev=734877&r1=734876&r2=734877&view=diff
==============================================================================
--- 
tuscany/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java
 (original)
+++ 
tuscany/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java
 Thu Jan 15 16:52:30 2009
@@ -261,23 +261,68 @@
      */
     private static void addPackages(String jarFile, Set<String> packages) 
throws IOException {
         String version = ";version=" + jarVersion(jarFile);
-        ZipInputStream is = new ZipInputStream(new FileInputStream(file(new 
URL(jarFile))));
-        ZipEntry entry;
-        while ((entry = is.getNextEntry()) != null) {
-            String entryName = entry.getName();
-            if (!entry.isDirectory() && entryName != null
-                && entryName.length() > 0
-                && !entryName.startsWith(".")
-                && entryName.endsWith(".class") // Exclude resources from 
Export-Package
-                && entryName.lastIndexOf("/") > 0) {
-                String pkg = entryName.substring(0, 
entryName.lastIndexOf("/")).replace('/', '.') + version;
+        File file = file(new URL(jarFile));
+        if (file.isDirectory()) {
+            List<String> classFiles = listClassFiles(file);
+            for (String cls : classFiles) {
+                int index = cls.lastIndexOf('/');
+                String pkg = cls.substring(0, index);
+                pkg = pkg.replace('/', '.') + version;
                 packages.add(pkg);
             }
+        } else if (file.isFile()) {
+            ZipInputStream is = new ZipInputStream(new FileInputStream(file));
+            ZipEntry entry;
+            while ((entry = is.getNextEntry()) != null) {
+                String entryName = entry.getName();
+                if (!entry.isDirectory() && entryName != null
+                    && entryName.length() > 0
+                    && !entryName.startsWith(".")
+                    && entryName.endsWith(".class") // Exclude resources from 
Export-Package
+                    && entryName.lastIndexOf("/") > 0) {
+                    String pkg = entryName.substring(0, 
entryName.lastIndexOf("/")).replace('/', '.') + version;
+                    packages.add(pkg);
+                }
+            }
+            is.close();
         }
-        is.close();
+    }
+    
+    private static List<String> listClassFiles(File directory) {
+        List<String> artifacts = new ArrayList<String>();
+        traverse(artifacts, directory, directory);
+        return artifacts;
     }
 
     /**
+     * Recursively traverse a root directory
+     * 
+     * @param fileList
+     * @param file
+     * @param root
+     * @throws IOException
+     */
+    private static void traverse(List<String> fileList, File file, File root) {
+        if (file.isFile() && file.getName().endsWith(".class")) {
+            fileList.add(root.toURI().relativize(file.toURI()).toString());
+        } else if (file.isDirectory()) {
+            String uri = root.toURI().relativize(file.toURI()).toString();
+            if (uri.endsWith("/")) {
+                uri = uri.substring(0, uri.length() - 1);
+            }
+            fileList.add(uri);
+            
+            File[] files = file.listFiles();
+            for (File f: files) {
+                if (!f.getName().startsWith(".")) {
+                    traverse(fileList, f, root);
+                }
+            }
+        }
+    }
+
+
+    /**
      * Generate a manifest from a list of third-party JAR files.
      * 
      * @param jarFiles
@@ -362,7 +407,11 @@
         if (url == null) {
             throw new FileNotFoundException(resource);
         }
-        URI uri = url.toURI();
+        String str = url.toString();
+        if (str.contains(" ")) {
+            str = str.replace(" ", "%20");
+        }
+        URI uri = URI.create(str);
 
         String scheme = uri.getScheme();
         if (scheme.equals("jar")) {
@@ -506,7 +555,9 @@
         } else {
             JarFile jar = new JarFile(file, false);
             Manifest manifest = jar.getManifest();
-            bundleName = 
manifest.getMainAttributes().getValue(BUNDLE_SYMBOLICNAME);
+            if (manifest != null) {
+                bundleName = 
manifest.getMainAttributes().getValue(BUNDLE_SYMBOLICNAME);
+            }
             jar.close();
         }
         if (bundleName == null) {

Modified: tuscany/java/sca/samples/calculator-osgi/pom.xml
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/samples/calculator-osgi/pom.xml?rev=734877&r1=734876&r2=734877&view=diff
==============================================================================
--- tuscany/java/sca/samples/calculator-osgi/pom.xml (original)
+++ tuscany/java/sca/samples/calculator-osgi/pom.xml Thu Jan 15 16:52:30 2009
@@ -115,6 +115,21 @@
                     </archive>
                 </configuration>
             </plugin>
+            
+            <plugin>
+                <groupId>org.apache.tuscany.sca</groupId>
+                <artifactId>tuscany-maven-osgi-junit</artifactId>
+                <executions>
+                    <execution>
+                        <id>osgi-test</id>
+                        <phase>test</phase>
+                        <goals>
+                            <goal>test</goal>
+                        </goals>
+                    </execution>
+                    <configuration></configuration>
+                </executions>
+            </plugin>
         </plugins>
     </build>
 </project>

Added: 
tuscany/java/sca/samples/calculator-osgi/src/test/java/calculator/CalculatorTestCase.java
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/samples/calculator-osgi/src/test/java/calculator/CalculatorTestCase.java?rev=734877&view=auto
==============================================================================
--- 
tuscany/java/sca/samples/calculator-osgi/src/test/java/calculator/CalculatorTestCase.java
 (added)
+++ 
tuscany/java/sca/samples/calculator-osgi/src/test/java/calculator/CalculatorTestCase.java
 Thu Jan 15 16:52:30 2009
@@ -0,0 +1,55 @@
+/*
+ * 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 calculator;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * This shows how to test the Calculator composition.
+ */
+public class CalculatorTestCase {
+
+    private static Node node;   
+    
+    @BeforeClass
+    public static void setUpBeforeClass() throws Exception {
+        String location = 
ContributionLocationHelper.getContributionLocation(CalculatorClient.class);
+        node = NodeFactory.newInstance().createNode("Calculator.composite", 
new Contribution("test", location));
+        System.out.println("SCA Node API ClassLoader: " + 
node.getClass().getClassLoader());
+        node.start();
+    }
+
+    @AfterClass
+    public static void tearDownAfterClass() throws Exception {
+        if (node != null) {
+            node.stop();
+            node.destroy();
+        }
+    }
+
+    @Test
+    public void testDummy() throws Exception {
+    }
+}

Propchange: 
tuscany/java/sca/samples/calculator-osgi/src/test/java/calculator/CalculatorTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
tuscany/java/sca/samples/calculator-osgi/src/test/java/calculator/CalculatorTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: 
tuscany/java/sca/tools/maven/maven-osgi-junit/src/main/java/org/apache/tuscany/sca/equinox/junit/plugin/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Thu Jan 15 16:52:30 2009
@@ -0,0 +1 @@
+/tuscany/branches/sca-java-1.3/tools/maven/maven-osgi-junit/src/main/java/org/apache/tuscany/tools/sca/osgi/junit/plugin:671193,680620-680628

Modified: 
tuscany/java/sca/tools/maven/maven-osgi-junit/src/main/java/org/apache/tuscany/sca/equinox/junit/plugin/OSGiJUnitMojo.java
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/tools/maven/maven-osgi-junit/src/main/java/org/apache/tuscany/sca/equinox/junit/plugin/OSGiJUnitMojo.java?rev=734877&r1=734534&r2=734877&view=diff
==============================================================================
--- 
tuscany/java/sca/tools/maven/maven-osgi-junit/src/main/java/org/apache/tuscany/sca/equinox/junit/plugin/OSGiJUnitMojo.java
 (original)
+++ 
tuscany/java/sca/tools/maven/maven-osgi-junit/src/main/java/org/apache/tuscany/sca/equinox/junit/plugin/OSGiJUnitMojo.java
 Thu Jan 15 16:52:30 2009
@@ -16,16 +16,22 @@
  * specific language governing permissions and limitations
  * under the License.    
  */
-package org.apache.tuscany.tools.sca.osgi.junit.plugin;
+package org.apache.tuscany.sca.equinox.junit.plugin;
 
 import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
 import java.lang.reflect.Method;
 import java.net.MalformedURLException;
 import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
+import java.util.jar.JarOutputStream;
+import java.util.jar.Manifest;
+import java.util.zip.ZipEntry;
 
 import junit.framework.Assert;
 
@@ -45,7 +51,7 @@
 /**
  * @version $Rev$ $Date$
  * @goal test
- * @phase integration-test
+ * @phase test
  * @requiresDependencyResolution test
  * @description Run the unit test with OSGi
  */
@@ -103,11 +109,6 @@
      */
     protected java.util.List remoteRepos;
 
-    /**
-     * @parameter
-     */
-    protected String osgiRuntime;
-
     protected Artifact getArtifact(String groupId, String artifactId) throws 
MojoExecutionException {
         Artifact artifact;
         VersionRange vr;
@@ -165,15 +166,47 @@
         }
         return sb.toString();
     }
+    
+    private void generateJar(File root, File jar, Manifest mf) throws 
IOException {
+        getLog().info("Generating " + jar.toString());
+        FileOutputStream fos = new FileOutputStream(jar);
+        JarOutputStream jos = mf != null ? new JarOutputStream(fos, mf) : new 
JarOutputStream(fos);
+        addDir(jos, root, root);
+        jos.close();
+    }
 
-
+    private void addDir(JarOutputStream jos, File root, File dir) throws 
IOException, FileNotFoundException {
+        for (File file : dir.listFiles()) {
+            if (file.isDirectory()) {
+                addDir(jos, root, file);
+            } else if (file.isFile()) {
+                // getLog().info(file.toString());
+                String uri = root.toURI().relativize(file.toURI()).toString();
+                ZipEntry entry = new ZipEntry(uri);
+                jos.putNextEntry(entry);
+                byte[] buf = new byte[4096];
+                FileInputStream in = new FileInputStream(file);
+                for (;;) {
+                    int len = in.read(buf);
+                    if (len > 0) {
+                        jos.write(buf, 0, len);
+                    } else {
+                        break;
+                    }
+                }
+                in.close();
+                jos.closeEntry();
+            }
+        }
+    }
+    
     public void execute() throws MojoExecutionException {
         if (project.getPackaging().equals("pom")) {
             return;
         }
 
         Log log = getLog();
-        List<URL> jarFiles = new ArrayList<URL>();
+        Set<URL> jarFiles = new HashSet<URL>();
         for (Object o : project.getArtifacts()) {
             Artifact a = (Artifact)o;
             try {
@@ -189,53 +222,61 @@
         /*
          * Add org.apache.tuscany.sca:tuscany-extensibility-osgi module
          */
-        String aid = "equinox".equals(osgiRuntime) ? 
"tuscany-extensibility-equinox" : "tuscany-extensibility-osgi";
+        String aid = "tuscany-extensibility-equinox";
         Artifact ext = getArtifact("org.apache.tuscany.sca", aid);
         try {
             URL url = ext.getFile().toURI().toURL();
-            if (!jarFiles.contains(url)) {
-                if (log.isDebugEnabled()) {
-                    log.debug("Adding: " + ext);
-                }
-                jarFiles.add(url);
+            if (log.isDebugEnabled()) {
+                log.debug("Adding: " + ext);
             }
+            jarFiles.add(url);
         } catch (MalformedURLException e) {
             getLog().error(e);
         }
+        
+        File mainJar = new File(project.getBuild().getDirectory(), 
project.getArtifactId()+"-osgi.jar");
+        File testJar = new File(project.getBuild().getDirectory(), 
project.getArtifactId()+"-test-osgi.jar");
+        try {
+            generateJar(new File(project.getBuild().getOutputDirectory()), 
mainJar, null);
+            generateJar(new File(project.getBuild().getTestOutputDirectory()), 
testJar, null);
+            jarFiles.add(mainJar.toURI().toURL());
+            jarFiles.add(testJar.toURI().toURL());
+        } catch (IOException e) {
+            getLog().error(e);
+        }
+        
+        if (log.isDebugEnabled()) {
+            for (URL url : jarFiles) {
+                getLog().debug(url.toString());
+            }
+        }
 
-        //        String home = new File(basedir, "target/tuscany").toString();
-        //        System.setProperty("TUSCANY_HOME", home);
-        //        getLog().info(home);
         try {
-            EquinoxHost host = new EquinoxHost();
+            EquinoxHost host = new EquinoxHost(jarFiles);
             BundleContext context = host.start();
 
-            for (Bundle b : context.getBundles()) {
-                if (getLog().isDebugEnabled()) {
+            if (getLog().isDebugEnabled()) {
+                for (Bundle b : context.getBundles()) {
                     getLog().debug(string(b, false));
                 }
             }
+            Bundle testBundle = null;
+            String libraryBundleName = 
"org.apache.tuscany.sca.node.launcher.equinox.libraries";
+            for(Bundle bundle: context.getBundles()) {
+                if(libraryBundleName.equals(bundle.getSymbolicName())) {
+                    testBundle = bundle;
+                    break;
+                }
+            }
 
-            ClassLoader tccl = Thread.currentThread().getContextClassLoader();
-            URL[] urls =
-                new URL[] {new 
File(project.getBuild().getOutputDirectory()).toURI().toURL(),
-                           new 
File(project.getBuild().getTestOutputDirectory()).toURI().toURL()};
-
-            URLClassLoader cl = new URLClassLoader(urls, tccl);
-            Thread.currentThread().setContextClassLoader(cl);
             try {
-                runAllTestsFromDirs(cl, 
project.getBuild().getTestOutputDirectory());
+                runAllTestsFromDirs(testBundle, 
project.getBuild().getTestOutputDirectory());
             } finally {
-                Thread.currentThread().setContextClassLoader(tccl);
+                host.stop();
             }
-            host.stop();
         } catch (Throwable e) {
             throw new MojoExecutionException(e.getMessage(), e);
         }
-        //        finally {
-        //            System.clearProperty("TUSCANY_HOME");
-        //        }
-
     }
 
     public void getTestCases(File dir, String prefix, HashSet<String> 
testCaseSet) {
@@ -254,14 +295,14 @@
         }
     }
 
-    public void runAllTestsFromDirs(ClassLoader testClassLoader, String 
testDir) throws Exception {
+    public void runAllTestsFromDirs(Bundle testBundle, String testDir) throws 
Exception {
 
         int failures = 0;
         HashSet<String> testCaseSet = new HashSet<String>();
         getTestCases(new File(testDir), null, testCaseSet);
         for (String className : testCaseSet) {
-            Class testClass = testClassLoader.loadClass(className);
-            failures += runTestCase(testClassLoader, testClass);
+            Class testClass = testBundle.loadClass(className);
+            failures += runTestCase(testBundle, testClass);
         }
 
         Assert.assertEquals(0, failures);
@@ -270,18 +311,18 @@
 
     /**
      * Use java reflection to call JUNIT as the JUNIT might be in the bundles
-     * @param testClassLoader
+     * @param testBundle
      * @param testClass
      * @return
      * @throws Exception
      */
-    public int runTestCase(ClassLoader testClassLoader, Class testClass) 
throws Exception {
+    public int runTestCase(Bundle testBundle, Class testClass) throws 
Exception {
 
         if (testClass.getName().endsWith("TestCase")) {
             getLog().info("Running: " + testClass.getName());
-            Class coreClass = Class.forName("org.junit.runner.JUnitCore", 
true, testClassLoader);
+            Class coreClass = 
testBundle.loadClass("org.junit.runner.JUnitCore");
             Object core = coreClass.newInstance();
-            Class reqClass = Class.forName("org.junit.runner.Request", true, 
testClassLoader);
+            Class reqClass = testBundle.loadClass("org.junit.runner.Request");
             Method aClass = reqClass.getMethod("aClass", Class.class);
             Object req = aClass.invoke(null, testClass);
             Method run = coreClass.getMethod("run", reqClass);
@@ -291,7 +332,7 @@
             List failureList = 
(List)result.getClass().getMethod("getFailures").invoke(result);
 
             int failures = 0, errors = 0;
-            Class errorClass = 
Class.forName("junit.framework.AssertionFailedError", true, testClassLoader);
+            Class errorClass = 
testBundle.loadClass("junit.framework.AssertionFailedError");
             for (Object f : failureList) {
                 Object ex = f.getClass().getMethod("getException").invoke(f);
                 if (errorClass.isInstance(ex)) {

Modified: 
tuscany/java/sca/tools/runtime-inspector/src/main/java/org/apache/tuscany/sca/tools/inspector/AssemblyInspector.java
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/tools/runtime-inspector/src/main/java/org/apache/tuscany/sca/tools/inspector/AssemblyInspector.java?rev=734877&r1=734876&r2=734877&view=diff
==============================================================================
--- 
tuscany/java/sca/tools/runtime-inspector/src/main/java/org/apache/tuscany/sca/tools/inspector/AssemblyInspector.java
 (original)
+++ 
tuscany/java/sca/tools/runtime-inspector/src/main/java/org/apache/tuscany/sca/tools/inspector/AssemblyInspector.java
 Thu Jan 15 16:52:30 2009
@@ -22,11 +22,11 @@
 import javax.xml.stream.XMLStreamWriter;
 
 import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
 import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
 import 
org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
 import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.node.Node;
 import org.apache.tuscany.sca.node.impl.NodeImpl;
 
 
@@ -36,7 +36,7 @@
 public class AssemblyInspector {
     
 
-    public String assemblyAsString(SCANode node) {
+    public String assemblyAsString(Node node) {
         StringBuffer assemblyString = new StringBuffer();
         
         // get at the node internals
@@ -44,7 +44,7 @@
         ExtensionPointRegistry registry = 
((NodeImpl)node).getExtensionPointRegistry();
         
         // Get the output factory 
-        ModelFactoryExtensionPoint modelFactories = 
registry.getExtensionPoint(ModelFactoryExtensionPoint.class);
+        FactoryExtensionPoint modelFactories = 
registry.getExtensionPoint(FactoryExtensionPoint.class);
         XMLOutputFactory outputFactory = 
modelFactories.getFactory(XMLOutputFactory.class);
         StAXArtifactProcessorExtensionPoint staxProcessors = 
registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
         StAXArtifactProcessor<Composite> compositeProcessor = 
(StAXArtifactProcessor<Composite>)staxProcessors.getProcessor(Composite.class);

Modified: 
tuscany/java/sca/tools/runtime-inspector/src/main/java/org/apache/tuscany/sca/tools/inspector/RegistryInspector.java
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/tools/runtime-inspector/src/main/java/org/apache/tuscany/sca/tools/inspector/RegistryInspector.java?rev=734877&r1=734876&r2=734877&view=diff
==============================================================================
--- 
tuscany/java/sca/tools/runtime-inspector/src/main/java/org/apache/tuscany/sca/tools/inspector/RegistryInspector.java
 (original)
+++ 
tuscany/java/sca/tools/runtime-inspector/src/main/java/org/apache/tuscany/sca/tools/inspector/RegistryInspector.java
 Thu Jan 15 16:52:30 2009
@@ -23,7 +23,7 @@
 import java.util.Set;
 
 import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.Node;
 import org.apache.tuscany.sca.node.impl.NodeImpl;
 
 
@@ -32,7 +32,7 @@
  */
 public class RegistryInspector {
 
-    public String registryAsString(SCANode node) {
+    public String registryAsString(Node node) {
         StringBuffer extensionPointRegistryString = new 
StringBuffer("Extension Point Registry \n");
         
         // Get the interesting extension points out of the registry and print 
them out

Modified: 
tuscany/java/sca/tools/runtime-inspector/src/main/java/org/apache/tuscany/sca/tools/inspector/RuntimeInspector.java
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/tools/runtime-inspector/src/main/java/org/apache/tuscany/sca/tools/inspector/RuntimeInspector.java?rev=734877&r1=734876&r2=734877&view=diff
==============================================================================
--- 
tuscany/java/sca/tools/runtime-inspector/src/main/java/org/apache/tuscany/sca/tools/inspector/RuntimeInspector.java
 (original)
+++ 
tuscany/java/sca/tools/runtime-inspector/src/main/java/org/apache/tuscany/sca/tools/inspector/RuntimeInspector.java
 Thu Jan 15 16:52:30 2009
@@ -35,9 +35,8 @@
 import java.util.Set;
 
 import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.Node;
 import org.apache.tuscany.sca.node.impl.NodeImpl;
-import org.w3c.dom.Node;
 
 
 /**
@@ -56,7 +55,7 @@
         }
     }    
 
-    public String runtimeAsString(SCANode node) {
+    public String runtimeAsString(Node node) {
         StringBuffer assemblyString = new StringBuffer();
         this.out = new PrintWriter(new OutputStreamWriter(System.out), true);
         


Reply via email to