Author: jboynes
Date: Sat Sep  9 09:43:24 2006
New Revision: 441816

URL: http://svn.apache.org/viewvc?view=rev&rev=441816
Log:
remove duplicate scdl from webapp and make paths consistent

Added:
    
incubator/tuscany/java/sca/runtime/webapp-host/src/main/resources/META-INF/tuscany/
    
incubator/tuscany/java/sca/runtime/webapp-host/src/main/resources/META-INF/tuscany/webapp.scdl
   (contents, props changed)
      - copied, changed from r441805, 
incubator/tuscany/java/sca/runtime/webapp-host/src/main/resources/META-INF/sca/webapp.system.scdl
Removed:
    
incubator/tuscany/java/sca/runtime/webapp-host/src/main/resources/META-INF/sca/composite.scdl
    
incubator/tuscany/java/sca/runtime/webapp-host/src/main/resources/META-INF/sca/implementation.scdl
    
incubator/tuscany/java/sca/runtime/webapp-host/src/main/resources/META-INF/sca/interfaceJava.scdl
    
incubator/tuscany/java/sca/runtime/webapp-host/src/main/resources/META-INF/sca/javaImplementation.scdl
    
incubator/tuscany/java/sca/runtime/webapp-host/src/main/resources/META-INF/sca/loader.scdl
    
incubator/tuscany/java/sca/runtime/webapp-host/src/main/resources/META-INF/sca/systemImplementation.scdl
    
incubator/tuscany/java/sca/runtime/webapp-host/src/main/resources/META-INF/sca/webapp.system.scdl
Modified:
    
incubator/tuscany/java/sca/runtime/webapp-host/src/main/java/org/apache/tuscany/runtime/webapp/ServletLauncherListener.java
    
incubator/tuscany/java/sca/runtime/webapp-host/src/test/java/org/apache/tuscany/runtime/webapp/ServletLauncherListenerTestCase.java
    
incubator/tuscany/java/sca/runtime/webapp/src/main/java/org/apache/tuscany/runtime/webapp/Constants.java

Modified: 
incubator/tuscany/java/sca/runtime/webapp-host/src/main/java/org/apache/tuscany/runtime/webapp/ServletLauncherListener.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/webapp-host/src/main/java/org/apache/tuscany/runtime/webapp/ServletLauncherListener.java?view=diff&rev=441816&r1=441815&r2=441816
==============================================================================
--- 
incubator/tuscany/java/sca/runtime/webapp-host/src/main/java/org/apache/tuscany/runtime/webapp/ServletLauncherListener.java
 (original)
+++ 
incubator/tuscany/java/sca/runtime/webapp-host/src/main/java/org/apache/tuscany/runtime/webapp/ServletLauncherListener.java
 Sat Sep  9 09:43:24 2006
@@ -46,7 +46,6 @@
 import 
org.apache.tuscany.core.implementation.system.model.SystemCompositeImplementation;
 import org.apache.tuscany.core.launcher.CompositeContextImpl;
 import org.apache.tuscany.core.launcher.LauncherImpl;
-import static 
org.apache.tuscany.core.launcher.LauncherImpl.METAINF_SYSTEM_SCDL_PATH;
 import org.apache.tuscany.core.monitor.MonitorFactoryUtil;
 import org.apache.tuscany.host.MonitorFactory;
 import org.apache.tuscany.host.servlet.ServletRequestInjector;
@@ -88,7 +87,7 @@
         // Read optional path to system SCDL from context-param
         String systemScdlPath = 
servletContext.getInitParameter(SYSTEM_SCDL_PATH_PARAM);
         if (systemScdlPath == null) {
-            systemScdlPath = "/" + METAINF_SYSTEM_SCDL_PATH;
+            systemScdlPath = Constants.WEBAPP_SYSTEM_SCDL_PATH;
         }
 
         // Read optional path to application SCDL from context-param
@@ -120,9 +119,11 @@
 
             // load extensions
             Set<String> paths = 
