diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2008-11-30 13:46:51 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2008-11-30 13:46:51 +0000 |
commit | c8f58fe2afa3f2f3bdf86846a48cb5a6dd7d503b (patch) | |
tree | b96a10cd0bf623da0612ceff196be9315c7da2e8 /branches/sca-java-1.x/itest/policy-security-token/src | |
parent | b30b676df944c0444a7a6ec8df26f8208a01e896 (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/policy-security-token/src')
3 files changed, 13 insertions, 4 deletions
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 |