From 80fda303e635f8f72f4858daff9a3be7bae00350 Mon Sep 17 00:00:00 2001 From: rfeng Date: Thu, 5 Mar 2009 06:03:09 +0000 Subject: Organize imports and format code git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@750325 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/test/ASM_0001_Client.java | 74 ++++++++-------- .../src/main/java/test/ASM_0002_Client.java | 98 +++++++++++----------- .../src/main/java/test/ASM_0003_Client.java | 98 +++++++++++----------- .../sampleTest/src/main/java/test/Service1.java | 14 ++-- .../src/main/java/test/Service1Superset.java | 28 +++---- .../sampleTest/src/main/java/test/Service2.java | 14 ++-- .../src/main/java/test/TestException.java | 32 ++++--- .../src/main/java/test/TestInvocation.java | 20 ++--- .../src/main/java/test/service1Impl.java | 15 ++-- .../src/main/java/test/service1Impl2.java | 24 +++--- .../src/main/java/test/service1Impl3.java | 32 +++---- .../src/main/java/test/service1Impl4.java | 34 ++++---- .../src/main/java/test/service1Impl5.java | 23 ++--- .../src/main/java/test/service1Impl6.java | 29 ++++--- .../src/main/java/test/service1SupersetImpl.java | 21 ++--- .../src/main/java/test/service2Impl.java | 15 ++-- 16 files changed, 294 insertions(+), 277 deletions(-) (limited to 'java/sca/stest/sampleTest/src/main') diff --git a/java/sca/stest/sampleTest/src/main/java/test/ASM_0001_Client.java b/java/sca/stest/sampleTest/src/main/java/test/ASM_0001_Client.java index bbe76aef62..dff88ce8ca 100644 --- a/java/sca/stest/sampleTest/src/main/java/test/ASM_0001_Client.java +++ b/java/sca/stest/sampleTest/src/main/java/test/ASM_0001_Client.java @@ -20,8 +20,6 @@ package test; import org.oasisopen.sca.annotation.Service; -import test.TestInvocation; - /** * Basic test initiation class * @author MikeEdwards @@ -29,41 +27,41 @@ import test.TestInvocation; */ @Service(TestInvocation.class) public class ASM_0001_Client implements TestInvocation { - - private String testName = "ASM_0001"; - - /** - * This method is offered as a service and is - * invoked by the test client to run the test - */ - public String invokeTest( String input ) throws TestException { - String response = null; - - response = runTest( input ); - - return response; - } // end method invokeTest - - /** - * This method actually runs the test - and is subclassed by classes that run other tests. - * @param input - an input string - * @return - a response string = "ASM_0001 inputString invoked ok"; - * - */ - public String runTest( String input ){ - String response = null; - - response = testName + " " + input + " invoked ok"; - - return response; - } // end method runTest - - /** - * Sets the name of the test - * @param name - the test name - */ - protected void setTestName( String name ) { - testName = name; - } + + private String testName = "ASM_0001"; + + /** + * This method is offered as a service and is + * invoked by the test client to run the test + */ + public String invokeTest(String input) throws TestException { + String response = null; + + response = runTest(input); + + return response; + } // end method invokeTest + + /** + * This method actually runs the test - and is subclassed by classes that run other tests. + * @param input - an input string + * @return - a response string = "ASM_0001 inputString invoked ok"; + * + */ + public String runTest(String input) { + String response = null; + + response = testName + " " + input + " invoked ok"; + + return response; + } // end method runTest + + /** + * Sets the name of the test + * @param name - the test name + */ + protected void setTestName(String name) { + testName = name; + } } // diff --git a/java/sca/stest/sampleTest/src/main/java/test/ASM_0002_Client.java b/java/sca/stest/sampleTest/src/main/java/test/ASM_0002_Client.java index 156f93bb1e..673dde9590 100644 --- a/java/sca/stest/sampleTest/src/main/java/test/ASM_0002_Client.java +++ b/java/sca/stest/sampleTest/src/main/java/test/ASM_0002_Client.java @@ -18,11 +18,9 @@ */ package test; -import org.oasisopen.sca.annotation.Service; -import org.oasisopen.sca.annotation.Reference; import org.oasisopen.sca.annotation.Property; - -import test.TestInvocation; +import org.oasisopen.sca.annotation.Reference; +import org.oasisopen.sca.annotation.Service; /** * Test initiation class with a single reference of multiplicity 1..1 @@ -31,50 +29,52 @@ import test.TestInvocation; */ @Service(TestInvocation.class) public class ASM_0002_Client implements TestInvocation { - - @Property - public String testName = "ASM_xxxx"; - - @Reference - public Service1 reference1; - - /** - * This method is offered as a service and is - * invoked by the test client to run the test - */ - public String invokeTest( String input ) throws TestException { - String response = null; - - try { - response = runTest( input ); - } catch( Exception e ) { - throw new TestException("Test service got an exception during execution: " + e.getClass().getName()+ " " + e.getMessage() ); - } // end try - return response; - } // end method invokeTest - - /** - * This method actually runs the test - and is subclassed by classes that run other tests. - * @param input - an input string - * @return - a response string = "ASM_0001 inputString invoked ok"; - * - */ - public String runTest( String input ){ - String response = null; - - String response1 = reference1.operation1(input); - - response = testName + " " + input + " " + response1; - - return response; - } // end method runTest - - /** - * Sets the name of the test - * @param name - the test name - */ - protected void setTestName( String name ) { - testName = name; - } + + @Property + public String testName = "ASM_xxxx"; + + @Reference + public Service1 reference1; + + /** + * This method is offered as a service and is + * invoked by the test client to run the test + */ + public String invokeTest(String input) throws TestException { + String response = null; + + try { + response = runTest(input); + } catch (Exception e) { + throw new TestException("Test service got an exception during execution: " + e.getClass().getName() + + " " + + e.getMessage()); + } // end try + return response; + } // end method invokeTest + + /** + * This method actually runs the test - and is subclassed by classes that run other tests. + * @param input - an input string + * @return - a response string = "ASM_0001 inputString invoked ok"; + * + */ + public String runTest(String input) { + String response = null; + + String response1 = reference1.operation1(input); + + response = testName + " " + input + " " + response1; + + return response; + } // end method runTest + + /** + * Sets the name of the test + * @param name - the test name + */ + protected void setTestName(String name) { + testName = name; + } } // diff --git a/java/sca/stest/sampleTest/src/main/java/test/ASM_0003_Client.java b/java/sca/stest/sampleTest/src/main/java/test/ASM_0003_Client.java index 7a8369644f..f6f4f1ccb8 100644 --- a/java/sca/stest/sampleTest/src/main/java/test/ASM_0003_Client.java +++ b/java/sca/stest/sampleTest/src/main/java/test/ASM_0003_Client.java @@ -18,14 +18,12 @@ */ package test; -import org.oasisopen.sca.annotation.Service; -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Property; - -import test.TestInvocation; - import java.util.List; +import org.oasisopen.sca.annotation.Property; +import org.oasisopen.sca.annotation.Reference; +import org.oasisopen.sca.annotation.Service; + /** * Basic test initiation class * @author MikeEdwards @@ -33,49 +31,49 @@ import java.util.List; */ @Service(TestInvocation.class) public class ASM_0003_Client implements TestInvocation { - - @Property - public String testName = "ASM_xxxx"; - - @Reference - public List reference1; - - /** - * This method is offered as a service and is - * invoked by the test client to run the test - */ - public String invokeTest( String input ) throws TestException { - String response = null; - - response = runTest( input ); - - return response; - } // end method invokeTest - - /** - * This method actually runs the test - and is subclassed by classes that run other tests. - * @param input - an input string - * @return - a response string = "ASM_0001 inputString invoked ok"; - * - */ - public String runTest( String input ){ - String response = ""; - - for( Service1 reference : reference1 ) { - response += reference.operation1(input); - } // end for - - response = testName + " " + input + " " + response; - - return response; - } // end method runTest - - /** - * Sets the name of the test - * @param name - the test name - */ - protected void setTestName( String name ) { - testName = name; - } + + @Property + public String testName = "ASM_xxxx"; + + @Reference + public List reference1; + + /** + * This method is offered as a service and is + * invoked by the test client to run the test + */ + public String invokeTest(String input) throws TestException { + String response = null; + + response = runTest(input); + + return response; + } // end method invokeTest + + /** + * This method actually runs the test - and is subclassed by classes that run other tests. + * @param input - an input string + * @return - a response string = "ASM_0001 inputString invoked ok"; + * + */ + public String runTest(String input) { + String response = ""; + + for (Service1 reference : reference1) { + response += reference.operation1(input); + } // end for + + response = testName + " " + input + " " + response; + + return response; + } // end method runTest + + /** + * Sets the name of the test + * @param name - the test name + */ + protected void setTestName(String name) { + testName = name; + } } // diff --git a/java/sca/stest/sampleTest/src/main/java/test/Service1.java b/java/sca/stest/sampleTest/src/main/java/test/Service1.java index ad654e4a3f..713fa40563 100644 --- a/java/sca/stest/sampleTest/src/main/java/test/Service1.java +++ b/java/sca/stest/sampleTest/src/main/java/test/Service1.java @@ -28,12 +28,12 @@ import org.oasisopen.sca.annotation.Remotable; */ @Remotable public interface Service1 { - - /** - * Method for invoking testcase service - * @param input - input parameter(s) as a String - * @return - output data as a String - */ - public String operation1( String input ); + + /** + * Method for invoking testcase service + * @param input - input parameter(s) as a String + * @return - output data as a String + */ + public String operation1(String input); } diff --git a/java/sca/stest/sampleTest/src/main/java/test/Service1Superset.java b/java/sca/stest/sampleTest/src/main/java/test/Service1Superset.java index 54a283a1a7..7d3a2f2e9f 100644 --- a/java/sca/stest/sampleTest/src/main/java/test/Service1Superset.java +++ b/java/sca/stest/sampleTest/src/main/java/test/Service1Superset.java @@ -27,19 +27,19 @@ import org.oasisopen.sca.annotation.Remotable; @Remotable public interface Service1Superset { - - /** - * Method for invoking testcase service - * @param input - input parameter(s) as a String - * @return - output data as a String - */ - public String operation1( String input ); - - /** - * A second method for invoking a testcase service - * @param input - input parameter(s) as a String - * @return - output data as a String - */ - public String operation2( String input ); + + /** + * Method for invoking testcase service + * @param input - input parameter(s) as a String + * @return - output data as a String + */ + public String operation1(String input); + + /** + * A second method for invoking a testcase service + * @param input - input parameter(s) as a String + * @return - output data as a String + */ + public String operation2(String input); } diff --git a/java/sca/stest/sampleTest/src/main/java/test/Service2.java b/java/sca/stest/sampleTest/src/main/java/test/Service2.java index 15bcb9481c..f834a4fbf1 100644 --- a/java/sca/stest/sampleTest/src/main/java/test/Service2.java +++ b/java/sca/stest/sampleTest/src/main/java/test/Service2.java @@ -24,12 +24,12 @@ package test; * */ public interface Service2 { - - /** - * Method for invoking testcase service - * @param input - input parameter(s) as a String - * @return - output data as a String - */ - public int operation2( int input ); + + /** + * Method for invoking testcase service + * @param input - input parameter(s) as a String + * @return - output data as a String + */ + public int operation2(int input); } diff --git a/java/sca/stest/sampleTest/src/main/java/test/TestException.java b/java/sca/stest/sampleTest/src/main/java/test/TestException.java index 6238a5c24b..158c5f4522 100644 --- a/java/sca/stest/sampleTest/src/main/java/test/TestException.java +++ b/java/sca/stest/sampleTest/src/main/java/test/TestException.java @@ -23,17 +23,25 @@ package test; */ public class TestException extends Exception { - /** - * Required serialVersionUID field - */ - private static final long serialVersionUID = -6978058912756564824L; - - public TestException() { super(); }; - - public TestException( String msg ) { super( msg ); }; - - public TestException( String msg, Throwable cause ) { super( msg, cause); }; - - public TestException( Throwable cause ) { super( cause ); }; + /** + * Required serialVersionUID field + */ + private static final long serialVersionUID = -6978058912756564824L; + + public TestException() { + super(); + }; + + public TestException(String msg) { + super(msg); + }; + + public TestException(String msg, Throwable cause) { + super(msg, cause); + }; + + public TestException(Throwable cause) { + super(cause); + }; } diff --git a/java/sca/stest/sampleTest/src/main/java/test/TestInvocation.java b/java/sca/stest/sampleTest/src/main/java/test/TestInvocation.java index ee42e0fe4e..e5d781095f 100644 --- a/java/sca/stest/sampleTest/src/main/java/test/TestInvocation.java +++ b/java/sca/stest/sampleTest/src/main/java/test/TestInvocation.java @@ -18,8 +18,8 @@ */ package test; -import javax.jws.WebService; import javax.jws.WebMethod; + import org.oasisopen.sca.annotation.Remotable; /** @@ -29,14 +29,14 @@ import org.oasisopen.sca.annotation.Remotable; */ @Remotable public interface TestInvocation { - - /** - * Method for invoking testcase - * @param input - input parameter(s) as a String - * @return - output data as a String - * @throws - a TestException is thrown in cases where the test service fails internally - */ - @WebMethod - public String invokeTest( String input ) throws TestException ; + + /** + * Method for invoking testcase + * @param input - input parameter(s) as a String + * @return - output data as a String + * @throws - a TestException is thrown in cases where the test service fails internally + */ + @WebMethod + public String invokeTest(String input) throws TestException; } diff --git a/java/sca/stest/sampleTest/src/main/java/test/service1Impl.java b/java/sca/stest/sampleTest/src/main/java/test/service1Impl.java index ff81bd5d54..a505f895a2 100644 --- a/java/sca/stest/sampleTest/src/main/java/test/service1Impl.java +++ b/java/sca/stest/sampleTest/src/main/java/test/service1Impl.java @@ -18,7 +18,8 @@ */ package test; -import org.oasisopen.sca.annotation.*; +import org.oasisopen.sca.annotation.Property; +import org.oasisopen.sca.annotation.Service; /** * Simple Java component implementation for business interface Service1 @@ -27,12 +28,12 @@ import org.oasisopen.sca.annotation.*; */ @Service(Service1.class) public class service1Impl implements Service1 { - - @Property - public String serviceName = "service1"; - public String operation1(String input) { - return serviceName + " operation1 invoked"; - } + @Property + public String serviceName = "service1"; + + public String operation1(String input) { + return serviceName + " operation1 invoked"; + } } diff --git a/java/sca/stest/sampleTest/src/main/java/test/service1Impl2.java b/java/sca/stest/sampleTest/src/main/java/test/service1Impl2.java index 367a92efac..0f639fbbf3 100644 --- a/java/sca/stest/sampleTest/src/main/java/test/service1Impl2.java +++ b/java/sca/stest/sampleTest/src/main/java/test/service1Impl2.java @@ -18,7 +18,9 @@ */ package test; -import org.oasisopen.sca.annotation.*; +import org.oasisopen.sca.annotation.Property; +import org.oasisopen.sca.annotation.Reference; +import org.oasisopen.sca.annotation.Service; /** * Enhanced Java component implementation for business interface Service1, @@ -29,16 +31,16 @@ import org.oasisopen.sca.annotation.*; */ @Service(Service1.class) public class service1Impl2 implements Service1 { - - @Property - public String serviceName = "service1"; - // Reference with an implied multiplicity of (1..1) since required=true is the default - @Reference - public Service1 reference1 = null; - public String operation1(String input) { - String result = reference1.operation1(input); - return serviceName + " operation1 invoked" + " " + result; - } + @Property + public String serviceName = "service1"; + // Reference with an implied multiplicity of (1..1) since required=true is the default + @Reference + public Service1 reference1 = null; + + public String operation1(String input) { + String result = reference1.operation1(input); + return serviceName + " operation1 invoked" + " " + result; + } } diff --git a/java/sca/stest/sampleTest/src/main/java/test/service1Impl3.java b/java/sca/stest/sampleTest/src/main/java/test/service1Impl3.java index 49021867c4..834dc3ddf7 100644 --- a/java/sca/stest/sampleTest/src/main/java/test/service1Impl3.java +++ b/java/sca/stest/sampleTest/src/main/java/test/service1Impl3.java @@ -18,7 +18,9 @@ */ package test; -import org.oasisopen.sca.annotation.*; +import org.oasisopen.sca.annotation.Property; +import org.oasisopen.sca.annotation.Reference; +import org.oasisopen.sca.annotation.Service; /** * Enhanced Java component implementation for business interface Service1, @@ -30,20 +32,20 @@ import org.oasisopen.sca.annotation.*; */ @Service(Service1.class) public class service1Impl3 implements Service1 { - - @Property - public String serviceName = "service1"; - // Required = true + an array -> multiplicity 1..n - @Reference(required=true) - public Service1[] reference1 = null; - public String operation1(String input) { - String result = ""; - // Call each of the references in the array, concatenating the results - for( int i=0 ; i < reference1.length; i++ ) { - result = result.concat( reference1[i].operation1(input) ); - } // end for - return serviceName + " operation1 invoked" + " " + result; - } + @Property + public String serviceName = "service1"; + // Required = true + an array -> multiplicity 1..n + @Reference(required = true) + public Service1[] reference1 = null; + + public String operation1(String input) { + String result = ""; + // Call each of the references in the array, concatenating the results + for (int i = 0; i < reference1.length; i++) { + result = result.concat(reference1[i].operation1(input)); + } // end for + return serviceName + " operation1 invoked" + " " + result; + } } diff --git a/java/sca/stest/sampleTest/src/main/java/test/service1Impl4.java b/java/sca/stest/sampleTest/src/main/java/test/service1Impl4.java index bb0226ca79..4799d777c7 100644 --- a/java/sca/stest/sampleTest/src/main/java/test/service1Impl4.java +++ b/java/sca/stest/sampleTest/src/main/java/test/service1Impl4.java @@ -18,7 +18,9 @@ */ package test; -import org.oasisopen.sca.annotation.*; +import org.oasisopen.sca.annotation.Property; +import org.oasisopen.sca.annotation.Reference; +import org.oasisopen.sca.annotation.Service; /** * Enhanced Java component implementation for business interface Service1, @@ -30,21 +32,21 @@ import org.oasisopen.sca.annotation.*; */ @Service(Service1.class) public class service1Impl4 implements Service1 { - - @Property - public String serviceName = "service1"; - // Required = false + an array -> multiplicity 0..n - @Reference(required=false) - public Service1[] reference1 = null; - public String operation1(String input) { - String result = serviceName + " operation1 invoked"; - // Call each of the references in the array, concatenating the results - for( int i=0 ; i < reference1.length; i++ ) { - result = result.concat(" "); - result = result.concat( reference1[i].operation1(input) ); - } // end for - return result; - } + @Property + public String serviceName = "service1"; + // Required = false + an array -> multiplicity 0..n + @Reference(required = false) + public Service1[] reference1 = null; + + public String operation1(String input) { + String result = serviceName + " operation1 invoked"; + // Call each of the references in the array, concatenating the results + for (int i = 0; i < reference1.length; i++) { + result = result.concat(" "); + result = result.concat(reference1[i].operation1(input)); + } // end for + return result; + } } diff --git a/java/sca/stest/sampleTest/src/main/java/test/service1Impl5.java b/java/sca/stest/sampleTest/src/main/java/test/service1Impl5.java index a7f2145643..dd69308c95 100644 --- a/java/sca/stest/sampleTest/src/main/java/test/service1Impl5.java +++ b/java/sca/stest/sampleTest/src/main/java/test/service1Impl5.java @@ -18,7 +18,8 @@ */ package test; -import org.oasisopen.sca.annotation.*; +import org.oasisopen.sca.annotation.Property; +import org.oasisopen.sca.annotation.Service; /** * Java component implementation for business interface Service1 @@ -29,16 +30,16 @@ import org.oasisopen.sca.annotation.*; */ @Service(Service1.class) public class service1Impl5 implements Service1 { - - @Property - public String serviceName = "service1"; - @Property - public String serviceData1; - @Property - public String serviceData2; - public String operation1(String input) { - return serviceName + " operation1 invoked" + serviceData1 + serviceData2; - } + @Property + public String serviceName = "service1"; + @Property + public String serviceData1; + @Property + public String serviceData2; + + public String operation1(String input) { + return serviceName + " operation1 invoked" + serviceData1 + serviceData2; + } } diff --git a/java/sca/stest/sampleTest/src/main/java/test/service1Impl6.java b/java/sca/stest/sampleTest/src/main/java/test/service1Impl6.java index 66fe13b279..1810686194 100644 --- a/java/sca/stest/sampleTest/src/main/java/test/service1Impl6.java +++ b/java/sca/stest/sampleTest/src/main/java/test/service1Impl6.java @@ -18,7 +18,9 @@ */ package test; -import org.oasisopen.sca.annotation.*; +import org.oasisopen.sca.annotation.Property; +import org.oasisopen.sca.annotation.Reference; +import org.oasisopen.sca.annotation.Service; /** * Enhanced Java component implementation for business interface Service1, @@ -30,18 +32,19 @@ import org.oasisopen.sca.annotation.*; */ @Service(Service1.class) public class service1Impl6 implements Service1 { - - @Property - public String serviceName = "service1"; - // Required = false -> multiplicity 0..1 - @Reference(required=false) - public Service1 reference1 = null; - public String operation1(String input) { - String result = serviceName + " operation1 invoked"; - // Call the reference if present - if( reference1 != null ) result = result.concat(reference1.operation1( input )); - return result; - } + @Property + public String serviceName = "service1"; + // Required = false -> multiplicity 0..1 + @Reference(required = false) + public Service1 reference1 = null; + + public String operation1(String input) { + String result = serviceName + " operation1 invoked"; + // Call the reference if present + if (reference1 != null) + result = result.concat(reference1.operation1(input)); + return result; + } } diff --git a/java/sca/stest/sampleTest/src/main/java/test/service1SupersetImpl.java b/java/sca/stest/sampleTest/src/main/java/test/service1SupersetImpl.java index e0bc3464f6..f137b7f1b4 100644 --- a/java/sca/stest/sampleTest/src/main/java/test/service1SupersetImpl.java +++ b/java/sca/stest/sampleTest/src/main/java/test/service1SupersetImpl.java @@ -18,7 +18,8 @@ */ package test; -import org.oasisopen.sca.annotation.*; +import org.oasisopen.sca.annotation.Property; +import org.oasisopen.sca.annotation.Service; /** * Simple Java component implementation for business interface Service1Superset @@ -27,16 +28,16 @@ import org.oasisopen.sca.annotation.*; */ @Service(Service1Superset.class) public class service1SupersetImpl implements Service1Superset { - - @Property - public String serviceName = "service1"; - public String operation1(String input) { - return serviceName + " operation1 invoked"; - } + @Property + public String serviceName = "service1"; - public String operation2(String input) { - return serviceName + " operation2 invoked"; - } + public String operation1(String input) { + return serviceName + " operation1 invoked"; + } + + public String operation2(String input) { + return serviceName + " operation2 invoked"; + } } diff --git a/java/sca/stest/sampleTest/src/main/java/test/service2Impl.java b/java/sca/stest/sampleTest/src/main/java/test/service2Impl.java index a05a74dc35..919b33014c 100644 --- a/java/sca/stest/sampleTest/src/main/java/test/service2Impl.java +++ b/java/sca/stest/sampleTest/src/main/java/test/service2Impl.java @@ -18,7 +18,8 @@ */ package test; -import org.oasisopen.sca.annotation.*; +import org.oasisopen.sca.annotation.Property; +import org.oasisopen.sca.annotation.Service; /** * Simple Java component implementation for business interface Service2 @@ -27,12 +28,12 @@ import org.oasisopen.sca.annotation.*; */ @Service(Service2.class) public class service2Impl implements Service2 { - - @Property - public String serviceName = "service1"; - public int operation2(int input) { - return input+1; - } + @Property + public String serviceName = "service1"; + + public int operation2(int input) { + return input + 1; + } } -- cgit v1.2.3