diff options
Diffstat (limited to 'sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock')
39 files changed, 1440 insertions, 0 deletions
diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/AsyncTarget.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/AsyncTarget.java new file mode 100644 index 0000000000..c30e19de88 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/AsyncTarget.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.core.mock.component; + +import org.osoa.sca.annotations.OneWay; + +/** + * @version $Rev$ $Date$ + */ +public interface AsyncTarget { + @OneWay + void invoke(); + + int getCount(); +} diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/BadContextPojo.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/BadContextPojo.java new file mode 100644 index 0000000000..f9ae94f152 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/BadContextPojo.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.core.mock.component; + +import org.osoa.sca.annotations.Context; + +public class BadContextPojo { + + @Context + String context; + +} diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/BadNamePojo.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/BadNamePojo.java new file mode 100644 index 0000000000..c4074484b9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/BadNamePojo.java @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.core.mock.component; + +import org.osoa.sca.annotations.ComponentName; + +public class BadNamePojo { + @ComponentName + private int name; +} diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/BasicInterface.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/BasicInterface.java new file mode 100644 index 0000000000..ca305b9ef0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/BasicInterface.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.core.mock.component; + +/** + * @version $Rev$ $Date$ + */ +public interface BasicInterface { + String returnsProperty(); + + BasicInterface returnsReference(); + + int returnsInt(); +} diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/BasicInterfaceImpl.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/BasicInterfaceImpl.java new file mode 100644 index 0000000000..ea32d1f6b9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/BasicInterfaceImpl.java @@ -0,0 +1,66 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.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/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeComponent.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeComponent.java new file mode 100644 index 0000000000..6d320df145 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeComponent.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.core.mock.component; + +import org.osoa.sca.annotations.Scope; + +/** + * @version $Rev$ $Date$ + */ +@Scope("COMPOSITE") +public interface CompositeScopeComponent { + + //public boolean isInit(); +} + diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeComponentImpl.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeComponentImpl.java new file mode 100644 index 0000000000..9ff289a502 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeComponentImpl.java @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.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/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeDestroyOnlyComponent.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeDestroyOnlyComponent.java new file mode 100644 index 0000000000..832055a084 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeDestroyOnlyComponent.java @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.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/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeInitDestroyComponent.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeInitDestroyComponent.java new file mode 100644 index 0000000000..e8b76e13c0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeInitDestroyComponent.java @@ -0,0 +1,39 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.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/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeInitOnlyComponent.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeInitOnlyComponent.java new file mode 100644 index 0000000000..057580be7a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeInitOnlyComponent.java @@ -0,0 +1,42 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.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/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeComponent.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeComponent.java new file mode 100644 index 0000000000..79f48a57c5 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeComponent.java @@ -0,0 +1,29 @@ +/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.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/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeComponentImpl.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeComponentImpl.java new file mode 100644 index 0000000000..5b42d92191 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeComponentImpl.java @@ -0,0 +1,29 @@ +/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.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/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeDestroyOnlyComponent.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeDestroyOnlyComponent.java new file mode 100644 index 0000000000..c64556e754 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeDestroyOnlyComponent.java @@ -0,0 +1,37 @@ +/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.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/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeInitDestroyComponent.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeInitDestroyComponent.java new file mode 100644 index 0000000000..6f930ef750 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeInitDestroyComponent.java @@ -0,0 +1,38 @@ +/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.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/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeInitOnlyComponent.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeInitOnlyComponent.java new file mode 100644 index 0000000000..70733f4d99 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeInitOnlyComponent.java @@ -0,0 +1,38 @@ +/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.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/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderException.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderException.java new file mode 100644 index 0000000000..4bb9cde958 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderException.java @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.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/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedDependentPojo.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedDependentPojo.java new file mode 100644 index 0000000000..df59029884 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedDependentPojo.java @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.core.mock.component; + +/** + * @version $$Rev$$ $$Date$$ + */ +public interface OrderedDependentPojo extends OrderedInitPojo { + + OrderedInitPojo getPojo(); + + void setPojo(OrderedInitPojo pojo); +} diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedDependentPojoImpl.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedDependentPojoImpl.java new file mode 100644 index 0000000000..1b51c2772d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedDependentPojoImpl.java @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.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/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedEagerInitPojo.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedEagerInitPojo.java new file mode 100644 index 0000000000..139086bf0d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedEagerInitPojo.java @@ -0,0 +1,60 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.core.mock.component; + +import org.osoa.sca.annotations.Destroy; +import org.osoa.sca.annotations.EagerInit; +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Scope; + +@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/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedInitPojo.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedInitPojo.java new file mode 100644 index 0000000000..1c3615fcd0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedInitPojo.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.core.mock.component; + +/** + * @version $$Rev$$ $$Date$$ + */ +public interface OrderedInitPojo { + int getNumberInstantiated(); + + int getInitOrder(); +} diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedInitPojoImpl.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedInitPojoImpl.java new file mode 100644 index 0000000000..b65ead9b19 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedInitPojoImpl.java @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.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/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OtherTarget.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OtherTarget.java new file mode 100644 index 0000000000..963c31a4ca --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OtherTarget.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.core.mock.component; + +/** + * Implementations are used in wiring tests + * + * @version $Rev$ $Date$ + */ +public interface OtherTarget { + + String getString(); + + void setString(String val); +} diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OtherTargetImpl.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OtherTargetImpl.java new file mode 100644 index 0000000000..91ccc9e772 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OtherTargetImpl.java @@ -0,0 +1,39 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.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/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/RequestScopeComponent.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/RequestScopeComponent.java new file mode 100644 index 0000000000..7d03c4372d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/RequestScopeComponent.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.core.mock.component; + +import org.osoa.sca.annotations.Scope; + +/** + * @version $Rev$ $Date$ + */ +@Scope("REQUEST") +public interface RequestScopeComponent { + +} + diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/RequestScopeDestroyOnlyComponent.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/RequestScopeDestroyOnlyComponent.java new file mode 100644 index 0000000000..f94f071086 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/RequestScopeDestroyOnlyComponent.java @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.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/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/RequestScopeInitDestroyComponent.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/RequestScopeInitDestroyComponent.java new file mode 100644 index 0000000000..f2de2d9afa --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/RequestScopeInitDestroyComponent.java @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.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/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/RequestScopeInitOnlyComponent.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/RequestScopeInitOnlyComponent.java new file mode 100644 index 0000000000..9bcef40834 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/RequestScopeInitOnlyComponent.java @@ -0,0 +1,39 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.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/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SessionScopeComponent.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SessionScopeComponent.java new file mode 100644 index 0000000000..8318333feb --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SessionScopeComponent.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.core.mock.component; + +import org.osoa.sca.annotations.Scope; + +/** + * @version $Rev$ $Date$ + */ +@Scope("SESSION") +public interface SessionScopeComponent { + +} + diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SessionScopeComponentImpl.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SessionScopeComponentImpl.java new file mode 100644 index 0000000000..0494d587aa --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SessionScopeComponentImpl.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.core.mock.component; + +import org.osoa.sca.annotations.Scope; + +/** + * @version $Rev$ $Date$ + */ +@Scope("SESSION") +public class SessionScopeComponentImpl implements + SessionScopeComponent { + +} diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SessionScopeInitDestroyComponent.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SessionScopeInitDestroyComponent.java new file mode 100644 index 0000000000..fdc11a80af --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SessionScopeInitDestroyComponent.java @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.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/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SessionScopeInitOnlyComponent.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SessionScopeInitOnlyComponent.java new file mode 100644 index 0000000000..4e849895f8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SessionScopeInitOnlyComponent.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.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/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SimpleTarget.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SimpleTarget.java new file mode 100644 index 0000000000..44eb94260e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SimpleTarget.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.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/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SimpleTargetImpl.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SimpleTargetImpl.java new file mode 100644 index 0000000000..662b21116a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SimpleTargetImpl.java @@ -0,0 +1,41 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.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/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/Source.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/Source.java new file mode 100644 index 0000000000..aa3b5be528 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/Source.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.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/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SourceImpl.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SourceImpl.java new file mode 100644 index 0000000000..81e39a9fe9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SourceImpl.java @@ -0,0 +1,63 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.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/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/StatelessComponent.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/StatelessComponent.java new file mode 100644 index 0000000000..89d0be7a53 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/StatelessComponent.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.core.mock.component; + +import org.osoa.sca.annotations.Scope; + +/** + * @version $Rev$ $Date$ + */ +@Scope("STATELESS") +public interface StatelessComponent { + +} + diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/StatelessComponentImpl.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/StatelessComponentImpl.java new file mode 100644 index 0000000000..28eb28e76d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/StatelessComponentImpl.java @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.core.mock.component; + +/** + * @version $Rev$ $Date$ + */ +public class StatelessComponentImpl implements + StatelessComponent { + +} diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/Target.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/Target.java new file mode 100644 index 0000000000..5e85ed48b0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/Target.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.core.mock.component; + +/** + * Implementations are used in wiring tests + * + * @version $Rev$ $Date$ + */ +public interface Target { + + String getString(); + + void setString(String val); +} + diff --git a/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/TargetImpl.java b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/TargetImpl.java new file mode 100644 index 0000000000..169b38a8d0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/TargetImpl.java @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.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; + } + +} |