Repository: cxf Updated Branches: refs/heads/3.0.x-fixes 709ad76d6 -> 8306873ae
Fixing LDAP tests Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/8306873a Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/8306873a Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/8306873a Branch: refs/heads/3.0.x-fixes Commit: 8306873aec6de5240c8bdefb5c61e9a5733ae03b Parents: 5d25cac Author: Colm O hEigeartaigh <cohei...@apache.org> Authored: Fri Dec 5 14:28:58 2014 +0000 Committer: Colm O hEigeartaigh <cohei...@apache.org> Committed: Fri Dec 5 14:29:58 2014 +0000 ---------------------------------------------------------------------- .../systest/kerberos/ldap/LDAPClaimsTest.java | 62 -------------------- systests/kerberos/src/test/resources/ldap.xml | 16 ----- 2 files changed, 78 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/8306873a/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/ldap/LDAPClaimsTest.java ---------------------------------------------------------------------- diff --git a/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/ldap/LDAPClaimsTest.java b/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/ldap/LDAPClaimsTest.java index 0d4f6de..bfc242a 100644 --- a/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/ldap/LDAPClaimsTest.java +++ b/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/ldap/LDAPClaimsTest.java @@ -167,68 +167,6 @@ public class LDAPClaimsTest extends AbstractLdapTestUnit { } } -<<<<<<< HEAD:services/sts/sts-core/src/test/java/org/apache/cxf/sts/ldap/LDAPClaimsTest.java -======= - @org.junit.Test - public void testMultiUserBaseDNs() throws Exception { - LdapClaimsHandler claimsHandler = (LdapClaimsHandler)appContext.getBean("testClaimsHandlerMultipleUserBaseDNs"); - - String user = props.getProperty("claimUser"); - Assert.notNull(user, "Property 'claimUser' not configured"); - String otherUser = props.getProperty("otherClaimUser"); - Assert.notNull(otherUser, "Property 'otherClaimUser' not configured"); - - ClaimCollection requestedClaims = createRequestClaimCollection(); - - List<URI> expectedClaims = new ArrayList<URI>(); - expectedClaims.add(ClaimTypes.FIRSTNAME); - expectedClaims.add(ClaimTypes.LASTNAME); - expectedClaims.add(ClaimTypes.EMAILADDRESS); - - // First user - ClaimsParameters params = new ClaimsParameters(); - params.setPrincipal(new CustomTokenPrincipal(user)); - ProcessedClaimCollection retrievedClaims = - claimsHandler.retrieveClaimValues(requestedClaims, params); - - Assert.isTrue( - retrievedClaims.size() == expectedClaims.size(), - "Retrieved number of claims [" + retrievedClaims.size() - + "] doesn't match with expected [" + expectedClaims.size() + "]" - ); - - for (ProcessedClaim c : retrievedClaims) { - if (expectedClaims.contains(c.getClaimType())) { - expectedClaims.remove(c.getClaimType()); - } else { - Assert.isTrue(false, "Claim '" + c.getClaimType() + "' not requested"); - } - } - - // Second user - params.setPrincipal(new CustomTokenPrincipal(otherUser)); - retrievedClaims = claimsHandler.retrieveClaimValues(requestedClaims, params); - - expectedClaims.add(ClaimTypes.FIRSTNAME); - expectedClaims.add(ClaimTypes.LASTNAME); - expectedClaims.add(ClaimTypes.EMAILADDRESS); - - Assert.isTrue( - retrievedClaims.size() == expectedClaims.size(), - "Retrieved number of claims [" + retrievedClaims.size() - + "] doesn't match with expected [" + expectedClaims.size() + "]" - ); - - for (ProcessedClaim c : retrievedClaims) { - if (expectedClaims.contains(c.getClaimType())) { - expectedClaims.remove(c.getClaimType()); - } else { - Assert.isTrue(false, "Claim '" + c.getClaimType() + "' not requested"); - } - } - } ->>>>>>> 7bf10fc... Moving LDAP tests to new integration module + re-enabling:systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/ldap/LDAPClaimsTest.java - @org.junit.Test(expected = STSException.class) public void testRetrieveClaimsWithUnsupportedMandatoryClaimType() throws Exception { LdapClaimsHandler claimsHandler = (LdapClaimsHandler)appContext.getBean("testClaimsHandler"); http://git-wip-us.apache.org/repos/asf/cxf/blob/8306873a/systests/kerberos/src/test/resources/ldap.xml ---------------------------------------------------------------------- diff --git a/systests/kerberos/src/test/resources/ldap.xml b/systests/kerberos/src/test/resources/ldap.xml index 41885ba..8c137b4 100644 --- a/systests/kerberos/src/test/resources/ldap.xml +++ b/systests/kerberos/src/test/resources/ldap.xml @@ -35,24 +35,8 @@ <entry key="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/country" value="c"/> </util:map> <bean id="testClaimsHandler" class="org.apache.cxf.sts.claims.LdapClaimsHandler"> -<<<<<<< HEAD:services/sts/sts-core/src/test/resources/ldap.xml - <property name="ldapTemplate" ref="ldapTemplate"/> - <property name="claimsLdapAttributeMapping" ref="claimsToLdapAttributeMapping"/> - <property name="userBaseDN" value="OU=users,DC=emea,DC=mycompany,DC=com"/> -======= <property name="ldapTemplate" ref="ldapTemplate" /> <property name="claimsLdapAttributeMapping" ref="claimsToLdapAttributeMapping" /> <property name="userBaseDN" value="OU=users,DC=example,DC=com" /> </bean> - <bean id="testClaimsHandlerMultipleUserBaseDNs" class="org.apache.cxf.sts.claims.LdapClaimsHandler"> - <property name="ldapTemplate" ref="ldapTemplate" /> - <property name="claimsLdapAttributeMapping" ref="claimsToLdapAttributeMapping" /> - <property name="userBaseDNs"> - <list> - <value>OU=users,DC=example,DC=com</value> - <value>OU=other-users,DC=example,DC=com</value> - </list> - </property> ->>>>>>> 7bf10fc... Moving LDAP tests to new integration module + re-enabling:systests/kerberos/src/test/resources/ldap.xml - </bean> </beans>