[jboss-cvs] Picketlink SVN: r615 - in integration-tests/trunk/picketlink-sts-tests: src/test/java/org/picketlink/test/integration/sts and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Dec 21 12:15:03 EST 2010


Author: anil.saldhana at jboss.com
Date: 2010-12-21 12:15:03 -0500 (Tue, 21 Dec 2010)
New Revision: 615

Modified:
   integration-tests/trunk/picketlink-sts-tests/.classpath
   integration-tests/trunk/picketlink-sts-tests/src/test/java/org/picketlink/test/integration/sts/PicketLinkSTSIntegrationUnitTestCase.java
Log:
fix test

Modified: integration-tests/trunk/picketlink-sts-tests/.classpath
===================================================================
--- integration-tests/trunk/picketlink-sts-tests/.classpath	2010-12-20 22:35:31 UTC (rev 614)
+++ integration-tests/trunk/picketlink-sts-tests/.classpath	2010-12-21 17:15:03 UTC (rev 615)
@@ -2,6 +2,16 @@
   <classpathentry kind="src" path="src/test/java" output="target/test-classes" including="**/*.java"/>
   <classpathentry kind="src" path="src/test/resources" output="target/test-classes" excluding="**/*.java"/>
   <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.3/servlet-api-2.3.jar" sourcepath="M2_REPO/javax/servlet/servlet-api/2.3/servlet-api-2.3-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/ant/ant/1.5/ant-1.5.jar"/>
+  <classpathentry kind="var" path="M2_REPO/ant-contrib/ant-contrib/1.0b2/ant-contrib-1.0b2.jar" sourcepath="M2_REPO/ant-contrib/ant-contrib/1.0b2/ant-contrib-1.0b2-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/httpunit/httpunit/1.7/httpunit-1.7.jar" sourcepath="M2_REPO/httpunit/httpunit/1.7/httpunit-1.7-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/rhino/js/1.6R7/js-1.6R7.jar"/>
+  <classpathentry kind="var" path="M2_REPO/jtidy/jtidy/4aug2000r7-dev/jtidy-4aug2000r7-dev.jar" sourcepath="M2_REPO/jtidy/jtidy/4aug2000r7-dev/jtidy-4aug2000r7-dev-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar" sourcepath="M2_REPO/junit/junit/4.4/junit-4.4-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/nekohtml/nekohtml/1.9.12/nekohtml-1.9.12.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/picketlink/picketlink-fed/2.0.0-SNAPSHOT/picketlink-fed-2.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/picketlink/picketlink-fed/2.0.0-SNAPSHOT/picketlink-fed-2.0.0-SNAPSHOT-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/apache-xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar"/>
   <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-  <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
 </classpath>
\ No newline at end of file

Modified: integration-tests/trunk/picketlink-sts-tests/src/test/java/org/picketlink/test/integration/sts/PicketLinkSTSIntegrationUnitTestCase.java
===================================================================
--- integration-tests/trunk/picketlink-sts-tests/src/test/java/org/picketlink/test/integration/sts/PicketLinkSTSIntegrationUnitTestCase.java	2010-12-20 22:35:31 UTC (rev 614)
+++ integration-tests/trunk/picketlink-sts-tests/src/test/java/org/picketlink/test/integration/sts/PicketLinkSTSIntegrationUnitTestCase.java	2010-12-21 17:15:03 UTC (rev 615)
@@ -44,14 +44,15 @@
 import org.picketlink.identity.federation.core.wstrust.WSTrustConstants;
 import org.picketlink.identity.federation.core.wstrust.WSTrustUtil;
 import org.picketlink.identity.federation.core.wstrust.plugins.saml.SAMLUtil;
