From 88b043b538e64e6476435163e5e59be68c77751e Mon Sep 17 00:00:00 2001 From: slaws Date: Thu, 26 Feb 2009 11:30:18 +0000 Subject: TUSCANY-2868 - Add more assembly/component test cases. Thanks for the patch Jun Guo git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@748094 13f79535-47bb-0310-9956-ffa450edef68 --- .../assembly/component/property/ServiceA.java | 32 +++++++++++++ .../assembly/component/property/ServiceAImpl.java | 51 ++++++++++++++++++++ .../assembly/component/property/ServiceB.java | 32 +++++++++++++ .../assembly/component/property/ServiceBImpl.java | 56 ++++++++++++++++++++++ .../assembly/component/property/ServiceC.java | 29 +++++++++++ .../assembly/component/property/ServiceCImpl.java | 44 +++++++++++++++++ 6 files changed, 244 insertions(+) create mode 100644 branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/property/ServiceA.java create mode 100644 branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/property/ServiceAImpl.java create mode 100644 branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/property/ServiceB.java create mode 100644 branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/property/ServiceBImpl.java create mode 100644 branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/property/ServiceC.java create mode 100644 branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/property/ServiceCImpl.java (limited to 'branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany') diff --git a/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/property/ServiceA.java b/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/property/ServiceA.java new file mode 100644 index 0000000000..d29eb41dfb --- /dev/null +++ b/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/property/ServiceA.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.vtest.assembly.component.property; + +/** + * + * + */ +public interface ServiceA { + + String getServiceName() ; + + String getStrProperty() ; + + Object getObjProperty() ; +} diff --git a/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/property/ServiceAImpl.java b/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/property/ServiceAImpl.java new file mode 100644 index 0000000000..dfd613d798 --- /dev/null +++ b/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/property/ServiceAImpl.java @@ -0,0 +1,51 @@ +/* + * 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.vtest.assembly.component.property; + +import org.osoa.sca.annotations.Property; +import org.osoa.sca.annotations.Service; + +/** + * + * + */ +@Service(ServiceA.class) +public class ServiceAImpl implements ServiceA{ + + @Property + protected String strProperty ; + + @Property + protected Object objProperty ; + + + public String getServiceName() { + return "AService" ; + } + + public String getStrProperty() { + + return strProperty ; + } + + public Object getObjProperty() { + + return objProperty ; + } +} diff --git a/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/property/ServiceB.java b/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/property/ServiceB.java new file mode 100644 index 0000000000..d57894527d --- /dev/null +++ b/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/property/ServiceB.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.vtest.assembly.component.property; + +import org.osoa.sca.annotations.Property; + +/** + * + * + */ +public interface ServiceB { + + Object getObjProperty() ; + String getStrProperty() ; + int getIntProperty() ; +} diff --git a/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/property/ServiceBImpl.java b/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/property/ServiceBImpl.java new file mode 100644 index 0000000000..f202906d7c --- /dev/null +++ b/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/property/ServiceBImpl.java @@ -0,0 +1,56 @@ +/* + * 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.vtest.assembly.component.property; + +import org.osoa.sca.annotations.Property; +import org.osoa.sca.annotations.Service; + +/** + * + * + */ +@Service(ServiceB.class) +public class ServiceBImpl implements ServiceB{ + + @Property + protected Object objProperty ; + + @Property + protected String strProperty ; + +// @Property +// protected int intProperty ; + + public Object getObjProperty() { + return objProperty ; + } + + public String getStrProperty() { + + return strProperty ; + } + + public int getIntProperty() { + + return 100 ; +// return intProperty ; + } + +} diff --git a/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/property/ServiceC.java b/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/property/ServiceC.java new file mode 100644 index 0000000000..1eefede818 --- /dev/null +++ b/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/property/ServiceC.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.vtest.assembly.component.property; + +/** + * + * + */ +public interface ServiceC { + + String getStrProperty() ; + Object getObjProperty() ; +} diff --git a/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/property/ServiceCImpl.java b/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/property/ServiceCImpl.java new file mode 100644 index 0000000000..bfbc1848c2 --- /dev/null +++ b/branches/sca-java-1.x/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/property/ServiceCImpl.java @@ -0,0 +1,44 @@ +/* + * 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.vtest.assembly.component.property; + +import org.osoa.sca.annotations.Property; +import org.osoa.sca.annotations.Service; + +/** + * + * + */ +@Service(ServiceC.class) +public class ServiceCImpl implements ServiceC{ + + @Property + protected String strProperty ; + + @Property(name="objProperty") + protected String objProperty ; + + public String getStrProperty() { + return strProperty ; + } + + public Object getObjProperty() { + return objProperty ; + } +} -- cgit v1.2.3