summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.x/itest
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2008-11-30 13:46:51 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2008-11-30 13:46:51 +0000
commitc8f58fe2afa3f2f3bdf86846a48cb5a6dd7d503b (patch)
treeb96a10cd0bf623da0612ceff196be9315c7da2e8 /branches/sca-java-1.x/itest
parentb30b676df944c0444a7a6ec8df26f8208a01e896 (diff)
Tidy jms policy implementations to remove code from the binding and put it into binding wire interceptors. The implication is that the JMS runtime no longer depends on the JMS policy package. Also get rid of split packages in wire format and operation selector packages. Add a binding context to the Tuscany message so that you don't have to keep finding it in the message header.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@721811 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/itest')
-rw-r--r--branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/README2
-rw-r--r--branches/sca-java-1.x/itest/jms-format/src/main/resources/jmsmessage/helloworld.composite2
-rw-r--r--branches/sca-java-1.x/itest/jms-format/src/main/resources/jmstextxml/helloworld.composite4
-rw-r--r--branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSBytesTestCase.java2
-rw-r--r--branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSDelimitedTestCase.java4
-rw-r--r--branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSMessageTestCase.java2
-rw-r--r--branches/sca-java-1.x/itest/jms/pom.xml7
-rw-r--r--branches/sca-java-1.x/itest/policy-security-token/pom.xml2
-rw-r--r--branches/sca-java-1.x/itest/policy-security-token/src/main/java/helloworld/HelloWorldClientImpl.java3
-rw-r--r--branches/sca-java-1.x/itest/policy-security-token/src/main/java/helloworld/HelloWorldServiceImpl.java10
-rw-r--r--branches/sca-java-1.x/itest/policy-security-token/src/test/java/org/apache/tuscany/sca/itest/TokenAuthTestCase.java4
11 files changed, 32 insertions, 10 deletions
diff --git a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/README b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/README
index d266735183..81ea3edffb 100644
--- a/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/README
+++ b/branches/sca-java-1.x/itest/jms-format/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/README
@@ -1,3 +1,3 @@
-This test uses an SCA composite to fake a scenario where the reference is and SCA reference but the
+This test uses an SCA composite to fake a scenario where the reference is an SCA reference but the
service is a non-SCA JMS endpoint. This gives us the opportunity to play about with the interface
configuration at the reference to see how the contents of the JMS message can be controlled. \ No newline at end of file
diff --git a/branches/sca-java-1.x/itest/jms-format/src/main/resources/jmsmessage/helloworld.composite b/branches/sca-java-1.x/itest/jms-format/src/main/resources/jmsmessage/helloworld.composite
index f487996324..6202e947f5 100644
--- a/branches/sca-java-1.x/itest/jms-format/src/main/resources/jmsmessage/helloworld.composite
+++ b/branches/sca-java-1.x/itest/jms-format/src/main/resources/jmsmessage/helloworld.composite
@@ -20,6 +20,7 @@
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
targetNamespace="http://helloworld"
xmlns:hw="http://helloworld"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
name="helloworld">
<component name="HelloWorldReferenceComponent">
@@ -29,6 +30,7 @@
<interface.java interface="org.apache.tuscany.sca.binding.jms.format.jmsmessage.helloworld.HelloWorldServiceReferenceSide"/>
<binding.jms>
<destination name="HelloWorldService1"/>
+ <tuscany:wireFormat.jmsText/>
</binding.jms>
</reference>
</component>
diff --git a/branches/sca-java-1.x/itest/jms-format/src/main/resources/jmstextxml/helloworld.composite b/branches/sca-java-1.x/itest/jms-format/src/main/resources/jmstextxml/helloworld.composite
index 07507e0ebe..0d0b5aef65 100644
--- a/branches/sca-java-1.x/itest/jms-format/src/main/resources/jmstextxml/helloworld.composite
+++ b/branches/sca-java-1.x/itest/jms-format/src/main/resources/jmstextxml/helloworld.composite
@@ -18,9 +18,9 @@
* under the License.
-->
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://helloworld"
+ targetNamespace="http://helloworld"
xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- xmlns:hw="http://helloworld"
+ xmlns:hw="http://helloworld"
name="helloworld">
<component name="HelloWorldReferenceComponent">
diff --git a/branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSBytesTestCase.java b/branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSBytesTestCase.java
index 3d40d4fa85..a242206080 100644
--- a/branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSBytesTestCase.java
+++ b/branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSBytesTestCase.java
@@ -51,7 +51,7 @@ public class FormatJMSBytesTestCase {
HelloWorldReference helloWorldService = ((SCAClient)node).getService(HelloWorldReference.class, "HelloWorldReferenceComponent");
System.out.println(helloWorldService.getGreetings("Fred Bloggs"));
- //assertEquals("Hello Fred Bloggs", helloWorldService.getGreetings("Fred Bloggs"));
+ assertEquals("Hello Fred Bloggs", helloWorldService.getGreetings("Fred Bloggs"));
}
diff --git a/branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSDelimitedTestCase.java b/branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSDelimitedTestCase.java
index 90b74146e5..9f365ba3c1 100644
--- a/branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSDelimitedTestCase.java
+++ b/branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSDelimitedTestCase.java
@@ -47,6 +47,10 @@ public class FormatJMSDelimitedTestCase {
node.start();
}
+ /**
+ * The delimited wrie format is not yet implemented
+ *
+ */
@Test
@Ignore
public void testHelloWorldCreate() throws Exception {
diff --git a/branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSMessageTestCase.java b/branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSMessageTestCase.java
index 18955df933..c617a984ef 100644
--- a/branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSMessageTestCase.java
+++ b/branches/sca-java-1.x/itest/jms-format/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSMessageTestCase.java
@@ -51,7 +51,7 @@ public class FormatJMSMessageTestCase {
HelloWorldReference helloWorldService = ((SCAClient)node).getService(HelloWorldReference.class, "HelloWorldReferenceComponent");
System.out.println(helloWorldService.getGreetings("Fred Bloggs"));
- //assertEquals("Hello Fred Bloggs", helloWorldService.getGreetings("Fred Bloggs"));
+ assertEquals("Hello Fred Bloggs", helloWorldService.getGreetings("Fred Bloggs"));
}
diff --git a/branches/sca-java-1.x/itest/jms/pom.xml b/branches/sca-java-1.x/itest/jms/pom.xml
index a5e0d7f063..a7aaf5a910 100644
--- a/branches/sca-java-1.x/itest/jms/pom.xml
+++ b/branches/sca-java-1.x/itest/jms/pom.xml
@@ -56,6 +56,13 @@
<version>1.4-SNAPSHOT</version>
<scope>runtime</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jms-policy</artifactId>
+ <version>1.4-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
diff --git a/branches/sca-java-1.x/itest/policy-security-token/pom.xml b/branches/sca-java-1.x/itest/policy-security-token/pom.xml
index d15d737ff4..9e18c7d1d9 100644
--- a/branches/sca-java-1.x/itest/policy-security-token/pom.xml
+++ b/branches/sca-java-1.x/itest/policy-security-token/pom.xml
@@ -65,7 +65,7 @@
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
+ <artifactId>tuscany-binding-jms-policy</artifactId>
<version>1.4-SNAPSHOT</version>
</dependency>
diff --git a/branches/sca-java-1.x/itest/policy-security-token/src/main/java/helloworld/HelloWorldClientImpl.java b/branches/sca-java-1.x/itest/policy-security-token/src/main/java/helloworld/HelloWorldClientImpl.java
index 55b798edbe..769be60538 100644
--- a/branches/sca-java-1.x/itest/policy-security-token/src/main/java/helloworld/HelloWorldClientImpl.java
+++ b/branches/sca-java-1.x/itest/policy-security-token/src/main/java/helloworld/HelloWorldClientImpl.java
@@ -34,8 +34,7 @@ public class HelloWorldClientImpl implements HelloWorldService {
protected HelloWorldService helloworldJMS;
public String getGreetings(String name) {
- return "Hello " +
- helloworldWS.getGreetings(name) +
+ return helloworldWS.getGreetings(name) +
helloworldJMS.getGreetings(name);
}
diff --git a/branches/sca-java-1.x/itest/policy-security-token/src/main/java/helloworld/HelloWorldServiceImpl.java b/branches/sca-java-1.x/itest/policy-security-token/src/main/java/helloworld/HelloWorldServiceImpl.java
index 6372570d1f..60c07f6f73 100644
--- a/branches/sca-java-1.x/itest/policy-security-token/src/main/java/helloworld/HelloWorldServiceImpl.java
+++ b/branches/sca-java-1.x/itest/policy-security-token/src/main/java/helloworld/HelloWorldServiceImpl.java
@@ -18,6 +18,8 @@
*/
package helloworld;
+import java.security.Principal;
+
import javax.security.auth.Subject;
import org.osoa.sca.RequestContext;
@@ -39,7 +41,13 @@ public class HelloWorldServiceImpl implements HelloWorldService {
if (subject == null){
return "Hello " + name + " null subject";
} else {
- return "Hello " + name + " " + subject.toString();
+ String response = "Hello " + name + " ";
+
+ for (Principal principal : subject.getPrincipals()){
+ response += principal.getName();
+ }
+
+ return response + " ";
}
}
diff --git a/branches/sca-java-1.x/itest/policy-security-token/src/test/java/org/apache/tuscany/sca/itest/TokenAuthTestCase.java b/branches/sca-java-1.x/itest/policy-security-token/src/test/java/org/apache/tuscany/sca/itest/TokenAuthTestCase.java
index 167e45738f..b0ae00b639 100644
--- a/branches/sca-java-1.x/itest/policy-security-token/src/test/java/org/apache/tuscany/sca/itest/TokenAuthTestCase.java
+++ b/branches/sca-java-1.x/itest/policy-security-token/src/test/java/org/apache/tuscany/sca/itest/TokenAuthTestCase.java
@@ -65,7 +65,9 @@ public class TokenAuthTestCase {
//@Ignore
public void testViaSCAClient() {
String greetings = service.getGreetings("Simon");
- System.out.println(">>>" + greetings);
+ System.out.println("Tokens reported at component context security subject = ");
+ System.out.println(greetings);
+ Assert.assertEquals("Hello Simon SomeWSAuthorizationToken Hello Simon DummyTokenID ", greetings);
}
@Test