-import org.picketlink.identity.federation.core.wstrust.wrappers.RequestSecurityToken;
-import org.picketlink.identity.federation.saml.v2.assertion.AssertionType;
-import org.picketlink.identity.federation.saml.v2.assertion.AudienceRestrictionType;
-import org.picketlink.identity.federation.saml.v2.assertion.ConditionAbstractType;
-import org.picketlink.identity.federation.saml.v2.assertion.ConditionsType;
-import org.picketlink.identity.federation.saml.v2.assertion.NameIDType;
-import org.picketlink.identity.federation.saml.v2.assertion.SubjectConfirmationDataType;
-import org.picketlink.identity.federation.saml.v2.assertion.SubjectConfirmationType;
+import org.picketlink.identity.federation.core.wstrust.wrappers.RequestSecurityToken; 
+import org.picketlink.identity.federation.newmodel.saml.v2.assertion.AssertionType;
+import org.picketlink.identity.federation.newmodel.saml.v2.assertion.AudienceRestrictionType;
+import org.picketlink.identity.federation.newmodel.saml.v2.assertion.ConditionAbstractType;
+import org.picketlink.identity.federation.newmodel.saml.v2.assertion.ConditionsType;
+import org.picketlink.identity.federation.newmodel.saml.v2.assertion.NameIDType;
+import org.picketlink.identity.federation.newmodel.saml.v2.assertion.SubjectConfirmationDataType;
+import org.picketlink.identity.federation.newmodel.saml.v2.assertion.SubjectConfirmationType;
+import org.picketlink.identity.federation.newmodel.saml.v2.assertion.SubjectType;
 import org.picketlink.identity.federation.ws.trust.BinarySecretType;
 import org.picketlink.identity.federation.ws.trust.EntropyType;
 import org.picketlink.identity.federation.ws.trust.UseKeyType;
@@ -133,9 +134,10 @@
       AssertionType assertion = this.validateSAML20Assertion(assertionElement, "admin", SAMLUtil.SAML2_BEARER_URI);
 
       // in this scenario, the conditions section should NOT have an audience restriction.
