You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2007/09/14 23:40:52 UTC

svn commit: r575799 [9/12] - in /incubator/tuscany/java/sca: itest/ itest/osgi-contribution/ itest/osgi-contribution/contribution-classes-v2/ itest/osgi-contribution/contribution-classes-v2/src/ itest/osgi-contribution/contribution-classes-v2/src/main/...

Added: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/callback/Callback1TestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/callback/Callback1TestCase.java?rev=575799&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/callback/Callback1TestCase.java (added)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/callback/Callback1TestCase.java Fri Sep 14 14:40:35 2007
@@ -0,0 +1,30 @@
+/*
+ * 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 callback;
+
+
+public class Callback1TestCase extends CallbackTestCase {
+
+    public Callback1TestCase() {
+        super("callback/callback-test1.composite");
+    }
+    
+   
+}

Propchange: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/callback/Callback1TestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/callback/Callback1TestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/callback/Callback2TestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/callback/Callback2TestCase.java?rev=575799&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/callback/Callback2TestCase.java (added)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/callback/Callback2TestCase.java Fri Sep 14 14:40:35 2007
@@ -0,0 +1,29 @@
+/*
+ * 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 callback;
+
+
+public abstract class Callback2TestCase extends CallbackTestCase {
+
+    public Callback2TestCase() {
+        super("callback/callback-test2.composite");
+    }
+    
+}

Propchange: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/callback/Callback2TestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/callback/Callback2TestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/callback/Callback3TestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/callback/Callback3TestCase.java?rev=575799&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/callback/Callback3TestCase.java (added)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/callback/Callback3TestCase.java Fri Sep 14 14:40:35 2007
@@ -0,0 +1,29 @@
+/*
+ * 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 callback;
+
+
+public class Callback3TestCase extends CallbackTestCase {
+
+    public Callback3TestCase() {
+        super("callback/callback-test3.composite");
+    }
+    
+}

Propchange: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/callback/Callback3TestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/callback/Callback3TestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/callback/CallbackTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/callback/CallbackTestCase.java?rev=575799&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/callback/CallbackTestCase.java (added)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/callback/CallbackTestCase.java Fri Sep 14 14:40:35 2007
@@ -0,0 +1,63 @@
+/*
+ * 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 callback;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+import callback.client.CallbackClient;
+
+import util.OSGiTestUtil;
+
+public abstract class CallbackTestCase extends TestCase {
+
+    private SCADomain scaDomain;
+    private CallbackClient aCallbackClient;
+    
+    protected String compositeName;
+    
+   
+    public CallbackTestCase(String compositeName) {
+        super();
+        this.compositeName = compositeName;
+    }
+
+   
+
+    protected void setUp() throws Exception {
+        OSGiTestUtil.setUpOSGiTestRuntime();
+        
+        scaDomain = SCADomain.newInstance(compositeName);
+        aCallbackClient = scaDomain.getService(CallbackClient.class, "CallbackClient");
+    }
+
+    
+    protected void tearDown() throws Exception {
+        scaDomain.close();
+        
+        OSGiTestUtil.shutdownOSGiRuntime();
+    }
+
+    public void test() throws Exception {
+        aCallbackClient.run(); 
+    }
+
+}

Propchange: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/callback/CallbackTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/callback/CallbackTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/conversation/ConversationTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/conversation/ConversationTestCase.java?rev=575799&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/conversation/ConversationTestCase.java (added)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/conversation/ConversationTestCase.java Fri Sep 14 14:40:35 2007
@@ -0,0 +1,332 @@
+/*
+ * 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 conversation;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import conversation.client.ConversationalClient;
+
+import util.OSGiTestUtil;
+
+public abstract class ConversationTestCase {
+
+    private SCADomain domain;
+    private ConversationalClient conversationalStatelessClientStatelessService;
+    private ConversationalClient conversationalStatelessClientStatefulService;
+    private ConversationalClient conversationalStatefulClientStatelessService;
+    private ConversationalClient conversationalStatefulClientStatefulService;    
+
+    @Before
+    public void setUp() throws Exception {
+        
+        try {
+
+            OSGiTestUtil.setUpOSGiTestRuntime();
+            
+            domain = SCADomain.newInstance("conversation/conversation-test.composite");
+
+            conversationalStatelessClientStatelessService = domain.getService(ConversationalClient.class,
+                                   "ConversationalStatelessClientStatelessService/ConversationalClient");
+
+            conversationalStatelessClientStatefulService  = domain.getService(ConversationalClient.class,
+                                   "ConversationalStatelessClientStatefulService/ConversationalClient");
+
+            conversationalStatefulClientStatelessService  = domain.getService(ConversationalClient.class,
+                                   "ConversationalStatefulClientStatelessService/ConversationalClient");
+
+            conversationalStatefulClientStatefulService   = domain.getService(ConversationalClient.class,
+                                   "ConversationalStatefulClientStatefulService/ConversationalClient");
+
+
+            
+        } catch (Exception e) {
+            e.printStackTrace();
+            
+            throw e;
+        }
+               
+    }
+
+    @After
+    public void tearDown() throws Exception {
+        domain.close();
+        
+
+        OSGiTestUtil.shutdownOSGiRuntime();
+    }
+  
+    // stateless client stateful service tests
+    // =======================================
+    @Test
+    public void testStatelessStatefulConversationFromInjectedReference() {
+        int count = conversationalStatelessClientStatefulService.runConversationFromInjectedReference();
+        Assert.assertEquals(2, count);
+    } 
+    
+    @Test
+    public void testStatelessStatefulConversationFromServiceReference() {
+        int count = conversationalStatelessClientStatefulService.runConversationFromServiceReference();
+        Assert.assertEquals(2, count);
+    }          
+    
+    @Test
+    public void testStatelessStatefulConversationWithUserDefinedConversationId() {
+        int count = conversationalStatelessClientStatefulService.runConversationWithUserDefinedConversationId();
+        Assert.assertEquals(2, count);
+    }   
+    
+     @Test
+    public void testStatelessStatefulConversationCheckUserDefinedConversationId() {
+        String conversationId = conversationalStatelessClientStatefulService.runConversationCheckUserDefinedConversationId();
+        Assert.assertEquals("MyConversation2", conversationId);
+    } 
+    
+     @Test
+    public void testStatelessStatefulConversationCheckingScope() {
+        conversationalStatelessClientStatefulService.runConversationCheckingScope();
+        
+        Assert.assertEquals("init,initializeCount,incrementCount,retrieveCount,endConversation,destroy,init,", 
+                conversationalStatelessClientStatefulService.getServiceCalls());
+    }     
+    
+     @Test
+    public void testStatelessStatefulConversationWithCallback() {
+        int count = conversationalStatelessClientStatefulService.runConversationWithCallback();
+        Assert.assertEquals(0, count);
+               
+        Assert.assertEquals("init,runConversationWithCallback,init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,destroy,init,", 
+                conversationalStatelessClientStatefulService.getCalls());        
+    }  
+    
+    /////@Test
+    public void testStatelessStatefulConversationHavingPassedReference() {
+        int count = conversationalStatelessClientStatefulService.runConversationHavingPassedReference();
+        Assert.assertEquals(3, count);
+    }    
+  
+    @Test
+    public void testStatelessStatefulConversationBusinessException() {
+        String message = conversationalStatelessClientStatefulService.runConversationBusinessException();
+        Assert.assertEquals("Business Exception", message);
+    }     
+    
+    @Test
+    public void testStatelessStatefulConversationBusinessExceptionCallback() {
+        String message = conversationalStatelessClientStatefulService.runConversationBusinessExceptionCallback();
+        Assert.assertEquals("Business Exception", message);
+    }  
+    
+    @Test
+    public void testStatelessStatefulConversationCallingEndedConversation() {
+        int count = conversationalStatelessClientStatefulService.runConversationCallingEndedConversation();
+        Assert.assertEquals(0, count);
+    }     
+    
+    @Test
+    public void testStatelessStatefulConversationCallingEndedConversationCallback() {
+        int count = conversationalStatelessClientStatefulService.runConversationCallingEndedConversationCallback();
+        Assert.assertEquals(0, count);
+    }     
+    
+    // stateless client stateless service tests
+    // ========================================
+    @Test
+    public void testStatelessStatelessConversationFromInjectedReference() {
+        int count = conversationalStatelessClientStatelessService.runConversationFromInjectedReference();
+        Assert.assertEquals(2, count);
+    } 
+    
+    @Test
+    public void testStatelessStatelessConversationFromServiceReference() {
+        int count = conversationalStatelessClientStatelessService.runConversationFromServiceReference();
+        Assert.assertEquals(2, count);
+    }    
+    
+    @Test
+    public void testStatelessStatelessConversationWithUserDefinedConversationId() {
+        int count = conversationalStatelessClientStatelessService.runConversationWithUserDefinedConversationId();
+        Assert.assertEquals(2, count);
+    }  
+    @Test
+    public void testStatelessStatelessConversationCheckUserDefinedConversationId() {
+        String conversationId = conversationalStatelessClientStatelessService.runConversationCheckUserDefinedConversationId();
+        Assert.assertEquals("MyConversation2", conversationId);
+    }     
+    
+    @Test
+    public void testStatelessStatelessConversationCheckingScope() {
+        conversationalStatelessClientStatelessService.runConversationCheckingScope();
+        Assert.assertEquals("init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,init,", 
+                conversationalStatelessClientStatelessService.getServiceCalls());
+    }       
+    
+    @Test
+    public void testStatelessStatelessConversationWithCallback() {
+        int count = conversationalStatelessClientStatelessService.runConversationWithCallback();
+        Assert.assertEquals(0, count);
+             
+        Assert.assertEquals("init,runConversationWithCallback,init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,destroy,init,", 
+                conversationalStatelessClientStatelessService.getCalls());        
+    }
+    /////@Test
+    public void testStatelessStatelessConversationHavingPassedReference() {
+        int count = conversationalStatelessClientStatelessService.runConversationHavingPassedReference();
+        Assert.assertEquals(3, count);
+    }     
+
+    @Test
+    public void testStatelessStatelessConversationCallingEndedConversation() {
+        int count = conversationalStatelessClientStatelessService.runConversationCallingEndedConversation();
+        Assert.assertEquals(-999, count);
+    }     
+    
+    @Test
+    public void testStatelessStatelessConversationCallingEndedConversationCallback() {
+        int count = conversationalStatelessClientStatelessService.runConversationCallingEndedConversationCallback();
+        Assert.assertEquals(0, count);
+    } 
+
+    // stateful client stateful service tests  
+    // ======================================
+    @Test
+    public void testStatefulStatefulConversationFromInjectedReference() {
+        int count = conversationalStatefulClientStatefulService.runConversationFromInjectedReference();
+        Assert.assertEquals(2, count);
+    } 
+    
+    @Test
+    public void testStatefulStatefulConversationFromServiceReference() {
+        int count = conversationalStatefulClientStatefulService.runConversationFromServiceReference();
+        Assert.assertEquals(2, count);
+    }          
+    
+    @Test
+    public void testStatefulStatefulConversationWithUserDefinedConversationId() {
+        int count = conversationalStatefulClientStatefulService.runConversationWithUserDefinedConversationId();
+        Assert.assertEquals(2, count);
+    }    
+    
+    @Test
+    public void testStatefulStatefulConversationCheckUserDefinedConversationId() {
+        String conversationId = conversationalStatefulClientStatefulService.runConversationCheckUserDefinedConversationId();
+        Assert.assertEquals("MyConversation2", conversationId);
+    } 
+    
+    @Test
+    public void testStatefulStatefulConversationCheckingScope() {
+        conversationalStatefulClientStatefulService.runConversationCheckingScope();
+        Assert.assertEquals("init,initializeCount,incrementCount,retrieveCount,endConversation,destroy,init,", 
+                conversationalStatefulClientStatefulService.getServiceCalls());
+    }  
+
+    @Test
+    public void testStatefulStatefulConversationWithCallback() {
+        int count = conversationalStatefulClientStatefulService.runConversationWithCallback();
+        Assert.assertEquals(4, count);
+              
+        Assert.assertEquals("init,runConversationWithCallback,initializeCount,incrementCount,retrieveCount,endConversation,destroy,init,", 
+                conversationalStatefulClientStatefulService.getCalls());        
+    }   
+    
+    /////@Test
+    public void testStatefulStatefulConversationHavingPassedReference() {
+        int count = conversationalStatefulClientStatefulService.runConversationHavingPassedReference();
+        Assert.assertEquals(3, count);
+    } 
+    
+    @Test
+    public void testStatefulStatefulConversationCallingEndedConversation() {
+        int count = conversationalStatefulClientStatefulService.runConversationCallingEndedConversation();
+        Assert.assertEquals(0, count);
+    }     
+    
+    @Test
+    public void testStatefulStatefulConversationCallingEndedConversationCallback() {
+        int count = conversationalStatefulClientStatefulService.runConversationCallingEndedConversationCallback();
+        Assert.assertEquals(0, count);
+    }     
+   
+    // stateful client stateless service tests  
+    // =======================================
+    @Test
+    public void testStatefulStatelessConversationFromInjectedReference() {
+        int count = conversationalStatefulClientStatelessService.runConversationFromInjectedReference();
+        Assert.assertEquals(2, count);
+    } 
+    
+    @Test
+    public void testStatefulStatelessConversationFromServiceReference() {
+        int count = conversationalStatefulClientStatelessService.runConversationFromServiceReference();
+        Assert.assertEquals(2, count);
+    }    
+    
+    @Test
+    public void testStatefulStatelessConversationWithUserDefinedConversationId() {
+        int count = conversationalStatefulClientStatelessService.runConversationWithUserDefinedConversationId();
+        Assert.assertEquals(2, count);
+    }    
+
+    @Test
+    public void testStatefulStatelessConversationCheckUserDefinedConversationId() {
+        String conversationId = conversationalStatefulClientStatelessService.runConversationCheckUserDefinedConversationId();
+        Assert.assertEquals("MyConversation2", conversationId);
+    } 
+    
+    @Test
+    public void testStatefulStatelessConversationCheckingScope() {
+        conversationalStatefulClientStatelessService.runConversationCheckingScope();
+        
+        Assert.assertEquals("init,initializeCount,destroy,init,incrementCount,destroy,init,retrieveCount,destroy,init,endConversation,destroy,init,", 
+                conversationalStatefulClientStatelessService.getServiceCalls());
+    } 
+    
+    @Test
+    public void testStatefulStatelessConversationWithCallback() {
+        int count = conversationalStatefulClientStatelessService.runConversationWithCallback();
+        Assert.assertEquals(4, count);
+        
+        Assert.assertEquals("init,runConversationWithCallback,initializeCount,incrementCount,retrieveCount,endConversation,destroy,init,", 
+                conversationalStatefulClientStatelessService.getCalls());        
+    }     
+    
+    /////@Test
+    public void testStatefulStatelessConversationHavingPassedReference() {
+        int count = conversationalStatefulClientStatelessService.runConversationHavingPassedReference();
+        Assert.assertEquals(3, count);
+    }     
+    
+    @Test
+    public void testStatefulStatelessConversationCallingEndedConversation() {
+        int count = conversationalStatefulClientStatelessService.runConversationCallingEndedConversation();
+        Assert.assertEquals(-999, count);
+    }     
+    
+    @Test
+    public void testStatefulStatelessConversationCallingEndedConversationCallback() {
+        int count = conversationalStatefulClientStatelessService.runConversationCallingEndedConversationCallback();
+        Assert.assertEquals(0, count);
+    }        
+        
+}

Propchange: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/conversation/ConversationTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/conversation/ConversationTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/helloworld/HelloWorldTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/helloworld/HelloWorldTestCase.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/helloworld/HelloWorldTestCase.java (original)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/helloworld/HelloWorldTestCase.java Fri Sep 14 14:40:35 2007
@@ -1,55 +0,0 @@
-/*
- * 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 helloworld;
-
-import helloworld.HelloWorld;
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-import util.OSGiTestUtil;
-
-
-public class HelloWorldTestCase extends TestCase {
-
-    private SCADomain scaDomain;
-    private HelloWorld helloWorld;
-
-    protected void setUp() throws Exception {
-        OSGiTestUtil.setUpOSGiTestRutime();
-        
-        scaDomain = SCADomain.newInstance("sca/ws-helloworld.composite");
-        helloWorld = scaDomain.getService(HelloWorld.class, "HelloWorldComponent");
-    }
-    
-    protected void tearDown() throws Exception {
-        scaDomain.close();
-        OSGiTestUtil.shutdownOSGiRuntime();
-    }
-    
-
-    public void testHelloWorld() throws Exception {
-        String greetings = helloWorld.getGreetings("petra");
-        System.out.println(greetings);
-        assertEquals("Hello petra", greetings);
-    }
-
-    
-}

Modified: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/helloworld/PassByRefTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/helloworld/PassByRefTestCase.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/helloworld/PassByRefTestCase.java (original)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/helloworld/PassByRefTestCase.java Fri Sep 14 14:40:35 2007
@@ -1,135 +0,0 @@
-/*
- * 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 helloworld;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-import util.OSGiTestUtil;
-
-
-public class PassByRefTestCase extends TestCase {
-
-    private SCADomain scaDomain;
-    private Greetings greetingsJava;
-    private Greetings greetingsOSGi;
-    private String[] origNames = {"world"};
-    private String[] names;
-
-    protected void setUp() throws Exception {
-        OSGiTestUtil.setUpOSGiTestRutime();
-        
-        scaDomain = SCADomain.newInstance("sca/passbyref-test.composite");
-        greetingsJava = scaDomain.getService(Greetings.class, "JavaGreetingsComponent");
-        greetingsOSGi = scaDomain.getService(Greetings.class, "OSGiGreetingsComponent");
-        
-        names = new String[origNames.length];
-        System.arraycopy(origNames, 0, names, 0, names.length);
-    }
-    
-    protected void tearDown() throws Exception {
-        scaDomain.close();
-        OSGiTestUtil.shutdownOSGiRuntime();
-    }
-    
-    public void test() throws Exception {
-        
-        javaOSGiPassByValue();
-        osgiJavaPassByValue();
-        javaOSGiPassByRef();
-//        osgiJavaPassByRef(); // FIXME
-        
-    }
-    
-
-    public void javaOSGiPassByValue() throws Exception {
-        
-        String[] greetings = greetingsJava.getGreetingsFromJava(names);
-        for (int i = 0; i < origNames.length; i++) {
-            assertEquals(origNames[i], names[i]);
-        }
-        for (int i = 0; i < origNames.length; i++) {
-
-            System.out.println(greetings[i]);
-            
-            assertEquals(greetings[i], 
-                    "Hello " + origNames[i] + "(From Java)(From OSGi)");
-        }
-        
-    }
-    
-    public void osgiJavaPassByValue() throws Exception {
-        String[] names = {
-                "world"
-        };
-        String[] greetings = greetingsOSGi.getGreetingsFromOSGi(names);
-        
-        for (int i = 0; i < origNames.length; i++) {
-            assertEquals(origNames[i], names[i]);
-        }
-        for (int i = 0; i < origNames.length; i++) {
-
-            System.out.println(greetings[i]);
-            
-            assertEquals(greetings[i], 
-                    "Hello " + origNames[i] + "(From OSGi)(From Java)");
-        }
-        
-
-
-    }
-    
-    public void javaOSGiPassByRef() throws Exception {
-        String[] names = {
-                "world"
-        };
-        String[] greetings = greetingsJava.getModifiedGreetingsFromJava(names);
-        for (int i = 0; i < origNames.length; i++) {
-            assertEquals("Hello " + origNames[i] + "(From Java)(From OSGi)", names[i]);
-        }
-        for (int i = 0; i < origNames.length; i++) {
-
-            System.out.println(greetings[i]);
-            
-            assertEquals(greetings[i], 
-                    "Hello " + origNames[i] + "(From Java)(From OSGi)");
-        }
-    }
-    
-    public void osgiJavaPassByRef() throws Exception {
-        String[] names = {
-                "world"
-        };
-        String[] greetings = greetingsOSGi.getModifiedGreetingsFromOSGi(names);
-        for (int i = 0; i < origNames.length; i++) {
-            assertEquals("Hello " + origNames[i] + "(From OSGi)(From Java)", names[i]);
-        }
-        for (int i = 0; i < origNames.length; i++) {
-
-            System.out.println(greetings[i]);
-            
-            assertEquals(greetings[i], 
-                    "Hello " + origNames[i] + "(From OSGi)(From Java)");
-        }
-    }
-
-    
-}

Added: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/helloworld/passbyref/PassByRefTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/helloworld/passbyref/PassByRefTestCase.java?rev=575799&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/helloworld/passbyref/PassByRefTestCase.java (added)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/helloworld/passbyref/PassByRefTestCase.java Fri Sep 14 14:40:35 2007
@@ -0,0 +1,136 @@
+/*
+ * 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 helloworld.passbyref;
+
+import helloworld.Greetings;
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+import util.OSGiTestUtil;
+
+
+public abstract class PassByRefTestCase extends TestCase {
+
+    private SCADomain scaDomain;
+    private Greetings greetingsJava;
+    private Greetings greetingsOSGi;
+    private String[] origNames = {"world"};
+    private String[] names;
+
+    protected void setUp() throws Exception {
+        OSGiTestUtil.setUpOSGiTestRuntime();
+        
+        scaDomain = SCADomain.newInstance("passbyref/passbyref-test.composite");
+        greetingsJava = scaDomain.getService(Greetings.class, "JavaGreetingsComponent");
+        greetingsOSGi = scaDomain.getService(Greetings.class, "OSGiGreetingsComponent");
+        
+        names = new String[origNames.length];
+        System.arraycopy(origNames, 0, names, 0, names.length);
+    }
+    
+    protected void tearDown() throws Exception {
+        scaDomain.close();
+        OSGiTestUtil.shutdownOSGiRuntime();
+    }
+    
+    public void test() throws Exception {
+        
+        javaOSGiPassByValue();
+        osgiJavaPassByValue();
+        javaOSGiPassByRef();
+        osgiJavaPassByRef();
+        
+    }
+    
+
+    public void javaOSGiPassByValue() throws Exception {
+        
+        String[] greetings = greetingsJava.getGreetingsFromJava(names);
+        for (int i = 0; i < origNames.length; i++) {
+            assertEquals(origNames[i], names[i]);
+        }
+        for (int i = 0; i < origNames.length; i++) {
+
+            System.out.println(greetings[i]);
+            
+            assertEquals(greetings[i], 
+                    "Hello " + origNames[i] + "(From Java)(From OSGi)");
+        }
+        
+    }
+    
+    public void osgiJavaPassByValue() throws Exception {
+        String[] names = {
+                "world"
+        };
+        String[] greetings = greetingsOSGi.getGreetingsFromOSGi(names);
+        
+        for (int i = 0; i < origNames.length; i++) {
+            assertEquals(origNames[i], names[i]);
+        }
+        for (int i = 0; i < origNames.length; i++) {
+
+            System.out.println(greetings[i]);
+            
+            assertEquals(greetings[i], 
+                    "Hello " + origNames[i] + "(From OSGi)(From Java)");
+        }
+        
+
+
+    }
+    
+    public void javaOSGiPassByRef() throws Exception {
+        String[] names = {
+                "world"
+        };
+        String[] greetings = greetingsJava.getModifiedGreetingsFromJava(names);
+        for (int i = 0; i < origNames.length; i++) {
+            assertEquals("Hello " + origNames[i] + "(From Java)(From OSGi)", names[i]);
+        }
+        for (int i = 0; i < origNames.length; i++) {
+
+            System.out.println(greetings[i]);
+            
+            assertEquals(greetings[i], 
+                    "Hello " + origNames[i] + "(From Java)(From OSGi)");
+        }
+    }
+    
+    public void osgiJavaPassByRef() throws Exception {
+        String[] names = {
+                "world"
+        };
+        String[] greetings = greetingsOSGi.getModifiedGreetingsFromOSGi(names);
+        for (int i = 0; i < origNames.length; i++) {
+            assertEquals("Hello " + origNames[i] + "(From OSGi)(From Java)", names[i]);
+        }
+        for (int i = 0; i < origNames.length; i++) {
+
+            System.out.println(greetings[i]);
+            
+            assertEquals(greetings[i], 
+                    "Hello " + origNames[i] + "(From OSGi)(From Java)");
+        }
+    }
+
+    
+}

Propchange: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/helloworld/passbyref/PassByRefTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/helloworld/passbyref/PassByRefTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/helloworld/ws/HelloWorldTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/helloworld/ws/HelloWorldTestCase.java?rev=575799&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/helloworld/ws/HelloWorldTestCase.java (added)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/helloworld/ws/HelloWorldTestCase.java Fri Sep 14 14:40:35 2007
@@ -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 helloworld.ws;
+
+import helloworld.HelloWorld;
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+import util.OSGiTestUtil;
+
+
+public class HelloWorldTestCase extends TestCase {
+
+    private SCADomain scaDomain;
+    private HelloWorld helloWorld;
+
+    protected void setUp() throws Exception {
+        OSGiTestUtil.setUpOSGiTestRuntime();
+        
+        scaDomain = SCADomain.newInstance("ws/ws-helloworld.composite");
+        helloWorld = scaDomain.getService(HelloWorld.class, "HelloWorldComponent");
+    }
+    
+    protected void tearDown() throws Exception {
+        scaDomain.close();
+        OSGiTestUtil.shutdownOSGiRuntime();
+    }
+    
+
+    public void testHelloWorld() throws Exception {
+        String greetings = helloWorld.getGreetings("petra");
+        System.out.println(greetings);
+        assertEquals("Hello petra", greetings);
+    }
+
+    
+}

Propchange: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/helloworld/ws/HelloWorldTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/helloworld/ws/HelloWorldTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/SupplyChainTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/SupplyChainTestCase.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/SupplyChainTestCase.java (original)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/SupplyChainTestCase.java Fri Sep 14 14:40:35 2007
@@ -43,7 +43,7 @@
 
     protected void setUp() throws Exception {
 
-        OSGiTestUtil.setUpOSGiTestRutime();
+        OSGiTestUtil.setUpOSGiTestRuntime();
         
         scaDomain = SCADomain.newInstance(compositeName);
         customer = scaDomain.getService(Customer.class, "CustomerComponent");

Modified: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/VersionedSupplyChainTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/VersionedSupplyChainTestCase.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/VersionedSupplyChainTestCase.java (original)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/VersionedSupplyChainTestCase.java Fri Sep 14 14:40:35 2007
@@ -43,7 +43,7 @@
     
     protected void setUp() throws Exception {
         
-        OSGiTestUtil.setUpOSGiTestRutime();
+        OSGiTestUtil.setUpOSGiTestRuntime();
 
         scaDomain = SCADomain.newInstance(compositeName);
         customer1 = scaDomain.getService(Customer.class, "CustomerComponent1");
@@ -54,6 +54,7 @@
         scaDomain.close();
         
         OSGiTestUtil.shutdownOSGiRuntime();
+        Thread.sleep(1000);
     }
    
     public void test() throws Exception {

Modified: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/factory/DSFactoryTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/factory/DSFactoryTestCase.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/factory/DSFactoryTestCase.java (original)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/factory/DSFactoryTestCase.java Fri Sep 14 14:40:35 2007
@@ -25,7 +25,7 @@
 public class DSFactoryTestCase extends FactoryTestCase {
 
     public DSFactoryTestCase() {
-        super("sca/factory-ds-test.composite");
+        super("factory/factory-ds-test.composite");
     }
     
     

Modified: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/factory/FactoryTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/factory/FactoryTestCase.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/factory/FactoryTestCase.java (original)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/factory/FactoryTestCase.java Fri Sep 14 14:40:35 2007
@@ -26,7 +26,7 @@
 public class FactoryTestCase extends SupplyChainTestCase {
 
     public FactoryTestCase() {
-        super("sca/factory-test.composite");
+        super("factory/factory-test.composite");
     }
     
     protected FactoryTestCase(String compositeName) {

Modified: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/interfaces/DSInterfacesTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/interfaces/DSInterfacesTestCase.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/interfaces/DSInterfacesTestCase.java (original)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/interfaces/DSInterfacesTestCase.java Fri Sep 14 14:40:35 2007
@@ -23,10 +23,10 @@
 /**
  * OSGi test program - declarative with components exposing multiple services with multiple interfaces
  */
