You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by gi...@apache.org on 2012/03/22 21:22:30 UTC
svn commit: r1304029 [3/3] - in /webservices/wss4j/branches/swssf:
rampart-policy/src/main/java/org/apache/ws/secpolicy/
streaming-ws-policy/src/main/java/org/swssf/policy/
streaming-ws-policy/src/main/java/org/swssf/policy/assertionStates/
streaming-w...
Propchange: webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/SupportingTokensTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/WSP13SpecTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/WSP13SpecTest.java?rev=1304029&r1=1304028&r2=1304029&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/WSP13SpecTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/WSP13SpecTest.java Thu Mar 22 20:22:29 2012
@@ -41,10 +41,10 @@ public class WSP13SpecTest extends Abstr
public Object[][] ignoreEventsTransportBindingC11a() {
return new Object[][]{
{null, null, null},
- {SecurityEvent.Event.HttpsToken, 1, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}HttpsToken not satisfied"},
- {SecurityEvent.Event.RequiredElement, 3, "\nElement /{http://schemas.xmlsoap.org/soap/envelope/}Envelope/{http://schemas.xmlsoap.org/soap/envelope/}Header/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp must be present"},
- {SecurityEvent.Event.UsernameToken, 4, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}UsernameToken not satisfied"},
- {SecurityEvent.Event.X509Token, 5, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}X509Token not satisfied"},
+ {SecurityEvent.Event.HttpsToken, 0, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}HttpsToken not satisfied"},
+ {SecurityEvent.Event.RequiredElement, 2, "\nElement /{http://schemas.xmlsoap.org/soap/envelope/}Envelope/{http://schemas.xmlsoap.org/soap/envelope/}Header/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp must be present"},
+ {SecurityEvent.Event.UsernameToken, 3, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}UsernameToken not satisfied"},
+ {SecurityEvent.Event.X509Token, 4, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}X509Token not satisfied"},
};
}
@@ -62,9 +62,9 @@ public class WSP13SpecTest extends Abstr
public Object[][] ignoreEventsAsymmetricBindingC31a() {
return new Object[][]{
{null, null, null},
- {SecurityEvent.Event.RequiredElement, 2, "\nElement /{http://schemas.xmlsoap.org/soap/envelope/}Envelope/{http://schemas.xmlsoap.org/soap/envelope/}Header/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp must be present"},
- {SecurityEvent.Event.X509Token, 3, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}X509Token not satisfied"},
- {SecurityEvent.Event.UsernameToken, 8, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}UsernameToken not satisfied"},
+ {SecurityEvent.Event.RequiredElement, 1, "\nElement /{http://schemas.xmlsoap.org/soap/envelope/}Envelope/{http://schemas.xmlsoap.org/soap/envelope/}Header/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp must be present"},
+ {SecurityEvent.Event.X509Token, 2, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}X509Token not satisfied"},
+ {SecurityEvent.Event.UsernameToken, 7, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}UsernameToken not satisfied"},
};
}
@@ -82,10 +82,10 @@ public class WSP13SpecTest extends Abstr
public Object[][] ignoreEventsSymmetricBindingC21a() {
return new Object[][]{
{null, null, null},
- {SecurityEvent.Event.RequiredElement, 2, "\nElement /{http://schemas.xmlsoap.org/soap/envelope/}Envelope/{http://schemas.xmlsoap.org/soap/envelope/}Header/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp must be present"},
+ {SecurityEvent.Event.RequiredElement, 1, "\nElement /{http://schemas.xmlsoap.org/soap/envelope/}Envelope/{http://schemas.xmlsoap.org/soap/envelope/}Header/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp must be present"},
{SecurityEvent.Event.SamlToken, -1, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}IssuedToken not satisfied"},
- {SecurityEvent.Event.UsernameToken, 5, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}UsernameToken not satisfied"},
- {SecurityEvent.Event.X509Token, 16, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}X509Token not satisfied"},
+ {SecurityEvent.Event.UsernameToken, 4, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}UsernameToken not satisfied"},
+ {SecurityEvent.Event.X509Token, 15, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}X509Token not satisfied"},
};
}
@@ -103,10 +103,10 @@ public class WSP13SpecTest extends Abstr
public Object[][] ignoreEventsSymmetricBindingC21b() {
return new Object[][]{
{null, null, null},
- {SecurityEvent.Event.RequiredElement, 2, "\nElement /{http://schemas.xmlsoap.org/soap/envelope/}Envelope/{http://schemas.xmlsoap.org/soap/envelope/}Header/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp must be present"},
+ {SecurityEvent.Event.RequiredElement, 1, "\nElement /{http://schemas.xmlsoap.org/soap/envelope/}Envelope/{http://schemas.xmlsoap.org/soap/envelope/}Header/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security/{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp must be present"},
{SecurityEvent.Event.SamlToken, -1, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}IssuedToken not satisfied"},
- {SecurityEvent.Event.UsernameToken, 5, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}UsernameToken not satisfied"},
- {SecurityEvent.Event.X509Token, 16, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}X509Token not satisfied"},
+ {SecurityEvent.Event.UsernameToken, 4, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}UsernameToken not satisfied"},
+ {SecurityEvent.Event.X509Token, 15, "Assertion {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}X509Token not satisfied"},
};
}
@@ -121,31 +121,40 @@ public class WSP13SpecTest extends Abstr
}
private void applyPolicy(SecurityEvent.Event ignoreEvent, Integer eventIndex, String expectedErrorMessage, PolicyEnforcer policyEnforcer, List<SecurityEvent> securityEventList) throws WSSecurityException {
- for (int i = 0; i < securityEventList.size(); i++) {
- SecurityEvent securityEvent = securityEventList.get(i);
- if (eventIndex != null && eventIndex == -1 && securityEvent.getSecurityEventType() == ignoreEvent) {
- continue;
- }
- if (eventIndex != null && i == eventIndex && securityEvent.getSecurityEventType() != ignoreEvent) {
- for (int j = 0; j < securityEventList.size(); j++) {
- System.out.println(j + " " + securityEventList.get(j));
+ try {
+ for (int i = 0; i < securityEventList.size(); i++) {
+ SecurityEvent securityEvent = securityEventList.get(i);
+ if (eventIndex != null && eventIndex == -1 && securityEvent.getSecurityEventType() == ignoreEvent) {
+ continue;
+ }
+ if (eventIndex != null && i == eventIndex && securityEvent.getSecurityEventType() != ignoreEvent) {
+ for (int j = 0; j < securityEventList.size(); j++) {
+ System.out.println(j + " " + securityEventList.get(j));
+ }
+ Assert.fail("Event at index " + eventIndex + " is not of type " + ignoreEvent);
+ }
+ if (ignoreEvent == null || i != eventIndex) {
+ policyEnforcer.registerSecurityEvent(securityEvent);
}
- Assert.fail("Event at index " + eventIndex + " is not of type " + ignoreEvent);
- }
- if (ignoreEvent == null || i != eventIndex) {
- policyEnforcer.registerSecurityEvent(securityEvent);
}
- }
- try {
+
policyEnforcer.doFinal();
if (ignoreEvent != null) {
Assert.fail("Expected WSSPolicyException");
}
} catch (WSSPolicyException e) {
+ //Exception for policyEnforcer.doFinal();
if (ignoreEvent == null) {
Assert.fail("Unexpected WSSPolicyException");
}
Assert.assertEquals(e.getMessage(), expectedErrorMessage);
+ } catch (WSSecurityException e) {
+ //Exception for policyEnforcer.registerSecurityEvent(securityEvent);
+ if (ignoreEvent == null) {
+ Assert.fail("Unexpected WSSPolicyException");
+ }
+ Assert.assertTrue(e.getCause() instanceof WSSPolicyException);
+ Assert.assertEquals(e.getCause().getMessage(), expectedErrorMessage);
}
}
}
Modified: webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/X509TokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/X509TokenTest.java?rev=1304029&r1=1304028&r2=1304029&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/X509TokenTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/X509TokenTest.java Thu Mar 22 20:22:29 2012
@@ -167,67 +167,4 @@ public class X509TokenTest extends Abstr
"X509Certificate Version 3 mismatch; Policy enforces WssX509V3Token11");
}
}
-
- @Test
- public void testSupportingTokenPolicy() throws Exception {
- String policyString =
- "<sp:SupportingTokens xmlns:sp=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702\" xmlns:sp3=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200802\">\n" +
- "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
- " <sp:X509Token>\n" +
- " <sp:IssuerName>CN=transmitter,OU=swssf,C=CH</sp:IssuerName>\n" +
- " <wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
- " <sp:RequireThumbprintReference/>\n" +
- " <sp:WssX509V3Token11/>\n" +
- " </wsp:Policy>\n" +
- " </sp:X509Token>\n" +
- " </wsp:Policy>\n" +
- "</sp:SupportingTokens>";
-
- PolicyEnforcer policyEnforcer = buildAndStartPolicyEngine(policyString);
- X509TokenSecurityEvent x509TokenSecurityEvent = new X509TokenSecurityEvent();
- SecurityToken securityToken = getX509Token(WSSConstants.X509V3Token);
- securityToken.addTokenUsage(SecurityToken.TokenUsage.SupportingTokens);
- x509TokenSecurityEvent.setSecurityToken(securityToken);
- policyEnforcer.registerSecurityEvent(x509TokenSecurityEvent);
-
- OperationSecurityEvent operationSecurityEvent = new OperationSecurityEvent();
- operationSecurityEvent.setOperation(new QName("definitions"));
- policyEnforcer.registerSecurityEvent(operationSecurityEvent);
-
- policyEnforcer.doFinal();
- }
-
- @Test
- public void testSupportingTokenPolicyNegative() throws Exception {
- String policyString =
- "<sp:SupportingTokens xmlns:sp=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702\" xmlns:sp3=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200802\">\n" +
- "<wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
- " <sp:X509Token>\n" +
- " <sp:IssuerName>CN=transmitter,OU=swssf,C=CH</sp:IssuerName>\n" +
- " <wsp:Policy xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">\n" +
- " <sp:RequireThumbprintReference/>\n" +
- " <sp:WssX509V3Token11/>\n" +
- " </wsp:Policy>\n" +
- " </sp:X509Token>\n" +
- " </wsp:Policy>\n" +
- "</sp:SupportingTokens>";
-
- PolicyEnforcer policyEnforcer = buildAndStartPolicyEngine(policyString);
- X509TokenSecurityEvent x509TokenSecurityEvent = new X509TokenSecurityEvent();
- SecurityToken securityToken = getX509Token(WSSConstants.X509V1Token);
- securityToken.addTokenUsage(SecurityToken.TokenUsage.SupportingTokens);
- x509TokenSecurityEvent.setSecurityToken(securityToken);
- policyEnforcer.registerSecurityEvent(x509TokenSecurityEvent);
-
- OperationSecurityEvent operationSecurityEvent = new OperationSecurityEvent();
- operationSecurityEvent.setOperation(new QName("definitions"));
- try {
- policyEnforcer.registerSecurityEvent(operationSecurityEvent);
- Assert.fail("Exception expected");
- } catch (WSSecurityException e) {
- Assert.assertEquals(e.getMessage(), "An error was discovered processing the <wsse:Security> header; nested exception is: \n" +
- "\torg.swssf.policy.PolicyViolationException: \n" +
- "X509Certificate Version 3 mismatch; Policy enforces WssX509V3Token11");
- }
- }
}
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/ext/WSSUtils.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/ext/WSSUtils.java?rev=1304029&r1=1304028&r2=1304029&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/ext/WSSUtils.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/ext/WSSUtils.java Thu Mar 22 20:22:29 2012
@@ -378,10 +378,10 @@ public class WSSUtils extends XMLSecurit
}
public static boolean pathMatches(List<QName> path1, List<QName> path2, boolean matchAnySoapNS, boolean lastElementWildCard) {
- if (path1 == null || path2 == null) {
+ if (path1 == null) {
throw new IllegalArgumentException("Internal error");
}
- if (path1.size() != path2.size()) {
+ if (path2 == null || path1.size() != path2.size()) {
return false;
}
Iterator<QName> path1Iterator = path1.iterator();
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/InboundWSSecurityContextImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/InboundWSSecurityContextImpl.java?rev=1304029&r1=1304028&r2=1304029&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/InboundWSSecurityContextImpl.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/InboundWSSecurityContextImpl.java Thu Mar 22 20:22:29 2012
@@ -81,14 +81,14 @@ public class InboundWSSecurityContextImp
throw new WSSecurityException(e.getMessage(), e);
}
- //forward operation security event
- forwardSecurityEvent(securityEvent);
-
Iterator<SecurityEvent> securityEventIterator = securityEventQueue.descendingIterator();
while (securityEventIterator.hasNext()) {
SecurityEvent prevSecurityEvent = securityEventIterator.next();
forwardSecurityEvent(prevSecurityEvent);
}
+ //forward operation security event
+ forwardSecurityEvent(securityEvent);
+
securityEventQueue.clear();
return;
}
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/KeyValueTokenSecurityEvent.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/KeyValueTokenSecurityEvent.java?rev=1304029&r1=1304028&r2=1304029&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/KeyValueTokenSecurityEvent.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/securityEvent/KeyValueTokenSecurityEvent.java Thu Mar 22 20:22:29 2012
@@ -24,12 +24,17 @@ package org.swssf.wss.securityEvent;
*/
public class KeyValueTokenSecurityEvent extends TokenSecurityEvent {
+ private boolean rsaKeyValue = false;
+
public KeyValueTokenSecurityEvent() {
super(Event.KeyValueToken);
}
- public boolean hasRsaKeyValue() {
- //todo
- return true;
+ public boolean isRsaKeyValue() {
+ return rsaKeyValue;
+ }
+
+ public void setRsaKeyValue(boolean rsaKeyValue) {
+ this.rsaKeyValue = rsaKeyValue;
}
}
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/DerivedKeyTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/DerivedKeyTokenTest.java?rev=1304029&r1=1304028&r2=1304029&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/DerivedKeyTokenTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/DerivedKeyTokenTest.java Thu Mar 22 20:22:29 2012
@@ -152,12 +152,12 @@ public class DerivedKeyTokenTest extends
InboundWSSec wsSecIn = WSSec.getInboundWSSec(securityProperties);
SecurityEvent.Event[] expectedSecurityEvents = new SecurityEvent.Event[]{
- SecurityEvent.Event.Operation,
SecurityEvent.Event.X509Token,
SecurityEvent.Event.EncryptedPart,
SecurityEvent.Event.AlgorithmSuite,
SecurityEvent.Event.AlgorithmSuite,
SecurityEvent.Event.AlgorithmSuite,
+ SecurityEvent.Event.Operation,
};
final TestSecurityEventListener securityEventListener = new TestSecurityEventListener(expectedSecurityEvents);
XMLStreamReader xmlStreamReader = wsSecIn.processInMessage(
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/EncDecryptionTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/EncDecryptionTest.java?rev=1304029&r1=1304028&r2=1304029&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/EncDecryptionTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/EncDecryptionTest.java Thu Mar 22 20:22:29 2012
@@ -129,11 +129,11 @@ public class EncDecryptionTest extends A
securityProperties.setCallbackHandler(new CallbackHandlerImpl());
SecurityEvent.Event[] expectedSecurityEvents = new SecurityEvent.Event[]{
- SecurityEvent.Event.Operation,
SecurityEvent.Event.X509Token,
SecurityEvent.Event.EncryptedPart,
SecurityEvent.Event.AlgorithmSuite,
SecurityEvent.Event.AlgorithmSuite,
+ SecurityEvent.Event.Operation,
};
final TestSecurityEventListener securityEventListener = new TestSecurityEventListener(expectedSecurityEvents);
@@ -245,8 +245,8 @@ public class EncDecryptionTest extends A
securityProperties.setCallbackHandler(new CallbackHandlerImpl());
SecurityEvent.Event[] expectedSecurityEvents = new SecurityEvent.Event[]{
- SecurityEvent.Event.Operation,
SecurityEvent.Event.X509Token,
+ SecurityEvent.Event.Operation,
SecurityEvent.Event.X509Token,
SecurityEvent.Event.EncryptedKeyToken,
SecurityEvent.Event.ContentEncrypted,
@@ -438,8 +438,8 @@ public class EncDecryptionTest extends A
securityProperties.setCallbackHandler(new org.swssf.wss.test.CallbackHandlerImpl());
SecurityEvent.Event[] expectedSecurityEvents = new SecurityEvent.Event[]{
- SecurityEvent.Event.Operation,
SecurityEvent.Event.X509Token,
+ SecurityEvent.Event.Operation,
SecurityEvent.Event.X509Token,
SecurityEvent.Event.EncryptedKeyToken,
SecurityEvent.Event.AlgorithmSuite,
@@ -556,11 +556,11 @@ public class EncDecryptionTest extends A
securityProperties.setCallbackHandler(new org.swssf.wss.test.CallbackHandlerImpl());
SecurityEvent.Event[] expectedSecurityEvents = new SecurityEvent.Event[]{
- SecurityEvent.Event.Operation,
SecurityEvent.Event.X509Token,
SecurityEvent.Event.AlgorithmSuite,
SecurityEvent.Event.AlgorithmSuite,
SecurityEvent.Event.EncryptedPart,
+ SecurityEvent.Event.Operation,
};
final TestSecurityEventListener securityEventListener = new TestSecurityEventListener(expectedSecurityEvents);
Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/InteroperabilityTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/InteroperabilityTest.java?rev=1304029&r1=1304028&r2=1304029&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/InteroperabilityTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/InteroperabilityTest.java Thu Mar 22 20:22:29 2012
@@ -71,7 +71,6 @@ public class InteroperabilityTest extend
securityProperties.loadDecryptionKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
SecurityEvent.Event[] expectedSecurityEvents = new SecurityEvent.Event[]{
- SecurityEvent.Event.Operation,
SecurityEvent.Event.X509Token,
SecurityEvent.Event.X509Token,
SecurityEvent.Event.SignatureValue,
@@ -87,6 +86,7 @@ public class InteroperabilityTest extend
SecurityEvent.Event.EncryptedPart,
SecurityEvent.Event.AlgorithmSuite,
SecurityEvent.Event.AlgorithmSuite,
+ SecurityEvent.Event.Operation,
};
final TestSecurityEventListener securityEventListener = new TestSecurityEventListener(expectedSecurityEvents);
Document document = doInboundSecurity(securityProperties,
@@ -126,7 +126,6 @@ public class InteroperabilityTest extend
securityProperties.loadDecryptionKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
SecurityEvent.Event[] expectedSecurityEvents = new SecurityEvent.Event[]{
- SecurityEvent.Event.Operation,
SecurityEvent.Event.X509Token,
SecurityEvent.Event.X509Token,
SecurityEvent.Event.SignatureValue,
@@ -142,6 +141,7 @@ public class InteroperabilityTest extend
SecurityEvent.Event.EncryptedPart,
SecurityEvent.Event.AlgorithmSuite,
SecurityEvent.Event.AlgorithmSuite,
+ SecurityEvent.Event.Operation,
};
final TestSecurityEventListener securityEventListener = new TestSecurityEventListener(expectedSecurityEvents);
Document document = doInboundSecurity(
@@ -182,7 +182,6 @@ public class InteroperabilityTest extend
securityProperties.loadDecryptionKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
SecurityEvent.Event[] expectedSecurityEvents = new SecurityEvent.Event[]{
- SecurityEvent.Event.Operation,
SecurityEvent.Event.X509Token,
SecurityEvent.Event.AlgorithmSuite,
SecurityEvent.Event.AlgorithmSuite,
@@ -200,6 +199,7 @@ public class InteroperabilityTest extend
SecurityEvent.Event.SignedElement,
SecurityEvent.Event.EncryptedPart,
SecurityEvent.Event.AlgorithmSuite,
+ SecurityEvent.Event.Operation,
};
final TestSecurityEventListener securityEventListener = new TestSecurityEventListener(expectedSecurityEvents);
Document document = doInboundSecurity(
@@ -276,7 +276,6 @@ public class InteroperabilityTest extend
securityProperties.loadDecryptionKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
SecurityEvent.Event[] expectedSecurityEvents = new SecurityEvent.Event[]{
- SecurityEvent.Event.Operation,
SecurityEvent.Event.X509Token,
SecurityEvent.Event.Timestamp,
SecurityEvent.Event.X509Token,
@@ -289,6 +288,7 @@ public class InteroperabilityTest extend
SecurityEvent.Event.EncryptedPart,
SecurityEvent.Event.AlgorithmSuite,
SecurityEvent.Event.AlgorithmSuite,
+ SecurityEvent.Event.Operation,
};
final TestSecurityEventListener securityEventListener = new TestSecurityEventListener(expectedSecurityEvents);
Document document = doInboundSecurity(
@@ -396,7 +396,6 @@ public class InteroperabilityTest extend
securityProperties.loadDecryptionKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
SecurityEvent.Event[] expectedSecurityEvents = new SecurityEvent.Event[]{
- SecurityEvent.Event.Operation,
SecurityEvent.Event.X509Token,
SecurityEvent.Event.X509Token,
SecurityEvent.Event.SignatureValue,
@@ -414,9 +413,10 @@ public class InteroperabilityTest extend
SecurityEvent.Event.SignedElement,
SecurityEvent.Event.EncryptedPart,
SecurityEvent.Event.AlgorithmSuite,
+ SecurityEvent.Event.Operation,
};
final TestSecurityEventListener securityEventListener = new TestSecurityEventListener(expectedSecurityEvents);
- Document document = doInboundSecurity(
+ Document document = doInboundSecurity(
securityProperties, xmlInputFactory.createXMLStreamReader(new ByteArrayInputStream(baos.toByteArray())), securityEventListener);
//read the whole stream:
@@ -610,7 +610,6 @@ public class InteroperabilityTest extend
InboundWSSec wsSecIn = WSSec.getInboundWSSec(securityProperties);
SecurityEvent.Event[] expectedSecurityEvents = new SecurityEvent.Event[]{
- SecurityEvent.Event.Operation,
SecurityEvent.Event.X509Token,
SecurityEvent.Event.X509Token,
SecurityEvent.Event.SignatureValue,
@@ -619,6 +618,7 @@ public class InteroperabilityTest extend
SecurityEvent.Event.EncryptedPart,
SecurityEvent.Event.AlgorithmSuite,
SecurityEvent.Event.AlgorithmSuite,
+ SecurityEvent.Event.Operation,
SecurityEvent.Event.AlgorithmSuite,
SecurityEvent.Event.AlgorithmSuite,
SecurityEvent.Event.SignedElement,
@@ -732,7 +732,6 @@ public class InteroperabilityTest extend
securityProperties.loadDecryptionKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
SecurityEvent.Event[] expectedSecurityEvents = new SecurityEvent.Event[]{
- SecurityEvent.Event.Operation,
SecurityEvent.Event.X509Token,
SecurityEvent.Event.X509Token,
SecurityEvent.Event.SignatureValue,
@@ -748,6 +747,7 @@ public class InteroperabilityTest extend
SecurityEvent.Event.EncryptedPart,
SecurityEvent.Event.AlgorithmSuite,
SecurityEvent.Event.AlgorithmSuite,
+ SecurityEvent.Event.Operation,
};
final TestSecurityEventListener securityEventListener = new TestSecurityEventListener(expectedSecurityEvents);
Document document = doInboundSecurity(
@@ -828,7 +828,6 @@ public class InteroperabilityTest extend
securityProperties.loadDecryptionKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
SecurityEvent.Event[] expectedSecurityEvents = new SecurityEvent.Event[]{
- SecurityEvent.Event.Operation,
SecurityEvent.Event.X509Token,
SecurityEvent.Event.X509Token,
SecurityEvent.Event.SignatureValue,
@@ -844,6 +843,7 @@ public class InteroperabilityTest extend
SecurityEvent.Event.EncryptedPart,
SecurityEvent.Event.AlgorithmSuite,
SecurityEvent.Event.AlgorithmSuite,
+ SecurityEvent.Event.Operation,
};
final TestSecurityEventListener securityEventListener = new TestSecurityEventListener(expectedSecurityEvents);
Document document = doInboundSecurity(