-      ConditionsType conditions = assertion.getConditions();
-      Assert.assertEquals("Unexpected restriction list size", 0, conditions
-            .getConditionOrAudienceRestrictionOrOneTimeUse().size());
+      ConditionsType conditionsType = assertion.getConditions();
+      
+      List<ConditionAbstractType> conditions = conditionsType.getConditions();
+      Assert.assertEquals("Unexpected restriction list size", 0, conditions.size());
    }
 
    /**
@@ -157,10 +159,11 @@
       AssertionType assertion = this.validateSAML20Assertion(assertionElement, "admin", SAMLUtil.SAML2_BEARER_URI);
 
       // in this scenario, the conditions section should have an audience restriction.
-      ConditionsType conditions = assertion.getConditions();
-      Assert.assertEquals("Unexpected restriction list size", 1, conditions
-            .getConditionOrAudienceRestrictionOrOneTimeUse().size());
-      ConditionAbstractType abstractType = conditions.getConditionOrAudienceRestrictionOrOneTimeUse().get(0);
+      ConditionsType conditionsType = assertion.getConditions();
+      List<ConditionAbstractType> conditions = conditionsType.getConditions();
+      
+      Assert.assertEquals("Unexpected restriction list size", 1, conditions.size());
+      ConditionAbstractType abstractType = conditions.get(0);
       Assert.assertTrue("Unexpected restriction type", abstractType instanceof AudienceRestrictionType);
       AudienceRestrictionType audienceRestriction = (AudienceRestrictionType) abstractType;
       Assert.assertEquals("Unexpected audience restriction list size", 1, audienceRestriction.getAudience().size());
@@ -198,8 +201,7 @@
 
       // we haven't specified the service endpoint URI, so no restrictions should be visible.
       ConditionsType conditions = assertion.getConditions();
-      Assert.assertEquals("Unexpected restriction list size", 0, conditions
-            .getConditionOrAudienceRestrictionOrOneTimeUse().size());
+      Assert.assertEquals("Unexpected restriction list size", 0, conditions.getConditions().size());
    }
 
    /**
@@ -229,8 +231,7 @@
       AssertionType assertion = this.validateSAML20Assertion(assertionElement, "admin",
             SAMLUtil.SAML2_HOLDER_OF_KEY_URI);
       // validate the holder of key contents.
-      SubjectConfirmationType subjConfirmation = (SubjectConfirmationType) assertion.getSubject().getContent().get(1)
-            .getValue();
+      SubjectConfirmationType subjConfirmation = (SubjectConfirmationType) assertion.getSubject().getConfirmation().get(0);
       this.validateHolderOfKeyContents(subjConfirmation, WSTrustConstants.KEY_TYPE_SYMMETRIC, null, false);
 
       // TODO: client API must allow access to the WS-Trust response for retrieval of the proof token.
@@ -276,8 +277,7 @@
       AssertionType assertion = this.validateSAML20Assertion(assertionElement, "admin",
             SAMLUtil.SAML2_HOLDER_OF_KEY_URI);
       // validate the holder of key contents.
-      SubjectConfirmationType subjConfirmation = (SubjectConfirmationType) assertion.getSubject().getContent().get(1)
-            .getValue();
+      SubjectConfirmationType subjConfirmation = (SubjectConfirmationType) assertion.getSubject().getConfirmation().get(0) ;
       this.validateHolderOfKeyContents(subjConfirmation, WSTrustConstants.KEY_TYPE_SYMMETRIC, null, false);
 
       // TODO: client API must allow access to the WS-Trust response for retrieval of the server entropy and algorithm.
@@ -312,8 +312,7 @@
       AssertionType assertion = this.validateSAML20Assertion(assertionElement, "admin",
             SAMLUtil.SAML2_HOLDER_OF_KEY_URI);
       // validate the holder of key contents.
-      SubjectConfirmationType subjConfirmation = (SubjectConfirmationType) assertion.getSubject().getContent().get(1)
-            .getValue();
+      SubjectConfirmationType subjConfirmation = (SubjectConfirmationType) assertion.getSubject().getConfirmation().get(0);
       this.validateHolderOfKeyContents(subjConfirmation, WSTrustConstants.KEY_TYPE_PUBLIC, certificate, false);
    }
 
@@ -347,8 +346,7 @@
       AssertionType assertion = this.validateSAML20Assertion(assertionElement, "admin",
             SAMLUtil.SAML2_HOLDER_OF_KEY_URI);
       // validate the holder of key contents.
-      SubjectConfirmationType subjConfirmation = (SubjectConfirmationType) assertion.getSubject().getContent().get(1)
-            .getValue();
+      SubjectConfirmationType subjConfirmation = (SubjectConfirmationType) assertion.getSubject().getConfirmation().get(0);
       this.validateHolderOfKeyContents(subjConfirmation, WSTrustConstants.KEY_TYPE_PUBLIC, certificate, true);
    }
 
@@ -499,16 +497,14 @@
 
       // validate the assertion subject.
       Assert.assertNotNull("Unexpected null subject", assertion.getSubject());
-      List<JAXBElement<?>> content = assertion.getSubject().getContent();
-      Assert.assertNotNull("Unexpected null subject content");
-      Assert.assertEquals(2, content.size());
-      Assert.assertEquals("Unexpected type found", NameIDType.class, content.get(0).getDeclaredType());
-      NameIDType nameID = (NameIDType) content.get(0).getValue();
+      
+      SubjectType subject = assertion.getSubject();
+      NameIDType nameID = (NameIDType) subject.getSubType().getBaseID();
+      
       Assert.assertEquals("Unexpected name id qualifier", "urn:picketlink:identity-federation", nameID
             .getNameQualifier());
-      Assert.assertEquals("Unexpected name id value", assertionPrincipal, nameID.getValue());
-      Assert.assertEquals("Unexpected type found", SubjectConfirmationType.class, content.get(1).getDeclaredType());
-      SubjectConfirmationType subjType = (SubjectConfirmationType) content.get(1).getValue();
+      Assert.assertEquals("Unexpected name id value", assertionPrincipal, nameID.getValue()); 
+      SubjectConfirmationType subjType = (SubjectConfirmationType) subject.getSubType().getConfirmation().get(0);
       Assert.assertEquals("Unexpected confirmation method", confirmationMethod, subjType.getMethod());
 
       // validate the assertion conditions.
@@ -540,7 +536,8 @@
    {
       SubjectConfirmationDataType subjConfirmationDataType = subjectConfirmation.getSubjectConfirmationData();
       Assert.assertNotNull("Unexpected null subject confirmation data", subjConfirmationDataType);
-      List<Object> confirmationContent = subjConfirmationDataType.getContent();
+      throw new RuntimeException( "FIX" );
+      /*List<Object> confirmationContent = subjConfirmationDataType.getContent();
       Assert.assertEquals("Unexpected subject confirmation content size", 1, confirmationContent.size());
       JAXBElement<?> keyInfoElement = (JAXBElement<?>) confirmationContent.get(0);
       Assert.assertEquals("Unexpected subject confirmation context type", KeyInfoType.class, keyInfoElement
@@ -599,6 +596,6 @@
             Assert.assertEquals("Invalid certificate in key info", certificate, CertificateFactory.getInstance("X.509")
                   .generateCertificate(byteInputStream));
          }
-      }
+      }*/
    }
 }
\ No newline at end of file



More information about the jboss-cvs-commits mailing list