summaryrefslogtreecommitdiffstats
path: root/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/rfeng/minicore/src/test/java/org/apache/tuscany')
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/binding/local/AbstractLocalTargetInvokerTestCase.java72
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/binding/local/LocalBindingBuilderTestCase.java40
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/binding/local/LocalBindingLoaderTestCase.java70
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/binding/local/LocalCallbackTargetInvokerInvocationExceptionTestCase.java84
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/binding/local/LocalCallbackTargetInvokerTestCase.java83
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/binding/local/LocalCallbackTargetInvokerThrowableTestCase.java89
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/binding/local/LocalTargetInvokerTestCase.java115
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/BuilderRegistryNoBindingsTestCase.java89
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/BuilderRegistryTestCase.java190
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/ConnectorImplTestCase.java320
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/IllegalCallbackExceptionTestCase.java40
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/IncompatibleInterfacesExceptionTestCase.java38
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/InvalidSourceTypeExceptionTestCase.java39
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/InvalidTargetTypeExceptionTestCase.java39
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/TargetServiceNotFoundExceptionTestCase.java38
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/WirePostProcessorRegistryImplTestCase.java48
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/WiringExceptionFormatterTestCase.java70
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/ComponentManagerImplTestCase.java90
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/JavaObjectRegistrationTestCase.java77
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/SystemSingletonAtomicComponentTestCase.java82
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/event/EventTestCase.java69
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/AbstractScopeContainerTestCase.java61
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/BasicCompositeScopeTestCase.java143
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/BasicConversationalScopeTestCase.java95
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/BasicHttpSessionScopeTestCase.java220
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/BasicRequestScopeTestCase.java167
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/BasicStatelessScopeTestCase.java89
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/CompositeScopeInitDestroyErrorTestCase.java93
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/ConversationalScopeContainerDestroyOnExpirationTestCase.java72
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/ConversationalScopeContainerMaxAgeTestCase.java76
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/ConversationalScopeContainerMaxIdleTimeTestCase.java78
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/ConversationalScopeContainerPersistenceTestCase.java189
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/InstanceWrapperBaseTestCase.java64
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/WorkContextTestCase.java166
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/implementation/composite/CompositeComponentImplTestCase.java79
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/implementation/composite/DuplicateRegistrationTestCase.java120
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/implementation/composite/ManagedRequestContextTestCase.java42
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/implementation/composite/ReferenceImplTestCase.java55
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/implementation/composite/ServiceImplTestCase.java56
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/injection/SingletonObjectFactoryTestCase.java33
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/AsyncTarget.java31
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/BadContextPojo.java28
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/BadNamePojo.java26
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/BasicInterface.java30
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/BasicInterfaceImpl.java66
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/CompositeScopeComponent.java31
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/CompositeScopeComponentImpl.java40
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/CompositeScopeDestroyOnlyComponent.java36
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/CompositeScopeInitDestroyComponent.java39
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/CompositeScopeInitOnlyComponent.java42
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeComponent.java29
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeComponentImpl.java29
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeDestroyOnlyComponent.java37
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeInitDestroyComponent.java38
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeInitOnlyComponent.java38
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OrderException.java40
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OrderedDependentPojo.java29
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OrderedDependentPojoImpl.java36
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OrderedEagerInitPojo.java60
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OrderedInitPojo.java28
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OrderedInitPojoImpl.java61
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OtherTarget.java31
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OtherTargetImpl.java39
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/RequestScopeComponent.java30
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/RequestScopeDestroyOnlyComponent.java38
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/RequestScopeInitDestroyComponent.java38
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/RequestScopeInitOnlyComponent.java39
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/SessionScopeComponent.java30
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/SessionScopeComponentImpl.java30
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/SessionScopeInitDestroyComponent.java36
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/SessionScopeInitOnlyComponent.java37
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/SimpleTarget.java30
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/SimpleTargetImpl.java41
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/Source.java37
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/SourceImpl.java63
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/StatelessComponent.java30
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/StatelessComponentImpl.java27
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/Target.java32
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/TargetImpl.java38
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/wire/MockStaticInvoker.java98
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/wire/MockSyncInterceptor.java55
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/wire/MockTargetInvoker.java33
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/monitor/DefaultExceptionFormatterTestCase.java59
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/monitor/JavaLoggingTestCase.java153
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/resolver/DefaultAutowireResolverTestCase.java177
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/services/store/memory/MemoryStoreTestCase.java166
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/util/Bean1.java45
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/util/Bean2.java47
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/util/JavaIntrospectionHelperTestCase.java180
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/util/SuperBean.java48
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/CallbackInterfaceInterceptorTestCase.java60
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/ContractCompatibilityTestCase.java390
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/IncompatibleServiceContractExceptionFormatterTestCase.java82
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/InvocationChainImplTestCase.java84
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/NonBlockingInterceptorBuilderTestCase.java38
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/NonBlockingInterceptorTestCase.java75
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/OptimizedWireObjectFactoryTestCase.java44
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/WireImplTestCase.java50
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/WireObjectFactoryTestCase.java138
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/WireOptimizationTestCase.java113
-rw-r--r--sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/WireUtilsTestCase.java69
101 files changed, 0 insertions, 7324 deletions
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/binding/local/AbstractLocalTargetInvokerTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/binding/local/AbstractLocalTargetInvokerTestCase.java
deleted file mode 100644
index dfda132671..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/binding/local/AbstractLocalTargetInvokerTestCase.java
+++ /dev/null
@@ -1,72 +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 org.apache.tuscany.core.binding.local;
-
-import org.apache.tuscany.spi.wire.Interceptor;
-import org.apache.tuscany.spi.wire.InvocationChain;
-import org.apache.tuscany.spi.wire.Message;
-import org.apache.tuscany.spi.wire.MessageImpl;
-import org.apache.tuscany.spi.wire.TargetInvoker;
-
-import junit.framework.TestCase;
-import org.apache.tuscany.core.mock.wire.MockTargetInvoker;
-import org.easymock.EasyMock;
-import org.easymock.IAnswer;
-
-/**
- * @version $Rev$ $Date$
- */
-public class AbstractLocalTargetInvokerTestCase extends TestCase {
-
- public void testInvokerWithInterceptor() throws Throwable {
- AbstractLocalTargetInvoker invoker = new MockTargetInvoker();
- Interceptor interceptor = EasyMock.createMock(Interceptor.class);
- interceptor.invoke(EasyMock.isA(Message.class));
- EasyMock.expectLastCall().andStubAnswer(new IAnswer<Object>() {
- public Object answer() throws Throwable {
- Message msg = (Message) EasyMock.getCurrentArguments()[0];
- if (msg.getTargetInvoker() == null) {
- fail("Target invoker not set");
- }
- return null;
- }
- });
- EasyMock.replay(interceptor);
- InvocationChain chain = EasyMock.createMock(InvocationChain.class);
- EasyMock.expect(chain.getHeadInterceptor()).andReturn(interceptor);
- EasyMock.replay(chain);
- invoker.invoke(chain, EasyMock.createNiceMock(TargetInvoker.class), new MessageImpl());
- EasyMock.verify(chain);
- EasyMock.verify(interceptor);
- }
-
- public void testShortCircuitInvoke() throws Throwable {
- AbstractLocalTargetInvoker invoker = new MockTargetInvoker();
- TargetInvoker targetInvoker = EasyMock.createMock(TargetInvoker.class);
- EasyMock.expect(targetInvoker.invoke(EasyMock.isA(Message.class))).andReturn(new MessageImpl());
- EasyMock.replay(targetInvoker);
- InvocationChain chain = EasyMock.createMock(InvocationChain.class);
- EasyMock.expect(chain.getHeadInterceptor()).andReturn(null);
- EasyMock.replay(chain);
- invoker.invoke(chain, targetInvoker, new MessageImpl());
- EasyMock.verify(chain);
- EasyMock.verify(targetInvoker);
- }
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/binding/local/LocalBindingBuilderTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/binding/local/LocalBindingBuilderTestCase.java
deleted file mode 100644
index e628df47e2..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/binding/local/LocalBindingBuilderTestCase.java
+++ /dev/null
@@ -1,40 +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 org.apache.tuscany.core.binding.local;
-
-import java.net.URI;
-
-import org.apache.tuscany.spi.component.ServiceBinding;
-import org.apache.tuscany.spi.model.ServiceDefinition;
-
-import junit.framework.TestCase;
-
-/**
- * @version $Rev$ $Date$
- */
-public class LocalBindingBuilderTestCase extends TestCase {
-
- public void testBuild() throws Exception {
- LocalBindingBuilder builder = new LocalBindingBuilder();
- ServiceDefinition def = new ServiceDefinition();
- def.setUri(new URI("#foo"));
- ServiceBinding binding = builder.build(def, null, null);
- assertEquals(LocalServiceBinding.class, binding.getClass());
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/binding/local/LocalBindingLoaderTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/binding/local/LocalBindingLoaderTestCase.java
deleted file mode 100644
index 0c35ae9a09..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/binding/local/LocalBindingLoaderTestCase.java
+++ /dev/null
@@ -1,70 +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 org.apache.tuscany.core.binding.local;
-
-import java.net.URI;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.spi.loader.LoaderException;
-
-import junit.framework.TestCase;
-import org.easymock.EasyMock;
-
-/**
- * @version $Rev$ $Date$
- */
-public class LocalBindingLoaderTestCase extends TestCase {
- private LocalBindingLoader loader;
-
- public void testParse() throws Exception {
- XMLStreamReader reader = EasyMock.createMock(XMLStreamReader.class);
- EasyMock.expect(reader.getAttributeValue(null, "uri")).andReturn("foo");
- EasyMock.replay(reader);
- LocalBindingDefinition definition = loader.load(null, reader, null);
- assertEquals(new URI("foo"), definition.getTargetUri());
- EasyMock.verify(reader);
- }
-
- public void testNoUri() throws Exception {
- XMLStreamReader reader = EasyMock.createMock(XMLStreamReader.class);
- EasyMock.expect(reader.getAttributeValue(null, "uri")).andReturn(null);
- EasyMock.replay(reader);
- LocalBindingDefinition definition = loader.load(null, reader, null);
- assertNull(definition.getTargetUri());
- EasyMock.verify(reader);
- }
-
- public void testBadUri() throws Exception {
- XMLStreamReader reader = EasyMock.createMock(XMLStreamReader.class);
- EasyMock.expect(reader.getAttributeValue(null, "uri")).andReturn("foo foo");
- EasyMock.replay(reader);
- try {
- loader.load(null, reader, null);
- fail();
- } catch (LoaderException e) {
- // expected
- }
- EasyMock.verify(reader);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- loader = new LocalBindingLoader(null);
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/binding/local/LocalCallbackTargetInvokerInvocationExceptionTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/binding/local/LocalCallbackTargetInvokerInvocationExceptionTestCase.java
deleted file mode 100644
index 9b83d95918..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/binding/local/LocalCallbackTargetInvokerInvocationExceptionTestCase.java
+++ /dev/null
@@ -1,84 +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 org.apache.tuscany.core.binding.local;
-
-import java.lang.reflect.Type;
-
-import org.apache.tuscany.spi.model.Operation;
-import org.apache.tuscany.spi.wire.Interceptor;
-import org.apache.tuscany.spi.wire.InvocationChain;
-import org.apache.tuscany.spi.wire.Message;
-import org.apache.tuscany.spi.wire.MessageImpl;
-import org.apache.tuscany.spi.wire.Wire;
-
-import junit.framework.TestCase;
-import org.apache.tuscany.core.wire.InvocationChainImpl;
-import org.apache.tuscany.core.wire.WireImpl;
-
-/**
- * @version $Rev$ $Date$
- */
-public class LocalCallbackTargetInvokerInvocationExceptionTestCase extends TestCase {
-
- /**
- * Verfies an InvocationTargetException thrown when invoking the target is propagated to the client correctly and
- * the originating error is unwrapped
- */
- public void testThrowableTargetInvocation() throws Exception {
- Operation<Type> operation = new Operation<Type>("echo", null, null, null);
- Interceptor head = new ErrorInterceptor();
- InvocationChain chain = new InvocationChainImpl(operation);
- chain.addInterceptor(head);
- Wire wire = new WireImpl();
- wire.addCallbackInvocationChain(operation, chain);
- LocalCallbackTargetInvoker invoker = new LocalCallbackTargetInvoker(operation, wire);
- Message msg = new MessageImpl();
- msg.setBody("foo");
- Message response = invoker.invoke(msg);
- assertTrue(response.isFault());
- Object body = response.getBody();
- assertTrue(SomeException.class.equals(body.getClass()));
- }
-
- private class SomeException extends Exception {
-
- }
-
- private class ErrorInterceptor implements Interceptor {
-
- public Message invoke(Message msg) {
- msg.setBodyWithFault(new SomeException());
- return msg;
- }
-
- public void setNext(Interceptor next) {
-
- }
-
- public Interceptor getNext() {
- return null;
- }
-
- public boolean isOptimizable() {
- return false;
- }
- }
-
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/binding/local/LocalCallbackTargetInvokerTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/binding/local/LocalCallbackTargetInvokerTestCase.java
deleted file mode 100644
index d922ec8033..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/binding/local/LocalCallbackTargetInvokerTestCase.java
+++ /dev/null
@@ -1,83 +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 org.apache.tuscany.core.binding.local;
-
-import java.lang.reflect.Type;
-import java.net.URI;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.tuscany.spi.model.Operation;
-import org.apache.tuscany.spi.wire.Interceptor;
-import org.apache.tuscany.spi.wire.InvocationChain;
-import org.apache.tuscany.spi.wire.Message;
-import org.apache.tuscany.spi.wire.MessageImpl;
-import org.apache.tuscany.spi.wire.Wire;
-
-import junit.framework.TestCase;
-import org.easymock.EasyMock;
-
-/**
- * @version $Rev$ $Date$
- */
-public class LocalCallbackTargetInvokerTestCase extends TestCase {
- private Wire wire;
- private Message message;
- private InvocationChain chain;
- private Interceptor head;
- private LocalCallbackTargetInvoker invoker;
-
- /**
- * Verfies the normal execution path through a callback
- */
- public void testNormalPathMessageInvocation() throws Exception {
- Message response = invoker.invoke(message);
- assertEquals("response", response.getBody());
- EasyMock.verify(wire);
- EasyMock.verify(chain);
- EasyMock.verify(head);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- URI targetAddress = URI.create("from");
- message = new MessageImpl();
- message.pushCallbackUri(targetAddress);
- message.setBody("foo");
- Message response = new MessageImpl();
- response.setBody("response");
- Operation<Type> operation = new Operation<Type>("echo", null, null, null);
- head = EasyMock.createMock(Interceptor.class);
- EasyMock.expect(head.invoke(EasyMock.isA(Message.class))).andReturn(response);
- EasyMock.replay(head);
- chain = EasyMock.createMock(InvocationChain.class);
- EasyMock.expect(chain.getTargetInvoker()).andReturn(null);
- EasyMock.expect(chain.getHeadInterceptor()).andReturn(head);
- EasyMock.replay(chain);
- Map<Operation<?>, InvocationChain> chains = new HashMap<Operation<?>, InvocationChain>();
- chains.put(operation, chain);
- wire = EasyMock.createMock(Wire.class);
- EasyMock.expect(wire.getCallbackInvocationChains()).andReturn(chains);
- EasyMock.replay(wire);
-
- invoker = new LocalCallbackTargetInvoker(operation, wire);
- }
-
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/binding/local/LocalCallbackTargetInvokerThrowableTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/binding/local/LocalCallbackTargetInvokerThrowableTestCase.java
deleted file mode 100644
index 0c06842a60..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/binding/local/LocalCallbackTargetInvokerThrowableTestCase.java
+++ /dev/null
@@ -1,89 +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 org.apache.tuscany.core.binding.local;
-
-import java.lang.reflect.Type;
-
-import org.apache.tuscany.spi.model.Operation;
-import org.apache.tuscany.spi.wire.Interceptor;
-import org.apache.tuscany.spi.wire.InvocationChain;
-import org.apache.tuscany.spi.wire.Message;
-import org.apache.tuscany.spi.wire.MessageImpl;
-import org.apache.tuscany.spi.wire.Wire;
-
-import junit.framework.TestCase;
-import org.apache.tuscany.core.wire.InvocationChainImpl;
-import org.apache.tuscany.core.wire.WireImpl;
-
-/**
- * @version $Rev$ $Date$
- */
-public class LocalCallbackTargetInvokerThrowableTestCase extends TestCase {
- private LocalCallbackTargetInvoker invoker;
-
- /**
- * Verfies an exception thrown in the target is propagated to the client correctly
- */
- public void testThrowableTargetInvocation() throws Exception {
- Message message = new MessageImpl();
- message.setBody("foo");
- Message response = invoker.invoke(message);
- assertTrue(response.isFault());
- Object body = response.getBody();
- if (!(body instanceof InsidiousException)) {
- fail();
- }
- }
-
- @SuppressWarnings("unchecked")
- protected void setUp() throws Exception {
- super.setUp();
- Operation<Type> operation = new Operation<Type>("echo", null, null, null);
- InvocationChain chain = new InvocationChainImpl(operation);
- chain.addInterceptor(new InsidiuousInterceptor());
- Wire wire = new WireImpl();
- wire.addCallbackInvocationChain(operation, chain);
- invoker = new LocalCallbackTargetInvoker(operation, wire);
- }
-
- private class InsidiousException extends RuntimeException {
-
- }
-
- private class InsidiuousInterceptor implements Interceptor {
-
- public Message invoke(Message msg) throws InsidiousException {
- throw new InsidiousException();
- }
-
- public void setNext(Interceptor next) {
-
- }
-
- public Interceptor getNext() {
- return null;
- }
-
- public boolean isOptimizable() {
- return false;
- }
- }
-
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/binding/local/LocalTargetInvokerTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/binding/local/LocalTargetInvokerTestCase.java
deleted file mode 100644
index e49447164d..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/binding/local/LocalTargetInvokerTestCase.java
+++ /dev/null
@@ -1,115 +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 org.apache.tuscany.core.binding.local;
-
-import java.net.URI;
-
-import org.apache.tuscany.spi.model.Operation;
-import org.apache.tuscany.spi.model.ServiceContract;
-import org.apache.tuscany.spi.wire.InvocationChain;
-import org.apache.tuscany.spi.wire.Message;
-import org.apache.tuscany.spi.wire.MessageImpl;
-import org.apache.tuscany.spi.wire.TargetInvoker;
-import org.apache.tuscany.spi.wire.Wire;
-
-import junit.framework.TestCase;
-import org.apache.tuscany.core.wire.InvocationChainImpl;
-import org.apache.tuscany.core.wire.WireImpl;
-import org.easymock.EasyMock;
-
-/**
- * @version $Rev$ $Date$
- */
-public class LocalTargetInvokerTestCase extends TestCase {
- private ServiceContract<Object> serviceContract;
- private Operation<Object> operation;
-
- public void testInvoke() {
- TargetInvoker targetInvoker = EasyMock.createMock(TargetInvoker.class);
- EasyMock.expect(targetInvoker.invoke(EasyMock.isA(Message.class))).andReturn(new MessageImpl());
- EasyMock.replay(targetInvoker);
- InvocationChain chain = new InvocationChainImpl(operation);
- chain.setTargetInvoker(targetInvoker);
- Wire wire = new WireImpl();
- wire.addInvocationChain(operation, chain);
- wire.setSourceContract(serviceContract);
- TargetInvoker invoker = new LocalTargetInvoker(operation, wire);
- Message msg = invoker.invoke(new MessageImpl());
- assertFalse(msg.isFault());
- EasyMock.verify(targetInvoker);
- }
-
- public void testCallbackSetInvoke() {
- ServiceContract<?> contract = new ServiceContract<Object>() {
-
- };
- contract.setCallbackClass(Object.class);
- TargetInvoker targetInvoker = EasyMock.createMock(TargetInvoker.class);
- EasyMock.expect(targetInvoker.invoke(EasyMock.isA(Message.class))).andReturn(new MessageImpl());
- EasyMock.replay(targetInvoker);
-
- InvocationChain chain = new InvocationChainImpl(operation);
- chain.setTargetInvoker(targetInvoker);
- InvocationChain callbackChain = new InvocationChainImpl(operation);
- Wire wire = new WireImpl();
- wire.addInvocationChain(operation, chain);
- wire.addCallbackInvocationChain(operation, callbackChain);
- wire.setSourceContract(serviceContract);
- URI uri = URI.create("foo");
- wire.setSourceUri(uri);
- wire.addInvocationChain(operation, chain);
- TargetInvoker invoker = new LocalTargetInvoker(operation, wire);
- Message msg = EasyMock.createMock(Message.class);
- msg.pushCallbackUri(EasyMock.eq(uri));
- EasyMock.replay(msg);
- invoker.invoke(msg);
- EasyMock.verify(msg);
- EasyMock.verify(targetInvoker);
- }
-
- public void testFaultInvoke() {
- TargetInvoker targetInvoker = EasyMock.createMock(TargetInvoker.class);
- EasyMock.expect(targetInvoker.invoke(EasyMock.isA(Message.class))).andThrow(new TestException());
- EasyMock.replay(targetInvoker);
-
- InvocationChain chain = new InvocationChainImpl(operation);
- chain.setTargetInvoker(targetInvoker);
- Wire wire = new WireImpl();
- wire.setSourceContract(serviceContract);
- wire.addInvocationChain(operation, chain);
- TargetInvoker invoker = new LocalTargetInvoker(operation, wire);
- Message msg = invoker.invoke(new MessageImpl());
- assertTrue(msg.isFault());
- assertTrue(msg.getBody() instanceof TestException);
- EasyMock.verify(targetInvoker);
- }
-
-
- protected void setUp() throws Exception {
- super.setUp();
- serviceContract = new ServiceContract<Object>() {
- };
- operation = new Operation<Object>("foo", null, null, null);
- }
-
-
- private class TestException extends RuntimeException {
-
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/BuilderRegistryNoBindingsTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/BuilderRegistryNoBindingsTestCase.java
deleted file mode 100644
index f13ed3367d..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/BuilderRegistryNoBindingsTestCase.java
+++ /dev/null
@@ -1,89 +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 org.apache.tuscany.core.builder;
-
-import java.net.URI;
-
-import org.apache.tuscany.spi.builder.BuilderRegistry;
-import org.apache.tuscany.spi.component.Component;
-import org.apache.tuscany.spi.component.Reference;
-import org.apache.tuscany.spi.component.ReferenceBinding;
-import org.apache.tuscany.spi.component.Service;
-import org.apache.tuscany.spi.component.ServiceBinding;
-import org.apache.tuscany.spi.deployer.DeploymentContext;
-import org.apache.tuscany.spi.model.Multiplicity;
-import org.apache.tuscany.spi.model.ReferenceDefinition;
-import org.apache.tuscany.spi.model.ServiceDefinition;
-
-import junit.framework.TestCase;
-import org.apache.tuscany.core.binding.local.LocalBindingBuilder;
-import org.apache.tuscany.core.binding.local.LocalBindingDefinition;
-import org.apache.tuscany.core.binding.local.LocalReferenceBinding;
-import org.apache.tuscany.core.binding.local.LocalServiceBinding;
-import org.easymock.EasyMock;
-
-/**
- * @version $Rev$ $Date$
- */
-public class BuilderRegistryNoBindingsTestCase extends TestCase {
- private DeploymentContext deploymentContext;
- private Component parent;
- private BuilderRegistry registry;
-
- public void testNoServiceBindings() throws Exception {
- ServiceBinding binding = EasyMock.createNiceMock(ServiceBinding.class);
- EasyMock.replay(binding);
- ServiceDefinition definition = new ServiceDefinition(URI.create("#foo"), null, false);
- definition.setTarget(new URI("foo"));
- EasyMock.replay(deploymentContext);
- EasyMock.replay(parent);
-
- Service service = registry.build(definition, deploymentContext);
-
- assertEquals(1, service.getServiceBindings().size());
- assertTrue(service.getServiceBindings().get(0) instanceof LocalServiceBinding);
- EasyMock.verify(deploymentContext);
- EasyMock.verify(parent);
- }
-
- public void testReferenceBindingBuilderDispatch() throws Exception {
- ReferenceBinding binding = EasyMock.createNiceMock(ReferenceBinding.class);
- EasyMock.replay(binding);
- ReferenceDefinition definition = new ReferenceDefinition(URI.create("#foo"), null, Multiplicity.ONE_ONE);
- EasyMock.replay(deploymentContext);
- EasyMock.replay(parent);
-
- Reference reference = registry.build(definition, deploymentContext);
-
- assertEquals(1, reference.getReferenceBindings().size());
- assertTrue(reference.getReferenceBindings().get(0) instanceof LocalReferenceBinding);
- EasyMock.verify(deploymentContext);
- EasyMock.verify(parent);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- deploymentContext = EasyMock.createMock(DeploymentContext.class);
- parent = EasyMock.createNiceMock(Component.class);
- registry = new BuilderRegistryImpl(null);
- registry.register(LocalBindingDefinition.class, new LocalBindingBuilder());
- }
-
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/BuilderRegistryTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/BuilderRegistryTestCase.java
deleted file mode 100644
index 34173154b8..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/BuilderRegistryTestCase.java
+++ /dev/null
@@ -1,190 +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 org.apache.tuscany.core.builder;
-
-import java.net.URI;
-import java.util.Map;
-
-import org.apache.tuscany.spi.builder.BindingBuilder;
-import org.apache.tuscany.spi.builder.BuilderConfigException;
-import org.apache.tuscany.spi.builder.BuilderRegistry;
-import org.apache.tuscany.spi.builder.ComponentBuilder;
-import org.apache.tuscany.spi.component.AtomicComponent;
-import org.apache.tuscany.spi.component.Component;
-import org.apache.tuscany.spi.component.Reference;
-import org.apache.tuscany.spi.component.ReferenceBinding;
-import org.apache.tuscany.spi.component.ScopeContainer;
-import org.apache.tuscany.spi.component.ScopeRegistry;
-import org.apache.tuscany.spi.component.Service;
-import org.apache.tuscany.spi.component.ServiceBinding;
-import org.apache.tuscany.spi.deployer.DeploymentContext;
-import org.apache.tuscany.spi.model.BindingDefinition;
-import org.apache.tuscany.spi.model.ComponentDefinition;
-import org.apache.tuscany.spi.model.ComponentType;
-import org.apache.tuscany.spi.model.CompositeComponentType;
-import org.apache.tuscany.spi.model.CompositeImplementation;
-import org.apache.tuscany.spi.model.Implementation;
-import static org.apache.tuscany.spi.model.Multiplicity.ONE_ONE;
-import org.apache.tuscany.spi.model.ReferenceDefinition;
-import org.apache.tuscany.spi.model.Scope;
-import org.apache.tuscany.spi.model.ServiceDefinition;
-
-import junit.framework.TestCase;
-import org.easymock.EasyMock;
-
-/**
- * @version $Rev$ $Date$
- */
-public class BuilderRegistryTestCase extends TestCase {
- private DeploymentContext deploymentContext;
- private ScopeContainer scopeContainer;
- private Map<URI, Component> components;
-
- //private BuilderRegistryImpl registry;
- private Component parent;
-
- @SuppressWarnings({"unchecked"})
- public void testRegistration() throws Exception {
- URI componentId = URI.create("sca://localhost/component");
- CompositeImplementation implementation = new CompositeImplementation();
- ComponentDefinition<CompositeImplementation> componentDefinition =
- new ComponentDefinition<CompositeImplementation>(implementation);
- componentDefinition.getImplementation().setComponentType(new CompositeComponentType());
-
- Component component = EasyMock.createMock(Component.class);
- component.setDefaultPropertyValues(componentDefinition.getPropertyValues());
- component.setScopeContainer(scopeContainer);
- EasyMock.expect(component.getUri()).andReturn(componentId);
- EasyMock.replay(component);
-
- EasyMock.expect(deploymentContext.getCompositeScope()).andReturn(scopeContainer);
- EasyMock.expect(deploymentContext.getComponents()).andReturn(components);
- EasyMock.replay(deploymentContext);
-
- EasyMock.expect(components.put(componentId, component)).andReturn(null);
- EasyMock.replay(components);
-
- ComponentBuilder builder = EasyMock.createMock(ComponentBuilder.class);
- EasyMock.expect(builder.build(componentDefinition, deploymentContext)).andReturn(component);
- EasyMock.replay(builder);
-
- BuilderRegistry registry = new BuilderRegistryImpl(null);
- registry.register(CompositeImplementation.class, builder);
-
- assertSame(component, registry.build(componentDefinition, deploymentContext));
- EasyMock.verify(builder);
- }
-
- @SuppressWarnings({"unchecked"})
- public void testServiceBindingBuilderDispatch() throws Exception {
- BuilderRegistry registry = new BuilderRegistryImpl(null);
- ServiceBinding binding = EasyMock.createNiceMock(ServiceBinding.class);
- EasyMock.replay(binding);
- BindingBuilder<MockBindingDefinition> builder = EasyMock.createMock(BindingBuilder.class);
- EasyMock.expect(builder.build(
- EasyMock.isA(ServiceDefinition.class),
- EasyMock.isA(MockBindingDefinition.class),
- EasyMock.isA(DeploymentContext.class))).andReturn(binding).times(2);
- EasyMock.replay(builder);
- registry.register(MockBindingDefinition.class, builder);
- ServiceDefinition definition = new ServiceDefinition(URI.create("#foo"), null, false);
- definition.addBinding(new MockBindingDefinition());
- definition.addBinding(new MockBindingDefinition());
- definition.setTarget(new URI("foo"));
- Service service = registry.build(definition, deploymentContext);
- assertEquals(2, service.getServiceBindings().size());
- }
-
- @SuppressWarnings({"unchecked"})
- public void testReferenceBindingBuilderDispatch() throws Exception {
- BuilderRegistry registry = new BuilderRegistryImpl(null);
- ReferenceBinding binding = EasyMock.createNiceMock(ReferenceBinding.class);
- EasyMock.replay(binding);
- BindingBuilder<MockBindingDefinition> builder = EasyMock.createMock(BindingBuilder.class);
- EasyMock.expect(builder.build(
- EasyMock.isA(ReferenceDefinition.class),
- EasyMock.isA(MockBindingDefinition.class),
- EasyMock.isA(DeploymentContext.class))).andReturn(binding).times(2);
- EasyMock.replay(builder);
- registry.register(MockBindingDefinition.class, builder);
- ReferenceDefinition definition = new ReferenceDefinition(URI.create("#foo"), null, ONE_ONE);
- definition.addBinding(new MockBindingDefinition());
- definition.addBinding(new MockBindingDefinition());
- Reference reference = registry.build(definition, deploymentContext);
- assertEquals(2, reference.getReferenceBindings().size());
- }
-
- @SuppressWarnings({"unchecked"})
- public void testNoConversationalContract() throws Exception {
- ScopeRegistry scopeRegistry = EasyMock.createMock(ScopeRegistry.class);
- ScopeContainer scopeContainer = EasyMock.createNiceMock(ScopeContainer.class);
- EasyMock.expect(scopeRegistry.getScopeContainer(EasyMock.isA(Scope.class))).andReturn(scopeContainer);
- EasyMock.replay(scopeRegistry);
- BuilderRegistry registry = new BuilderRegistryImpl(scopeRegistry);
-
- AtomicComponent component = EasyMock.createNiceMock(AtomicComponent.class);
- EasyMock.replay(component);
- ComponentBuilder<FooImplementation> builder = EasyMock.createMock(ComponentBuilder.class);
- EasyMock.expect(builder.build(
- EasyMock.isA(ComponentDefinition.class),
- EasyMock.isA(DeploymentContext.class))).andReturn(component);
- EasyMock.replay(builder);
- registry.register(FooImplementation.class, builder);
-
- FooImplementation impl = new FooImplementation();
- ComponentType componentType = new ComponentType();
- componentType.setImplementationScope(Scope.CONVERSATION);
- impl.setComponentType(componentType);
- URI uri = URI.create("foo");
- ComponentDefinition<FooImplementation> definition = new ComponentDefinition<FooImplementation>(uri, impl);
- try {
- registry.build(definition, deploymentContext);
- fail("Should throw NoConversationalContractException");
- } catch (NoConversationalContractException e) {
- // expected
- }
- }
-
- @SuppressWarnings({"unchecked"})
- protected void setUp() throws Exception {
- super.setUp();
- deploymentContext = EasyMock.createMock(DeploymentContext.class);
- parent = EasyMock.createNiceMock(Component.class);
- scopeContainer = EasyMock.createMock(ScopeContainer.class);
- components = EasyMock.createMock(Map.class);
- }
-
- private class MockBuilder implements ComponentBuilder<CompositeImplementation> {
- public Component build(
- ComponentDefinition componentDefinition,
- DeploymentContext deploymentContext) throws BuilderConfigException {
- return null;
- }
- }
-
- private class MockBindingDefinition extends BindingDefinition {
-
- }
-
- private class FooImplementation extends Implementation<ComponentType> {
-
- }
-
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/ConnectorImplTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/ConnectorImplTestCase.java
deleted file mode 100644
index 4c4e1a32b0..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/ConnectorImplTestCase.java
+++ /dev/null
@@ -1,320 +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 org.apache.tuscany.core.builder;
-
-import java.lang.reflect.Type;
-import java.net.URI;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.spi.component.AtomicComponent;
-import org.apache.tuscany.spi.component.Component;
-import org.apache.tuscany.spi.component.ComponentManager;
-import org.apache.tuscany.spi.model.ComponentDefinition;
-import org.apache.tuscany.spi.model.ComponentType;
-import org.apache.tuscany.spi.model.Implementation;
-import org.apache.tuscany.spi.model.Operation;
-import org.apache.tuscany.spi.model.Property;
-import org.apache.tuscany.spi.model.ReferenceDefinition;
-import org.apache.tuscany.spi.model.ReferenceTarget;
-import org.apache.tuscany.spi.model.Scope;
-import org.apache.tuscany.spi.model.ServiceContract;
-import org.apache.tuscany.spi.model.ServiceDefinition;
-import org.apache.tuscany.spi.wire.Interceptor;
-import org.apache.tuscany.spi.wire.InvocationChain;
-import org.apache.tuscany.spi.wire.Wire;
-
-import junit.framework.TestCase;
-import org.apache.tuscany.core.component.ComponentManagerImpl;
-import org.apache.tuscany.core.wire.InvokerInterceptor;
-import org.apache.tuscany.core.wire.NonBlockingInterceptor;
-import org.easymock.EasyMock;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ConnectorImplTestCase extends TestCase {
- private TestConnector connector;
- private ComponentManager manager;
-
- public void testConnectTargetNotFound() throws Exception {
- Implementation<ComponentType<ServiceDefinition, ReferenceDefinition, Property<?>>> impl =
- new Implementation<ComponentType<ServiceDefinition, ReferenceDefinition, Property<?>>>() {
- };
- ComponentType<ServiceDefinition, ReferenceDefinition, Property<?>> type =
- new ComponentType<ServiceDefinition, ReferenceDefinition, Property<?>>();
- URI refUri = URI.create("ref");
- ReferenceDefinition referenceDefinition = new ReferenceDefinition(refUri, null);
- referenceDefinition.setRequired(true);
- type.add(referenceDefinition);
- impl.setComponentType(type);
-
- URI sourceUri = URI.create("source");
- ComponentDefinition<?> definition =
- new ComponentDefinition<Implementation<ComponentType<ServiceDefinition,
- ReferenceDefinition, Property<?>>>>(impl);
- definition.setUri(sourceUri);
- ReferenceTarget referenceTarget = new ReferenceTarget();
- referenceTarget.setReferenceName(refUri);
- referenceTarget.addTarget(URI.create("NotThere"));
- definition.add(referenceTarget);
- Component component = EasyMock.createMock(Component.class);
- EasyMock.expect(component.getUri()).andReturn(sourceUri);
- EasyMock.replay(component);
- manager.register(component);
- try {
- connector.connect(definition);
- fail();
- } catch (ComponentNotFoundException e) {
- // expected
- }
- }
-
- /**
- * Verifies a non-existent target does not throw an error.
- * <p/>
- * TODO JFM when the allocator is in place it should optimize connecting to non-existent targets but keep it for
- * now
- */
- public void testConnectTargetNotFoundNonRequiredReference() throws Exception {
- Implementation<ComponentType<ServiceDefinition, ReferenceDefinition, Property<?>>> impl =
- new Implementation<ComponentType<ServiceDefinition, ReferenceDefinition, Property<?>>>() {
- };
- ComponentType<ServiceDefinition, ReferenceDefinition, Property<?>> type =
- new ComponentType<ServiceDefinition, ReferenceDefinition, Property<?>>();
- URI refUri = URI.create("ref");
- ReferenceDefinition referenceDefinition = new ReferenceDefinition(refUri, null);
- referenceDefinition.setRequired(false);
- type.add(referenceDefinition);
- impl.setComponentType(type);
-
- URI sourceUri = URI.create("source");
- ComponentDefinition<?> definition =
- new ComponentDefinition<Implementation<ComponentType<ServiceDefinition,
- ReferenceDefinition, Property<?>>>>(impl);
- definition.setUri(sourceUri);
- ReferenceTarget referenceTarget = new ReferenceTarget();
- referenceTarget.setReferenceName(refUri);
- referenceTarget.addTarget(URI.create("NotThere"));
- definition.add(referenceTarget);
- Component component = EasyMock.createMock(Component.class);
- EasyMock.expect(component.getUri()).andReturn(sourceUri);
- EasyMock.replay(component);
- manager.register(component);
- connector.connect(definition);
- }
-
- public void testNonOptimizableTargetComponent() throws Exception {
- AtomicComponent source = EasyMock.createMock(AtomicComponent.class);
- EasyMock.expect(source.getScope()).andReturn(Scope.COMPOSITE);
- EasyMock.replay(source);
-
- AtomicComponent target = EasyMock.createMock(AtomicComponent.class);
- EasyMock.expect(target.getScope()).andReturn(Scope.COMPOSITE);
- EasyMock.expect(target.isOptimizable()).andReturn(false);
- EasyMock.replay(target);
-
- Wire wire = EasyMock.createMock(Wire.class);
- wire.setOptimizable(false);
- EasyMock.replay(wire);
- connector.optimize(source, target, wire);
- EasyMock.verify(source);
- EasyMock.verify(target);
- EasyMock.verify(wire);
- }
-
- public void testOptimizableTargetComponent() throws Exception {
- AtomicComponent source = EasyMock.createMock(AtomicComponent.class);
- EasyMock.expect(source.getScope()).andReturn(Scope.COMPOSITE);
- EasyMock.replay(source);
-
- AtomicComponent target = EasyMock.createMock(AtomicComponent.class);
- EasyMock.expect(target.getScope()).andReturn(Scope.COMPOSITE);
- EasyMock.expect(target.isOptimizable()).andReturn(true);
- EasyMock.replay(target);
-
- Wire wire = EasyMock.createMock(Wire.class);
- wire.setOptimizable(true);
- wire.setTarget(EasyMock.eq(target));
- wire.getInvocationChains();
- EasyMock.expectLastCall().andReturn(Collections.emptyMap());
- wire.getCallbackInvocationChains();
- EasyMock.expectLastCall().andReturn(Collections.emptyMap());
- EasyMock.replay(wire);
- connector.optimize(source, target, wire);
- EasyMock.verify(source);
- EasyMock.verify(target);
- }
-
- public void testIsOptimizable() {
- assertTrue(connector.isOptimizable(Scope.STATELESS, Scope.STATELESS));
- assertTrue(connector.isOptimizable(Scope.STATELESS, Scope.COMPOSITE));
- assertFalse(connector.isOptimizable(Scope.STATELESS, Scope.CONVERSATION));
- assertTrue(connector.isOptimizable(Scope.STATELESS, Scope.REQUEST));
- assertTrue(connector.isOptimizable(Scope.STATELESS, Scope.SESSION));
- assertTrue(connector.isOptimizable(Scope.STATELESS, Scope.SYSTEM));
-
- assertTrue(connector.isOptimizable(Scope.COMPOSITE, Scope.COMPOSITE));
- assertFalse(connector.isOptimizable(Scope.COMPOSITE, Scope.CONVERSATION));
- assertFalse(connector.isOptimizable(Scope.COMPOSITE, Scope.REQUEST));
- assertFalse(connector.isOptimizable(Scope.COMPOSITE, Scope.SESSION));
- assertFalse(connector.isOptimizable(Scope.COMPOSITE, Scope.STATELESS));
- assertTrue(connector.isOptimizable(Scope.COMPOSITE, Scope.SYSTEM));
-
- assertFalse(connector.isOptimizable(Scope.CONVERSATION, Scope.COMPOSITE));
- assertFalse(connector.isOptimizable(Scope.CONVERSATION, Scope.CONVERSATION));
- assertFalse(connector.isOptimizable(Scope.CONVERSATION, Scope.REQUEST));
- assertFalse(connector.isOptimizable(Scope.CONVERSATION, Scope.SESSION));
- assertFalse(connector.isOptimizable(Scope.CONVERSATION, Scope.STATELESS));
- assertFalse(connector.isOptimizable(Scope.CONVERSATION, Scope.SYSTEM));
-
- assertTrue(connector.isOptimizable(Scope.REQUEST, Scope.COMPOSITE));
- assertFalse(connector.isOptimizable(Scope.REQUEST, Scope.CONVERSATION));
- assertTrue(connector.isOptimizable(Scope.REQUEST, Scope.REQUEST));
- assertTrue(connector.isOptimizable(Scope.REQUEST, Scope.SESSION));
- assertFalse(connector.isOptimizable(Scope.REQUEST, Scope.STATELESS));
- assertTrue(connector.isOptimizable(Scope.REQUEST, Scope.SYSTEM));
-
- assertTrue(connector.isOptimizable(Scope.SESSION, Scope.COMPOSITE));
- assertFalse(connector.isOptimizable(Scope.SESSION, Scope.CONVERSATION));
- assertFalse(connector.isOptimizable(Scope.SESSION, Scope.REQUEST));
- assertTrue(connector.isOptimizable(Scope.SESSION, Scope.SESSION));
- assertFalse(connector.isOptimizable(Scope.SESSION, Scope.STATELESS));
- assertTrue(connector.isOptimizable(Scope.SESSION, Scope.SYSTEM));
-
- assertTrue(connector.isOptimizable(Scope.SYSTEM, Scope.COMPOSITE));
- assertFalse(connector.isOptimizable(Scope.SYSTEM, Scope.CONVERSATION));
- assertFalse(connector.isOptimizable(Scope.SYSTEM, Scope.REQUEST));
- assertFalse(connector.isOptimizable(Scope.SYSTEM, Scope.SESSION));
- assertFalse(connector.isOptimizable(Scope.SYSTEM, Scope.STATELESS));
- assertTrue(connector.isOptimizable(Scope.SYSTEM, Scope.SYSTEM));
-
- assertFalse(connector.isOptimizable(Scope.UNDEFINED, Scope.COMPOSITE));
- assertFalse(connector.isOptimizable(Scope.UNDEFINED, Scope.CONVERSATION));
- assertFalse(connector.isOptimizable(Scope.UNDEFINED, Scope.REQUEST));
- assertFalse(connector.isOptimizable(Scope.UNDEFINED, Scope.SESSION));
- assertFalse(connector.isOptimizable(Scope.UNDEFINED, Scope.STATELESS));
- assertFalse(connector.isOptimizable(Scope.UNDEFINED, Scope.SYSTEM));
-
- }
-
- public void testCreateSyncForwardWire() throws Exception {
- ServiceContract<Type> contract = new ServiceContract<Type>() {
-
- };
- Operation<Type> operation = new Operation<Type>("operation", null, null, null);
- Map<String, Operation<Type>> operations = new HashMap<String, Operation<Type>>();
- operations.put("operation", operation);
- contract.setOperations(operations);
- Wire wire = connector.createWire(URI.create("target"), URI.create("#ref"), contract, Wire.LOCAL_BINDING);
- assertEquals(1, wire.getInvocationChains().size());
- InvocationChain chain = wire.getInvocationChains().get(operation);
- Interceptor head = chain.getHeadInterceptor();
- assertTrue(head instanceof InvokerInterceptor);
- }
-
- public void testCreateSyncCallbackWire() throws Exception {
- ServiceContract<Type> contract = new ServiceContract<Type>() {
-
- };
-
- Operation<Type> operation = new Operation<Type>("operation", null, null, null);
- Map<String, Operation<Type>> operations = new HashMap<String, Operation<Type>>();
- operations.put("operation", operation);
- contract.setOperations(operations);
-
- Operation<Type> callbackOperation = new Operation<Type>("operation", null, null, null);
- Map<String, Operation<Type>> callbackOperations = new HashMap<String, Operation<Type>>();
- callbackOperations.put("operation", callbackOperation);
- contract.setCallbackOperations(callbackOperations);
-
- Wire wire = connector.createWire(URI.create("target"), URI.create("#ref"), contract, Wire.LOCAL_BINDING);
- assertEquals(1, wire.getCallbackInvocationChains().size());
- InvocationChain chain = wire.getCallbackInvocationChains().get(callbackOperation);
- Interceptor head = chain.getHeadInterceptor();
- assertTrue(head instanceof InvokerInterceptor);
- }
-
- public void testCreateNonBlockingForwardWire() throws Exception {
- ServiceContract<Type> contract = new ServiceContract<Type>() {
-
- };
- Operation<Type> operation = new Operation<Type>("operation", null, null, null);
- operation.setNonBlocking(true);
- Map<String, Operation<Type>> operations = new HashMap<String, Operation<Type>>();
- operations.put("operation", operation);
- contract.setOperations(operations);
- Wire wire = connector.createWire(URI.create("target"), URI.create("#ref"), contract, Wire.LOCAL_BINDING);
- assertEquals(1, wire.getInvocationChains().size());
- InvocationChain chain = wire.getInvocationChains().get(operation);
- Interceptor head = chain.getHeadInterceptor();
- assertTrue(head instanceof NonBlockingInterceptor);
- assertTrue(head.getNext() instanceof InvokerInterceptor);
- }
-
- public void testCreateNonBlockingCallbackWire() throws Exception {
- ServiceContract<Type> contract = new ServiceContract<Type>() {
-
- };
-
- Operation<Type> operation = new Operation<Type>("operation", null, null, null);
- operation.setNonBlocking(true);
- Map<String, Operation<Type>> operations = new HashMap<String, Operation<Type>>();
- operations.put("operation", operation);
- contract.setOperations(operations);
-
- Operation<Type> callbackOperation = new Operation<Type>("operation", null, null, null);
- callbackOperation.setNonBlocking(true);
- Map<String, Operation<Type>> callbackOperations = new HashMap<String, Operation<Type>>();
- callbackOperations.put("operation", callbackOperation);
- contract.setCallbackOperations(callbackOperations);
-
- Wire wire = connector.createWire(URI.create("target"), URI.create("#ref"), contract, Wire.LOCAL_BINDING);
- assertEquals(1, wire.getCallbackInvocationChains().size());
- InvocationChain chain = wire.getCallbackInvocationChains().get(callbackOperation);
- Interceptor head = chain.getHeadInterceptor();
- assertTrue(head instanceof NonBlockingInterceptor);
- assertTrue(head.getNext() instanceof InvokerInterceptor);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- manager = new ComponentManagerImpl();
- connector = new TestConnector(manager);
- }
-
- private class TestConnector extends ConnectorImpl {
-
- public TestConnector(ComponentManager componentManager) {
- super(componentManager);
- }
-
- protected Wire createWire(URI sourceURI, URI targetUri, ServiceContract<?> contract, QName bindingType) {
- return super.createWire(sourceURI, targetUri, contract, bindingType);
- }
-
- public boolean isOptimizable(Scope pReferrer, Scope pReferee) {
- return super.isOptimizable(pReferrer, pReferee);
- }
-
- }
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/IllegalCallbackExceptionTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/IllegalCallbackExceptionTestCase.java
deleted file mode 100644
index c6a9927db3..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/IllegalCallbackExceptionTestCase.java
+++ /dev/null
@@ -1,40 +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 org.apache.tuscany.core.builder;
-
-import java.net.URI;
-
-import junit.framework.TestCase;
-
-/**
- * @version $Rev$ $Date$
- */
-public class IllegalCallbackExceptionTestCase extends TestCase {
-
- public void testInstantiation() throws Exception {
- URI sourceUri = URI.create("source");
- URI targetUri = URI.create("target");
- IllegalCallbackException e = new IllegalCallbackException("message", "identifier", sourceUri, targetUri);
- assertEquals("message", e.getMessage());
- assertEquals("identifier", e.getIdentifier());
- assertEquals(sourceUri, e.getSourceUri());
- assertEquals(targetUri, e.getTargetUri());
-
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/IncompatibleInterfacesExceptionTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/IncompatibleInterfacesExceptionTestCase.java
deleted file mode 100644
index 5d370fcfc5..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/IncompatibleInterfacesExceptionTestCase.java
+++ /dev/null
@@ -1,38 +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 org.apache.tuscany.core.builder;
-
-import java.net.URI;
-
-import junit.framework.TestCase;
-
-/**
- * @version $Rev$ $Date$
- */
-public class IncompatibleInterfacesExceptionTestCase extends TestCase {
-
- public void testInstantiation() throws Exception {
- URI sourceUri = URI.create("source");
- URI targetUri = URI.create("target");
- IncompatibleInterfacesException e = new IncompatibleInterfacesException(sourceUri, targetUri);
- assertNotNull(e.getMessage());
- assertEquals("source", e.getSourceUri().toString());
- assertEquals("target", e.getTargetUri().toString());
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/InvalidSourceTypeExceptionTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/InvalidSourceTypeExceptionTestCase.java
deleted file mode 100644
index 67ad003d58..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/InvalidSourceTypeExceptionTestCase.java
+++ /dev/null
@@ -1,39 +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 org.apache.tuscany.core.builder;
-
-import java.net.URI;
-
-import junit.framework.TestCase;
-
-/**
- * @version $Rev$ $Date$
- */
-public class InvalidSourceTypeExceptionTestCase extends TestCase {
-
- public void testInstantiation() throws Exception {
- URI sourceUri = URI.create("source");
- URI targetUri = URI.create("target");
- InvalidSourceTypeException e = new InvalidSourceTypeException("message", sourceUri, targetUri);
- assertEquals("message", e.getMessage());
- assertEquals(sourceUri, e.getSourceUri());
- assertEquals(targetUri, e.getTargetUri());
-
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/InvalidTargetTypeExceptionTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/InvalidTargetTypeExceptionTestCase.java
deleted file mode 100644
index 61060293ce..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/InvalidTargetTypeExceptionTestCase.java
+++ /dev/null
@@ -1,39 +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 org.apache.tuscany.core.builder;
-
-import java.net.URI;
-
-import junit.framework.TestCase;
-
-/**
- * @version $Rev$ $Date$
- */
-public class InvalidTargetTypeExceptionTestCase extends TestCase {
-
- public void testInstantiation() throws Exception {
- URI sourceUri = URI.create("source");
- URI targetUri = URI.create("target");
- InvalidTargetTypeException e = new InvalidTargetTypeException("message", sourceUri, targetUri);
- assertEquals("message", e.getMessage());
- assertEquals(sourceUri, e.getSourceUri());
- assertEquals(targetUri, e.getTargetUri());
-
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/TargetServiceNotFoundExceptionTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/TargetServiceNotFoundExceptionTestCase.java
deleted file mode 100644
index 2d056ac964..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/TargetServiceNotFoundExceptionTestCase.java
+++ /dev/null
@@ -1,38 +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 org.apache.tuscany.core.builder;
-
-import java.net.URI;
-
-import junit.framework.TestCase;
-
-/**
- * @version $Rev$ $Date$
- */
-public class TargetServiceNotFoundExceptionTestCase extends TestCase {
-
- public void testInstantiation() throws Exception {
- URI sourceUri = URI.create("source");
- URI targetUri = URI.create("target");
- TargetServiceNotFoundException e = new TargetServiceNotFoundException("message", sourceUri, targetUri);
- assertEquals("message", e.getMessage());
- assertEquals(sourceUri, e.getSourceUri());
- assertEquals(targetUri, e.getTargetUri());
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/WirePostProcessorRegistryImplTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/WirePostProcessorRegistryImplTestCase.java
deleted file mode 100644
index fcd5f03189..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/WirePostProcessorRegistryImplTestCase.java
+++ /dev/null
@@ -1,48 +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 org.apache.tuscany.core.builder;
-
-import org.apache.tuscany.spi.wire.Wire;
-import org.apache.tuscany.spi.wire.WirePostProcessor;
-import org.apache.tuscany.spi.wire.WirePostProcessorRegistry;
-
-import junit.framework.TestCase;
-import org.easymock.EasyMock;
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.verify;
-
-/**
- * @version $Rev$ $Date$
- */
-public class WirePostProcessorRegistryImplTestCase extends TestCase {
-
- public void testRegisterUnregister() throws Exception {
- WirePostProcessorRegistry registry = new WirePostProcessorRegistryImpl();
- Wire wire = EasyMock.createMock(Wire.class);
- WirePostProcessor processor = createMock(WirePostProcessor.class);
- processor.process(EasyMock.eq(wire));
- EasyMock.replay(processor);
- registry.register(processor);
- registry.process(wire);
- registry.unregister(processor);
- registry.process(wire);
- verify(processor);
- }
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/WiringExceptionFormatterTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/WiringExceptionFormatterTestCase.java
deleted file mode 100644
index e05a162d7a..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/builder/WiringExceptionFormatterTestCase.java
+++ /dev/null
@@ -1,70 +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 org.apache.tuscany.core.builder;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.net.URI;
-
-import org.apache.tuscany.spi.builder.WiringException;
-
-import junit.framework.TestCase;
-import org.apache.tuscany.host.monitor.FormatterRegistry;
-import org.easymock.EasyMock;
-
-/**
- * @version $Rev$ $Date$
- */
-public class WiringExceptionFormatterTestCase extends TestCase {
- WiringExceptionFormatter formatter = new WiringExceptionFormatter(EasyMock.createNiceMock(FormatterRegistry.class));
-
- public void testFormat() throws Exception {
- WiringException e =
- new MockWiringException("message", "identifier", URI.create("source"), URI.create("target"));
- StringWriter writer = new StringWriter();
- PrintWriter pw = new PrintWriter(writer);
- formatter.write(pw, e);
- String buffer = writer.toString();
- assertTrue(buffer.indexOf("message") >= 0);
- assertTrue(buffer.indexOf("identifier") >= 0);
- assertTrue(buffer.indexOf("source") >= 0);
- assertTrue(buffer.indexOf("target") >= 0);
- }
-
-
- public void testFormatNulls() throws Exception {
- WiringException e = new MockWiringException("message",
- "identifier",
- null,
- null);
- StringWriter writer = new StringWriter();
- PrintWriter pw = new PrintWriter(writer);
- formatter.write(pw, e);
- String buffer = writer.toString();
- assertTrue(buffer.indexOf("message") >= 0);
- assertTrue(buffer.indexOf("identifier") >= 0);
- }
-
- private class MockWiringException extends WiringException {
-
- public MockWiringException(String message, String identifier, URI source, URI reference) {
- super(message, identifier, source, reference);
- }
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/ComponentManagerImplTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/ComponentManagerImplTestCase.java
deleted file mode 100644
index c1710e9b8e..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/ComponentManagerImplTestCase.java
+++ /dev/null
@@ -1,90 +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 org.apache.tuscany.core.component;
-
-import java.net.URI;
-
-import junit.framework.TestCase;
-import org.easymock.EasyMock;
-
-import org.apache.tuscany.spi.component.Component;
-import org.apache.tuscany.spi.component.DuplicateNameException;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ComponentManagerImplTestCase extends TestCase {
- private static final URI DOMAIN = URI.create("sca://localhost/");
- private static final URI ROOT1 = DOMAIN.resolve("root1");
- private static final URI GRANDCHILD = DOMAIN.resolve("parent/child2/grandchild");
-
- private ComponentManagerImpl manager;
-
- public void testRegister() throws Exception {
- Component root = EasyMock.createMock(Component.class);
- EasyMock.expect(root.getUri()).andReturn(ROOT1);
- EasyMock.replay(root);
- manager.register(root);
- assertEquals(root, manager.getComponent(ROOT1));
- EasyMock.verify(root);
-
- EasyMock.reset(root);
- EasyMock.expect(root.getUri()).andReturn(ROOT1);
- EasyMock.replay(root);
- manager.unregister(root);
- EasyMock.verify(root);
- assertEquals(null, manager.getComponent(ROOT1));
- }
-
- public void testRegisterGrandchild() throws Exception {
- Component root = EasyMock.createMock(Component.class);
- EasyMock.expect(root.getUri()).andReturn(GRANDCHILD);
- EasyMock.replay(root);
- manager.register(root);
- assertEquals(root, manager.getComponent(GRANDCHILD));
- EasyMock.verify(root);
- }
-
- public void testRegisterDuplicate() throws Exception {
- Component root = EasyMock.createMock(Component.class);
- EasyMock.expect(root.getUri()).andReturn(ROOT1);
- EasyMock.replay(root);
-
- Component duplicate = EasyMock.createMock(Component.class);
- EasyMock.expect(duplicate.getUri()).andReturn(ROOT1);
- EasyMock.replay(duplicate);
-
- manager.register(root);
- assertEquals(root, manager.getComponent(ROOT1));
- try {
- manager.register(duplicate);
- fail();
- } catch (DuplicateNameException e) {
- // expected
- }
- assertEquals(root, manager.getComponent(ROOT1));
- EasyMock.verify(root);
- EasyMock.verify(duplicate);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- manager = new ComponentManagerImpl();
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/JavaObjectRegistrationTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/JavaObjectRegistrationTestCase.java
deleted file mode 100644
index 2d00a13716..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/JavaObjectRegistrationTestCase.java
+++ /dev/null
@@ -1,77 +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 org.apache.tuscany.core.component;
-
-import java.net.URI;
-
-import org.apache.tuscany.spi.component.AtomicComponent;
-import org.apache.tuscany.spi.component.Component;
-import org.apache.tuscany.spi.component.ComponentManager;
-import org.apache.tuscany.spi.component.DuplicateNameException;
-import org.apache.tuscany.spi.idl.java.JavaServiceContract;
-
-import junit.framework.TestCase;
-
-/**
- * @version $Rev$ $Date$
- */
-public class JavaObjectRegistrationTestCase extends TestCase {
- private ComponentManager componentManager;
-
- public void testRegistration() throws Exception {
- MockComponent instance = new MockComponent();
- URI uri = URI.create("foo");
- JavaServiceContract<MockComponent> contract = new JavaServiceContract<MockComponent>(MockComponent.class) {
- };
- componentManager.registerJavaObject(uri, contract, instance);
- Component component = componentManager.getComponent(URI.create("foo"));
- assertTrue(component instanceof AtomicComponent);
- MockComponent resolvedInstance = (MockComponent) ((AtomicComponent) component).getTargetInstance();
- assertSame(instance, resolvedInstance);
- }
-
- public void testDuplicateRegistration() throws Exception {
- MockComponent instance = new MockComponent();
- URI uri = URI.create("foo");
- JavaServiceContract<MockComponent> contract = new JavaServiceContract<MockComponent>(MockComponent.class) {
- };
- componentManager.registerJavaObject(uri, contract, instance);
- try {
- componentManager.registerJavaObject(uri, contract, instance);
- fail();
- } catch (DuplicateNameException e) {
- // ok
- }
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- componentManager = new ComponentManagerImpl();
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- private static class MockComponent {
- public String hello(String message) {
- return message;
- }
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/SystemSingletonAtomicComponentTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/SystemSingletonAtomicComponentTestCase.java
deleted file mode 100644
index fac45ebfb5..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/SystemSingletonAtomicComponentTestCase.java
+++ /dev/null
@@ -1,82 +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 org.apache.tuscany.core.component;
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.spi.component.TargetException;
-import org.apache.tuscany.spi.idl.java.JavaServiceContract;
-
-import junit.framework.TestCase;
-
-/**
- * @version $Rev$ $Date$
- */
-public class SystemSingletonAtomicComponentTestCase extends TestCase {
-
- public void testGetInstance() throws TargetException {
- JavaServiceContract<Foo> contract = new JavaServiceContract<Foo>(Foo.class) {
-
- };
- FooImpl foo = new FooImpl();
- SystemSingletonAtomicComponent<Foo, FooImpl> component =
- new SystemSingletonAtomicComponent<Foo, FooImpl>(URI.create("foo"), contract, foo);
- assertEquals(foo, component.getTargetInstance());
- }
-
- public void testGetInstanceMultipleServices() throws TargetException {
- FooImpl foo = new FooImpl();
- List<JavaServiceContract<?>> services = new ArrayList<JavaServiceContract<?>>();
- services.add(new JavaServiceContract<Foo>(Foo.class) {
- });
- services.add(new JavaServiceContract<Bar>(Bar.class) {
- });
- SystemSingletonAtomicComponent<Foo, FooImpl> component =
- new SystemSingletonAtomicComponent<Foo, FooImpl>(URI.create("foo"), services, foo);
- assertEquals(foo, component.getTargetInstance());
- }
-
- public void testOptimizable() {
- JavaServiceContract<Foo> contract = new JavaServiceContract<Foo>(Foo.class) {
- };
- FooImpl foo = new FooImpl();
- SystemSingletonAtomicComponent<Foo, FooImpl> component =
- new SystemSingletonAtomicComponent<Foo, FooImpl>(URI.create("foo"), contract, foo);
- assertTrue(component.isOptimizable());
- }
-
-
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- private interface Foo {
-
- }
-
- private interface Bar {
-
- }
-
- private class FooImpl implements Foo, Bar {
-
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/event/EventTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/event/EventTestCase.java
deleted file mode 100644
index 93cb50ddcb..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/event/EventTestCase.java
+++ /dev/null
@@ -1,69 +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 org.apache.tuscany.core.component.event;
-
-import java.net.URI;
-
-import junit.framework.TestCase;
-
-/**
- * @version $Rev$ $Date$
- */
-public class EventTestCase extends TestCase {
- private URI uri = URI.create("foo");
-
- public void testCompositeStart() {
- ComponentStart event = new ComponentStart(this, uri);
- assertEquals(uri, event.getComponentUri());
- }
-
- public void testCompositeStop() {
- ComponentStop event = new ComponentStop(this, uri);
- assertEquals(uri, event.getComponentUri());
- }
-
- public void testHttpSessionStart() {
- Object id = new Object();
- HttpSessionEvent event = new HttpSessionStart(this, id);
- assertEquals(this, event.getSource());
- assertEquals(id, event.getId());
- }
-
- public void testHttpSessionEnd() {
- Object id = new Object();
- HttpSessionEvent event = new HttpSessionEnd(this, id);
- assertEquals(this, event.getSource());
- assertEquals(id, event.getId());
- }
-
- public void testRequestStart() {
- RequestStart event = new RequestStart(this);
- assertEquals(this, event.getSource());
- }
-
- public void testReequestEnd() {
- RequestEnd event = new RequestEnd(this);
- assertEquals(this, event.getSource());
- }
-
-
- protected void setUp() throws Exception {
- super.setUp();
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/AbstractScopeContainerTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/AbstractScopeContainerTestCase.java
deleted file mode 100644
index a6e4de3c48..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/AbstractScopeContainerTestCase.java
+++ /dev/null
@@ -1,61 +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 org.apache.tuscany.core.component.scope;
-
-import java.net.URI;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.spi.component.ScopeContainer;
-import org.apache.tuscany.spi.component.AtomicComponent;
-import org.apache.tuscany.spi.component.InstanceWrapper;
-
-import org.easymock.EasyMock;
-import org.easymock.IMocksControl;
-
-/**
- * @version $Rev$ $Date$
- */
-public abstract class AbstractScopeContainerTestCase<T, KEY> extends TestCase {
- protected IMocksControl control;
- protected ScopeContainer<KEY> scopeContainer;
- protected URI groupId;
- protected KEY contextId;
- protected AtomicComponent<T> component;
- protected InstanceWrapper<T> wrapper;
-
- @SuppressWarnings("unchecked")
- protected void setUp() throws Exception {
- super.setUp();
- control = EasyMock.createStrictControl();
- component = control.createMock(AtomicComponent.class);
- wrapper = control.createMock(InstanceWrapper.class);
- }
-
- protected void preRegisterComponent() throws Exception {
- scopeContainer.start();
- scopeContainer.register(component, groupId);
- EasyMock.expect(component.isEagerInit()).andStubReturn(false);
- }
-
- protected void expectCreateWrapper() throws Exception {
- EasyMock.expect(component.createInstanceWrapper()).andReturn(wrapper);
- wrapper.start();
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/BasicCompositeScopeTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/BasicCompositeScopeTestCase.java
deleted file mode 100644
index cb66af27b0..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/BasicCompositeScopeTestCase.java
+++ /dev/null
@@ -1,143 +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 org.apache.tuscany.core.component.scope;
-
-import java.net.URI;
-
-import junit.framework.TestCase;
-import org.easymock.EasyMock;
-import org.easymock.IMocksControl;
-
-import org.apache.tuscany.spi.component.AtomicComponent;
-import org.apache.tuscany.spi.component.InstanceWrapper;
-import org.apache.tuscany.spi.component.ScopeContainer;
-import org.apache.tuscany.spi.component.TargetResolutionException;
-import org.apache.tuscany.spi.model.Scope;
-
-/**
- * @version $$Rev$$ $$Date$$
- */
-public class BasicCompositeScopeTestCase<T> extends TestCase {
- protected IMocksControl control;
- protected ScopeContainer<URI> scopeContainer;
- protected URI groupId;
- protected URI contextId;
- protected AtomicComponent<T> component;
- protected InstanceWrapper<T> wrapper;
-
- public void testCorrectScope() {
- assertEquals(Scope.COMPOSITE, scopeContainer.getScope());
- }
-
- public void testWrapperCreation() throws Exception {
- EasyMock.expect(component.createInstanceWrapper()).andReturn(wrapper);
- wrapper.start();
- control.replay();
- scopeContainer.register(component, groupId);
- assertSame(wrapper, scopeContainer.getWrapper(component, contextId));
- assertSame(wrapper, scopeContainer.getWrapper(component, contextId));
- assertSame(wrapper, scopeContainer.getAssociatedWrapper(component, contextId));
- control.verify();
- }
-
- public void testGetAssociatedInstanceNonExistent() throws Exception {
- URI uri = URI.create("oops");
- EasyMock.expect(component.getUri()).andReturn(uri);
- control.replay();
- scopeContainer.register(component, groupId);
- try {
- scopeContainer.getAssociatedWrapper(component, contextId);
- fail();
- } catch (TargetResolutionException e) {
- assertEquals(uri.toString(), e.getMessage());
- }
- control.verify();
- }
-
- /*
- public void testLifecycleWithNoEagerInit() throws Exception {
- EasyMock.expect(component.getInitLevel()).andReturn(0);
- control.replay();
- scopeContainer.startContext(contextId, groupId);
- scopeContainer.stopContext(contextId);
- control.verify();
- }
-
- public void testLifecycleWithEagerInit() throws Exception {
- EasyMock.expect(component.getInitLevel()).andReturn(1);
- EasyMock.expect(component.createInstanceWrapper()).andReturn(wrapper);
- wrapper.start();
- wrapper.stop();
- EasyMock.replay(component, wrapper);
- scopeContainer.onEvent(new ComponentStart(this, null));
- scopeContainer.onEvent(new ComponentStop(this, null));
- EasyMock.verify(component, wrapper);
- }
-
- public void testDestroyOrder() throws Exception {
- scopeContainer = new CompositeScopeContainer(null);
- scopeContainer.start();
- IMocksControl control = EasyMock.createStrictControl();
- InstanceWrapper wrapper1 = control.createMock(InstanceWrapper.class);
- InstanceWrapper wrapper2 = control.createMock(InstanceWrapper.class);
- InstanceWrapper wrapper3 = control.createMock(InstanceWrapper.class);
- AtomicComponent component1 = control.createMock(AtomicComponent.class);
- AtomicComponent component2 = control.createMock(AtomicComponent.class);
- AtomicComponent component3 = control.createMock(AtomicComponent.class);
-
- EasyMock.expect(component1.getInitLevel()).andStubReturn(-1);
- EasyMock.expect(component2.getInitLevel()).andStubReturn(1);
- EasyMock.expect(component3.getInitLevel()).andStubReturn(-1);
-
- EasyMock.expect(component2.createInstanceWrapper()).andReturn(wrapper2);
- wrapper2.start();
- EasyMock.expect(component1.createInstanceWrapper()).andReturn(wrapper1);
- wrapper1.start();
- EasyMock.expect(component3.createInstanceWrapper()).andReturn(wrapper3);
- wrapper3.start();
- wrapper3.stop();
- wrapper1.stop();
- wrapper2.stop();
- control.replay();
-
- scopeContainer.register(component1, contextId);
- scopeContainer.register(component2, contextId);
- scopeContainer.register(component3, contextId);
- scopeContainer.onEvent(new ComponentStart(this, null));
- assertSame(wrapper1, scopeContainer.getWrapper(component1));
- assertSame(wrapper2, scopeContainer.getWrapper(component2));
- assertSame(wrapper3, scopeContainer.getWrapper(component3));
- scopeContainer.onEvent(new ComponentStop(this, null));
- control.verify();
- }
- */
- @SuppressWarnings("unchecked")
- protected void setUp() throws Exception {
- super.setUp();
- groupId = contextId = URI.create("compositeId");
- control = EasyMock.createStrictControl();
- component = control.createMock(AtomicComponent.class);
- EasyMock.expect(component.isEagerInit()).andStubReturn(false);
- wrapper = control.createMock(InstanceWrapper.class);
-
- scopeContainer = new CompositeScopeContainer<URI>(null);
- scopeContainer.start();
- scopeContainer.startContext(contextId, groupId);
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/BasicConversationalScopeTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/BasicConversationalScopeTestCase.java
deleted file mode 100644
index 02f5540dea..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/BasicConversationalScopeTestCase.java
+++ /dev/null
@@ -1,95 +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 org.apache.tuscany.core.component.scope;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.core.component.SimpleWorkContext;
-import org.apache.tuscany.core.services.store.memory.MemoryStore;
-import org.apache.tuscany.spi.component.AtomicComponent;
-import org.apache.tuscany.spi.component.InstanceWrapper;
-import org.apache.tuscany.spi.component.ScopeContainer;
-import org.apache.tuscany.spi.component.WorkContext;
-import org.apache.tuscany.spi.services.store.StoreMonitor;
-import org.easymock.EasyMock;
-
-/**
- * @version $$Rev: 471111 $$ $$Date: 2006-11-03 23:06:48 -0500 (Fri, 03 Nov 2006) $$
- */
-public class BasicConversationalScopeTestCase extends TestCase {
- private AtomicComponent component;
- private InstanceWrapper wrapper;
- private ScopeContainer scopeContainer;
- private WorkContext workContext;
-
-/*
- public void testLifecycleManagement() throws Exception {
- // start the request
- String conversation = "conv";
- workContext.setIdentifier(Scope.CONVERSATION, conversation);
-
- EasyMock.expect(component.createInstanceWrapper()).andReturn(wrapper);
- wrapper.start();
- // FIXME shouldn't stop be called when the component is removed?
-// wrapper.stop();
- EasyMock.replay(component, wrapper);
- assertSame(wrapper, scopeContainer.getWrapper(component));
- assertSame(wrapper, scopeContainer.getWrapper(component));
- scopeContainer.remove(component);
- EasyMock.verify(component, wrapper);
- }
-*/
-
-/*
- public void testCoversationIsolation() throws Exception {
- String conversation1 = "conv";
- String conversation2 = "conv2";
-
- InstanceWrapper wrapper2 = EasyMock.createStrictMock(InstanceWrapper.class);
- EasyMock.expect(component.createInstanceWrapper()).andReturn(wrapper);
- wrapper.start();
- EasyMock.expect(component.createInstanceWrapper()).andReturn(wrapper2);
- wrapper2.start();
- EasyMock.replay(component, wrapper, wrapper2);
- workContext.setIdentifier(Scope.CONVERSATION, conversation1);
- assertSame(wrapper, scopeContainer.getWrapper(component));
- workContext.setIdentifier(Scope.CONVERSATION, conversation2);
- assertSame(wrapper2, scopeContainer.getWrapper(component));
- EasyMock.verify(component, wrapper);
- }
-*/
- public void testX() {
-}
-
- protected void setUp() throws Exception {
- super.setUp();
- component = EasyMock.createStrictMock(AtomicComponent.class);
- EasyMock.expect(component.getMaxAge()).andStubReturn(-1);
- EasyMock.expect(component.getMaxIdleTime()).andStubReturn(-1);
- wrapper = EasyMock.createStrictMock(InstanceWrapper.class);
-
- StoreMonitor monitor = EasyMock.createMock(StoreMonitor.class);
- monitor.start(EasyMock.isA(String.class));
- monitor.stop(EasyMock.isA(String.class));
- MemoryStore store = new MemoryStore(monitor);
- workContext = new SimpleWorkContext();
- scopeContainer = new ConversationalScopeContainer(store, workContext, null);
- scopeContainer.start();
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/BasicHttpSessionScopeTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/BasicHttpSessionScopeTestCase.java
deleted file mode 100644
index 1f29c92c92..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/BasicHttpSessionScopeTestCase.java
+++ /dev/null
@@ -1,220 +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 org.apache.tuscany.core.component.scope;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.core.component.SimpleWorkContext;
-import org.apache.tuscany.spi.component.AtomicComponent;
-import org.apache.tuscany.spi.component.InstanceWrapper;
-import org.apache.tuscany.spi.component.ScopeContainer;
-import org.apache.tuscany.spi.component.ScopeContainerMonitor;
-import org.apache.tuscany.spi.component.WorkContext;
-import org.easymock.EasyMock;
-
-/**
- * @version $$Rev$$ $$Date$$
- */
-public abstract class BasicHttpSessionScopeTestCase extends TestCase {
- private ScopeContainerMonitor monitor;
- private ScopeContainer scopeContainer;
- private AtomicComponent component;
- private InstanceWrapper wrapper;
- private WorkContext workContext;
-
- public void testLifecycleManagement() throws Exception {
-/*
- // start the request
- Object session = new Object();
- workContext.setIdentifier(Scope.SESSION, session);
-
- EasyMock.expect(component.createInstanceWrapper()).andReturn(wrapper);
- wrapper.start();
- wrapper.stop();
- EasyMock.replay(component, wrapper);
- assertSame(wrapper, scopeContainer.getWrapper(component));
- assertSame(wrapper, scopeContainer.getWrapper(component));
- scopeContainer.onEvent(new HttpSessionEnd(this, session));
- EasyMock.verify(component, wrapper);
-*/
- }
-
- public void testGetAssociatedInstance() throws Exception {
-/*
- // start the request
- Object session = new Object();
- workContext.setIdentifier(Scope.SESSION, session);
-
- EasyMock.expect(component.createInstanceWrapper()).andReturn(wrapper);
- wrapper.start();
- EasyMock.replay(component, wrapper);
- assertSame(wrapper, scopeContainer.getWrapper(component));
- assertSame(wrapper, scopeContainer.getAssociatedWrapper(component));
- EasyMock.verify(component, wrapper);
-*/
- }
-
- public void testGetAssociatedInstanceNonExistent() throws Exception {
-/*
- URI id = URI.create("oops");
- EasyMock.expect(component.getUri()).andReturn(id);
- EasyMock.replay(component);
-
- // start the request
- Object session = new Object();
- workContext.setIdentifier(Scope.SESSION, session);
- try {
- scopeContainer.getAssociatedWrapper(component);
- fail();
- } catch (TargetNotFoundException e) {
- assertEquals(id.toString(), e.getMessage());
- EasyMock.verify(component);
- }
-*/
- }
-
- public void testSessionIsolation() throws Exception {
-/*
- // start the request
- Object session1 = new Object();
- Object session2 = new Object();
-
- InstanceWrapper wrapper2 = EasyMock.createNiceMock(InstanceWrapper.class);
- EasyMock.expect(component.createInstanceWrapper()).andReturn(wrapper);
- wrapper.start();
- EasyMock.expect(component.createInstanceWrapper()).andReturn(wrapper2);
- wrapper2.start();
- EasyMock.replay(component, wrapper);
- workContext.setIdentifier(Scope.SESSION, session1);
- assertSame(wrapper, scopeContainer.getWrapper(component));
- assertSame(wrapper, scopeContainer.getAssociatedWrapper(component));
- workContext.setIdentifier(Scope.SESSION, session2);
- assertSame(wrapper2, scopeContainer.getWrapper(component));
- assertSame(wrapper2, scopeContainer.getAssociatedWrapper(component));
- workContext.setIdentifier(Scope.SESSION, session1);
- assertSame(wrapper, scopeContainer.getWrapper(component));
- EasyMock.verify(component, wrapper);
-*/
- }
-
- public void testDestroyErrorMonitor() throws Exception {
-/*
- TargetDestructionException ex = new TargetDestructionException("oops", "again");
- monitor.destructionError(ex);
- EasyMock.expect(component.createInstanceWrapper()).andReturn(wrapper);
- wrapper.start();
- wrapper.stop();
- EasyMock.expectLastCall().andThrow(ex);
- EasyMock.replay(component, wrapper, monitor);
-
- Object id = new Object();
- scopeContainer.onEvent(new HttpSessionStart(this, id));
- workContext.setIdentifier(Scope.SESSION, id);
- assertSame(wrapper, scopeContainer.getWrapper(component));
- scopeContainer.onEvent(new HttpSessionEnd(this, id));
- EasyMock.verify(component, wrapper, monitor);
-*/
- }
-
- public void testDestroyOrder() throws Exception {
-/*
- Object session = new Object();
- workContext.setIdentifier(Scope.SESSION, session);
-
- IMocksControl control = EasyMock.createStrictControl();
- InstanceWrapper wrapper1 = control.createMock(InstanceWrapper.class);
- InstanceWrapper wrapper2 = control.createMock(InstanceWrapper.class);
- InstanceWrapper wrapper3 = control.createMock(InstanceWrapper.class);
- AtomicComponent component1 = control.createMock(AtomicComponent.class);
- AtomicComponent component2 = control.createMock(AtomicComponent.class);
- AtomicComponent component3 = control.createMock(AtomicComponent.class);
-
- component1.addListener(scopeContainer);
- component2.addListener(scopeContainer);
- component3.addListener(scopeContainer);
- EasyMock.expect(component1.createInstanceWrapper()).andReturn(wrapper1);
- wrapper1.start();
- EasyMock.expect(component2.createInstanceWrapper()).andReturn(wrapper2);
- wrapper2.start();
- EasyMock.expect(component3.createInstanceWrapper()).andReturn(wrapper3);
- wrapper3.start();
- wrapper3.stop();
- wrapper2.stop();
- wrapper1.stop();
- control.replay();
-
- scopeContainer.register(component1, null);
- scopeContainer.register(component2, null);
- scopeContainer.register(component3, null);
- scopeContainer.onEvent(new HttpSessionStart(this, session));
- assertSame(wrapper1, scopeContainer.getWrapper(component1));
- assertSame(wrapper2, scopeContainer.getWrapper(component2));
- assertSame(wrapper3, scopeContainer.getWrapper(component3));
- scopeContainer.onEvent(new HttpSessionEnd(this, session));
- control.verify();
-*/
- }
-
- public void testReuseSession() throws Exception {
-/*
- Object session = new Object();
- workContext.setIdentifier(Scope.SESSION, session);
-
- IMocksControl control = EasyMock.createStrictControl();
- InstanceWrapper wrapper1 = control.createMock(InstanceWrapper.class);
- InstanceWrapper wrapper2 = control.createMock(InstanceWrapper.class);
- AtomicComponent component1 = control.createMock(AtomicComponent.class);
-
- component1.addListener(scopeContainer);
- EasyMock.expect(component1.createInstanceWrapper()).andReturn(wrapper1);
- wrapper1.start();
- wrapper1.stop();
- EasyMock.expect(component1.createInstanceWrapper()).andReturn(wrapper2);
- wrapper2.start();
- wrapper2.stop();
- control.replay();
-
- scopeContainer.register(component1, null);
- scopeContainer.onEvent(new HttpSessionStart(this, session));
- assertSame(wrapper1, scopeContainer.getWrapper(component1));
- scopeContainer.onEvent(new HttpSessionEnd(this, session));
-
- scopeContainer.onEvent(new HttpSessionStart(this, session));
- assertSame(wrapper2, scopeContainer.getWrapper(component1));
- scopeContainer.onEvent(new HttpSessionEnd(this, session));
- control.verify();
-*/
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- component = EasyMock.createStrictMock(AtomicComponent.class);
- wrapper = EasyMock.createStrictMock(InstanceWrapper.class);
-
- workContext = new SimpleWorkContext();
- monitor = EasyMock.createStrictMock(ScopeContainerMonitor.class);
- scopeContainer = new HttpSessionScopeContainer(workContext, monitor);
- scopeContainer.start();
-
- component.addListener(scopeContainer);
- EasyMock.replay(component);
- scopeContainer.register(component, null);
- EasyMock.reset(component);
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/BasicRequestScopeTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/BasicRequestScopeTestCase.java
deleted file mode 100644
index 4aad2dc0c6..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/BasicRequestScopeTestCase.java
+++ /dev/null
@@ -1,167 +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 org.apache.tuscany.core.component.scope;
-
-import junit.framework.TestCase;
-import org.easymock.EasyMock;
-
-import org.apache.tuscany.spi.component.AtomicComponent;
-import org.apache.tuscany.spi.component.InstanceWrapper;
-import org.apache.tuscany.spi.component.ScopeContainer;
-import org.apache.tuscany.spi.component.ScopeContainerMonitor;
-
-/**
- * @version $$Rev$$ $$Date$$
- */
-public abstract class BasicRequestScopeTestCase extends TestCase {
- private ScopeContainerMonitor monitor;
- private ScopeContainer scopeContainer;
- private AtomicComponent component;
- private InstanceWrapper wrapper;
-
- public void testLifecycleManagement() throws Exception {
-/*
- EasyMock.expect(component.createInstanceWrapper()).andReturn(wrapper);
- wrapper.start();
- EasyMock.replay(component, wrapper);
- assertSame(wrapper, scopeContainer.getWrapper(component));
- assertSame(wrapper, scopeContainer.getWrapper(component));
- EasyMock.verify(component, wrapper);
-*/
- }
-
- public void testGetAssociatedInstance() throws Exception {
-/*
- EasyMock.expect(component.createInstanceWrapper()).andReturn(wrapper);
- wrapper.start();
- EasyMock.replay(component, wrapper);
- assertSame(wrapper, scopeContainer.getWrapper(component));
- assertSame(wrapper, scopeContainer.getAssociatedWrapper(component));
- EasyMock.verify(component, wrapper);
-*/
- }
-
- public void testGetAssociatedInstanceNonExistent() throws Exception {
-/*
- URI id = URI.create("oops");
- EasyMock.expect(component.getUri()).andReturn(id);
- EasyMock.replay(component);
-
- try {
- scopeContainer.getAssociatedWrapper(component);
- fail();
- } catch (TargetNotFoundException e) {
- assertEquals(id.toString(), e.getMessage());
- EasyMock.verify(component);
- }
-*/
- }
-
- public void testRequestIsolation() throws Exception {
-/*
- IMocksControl control = EasyMock.createStrictControl();
- InstanceWrapper wrapper1 = control.createMock(InstanceWrapper.class);
- InstanceWrapper wrapper2 = control.createMock(InstanceWrapper.class);
- AtomicComponent component1 = control.createMock(AtomicComponent.class);
- AtomicComponent component2 = control.createMock(AtomicComponent.class);
-
- EasyMock.expect(component1.createInstanceWrapper()).andReturn(wrapper1);
- wrapper1.start();
- wrapper1.stop();
- EasyMock.expect(component2.createInstanceWrapper()).andReturn(wrapper2);
- wrapper2.start();
- wrapper2.stop();
- control.replay();
-
- scopeContainer.register(component1, null);
- scopeContainer.register(component2, null);
- scopeContainer.onEvent(new RequestStart(this));
- assertSame(wrapper1, scopeContainer.getWrapper(component1));
- scopeContainer.onEvent(new RequestEnd(this));
- scopeContainer.onEvent(new RequestStart(this));
- assertSame(wrapper2, scopeContainer.getWrapper(component2));
- scopeContainer.onEvent(new RequestEnd(this));
- control.verify();
-*/
- }
-
- public void testDestroyErrorMonitor() throws Exception {
-/*
- TargetDestructionException ex = new TargetDestructionException("oops", "again");
- monitor.destructionError(ex);
- EasyMock.expect(component.createInstanceWrapper()).andReturn(wrapper);
- wrapper.start();
- wrapper.stop();
- EasyMock.expectLastCall().andThrow(ex);
- EasyMock.replay(component, wrapper, monitor);
-
- scopeContainer.onEvent(new RequestStart(this));
- assertSame(wrapper, scopeContainer.getWrapper(component));
- scopeContainer.onEvent(new RequestEnd(this));
- EasyMock.verify(component, wrapper, monitor);
-*/
- }
-
- public void testDestroyOrder() throws Exception {
-/*
- IMocksControl control = EasyMock.createStrictControl();
- InstanceWrapper wrapper1 = control.createMock(InstanceWrapper.class);
- InstanceWrapper wrapper2 = control.createMock(InstanceWrapper.class);
- InstanceWrapper wrapper3 = control.createMock(InstanceWrapper.class);
- AtomicComponent component1 = control.createMock(AtomicComponent.class);
- AtomicComponent component2 = control.createMock(AtomicComponent.class);
- AtomicComponent component3 = control.createMock(AtomicComponent.class);
-
- EasyMock.expect(component1.createInstanceWrapper()).andReturn(wrapper1);
- wrapper1.start();
- EasyMock.expect(component2.createInstanceWrapper()).andReturn(wrapper2);
- wrapper2.start();
- EasyMock.expect(component3.createInstanceWrapper()).andReturn(wrapper3);
- wrapper3.start();
- wrapper3.stop();
- wrapper2.stop();
- wrapper1.stop();
- control.replay();
-
- scopeContainer.register(component1, null);
- scopeContainer.register(component2, null);
- scopeContainer.register(component3, null);
- scopeContainer.onEvent(new RequestStart(this));
- assertSame(wrapper1, scopeContainer.getWrapper(component1));
- assertSame(wrapper2, scopeContainer.getWrapper(component2));
- assertSame(wrapper3, scopeContainer.getWrapper(component3));
- scopeContainer.onEvent(new RequestEnd(this));
- control.verify();
-*/
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- component = EasyMock.createStrictMock(AtomicComponent.class);
- wrapper = EasyMock.createStrictMock(InstanceWrapper.class);
- monitor = EasyMock.createStrictMock(ScopeContainerMonitor.class);
- scopeContainer = new RequestScopeContainer(monitor);
- scopeContainer.start();
-
- component.addListener(scopeContainer);
- EasyMock.replay(component);
- scopeContainer.register(component, null);
- EasyMock.reset(component);
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/BasicStatelessScopeTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/BasicStatelessScopeTestCase.java
deleted file mode 100644
index a7cab71ade..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/BasicStatelessScopeTestCase.java
+++ /dev/null
@@ -1,89 +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 org.apache.tuscany.core.component.scope;
-
-import junit.framework.TestCase;
-import org.easymock.EasyMock;
-import org.easymock.IMocksControl;
-
-import org.apache.tuscany.spi.component.AtomicComponent;
-import org.apache.tuscany.spi.component.InstanceWrapper;
-import org.apache.tuscany.spi.model.Scope;
-
-/**
- * Unit tests for the composite scope container
- *
- * @version $Rev$ $Date$
- */
-public class BasicStatelessScopeTestCase<T> extends TestCase {
- private StatelessScopeContainer<String> scopeContainer;
- private String contextId;
- private IMocksControl control;
- private AtomicComponent<T> component;
- private InstanceWrapper<T> wrapper;
-
- public void testCorrectScope() {
- assertEquals(Scope.STATELESS, scopeContainer.getScope());
- }
-
- public void testInstanceCreation() throws Exception {
- @SuppressWarnings("unchecked")
- InstanceWrapper<T> wrapper2 = control.createMock(InstanceWrapper.class);
-
- EasyMock.expect(component.createInstanceWrapper()).andReturn(wrapper);
- wrapper.start();
- EasyMock.expect(component.createInstanceWrapper()).andReturn(wrapper2);
- wrapper2.start();
- control.replay();
-
- assertSame(wrapper, scopeContainer.getWrapper(component, contextId));
- assertSame(wrapper2, scopeContainer.getWrapper(component, contextId));
- control.verify();
- }
-
- public void testGetAssociatedInstance() throws Exception {
- control.replay();
- try {
- // always throws an exception, which is the semantic for stateless implementations
- scopeContainer.getAssociatedWrapper(component, contextId);
- fail();
- } catch (UnsupportedOperationException e) {
- // ok
- }
- control.verify();
- }
-
- public void testReturnWrapper() throws Exception {
- wrapper.stop();
- control.replay();
- scopeContainer.returnWrapper(component, wrapper, contextId);
- control.verify();
- }
-
- @SuppressWarnings("unchecked")
- protected void setUp() throws Exception {
- super.setUp();
- scopeContainer = new StatelessScopeContainer<String>(null);
- contextId = "context";
-
- control = EasyMock.createStrictControl();
- component = control.createMock(AtomicComponent.class);
- wrapper = control.createMock(InstanceWrapper.class);
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/CompositeScopeInitDestroyErrorTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/CompositeScopeInitDestroyErrorTestCase.java
deleted file mode 100644
index 01c426e917..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/CompositeScopeInitDestroyErrorTestCase.java
+++ /dev/null
@@ -1,93 +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 org.apache.tuscany.core.component.scope;
-
-import java.net.URI;
-
-import org.apache.tuscany.spi.ObjectCreationException;
-import org.apache.tuscany.spi.component.AtomicComponent;
-import org.apache.tuscany.spi.component.ScopeContainerMonitor;
-import org.apache.tuscany.spi.component.TargetDestructionException;
-import org.apache.tuscany.spi.component.InstanceWrapper;
-import org.apache.tuscany.spi.component.TargetResolutionException;
-import org.apache.tuscany.spi.component.GroupInitializationException;
-
-import junit.framework.TestCase;
-import org.apache.tuscany.core.component.event.ComponentStart;
-import org.apache.tuscany.core.component.event.ComponentStop;
-import org.easymock.EasyMock;
-
-/**
- * @version $Rev$ $Date$
- */
-public class CompositeScopeInitDestroyErrorTestCase extends TestCase {
- private URI groupId;
-
- public void testInitializeError() throws Exception {
- CompositeScopeContainer scope = new CompositeScopeContainer(null);
- scope.start();
-
- ObjectCreationException ex = new ObjectCreationException("");
- AtomicComponent component = EasyMock.createMock(AtomicComponent.class);
- EasyMock.expect(component.createInstanceWrapper()).andThrow(ex);
- EasyMock.expect(component.isEagerInit()).andStubReturn(true);
- EasyMock.expect(component.getInitLevel()).andStubReturn(1);
- EasyMock.replay(component);
- scope.register(component, groupId);
- try {
- scope.startContext(groupId, groupId);
- } catch (GroupInitializationException e) {
- assertSame(ex, e.getCauses().get(0));
- }
- EasyMock.verify(component);
- }
-
- public void testDestroyErrorMonitor() throws Exception {
- InstanceWrapper wrapper = EasyMock.createMock(InstanceWrapper.class);
- wrapper.start();
- wrapper.stop();
- EasyMock.expectLastCall().andThrow(new TargetDestructionException("", ""));
- EasyMock.replay(wrapper);
-
- ScopeContainerMonitor monitor;
- monitor = EasyMock.createMock(ScopeContainerMonitor.class);
- monitor.destructionError(EasyMock.isA(TargetDestructionException.class));
- EasyMock.replay(monitor);
- CompositeScopeContainer scope = new CompositeScopeContainer(monitor);
- scope.start();
-
- AtomicComponent component = EasyMock.createMock(AtomicComponent.class);
- EasyMock.expect(component.createInstanceWrapper()).andReturn(wrapper);
- EasyMock.expect(component.isEagerInit()).andStubReturn(true);
- EasyMock.expect(component.getInitLevel()).andStubReturn(1);
- EasyMock.replay(component);
- scope.register(component, groupId);
- scope.startContext(groupId, groupId);
- scope.stopContext(groupId);
- EasyMock.verify(monitor);
- EasyMock.verify(component);
- EasyMock.verify(wrapper);
- }
-
-
- protected void setUp() throws Exception {
- super.setUp();
- groupId = URI.create("composite");
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/ConversationalScopeContainerDestroyOnExpirationTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/ConversationalScopeContainerDestroyOnExpirationTestCase.java
deleted file mode 100644
index caf0c0cc5e..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/ConversationalScopeContainerDestroyOnExpirationTestCase.java
+++ /dev/null
@@ -1,72 +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 org.apache.tuscany.core.component.scope;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.core.component.SimpleWorkContext;
-import org.apache.tuscany.spi.component.AtomicComponent;
-import org.apache.tuscany.spi.component.InstanceWrapper;
-import org.apache.tuscany.spi.component.WorkContext;
-import org.apache.tuscany.spi.event.RuntimeEventListener;
-import org.apache.tuscany.spi.services.store.Store;
-import org.apache.tuscany.spi.services.store.StoreExpirationEvent;
-import org.easymock.EasyMock;
-import org.easymock.IAnswer;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ConversationalScopeContainerDestroyOnExpirationTestCase extends TestCase {
- private Store store;
- private RuntimeEventListener listener;
- private WorkContext context;
- private InstanceWrapper wrapper;
- private AtomicComponent component;
-
- /**
- * Verifies the scope container registers a callback listener for component instance destroy events when a
- * conversational instance expires
- */
- public void testDestroyNotification() throws Exception {
- store.addListener(EasyMock.isA(RuntimeEventListener.class));
- EasyMock.expectLastCall().andStubAnswer(new IAnswer<Object>(){
- public Object answer() throws Throwable {
- listener = (RuntimeEventListener) EasyMock.getCurrentArguments()[0];
- return null;
- }
- });
- wrapper.stop();
- EasyMock.replay(store);
- EasyMock.replay(wrapper);
-
- new ConversationalScopeContainer(store, context, null);
- listener.onEvent(new StoreExpirationEvent(this, component, wrapper));
- EasyMock.verify(store);
- EasyMock.verify(wrapper);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- store = EasyMock.createMock(Store.class);
- wrapper = EasyMock.createMock(InstanceWrapper.class);
- component = EasyMock.createMock(AtomicComponent.class);
- context = new SimpleWorkContext();
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/ConversationalScopeContainerMaxAgeTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/ConversationalScopeContainerMaxAgeTestCase.java
deleted file mode 100644
index e896b410d0..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/ConversationalScopeContainerMaxAgeTestCase.java
+++ /dev/null
@@ -1,76 +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 org.apache.tuscany.core.component.scope;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.core.component.SimpleWorkContext;
-import org.apache.tuscany.spi.component.AtomicComponent;
-import org.apache.tuscany.spi.component.InstanceWrapper;
-import org.apache.tuscany.spi.component.SCAObject;
-import org.apache.tuscany.spi.component.ScopeContainer;
-import org.apache.tuscany.spi.component.WorkContext;
-import org.apache.tuscany.spi.event.RuntimeEventListener;
-import org.apache.tuscany.spi.model.Scope;
-import org.apache.tuscany.spi.services.store.Store;
-import org.easymock.EasyMock;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ConversationalScopeContainerMaxAgeTestCase extends TestCase {
-
- private ScopeContainer container;
- private WorkContext context;
- private Store store;
- private AtomicComponent component;
- private InstanceWrapper wrapper;
-
- public void testMaxAgeUpdate() throws Exception {
-/*
- context.setIdentifier(Scope.CONVERSATION, "12345");
- assertSame(wrapper, container.getWrapper(component));
- EasyMock.verify(store);
-*/
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- context = new SimpleWorkContext();
- component = EasyMock.createMock(AtomicComponent.class);
- EasyMock.expect(component.getMaxIdleTime()).andReturn(-1L).atLeastOnce();
- EasyMock.expect(component.getMaxAge()).andReturn(600000L).atLeastOnce();
- EasyMock.replay(component);
-
- wrapper = EasyMock.createMock(InstanceWrapper.class);
-
- store = EasyMock.createMock(Store.class);
- EasyMock.expect(store.readRecord(EasyMock.isA(SCAObject.class), EasyMock.isA(String.class))).andReturn(wrapper);
- store.addListener(EasyMock.isA(RuntimeEventListener.class));
- EasyMock.replay(store);
- container = new ConversationalScopeContainer(store, context, null);
- container.start();
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- context.clearIdentifier(Scope.CONVERSATION);
- container.stop();
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/ConversationalScopeContainerMaxIdleTimeTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/ConversationalScopeContainerMaxIdleTimeTestCase.java
deleted file mode 100644
index 9ac97bff32..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/ConversationalScopeContainerMaxIdleTimeTestCase.java
+++ /dev/null
@@ -1,78 +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 org.apache.tuscany.core.component.scope;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.core.component.SimpleWorkContext;
-import org.apache.tuscany.spi.component.AtomicComponent;
-import org.apache.tuscany.spi.component.InstanceWrapper;
-import org.apache.tuscany.spi.component.SCAObject;
-import org.apache.tuscany.spi.component.ScopeContainer;
-import org.apache.tuscany.spi.component.WorkContext;
-import org.apache.tuscany.spi.event.RuntimeEventListener;
-import org.apache.tuscany.spi.model.Scope;
-import org.apache.tuscany.spi.services.store.Store;
-import org.easymock.EasyMock;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ConversationalScopeContainerMaxIdleTimeTestCase extends TestCase {
-
- private ScopeContainer container;
- private WorkContext context;
- private Store store;
- private AtomicComponent component;
- private InstanceWrapper wrapper;
-
- public void testMaxIdleTimeUpdate() throws Exception {
-/*
- context.setIdentifier(Scope.CONVERSATION, "12345");
- assertSame(wrapper, container.getWrapper(component));
- EasyMock.verify(store);
-*/
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- wrapper = EasyMock.createMock(InstanceWrapper.class);
- context = new SimpleWorkContext();
- component = EasyMock.createMock(AtomicComponent.class);
- EasyMock.expect(component.getMaxIdleTime()).andStubReturn(600000L);
- EasyMock.replay(component);
- store = EasyMock.createMock(Store.class);
- EasyMock.expect(store.readRecord(EasyMock.isA(SCAObject.class), EasyMock.isA(String.class))).andReturn(wrapper);
- store.addListener(EasyMock.isA(RuntimeEventListener.class));
- store.updateRecord(EasyMock.isA(SCAObject.class),
- EasyMock.isA(String.class),
- EasyMock.eq(wrapper),
- EasyMock.anyLong());
- EasyMock.replay(store);
- container = new ConversationalScopeContainer(store, context, null);
- container.start();
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- context.clearIdentifier(Scope.CONVERSATION);
- container.stop();
- }
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/ConversationalScopeContainerPersistenceTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/ConversationalScopeContainerPersistenceTestCase.java
deleted file mode 100644
index a8960c4575..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/ConversationalScopeContainerPersistenceTestCase.java
+++ /dev/null
@@ -1,189 +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 org.apache.tuscany.core.component.scope;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.core.component.SimpleWorkContext;
-import org.apache.tuscany.core.services.store.memory.MemoryStore;
-import org.apache.tuscany.spi.component.WorkContext;
-import org.apache.tuscany.spi.model.Scope;
-import org.apache.tuscany.spi.services.store.Store;
-import org.apache.tuscany.spi.services.store.StoreMonitor;
-import org.easymock.EasyMock;
-
-/**
- * @version $Rev$ $Date$
- */
-public abstract class ConversationalScopeContainerPersistenceTestCase extends TestCase {
- private ConversationalScopeContainer container;
- private WorkContext context;
-
- public void testNotYetPersistedInMemory() throws Exception {
-/*
- InstanceWrapper wrapper = EasyMock.createMock(InstanceWrapper.class);
- wrapper.start();
- EasyMock.replay(wrapper);
-
- String id = UUID.randomUUID().toString();
- context.setIdentifier(Scope.CONVERSATION, id);
- AtomicComponent component = EasyMock.createMock(AtomicComponent.class);
- component.addListener(EasyMock.eq(container));
- EasyMock.expect(component.createInstanceWrapper()).andReturn(wrapper);
- EasyMock.expect(component.getMaxAge()).andReturn(600000L).atLeastOnce();
- EasyMock.replay(component);
-
- container.register(component, null);
- assertSame(wrapper, container.getWrapper(component));
- EasyMock.verify(component);
- EasyMock.verify(wrapper);
-*/
- }
-
- public void testPersistNewInMemory() throws Exception {
-/*
- String id = UUID.randomUUID().toString();
- String id2 = UUID.randomUUID().toString();
- context.setIdentifier(Scope.CONVERSATION, id);
- AtomicComponent component = EasyMock.createMock(AtomicComponent.class);
- component.addListener(EasyMock.eq(container));
- EasyMock.expect(component.getMaxIdleTime()).andReturn(-1L).atLeastOnce();
- EasyMock.replay(component);
- container.register(component, null);
- InstanceWrapper fooWrapper = EasyMock.createMock(InstanceWrapper.class);
- InstanceWrapper fooWrapper2 = EasyMock.createMock(InstanceWrapper.class);
- container.persistNew(component, id, fooWrapper, System.currentTimeMillis() + 100000);
- assertEquals(fooWrapper, container.getWrapper(component));
- container.persistNew(component, id2, fooWrapper2, System.currentTimeMillis() + 100000);
- context.setIdentifier(Scope.CONVERSATION, id2);
- assertEquals(fooWrapper2, container.getWrapper(component));
- EasyMock.verify(component);
-*/
- }
-
- public void testPersistInMemory() throws Exception {
-/*
- String id = UUID.randomUUID().toString();
- context.setIdentifier(Scope.CONVERSATION, id);
- AtomicComponent component = EasyMock.createMock(AtomicComponent.class);
- component.addListener(EasyMock.eq(container));
- EasyMock.expect(component.getMaxIdleTime()).andReturn(-1L).atLeastOnce();
- EasyMock.replay(component);
- container.register(component, null);
- InstanceWrapper fooWrapper = EasyMock.createMock(InstanceWrapper.class);
- container.persistNew(component, id, fooWrapper, System.currentTimeMillis() + 100000);
- assertEquals(fooWrapper, container.getWrapper(component));
- container.persist(component, id, fooWrapper, System.currentTimeMillis() + 100000);
- assertEquals(fooWrapper, container.getWrapper(component));
- EasyMock.verify(component);
-*/
- }
-
- public void testRemoveInMemory() throws Exception {
-/*
- String id = UUID.randomUUID().toString();
- context.setIdentifier(Scope.CONVERSATION, id);
- AtomicComponent component = EasyMock.createMock(AtomicComponent.class);
- component.addListener(EasyMock.eq(container));
- EasyMock.expect(component.getMaxIdleTime()).andReturn(-1L).atLeastOnce();
- EasyMock.expect(component.getUri()).andReturn(URI.create("foo")).atLeastOnce();
- EasyMock.replay(component);
- container.register(component, null);
- InstanceWrapper fooWrapper = EasyMock.createMock(InstanceWrapper.class);
- container.persistNew(component, id, fooWrapper, System.currentTimeMillis() + 100000);
- assertEquals(fooWrapper, container.getWrapper(component));
- container.remove(component);
- try {
- container.getAssociatedWrapper(component);
- fail();
- } catch (TargetNotFoundException e) {
- //expected
- }
- EasyMock.verify(component);
-*/
- }
-
- public void testRecreateAfterRemoveInMemory() throws Exception {
-/*
- InstanceWrapper wrapper = EasyMock.createMock(InstanceWrapper.class);
- wrapper.start();
- EasyMock.replay(wrapper);
-
- String id = UUID.randomUUID().toString();
- context.setIdentifier(Scope.CONVERSATION, id);
- AtomicComponent component = EasyMock.createMock(AtomicComponent.class);
- component.addListener(EasyMock.eq(container));
- EasyMock.expect(component.getMaxAge()).andReturn(600000L).atLeastOnce();
- EasyMock.expect(component.getMaxIdleTime()).andReturn(-1L).atLeastOnce();
- EasyMock.expect(component.createInstanceWrapper()).andReturn(wrapper);
- EasyMock.replay(component);
-
- container.register(component, null);
- InstanceWrapper fooWrapper = EasyMock.createMock(InstanceWrapper.class);
- container.persistNew(component, id, fooWrapper, System.currentTimeMillis() + 100000);
- assertEquals(fooWrapper, container.getWrapper(component));
- container.remove(component);
- assertSame(wrapper, container.getWrapper(component));
- EasyMock.verify(component);
-*/
- }
-
- public void testGetPersistedInstance() throws Exception {
-/*
- String id = UUID.randomUUID().toString();
- String id2 = UUID.randomUUID().toString();
- context.setIdentifier(Scope.CONVERSATION, id);
- AtomicComponent component = EasyMock.createMock(AtomicComponent.class);
- EasyMock.expect(component.getUri()).andReturn(URI.create("foo")).atLeastOnce();
- EasyMock.expect(component.getMaxIdleTime()).andReturn(-1L).atLeastOnce();
- component.addListener(EasyMock.eq(container));
- EasyMock.replay(component);
- container.register(component, null);
-
- InstanceWrapper fooWrapper = EasyMock.createMock(InstanceWrapper.class);
- container.persistNew(component, id, fooWrapper, System.currentTimeMillis() + 100000);
- assertEquals(fooWrapper, container.getAssociatedWrapper(component));
- assertEquals(fooWrapper, container.getAssociatedWrapper(component));
- context.setIdentifier(Scope.CONVERSATION, id2);
- try {
- container.getAssociatedWrapper(component);
- fail();
- } catch (TargetNotFoundException e) {
- //expected
- }
- EasyMock.verify(component);
-*/
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- context = new SimpleWorkContext();
- StoreMonitor mock = EasyMock.createNiceMock(StoreMonitor.class);
- EasyMock.replay(mock);
- Store store = new MemoryStore(mock);
- container = new ConversationalScopeContainer(store, context, null);
- container.start();
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- context.clearIdentifier(Scope.CONVERSATION);
- container.stop();
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/InstanceWrapperBaseTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/InstanceWrapperBaseTestCase.java
deleted file mode 100644
index c583ff19c6..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/InstanceWrapperBaseTestCase.java
+++ /dev/null
@@ -1,64 +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 org.apache.tuscany.core.component.scope;
-
-import junit.framework.TestCase;
-
-/**
- * @version $Rev$ $Date$
- */
-public class InstanceWrapperBaseTestCase extends TestCase {
- private static final Object INSTANCE = new Object();
- private InstanceWrapperBase<Object> wrapper;
-
- public void testLifecycle() throws Exception {
- assertFalse(wrapper.isStarted());
- try {
- wrapper.getInstance();
- fail();
- } catch (AssertionError e) {
- // expected
- }
- wrapper.start();
- assertTrue(wrapper.isStarted());
- assertSame(INSTANCE, wrapper.getInstance());
- wrapper.stop();
- assertFalse(wrapper.isStarted());
- try {
- wrapper.getInstance();
- fail();
- } catch (AssertionError e) {
- // expected
- }
- }
-
- public void testNullCheck() {
- try {
- new InstanceWrapperBase<Object>(null);
- fail();
- } catch (AssertionError e) {
- // expected
- }
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- wrapper = new InstanceWrapperBase<Object>(INSTANCE);
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/WorkContextTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/WorkContextTestCase.java
deleted file mode 100644
index 94feca05be..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/component/scope/WorkContextTestCase.java
+++ /dev/null
@@ -1,166 +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 org.apache.tuscany.core.component.scope;
-
-import org.apache.tuscany.spi.component.AtomicComponent;
-import org.apache.tuscany.spi.component.Component;
-import org.apache.tuscany.spi.component.WorkContext;
-
-import junit.framework.TestCase;
-import org.apache.tuscany.core.component.SimpleWorkContext;
-import org.easymock.EasyMock;
-
-/**
- * @version $Rev$ $Date$
- */
-public class WorkContextTestCase extends TestCase {
-
- public void testSetCurrentAtomicComponent() throws Exception {
- WorkContext ctx = new SimpleWorkContext();
- AtomicComponent component = EasyMock.createNiceMock(AtomicComponent.class);
- AtomicComponent component2 = EasyMock.createNiceMock(AtomicComponent.class);
- ctx.setCurrentAtomicComponent(component);
- assertEquals(component, ctx.getCurrentAtomicComponent());
- ctx.setCurrentAtomicComponent(component2);
- assertEquals(component2, ctx.getCurrentAtomicComponent());
- }
-
- public void testNonSetCurrentAtomicComponent() throws Exception {
- WorkContext ctx = new SimpleWorkContext();
- assertNull(ctx.getCurrentAtomicComponent());
- }
-
- public void testIndentifier() throws Exception {
- WorkContext ctx = new SimpleWorkContext();
- Object id = new Object();
- ctx.setIdentifier(this, id);
- assertEquals(id, ctx.getIdentifier(this));
- }
-
- public void testClearIndentifier() throws Exception {
- WorkContext ctx = new SimpleWorkContext();
- Object id = new Object();
- ctx.setIdentifier(this, id);
- ctx.clearIdentifier(this);
- assertNull(ctx.getIdentifier(this));
- }
-
- public void testClearIndentifiers() throws Exception {
- WorkContext ctx = new SimpleWorkContext();
- Object id = new Object();
- Object id2 = new Object();
- ctx.setIdentifier(id, id);
- ctx.setIdentifier(id2, id2);
- ctx.clearIdentifiers();
- assertNull(ctx.getIdentifier(id));
- assertNull(ctx.getIdentifier(id2));
- }
-
- public void testClearNonExistentIndentifier() throws Exception {
- WorkContext ctx = new SimpleWorkContext();
- ctx.clearIdentifier(this);
- }
-
- public void testNullIndentifier() throws Exception {
- WorkContext ctx = new SimpleWorkContext();
- Object id = new Object();
- ctx.setIdentifier(this, id);
- ctx.clearIdentifier(null);
- assertEquals(id, ctx.getIdentifier(this));
- }
-
- public void testNoIndentifier() throws Exception {
- WorkContext ctx = new SimpleWorkContext();
- assertNull(ctx.getIdentifier(this));
- }
-
- public void testSetGetCorrelationId() {
- WorkContext context = new SimpleWorkContext();
- context.setCorrelationId("msg-005");
- assertEquals(context.getCorrelationId(), "msg-005");
- context.setCorrelationId(null);
- assertNull(context.getCorrelationId());
- }
-
- public void testSetGetCorrelationIdInNewThread() throws InterruptedException {
- WorkContext context = new SimpleWorkContext();
- context.setCorrelationId("msg-005");
- assertEquals(context.getCorrelationId(), "msg-005");
- context.setIdentifier("TX", "002");
- ChildThread t = new ChildThread(context);
- t.start();
- t.join();
- assertTrue(t.passed);
- context.setCorrelationId(null);
- assertNull(context.getCorrelationId());
- }
-
- public void testCurrentAtomicComponentDoesNotPropagateToChildThread() throws InterruptedException {
- // NOTE should behaviour be to propagate?
- WorkContext context = new SimpleWorkContext();
- context.setCurrentAtomicComponent(EasyMock.createNiceMock(AtomicComponent.class));
- TestCurrentAtomicComponentChildThread t = new TestCurrentAtomicComponentChildThread(context);
- t.start();
- t.join();
- assertTrue(t.passed);
- context.setCurrentAtomicComponent(null);
- assertNull(context.getCurrentAtomicComponent());
- }
-
- private static final class ChildThread extends Thread {
- private WorkContext context;
- private boolean passed = true;
-
- private ChildThread(WorkContext context) {
- this.context = context;
- }
-
- @Override
- public void run() {
- try {
- assertNull(context.getCorrelationId());
- assertEquals("002", context.getIdentifier("TX"));
- } catch (AssertionError e) {
- passed = false;
- }
- }
-
- }
-
- private static final class TestCurrentAtomicComponentChildThread extends Thread {
- private WorkContext context;
- private boolean passed = true;
-
- private TestCurrentAtomicComponentChildThread(WorkContext context) {
- this.context = context;
- }
-
- @Override
- public void run() {
- try {
- assertNull(context.getCurrentAtomicComponent());
- } catch (AssertionError e) {
- passed = false;
- }
- }
-
- }
-
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/implementation/composite/CompositeComponentImplTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/implementation/composite/CompositeComponentImplTestCase.java
deleted file mode 100644
index a5574c7f78..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/implementation/composite/CompositeComponentImplTestCase.java
+++ /dev/null
@@ -1,79 +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 org.apache.tuscany.core.implementation.composite;
-
-import java.net.URI;
-
-import org.apache.tuscany.spi.component.Component;
-import org.apache.tuscany.spi.component.Reference;
-import org.apache.tuscany.spi.component.Service;
-import org.apache.tuscany.spi.event.Event;
-import org.apache.tuscany.spi.event.RuntimeEventListener;
-import org.apache.tuscany.spi.model.Scope;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-import org.easymock.EasyMock;
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.eq;
-import static org.easymock.EasyMock.expectLastCall;
-import static org.easymock.EasyMock.replay;
-
-/**
- * @version $Rev$ $Date$
- */
-public class CompositeComponentImplTestCase extends TestCase {
-
- public void testGetScope() {
- Component composite = new CompositeComponentImpl(URI.create("parent"));
- Assert.assertEquals(Scope.SYSTEM, composite.getScope());
- }
-
- public void testRegisterService() throws Exception {
- Component composite = new CompositeComponentImpl(URI.create("parent"));
- Service service = new ServiceImpl(URI.create("foo#service"), null);
- composite.register(service);
- assertNotNull(composite.getService("service"));
- }
-
- public void testRegisterReference() throws Exception {
- Component composite = new CompositeComponentImpl(URI.create("parent"));
- Reference reference = new ReferenceImpl(URI.create("foo#reference"), null);
- composite.register(reference);
- assertNotNull(composite.getReference("reference"));
- }
-
- public void testOnEvent() {
- CompositeComponentImpl composite = new CompositeComponentImpl(URI.create("parent"));
- Event event = new Event() {
- public Object getSource() {
- return null;
- }
- };
- RuntimeEventListener listener = createMock(RuntimeEventListener.class);
- listener.onEvent(eq(event));
- expectLastCall();
- replay(listener);
- composite.addListener(listener);
- composite.start();
- composite.onEvent(event);
- EasyMock.verify(listener);
- }
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/implementation/composite/DuplicateRegistrationTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/implementation/composite/DuplicateRegistrationTestCase.java
deleted file mode 100644
index c3394c1043..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/implementation/composite/DuplicateRegistrationTestCase.java
+++ /dev/null
@@ -1,120 +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 org.apache.tuscany.core.implementation.composite;
-
-import java.net.URI;
-
-import org.apache.tuscany.spi.component.DuplicateNameException;
-import org.apache.tuscany.spi.component.Service;
-import org.apache.tuscany.spi.component.Reference;
-import org.apache.tuscany.spi.component.Component;
-
-import junit.framework.TestCase;
-import org.easymock.EasyMock;
-
-/**
- * Verfies children with the same name cannot be registered in the same composite
- *
- * @version $Rev$ $Date$
- */
-public class DuplicateRegistrationTestCase extends TestCase {
-
- public void testDuplicateServiceRegistration() throws Exception {
- Component parent = new CompositeComponentImpl(URI.create("parent"));
- parent.start();
-
- Service service1 = EasyMock.createMock(Service.class);
- EasyMock.expect(service1.getUri()).andReturn(URI.create("#service")).atLeastOnce();
- service1.stop();
- EasyMock.replay(service1);
-
- Service service2 = EasyMock.createMock(Service.class);
- EasyMock.expect(service2.getUri()).andReturn(URI.create("#service")).atLeastOnce();
- service2.stop();
- EasyMock.replay(service2);
-
- parent.register(service2);
- try {
- parent.register(service1);
- fail();
- } catch (DuplicateNameException e) {
- // ok
- }
- parent.stop();
- }
-
- public void testDuplicateReferenceRegistration() throws Exception {
- Component parent = new CompositeComponentImpl(URI.create("parent"));
- parent.start();
-
- Reference reference1 = EasyMock.createMock(Reference.class);
- EasyMock.expect(reference1.getUri()).andReturn(URI.create("#reference")).atLeastOnce();
- reference1.stop();
- EasyMock.replay(reference1);
-
- Reference reference2 = EasyMock.createMock(Reference.class);
- EasyMock.expect(reference2.getUri()).andReturn(URI.create("#reference")).atLeastOnce();
- reference2.stop();
- EasyMock.replay(reference2);
-
- parent.register(reference2);
- try {
- parent.register(reference1);
- fail();
- } catch (DuplicateNameException e) {
- // ok
- }
- parent.stop();
-
- }
-
- public void testDuplicateServiceReferenceRegistration() throws Exception {
- Component parent = new CompositeComponentImpl(URI.create("parent"));
- parent.start();
-
- Service service1 = EasyMock.createMock(Service.class);
- EasyMock.expect(service1.getUri()).andReturn(URI.create("#child")).atLeastOnce();
- service1.stop();
- EasyMock.replay(service1);
-
- Reference service2 = EasyMock.createMock(Reference.class);
- EasyMock.expect(service2.getUri()).andReturn(URI.create("#child")).atLeastOnce();
- service2.stop();
- EasyMock.replay(service2);
-
- parent.register(service2);
- try {
- parent.register(service1);
- fail();
- } catch (DuplicateNameException e) {
- // ok
- }
- parent.stop();
-
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/implementation/composite/ManagedRequestContextTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/implementation/composite/ManagedRequestContextTestCase.java
deleted file mode 100644
index 12299e762b..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/implementation/composite/ManagedRequestContextTestCase.java
+++ /dev/null
@@ -1,42 +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 org.apache.tuscany.core.implementation.composite;
-
-import org.osoa.sca.RequestContext;
-
-import org.apache.tuscany.spi.component.WorkContext;
-
-import junit.framework.TestCase;
-import org.easymock.EasyMock;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ManagedRequestContextTestCase extends TestCase {
-
- public void testGetServiceName() {
- WorkContext workContext = EasyMock.createMock(WorkContext.class);
- EasyMock.expect(workContext.getCurrentServiceName()).andReturn("foo");
- EasyMock.replay(workContext);
- RequestContext context = new ManagedRequestContext(workContext);
- assertEquals("foo", context.getServiceName());
- EasyMock.verify(workContext);
- }
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/implementation/composite/ReferenceImplTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/implementation/composite/ReferenceImplTestCase.java
deleted file mode 100644
index 34d37469a7..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/implementation/composite/ReferenceImplTestCase.java
+++ /dev/null
@@ -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 org.apache.tuscany.core.implementation.composite;
-
-import java.net.URI;
-
-import org.apache.tuscany.spi.component.Reference;
-import org.apache.tuscany.spi.component.ReferenceBinding;
-
-import junit.framework.TestCase;
-import org.easymock.EasyMock;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ReferenceImplTestCase extends TestCase {
-
- public void testStart() {
- ReferenceBinding binding = EasyMock.createMock(ReferenceBinding.class);
- binding.start();
- EasyMock.replay(binding);
- Reference reference = new ReferenceImpl(URI.create("ref"), null);
- reference.addReferenceBinding(binding);
- reference.start();
- EasyMock.verify(binding);
-
- }
-
- public void testStop() {
- ReferenceBinding binding = EasyMock.createMock(ReferenceBinding.class);
- binding.stop();
- EasyMock.replay(binding);
- Reference reference = new ReferenceImpl(URI.create("ref"), null);
- reference.addReferenceBinding(binding);
- reference.stop();
- EasyMock.verify(binding);
-
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/implementation/composite/ServiceImplTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/implementation/composite/ServiceImplTestCase.java
deleted file mode 100644
index bb8ed020e0..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/implementation/composite/ServiceImplTestCase.java
+++ /dev/null
@@ -1,56 +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 org.apache.tuscany.core.implementation.composite;
-
-import java.net.URI;
-
-import org.apache.tuscany.spi.component.Service;
-import org.apache.tuscany.spi.component.ServiceBinding;
-
-import junit.framework.TestCase;
-import org.easymock.EasyMock;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ServiceImplTestCase extends TestCase {
-
- public void testStart() {
- ServiceBinding binding = EasyMock.createMock(ServiceBinding.class);
- binding.start();
- EasyMock.replay(binding);
- Service service = new ServiceImpl(URI.create("foo#bar"), null, null);
- service.addServiceBinding(binding);
- service.start();
- EasyMock.verify(binding);
-
- }
-
- public void testStop() {
- ServiceBinding binding = EasyMock.createMock(ServiceBinding.class);
- binding.stop();
- EasyMock.replay(binding);
- Service service = new ServiceImpl(URI.create("foo#bar"), null, null);
- service.addServiceBinding(binding);
- service.stop();
- EasyMock.verify(binding);
-
- }
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/injection/SingletonObjectFactoryTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/injection/SingletonObjectFactoryTestCase.java
deleted file mode 100644
index 876e68d5b3..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/injection/SingletonObjectFactoryTestCase.java
+++ /dev/null
@@ -1,33 +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 org.apache.tuscany.core.injection;
-
-import junit.framework.TestCase;
-
-/**
- * @version $Rev$ $Date$
- */
-public class SingletonObjectFactoryTestCase extends TestCase {
-
- public void testSingleton() throws Exception {
- Object o = new Object();
- SingletonObjectFactory<Object> factory = new SingletonObjectFactory<Object>(o);
- assertEquals(o, factory.getInstance());
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/AsyncTarget.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/AsyncTarget.java
deleted file mode 100644
index 653d5d7335..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/AsyncTarget.java
+++ /dev/null
@@ -1,31 +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 org.apache.tuscany.core.mock.component;
-
-import org.osoa.sca.annotations.OneWay;
-
-/**
- * @version $Rev$ $Date$
- */
-public interface AsyncTarget {
- @OneWay
- void invoke();
-
- int getCount();
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/BadContextPojo.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/BadContextPojo.java
deleted file mode 100644
index 066acc346d..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/BadContextPojo.java
+++ /dev/null
@@ -1,28 +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 org.apache.tuscany.core.mock.component;
-
-import org.osoa.sca.annotations.Context;
-
-public class BadContextPojo {
-
- @Context
- String context;
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/BadNamePojo.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/BadNamePojo.java
deleted file mode 100644
index 77ec37f9e4..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/BadNamePojo.java
+++ /dev/null
@@ -1,26 +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 org.apache.tuscany.core.mock.component;
-
-import org.osoa.sca.annotations.ComponentName;
-
-public class BadNamePojo {
- @ComponentName
- private int name;
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/BasicInterface.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/BasicInterface.java
deleted file mode 100644
index b7921c248f..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/BasicInterface.java
+++ /dev/null
@@ -1,30 +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 org.apache.tuscany.core.mock.component;
-
-/**
- * @version $Rev$ $Date$
- */
-public interface BasicInterface {
- String returnsProperty();
-
- BasicInterface returnsReference();
-
- int returnsInt();
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/BasicInterfaceImpl.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/BasicInterfaceImpl.java
deleted file mode 100644
index f7d7bb38cf..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/BasicInterfaceImpl.java
+++ /dev/null
@@ -1,66 +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 org.apache.tuscany.core.mock.component;
-
-import org.osoa.sca.annotations.Property;
-import org.osoa.sca.annotations.Reference;
-
-/**
- * @version $Rev$ $Date$
- */
-public class BasicInterfaceImpl implements BasicInterface {
-
- @Property
- public String publicProperty;
-
- @Reference (required = false)
- public BasicInterface publicReference;
-
- @Property
- protected String protectedProperty;
-
- @Reference (required = false)
- protected BasicInterface protectedReference;
-
- private String privateProperty;
-
- private BasicInterface privateReference;
-
- @Property
- public void setPrivateProperty(String privateProperty) {
- this.privateProperty = privateProperty;
- }
-
- @Reference (required = false)
- public void setPrivateReference(BasicInterface privateReference) {
- this.privateReference = privateReference;
- }
-
- public String returnsProperty() {
- return privateProperty;
- }
-
- public BasicInterface returnsReference() {
- return privateReference;
- }
-
- public int returnsInt() {
- return 0;
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/CompositeScopeComponent.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/CompositeScopeComponent.java
deleted file mode 100644
index 88b97216cd..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/CompositeScopeComponent.java
+++ /dev/null
@@ -1,31 +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 org.apache.tuscany.core.mock.component;
-
-import org.osoa.sca.annotations.Scope;
-
-/**
- * @version $Rev$ $Date$
- */
-@Scope("COMPOSITE")
-public interface CompositeScopeComponent {
-
- //public boolean isInit();
-}
-
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/CompositeScopeComponentImpl.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/CompositeScopeComponentImpl.java
deleted file mode 100644
index 93ee1f707a..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/CompositeScopeComponentImpl.java
+++ /dev/null
@@ -1,40 +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 org.apache.tuscany.core.mock.component;
-
-import org.osoa.sca.annotations.Scope;
-
-
-/**
- * @version $Rev$ $Date$
- */
-@Scope("COMPOSITE")
-public class CompositeScopeComponentImpl implements
- CompositeScopeComponent {
-
- private String foo;
-
- public void setFoo(String foo) {
- this.foo = foo;
- }
-
- public String getFoo() {
- return foo;
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/CompositeScopeDestroyOnlyComponent.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/CompositeScopeDestroyOnlyComponent.java
deleted file mode 100644
index 16ce3b5569..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/CompositeScopeDestroyOnlyComponent.java
+++ /dev/null
@@ -1,36 +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 org.apache.tuscany.core.mock.component;
-
-import org.osoa.sca.annotations.Destroy;
-
-public class CompositeScopeDestroyOnlyComponent extends CompositeScopeComponentImpl {
-
- boolean destroyed;
-
- public boolean isDestroyed() {
- return destroyed;
- }
-
- @Destroy
- public void destroy() {
- destroyed = true;
- }
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/CompositeScopeInitDestroyComponent.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/CompositeScopeInitDestroyComponent.java
deleted file mode 100644
index 05b938a87c..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/CompositeScopeInitDestroyComponent.java
+++ /dev/null
@@ -1,39 +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 org.apache.tuscany.core.mock.component;
-
-import org.osoa.sca.annotations.Destroy;
-
-public class CompositeScopeInitDestroyComponent extends CompositeScopeInitOnlyComponent {
-
- boolean destroyed;
-
- public boolean isDestroyed() {
- return destroyed;
- }
-
- @Destroy
- public void destroy() {
- if (destroyed) {
- throw new AssertionError("Destroy called more than once");
- }
- destroyed = true;
- }
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/CompositeScopeInitOnlyComponent.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/CompositeScopeInitOnlyComponent.java
deleted file mode 100644
index f9f80ca15c..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/CompositeScopeInitOnlyComponent.java
+++ /dev/null
@@ -1,42 +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 org.apache.tuscany.core.mock.component;
-
-import org.osoa.sca.annotations.Init;
-
-public class CompositeScopeInitOnlyComponent extends CompositeScopeComponentImpl {
-
- private boolean initialized;
- // this value tests to ensure introspection can find the init() method even
- // if a field is named the same. Ultimately, this should be in the introspection tests
- private boolean init;
-
- public boolean isInitialized() {
- return initialized;
- }
-
- @Init
- public void init() {
- if (initialized) {
- throw new AssertionError("Init called more than once");
- }
- initialized = true;
- }
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeComponent.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeComponent.java
deleted file mode 100644
index c71ac0586f..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeComponent.java
+++ /dev/null
@@ -1,29 +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 org.apache.tuscany.core.mock.component;
-
-import org.osoa.sca.annotations.Scope;
-
-/**
- * @version $Rev: 430937 $ $Date: 2006-08-11 21:17:56 -0400 (Fri, 11 Aug 2006) $
- */
-@Scope("CONVERSATION")
-public interface ConversationalScopeComponent {
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeComponentImpl.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeComponentImpl.java
deleted file mode 100644
index 5ea7278e1f..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeComponentImpl.java
+++ /dev/null
@@ -1,29 +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 org.apache.tuscany.core.mock.component;
-
-import org.osoa.sca.annotations.Scope;
-
-/**
- * @version $Rev: 430937 $ $Date: 2006-08-11 21:17:56 -0400 (Fri, 11 Aug 2006) $
- */
-@Scope("CONVERSATION")
-public class ConversationalScopeComponentImpl implements ConversationalScopeComponent {
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeDestroyOnlyComponent.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeDestroyOnlyComponent.java
deleted file mode 100644
index 8cea9efa49..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeDestroyOnlyComponent.java
+++ /dev/null
@@ -1,37 +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 org.apache.tuscany.core.mock.component;
-
-import org.osoa.sca.annotations.Destroy;
-import org.osoa.sca.annotations.Scope;
-
-@Scope("CONVERSATION")
-public class ConversationalScopeDestroyOnlyComponent extends ConversationalScopeComponentImpl {
-
- boolean destroyed;
-
- public boolean isDestroyed() {
- return destroyed;
- }
-
- @Destroy
- public void destroy() {
- destroyed = true;
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeInitDestroyComponent.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeInitDestroyComponent.java
deleted file mode 100644
index 40dbfedf2c..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeInitDestroyComponent.java
+++ /dev/null
@@ -1,38 +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 org.apache.tuscany.core.mock.component;
-
-import org.osoa.sca.annotations.Destroy;
-import org.osoa.sca.annotations.Scope;
-
-@Scope("CONVERSATION")
-public class ConversationalScopeInitDestroyComponent
- extends ConversationalScopeInitOnlyComponent {
-
- private boolean destroyed;
-
- public boolean isDestroyed() {
- return destroyed;
- }
-
- @Destroy
- public void destroy() {
- destroyed = true;
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeInitOnlyComponent.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeInitOnlyComponent.java
deleted file mode 100644
index caaa0c39e7..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeInitOnlyComponent.java
+++ /dev/null
@@ -1,38 +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 org.apache.tuscany.core.mock.component;
-
-import org.osoa.sca.annotations.Init;
-import org.osoa.sca.annotations.Scope;
-
-@Scope("CONVERSATION")
-public class ConversationalScopeInitOnlyComponent
- extends ConversationalScopeComponentImpl {
-
- private boolean initialized;
-
- public boolean isInitialized() {
- return initialized;
- }
-
- @Init
- public void init() {
- initialized = true;
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OrderException.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OrderException.java
deleted file mode 100644
index af257c226d..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OrderException.java
+++ /dev/null
@@ -1,40 +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 org.apache.tuscany.core.mock.component;
-
-public class OrderException extends Exception {
-
- public OrderException() {
- super();
- }
-
- public OrderException(String message) {
- super(message);
- }
-
- public OrderException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public OrderException(Throwable cause) {
- super(cause);
- }
-
-}
-
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OrderedDependentPojo.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OrderedDependentPojo.java
deleted file mode 100644
index 2033f0eca5..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OrderedDependentPojo.java
+++ /dev/null
@@ -1,29 +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 org.apache.tuscany.core.mock.component;
-
-/**
- * @version $$Rev$$ $$Date$$
- */
-public interface OrderedDependentPojo extends OrderedInitPojo {
-
- OrderedInitPojo getPojo();
-
- void setPojo(OrderedInitPojo pojo);
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OrderedDependentPojoImpl.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OrderedDependentPojoImpl.java
deleted file mode 100644
index 439c3d143c..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OrderedDependentPojoImpl.java
+++ /dev/null
@@ -1,36 +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 org.apache.tuscany.core.mock.component;
-
-/**
- * @version $$Rev$$ $$Date$$
- */
-public class OrderedDependentPojoImpl extends OrderedInitPojoImpl implements OrderedDependentPojo {
-
- private OrderedInitPojo pojo;
-
- public OrderedInitPojo getPojo() {
- return pojo;
- }
-
- public void setPojo(OrderedInitPojo pojo) {
- this.pojo = pojo;
- }
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OrderedEagerInitPojo.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OrderedEagerInitPojo.java
deleted file mode 100644
index 1986952747..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OrderedEagerInitPojo.java
+++ /dev/null
@@ -1,60 +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 org.apache.tuscany.core.mock.component;
-
-import org.osoa.sca.annotations.Destroy;
-import org.osoa.sca.annotations.Init;
-import org.osoa.sca.annotations.Scope;
-import org.osoa.sca.annotations.EagerInit;
-
-@Scope("COMPOSITE")
-@EagerInit
-public class OrderedEagerInitPojo {
-
- private static final Object LOCK = new Object();
- private static int numberInstantied;
- private int initOrder;
-
- @Init
- public void init() {
- synchronized (LOCK) {
- ++numberInstantied;
- initOrder = numberInstantied;
- }
- }
-
- @Destroy
- public void destroy() throws OrderException {
- synchronized (LOCK) {
- if (initOrder != numberInstantied) {
- throw new OrderException("Instance shutdown done out of order");
- }
- --numberInstantied;
- }
- }
-
- public int getNumberInstantiated() {
- return numberInstantied;
- }
-
- public int getInitOrder() {
- return initOrder;
- }
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OrderedInitPojo.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OrderedInitPojo.java
deleted file mode 100644
index 0b891cfa42..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OrderedInitPojo.java
+++ /dev/null
@@ -1,28 +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 org.apache.tuscany.core.mock.component;
-
-/**
- * @version $$Rev$$ $$Date$$
- */
-public interface OrderedInitPojo {
- int getNumberInstantiated();
-
- int getInitOrder();
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OrderedInitPojoImpl.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OrderedInitPojoImpl.java
deleted file mode 100644
index a7063f6353..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OrderedInitPojoImpl.java
+++ /dev/null
@@ -1,61 +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 org.apache.tuscany.core.mock.component;
-
-import org.osoa.sca.annotations.Destroy;
-import org.osoa.sca.annotations.Init;
-import org.osoa.sca.annotations.Scope;
-
-@Scope("COMPOSITE")
-public class OrderedInitPojoImpl implements OrderedInitPojo {
-
- private static final Object LOCK = new Object();
- private static int numberInstantied;
- private int initOrder;
-
- public OrderedInitPojoImpl() {
- }
-
- @Init
- public void init() {
- synchronized (LOCK) {
- ++numberInstantied;
- initOrder = numberInstantied;
- }
- }
-
- @Destroy
- public void destroy() throws OrderException {
- synchronized (LOCK) {
- if (initOrder != numberInstantied) {
- throw new OrderException("Instance shutdown done out of order");
- }
- --numberInstantied;
- }
- }
-
- public int getNumberInstantiated() {
- return numberInstantied;
- }
-
- public int getInitOrder() {
- return initOrder;
- }
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OtherTarget.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OtherTarget.java
deleted file mode 100644
index 0b897daa40..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OtherTarget.java
+++ /dev/null
@@ -1,31 +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 org.apache.tuscany.core.mock.component;
-
-/**
- * Implementations are used in wiring tests
- *
- * @version $Rev$ $Date$
- */
-public interface OtherTarget {
-
- String getString();
-
- void setString(String val);
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OtherTargetImpl.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OtherTargetImpl.java
deleted file mode 100644
index a3b2bbf098..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/OtherTargetImpl.java
+++ /dev/null
@@ -1,39 +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 org.apache.tuscany.core.mock.component;
-
-/**
- * A target used for testing wires with a different source and target interface
- *
- * @version $Rev$ $Date$
- */
-public class OtherTargetImpl implements OtherTarget {
-
- private String theString;
-
- public String getString() {
- return theString;
- }
-
- public void setString(String val) {
- theString = val;
- }
-
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/RequestScopeComponent.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/RequestScopeComponent.java
deleted file mode 100644
index 8c7dc107ee..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/RequestScopeComponent.java
+++ /dev/null
@@ -1,30 +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 org.apache.tuscany.core.mock.component;
-
-import org.osoa.sca.annotations.Scope;
-
-/**
- * @version $Rev$ $Date$
- */
-@Scope("REQUEST")
-public interface RequestScopeComponent {
-
-}
-
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/RequestScopeDestroyOnlyComponent.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/RequestScopeDestroyOnlyComponent.java
deleted file mode 100644
index 5224ceda5f..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/RequestScopeDestroyOnlyComponent.java
+++ /dev/null
@@ -1,38 +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 org.apache.tuscany.core.mock.component;
-
-import org.osoa.sca.annotations.Destroy;
-import org.osoa.sca.annotations.Scope;
-
-@Scope("REQUEST")
-public class RequestScopeDestroyOnlyComponent extends SessionScopeComponentImpl {
-
- boolean destroyed;
-
- public boolean isDestroyed() {
- return destroyed;
- }
-
- @Destroy
- public void destroy() {
- destroyed = true;
- }
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/RequestScopeInitDestroyComponent.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/RequestScopeInitDestroyComponent.java
deleted file mode 100644
index 38b188a4b5..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/RequestScopeInitDestroyComponent.java
+++ /dev/null
@@ -1,38 +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 org.apache.tuscany.core.mock.component;
-
-import org.osoa.sca.annotations.Destroy;
-import org.osoa.sca.annotations.Scope;
-
-@Scope("REQUEST")
-public class RequestScopeInitDestroyComponent extends SessionScopeInitOnlyComponent {
-
- boolean destroyed;
-
- public boolean isDestroyed() {
- return destroyed;
- }
-
- @Destroy
- public void destroy() {
- destroyed = true;
- }
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/RequestScopeInitOnlyComponent.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/RequestScopeInitOnlyComponent.java
deleted file mode 100644
index 707f8ab50f..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/RequestScopeInitOnlyComponent.java
+++ /dev/null
@@ -1,39 +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 org.apache.tuscany.core.mock.component;
-
-import org.osoa.sca.annotations.Init;
-import org.osoa.sca.annotations.Scope;
-
-@Scope("REQUEST")
-public class RequestScopeInitOnlyComponent extends SessionScopeComponentImpl {
-
- private boolean initialized;
-
- public boolean isInitialized() {
- return initialized;
- }
-
- @Init
- public void init() {
- initialized = true;
- }
-
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/SessionScopeComponent.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/SessionScopeComponent.java
deleted file mode 100644
index 827ba804f2..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/SessionScopeComponent.java
+++ /dev/null
@@ -1,30 +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 org.apache.tuscany.core.mock.component;
-
-import org.osoa.sca.annotations.Scope;
-
-/**
- * @version $Rev$ $Date$
- */
-@Scope("SESSION")
-public interface SessionScopeComponent {
-
-}
-
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/SessionScopeComponentImpl.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/SessionScopeComponentImpl.java
deleted file mode 100644
index e547bf6113..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/SessionScopeComponentImpl.java
+++ /dev/null
@@ -1,30 +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 org.apache.tuscany.core.mock.component;
-
-import org.osoa.sca.annotations.Scope;
-
-/**
- * @version $Rev$ $Date$
- */
-@Scope("SESSION")
-public class SessionScopeComponentImpl implements
- SessionScopeComponent {
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/SessionScopeInitDestroyComponent.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/SessionScopeInitDestroyComponent.java
deleted file mode 100644
index c11bd1bd49..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/SessionScopeInitDestroyComponent.java
+++ /dev/null
@@ -1,36 +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 org.apache.tuscany.core.mock.component;
-
-import org.osoa.sca.annotations.Destroy;
-
-public class SessionScopeInitDestroyComponent extends SessionScopeInitOnlyComponent {
-
- private boolean destroyed;
-
- public boolean isDestroyed() {
- return destroyed;
- }
-
- @Destroy
- public void destroy() {
- destroyed = true;
- }
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/SessionScopeInitOnlyComponent.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/SessionScopeInitOnlyComponent.java
deleted file mode 100644
index 095cc916ec..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/SessionScopeInitOnlyComponent.java
+++ /dev/null
@@ -1,37 +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 org.apache.tuscany.core.mock.component;
-
-import org.osoa.sca.annotations.Init;
-
-public class SessionScopeInitOnlyComponent extends SessionScopeComponentImpl {
-
- private boolean initialized;
-
- public boolean isInitialized() {
- return initialized;
- }
-
- @Init
- public void init() {
- initialized = true;
- }
-
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/SimpleTarget.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/SimpleTarget.java
deleted file mode 100644
index c78ba00a7a..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/SimpleTarget.java
+++ /dev/null
@@ -1,30 +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 org.apache.tuscany.core.mock.component;
-
-public interface SimpleTarget {
-
- String hello(String message) throws Exception;
-
- String goodbye(String message) throws Exception;
-
- String echo(String message) throws Exception;
-
-}
-
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/SimpleTargetImpl.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/SimpleTargetImpl.java
deleted file mode 100644
index 634a07a401..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/SimpleTargetImpl.java
+++ /dev/null
@@ -1,41 +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 org.apache.tuscany.core.mock.component;
-
-public class SimpleTargetImpl implements SimpleTarget {
-
- public SimpleTargetImpl() {
- super();
- }
-
- public String hello(String message) throws Exception {
- return message;
- }
-
- public String goodbye(String message) throws Exception {
- return message;
- }
-
- public String echo(String message) throws Exception {
- return message;
- }
-
-
-}
-
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/Source.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/Source.java
deleted file mode 100644
index f7969f748b..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/Source.java
+++ /dev/null
@@ -1,37 +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 org.apache.tuscany.core.mock.component;
-
-import java.util.List;
-
-/**
- * Implementations are used in wiring tests
- *
- * @version $Rev$ $Date$
- */
-public interface Source {
-
- Target getTarget();
-
- List<Target> getTargets();
-
- List<Target> getTargetsThroughField();
-
-}
-
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/SourceImpl.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/SourceImpl.java
deleted file mode 100644
index 187e33b2bd..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/SourceImpl.java
+++ /dev/null
@@ -1,63 +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 org.apache.tuscany.core.mock.component;
-
-import java.util.List;
-
-/**
- * Mock system component implementation used in wiring tests
- *
- * @version $Rev$ $Date$
- */
-public class SourceImpl implements Source {
-
- private Target target;
- private List<Target> targets;
- private List<Target> targetsThroughField;
- private Target[] targetsArray;
-
- public void setTarget(Target target) {
- this.target = target;
- }
-
- public Target getTarget() {
- return target;
- }
-
- public List<Target> getTargets() {
- return targets;
- }
-
- public void setTargets(List<Target> targets) {
- this.targets = targets;
- }
-
- public List<Target> getTargetsThroughField() {
- return targetsThroughField;
- }
-
- public Target[] getArrayOfTargets() {
- return targetsArray;
- }
-
- public void setArrayOfTargets(Target[] targets) {
- targetsArray = targets;
- }
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/StatelessComponent.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/StatelessComponent.java
deleted file mode 100644
index c16ac942a3..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/StatelessComponent.java
+++ /dev/null
@@ -1,30 +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 org.apache.tuscany.core.mock.component;
-
-import org.osoa.sca.annotations.Scope;
-
-/**
- * @version $Rev$ $Date$
- */
-@Scope("STATELESS")
-public interface StatelessComponent {
-
-}
-
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/StatelessComponentImpl.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/StatelessComponentImpl.java
deleted file mode 100644
index 64a23c12c8..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/StatelessComponentImpl.java
+++ /dev/null
@@ -1,27 +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 org.apache.tuscany.core.mock.component;
-
-/**
- * @version $Rev$ $Date$
- */
-public class StatelessComponentImpl implements
- StatelessComponent {
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/Target.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/Target.java
deleted file mode 100644
index 778c14665d..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/Target.java
+++ /dev/null
@@ -1,32 +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 org.apache.tuscany.core.mock.component;
-
-/**
- * Implementations are used in wiring tests
- *
- * @version $Rev$ $Date$
- */
-public interface Target {
-
- String getString();
-
- void setString(String val);
-}
-
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/TargetImpl.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/TargetImpl.java
deleted file mode 100644
index 037dd3a37c..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/component/TargetImpl.java
+++ /dev/null
@@ -1,38 +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 org.apache.tuscany.core.mock.component;
-
-/**
- * Mock system component implementation used in wiring tests
- *
- * @version $Rev$ $Date$
- */
-public class TargetImpl implements Target {
-
- private String theString;
-
- public String getString() {
- return theString;
- }
-
- public void setString(String val) {
- theString = val;
- }
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/wire/MockStaticInvoker.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/wire/MockStaticInvoker.java
deleted file mode 100644
index 98f5973f62..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/wire/MockStaticInvoker.java
+++ /dev/null
@@ -1,98 +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 org.apache.tuscany.core.mock.wire;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.spi.wire.Interceptor;
-import org.apache.tuscany.spi.wire.InvocationRuntimeException;
-import org.apache.tuscany.spi.wire.Message;
-import org.apache.tuscany.spi.wire.TargetInvoker;
-import org.apache.tuscany.spi.component.WorkContext;
-
-/**
- * Caches component instances that do not need to be resolved for every wire, e.g. an wire originating from a lesser
- * scope intended for a target with a wider scope
- *
- * @version $Rev$ $Date$
- */
-public class MockStaticInvoker implements TargetInvoker {
-
- private Object instance;
- private Method operation;
- private boolean cacheable;
-
-
- public MockStaticInvoker(Method operation, Object instance) {
- this.operation = operation;
- this.instance = instance;
- }
-
- public boolean isCacheable() {
- return cacheable;
- }
-
- public void setCacheable(boolean cacheable) {
- this.cacheable = cacheable;
- }
-
- public boolean isOptimizable() {
- return isCacheable();
- }
-
- public Object invokeTarget(final Object payload, final short sequence, WorkContext workContext) throws InvocationTargetException {
- try {
- if (payload != null && !payload.getClass().isArray()) {
- return operation.invoke(instance, payload);
- } else {
- return operation.invoke(instance, (Object[]) payload);
- }
- } catch (IllegalAccessException e) {
- throw new InvocationRuntimeException(e);
- }
- }
-
- public Message invoke(Message msg) throws InvocationRuntimeException {
- try {
- Object resp = invokeTarget(msg.getBody(), TargetInvoker.NONE, null);
- msg.setBody(resp);
- } catch (InvocationTargetException e) {
- msg.setBodyWithFault(e.getCause());
- } catch (Throwable e) {
- msg.setBodyWithFault(e);
- }
- return msg;
- }
-
- public void setNext(Interceptor next) {
- throw new IllegalStateException("This interceptor must be the last interceptor in an interceptor chain");
- }
-
- public Object clone() throws CloneNotSupportedException {
- try {
- MockStaticInvoker invoker = (MockStaticInvoker) super.clone();
- invoker.instance = this.instance;
- invoker.operation = this.operation;
- return invoker;
- } catch (CloneNotSupportedException e) {
- return null; // will not happen
- }
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/wire/MockSyncInterceptor.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/wire/MockSyncInterceptor.java
deleted file mode 100644
index 1fe2c027ab..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/wire/MockSyncInterceptor.java
+++ /dev/null
@@ -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 org.apache.tuscany.core.mock.wire;
-
-import org.apache.tuscany.spi.wire.Interceptor;
-import org.apache.tuscany.spi.wire.Message;
-
-public class MockSyncInterceptor implements Interceptor {
-
- private int count;
-
- private Interceptor next;
-
- public MockSyncInterceptor() {
- }
-
- public Message invoke(Message msg) {
- ++count;
- return next.invoke(msg);
- }
-
- public int getCount() {
- return count;
- }
-
- public void setNext(Interceptor next) {
- this.next = next;
- }
-
- public Interceptor getNext() {
- return next;
- }
-
- public boolean isOptimizable() {
- return false;
- }
-
-}
-
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/wire/MockTargetInvoker.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/wire/MockTargetInvoker.java
deleted file mode 100644
index 3fcc75bdb4..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/mock/wire/MockTargetInvoker.java
+++ /dev/null
@@ -1,33 +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 org.apache.tuscany.core.mock.wire;
-
-import org.apache.tuscany.spi.wire.InvocationRuntimeException;
-import org.apache.tuscany.spi.wire.Message;
-
-import org.apache.tuscany.core.binding.local.AbstractLocalTargetInvoker;
-
-/**
- * @version $Rev$ $Date$
- */
-public class MockTargetInvoker extends AbstractLocalTargetInvoker {
- public Message invoke(Message msg) throws InvocationRuntimeException {
- return null;
- }
-} \ No newline at end of file
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/monitor/DefaultExceptionFormatterTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/monitor/DefaultExceptionFormatterTestCase.java
deleted file mode 100644
index 437e718206..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/monitor/DefaultExceptionFormatterTestCase.java
+++ /dev/null
@@ -1,59 +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 org.apache.tuscany.core.monitor;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-
-import junit.framework.TestCase;
-import org.apache.tuscany.api.TuscanyException;
-import org.apache.tuscany.api.TuscanyRuntimeException;
-
-/**
- * @version $Rev$ $Date$
- */
-public class DefaultExceptionFormatterTestCase extends TestCase {
- private DefaultExceptionFormatter formatter = new DefaultExceptionFormatter();
-
- public void testTuscanyExceptionFormat() throws Exception {
- StringWriter writer = new StringWriter();
- PrintWriter pw = new PrintWriter(writer);
- TuscanyException e = new TuscanyException("somemessage") {
- };
- formatter.write(pw, e);
- assertTrue(writer.toString().indexOf("somemessage") >= 0);
- }
-
- public void testTuscanyRuntimeExceptionFormat() throws Exception {
- StringWriter writer = new StringWriter();
- PrintWriter pw = new PrintWriter(writer);
- TuscanyRuntimeException e = new TuscanyRuntimeException("somemessage") {
- };
- formatter.write(pw, e);
- assertTrue(writer.toString().indexOf("somemessage") >= 0);
- }
-
- public void testNormalExceptionFormat() throws Exception {
- StringWriter writer = new StringWriter();
- PrintWriter pw = new PrintWriter(writer);
- Exception e = new Exception();
- formatter.write(pw, e); // just verify there are no errors since no formatting needs to be doen
- }
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/monitor/JavaLoggingTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/monitor/JavaLoggingTestCase.java
deleted file mode 100644
index 5fdf035c7a..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/monitor/JavaLoggingTestCase.java
+++ /dev/null
@@ -1,153 +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 org.apache.tuscany.core.monitor;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-import java.util.logging.Handler;
-import java.util.logging.Level;
-import java.util.logging.LogRecord;
-import java.util.logging.Logger;
-
-import org.apache.tuscany.api.annotation.LogLevel;
-import org.apache.tuscany.host.MonitorFactory;
-
-import junit.framework.TestCase;
-
-/**
- * Test case for the JavaLoggingMonitorFactory.
- *
- * @version $Rev$ $Date$
- */
-public class JavaLoggingTestCase extends TestCase {
- private static final Logger LOGGER = Logger.getLogger(Monitor.class.getName());
- private static final MockHandler HANDLER = new MockHandler();
-
- private MonitorFactory factory;
-
- /**
- * Smoke test to ensure the LOGGER is working.
- */
- public void testLogger() {
- LOGGER.info("test");
- assertEquals(1, HANDLER.logs.size());
- }
-
- /**
- * Test that no record is logged.
- */
- public void testUnloggedEvent() {
- Monitor mon = factory.getMonitor(Monitor.class);
- mon.eventNotToLog();
- assertEquals(0, HANDLER.logs.size());
- }
-
- /**
- * Test the correct record is written for an event with no arguments.
- */
- public void testEventWithNoArgs() {
- Monitor mon = factory.getMonitor(Monitor.class);
- mon.eventWithNoArgs();
- assertEquals(1, HANDLER.logs.size());
- LogRecord record = HANDLER.logs.get(0);
- assertEquals(Level.INFO, record.getLevel());
- assertEquals(LOGGER.getName(), record.getLoggerName());
- assertEquals(Monitor.class.getName() + "#eventWithNoArgs", record.getMessage());
- }
-
- /**
- * Test the correct record is written for an event defined by annotation.
- */
- public void testEventWithAnnotation() {
- Monitor mon = factory.getMonitor(Monitor.class);
- mon.eventWithAnnotation();
- assertEquals(1, HANDLER.logs.size());
- LogRecord record = HANDLER.logs.get(0);
- assertEquals(Level.INFO, record.getLevel());
- assertEquals(LOGGER.getName(), record.getLoggerName());
- assertEquals(Monitor.class.getName() + "#eventWithAnnotation", record.getMessage());
- }
-
- /**
- * Test the argument is logged.
- */
- public void testEventWithOneArg() {
- Monitor mon = factory.getMonitor(Monitor.class);
- mon.eventWithOneArg("ARG");
- assertEquals(1, HANDLER.logs.size());
- LogRecord record = HANDLER.logs.get(0);
- assertEquals(Monitor.class.getName() + "#eventWithOneArg", record.getMessage());
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- LOGGER.setUseParentHandlers(false);
- LOGGER.addHandler(HANDLER);
- HANDLER.flush();
-
- String sourceClass = Monitor.class.getName();
- Properties levels = new Properties();
- levels.setProperty(sourceClass + "#eventWithNoArgs", "INFO");
- levels.setProperty(sourceClass + "#eventWithOneArg", "INFO");
- levels.setProperty(sourceClass + "#eventWithThrowable", "WARNING");
- factory = new JavaLoggingMonitorFactory(levels, Level.FINE, "TestMessages");
- }
-
- protected void tearDown() throws Exception {
- LOGGER.removeHandler(HANDLER);
- HANDLER.flush();
- super.tearDown();
- }
-
- /**
- * Mock log HANDLER to capture records.
- */
- public static class MockHandler extends Handler {
- List<LogRecord> logs = new ArrayList<LogRecord>();
-
- public void publish(LogRecord record) {
- logs.add(record);
- }
-
- public void flush() {
- logs.clear();
- }
-
- public void close() throws SecurityException {
- }
- }
-
- @SuppressWarnings({"JavaDoc"})
- public static interface Monitor {
- void eventNotToLog();
-
- @LogLevel("INFO")
- void eventWithNoArgs();
-
- @LogLevel("INFO")
- void eventWithOneArg(String msg);
-
- @LogLevel("WARNING")
- void eventWithThrowable(Exception e);
-
- @LogLevel("INFO")
- void eventWithAnnotation();
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/resolver/DefaultAutowireResolverTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/resolver/DefaultAutowireResolverTestCase.java
deleted file mode 100644
index 6d50489f18..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/resolver/DefaultAutowireResolverTestCase.java
+++ /dev/null
@@ -1,177 +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 org.apache.tuscany.core.resolver;
-
-import java.net.URI;
-
-import org.apache.tuscany.spi.model.AtomicImplementation;
-import org.apache.tuscany.spi.model.ComponentDefinition;
-import org.apache.tuscany.spi.model.ComponentType;
-import org.apache.tuscany.spi.model.CompositeComponentType;
-import org.apache.tuscany.spi.model.CompositeImplementation;
-import org.apache.tuscany.spi.model.Property;
-import org.apache.tuscany.spi.model.ReferenceDefinition;
-import org.apache.tuscany.spi.model.ReferenceTarget;
-import org.apache.tuscany.spi.model.ServiceContract;
-import org.apache.tuscany.spi.model.ServiceDefinition;
-
-import junit.framework.TestCase;
-
-/**
- * @version $Rev$ $Date$
- */
-public class DefaultAutowireResolverTestCase extends TestCase {
- private static final URI REFERENCE_URI = URI.create("source#ref");
- private static final URI TARGET_URI = URI.create("target#service");
- private DefaultAutowireResolver resolver;
-
- public void testAutowireAtomicToAtomic() throws Exception {
- ComponentDefinition<CompositeImplementation> composite = createComposite("composite");
- CompositeComponentType<?, ?, ?> type = composite.getImplementation().getComponentType();
- ComponentDefinition<MockAtomicImpl> source = createSourceAtomic(Foo.class);
- type.add(source);
- ComponentDefinition<MockAtomicImpl> target = createTargetAtomic(Foo.class);
- type.add(target);
- resolver.resolve(null, composite);
- ReferenceTarget refTarget = source.getReferenceTargets().get(REFERENCE_URI.getFragment());
- assertEquals(TARGET_URI, refTarget.getTargets().get(0));
- }
-
- public void testAutowireAtomicToAtomicRequiresSuperInterface() throws Exception {
- ComponentDefinition<CompositeImplementation> composite = createComposite("composite");
- CompositeComponentType<?, ?, ?> type = composite.getImplementation().getComponentType();
- ComponentDefinition<MockAtomicImpl> source = createSourceAtomic(SuperFoo.class);
- type.add(source);
- ComponentDefinition<MockAtomicImpl> target = createTargetAtomic(Foo.class);
- type.add(target);
- resolver.resolve(null, composite);
- ReferenceTarget refTarget = source.getReferenceTargets().get(REFERENCE_URI.getFragment());
- assertEquals(TARGET_URI, refTarget.getTargets().get(0));
- }
-
- public void testAutowireAtomicToAtomicRequiresSubInterface() throws Exception {
- ComponentDefinition<CompositeImplementation> composite = createComposite("composite");
- CompositeComponentType<?, ?, ?> type = composite.getImplementation().getComponentType();
- ComponentDefinition<MockAtomicImpl> source = createSourceAtomic(Foo.class);
- type.add(source);
- ComponentDefinition<MockAtomicImpl> target = createTargetAtomic(SuperFoo.class);
- type.add(target);
- try {
- resolver.resolve(null, composite);
- fail();
- } catch (AutowireTargetNotFoundException e) {
- // expected
- }
- }
-
- public void testAutowireAtomicToAtomicIncompatibleInterfaces() throws Exception {
- ComponentDefinition<CompositeImplementation> composite = createComposite("composite");
- CompositeComponentType<?, ?, ?> type = composite.getImplementation().getComponentType();
- ComponentDefinition<MockAtomicImpl> source = createSourceAtomic(Foo.class);
- type.add(source);
- ComponentDefinition<MockAtomicImpl> target = createTargetAtomic(String.class);
- type.add(target);
- try {
- resolver.resolve(null, composite);
- fail();
- } catch (AutowireTargetNotFoundException e) {
- // expected
- }
- }
-
- public void testNestedAutowireAtomicToAtomic() throws Exception {
- ComponentDefinition<CompositeImplementation> composite = createComposite("composite");
- CompositeComponentType<?, ?, ?> type = composite.getImplementation().getComponentType();
- ComponentDefinition<MockAtomicImpl> source = createSourceAtomic(Foo.class);
- type.add(source);
- ComponentDefinition<MockAtomicImpl> target = createTargetAtomic(Foo.class);
- type.add(target);
- ComponentDefinition<CompositeImplementation> parent = createComposite("parent");
- parent.getImplementation().getComponentType().add(composite);
- resolver.resolve(null, parent);
- ReferenceTarget refTarget = source.getReferenceTargets().get(REFERENCE_URI.getFragment());
- assertEquals(TARGET_URI, refTarget.getTargets().get(0));
- }
-
-
- protected void setUp() throws Exception {
- super.setUp();
- resolver = new DefaultAutowireResolver();
- }
-
- private ComponentDefinition<CompositeImplementation> createComposite(String uri) {
- URI parentUri = URI.create(uri);
- CompositeComponentType<ServiceDefinition, ReferenceDefinition, Property<?>> type =
- new CompositeComponentType<ServiceDefinition, ReferenceDefinition, Property<?>>();
- CompositeImplementation impl = new CompositeImplementation();
- impl.setComponentType(type);
- return new ComponentDefinition<CompositeImplementation>(parentUri, impl);
- }
-
- private ComponentDefinition<MockAtomicImpl> createSourceAtomic(Class<?> requiredInterface) {
- URI uri = URI.create("source");
- ServiceContract contract = new ServiceContract() {
- };
- contract.setInterfaceClass(requiredInterface);
- ReferenceDefinition reference = new ReferenceDefinition(URI.create("#ref"), contract);
- reference.setRequired(true);
- MockComponentType type = new MockComponentType();
- type.add(reference);
- MockAtomicImpl impl = new MockAtomicImpl();
- impl.setComponentType(type);
- ComponentDefinition<MockAtomicImpl> definition = new ComponentDefinition<MockAtomicImpl>(uri, impl);
- ReferenceTarget target = new ReferenceTarget();
- target.setReferenceName(REFERENCE_URI);
- target.setAutowire(true);
- definition.add(target);
- return definition;
- }
-
- private ComponentDefinition<MockAtomicImpl> createTargetAtomic(Class<?> serviceInterface) {
- URI uri = URI.create("target");
- ServiceDefinition service = new ServiceDefinition();
- service.setUri(URI.create("#service"));
- ServiceContract contract = new ServiceContract() {
- };
- contract.setInterfaceClass(serviceInterface);
- service.setServiceContract(contract);
- MockComponentType type = new MockComponentType();
- type.add(service);
- MockAtomicImpl impl = new MockAtomicImpl();
- impl.setComponentType(type);
- return new ComponentDefinition<MockAtomicImpl>(uri, impl);
- }
-
- private class MockAtomicImpl extends AtomicImplementation<MockComponentType> {
-
- }
-
- private class MockComponentType extends ComponentType<ServiceDefinition, ReferenceDefinition, Property<?>> {
-
- }
-
- private interface SuperFoo {
-
- }
-
- private interface Foo extends SuperFoo {
-
- }
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/services/store/memory/MemoryStoreTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/services/store/memory/MemoryStoreTestCase.java
deleted file mode 100644
index 06ea7cf903..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/services/store/memory/MemoryStoreTestCase.java
+++ /dev/null
@@ -1,166 +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 org.apache.tuscany.core.services.store.memory;
-
-import java.net.URI;
-import java.util.UUID;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.tuscany.spi.component.AtomicComponent;
-import org.apache.tuscany.spi.event.RuntimeEventListener;
-import org.apache.tuscany.spi.services.store.DuplicateRecordException;
-import org.apache.tuscany.spi.services.store.Store;
-import org.apache.tuscany.spi.services.store.StoreExpirationEvent;
-import org.apache.tuscany.spi.services.store.StoreMonitor;
-
-import junit.framework.TestCase;
-import org.easymock.EasyMock;
-import org.easymock.IAnswer;
-
-/**
- * @version $Rev$ $Date$
- */
-public class MemoryStoreTestCase extends TestCase {
- private StoreMonitor monitor;
-
- public void testEviction() throws Exception {
- MemoryStore store = new MemoryStore(monitor);
- store.setReaperInterval(10);
- store.init();
- AtomicComponent component = EasyMock.createNiceMock(AtomicComponent.class);
- EasyMock.replay(component);
- String id = UUID.randomUUID().toString();
- Object value = new Object();
- store.insertRecord(component, id, value, 1);
- Thread.sleep(100);
- assertNull(store.readRecord(component, id));
- store.destroy();
- }
-
- public void testNotifyOnEviction() throws Exception {
- final CountDownLatch latch = new CountDownLatch(1);
- RuntimeEventListener listener = EasyMock.createMock(RuntimeEventListener.class);
- listener.onEvent(EasyMock.isA(StoreExpirationEvent.class));
- org.easymock.classextension.EasyMock.expectLastCall().andStubAnswer(new IAnswer<Object>() {
- public Object answer() throws Throwable {
- latch.countDown();
- return null;
- }
- });
- EasyMock.replay(listener);
- MemoryStore store = new MemoryStore(monitor);
- store.addListener(listener);
- store.setReaperInterval(10);
- store.init();
- AtomicComponent component = EasyMock.createNiceMock(AtomicComponent.class);
- EasyMock.replay(component);
- String id = UUID.randomUUID().toString();
- Object value = new Object();
- store.insertRecord(component, id, value, 1);
- if (!latch.await(1000, TimeUnit.MILLISECONDS)) {
- // failed to notify listener
- fail();
- }
- EasyMock.verify(listener);
- }
-
- public void testNoEviction() throws Exception {
- MemoryStore store = new MemoryStore(monitor);
- store.setReaperInterval(10);
- store.init();
- AtomicComponent component = EasyMock.createNiceMock(AtomicComponent.class);
- EasyMock.replay(component);
- String id = UUID.randomUUID().toString();
- Object value = new Object();
- store.insertRecord(component, id, value, Store.NEVER);
- Thread.sleep(100);
- assertNotNull(store.readRecord(component, id));
- store.destroy();
- }
-
- public void testInsertRecord() throws Exception {
- MemoryStore store = new MemoryStore(monitor);
- store.setReaperInterval(10);
- store.init();
- AtomicComponent component = EasyMock.createNiceMock(AtomicComponent.class);
- EasyMock.replay(component);
- String id = UUID.randomUUID().toString();
- Object value = new Object();
- store.insertRecord(component, id, value, Store.NEVER);
- store.destroy();
- }
-
- public void testInsertAlreadyExists() throws Exception {
- MemoryStore store = new MemoryStore(monitor);
- store.setReaperInterval(10);
- store.init();
- AtomicComponent component = EasyMock.createMock(AtomicComponent.class);
- EasyMock.expect(component.getUri()).andReturn(URI.create("component"));
- EasyMock.replay(component);
- String id = UUID.randomUUID().toString();
- Object value = new Object();
- store.insertRecord(component, id, value, Store.NEVER);
- try {
- store.insertRecord(component, id, value, Store.NEVER);
- fail();
- } catch (DuplicateRecordException e) {
- //expected
- }
- store.destroy();
- }
-
- public void testUpdateRecord() throws Exception {
- MemoryStore store = new MemoryStore(monitor);
- store.setReaperInterval(10);
- store.init();
- AtomicComponent component = EasyMock.createNiceMock(AtomicComponent.class);
- EasyMock.replay(component);
- String id = UUID.randomUUID().toString();
- Object value = new Object();
- Object newValue = new Object();
-
- store.insertRecord(component, id, value, Store.NEVER);
- store.updateRecord(component, id, newValue, 1L);
- assertEquals(newValue, store.readRecord(component, id));
- store.destroy();
- }
-
- public void testDeleteRecord() throws Exception {
- MemoryStore store = new MemoryStore(monitor);
- store.setReaperInterval(10);
- store.init();
- AtomicComponent component = EasyMock.createNiceMock(AtomicComponent.class);
- EasyMock.replay(component);
- String id = UUID.randomUUID().toString();
- Object value = new Object();
-
- store.insertRecord(component, id, value, Store.NEVER);
- store.removeRecord(component, id);
- assertNull(store.readRecord(component, id));
- store.destroy();
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- monitor = EasyMock.createNiceMock(StoreMonitor.class);
- EasyMock.replay(monitor);
- }
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/util/Bean1.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/util/Bean1.java
deleted file mode 100644
index 79fad549aa..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/util/Bean1.java
+++ /dev/null
@@ -1,45 +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 org.apache.tuscany.core.util;
-
-
-public class Bean1 extends SuperBean {
-
- public static final int ALL_BEAN1_FIELDS = 6 + ALL_SUPER_FIELDS;
- public static final int ALL_BEAN1_PUBLIC_PROTECTED_FIELDS = 5 + ALL_SUPER_PUBLIC_PROTECTED_FIELDS;
- public static final int ALL_BEAN1_METHODS = 4 + ALL_SUPER_METHODS - 1;
- public String field3;
- protected String field2;
- private String field1;
-
- public void setMethod1(String param) {
- }
-
- public void setMethod1(int param) {
- }
-
- public void override(String param) throws Exception {
- }
-
-
- public void noOverride(String param) throws Exception {
- }
-
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/util/Bean2.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/util/Bean2.java
deleted file mode 100644
index 7f7f03da9e..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/util/Bean2.java
+++ /dev/null
@@ -1,47 +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 org.apache.tuscany.core.util;
-
-import java.util.List;
-
-import junit.framework.AssertionFailedError;
-
-public class Bean2 {
-
- private List methodList;
- private List fieldList;
-
- public List getMethodList() {
- return methodList;
- }
-
- public void setMethodList(List list) {
- methodList = list;
- }
-
- public List getfieldList() {
- return fieldList;
- }
-
- public void setfieldList(List list) {
- throw new AssertionFailedError("setter inadvertantly called");
- }
-
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/util/JavaIntrospectionHelperTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/util/JavaIntrospectionHelperTestCase.java
deleted file mode 100644
index 797b147b54..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/util/JavaIntrospectionHelperTestCase.java
+++ /dev/null
@@ -1,180 +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 org.apache.tuscany.core.util;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import junit.framework.TestCase;
-import org.apache.tuscany.core.mock.component.Target;
-
-public class JavaIntrospectionHelperTestCase extends TestCase {
-
- private List testNoGenericsList;
- private List<String> testList;
- private Map<String, Bean1> testMap;
- private Target[] testArray;
- private String[] testStringArray;
-
- public JavaIntrospectionHelperTestCase() {
- super();
- }
-
- public JavaIntrospectionHelperTestCase(String arg0) {
- super(arg0);
- }
-
- public void testBean1AllPublicProtectedFields() throws Exception {
- Set<Field> beanFields = JavaIntrospectionHelper.getAllPublicAndProtectedFields(Bean1.class);
- assertEquals(4, beanFields.size()); //Bean1.ALL_BEAN1_PUBLIC_PROTECTED_FIELDS
- }
-
- public void testGetSuperAllMethods() throws Exception {
- Set<Method> superBeanMethods = JavaIntrospectionHelper.getAllUniquePublicProtectedMethods(SuperBean.class);
- assertEquals(SuperBean.ALL_SUPER_METHODS, superBeanMethods.size());
- }
-
- public void testGetBean1AllMethods() throws Exception {
- Set<Method> beanMethods = JavaIntrospectionHelper.getAllUniquePublicProtectedMethods(Bean1.class);
- assertEquals(Bean1.ALL_BEAN1_METHODS, beanMethods.size());
- }
-
- public void testOverrideMethod() throws Exception {
- Set<Method> beanFields = JavaIntrospectionHelper.getAllUniquePublicProtectedMethods(Bean1.class);
- boolean invoked = false;
- for (Method method : beanFields) {
- if (method.getName().equals("override")) {
- method.invoke(new Bean1(), "foo");
- invoked = true;
- }
- }
- if (!invoked) {
- throw new Exception("Override never invoked");
- }
- }
-
- public void testNoOverrideMethod() throws Exception {
- Set<Method> beanFields = JavaIntrospectionHelper.getAllUniquePublicProtectedMethods(Bean1.class);
- boolean found = false;
- for (Method method : beanFields) {
- if (method.getName().equals("noOverride") && method.getParameterTypes().length == 0) {
- found = true;
- }
- }
- if (!found) {
- throw new Exception("No override not found");
- }
- }
-
- public void testDefaultConstructor() throws Exception {
- Constructor ctr = JavaIntrospectionHelper.getDefaultConstructor(Bean2.class);
- assertEquals(ctr, Bean2.class.getConstructor());
- assertTrue(Bean2.class == ctr.newInstance((Object[]) null).getClass());
- }
-
-
- public void testGetAllInterfaces() {
- Set<Class> interfaces = JavaIntrospectionHelper.getAllInterfaces(Z.class);
- assertEquals(2, interfaces.size());
- assertTrue(interfaces.contains(W.class));
- assertTrue(interfaces.contains(W2.class));
- }
-
-
- public void testGetAllInterfacesObject() {
- Set<Class> interfaces = JavaIntrospectionHelper.getAllInterfaces(Object.class);
- assertEquals(0, interfaces.size());
- }
-
- public void testGetAllInterfacesNoInterfaces() {
- Set<Class> interfaces = JavaIntrospectionHelper.getAllInterfaces(NoInterface.class);
- assertEquals(0, interfaces.size());
- }
-
- /**
- * Tests generics introspection capabilities
- */
- public void testGenerics() throws Exception {
-
- List classes = JavaIntrospectionHelper.getGenerics(getClass().getDeclaredField("testList").getGenericType());
- assertEquals(1, classes.size());
- assertEquals(String.class, classes.get(0));
-
- classes =
- JavaIntrospectionHelper.getGenerics(getClass().getDeclaredField("testNoGenericsList").getGenericType());
- assertEquals(0, classes.size());
-
- classes = JavaIntrospectionHelper.getGenerics(getClass().getDeclaredField("testMap").getGenericType());
- assertEquals(2, classes.size());
- assertEquals(String.class, classes.get(0));
- assertEquals(Bean1.class, classes.get(1));
-
- classes = JavaIntrospectionHelper
- .getGenerics(getClass().getDeclaredMethod("fooMethod", Map.class).getGenericParameterTypes()[0]);
- assertEquals(2, classes.size());
- assertEquals(String.class, classes.get(0));
- assertEquals(Bean1.class, classes.get(1));
-
- classes = JavaIntrospectionHelper
- .getGenerics(getClass().getDeclaredMethod("fooMethod", List.class).getGenericParameterTypes()[0]);
- assertEquals(1, classes.size());
- assertEquals(String.class, classes.get(0));
-
- }
-
- private void fooMethod(List<String> foo) {
-
- }
-
- private void fooMethod(Map<String, Bean1> foo) {
-
- }
-
- public void setTestArray(Target[] array) {
- }
-
- private interface W {
-
- }
-
- private interface W2 {
-
- }
-
- private class X implements W {
-
- }
-
- private class Y extends X implements W, W2 {
-
- }
-
- private class Z extends Y {
-
- }
-
- private class NoInterface {
-
- }
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/util/SuperBean.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/util/SuperBean.java
deleted file mode 100644
index 83aef7fb5e..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/util/SuperBean.java
+++ /dev/null
@@ -1,48 +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 org.apache.tuscany.core.util;
-
-/**
- * @version $Rev$ $Date$
- */
-public class SuperBean {
-
- public static final int ALL_SUPER_FIELDS = 6;
- public static final int ALL_SUPER_PUBLIC_PROTECTED_FIELDS = 5;
- public static final int ALL_SUPER_METHODS = 4;
- public String superField2;
-
- protected String superField3;
-
- private String superField1;
-
- public void setSuperMethod1(String param) {
- }
-
- public void setSuperMethod1(int param) {
- }
-
- public void override(String param) throws Exception {
- throw new Exception("Override not handled");
- }
-
- public void noOverride() throws Exception {
- }
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/CallbackInterfaceInterceptorTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/CallbackInterfaceInterceptorTestCase.java
deleted file mode 100644
index 6c50cb406f..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/CallbackInterfaceInterceptorTestCase.java
+++ /dev/null
@@ -1,60 +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 org.apache.tuscany.core.wire;
-
-import org.osoa.sca.NoRegisteredCallbackException;
-
-import org.apache.tuscany.spi.wire.Interceptor;
-import org.apache.tuscany.spi.wire.Message;
-import org.apache.tuscany.spi.wire.MessageImpl;
-
-import junit.framework.TestCase;
-import org.easymock.EasyMock;
-
-/**
- * @version $Rev$ $Date$
- */
-public class CallbackInterfaceInterceptorTestCase extends TestCase {
-
- public void testOptimize() throws Exception {
- CallbackInterfaceInterceptor interceptor = new CallbackInterfaceInterceptor(true);
- assertFalse(interceptor.isOptimizable());
- }
-
- public void testImplements() {
- CallbackInterfaceInterceptor interceptor = new CallbackInterfaceInterceptor(true);
- Interceptor next = EasyMock.createMock(Interceptor.class);
- EasyMock.expect(next.invoke(EasyMock.isA(Message.class))).andReturn(null);
- EasyMock.replay(next);
- interceptor.setNext(next);
- interceptor.invoke(new MessageImpl());
- EasyMock.verify(next);
- }
-
- public void testDoesNotImplement() {
- CallbackInterfaceInterceptor interceptor = new CallbackInterfaceInterceptor(false);
- try {
- interceptor.invoke(new MessageImpl());
- fail();
- } catch (NoRegisteredCallbackException e) {
- // expected
- }
- }
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/ContractCompatibilityTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/ContractCompatibilityTestCase.java
deleted file mode 100644
index c955faf7b1..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/ContractCompatibilityTestCase.java
+++ /dev/null
@@ -1,390 +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 org.apache.tuscany.core.wire;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.tuscany.spi.QualifiedName;
-import org.apache.tuscany.spi.component.ReferenceBinding;
-import org.apache.tuscany.spi.model.DataType;
-import org.apache.tuscany.spi.model.Operation;
-import static org.apache.tuscany.spi.model.Operation.NO_CONVERSATION;
-import org.apache.tuscany.spi.model.ServiceContract;
-import org.apache.tuscany.spi.wire.ChainHolder;
-import org.apache.tuscany.spi.wire.IncompatibleServiceContractException;
-import org.apache.tuscany.spi.wire.ProxyCreationException;
-import org.apache.tuscany.spi.wire.Wire;
-import org.apache.tuscany.spi.wire.ProxyService;
-import org.apache.tuscany.spi.wire.InvocationChain;
-
-import junit.framework.TestCase;
-import org.osoa.sca.CallableReference;
-
-/**
- * TODO some tests commented out due to DataType.equals() needing to be strict
- *
- * @version $Rev$ $Date$
- */
-public class ContractCompatibilityTestCase extends TestCase {
-
- private ProxyService proxyService = new MockProxyService();
-
- public void testNoOperation() throws Exception {
- ServiceContract source = new MockContract<Type>("FooContract");
- ServiceContract target = new MockContract<Type>("FooContract");
- proxyService.checkCompatibility(source, target, false, false);
- }
-
- public void testBasic() throws Exception {
- ServiceContract<Type> source = new MockContract<Type>("FooContract");
- Operation<Type> opSource1 = new Operation<Type>("op1", null, null, null, false, null, NO_CONVERSATION);
- Map<String, Operation<Type>> sourceOperations = new HashMap<String, Operation<Type>>();
- sourceOperations.put("op1", opSource1);
- source.setOperations(sourceOperations);
- ServiceContract<Type> target = new MockContract<Type>("FooContract");
- Operation<Type> opSource2 = new Operation<Type>("op1", null, null, null, false, null, NO_CONVERSATION);
- Map<String, Operation<Type>> targetOperations = new HashMap<String, Operation<Type>>();
- targetOperations.put("op1", opSource2);
- target.setOperations(targetOperations);
- proxyService.checkCompatibility(source, target, false, false);
- }
-
- public void testBasicIncompatibleOperationNames() throws Exception {
- ServiceContract<Type> source = new MockContract<Type>("FooContract");
- Operation<Type> opSource1 = new Operation<Type>("op1", null, null, null, false, null, NO_CONVERSATION);
- Map<String, Operation<Type>> sourceOperations = new HashMap<String, Operation<Type>>();
- sourceOperations.put("op1", opSource1);
- source.setOperations(sourceOperations);
- ServiceContract<Type> target = new MockContract<Type>("FooContract");
- Operation<Type> opSource2 = new Operation<Type>("op2", null, null, null, false, null, NO_CONVERSATION);
- Map<String, Operation<Type>> targetOperations = new HashMap<String, Operation<Type>>();
- targetOperations.put("op2", opSource2);
- target.setOperations(targetOperations);
- try {
- proxyService.checkCompatibility(source, target, false, false);
- fail();
- } catch (IncompatibleServiceContractException e) {
- //expected
- }
- }
-
- public void testInputTypes() throws Exception {
- ServiceContract<Type> source = new MockContract<Type>("FooContract");
- List<DataType<Type>> sourceInputTypes = new ArrayList<DataType<Type>>();
- sourceInputTypes.add(new DataType<Type>(Object.class, Object.class));
- DataType<List<DataType<Type>>> inputType = new DataType<List<DataType<Type>>>(String.class, sourceInputTypes);
- Operation<Type> opSource1 = new Operation<Type>("op1", inputType, null, null, false, null, NO_CONVERSATION);
- Map<String, Operation<Type>> sourceOperations = new HashMap<String, Operation<Type>>();
- sourceOperations.put("op1", opSource1);
- source.setOperations(sourceOperations);
-
- ServiceContract<Type> target = new MockContract<Type>("FooContract");
- List<DataType<Type>> targetInputTypes = new ArrayList<DataType<Type>>();
- targetInputTypes.add(new DataType<Type>(Object.class, Object.class));
- DataType<List<DataType<Type>>> targetInputType =
- new DataType<List<DataType<Type>>>(String.class, targetInputTypes);
-
- Operation<Type> opTarget =
- new Operation<Type>("op1", targetInputType, null, null, false, null, NO_CONVERSATION);
- Map<String, Operation<Type>> targetOperations = new HashMap<String, Operation<Type>>();
- targetOperations.put("op1", opTarget);
- target.setOperations(targetOperations);
- proxyService.checkCompatibility(source, target, false, false);
- }
-
-
- public void testIncompatibleInputTypes() throws Exception {
- ServiceContract<Type> source = new MockContract<Type>("FooContract");
- List<DataType<Type>> sourceInputTypes = new ArrayList<DataType<Type>>();
- sourceInputTypes.add(new DataType<Type>(Integer.class, Integer.class));
- DataType<List<DataType<Type>>> inputType = new DataType<List<DataType<Type>>>(String.class, sourceInputTypes);
- Operation<Type> opSource1 = new Operation<Type>("op1", inputType, null, null, false, null, NO_CONVERSATION);
- Map<String, Operation<Type>> sourceOperations = new HashMap<String, Operation<Type>>();
- sourceOperations.put("op1", opSource1);
- source.setOperations(sourceOperations);
-
- ServiceContract<Type> target = new MockContract<Type>("FooContract");
- List<DataType<Type>> targetInputTypes = new ArrayList<DataType<Type>>();
- targetInputTypes.add(new DataType<Type>(String.class, String.class));
- DataType<List<DataType<Type>>> targetInputType =
- new DataType<List<DataType<Type>>>(String.class, targetInputTypes);
-
- Operation<Type> opTarget =
- new Operation<Type>("op1", targetInputType, null, null, false, null, NO_CONVERSATION);
- Map<String, Operation<Type>> targetOperations = new HashMap<String, Operation<Type>>();
- targetOperations.put("op1", opTarget);
- target.setOperations(targetOperations);
- try {
- proxyService.checkCompatibility(source, target, false, false);
- fail();
- } catch (IncompatibleServiceContractException e) {
- //expected
- }
- }
-
- /**
- * Verfies source input types can be super types of the target
- */
- public void testSourceSuperTypeInputCompatibility() throws Exception {
-// ServiceContract<Type> source = new MockContract<Type>("FooContract");
-// List<DataType<Type>> sourceInputTypes = new ArrayList<DataType<Type>>();
-// sourceInputTypes.add(new DataType<Type>(Object.class, Object.class));
-// DataType<List<DataType<Type>>> inputType = new DataType<List<DataType<Type>>>(String.class, sourceInputTypes);
-// Operation<Type> opSource1 = new Operation<Type>("op1", inputType, null, null, false, null);
-// Map<String, Operation<Type>> sourceOperations = new HashMap<String, Operation<Type>>();
-// sourceOperations.put("op1", opSource1);
-// source.setOperations(sourceOperations);
-//
-// ServiceContract<Type> target = new MockContract<Type>("FooContract");
-// List<DataType<Type>> targetInputTypes = new ArrayList<DataType<Type>>();
-// targetInputTypes.add(new DataType<Type>(String.class, String.class));
-// DataType<List<DataType<Type>>> targetInputType =
-// new DataType<List<DataType<Type>>>(String.class, targetInputTypes);
-//
-// Operation<Type> opTarget = new Operation<Type>("op1", targetInputType, null, null, false, null);
-// Map<String, Operation<Type>> targetOperations = new HashMap<String, Operation<Type>>();
-// targetOperations.put("op1", opTarget);
-// target.setOperations(targetOperations);
-// wireService.checkCompatibility(source, target, false);
- }
-
- public void testOutputTypes() throws Exception {
- ServiceContract<Type> source = new MockContract<Type>("FooContract");
- DataType<Type> sourceOutputType = new DataType<Type>(String.class, String.class);
- Operation<Type> opSource1 =
- new Operation<Type>("op1", null, sourceOutputType, null, false, null, NO_CONVERSATION);
- Map<String, Operation<Type>> sourceOperations = new HashMap<String, Operation<Type>>();
- sourceOperations.put("op1", opSource1);
- source.setOperations(sourceOperations);
-
- ServiceContract<Type> target = new MockContract<Type>("FooContract");
- DataType<Type> targetOutputType = new DataType<Type>(String.class, String.class);
- Operation<Type> opTarget =
- new Operation<Type>("op1", null, targetOutputType, null, false, null, NO_CONVERSATION);
- Map<String, Operation<Type>> targetOperations = new HashMap<String, Operation<Type>>();
- targetOperations.put("op1", opTarget);
- target.setOperations(targetOperations);
- proxyService.checkCompatibility(source, target, false, false);
- }
-
- /**
- * Verfies a return type that is a supertype of of the target is compatible
- */
- public void testSupertypeOutputTypes() throws Exception {
-// ServiceContract<Type> source = new MockContract<Type>("FooContract");
-// DataType<Type> sourceOutputType = new DataType<Type>(Object.class, Object.class);
-// Operation<Type> opSource1 = new Operation<Type>("op1", null, sourceOutputType, null, false, null);
-// Map<String, Operation<Type>> sourceOperations = new HashMap<String, Operation<Type>>();
-// sourceOperations.put("op1", opSource1);
-// source.setOperations(sourceOperations);
-//
-// ServiceContract<Type> target = new MockContract<Type>("FooContract");
-// DataType<Type> targetOutputType = new DataType<Type>(String.class, String.class);
-// Operation<Type> opTarget = new Operation<Type>("op1", null, targetOutputType, null, false, null);
-// Map<String, Operation<Type>> targetOperations = new HashMap<String, Operation<Type>>();
-// targetOperations.put("op1", opTarget);
-// target.setOperations(targetOperations);
-// wireService.checkCompatibility(source, target, false);
- }
-
- public void testIncompatibleOutputTypes() throws Exception {
- ServiceContract<Type> source = new MockContract<Type>("FooContract");
- DataType<Type> sourceOutputType = new DataType<Type>(String.class, String.class);
- Operation<Type> opSource1 =
- new Operation<Type>("op1", null, sourceOutputType, null, false, null, NO_CONVERSATION);
- Map<String, Operation<Type>> sourceOperations = new HashMap<String, Operation<Type>>();
- sourceOperations.put("op1", opSource1);
- source.setOperations(sourceOperations);
-
- ServiceContract<Type> target = new MockContract<Type>("FooContract");
- DataType<Type> targetOutputType = new DataType<Type>(Integer.class, Integer.class);
- Operation<Type> opTarget =
- new Operation<Type>("op1", null, targetOutputType, null, false, null, NO_CONVERSATION);
- Map<String, Operation<Type>> targetOperations = new HashMap<String, Operation<Type>>();
- targetOperations.put("op1", opTarget);
- target.setOperations(targetOperations);
- try {
- proxyService.checkCompatibility(source, target, false, false);
- fail();
- } catch (IncompatibleServiceContractException e) {
- //expected
- }
- }
-
- public void testFaultTypes() throws Exception {
- ServiceContract<Type> source = new MockContract<Type>("FooContract");
- DataType<Type> sourceFaultType = new DataType<Type>(String.class, String.class);
- List<DataType<Type>> sourceFaultTypes = new ArrayList<DataType<Type>>();
- sourceFaultTypes.add(0, sourceFaultType);
- Operation<Type> opSource1 =
- new Operation<Type>("op1", null, null, sourceFaultTypes, false, null, NO_CONVERSATION);
- Map<String, Operation<Type>> sourceOperations = new HashMap<String, Operation<Type>>();
- sourceOperations.put("op1", opSource1);
- source.setOperations(sourceOperations);
-
- ServiceContract<Type> target = new MockContract<Type>("FooContract");
- DataType<Type> targetFaultType = new DataType<Type>(String.class, String.class);
- List<DataType<Type>> targetFaultTypes = new ArrayList<DataType<Type>>();
- targetFaultTypes.add(0, targetFaultType);
-
- Operation<Type> opTarget =
- new Operation<Type>("op1", null, null, targetFaultTypes, false, null, NO_CONVERSATION);
- Map<String, Operation<Type>> targetOperations = new HashMap<String, Operation<Type>>();
- targetOperations.put("op1", opTarget);
- target.setOperations(targetOperations);
- proxyService.checkCompatibility(source, target, false, false);
- }
-
- public void testSourceFaultTargetNoFaultCompatibility() throws Exception {
- ServiceContract<Type> source = new MockContract<Type>("FooContract");
- DataType<Type> sourceFaultType = new DataType<Type>(String.class, String.class);
- List<DataType<Type>> sourceFaultTypes = new ArrayList<DataType<Type>>();
- sourceFaultTypes.add(0, sourceFaultType);
- Operation<Type> opSource1 =
- new Operation<Type>("op1", null, null, sourceFaultTypes, false, null, NO_CONVERSATION);
- Map<String, Operation<Type>> sourceOperations = new HashMap<String, Operation<Type>>();
- sourceOperations.put("op1", opSource1);
- source.setOperations(sourceOperations);
-
- ServiceContract<Type> target = new MockContract<Type>("FooContract");
- Operation<Type> opTarget = new Operation<Type>("op1", null, null, null, false, null, NO_CONVERSATION);
- Map<String, Operation<Type>> targetOperations = new HashMap<String, Operation<Type>>();
- targetOperations.put("op1", opTarget);
- target.setOperations(targetOperations);
- proxyService.checkCompatibility(source, target, false, false);
- }
-
- /**
- * Verifies a source's fault which is a supertype of the target's fault are compatibile
- *
- * @throws Exception
- */
- public void testFaultSuperTypes() throws Exception {
-// ServiceContract<Type> source = new MockContract<Type>("FooContract");
-// DataType<Type> sourceFaultType = new DataType<Type>(Exception.class, Exception.class);
-// List<DataType<Type>> sourceFaultTypes = new ArrayList<DataType<Type>>();
-// sourceFaultTypes.add(0, sourceFaultType);
-// Operation<Type> opSource1 = new Operation<Type>("op1", null, null, sourceFaultTypes, false, null);
-// Map<String, Operation<Type>> sourceOperations = new HashMap<String, Operation<Type>>();
-// sourceOperations.put("op1", opSource1);
-// source.setOperations(sourceOperations);
-//
-// ServiceContract<Type> target = new MockContract<Type>("FooContract");
-// DataType<Type> targetFaultType = new DataType<Type>(TuscanyException.class, TuscanyException.class);
-// List<DataType<Type>> targetFaultTypes = new ArrayList<DataType<Type>>();
-// targetFaultTypes.add(0, targetFaultType);
-//
-// Operation<Type> opTarget = new Operation<Type>("op1", null, null, targetFaultTypes, false, null);
-// Map<String, Operation<Type>> targetOperations = new HashMap<String, Operation<Type>>();
-// targetOperations.put("op1", opTarget);
-// target.setOperations(targetOperations);
-// wireService.checkCompatibility(source, target, false);
- }
-
- /**
- * Verifies a source's faults which are supertypes and a superset of the target's faults are compatibile
- */
- public void testFaultSuperTypesAndSuperset() throws Exception {
-// ServiceContract<Type> source = new MockContract<Type>("FooContract");
-// DataType<Type> sourceFaultType = new DataType<Type>(Exception.class, Exception.class);
-// DataType<Type> sourceFaultType2 = new DataType<Type>(RuntimeException.class, RuntimeException.class);
-// List<DataType<Type>> sourceFaultTypes = new ArrayList<DataType<Type>>();
-// sourceFaultTypes.add(0, sourceFaultType);
-// sourceFaultTypes.add(1, sourceFaultType2);
-// Operation<Type> opSource1 = new Operation<Type>("op1", null, null, sourceFaultTypes, false, null);
-// Map<String, Operation<Type>> sourceOperations = new HashMap<String, Operation<Type>>();
-// sourceOperations.put("op1", opSource1);
-// source.setOperations(sourceOperations);
-//
-// ServiceContract<Type> target = new MockContract<Type>("FooContract");
-// DataType<Type> targetFaultType = new DataType<Type>(TuscanyException.class, TuscanyException.class);
-// List<DataType<Type>> targetFaultTypes = new ArrayList<DataType<Type>>();
-// targetFaultTypes.add(0, targetFaultType);
-//
-// Operation<Type> opTarget = new Operation<Type>("op1", null, null, targetFaultTypes, false, null);
-// Map<String, Operation<Type>> targetOperations = new HashMap<String, Operation<Type>>();
-// targetOperations.put("op1", opTarget);
-// target.setOperations(targetOperations);
-// wireService.checkCompatibility(source, target, false);
- }
-
- private class MockContract<T> extends ServiceContract<T> {
- public MockContract() {
- }
-
- public MockContract(Class interfaceClass) {
- super(interfaceClass);
- }
-
- public MockContract(String interfaceName) {
- super(interfaceName);
- }
- }
-
- private class MockProxyService extends ProxyServiceExtension {
- public MockProxyService() {
- super(null);
- }
-
- public <T> T createProxy(Class<T> interfaze, Wire wire) throws ProxyCreationException {
- throw new UnsupportedOperationException();
- }
-
- public <T> T createProxy2(Class<T> interfaze, boolean conversational, Wire wire) throws ProxyCreationException {
- throw new UnsupportedOperationException();
- }
-
- public <T> T createProxy2(Class<T> interfaze, Wire wire) throws ProxyCreationException {
- throw new UnsupportedOperationException();
- }
-
- public <T> T createProxy(Class<T> interfaze, Wire wire, Map<Method, ChainHolder> mapping)
- throws ProxyCreationException {
- throw new UnsupportedOperationException();
- }
-
- public <T> T createProxy2(Class<T> interfaze, Wire wire, Map<Method, InvocationChain> mapping)
- throws ProxyCreationException {
- throw new UnsupportedOperationException();
- }
-
- public Object createCallbackProxy(Class<?> interfaze, List<Wire> wires) throws ProxyCreationException {
- throw new UnsupportedOperationException();
- }
-
- public Object createCallbackProxy(Class<?> interfaze) throws ProxyCreationException {
- throw new UnsupportedOperationException();
- }
-
- public void createWires(ReferenceBinding referenceBinding, ServiceContract<?> contract,
- QualifiedName targetName) {
- throw new UnsupportedOperationException();
- }
-
- public <B, R extends CallableReference<B>> R cast(B target) throws IllegalArgumentException {
- throw new UnsupportedOperationException();
- }
- }
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/IncompatibleServiceContractExceptionFormatterTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/IncompatibleServiceContractExceptionFormatterTestCase.java
deleted file mode 100644
index a9f455bc62..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/IncompatibleServiceContractExceptionFormatterTestCase.java
+++ /dev/null
@@ -1,82 +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 org.apache.tuscany.core.wire;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-
-import org.apache.tuscany.spi.model.Operation;
-import org.apache.tuscany.spi.model.ServiceContract;
-import org.apache.tuscany.spi.wire.IncompatibleServiceContractException;
-
-import junit.framework.TestCase;
-import org.apache.tuscany.host.monitor.FormatterRegistry;
-import org.easymock.EasyMock;
-
-/**
- * @version $Rev$ $Date$
- */
-public class IncompatibleServiceContractExceptionFormatterTestCase extends TestCase {
- FormatterRegistry registry = EasyMock.createNiceMock(FormatterRegistry.class);
- IncompatibleServiceContractExceptionFormatter formatter =
- new IncompatibleServiceContractExceptionFormatter(registry);
-
- public void testFormat() throws Exception {
- ServiceContract<Object> source = new ServiceContract<Object>() {
- };
- source.setInterfaceName("sourceInterface");
- ServiceContract<Object> target = new ServiceContract<Object>() {
- };
- target.setInterfaceName("targetInterface");
- Operation<Object> sourceOp = new Operation<Object>("sourceOp", null, null, null);
- Operation<Object> targetOp = new Operation<Object>("targetOp", null, null, null);
-
- IncompatibleServiceContractException e =
- new IncompatibleServiceContractException("message", source, target, sourceOp, targetOp);
- StringWriter writer = new StringWriter();
- PrintWriter pw = new PrintWriter(writer);
- formatter.write(pw, e);
- String buffer = writer.toString();
- assertTrue(buffer.indexOf("message") >= 0);
- assertTrue(buffer.indexOf("sourceInterface") >= 0);
- assertTrue(buffer.indexOf("targetInterface") >= 0);
- assertTrue(buffer.indexOf("sourceOp") >= 0);
- assertTrue(buffer.indexOf("targetOp") >= 0);
- }
-
-
- public void testFormatNulls() throws Exception {
- ServiceContract<Object> source = new ServiceContract<Object>() {
- };
- source.setInterfaceName("sourceInterface");
- ServiceContract<Object> target = new ServiceContract<Object>() {
- };
- target.setInterfaceName("targetInterface");
-
- IncompatibleServiceContractException e =
- new IncompatibleServiceContractException("message", source, target);
- StringWriter writer = new StringWriter();
- PrintWriter pw = new PrintWriter(writer);
- formatter.write(pw, e);
- String buffer = writer.toString();
- assertTrue(buffer.indexOf("message") >= 0);
- assertTrue(buffer.indexOf("sourceInterface") >= 0);
- assertTrue(buffer.indexOf("targetInterface") >= 0);
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/InvocationChainImplTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/InvocationChainImplTestCase.java
deleted file mode 100644
index 9875058abb..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/InvocationChainImplTestCase.java
+++ /dev/null
@@ -1,84 +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 org.apache.tuscany.core.wire;
-
-import java.lang.reflect.Type;
-
-import org.apache.tuscany.spi.model.Operation;
-import org.apache.tuscany.spi.wire.Interceptor;
-import org.apache.tuscany.spi.wire.Message;
-import org.apache.tuscany.spi.wire.InvocationChain;
-
-import junit.framework.TestCase;
-
-/**
- * @version $Rev$ $Date$
- */
-public class InvocationChainImplTestCase extends TestCase {
-
- public void testInsertAtPos() throws Exception {
- InvocationChain chain = new InvocationChainImpl(new Operation<Type>("foo", null, null, null));
- Interceptor inter3 = new MockInterceptor();
- Interceptor inter2 = new MockInterceptor();
- Interceptor inter1 = new MockInterceptor();
- chain.addInterceptor(inter3);
- chain.addInterceptor(0, inter1);
- chain.addInterceptor(1, inter2);
- Interceptor head = chain.getHeadInterceptor();
- assertEquals(inter1, head);
- assertEquals(inter2, head.getNext());
- assertEquals(inter3, head.getNext().getNext());
- }
-
- public void testInsertAtEnd() throws Exception {
- InvocationChain chain = new InvocationChainImpl(new Operation<Type>("foo", null, null, null));
- Interceptor inter2 = new MockInterceptor();
- Interceptor inter1 = new MockInterceptor();
- chain.addInterceptor(0, inter1);
- chain.addInterceptor(1, inter2);
- Interceptor head = chain.getHeadInterceptor();
- assertEquals(inter1, head);
- assertEquals(inter2, head.getNext());
- assertEquals(inter2, chain.getTailInterceptor());
-
- }
-
- private class MockInterceptor implements Interceptor {
-
- private Interceptor next;
-
- public Message invoke(Message msg) {
- return null;
- }
-
- public void setNext(Interceptor next) {
- this.next = next;
- }
-
- public Interceptor getNext() {
- return next;
- }
-
- public boolean isOptimizable() {
- return false;
- }
- }
-
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/NonBlockingInterceptorBuilderTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/NonBlockingInterceptorBuilderTestCase.java
deleted file mode 100644
index c563217306..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/NonBlockingInterceptorBuilderTestCase.java
+++ /dev/null
@@ -1,38 +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 org.apache.tuscany.core.wire;
-
-import static org.apache.tuscany.core.wire.NonBlockingInterceptorBuilder.QNAME;
-
-import org.apache.tuscany.spi.model.physical.PhysicalInterceptorDefinition;
-
-import junit.framework.TestCase;
-
-/**
- * @version $Rev$ $Date$
- */
-public class NonBlockingInterceptorBuilderTestCase extends TestCase {
-
- public void testBuild() throws Exception {
- NonBlockingInterceptorBuilder builder = new NonBlockingInterceptorBuilder(null, null);
- PhysicalInterceptorDefinition definition = new PhysicalInterceptorDefinition(QNAME);
- definition.setBuilder(QNAME);
- assertTrue(builder.build(definition) instanceof NonBlockingInterceptor);
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/NonBlockingInterceptorTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/NonBlockingInterceptorTestCase.java
deleted file mode 100644
index c08d1453db..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/NonBlockingInterceptorTestCase.java
+++ /dev/null
@@ -1,75 +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 org.apache.tuscany.core.wire;
-
-import org.apache.tuscany.spi.component.WorkContext;
-import org.apache.tuscany.spi.model.Scope;
-import org.apache.tuscany.spi.services.work.WorkScheduler;
-import org.apache.tuscany.spi.wire.Interceptor;
-import org.apache.tuscany.spi.wire.Message;
-import org.apache.tuscany.spi.wire.MessageImpl;
-
-import junit.framework.TestCase;
-import org.easymock.EasyMock;
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.expectLastCall;
-import static org.easymock.EasyMock.getCurrentArguments;
-import static org.easymock.EasyMock.isA;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-import org.easymock.IAnswer;
-
-/**
- * @version $Rev$ $Date$
- */
-public class NonBlockingInterceptorTestCase extends TestCase {
-
- public void testInvoke() throws Exception {
- WorkScheduler scheduler = createMock(WorkScheduler.class);
- scheduler.scheduleWork(isA(Runnable.class));
- expectLastCall().andStubAnswer(new IAnswer<Object>() {
- public Object answer() throws Throwable {
- Runnable runnable = (Runnable) getCurrentArguments()[0];
- runnable.run();
- return null;
- }
- });
- replay(scheduler);
- WorkContext context = createMock(WorkContext.class);
- String convID = "convID";
- EasyMock.expect(context.getIdentifier(Scope.CONVERSATION)).andReturn(convID);
- context.setCorrelationId(null);
- context.setIdentifier(Scope.CONVERSATION, convID);
- EasyMock.replay(context);
- Message msg = new MessageImpl();
- Interceptor next = EasyMock.createMock(Interceptor.class);
- EasyMock.expect(next.invoke(EasyMock.eq(msg))).andReturn(msg);
- EasyMock.replay(next);
- Interceptor interceptor = new NonBlockingInterceptor(scheduler, context, next);
- interceptor.invoke(msg);
- verify(context);
- verify(next);
- }
-
- public void testOptimizable() {
- NonBlockingInterceptor interceptor = new NonBlockingInterceptor(null, null);
- assertFalse(interceptor.isOptimizable());
- }
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/OptimizedWireObjectFactoryTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/OptimizedWireObjectFactoryTestCase.java
deleted file mode 100644
index 5293678d12..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/OptimizedWireObjectFactoryTestCase.java
+++ /dev/null
@@ -1,44 +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 org.apache.tuscany.core.wire;
-
-import org.apache.tuscany.spi.wire.Wire;
-
-import junit.framework.TestCase;
-import org.easymock.EasyMock;
-
-/**
- * @version $Rev$ $Date$
- */
-public class OptimizedWireObjectFactoryTestCase extends TestCase {
-
- public void testGetInstance() throws Exception {
- Foo foo = new Foo();
- Wire wire = EasyMock.createMock(Wire.class);
- EasyMock.expect(wire.getTargetInstance()).andReturn(foo);
- EasyMock.replay(wire);
- OptimizedWireObjectFactory<Foo> factory = new OptimizedWireObjectFactory<Foo>(Foo.class, wire);
- assertEquals(foo, factory.getInstance());
- EasyMock.verify(wire);
- }
-
- private class Foo {
-
- }
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/WireImplTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/WireImplTestCase.java
deleted file mode 100644
index e337133523..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/WireImplTestCase.java
+++ /dev/null
@@ -1,50 +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 org.apache.tuscany.core.wire;
-
-import org.apache.tuscany.spi.component.AtomicComponent;
-import org.apache.tuscany.spi.wire.Wire;
-
-import junit.framework.TestCase;
-import org.easymock.EasyMock;
-
-/**
- * @version $Rev$ $Date$
- */
-public class WireImplTestCase extends TestCase {
-
- /**
- * Tests that the target wire returns null if there is no connected wire. This behavior is needed for optional
- * autowires.
- */
- public void testGetNonExistentTarget() throws Exception {
- Wire wire = new WireImpl();
- assertNull(wire.getTargetInstance());
- }
-
- public void testTargetInstance() throws Exception {
- Wire wire = new WireImpl();
- AtomicComponent component = EasyMock.createMock(AtomicComponent.class);
- EasyMock.expect(component.getTargetInstance()).andReturn(new Object());
- EasyMock.replay(component);
- wire.setTarget(component);
- assertNotNull(wire.getTargetInstance());
- }
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/WireObjectFactoryTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/WireObjectFactoryTestCase.java
deleted file mode 100644
index 9f21b9efdb..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/WireObjectFactoryTestCase.java
+++ /dev/null
@@ -1,138 +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 org.apache.tuscany.core.wire;
-
-import java.lang.reflect.Type;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.tuscany.spi.idl.java.JavaServiceContract;
-import org.apache.tuscany.spi.model.Operation;
-import org.apache.tuscany.spi.model.ServiceContract;
-import org.apache.tuscany.spi.wire.ProxyService;
-import org.apache.tuscany.spi.wire.InvocationChain;
-import org.apache.tuscany.spi.wire.Wire;
-
-import junit.framework.TestCase;
-import org.easymock.EasyMock;
-
-/**
- * @version $Rev$ $Date$
- */
-public class WireObjectFactoryTestCase extends TestCase {
-
- @SuppressWarnings({"unchecked"})
- public void testCreateInstance() throws Exception {
- Operation<Type> op = new Operation<Type>("hello", null, null, null);
- InvocationChain chain = new InvocationChainImpl(op);
- Wire wire = EasyMock.createMock(Wire.class);
- Map<Operation<?>, InvocationChain> chains = new HashMap<Operation<?>, InvocationChain>();
- chains.put(op, chain);
- EasyMock.expect(wire.getInvocationChains()).andReturn(chains);
- EasyMock.expect(wire.isOptimizable()).andReturn(false);
- EasyMock.replay(wire);
- ProxyService service = EasyMock.createMock(ProxyService.class);
- service.createProxy(EasyMock.eq(Foo.class), EasyMock.eq(wire), EasyMock.isA(Map.class));
- EasyMock.expectLastCall().andReturn(new Foo() {
- public void hello() {
-
- }
- });
- EasyMock.replay(service);
-
- WireObjectFactory<Foo> factory = new WireObjectFactory<Foo>(Foo.class, wire, service);
- factory.getInstance();
- EasyMock.verify(service);
- EasyMock.verify(wire);
- }
-
- @SuppressWarnings("unchecked")
- public void testOptimizedCreateInstance() throws Exception {
- ServiceContract<?> contract = new JavaServiceContract(Foo.class);
- Wire wire = EasyMock.createMock(Wire.class);
- EasyMock.expect(wire.isOptimizable()).andReturn(true);
- EasyMock.expect(wire.getSourceContract()).andReturn(contract).atLeastOnce();
- EasyMock.expect(wire.getInvocationChains()).andReturn((Map) Collections.emptyMap());
- EasyMock.expect(wire.getTargetInstance()).andReturn(new Foo() {
- public void hello() {
- }
- });
- EasyMock.replay(wire);
- WireObjectFactory<Foo> factory = new WireObjectFactory<Foo>(Foo.class, wire, null);
- factory.getInstance();
- EasyMock.verify(wire);
-
- }
-
- /**
- * Verifies that a proxy is created when the required client contract is different than the wire contract
- */
- @SuppressWarnings("unchecked")
- public void testCannotOptimizeDifferentContractsCreateInstance() throws Exception {
- ServiceContract<?> contract = new JavaServiceContract(Object.class);
- Wire wire = EasyMock.createMock(Wire.class);
- EasyMock.expect(wire.isOptimizable()).andReturn(true);
- EasyMock.expect(wire.getSourceContract()).andReturn(contract).atLeastOnce();
- EasyMock.expect(wire.getInvocationChains()).andReturn((Map) Collections.emptyMap());
- EasyMock.replay(wire);
- ProxyService service = EasyMock.createMock(ProxyService.class);
- service.createProxy(EasyMock.eq(Foo.class), EasyMock.eq(wire), EasyMock.isA(Map.class));
- EasyMock.expectLastCall().andReturn(new Foo() {
- public void hello() {
-
- }
- });
- EasyMock.replay(service);
-
- WireObjectFactory<Foo> factory = new WireObjectFactory<Foo>(Foo.class, wire, service);
- factory.getInstance();
- EasyMock.verify(service);
- EasyMock.verify(wire);
- }
-
- @SuppressWarnings("unchecked")
- public void testNoJavaInterfaceCreateInstance() throws Exception {
- ServiceContract<?> contract = new JavaServiceContract();
- Wire wire = EasyMock.createMock(Wire.class);
- EasyMock.expect(wire.isOptimizable()).andReturn(true);
- EasyMock.expect(wire.getSourceContract()).andReturn(contract).atLeastOnce();
- EasyMock.expect(wire.getInvocationChains()).andReturn((Map) Collections.emptyMap());
- EasyMock.replay(wire);
- ProxyService service = EasyMock.createMock(ProxyService.class);
- service.createProxy(EasyMock.eq(Foo.class), EasyMock.eq(wire), EasyMock.isA(Map.class));
- EasyMock.expectLastCall().andReturn(new Foo() {
- public void hello() {
-
- }
- });
- EasyMock.replay(service);
-
- WireObjectFactory<Foo> factory = new WireObjectFactory<Foo>(Foo.class, wire, service);
- factory.getInstance();
- EasyMock.verify(service);
- EasyMock.verify(wire);
- }
-
- private interface Foo {
- void hello();
- }
-
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/WireOptimizationTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/WireOptimizationTestCase.java
deleted file mode 100644
index 1db3892471..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/WireOptimizationTestCase.java
+++ /dev/null
@@ -1,113 +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 org.apache.tuscany.core.wire;
-
-import java.lang.reflect.Type;
-
-import org.apache.tuscany.spi.component.AtomicComponent;
-import org.apache.tuscany.spi.model.Operation;
-import static org.apache.tuscany.spi.model.Operation.NO_CONVERSATION;
-import org.apache.tuscany.spi.wire.Interceptor;
-import org.apache.tuscany.spi.wire.InvocationChain;
-import org.apache.tuscany.spi.wire.Message;
-import org.apache.tuscany.spi.wire.Wire;
-
-import junit.framework.TestCase;
-import org.easymock.EasyMock;
-
-/**
- * Verifies wire optimization analysis
- *
- * @version $$Rev$$ $$Date$$
- */
-public class WireOptimizationTestCase extends TestCase {
- private Operation operation;
-
- public void foo() {
- }
-
- public void testWireInterceptorOptimization() throws Exception {
- AtomicComponent component = EasyMock.createNiceMock(AtomicComponent.class);
- EasyMock.replay(component);
- Wire wire = new WireImpl();
- InvocationChain chain = new InvocationChainImpl(operation);
- chain.addInterceptor(new OptimizableInterceptor());
- wire.addInvocationChain(operation, chain);
- assertTrue(WireUtils.isOptimizable(wire));
- }
-
- public void testWireNonInterceptorOptimization() throws Exception {
- AtomicComponent component = EasyMock.createNiceMock(AtomicComponent.class);
- EasyMock.replay(component);
- Wire wire = new WireImpl();
- InvocationChain chain = new InvocationChainImpl(operation);
- chain.addInterceptor(new NonOptimizableInterceptor());
- wire.addInvocationChain(operation, chain);
- assertFalse(WireUtils.isOptimizable(wire));
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- operation = new Operation<Type>("foo", null, null, null, false, null, NO_CONVERSATION);
-
- }
-
- private class OptimizableInterceptor implements Interceptor {
-
- public Message invoke(Message msg) {
- return null;
- }
-
- public void setNext(Interceptor next) {
-
- }
-
- public Interceptor getNext() {
- return null;
- }
-
- public boolean isOptimizable() {
- return true;
- }
- }
-
- private class NonOptimizableInterceptor implements Interceptor {
-
- public Message invoke(Message msg) {
- return null;
- }
-
- public void setNext(Interceptor next) {
-
- }
-
- public Interceptor getNext() {
- return null;
- }
-
- public boolean isOptimizable() {
- return false;
- }
- }
-
-}
diff --git a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/WireUtilsTestCase.java b/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/WireUtilsTestCase.java
deleted file mode 100644
index a9da65e0ba..0000000000
--- a/sandbox/rfeng/minicore/src/test/java/org/apache/tuscany/core/wire/WireUtilsTestCase.java
+++ /dev/null
@@ -1,69 +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 org.apache.tuscany.core.wire;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.Type;
-import java.util.Map;
-
-import org.apache.tuscany.spi.model.Operation;
-import org.apache.tuscany.spi.wire.ChainHolder;
-import org.apache.tuscany.spi.wire.InvocationChain;
-import org.apache.tuscany.spi.wire.Wire;
-
-import junit.framework.TestCase;
-
-/**
- * @version $Rev$ $Date$
- */
-public class WireUtilsTestCase extends TestCase {
- private Method m;
-
- public void testCreateInterfaceToWireMapping() throws Exception {
- Wire wire = new WireImpl();
- Operation<Type> op = new Operation<Type>("hello", null, null, null);
- InvocationChain chain = new InvocationChainImpl(op);
- wire.addInvocationChain(op, chain);
- Map<Method, ChainHolder> chains = WireUtils.createInterfaceToWireMapping(Foo.class, wire);
- assertEquals(1, chains.size());
- assertNotNull(chains.get(m));
- }
-
- public void testCreateInterfaceToWireMappingNoOperation() throws Exception {
- Wire wire = new WireImpl();
- Operation<Type> op = new Operation<Type>("goodbye", null, null, null);
- InvocationChain chain = new InvocationChainImpl(op);
- wire.addInvocationChain(op, chain);
- try {
- WireUtils.createInterfaceToWireMapping(Foo.class, wire);
- fail();
- } catch (NoMethodForOperationException e) {
- // expected
- }
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- m = Foo.class.getMethod("hello");
- }
-
- private interface Foo {
- void hello();
- }
-}