servletContext.getResourcePaths(extensionScdlPath);
-            for (String path : paths) {
-                monitor.deployExtension(path);
-                deployExtension(rt, path, servletContext.getResource(path));
+            if (paths != null) {
+                for (String path : paths) {
+                    monitor.deployExtension(path);
+                    deployExtension(rt, path, 
servletContext.getResource(path));
+                }
             }
 
             // FIXME this is too coupled to the configuration
@@ -310,7 +311,7 @@
         if (testSystemScdl != null) {
             systemScdl = testSystemScdl;
         } else {
-            systemScdl = getClass().getResource(path);
+            systemScdl = getClass().getClassLoader().getResource(path);
             if (systemScdl == null) {
                 MissingResourceException e = new 
MissingResourceException("System SCDL not found");
                 e.setIdentifier(path);

Copied: 
incubator/tuscany/java/sca/runtime/webapp-host/src/main/resources/META-INF/tuscany/webapp.scdl
 (from r441805, 
incubator/tuscany/java/sca/runtime/webapp-host/src/main/resources/META-INF/sca/webapp.system.scdl)
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/webapp-host/src/main/resources/META-INF/tuscany/webapp.scdl?view=diff&rev=441816&p1=incubator/tuscany/java/sca/runtime/webapp-host/src/main/resources/META-INF/sca/webapp.system.scdl&r1=441805&p2=incubator/tuscany/java/sca/runtime/webapp-host/src/main/resources/META-INF/tuscany/webapp.scdl&r2=441816
==============================================================================
--- 
incubator/tuscany/java/sca/runtime/webapp-host/src/main/resources/META-INF/sca/webapp.system.scdl
 (original)
+++ 
incubator/tuscany/java/sca/runtime/webapp-host/src/main/resources/META-INF/tuscany/webapp.scdl
 Sat Sep  9 09:43:24 2006
@@ -24,7 +24,7 @@
 -->
 <composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
            xmlns:system="http://tuscany.apache.org/xmlns/system/1.0-SNAPSHOT";
-           name="org.apache.tuscany.test.System">
+           name="org.apache.tuscany.runtime.webapp.System">
 
     <!-- Component that provides the Deployer service -->
     <component name="deployer">
@@ -79,22 +79,22 @@
     </component>
 
     <!-- include loader configuration -->
-    <include name="org.apache.tuscany.test.Loader" scdlLocation="loader.scdl"/>
+    <include name="org.apache.tuscany.launcher.Loader" 
scdlResource="org/apache/tuscany/core/loader.scdl"/>
 
     <!-- include implementation processor configuration -->
-    <include name="org.apache.tuscany.test.Implementation" 
scdlLocation="implementation.scdl"/>
+    <include name="org.apache.tuscany.launcher.Implementation" 
scdlResource="org/apache/tuscany/core/implementation.scdl"/>
 
     <!-- Java interface definition language -->
-    <include name="org.apache.tuscany.launcher.InterfaceJava" 
scdlLocation="interfaceJava.scdl"/>
+    <include name="org.apache.tuscany.launcher.InterfaceJava" 
scdlResource="org/apache/tuscany/core/interfaceJava.scdl"/>
 
     <!-- include omposite implementation type -->
-    <include name="org.apache.tuscany.test.Composite" 
scdlLocation="composite.scdl"/>
+    <include name="org.apache.tuscany.launcher.Composite" 
scdlResource="org/apache/tuscany/core/composite.scdl"/>
 
     <!-- System implementation type -->
-    <include name="org.apache.tuscany.test.SystemImplementation" 
scdlLocation="systemImplementation.scdl"/>
+    <include name="org.apache.tuscany.launcher.SystemImplementation" 
scdlResource="org/apache/tuscany/core/systemImplementation.scdl"/>
 
     <!-- Java implementation type -->
-    <include name="org.apache.tuscany.test.JavaImplementation" 
scdlLocation="javaImplementation.scdl"/>
+    <include name="org.apache.tuscany.launcher.JavaImplementation" 
scdlResource="org/apache/tuscany/core/javaImplementation.scdl"/>
 
     <!-- component that scans the extension directory -->
     <component name="directoryScanExtender">

Propchange: 
incubator/tuscany/java/sca/runtime/webapp-host/src/main/resources/META-INF/tuscany/webapp.scdl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
incubator/tuscany/java/sca/runtime/webapp-host/src/main/resources/META-INF/tuscany/webapp.scdl
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: 
incubator/tuscany/java/sca/runtime/webapp-host/src/main/resources/META-INF/tuscany/webapp.scdl
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: 
incubator/tuscany/java/sca/runtime/webapp-host/src/test/java/org/apache/tuscany/runtime/webapp/ServletLauncherListenerTestCase.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/webapp-host/src/test/java/org/apache/tuscany/runtime/webapp/ServletLauncherListenerTestCase.java?view=diff&rev=441816&r1=441815&r2=441816
==============================================================================
--- 
incubator/tuscany/java/sca/runtime/webapp-host/src/test/java/org/apache/tuscany/runtime/webapp/ServletLauncherListenerTestCase.java
 (original)
+++ 
incubator/tuscany/java/sca/runtime/webapp-host/src/test/java/org/apache/tuscany/runtime/webapp/ServletLauncherListenerTestCase.java
 Sat Sep  9 09:43:24 2006
@@ -36,14 +36,15 @@
  * @version $Rev$ $Date$
  */
 public class ServletLauncherListenerTestCase extends TestCase {
+    private URL systemScdl;
+    private ServletLauncherListener listener;
 
     /**
      * Verifies the web app host is configured properly to perform a basic boot
      */
     public void testBoot() throws Exception {
         final TuscanyWebappRuntime[] runtime = new TuscanyWebappRuntime[1];
-        ServletLauncherListener listener = new ServletLauncherListener();
-        
listener.setTestSystemScdl(getClass().getClassLoader().getResource("META-INF/sca/webapp.system.scdl"));
+        listener.setTestSystemScdl(systemScdl);
         ServletContext context = EasyMock.createNiceMock(ServletContext.class);
         expect(context.getServletContextName()).andReturn("foo").anyTimes();
         
expect(context.getResourcePaths(DEFAULT_EXTENSION_PATH_PARAM)).andReturn(Collections.emptySet());
@@ -69,8 +70,7 @@
      * Verifies a an is thrown when the application SCDL is not found
      */
     public void testApplicationSCDLNotFound() throws Exception {
-        ServletLauncherListener listener = new ServletLauncherListener();
-        
listener.setTestSystemScdl(getClass().getClassLoader().getResource("META-INF/sca/webapp.system.scdl"));
+        listener.setTestSystemScdl(systemScdl);
         ServletContext context = EasyMock.createNiceMock(ServletContext.class);
         expect(context.getServletContextName()).andReturn("foo").anyTimes();
         
expect(context.getResourcePaths(DEFAULT_EXTENSION_PATH_PARAM)).andReturn(Collections.emptySet());
@@ -89,8 +89,7 @@
      * Verifies an exception is thrown if the system SCDL is not found
      */
     public void testSystemSCDLNotFound() throws Exception {
-        ServletLauncherListener listener = new ServletLauncherListener();
-        
listener.setTestSystemScdl(getClass().getClassLoader().getResource("META-INF/sca/webapp.system.scdl"));
+        listener.setTestSystemScdl(systemScdl);
         ServletContext context = EasyMock.createNiceMock(ServletContext.class);
         expect(context.getServletContextName()).andReturn("foo").anyTimes();
         
expect(context.getInitParameter(SYSTEM_SCDL_PATH_PARAM)).andReturn("notthere");
@@ -106,5 +105,9 @@
         EasyMock.verify(context);
     }
 
-
+    protected void setUp() throws Exception {
+        super.setUp();
+        listener = new ServletLauncherListener();
+        systemScdl = getClass().getResource("/META-INF/tuscany/webapp.scdl");
+    }
 }

Modified: 
incubator/tuscany/java/sca/runtime/webapp/src/main/java/org/apache/tuscany/runtime/webapp/Constants.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/webapp/src/main/java/org/apache/tuscany/runtime/webapp/Constants.java?view=diff&rev=441816&r1=441815&r2=441816
==============================================================================
--- 
incubator/tuscany/java/sca/runtime/webapp/src/main/java/org/apache/tuscany/runtime/webapp/Constants.java
 (original)
+++ 
incubator/tuscany/java/sca/runtime/webapp/src/main/java/org/apache/tuscany/runtime/webapp/Constants.java
 Sat Sep  9 09:43:24 2006
@@ -23,6 +23,11 @@
     static final String SYSTEM_SCDL_PATH_PARAM = "systemScdlPath";
 
     /**
+     * Default webapp system SCDL path.
+     */
+    static final String WEBAPP_SYSTEM_SCDL_PATH = 
"META-INF/tuscany/webapp.scdl";
+
+    /**
      * Servlet context-param name for user-specified system SCDL path.
      */
     static final String EXTENSION_SCDL_PATH_PARAM = "extensionScdlPath";



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

Reply via email to