-public class DSInterfacesTestCase extends SupplyChainTestCase {
+public abstract class DSInterfacesTestCase extends SupplyChainTestCase {
 
     public DSInterfacesTestCase() {
-        super("sca/interfaces-ds-test.composite");
+        super("interfaces/interfaces-ds-test.composite");
     }
    
 }

Modified: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/interfaces/InterfacesTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/interfaces/InterfacesTestCase.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/interfaces/InterfacesTestCase.java (original)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/interfaces/InterfacesTestCase.java Fri Sep 14 14:40:35 2007
@@ -23,10 +23,10 @@
 /**
  * OSGi test program - procedural with components exposing multiple services with multiple interfaces
  */
-public class InterfacesTestCase extends SupplyChainTestCase {
+public abstract class InterfacesTestCase extends SupplyChainTestCase {
 
     public InterfacesTestCase() {
-        super("sca/interfaces-test.composite");
+        super("interfaces/interfaces-test.composite");
     }
    
 }

Modified: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/properties/DSProperties2TestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/properties/DSProperties2TestCase.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/properties/DSProperties2TestCase.java (original)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/properties/DSProperties2TestCase.java Fri Sep 14 14:40:35 2007
@@ -25,7 +25,7 @@
 public class DSProperties2TestCase extends Properties2TestCase {
 
     public DSProperties2TestCase() {
-        super("sca/properties2-ds-test.composite");
+        super("properties/properties2-ds-test.composite");
     }
    
 }

Modified: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/properties/DSPropertiesTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/properties/DSPropertiesTestCase.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/properties/DSPropertiesTestCase.java (original)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/properties/DSPropertiesTestCase.java Fri Sep 14 14:40:35 2007
@@ -25,7 +25,7 @@
 public class DSPropertiesTestCase extends PropertiesTestCase {
 
     public DSPropertiesTestCase() {
-        super("sca/properties-ds-test.composite");
+        super("properties/properties-ds-test.composite");
     }
    
 }

Modified: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/properties/Properties2TestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/properties/Properties2TestCase.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/properties/Properties2TestCase.java (original)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/properties/Properties2TestCase.java Fri Sep 14 14:40:35 2007
@@ -38,7 +38,7 @@
     
     public Properties2TestCase() {
         super();
-        compositeName = "sca/properties2-test.composite";
+        compositeName = "properties/properties2-test.composite";
     }
     
     protected Properties2TestCase(String compositeName) {
@@ -48,7 +48,7 @@
 
     protected void setUp() throws Exception {
         
-        OSGiTestUtil.setUpOSGiTestRutime();
+        OSGiTestUtil.setUpOSGiTestRuntime();
         
         scaDomain = SCADomain.newInstance(compositeName);
         stockQuoteServiceUSD = scaDomain.getService(StockQuote.class, "USDStockQuoteComponent");

Modified: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/properties/PropertiesTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/properties/PropertiesTestCase.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/properties/PropertiesTestCase.java (original)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/properties/PropertiesTestCase.java Fri Sep 14 14:40:35 2007
@@ -37,7 +37,7 @@
     
     public PropertiesTestCase() {
         super();
-        compositeName = "sca/properties-test.composite";
+        compositeName = "properties/properties-test.composite";
     }
     
     protected PropertiesTestCase(String compositeName) {
@@ -47,7 +47,7 @@
 
     protected void setUp() throws Exception {
         
-        OSGiTestUtil.setUpOSGiTestRutime();
+        OSGiTestUtil.setUpOSGiTestRuntime();
         
         scaDomain = SCADomain.newInstance(compositeName);
         stockQuoteService = scaDomain.getService(StockQuote.class, "StockQuoteComponent");

Modified: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/services/DSServicesTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/services/DSServicesTestCase.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/services/DSServicesTestCase.java (original)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/services/DSServicesTestCase.java Fri Sep 14 14:40:35 2007
@@ -26,7 +26,7 @@
 public class DSServicesTestCase extends SupplyChainTestCase {
 
     public DSServicesTestCase() {
-        super("sca/services-ds-test.composite");
+        super("services/services-ds-test.composite");
     }
    
 }

Modified: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/services/ServicesTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/services/ServicesTestCase.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/services/ServicesTestCase.java (original)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/services/ServicesTestCase.java Fri Sep 14 14:40:35 2007
@@ -26,7 +26,7 @@
 public class ServicesTestCase extends SupplyChainTestCase {
 
     public ServicesTestCase() {
-        super("sca/services-test.composite");
+        super("services/services-test.composite");
     }
    
 }

Modified: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/version/DSVersionTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/version/DSVersionTestCase.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/version/DSVersionTestCase.java (original)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/version/DSVersionTestCase.java Fri Sep 14 14:40:35 2007
@@ -26,7 +26,7 @@
 public class DSVersionTestCase extends VersionedSupplyChainTestCase {
     
     public DSVersionTestCase() {
-        super("sca/version-ds-test.composite");
+        super("version/version-ds-test.composite");
     }
     
     

Modified: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/version/VersionTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/version/VersionTestCase.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/version/VersionTestCase.java (original)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/version/VersionTestCase.java Fri Sep 14 14:40:35 2007
@@ -26,7 +26,7 @@
 public  class VersionTestCase extends VersionedSupplyChainTestCase {
     
     public VersionTestCase() {
-        super("sca/version-test.composite");
+        super("version/version-test.composite");
     }
     
     

Modified: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/wiring/DSWiring1TestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/wiring/DSWiring1TestCase.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/wiring/DSWiring1TestCase.java (original)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/wiring/DSWiring1TestCase.java Fri Sep 14 14:40:35 2007
@@ -26,7 +26,7 @@
 public class DSWiring1TestCase extends SupplyChainTestCase {
 
     public DSWiring1TestCase() {
-        super("sca/wiring-ds-test1.composite");
+        super("wiring/wiring-ds-test1.composite");
     }
     
     

Modified: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/wiring/DSWiring2TestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/wiring/DSWiring2TestCase.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/wiring/DSWiring2TestCase.java (original)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/wiring/DSWiring2TestCase.java Fri Sep 14 14:40:35 2007
@@ -26,7 +26,7 @@
 public class DSWiring2TestCase extends SupplyChainTestCase {
 
     public DSWiring2TestCase() {
-        super("sca/wiring-ds-test2.composite");
+        super("wiring/wiring-ds-test2.composite");
     }
     
     

Modified: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/wiring/Wiring1TestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/wiring/Wiring1TestCase.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/wiring/Wiring1TestCase.java (original)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/wiring/Wiring1TestCase.java Fri Sep 14 14:40:35 2007
@@ -26,7 +26,7 @@
 public class Wiring1TestCase extends SupplyChainTestCase {
 
     public Wiring1TestCase() {
-        super("sca/wiring-test1.composite");
+        super("wiring/wiring-test1.composite");
     }
    
 }

Modified: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/wiring/Wiring2TestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/wiring/Wiring2TestCase.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/wiring/Wiring2TestCase.java (original)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/supplychain/wiring/Wiring2TestCase.java Fri Sep 14 14:40:35 2007
@@ -26,7 +26,7 @@
 public class Wiring2TestCase extends SupplyChainTestCase {
 
     public Wiring2TestCase() {
-        super("sca/wiring-test2.composite");
+        super("wiring/wiring-test2.composite");
     }
    
 }

Modified: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/util/OSGiTestUtil.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/util/OSGiTestUtil.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/util/OSGiTestUtil.java (original)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/util/OSGiTestUtil.java Fri Sep 14 14:40:35 2007
@@ -18,7 +18,7 @@
  */
 package util;
 
-import org.apache.tuscany.sca.implementation.osgi.runtime.OSGiRuntime;
+import org.apache.tuscany.sca.osgi.runtime.OSGiRuntime;
 
 
 /**
@@ -26,13 +26,13 @@
  */
 public  class OSGiTestUtil  {
     
-    public static void setUpOSGiTestRutime() throws Exception {
+    public static void setUpOSGiTestRuntime() throws Exception {
 
-        setUpFelixTestRutime();
+        setUpFelixTestRuntime();
     }
     
     
-    private static void setUpFelixTestRutime() throws Exception {
+    private static void setUpFelixTestRuntime() throws Exception {
 
         String felixConfigFileName = "file:target/test-classes/osgi/felix/felix.config.properties";
         

Modified: incubator/tuscany/java/sca/itest/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/pom.xml?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/pom.xml (original)
+++ incubator/tuscany/java/sca/itest/pom.xml Fri Sep 14 14:40:35 2007
@@ -61,6 +61,7 @@
                 <module>large-sdo-ws</module>
                 <module>operation-overloading</module>
                 <module>osgi-implementation</module>
+                <module>osgi-contribution</module>
                 <module>properties</module>
                 <module>recursive</module>
                 <module>references</module>

Modified: incubator/tuscany/java/sca/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassReferenceModelResolver.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassReferenceModelResolver.java?rev=575799&r1=575798&r2=575799&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassReferenceModelResolver.java (original)
+++ incubator/tuscany/java/sca/modules/contribution-java/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassReferenceModelResolver.java Fri Sep 14 14:40:35 2007
@@ -20,6 +20,7 @@
 package org.apache.tuscany.sca.contribution.java.impl;
 
 import java.lang.ref.WeakReference;
+import java.lang.reflect.Constructor;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -40,10 +41,21 @@
     protected WeakReference<ClassLoader> classLoader;
     private Map<String, ClassReference> map = new HashMap<String, ClassReference>();
     
+    private ModelResolver osgiResolver;
+    
     public ClassReferenceModelResolver(Contribution contribution, ModelFactoryExtensionPoint modelFactories) {
         this.contribution = contribution;
         //FIXME The classloader should be passed in
         this.classLoader = new WeakReference<ClassLoader>(Thread.currentThread().getContextClassLoader());
+        
+        try {
+            Class osgiResolverClass = Class.forName("org.apache.tuscany.sca.contribution.osgi.impl.OSGiClassReferenceModelResolver");
+            if (osgiResolverClass != null) {
+                Constructor constructor = osgiResolverClass.getConstructor(Contribution.class, ModelFactoryExtensionPoint.class);
+                this.osgiResolver = (ModelResolver)constructor.newInstance(contribution, modelFactories);
+            }
+        } catch (Exception e) {
+        }
     }
 
     public void addModel(Object resolved) {
@@ -89,11 +101,19 @@
         
         //Load a class on demand
         Class clazz = null;
-        try {
-            clazz = Class.forName(((ClassReference)unresolved).getClassName(), true, classLoader.get());
-        } catch (ClassNotFoundException e) {
-            //we will later try to delegate to imported model resolvers
+        
+        if (osgiResolver != null)
+            resolved = osgiResolver.resolveModel(modelClass, unresolved);
+        
+        if (unresolved == resolved || resolved == null) {
+            try {
+                clazz = Class.forName(((ClassReference)unresolved).getClassName(), true, classLoader.get());
+            } catch (ClassNotFoundException e) {
+                //we will later try to delegate to imported model resolvers
+            }
         }
+        else
+            clazz = ((ClassReference)resolved).getJavaClass();
 
 
         if (clazz != null) {

Propchange: incubator/tuscany/java/sca/modules/contribution-osgi/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Sep 14 14:40:35 2007
@@ -0,0 +1,18 @@
+dojo
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+derby.log
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+.felix
+.externalToolBuilders
+maven-eclipse.xml

Added: incubator/tuscany/java/sca/modules/contribution-osgi/.checkstyle
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution-osgi/.checkstyle?rev=575799&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution-osgi/.checkstyle (added)
+++ incubator/tuscany/java/sca/modules/contribution-osgi/.checkstyle Fri Sep 14 14:40:35 2007
@@ -0,0 +1,25 @@
+<?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.
+-->
+
+<fileset-config file-format-version="1.2.0" simple-config="true">
+    <fileset name="all" enabled="true" check-config-name="Sun Checks" local="false">
+        <file-match-pattern match-pattern="." include-pattern="true"/>
+    </fileset>
+</fileset-config>

Added: incubator/tuscany/java/sca/modules/contribution-osgi/.pmd
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution-osgi/.pmd?rev=575799&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution-osgi/.pmd (added)
+++ incubator/tuscany/java/sca/modules/contribution-osgi/.pmd Fri Sep 14 14:40:35 2007
@@ -0,0 +1,20 @@
+<?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.
+-->
+<pmd><useProjectRuleSet>true</useProjectRuleSet><rules/></pmd>

Added: incubator/tuscany/java/sca/modules/contribution-osgi/.ruleset
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution-osgi/.ruleset?rev=575799&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution-osgi/.ruleset (added)
+++ incubator/tuscany/java/sca/modules/contribution-osgi/.ruleset Fri Sep 14 14:40:35 2007
@@ -0,0 +1,190 @@
+<?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.
+-->
+<ruleset name="pmd-eclipse">
+  <description>PMD Plugin preferences rule set</description>
+  
+  
+  <rule ref="rulesets/basic.xml/BooleanInstantiation"/>
+  <rule ref="rulesets/basic.xml/CollapsibleIfStatements"/>
+  <rule ref="rulesets/basic.xml/DoubleCheckedLocking"/>
+<!--<rule ref="rulesets/basic.xml/EmptyCatchBlock"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptyFinallyBlock"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptyIfStmt"/>-->
+  <rule ref="rulesets/basic.xml/EmptyStatementNotInLoop"/>
+<!--<rule ref="rulesets/basic.xml/EmptyStaticInitializer"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptySwitchStatements"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptySynchronizedBlock"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptyTryBlock"/>-->
+<!--<rule ref="rulesets/basic.xml/EmptyWhileStmt"/>-->
+  <rule ref="rulesets/basic.xml/ForLoopShouldBeWhileLoop"/>
+  <rule ref="rulesets/basic.xml/JumbledIncrementer"/>
+<!--<rule ref="rulesets/basic.xml/OverrideBothEqualsAndHashcode"/>-->
+  <rule ref="rulesets/basic.xml/ReturnFromFinallyBlock"/>
+  <rule ref="rulesets/basic.xml/UnconditionalIfStatement"/>
+  <rule ref="rulesets/basic.xml/UnnecessaryConversionTemporary"/>
+  <rule ref="rulesets/basic.xml/UnnecessaryFinalModifier"/>
+  <rule ref="rulesets/basic.xml/UnnecessaryReturn"/>
+<!--<rule ref="rulesets/basic.xml/UselessOverridingMethod"/>-->
+  
+<!--<rule ref="rulesets/braces.xml/ForLoopsMustUseBraces"/>-->
+<!--<rule ref="rulesets/braces.xml/IfElseStmtsMustUseBraces"/>-->
+<!--<rule ref="rulesets/braces.xml/IfStmtsMustUseBraces"/>-->
+<!--<rule ref="rulesets/braces.xml/WhileLoopsMustUseBraces"/>-->
+
+<!--<rule ref="rulesets/clone.xml/CloneMethodMustImplementCloneable"/>-->
+<!--<rule ref="rulesets/clone.xml/CloneThrowsCloneNotSupportedException"/>-->
+<!--<rule ref="rulesets/clone.xml/ProperCloneImplementation"/>-->
+  
+<!--<rule ref="rulesets/codesize.xml/CyclomaticComplexity"/>-->
+<!--<rule ref="rulesets/codesize.xml/ExcessiveClassLength"/>-->
+<!--<rule ref="rulesets/codesize.xml/ExcessiveMethodLength"/>-->
+<!--<rule ref="rulesets/codesize.xml/ExcessiveParameterList"/>-->
+<!--<rule ref="rulesets/codesize.xml/ExcessivePublicCount"/>-->
+<!--<rule ref="rulesets/codesize.xml/TooManyFields"/>-->
+
+<rule ref="rulesets/controversial.xml/AssignmentInOperand"/>
+<!--<rule ref="rulesets/controversial.xml/AtLeastOneConstructor"/>-->
+<!--<rule ref="rulesets/controversial.xml/CallSuperInConstructor"/>-->
+<!--<rule ref="rulesets/controversial.xml/DontImportSun"/>-->
+<!--<rule ref="rulesets/controversial.xml/NullAssignment"/>-->
+<!--<rule ref="rulesets/controversial.xml/OnlyOneReturn"/>-->
+<!--<rule ref="rulesets/controversial.xml/SingularField"/>-->
+<!--<rule ref="rulesets/controversial.xml/SuspiciousOctalEscape"/>-->
+<!--<rule ref="rulesets/controversial.xml/UnnecessaryConstructor"/>-->
+<rule ref="rulesets/controversial.xml/UnnecessaryParentheses"/>
+<!--<rule ref="rulesets/controversial.xml/UnusedModifier"/>-->
+
+<!--<rule ref="rulesets/coupling.xml/CouplingBetweenObjects"/>-->
+<!--<rule ref="rulesets/coupling.xml/ExcessiveImports"/>-->
+<!--<rule ref="rulesets/coupling.xml/LooseCoupling"/>-->
+
+<!--<rule ref="rulesets/design.xml/AbstractClassWithoutAbstractMethod"/>-->
+<!--<rule ref="rulesets/design.xml/AccessorClassGeneration"/>-->
+<!--<rule ref="rulesets/design.xml/AssignmentToNonFinalStatic"/>-->
+<!--<rule ref="rulesets/design.xml/AvoidDeeplyNestedIfStmts"/>-->
+<!--<rule ref="rulesets/design.xml/AvoidInstanceofChecksInCatchClause"/>-->
+<rule ref="rulesets/design.xml/AvoidProtectedFieldInFinalClass"/>
+<!--<rule ref="rulesets/design.xml/AvoidReassigningParameters"/>-->
+<!--<rule ref="rulesets/design.xml/AvoidSynchronizedAtMethodLevel"/>-->
+<!--<rule ref="rulesets/design.xml/BadComparison"/>-->
+<!--<rule ref="rulesets/design.xml/CloseConnection"/>-->
+<!--<rule ref="rulesets/design.xml/CompareObjectsWithEquals"/>-->
+<!--<rule ref="rulesets/design.xml/ConfusingTernary"/>-->
+<rule ref="rulesets/design.xml/ConstructorCallsOverridableMethod"/>
+<!--<rule ref="rulesets/design.xml/DefaultLabelNotLastInSwitchStmt"/>-->
+<!--<rule ref="rulesets/design.xml/FinalFieldCouldBeStatic"/>-->
+<rule ref="rulesets/design.xml/IdempotentOperations"/>
+<!--<rule ref="rulesets/design.xml/ImmutableField"/>-->
+<!--<rule ref="rulesets/design.xml/InstantiationToGetClass"/>-->
+<!--<rule ref="rulesets/design.xml/MissingBreakInSwitch"/>-->
+<!--<rule ref="rulesets/design.xml/MissingStaticMethodInNonInstantiatableClass"/>-->
+<!--<rule ref="rulesets/design.xml/NonCaseLabelInSwitchStatement"/>-->
+<!--<rule ref="rulesets/design.xml/NonStaticInitializer"/>-->
+<rule ref="rulesets/design.xml/OptimizableToArrayCall"/>
+<rule ref="rulesets/design.xml/PositionLiteralsFirstInComparisons"/>
+<rule ref="rulesets/design.xml/SimplifyBooleanExpressions"/>
+<rule ref="rulesets/design.xml/SimplifyBooleanReturns"/>
+<rule ref="rulesets/design.xml/SimplifyConditional"/>
+<!--<rule ref="rulesets/design.xml/SwitchDensity"/>-->
+<!--<rule ref="rulesets/design.xml/SwitchStmtsShouldHaveDefault"/>-->
+<rule ref="rulesets/design.xml/UnnecessaryLocalBeforeReturn"/>
+<!--<rule ref="rulesets/design.xml/UseLocaleWithCaseConversions"/>-->
+<!--<rule ref="rulesets/design.xml/UseNotifyAllInsteadOfNotify"/>-->
+<!--<rule ref="rulesets/design.xml/UseSingleton"/>-->
+
+<!--<rule ref="rulesets/finalizers.xml/EmptyFinalizer"/>-->
+<!--<rule ref="rulesets/finalizers.xml/FinalizeOnlyCallsSuperFinalize"/>-->
+<!--<rule ref="rulesets/finalizers.xml/FinalizeOverloaded"/>-->
+<!--<rule ref="rulesets/finalizers.xml/FinalizeDoesNotCallSuperFinalize"/>-->
+<!--<rule ref="rulesets/finalizers.xml/FinalizeShouldBeProtected"/>-->
+<!--<rule ref="rulesets/finalizers.xml/AvoidCallingFinalize"/>-->
+
+<!--<rule ref="rulesets/imports.xml/DuplicateImports"/>-->
+<!--<rule ref="rulesets/imports.xml/DontImportJavaLang"/>-->
+<!--<rule ref="rulesets/imports.xml/UnusedImports"/>-->
+<!--<rule ref="rulesets/imports.xml/ImportFromSamePackage"/>-->
+
+<!--<rule ref="rulesets/javabeans.xml/BeanMembersShouldSerialize"/>-->
+<!--<rule ref="rulesets/javabeans.xml/MissingSerialVersionUID"/>-->
+
+<!--<rule ref="rulesets/junit.xml/JUnitStaticSuite"/>-->
+<!--<rule ref="rulesets/junit.xml/JUnitSpelling"/>-->
+<!--<rule ref="rulesets/junit.xml/JUnitAssertionsShouldIncludeMessage"/>-->
+<!--<rule ref="rulesets/junit.xml/JUnitTestsShouldIncludeAssert"/>-->
+<!--<rule ref="rulesets/junit.xml/TestClassWithoutTestCases"/>-->
+<!--<rule ref="rulesets/junit.xml/UnnecessaryBooleanAssertion"/>-->
+<!--<rule ref="rulesets/junit.xml/UseAssertEqualsInsteadOfAssertTrue"/>-->
+<!--<rule ref="rulesets/junit.xml/UseAssertSameInsteadOfAssertTrue"/>-->
+
+  <!--<rule ref="rulesets/logging-java.xml/AvoidPrintStackTrace"/>-->
+  <!--<rule ref="rulesets/logging-java.xml/LoggerIsNotStaticFinal"/>-->
+  <!--<rule ref="rulesets/logging-java.xml/MoreThanOneLogger"/>-->
+  <!--<rule ref="rulesets/logging-java.xml/LoggerIsNotStaticFinal"/>-->
+  <!--<rule ref="rulesets/logging-java.xml/LogBlockWithoutIf"/>-->
+  <!--<rule ref="rulesets/logging-java.xml/SystemPrintln"/>-->
+  <!--<rule ref="rulesets/logging-jakarta-commons.xml/UseCorrectExceptionLogging"/>-->
+  <!--<rule ref="rulesets/logging-jakarta-commons.xml/ProperLogger"/>-->
+  
+  <!--<rule ref="rulesets/naming.xml/ShortVariable"/>-->
+  <!--<rule ref="rulesets/naming.xml/LongVariable"/>-->
+  <!--<rule ref="rulesets/naming.xml/ShortMethodName"/>-->
+  <!--<rule ref="rulesets/naming.xml/VariableNamingConventions"/>-->
+  <!--<rule ref="rulesets/naming.xml/MethodNamingConventions"/>-->
+  <!--<rule ref="rulesets/naming.xml/ClassNamingConventions"/>-->
+  <!--<rule ref="rulesets/naming.xml/AbstractNaming"/>-->
+  <!--<rule ref="rulesets/naming.xml/AvoidDollarSigns"/>-->
+  <!--<rule ref="rulesets/naming.xml/MethodWithSameNameAsEnclosingClass"/>-->
+  <!--<rule ref="rulesets/naming.xml/SuspiciousHashcodeMethodName"/>-->
+  <!--<rule ref="rulesets/naming.xml/SuspiciousConstantFieldName"/>-->
+  <!--<rule ref="rulesets/naming.xml/AvoidFieldNameMatchingTypeName"/>-->
+  <!--<rule ref="rulesets/naming.xml/AvoidFieldNameMatchingMethodName"/>-->
+  <!--<rule ref="rulesets/naming.xml/AvoidNonConstructorMethodsWithClassName"/>-->
+  <!--<rule ref="rulesets/naming.xml/NoPackage"/>-->
+  <!--<rule ref="rulesets/naming.xml/PackageCase"/>-->
+
+  <!--<rule ref="rulesets/optimizations.xml/LocalVariableCouldBeFinal"/>-->
+  <!--<rule ref="rulesets/optimizations.xml/MethodArgumentCouldBeFinal"/>-->
+  <!--<rule ref="rulesets/optimizations.xml/AvoidInstantiatingObjectsInLoops"/>-->
+  <!--<rule ref="rulesets/optimizations.xml/UseArrayListInsteadOfVector"/>-->
+  <!--<rule ref="rulesets/optimizations.xml/SimplifyStartsWith"/>-->
+  <!--<rule ref="rulesets/optimizations.xml/UseStringBufferForStringAppends"/>-->
+
+  <!--<rule ref="rulesets/strictexception.xml/AvoidCatchingThrowable"/>-->
+  <!--<rule ref="rulesets/strictexception.xml/SignatureDeclareThrowsException"/>-->
+  <!--<rule ref="rulesets/strictexception.xml/ExceptionAsFlowControl"/>-->
+  <!--<rule ref="rulesets/strictexception.xml/AvoidCatchingNPE"/>-->
+  <!--<rule ref="rulesets/strictexception.xml/AvoidThrowingRawExceptionTypes"/>-->
+  <!--<rule ref="rulesets/strictexception.xml/AvoidThrowingNullPointerException"/>-->
+ 
+  <!--<rule ref="rulesets/strings.xml/AvoidDuplicateLiterals"/>-->
+  <!--<rule ref="rulesets/strings.xml/StringInstantiation"/>-->
+  <!--<rule ref="rulesets/strings.xml/StringToString"/>-->
+  <!--<rule ref="rulesets/strings.xml/AvoidConcatenatingNonLiteralsInStringBuffer"/>-->
+  <!--<rule ref="rulesets/strings.xml/UnnecessaryCaseChange"/>-->
+  
+  <!--<rule ref="rulesets/sunsecure.xml/MethodReturnsInternalArray"/>-->
+  <!--<rule ref="rulesets/sunsecure.xml/ArrayIsStoredDirectly"/>-->
+  
+  <rule ref="rulesets/unusedcode.xml/UnusedLocalVariable"/>
+  <rule ref="rulesets/unusedcode.xml/UnusedPrivateField"/>
+  <rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod"/>
+  <!--<rule ref="rulesets/unusedcode.xml/UnusedFormalParameter"/>-->
+  
+</ruleset>

Added: incubator/tuscany/java/sca/modules/contribution-osgi/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution-osgi/pom.xml?rev=575799&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution-osgi/pom.xml (added)
+++ incubator/tuscany/java/sca/modules/contribution-osgi/pom.xml Fri Sep 14 14:40:35 2007
@@ -0,0 +1,65 @@
+<?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.    
+-->
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.tuscany.sca</groupId>
+        <artifactId>tuscany-modules</artifactId>
+        <version>1.1-incubating-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <artifactId>tuscany-contribution-osgi</artifactId>
+    <name>Apache Tuscany SCA Contribution Service OSGi </name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-contribution</artifactId>
+            <version>1.1-incubating-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-osgi-runtime</artifactId>
+            <version>1.1-incubating-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-core-spi</artifactId>
+            <version>1.1-incubating-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.main</artifactId>
+            <version>1.0.0</version>
+        </dependency>
+
+
+
+        <dependency>
+            <groupId>org.codehaus.woodstox</groupId>
+            <artifactId>wstx-asl</artifactId>
+            <version>3.2.1</version>
+            <scope>runtime</scope>
+        </dependency>
+    </dependencies>
+</project>

Propchange: incubator/tuscany/java/sca/modules/contribution-osgi/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/contribution-osgi/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/BundleReference.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/BundleReference.java?rev=575799&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/BundleReference.java (added)
+++ incubator/tuscany/java/sca/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/BundleReference.java Fri Sep 14 14:40:35 2007
@@ -0,0 +1,138 @@
+/*
+ * 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.sca.contribution.osgi;
+
+
+/**
+ * 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 BundleReference {
+    
+    private Object bundle;
+    private String bundleName;
+    private String bundleVersion;
+    private String bundleUniqueName;
+    private String bundleRelativePath;
+
+    /**
+     * Constructs a new BundleReference.
+     * 
+     * @param bundle The bundle reference
+     */
+    public BundleReference(Object bundle, String bundleName, String bundleVersion, String bundleRelativePath) {
+        this.bundle = bundle;
+        this.bundleName = bundleName;
+        this.bundleVersion = bundleVersion;       
+        this.bundleRelativePath = bundleRelativePath;
+        this.bundleUniqueName = bundleName + "(" + (bundleVersion == null?"0.0.0":bundleVersion) + ")";
+    }
+    
+    /**
+     * Constructs a new BundleReference.
+     * 
+     * @param className The class name
+     */
+    public BundleReference(String bundleName, String bundleVersion) {
+        this.bundleName = bundleName;
+        this.bundleVersion = bundleVersion;
+        this.bundleUniqueName = bundleName + "(" + (bundleVersion == null?"0.0.0":bundleVersion) + ")";
+    }
+    
+    /**
+     * Get the referenced bundle.
+     * 
+     * @return The referenced bundle
+     */
+    public Object getBundle() {
+        return bundle;
+    }
+    
+    /**
+     * Get the referenced bundle name.
+     * 
+     * @return The bundle name
+     */
+    public String getBundleName() {
+        return bundleName;
+    }
+    
+    /**
+     * Get the referenced bundle version.
+     * 
+     * @return The bundle version
+     */
+    public String getBundleVersion() {
+        return bundleVersion;
+    }
+    
+    /**
+     * Get the referenced bundle name and version.
+     * 
+     * @return The bundle name
+     */
+    public String getBundleUniqueName() {
+        return bundleUniqueName;
+    }
+    
+    /**
+     * Get the relative location of the bundle inside its contribution
+     * 
+     * @return The bundle path
+     */
+    public String getBundleRelativePath() {
+        return bundleRelativePath;
+    }
+    
+    
+    
+    /**
+     * Returns true if the bundle reference is unresolved.
+     * 
+     * @return Whether or not the bundle has been resolved
+     */
+    public boolean isUnresolved() {
+        return bundle == null;
+    }
+
+    @Override
+    public int hashCode() {
+        return bundleUniqueName.hashCode();
+    }
+    
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        } else {
+            if (obj instanceof BundleReference) {
+                BundleReference ref = (BundleReference)obj;
+                return bundleName.equals(ref.bundleName) &&
+                       (bundleVersion == null || ref.bundleVersion == null ||
+                        bundleVersion.equals(ref.bundleVersion));
+            } else {
+                return false;
+            }
+        }
+    }
+
+}

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

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



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