From bdd0a41aed7edf21ec2a65cfa17a86af2ef8c48a Mon Sep 17 00:00:00 2001 From: dims Date: Tue, 17 Jun 2008 00:23:01 +0000 Subject: Move Tuscany from Incubator to top level. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@668359 13f79535-47bb-0310-9956-ffa450edef68 --- sandbox/bdaniel/propertyTest/pom.xml | 72 ++++++++++++++++++++ .../src/main/java/testing/ABCDComponent.java | 9 +++ .../src/main/java/testing/ABCDComponentImpl.java | 36 ++++++++++ .../src/main/java/testing/ABComponent.java | 10 +++ .../src/main/java/testing/ABComponentImpl.java | 63 ++++++++++++++++++ .../src/main/java/testing/CDComponent.java | 11 ++++ .../src/main/java/testing/CDComponentImpl.java | 66 +++++++++++++++++++ .../src/main/java/testing/OverrideService.java | 5 ++ .../src/main/java/testing/OverrideServiceImpl.java | 5 ++ .../src/main/java/testing/PropertyService.java | 5 ++ .../src/main/resources/META-INF/sca/default.scdl | 69 ++++++++++++++++++++ .../main/resources/META-INF/sca/fileProperty.txt | 1 + .../src/test/java/testing/PropertyITest.java | 76 ++++++++++++++++++++++ 13 files changed, 428 insertions(+) create mode 100644 sandbox/bdaniel/propertyTest/pom.xml create mode 100644 sandbox/bdaniel/propertyTest/src/main/java/testing/ABCDComponent.java create mode 100644 sandbox/bdaniel/propertyTest/src/main/java/testing/ABCDComponentImpl.java create mode 100644 sandbox/bdaniel/propertyTest/src/main/java/testing/ABComponent.java create mode 100644 sandbox/bdaniel/propertyTest/src/main/java/testing/ABComponentImpl.java create mode 100644 sandbox/bdaniel/propertyTest/src/main/java/testing/CDComponent.java create mode 100644 sandbox/bdaniel/propertyTest/src/main/java/testing/CDComponentImpl.java create mode 100644 sandbox/bdaniel/propertyTest/src/main/java/testing/OverrideService.java create mode 100644 sandbox/bdaniel/propertyTest/src/main/java/testing/OverrideServiceImpl.java create mode 100644 sandbox/bdaniel/propertyTest/src/main/java/testing/PropertyService.java create mode 100644 sandbox/bdaniel/propertyTest/src/main/resources/META-INF/sca/default.scdl create mode 100644 sandbox/bdaniel/propertyTest/src/main/resources/META-INF/sca/fileProperty.txt create mode 100644 sandbox/bdaniel/propertyTest/src/test/java/testing/PropertyITest.java (limited to 'sandbox/bdaniel') diff --git a/sandbox/bdaniel/propertyTest/pom.xml b/sandbox/bdaniel/propertyTest/pom.xml new file mode 100644 index 0000000000..81e353a861 --- /dev/null +++ b/sandbox/bdaniel/propertyTest/pom.xml @@ -0,0 +1,72 @@ + + 4.0.0 + org.apache.tuscany.testing + propertyTest + SNAPSHOT + jar + + + + org.osoa + sca-api-r0.95 + 1.0-incubator-M2 + + + junit + junit + 3.8.1 + test + + + + install + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.5 + 1.5 + + + + org.apache.tuscany.sca.plugins + tuscany-itest-plugin + + + start + + start + + + + test + + test + + + + **/*ITest.java + + + + + stop + + stop + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + **/*ITest.java + + + + + + \ No newline at end of file diff --git a/sandbox/bdaniel/propertyTest/src/main/java/testing/ABCDComponent.java b/sandbox/bdaniel/propertyTest/src/main/java/testing/ABCDComponent.java new file mode 100644 index 0000000000..c3657adc4e --- /dev/null +++ b/sandbox/bdaniel/propertyTest/src/main/java/testing/ABCDComponent.java @@ -0,0 +1,9 @@ +package testing; + +public interface ABCDComponent { + String getA(); + String getB(); + String getC(); + String getD(); +} + diff --git a/sandbox/bdaniel/propertyTest/src/main/java/testing/ABCDComponentImpl.java b/sandbox/bdaniel/propertyTest/src/main/java/testing/ABCDComponentImpl.java new file mode 100644 index 0000000000..ef979297b5 --- /dev/null +++ b/sandbox/bdaniel/propertyTest/src/main/java/testing/ABCDComponentImpl.java @@ -0,0 +1,36 @@ +package testing; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Scope; + +@Scope("MODULE") +public class ABCDComponentImpl implements ABCDComponent { + private ABComponent abComponent; + private CDComponent cdComponent; + + @Reference + public void setAb(ABComponent component) { + this.abComponent = component; + } + + @Reference + public void setCd(CDComponent component) { + this.cdComponent = component; + } + + public String getA() { + return this.abComponent.getA(); + } + + public String getB() { + return this.abComponent.getB(); + } + + public String getC() { + return this.cdComponent.getC(); + } + + public String getD() { + return this.cdComponent.getD(); + } +} diff --git a/sandbox/bdaniel/propertyTest/src/main/java/testing/ABComponent.java b/sandbox/bdaniel/propertyTest/src/main/java/testing/ABComponent.java new file mode 100644 index 0000000000..c760883b5a --- /dev/null +++ b/sandbox/bdaniel/propertyTest/src/main/java/testing/ABComponent.java @@ -0,0 +1,10 @@ +package testing; + +public interface ABComponent { + + String getA(); + String getB(); + String getZ(); + int getIntValue(); + String getF(); +} diff --git a/sandbox/bdaniel/propertyTest/src/main/java/testing/ABComponentImpl.java b/sandbox/bdaniel/propertyTest/src/main/java/testing/ABComponentImpl.java new file mode 100644 index 0000000000..8a0de56400 --- /dev/null +++ b/sandbox/bdaniel/propertyTest/src/main/java/testing/ABComponentImpl.java @@ -0,0 +1,63 @@ +package testing; + +import org.osoa.sca.annotations.Property; + +public class ABComponentImpl implements ABComponent { + + private String aProperty; + private String bProperty; + private int intValue; + // private Collection manyProp; + private String zProperty; + private String fProperty; + + @Property(name="xpath") + public void setZProperty(final String value) { + this.zProperty = value; + } + +// @Property(name="foobar") +// public void setCollectionProperty(final Collection value) { +// this.manyProp = value; +// } + + @Property + public void setA(final String A) { + this.aProperty = A; + } + + @Property + public void setB(final String B) { + this.bProperty = B; + } + + @Property + public void setF(final String F) { + this.fProperty = F; + } + + @Property + public void setOne(final int value) { + this.intValue = value; + } + + public String getA() { + return this.aProperty; + } + + public String getB() { + return this.bProperty; + } + + public int getIntValue() { + return this.intValue; + } + + public String getZ() { + return this.zProperty; + } + + public String getF() { + return this.fProperty; + } +} diff --git a/sandbox/bdaniel/propertyTest/src/main/java/testing/CDComponent.java b/sandbox/bdaniel/propertyTest/src/main/java/testing/CDComponent.java new file mode 100644 index 0000000000..3972cad23e --- /dev/null +++ b/sandbox/bdaniel/propertyTest/src/main/java/testing/CDComponent.java @@ -0,0 +1,11 @@ +package testing; + +public interface CDComponent { + + String getC(); + String getC2(); + String getD(); + String getNoSource(); + String getFileProperty(); + int getOverrideValue(); +} diff --git a/sandbox/bdaniel/propertyTest/src/main/java/testing/CDComponentImpl.java b/sandbox/bdaniel/propertyTest/src/main/java/testing/CDComponentImpl.java new file mode 100644 index 0000000000..5dbd84de40 --- /dev/null +++ b/sandbox/bdaniel/propertyTest/src/main/java/testing/CDComponentImpl.java @@ -0,0 +1,66 @@ +package testing; + +import org.osoa.sca.annotations.Property; + +public class CDComponentImpl implements CDComponent { + + private String cProperty; + private String dProperty; + private String nosource; + private String fileProperty; + private int overrideNumber; + private String cProperty2; + + @Property(name="nonFileProperty") + public void setC2(final String value) { + this.cProperty2 = value; + } + @Property(name="two") + public void setOverrideNumber(final int value) { + this.overrideNumber = value; + } + + @Property(name="fileProperty") + public void setFileProp(final String value) { + this.fileProperty = value; + } + @Property + public void setC(final String C) { + this.cProperty = C; + } + + @Property + public void setD(final String D) { + this.dProperty = D; + } + + @Property + public void setNosource(final String value) { + this.nosource = value; + } + + public String getFileProperty() { + return this.fileProperty; + } + + public String getC() { + return this.cProperty; + } + + public String getC2() { + return this.cProperty2; + } + + public String getD() { + return this.dProperty; + } + + public String getNoSource() { + return this.nosource; + } + + public int getOverrideValue() { + return this.overrideNumber; + } +} + diff --git a/sandbox/bdaniel/propertyTest/src/main/java/testing/OverrideService.java b/sandbox/bdaniel/propertyTest/src/main/java/testing/OverrideService.java new file mode 100644 index 0000000000..25e71f11f0 --- /dev/null +++ b/sandbox/bdaniel/propertyTest/src/main/java/testing/OverrideService.java @@ -0,0 +1,5 @@ +package testing; + +public interface OverrideService { + +} diff --git a/sandbox/bdaniel/propertyTest/src/main/java/testing/OverrideServiceImpl.java b/sandbox/bdaniel/propertyTest/src/main/java/testing/OverrideServiceImpl.java new file mode 100644 index 0000000000..3a5f3e11c2 --- /dev/null +++ b/sandbox/bdaniel/propertyTest/src/main/java/testing/OverrideServiceImpl.java @@ -0,0 +1,5 @@ +package testing; + +public class OverrideServiceImpl implements OverrideService { + +} diff --git a/sandbox/bdaniel/propertyTest/src/main/java/testing/PropertyService.java b/sandbox/bdaniel/propertyTest/src/main/java/testing/PropertyService.java new file mode 100644 index 0000000000..4e81982819 --- /dev/null +++ b/sandbox/bdaniel/propertyTest/src/main/java/testing/PropertyService.java @@ -0,0 +1,5 @@ +package testing; + +public interface PropertyService { + +} diff --git a/sandbox/bdaniel/propertyTest/src/main/resources/META-INF/sca/default.scdl b/sandbox/bdaniel/propertyTest/src/main/resources/META-INF/sca/default.scdl new file mode 100644 index 0000000000..00340fc1f9 --- /dev/null +++ b/sandbox/bdaniel/propertyTest/src/main/resources/META-INF/sca/default.scdl @@ -0,0 +1,69 @@ + + + + + + + 1 + + + a + b + c + d + + y + z + + + + + + + ABComponent + CDComponent + + + + + + + f + + + + + + + + + aValue + + + 2 + + + + diff --git a/sandbox/bdaniel/propertyTest/src/main/resources/META-INF/sca/fileProperty.txt b/sandbox/bdaniel/propertyTest/src/main/resources/META-INF/sca/fileProperty.txt new file mode 100644 index 0000000000..4e22b1bac4 --- /dev/null +++ b/sandbox/bdaniel/propertyTest/src/main/resources/META-INF/sca/fileProperty.txt @@ -0,0 +1 @@ +fileValue diff --git a/sandbox/bdaniel/propertyTest/src/test/java/testing/PropertyITest.java b/sandbox/bdaniel/propertyTest/src/test/java/testing/PropertyITest.java new file mode 100644 index 0000000000..79e58229a7 --- /dev/null +++ b/sandbox/bdaniel/propertyTest/src/test/java/testing/PropertyITest.java @@ -0,0 +1,76 @@ +package testing; + +import junit.framework.TestCase; + +import org.osoa.sca.CurrentCompositeContext; + +public class PropertyITest extends TestCase { + private ABComponent abService; + private CDComponent cdService; + private ABCDComponent abcdService; + // private PropertyService propertyService; + + + public void testA() { + assertEquals("a", abService.getA()); + } + + public void testB() { + assertEquals("b", abService.getB()); + } + + public void testC() { + assertEquals("c", cdService.getC()); + } + + public void testC2() { + assertEquals("c", cdService.getC2()); + } + public void testD() { + assertEquals("d", cdService.getD()); + } + + public void testF() { + assertEquals("a", abService.getF()); + } + + public void testZ() { + assertEquals("z", abService.getZ()); + } + + + public void testIntValue() { + assertEquals(1, abService.getIntValue()); + } + + public void testDefaultValue() { + assertEquals(1, abService.getIntValue()); + } + + public void testDefaultValueOverride() { + assertEquals(1, cdService.getOverrideValue()); + } + + public void testNoSource() { + assertEquals("aValue", cdService.getNoSource()); + } + + public void testFileProperty() { + assertEquals("fileValue", cdService.getFileProperty()); + } + + public void testABCD() { + assertEquals("a", abcdService.getA()); + assertEquals("b", abcdService.getB()); + assertEquals("c", abcdService.getC()); + assertEquals("d", abcdService.getD()); + } + + protected void setUp() throws Exception { + super.setUp(); + abService = CurrentCompositeContext.getContext().locateService(ABComponent.class, "ABComponent"); + cdService = CurrentCompositeContext.getContext().locateService(CDComponent.class, "CDComponent"); + abcdService = CurrentCompositeContext.getContext().locateService(ABCDComponent.class, "ABCDComponent"); + // propertyService = CurrentCompositeContext.getContext().locateService(PropertyService.class, "PropertyService"); + } +} -- cgit v1.2.3