Author: bdaw
Date: 2009-05-09 07:10:49 -0400 (Sat, 09 May 2009)
New Revision: 485
Added:
idm/trunk/idm-cache/
idm/trunk/idm-cache/pom.xml
idm/trunk/idm-cache/src/
idm/trunk/idm-cache/src/main/
idm/trunk/idm-cache/src/main/java/
idm/trunk/idm-cache/src/main/java/org/
idm/trunk/idm-cache/src/main/java/org/jboss/
idm/trunk/idm-cache/src/main/java/org/jboss/identity/
idm/trunk/idm-cache/src/main/java/org/jboss/identity/idm/
idm/trunk/idm-cache/src/main/java/org/jboss/identity/idm/impl/
idm/trunk/idm-cache/src/main/resources/
idm/trunk/idm-cache/src/test/
idm/trunk/idm-cache/src/test/java/
idm/trunk/idm-cache/src/test/java/org/
idm/trunk/idm-cache/src/test/java/org/jboss/
idm/trunk/idm-cache/src/test/java/org/jboss/identity/
idm/trunk/idm-cache/src/test/java/org/jboss/identity/idm/
idm/trunk/idm-cache/src/test/resources/
idm/trunk/idm-core/src/test/resources/store-test-config.xml
idm/trunk/idm-hibernate/
idm/trunk/idm-hibernate/pom.xml
idm/trunk/idm-hibernate/src/
idm/trunk/idm-hibernate/src/main/
idm/trunk/idm-hibernate/src/main/java/
idm/trunk/idm-hibernate/src/main/java/org/
idm/trunk/idm-hibernate/src/main/java/org/jboss/
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate/
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/store/
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/store/hibernate/
idm/trunk/idm-hibernate/src/main/resources/
idm/trunk/idm-hibernate/src/test/
idm/trunk/idm-hibernate/src/test/java/
idm/trunk/idm-hibernate/src/test/java/org/
idm/trunk/idm-hibernate/src/test/java/org/jboss/
idm/trunk/idm-hibernate/src/test/java/org/jboss/identity/
idm/trunk/idm-hibernate/src/test/java/org/jboss/identity/idm/
idm/trunk/idm-hibernate/src/test/java/org/jboss/identity/idm/impl/
idm/trunk/idm-hibernate/src/test/resources/
idm/trunk/idm-ldap/
idm/trunk/idm-ldap/pom.xml
idm/trunk/idm-ldap/src/
idm/trunk/idm-ldap/src/main/
idm/trunk/idm-ldap/src/main/java/
idm/trunk/idm-ldap/src/main/java/org/
idm/trunk/idm-ldap/src/main/java/org/jboss/
idm/trunk/idm-ldap/src/main/java/org/jboss/identity/
idm/trunk/idm-ldap/src/main/java/org/jboss/identity/idm/
idm/trunk/idm-ldap/src/main/java/org/jboss/identity/idm/impl/
idm/trunk/idm-ldap/src/main/java/org/jboss/identity/idm/impl/model/
idm/trunk/idm-ldap/src/main/java/org/jboss/identity/idm/impl/model/ldap/
idm/trunk/idm-ldap/src/main/java/org/jboss/identity/idm/impl/store/
idm/trunk/idm-ldap/src/main/java/org/jboss/identity/idm/impl/store/ldap/
idm/trunk/idm-ldap/src/main/resources/
idm/trunk/idm-ldap/src/test/
idm/trunk/idm-ldap/src/test/java/
idm/trunk/idm-ldap/src/test/java/org/
idm/trunk/idm-ldap/src/test/java/org/jboss/
idm/trunk/idm-ldap/src/test/java/org/jboss/identity/
idm/trunk/idm-ldap/src/test/java/org/jboss/identity/idm/
idm/trunk/idm-ldap/src/test/resources/
idm/trunk/idm-testsuite/
idm/trunk/idm-testsuite/pom.xml
idm/trunk/idm-testsuite/src/
idm/trunk/idm-testsuite/src/main/
idm/trunk/idm-testsuite/src/main/java/
idm/trunk/idm-testsuite/src/main/java/org/
idm/trunk/idm-testsuite/src/main/resources/
idm/trunk/idm-testsuite/src/test/
idm/trunk/idm-testsuite/src/test/java/
idm/trunk/idm-testsuite/src/test/java/org/
idm/trunk/idm-testsuite/src/test/java/org/jboss/
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/HibernateTestSupport.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/IdentityTestPOJO.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/LDAPTestPOJO.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/APILDAPTestCase.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/APITestCase.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/APITestContext.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/GroupQueryTest.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/GroupTypeEnum.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/ModelTestCase.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/OrganizationLDAPTestCase.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/OrganizationTest.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/OrganizationTestCase.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/PersistenceManagerTest.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/RelationshipManagerTest.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/RoleManagerTest.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/RoleQueryTest.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/UserQueryTest.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/hibernate/
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreTestCase.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/hibernate/HibernateModelTestCase.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/ldap/
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/ldap/LDAPIdentityStoreTestCase.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/test/
idm/trunk/idm-testsuite/src/test/resources/
idm/trunk/idm-testsuite/src/test/resources/datasources/
idm/trunk/idm-testsuite/src/test/resources/hibernate-jboss-identity-classes.cfg.xml
idm/trunk/idm-testsuite/src/test/resources/hibernate-jboss-identity.cfg.xml
idm/trunk/idm-testsuite/src/test/resources/identity-config.xsd
idm/trunk/idm-testsuite/src/test/resources/ldap/
idm/trunk/idm-testsuite/src/test/resources/log4j.xml
idm/trunk/idm-testsuite/src/test/resources/opends/
idm/trunk/idm-testsuite/src/test/resources/organization-test-config.xml
idm/trunk/idm-testsuite/src/test/resources/organization-test-jboss-unit-config.xml
idm/trunk/idm-testsuite/src/test/resources/store-test-config.xml
Removed:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/model/hibernate/
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/model/ldap/
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/store/hibernate/
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/store/ldap/
idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/impl/HibernateTestSupport.java
idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/impl/IdentityTestPOJO.java
idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/impl/LDAPTestPOJO.java
idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/impl/api/
idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/impl/store/hibernate/
idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/impl/store/ldap/
idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/test/
idm/trunk/idm-core/src/test/resources/datasources/
idm/trunk/idm-core/src/test/resources/hibernate-jboss-identity-classes.cfg.xml
idm/trunk/idm-core/src/test/resources/hibernate-jboss-identity.cfg.xml
idm/trunk/idm-core/src/test/resources/ldap/
idm/trunk/idm-core/src/test/resources/log4j.xml
idm/trunk/idm-core/src/test/resources/opends/
idm/trunk/idm-core/src/test/resources/organization-test-config.xml
idm/trunk/idm-core/src/test/resources/organization-test-jboss-unit-config.xml
idm/trunk/idm-core/src/test/resources/store-test-config.xml
Modified:
idm/trunk/idm-core/pom.xml
idm/trunk/pom.xml
Log:
initial split of modules to separate hibernate, ldap and cache dependencies
Added: idm/trunk/idm-cache/pom.xml
===================================================================
--- idm/trunk/idm-cache/pom.xml (rev 0)
+++ idm/trunk/idm-cache/pom.xml 2009-05-09 11:10:49 UTC (rev 485)
@@ -0,0 +1,164 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.jboss.identity</groupId>
+ <artifactId>idm-parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../parent</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>idm-cache</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss Identity IDM Cachen</name>
+ <
url>http://labs.jboss.org/portal/jbosssecurity/</url>
+ <description>JBoss Identity IDM Cache</description>
+ <licenses>
+ <license>
+ <name>lgpl</name>
+ <
url>http://repository.jboss.com/licenses/lgpl.txt</url>
+ </license>
+ </licenses>
+ <organization>
+ <name>JBoss Inc.</name>
+ <url>http://www.jboss.org</url>
+ </organization>
+ <scm>
+
<
connection>scm:svn:http://anonsvn.jboss.org/repos/jbossidentity/trunk&...
+
<
developerConnection>scm:svn:https://svn.jboss.org/jbossidentity/trunk&...
+
<
url>http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossidentity/trunk<...
+ </scm>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.identity</groupId>
+ <artifactId>idm-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+
+ <dependency>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-core</artifactId>
+ <version>3.0.2.GA</version>
+ </dependency>
+
+ </dependencies>
+
+
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>dataSourceName</name>
+ <value>${dataSourceName}</value>
+ </property>
+ <property>
+ <name>directoryName</name>
+ <value>${directoryName}</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ <!--<plugin>-->
+ <!--<groupId>org.jboss.unit</groupId>-->
+
<!--<artifactId>jboss-unit-tooling-maven2</artifactId>-->
+ <!--<executions>-->
+ <!--<execution>-->
+ <!--<phase>test</phase>-->
+ <!--<goals>-->
+ <!--<goal>execute</goal>-->
+ <!--</goals>-->
+ <!--</execution>-->
+ <!--</executions>-->
+ <!--<configuration>-->
+
+ <!--<jpda>true</jpda>-->
+ <!--<jpdaPort>5005</jpdaPort>-->
+ <!--<jpdaSuspend>true</jpdaSuspend>-->
+
+ <!--<failOnError>true</failOnError>-->
+
+
+ <!--<testsuites>-->
+ <!--<testsuite>-->
+ <!--<config>jboss-unit.xml</config>-->
+ <!--<parameters>-->
+ <!--<parameter>-->
+ <!--<name>dataSourceName</name>-->
+ <!--<values>-->
+ <!--<value>hsqldb</value>-->
+ <!--<value>mysql5</value>-->
+ <!--<value>mysql4</value>-->
+
<!--<value>postgresql8</value>-->
+
<!--<value>sqlserver</value>-->
+ <!--<value>oracle9i</value>-->
+
<!--<value>oracle10g</value>-->
+ <!--</values>-->
+ <!--</parameter>-->
+ <!--</parameters>-->
+
+
+ <!--</testsuite>-->
+ <!--</testsuites>-->
+
+ <!--<reports>-->
+ <!--<xml>idm/target/tests/reports/xml</xml>-->
+
<!--<html>idm/target/tests/reports/html</html>-->
+ <!--</reports>-->
+ <!--</configuration>-->
+ <!--</plugin>-->
+
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>provided-jdbc-driver</id>
+ <dependencies>
+ <dependency>
+ <groupId>privided</groupId>
+ <artifactId>jdbc-driver</artifactId>
+ <version>NA</version>
+ <scope>system</scope>
+ <systemPath>${provided.jdbc.driver.path}</systemPath>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>provided-jdbc-driver2</id>
+ <dependencies>
+ <dependency>
+ <groupId>privided</groupId>
+ <artifactId>jdbc-driver2</artifactId>
+ <version>NA</version>
+ <scope>system</scope>
+ <systemPath>${provided.jdbc.driver.path2}</systemPath>
+ </dependency>
+ </dependencies>
+ </profile>
+ <!--<profile>-->
+ <!--<id>oracle-provided-jdbc-drivers</id>-->
+ <!--<dependencies>-->
+ <!--<dependency>-->
+ <!--<groupId>oracle</groupId>-->
+ <!--<artifactId>jdbc-driver1</artifactId>-->
+ <!--<version>NA</version>-->
+ <!--<scope>system</scope>-->
+
<!--<systemPath>${oracle.jdbc.driver1}</systemPath>-->
+ <!--</dependency>-->
+ <!--<dependency>-->
+ <!--<groupId>oracle</groupId>-->
+ <!--<artifactId>jdbc-driver2</artifactId>-->
+ <!--<version>NA</version>-->
+ <!--<scope>system</scope>-->
+
<!--<systemPath>${oracle.jdbc.driver1}</systemPath>-->
+ <!--</dependency>-->
+ <!--</dependencies>-->
+ <!--</profile>-->
+ </profiles>
+</project>
Modified: idm/trunk/idm-core/pom.xml
===================================================================
--- idm/trunk/idm-core/pom.xml 2009-05-09 10:22:47 UTC (rev 484)
+++ idm/trunk/idm-core/pom.xml 2009-05-09 11:10:49 UTC (rev 485)
@@ -230,6 +230,18 @@
</systemProperties>
</configuration>
</plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
<!--<plugin>-->
<!--<groupId>org.jboss.unit</groupId>-->
<!--<artifactId>jboss-unit-tooling-maven2</artifactId>-->
Deleted:
idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/impl/HibernateTestSupport.java
===================================================================
---
idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/impl/HibernateTestSupport.java 2009-05-09
10:22:47 UTC (rev 484)
+++
idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/impl/HibernateTestSupport.java 2009-05-09
11:10:49 UTC (rev 485)
@@ -1,135 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-
-package org.jboss.identity.idm.impl;
-
-import
org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType;
-import org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType;
-import org.hibernate.SessionFactory;
-import org.hibernate.cfg.AnnotationConfiguration;
-
-import java.util.logging.Logger;
-import java.sql.Connection;
-import java.sql.DriverManager;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
- * @version : 0.1 $
- */
-public class HibernateTestSupport
-{
- private static Logger logger =
Logger.getLogger(HibernateTestSupport.class.getName());
-
- protected SessionFactory sessionFactory;
-
- private Connection connection;
-
- private final String databaseName;
-
- private final String hibernateConfiguration;
-
- public HibernateTestSupport(String databaseName, String hibernateConfiguration)
- {
- this.databaseName = databaseName;
- this.hibernateConfiguration = hibernateConfiguration;
- }
-
- public SessionFactory getSessionFactory()
- {
- return sessionFactory;
- }
-
-
- public void start() throws Exception {
- try {
- logger.info("Starting in-memory HSQL database for unit tests");
- Class.forName("org.hsqldb.jdbcDriver");
- connection = DriverManager.getConnection("jdbc:hsqldb:mem:" +
databaseName, "sa", "");
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- logger.fine("Exception during HSQL database startup.");
- throw ex;
- }
- try
- {
- logger.info("Building JPA EntityManager for unit tests");
- //emFactory =
(HibernateEntityManagerFactory)Persistence.createEntityManagerFactory(persistenceUnit);
- sessionFactory = new
AnnotationConfiguration().configure(hibernateConfiguration).buildSessionFactory();
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- logger.fine("Exception during JPA EntityManager instanciation.");
- throw ex;
- }
- }
-
- public void stop() throws Exception {
- logger.info("Shuting down Hibernate JPA layer.");
- if (sessionFactory != null)
- {
- sessionFactory.close();
- }
-
- logger.info("Stopping in-memory HSQL database.");
- try
- {
- connection.createStatement().execute("SHUTDOWN");
- }
- catch (Exception ex) {
- throw ex;
- }
- }
-
- public void populateObjectTypes(String[] typeNames) throws Exception
- {
-
- sessionFactory.getCurrentSession().getTransaction().begin();
-
- for (String typeName : typeNames)
- {
- HibernateIdentityObjectType hibernateType = new
HibernateIdentityObjectType(typeName);
- sessionFactory.getCurrentSession().persist(hibernateType);
- }
-
- sessionFactory.getCurrentSession().getTransaction().commit();
-
- }
-
- public void populateRelationshipTypes(String[] typeNames) throws Exception
- {
-
- sessionFactory.getCurrentSession().getTransaction().begin();
-
- for (String typeName : typeNames)
- {
- HibernateIdentityObjectRelationshipType hibernateType = new
HibernateIdentityObjectRelationshipType(typeName);
- sessionFactory.getCurrentSession().persist(hibernateType);
- }
-
- sessionFactory.getCurrentSession().getTransaction().commit();
- }
-
-
-}
Deleted:
idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/impl/IdentityTestPOJO.java
===================================================================
---
idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/impl/IdentityTestPOJO.java 2009-05-09
10:22:47 UTC (rev 484)
+++
idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/impl/IdentityTestPOJO.java 2009-05-09
11:10:49 UTC (rev 485)
@@ -1,244 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-
-package org.jboss.identity.idm.impl;
-
-import org.jboss.unit.api.pojo.annotations.Parameter;
-import org.jboss.unit.api.pojo.annotations.Create;
-import static org.jboss.unit.api.Assert.assertTrue;
-import org.jboss.portal.test.framework.embedded.JNDISupport;
-import org.jboss.portal.test.framework.embedded.ConnectionManagerSupport;
-import org.jboss.portal.test.framework.embedded.TransactionManagerSupport;
-import org.jboss.portal.test.framework.embedded.DataSourceSupport;
-import org.jboss.portal.test.framework.embedded.HibernateSupport;
-import org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject;
-import org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute;
-import
org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute;
-import org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute;
-import org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential;
-import
org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType;
-import org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship;
-import
org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName;
-import
org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType;
-import org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType;
-import org.jboss.identity.idm.impl.model.hibernate.HibernateRealm;
-import
org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue;
-import org.jboss.identity.idm.test.HibernateAnnotationsSupport;
-import org.jboss.identity.idm.opends.OpenDSService;
-import org.opends.server.tools.LDAPModify;
-import org.hibernate.SessionFactory;
-
-import javax.naming.Context;
-import javax.naming.NamingEnumeration;
-import javax.naming.Binding;
-import javax.naming.ldap.InitialLdapContext;
-import javax.naming.directory.DirContext;
-import java.util.List;
-import java.util.LinkedList;
-import java.util.Hashtable;
-import java.io.File;
-
-import junit.framework.TestCase;
-
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
- * @version : 0.1 $
- */
-public class IdentityTestPOJO extends TestCase
-{
-
- private String identityConfig = "organization-test-jboss-unit-config.xml";
-
- private String realmName;
-
- private String dataSourceName = "hsqldb";
-
- private String hibernateConfig = "datasources/hibernates.xml";
-
- private String datasources = "datasources/datasources.xml";
-
- private JNDISupport jndiSupport;
-
- protected TransactionManagerSupport transactonManagerSupport;
-
- protected ConnectionManagerSupport connectionManagerSupport;
-
- protected DataSourceSupport dataSourceSupport;
-
- protected HibernateSupport hibernateSupport;
-
-
-
- public void start() throws Exception
- {
- overrideFromProperties();
-
- jndiSupport = new JNDISupport();
- jndiSupport.start();
- transactonManagerSupport = new TransactionManagerSupport();
- transactonManagerSupport.start();
- connectionManagerSupport = new ConnectionManagerSupport();
-
connectionManagerSupport.setTransactionManager(transactonManagerSupport.getTransactionManager());
- connectionManagerSupport.start();
-
-
-
- DataSourceSupport.Config dataSourceConfig =
DataSourceSupport.Config.obtainConfig(datasources, dataSourceName);
-
- HibernateSupport.Config hibernateSupportConfig =
HibernateSupport.getConfig(dataSourceName, hibernateConfig);
-
- dataSourceSupport = new DataSourceSupport();
-
dataSourceSupport.setTransactionManager(transactonManagerSupport.getTransactionManager());
-
dataSourceSupport.setConnectionManagerReference(connectionManagerSupport.getConnectionManagerReference());
- dataSourceSupport.setConfig(dataSourceConfig);
- dataSourceSupport.start();
-
- hibernateSupport = new HibernateAnnotationsSupport();
- hibernateSupport.setConfig(hibernateSupportConfig);
-
hibernateSupport.setJNDIName("java:/jbossidentity/HibernateStoreSessionFactory");
-
- List<String> annotatedClasses = new LinkedList<String>();
- annotatedClasses.add(HibernateIdentityObject.class.getName());
- annotatedClasses.add(HibernateIdentityObjectAttribute.class.getName());
- annotatedClasses.add(HibernateIdentityObjectBinaryAttribute.class.getName());
- annotatedClasses.add(HibernateIdentityObjectBinaryAttributeValue.class.getName());
- annotatedClasses.add(HibernateIdentityObjectTextAttribute.class.getName());
- annotatedClasses.add(HibernateIdentityObjectCredential.class.getName());
- annotatedClasses.add(HibernateIdentityObjectCredentialType.class.getName());
- annotatedClasses.add(HibernateIdentityObjectRelationship.class.getName());
- annotatedClasses.add(HibernateIdentityObjectRelationshipName.class.getName());
- annotatedClasses.add(HibernateIdentityObjectRelationshipType.class.getName());
- annotatedClasses.add(HibernateIdentityObjectType.class.getName());
- annotatedClasses.add(HibernateRealm.class.getName());
-
- hibernateSupport.setMappings(annotatedClasses);
-
- hibernateSupport.start();
-
-
- }
-
- public void stop() throws Exception
- {
- hibernateSupport.stop();
- dataSourceSupport.stop();
- connectionManagerSupport.stop();
- transactonManagerSupport.stop();
- jndiSupport.stop();
-
-
- }
-
- public void overrideFromProperties() throws Exception
- {
- String dsName =System.getProperties().getProperty("dataSourceName");
-
- if (dsName != null && !dsName.startsWith("$"))
- {
- setDataSourceName(dsName);
- }
-
- }
-
- public SessionFactory getSessionFactory()
- {
- return getHibernateSupport().getSessionFactory();
- }
-
-
-
-
- @Parameter(name="dataSourceName")
- public void setDataSourceName(String dataSourceName)
- {
- this.dataSourceName = dataSourceName;
- }
-
- @Parameter(name="hibernateConfig")
- public void setHibernateConfig(String hibernateConfig)
- {
- this.hibernateConfig = hibernateConfig;
- }
-
- @Parameter(name="datasources")
- public void setDatasources(String datasources)
- {
- this.datasources = datasources;
- }
-
- @Parameter(name="identityConfig")
- public void setIdentityConfig(String identityConfig)
- {
- this.identityConfig = identityConfig;
- }
-
- @Parameter(name="realmName")
- public void setRealmName(String realmName)
- {
- this.realmName = realmName;
- }
-
- public String getDataSourceName()
- {
- return dataSourceName;
- }
-
- public String getHibernateConfig()
- {
- return hibernateConfig;
- }
-
- public String getDatasources()
- {
- return datasources;
- }
-
- public String getIdentityConfig()
- {
- return identityConfig;
- }
-
- public String getRealmName()
- {
- return realmName;
- }
-
- public HibernateSupport getHibernateSupport()
- {
- return hibernateSupport;
- }
-
- public void begin()
- {
- getHibernateSupport().openSession();
- }
-
- public void commit()
- {
- assertTrue(getHibernateSupport().commitTransaction());
- }
-
-
-
-
-}
Deleted: idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/impl/LDAPTestPOJO.java
===================================================================
---
idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/impl/LDAPTestPOJO.java 2009-05-09
10:22:47 UTC (rev 484)
+++
idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/impl/LDAPTestPOJO.java 2009-05-09
11:10:49 UTC (rev 485)
@@ -1,185 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-
-package org.jboss.identity.idm.impl;
-
-import org.jboss.identity.idm.opends.OpenDSService;
-import org.jboss.unit.api.pojo.annotations.Parameter;
-import org.opends.server.tools.LDAPModify;
-
-import javax.naming.Context;
-import javax.naming.NamingEnumeration;
-import javax.naming.Binding;
-import javax.naming.directory.DirContext;
-import javax.naming.ldap.InitialLdapContext;
-import javax.naming.ldap.LdapContext;
-import java.util.Hashtable;
-import java.io.File;
-import java.net.URL;
-import java.net.URISyntaxException;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
- * @version : 0.1 $
- */
-public class LDAPTestPOJO extends IdentityTestPOJO
-{
-
- private String directoryName = "EmbeddedOpenDS";
-
- public static final String LDAP_HOST = "localhost";
-
- public static final String LDAP_PORT = "10389";
-
- public static final String LDAP_PROVIDER_URL = "ldap://" + LDAP_HOST +
":" + LDAP_PORT;
-
- public static final String LDAP_PRINCIPAL = "cn=Directory Manager";
-
- public static final String LDAP_CREDENTIALS = "password";
-
- public static Hashtable<String,String> env = new
Hashtable<String,String>();
-
- static
- {
- env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
- env.put(Context.PROVIDER_URL, LDAP_PROVIDER_URL);
- env.put(Context.SECURITY_AUTHENTICATION, "simple");
- env.put(Context.SECURITY_PRINCIPAL, LDAP_PRINCIPAL);
- env.put(Context.SECURITY_CREDENTIALS, LDAP_CREDENTIALS);
- }
-
- OpenDSService openDSService = new OpenDSService(null);
-
- @Override
- public void start() throws Exception
- {
- super.start();
-
-
- openDSService.start();
-
-
- }
-
- @Override
- public void stop() throws Exception
- {
- super.stop();
-
- cleanUp(new InitialLdapContext(env, null));
- openDSService.stop();
-
- }
-
- public void overrideFromProperties() throws Exception
- {
- super.overrideFromProperties();
-
- String dirName = System.getProperties().getProperty("directoryName");
-
- if (dirName != null && !dirName.startsWith("$"))
- {
- setDirectoryName(dirName);
- }
-
- }
-
- @Parameter
- public void setDirectoryName(String directoryName)
- {
- this.directoryName = directoryName;
- }
-
- public String getDirectoryName()
- {
- return directoryName;
- }
-
- public void populate() throws Exception
- {
- populateLDIF("ldap/initial-opends.ldif");
- }
-
- public void populateClean() throws Exception
- {
- populateLDIF("ldap/initial-empty-opends.ldif");
- }
-
- public void populateLDIF(String ldif) throws Exception
- {
-
- URL ldifURL = Thread.currentThread().getContextClassLoader().getResource(ldif);
-
- System.out.println("LDIF: " + ldifURL.toURI().getPath());
-
- String[] cmd = new String[] {"-h", LDAP_HOST,
- "-p", LDAP_PORT,
- "-D", LDAP_PRINCIPAL,
- "-w", LDAP_CREDENTIALS,
- "-a", "-f", ldifURL.toURI().getPath()};
-
- System.out.println("Populate success: " + (LDAPModify.mainModify(cmd,
false, System.out, System.err) == 0));
-
- }
-
- protected void cleanUp(DirContext ldapCtx) throws Exception
- {
- try
- {
- String dn = "dc=portal,dc=example,dc=com";
-
- System.out.println("Removing: " + dn);
-
- removeContext(ldapCtx, dn);
- }
- catch (Exception e)
- {
- //
- }
- }
-
- //subsequent remove of javax.naming.Context
- protected void removeContext(Context mainCtx, String name) throws Exception
- {
- Context deleteCtx = (Context)mainCtx.lookup(name);
- NamingEnumeration subDirs = mainCtx.listBindings(name);
-
- while (subDirs.hasMoreElements())
- {
- Binding binding = (Binding)subDirs.nextElement();
- String subName = binding.getName();
-
- removeContext(deleteCtx, subName);
- }
-
- mainCtx.unbind(name);
- }
-
-
- public LdapContext getLdapContext() throws Exception
- {
- return new InitialLdapContext(env, null);
- }
-
-
-
-}
Deleted: idm/trunk/idm-core/src/test/resources/hibernate-jboss-identity-classes.cfg.xml
===================================================================
---
idm/trunk/idm-core/src/test/resources/hibernate-jboss-identity-classes.cfg.xml 2009-05-09
10:22:47 UTC (rev 484)
+++
idm/trunk/idm-core/src/test/resources/hibernate-jboss-identity-classes.cfg.xml 2009-05-09
11:10:49 UTC (rev 485)
@@ -1,60 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
- ~ contributors as indicated by the @authors tag. See the ~
- ~ copyright.txt in the distribution for a full listing of ~
- ~ individual contributors. ~
- ~ ~
- ~ This is free software; you can redistribute it and/or modify it ~
- ~ under the terms of the GNU Lesser General Public License as ~
- ~ published by the Free Software Foundation; either version 2.1 of ~
- ~ the License, or (at your option) any later version. ~
- ~ ~
- ~ This software is distributed in the hope that it will be useful, ~
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
- ~ Lesser General Public License for more details. ~
- ~ ~
- ~ You should have received a copy of the GNU Lesser General Public ~
- ~ License along with this software; if not, write to the Free ~
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
- ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<!DOCTYPE hibernate-configuration PUBLIC
- "-//Hibernate/Hibernate Configuration DTD//EN"
- "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
-<hibernate-configuration>
- <session-factory>
-
- <property name="show_sql">false</property>
- <property
name="cache.use_second_level_cache">true</property>
- <property name="cache.use_query_cache">false</property>
-
- <property
name="current_session_context_class">thread</property>
-
- <!--<property
name="connection.datasource"></property>-->
-
- <property
name="hibernate.connection.url">jdbc:hsqldb:mem:unit-testing-jpa1</property>
- <property
name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
- <property
name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
- <property
name="hibernate.hbm2ddl.auto">create-drop</property>
- <property
name="hibernate.connection.username">sa</property>
- <property name="hibernate.connection.password"></property>
-
- <!-- Mapping classes -->
-
- <mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateRealm"/>
- <mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject"/>
- <mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential"/>
- <mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType"/>
- <mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute"/>
- <mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute"/>
- <mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute"/>
- <mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType"/>
- <mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship"/>
- <mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType"/>
- <mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName"/>
- </session-factory>
-</hibernate-configuration>
\ No newline at end of file
Deleted: idm/trunk/idm-core/src/test/resources/hibernate-jboss-identity.cfg.xml
===================================================================
--- idm/trunk/idm-core/src/test/resources/hibernate-jboss-identity.cfg.xml 2009-05-09
10:22:47 UTC (rev 484)
+++ idm/trunk/idm-core/src/test/resources/hibernate-jboss-identity.cfg.xml 2009-05-09
11:10:49 UTC (rev 485)
@@ -1,61 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
- ~ contributors as indicated by the @authors tag. See the ~
- ~ copyright.txt in the distribution for a full listing of ~
- ~ individual contributors. ~
- ~ ~
- ~ This is free software; you can redistribute it and/or modify it ~
- ~ under the terms of the GNU Lesser General Public License as ~
- ~ published by the Free Software Foundation; either version 2.1 of ~
- ~ the License, or (at your option) any later version. ~
- ~ ~
- ~ This software is distributed in the hope that it will be useful, ~
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
- ~ Lesser General Public License for more details. ~
- ~ ~
- ~ You should have received a copy of the GNU Lesser General Public ~
- ~ License along with this software; if not, write to the Free ~
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
- ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<!DOCTYPE hibernate-configuration PUBLIC
- "-//Hibernate/Hibernate Configuration DTD//EN"
- "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
-<hibernate-configuration>
- <session-factory>
-
- <property name="show_sql">false</property>
- <property
name="cache.use_second_level_cache">true</property>
- <property name="cache.use_query_cache">false</property>
-
- <property
name="current_session_context_class">thread</property>
-
- <!--<property
name="connection.datasource"></property>-->
-
- <property
name="hibernate.connection.url">jdbc:hsqldb:mem:unit-testing-jpa1</property>
- <property
name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
- <property
name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
- <property
name="hibernate.hbm2ddl.auto">create-drop</property>
- <property
name="hibernate.connection.username">sa</property>
- <property name="hibernate.connection.password"></property>
-
- <!-- Mapping classes -->
- <!-- all nessesary mappings are added programatically to the configuration
-->
- <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateRealm"/>-->
- <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject"/>-->
- <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential"/>-->
- <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType"/>-->
- <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute"/>-->
- <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute"/>-->
- <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute"/>-->
- <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType"/>-->
- <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship"/>-->
- <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType"/>-->
- <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName"/>-->
-
- </session-factory>
-</hibernate-configuration>
\ No newline at end of file
Deleted: idm/trunk/idm-core/src/test/resources/log4j.xml
===================================================================
--- idm/trunk/idm-core/src/test/resources/log4j.xml 2009-05-09 10:22:47 UTC (rev 484)
+++ idm/trunk/idm-core/src/test/resources/log4j.xml 2009-05-09 11:10:49 UTC (rev 485)
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<log4j:configuration
xmlns:log4j="http://jakarta.apache.org/log4j/"
debug="false">
- <appender name="CONSOLE"
class="org.apache.log4j.ConsoleAppender">
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern"
- value="[%d{dd/MM/yy hh:mm:ss:sss z}] %5p %c{2}:
%m%n" />
- </layout>
- </appender>
-
- <appender name="ASYNC"
class="org.apache.log4j.AsyncAppender">
- <appender-ref ref="CONSOLE"/>
- <appender-ref ref="FILE"/>
- </appender>
-
- <appender name="FILE"
class="org.apache.log4j.RollingFileAppender">
- <param name="File" value="log4j-output.log"/>
- <param name="MaxFileSize" value="1MB"/>
- <param name="MaxBackupIndex" value="100"/>
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern"
- value="[%d{dd/MM/yy hh:mm:ss:sss z}] %5p %c{2}:
%m%n" />
- </layout>
- </appender>
-
- <root>
- <priority value="info"/>
- <appender-ref ref="CONSOLE"/>
- <!--<appender-ref ref="ASYNC"/>-->
- </root>
-</log4j:configuration>
\ No newline at end of file
Deleted: idm/trunk/idm-core/src/test/resources/organization-test-config.xml
===================================================================
--- idm/trunk/idm-core/src/test/resources/organization-test-config.xml 2009-05-09 10:22:47
UTC (rev 484)
+++ idm/trunk/idm-core/src/test/resources/organization-test-config.xml 2009-05-09 11:10:49
UTC (rev 485)
@@ -1,792 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<jboss-identity xmlns="urn:jboss:identity:idm:config:v1_0_alpha"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:jboss:identity:idm:config:v1_0_alpha
identity-config.xsd">
- <realms>
- <realm>
- <id>realm://RedHat/DB</id>
- <repository-id-ref>RedHat Repository DB</repository-id-ref>
- <identity-type-mappings>
- <user-mapping>USER</user-mapping>
- </identity-type-mappings>
- </realm>
- <realm>
- <id>realm://portal/SamplePortal/DB</id>
- <repository-id-ref>Sample Portal Repository
DB</repository-id-ref>
- <identity-type-mappings>
- <user-mapping>USER</user-mapping>
- </identity-type-mappings>
- </realm>
- <realm>
- <id>realm://RedHat/DB_LDAP</id>
- <repository-id-ref>RedHat Repository DB+LDAP</repository-id-ref>
- <identity-type-mappings>
- <user-mapping>USER</user-mapping>
- </identity-type-mappings>
- </realm>
- <realm>
- <id>realm://portal/SamplePortal/DB_LDAP</id>
- <repository-id-ref>Sample Portal Repository
DB+LDAP</repository-id-ref>
- <identity-type-mappings>
- <user-mapping>USER</user-mapping>
- </identity-type-mappings>
- </realm>
- </realms>
- <repositories>
- <repository>
- <id>RedHat Repository DB</id>
-
<class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
- <external-config/>
- <default-identity-store-id>Hibernate Identity
Store</default-identity-store-id>
- <default-attribute-store-id>Hibernate Identity
Store</default-attribute-store-id>
- <options>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- </options>
- </repository>
- <repository>
- <id>Sample Portal Repository DB</id>
-
<class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
- <external-config/>
- <default-identity-store-id>Hibernate Identity
Store</default-identity-store-id>
- <default-attribute-store-id>Hibernate Identity
Store</default-attribute-store-id>
- <options>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- </options>
- </repository>
- <repository>
- <id>RedHat Repository DB+LDAP</id>
-
<class>org.jboss.identity.idm.impl.repository.FallbackIdentityStoreRepository</class>
- <external-config/>
- <default-identity-store-id>Hibernate Identity
Store</default-identity-store-id>
- <default-attribute-store-id>Hibernate Identity
Store</default-attribute-store-id>
- <identity-store-mappings>
- <identity-store-mapping>
- <identity-store-id>Hibernate Identity
Store</identity-store-id>
- <identity-object-types>
-
<identity-object-type>DIVISION</identity-object-type>
- <identity-object-type>PROJECT</identity-object-type>
- <identity-object-type>PEOPLE</identity-object-type>
- </identity-object-types>
- <options/>
- </identity-store-mapping>
- <identity-store-mapping>
- <identity-store-id>LDAP Identity
Store</identity-store-id>
- <identity-object-types>
- <identity-object-type>USER</identity-object-type>
-
<identity-object-type>ORGANIZATION</identity-object-type>
-
<identity-object-type>ORGANIZATION_UNIT</identity-object-type>
-
<identity-object-type>DEPARTMENT</identity-object-type>
- </identity-object-types>
- <options>
- <option>
- <name>cache</name>
- <value>true</value>
- </option>
- <option>
- <name>cache.config-file</name>
-
<value>src/test/resources/jboss-cache-config.xml</value>
- </option>
- </options>
- </identity-store-mapping>
- </identity-store-mappings>
- <options>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- </options>
- </repository>
- <repository>
- <id>Sample Portal Repository DB+LDAP</id>
-
<class>org.jboss.identity.idm.impl.repository.FallbackIdentityStoreRepository</class>
- <external-config/>
- <default-identity-store-id>Hibernate Identity
Store</default-identity-store-id>
- <default-attribute-store-id>Hibernate Identity
Store</default-attribute-store-id>
- <identity-store-mappings>
- <identity-store-mapping>
- <identity-store-id>Hibernate Identity
Store</identity-store-id>
- <identity-object-types>
- <identity-object-type>SYSTEM</identity-object-type>
-
<identity-object-type>ADMINISTRATION</identity-object-type>
-
<identity-object-type>COMMUNITY</identity-object-type>
-
<identity-object-type>DIVISION</identity-object-type>
-
<identity-object-type>SECURITY</identity-object-type>
- <identity-object-type>PEOPLE</identity-object-type>
- </identity-object-types>
- <options/>
- </identity-store-mapping>
- <identity-store-mapping>
- <identity-store-id>LDAP Identity
Store</identity-store-id>
- <identity-object-types>
- <identity-object-type>USER</identity-object-type>
-
<identity-object-type>DEPARTMENT</identity-object-type>
-
<identity-object-type>ORGANIZATION</identity-object-type>
-
<identity-object-type>ORGANIZATION_UNIT</identity-object-type>
- <identity-object-type>OFFICE</identity-object-type>
- </identity-object-types>
- <options>
- <option>
- <name>cache</name>
- <value>true</value>
- </option>
- <option>
- <name>cache.config-file</name>
-
<value>src/test/resources/jboss-cache-config.xml</value>
- </option>
- </options>
- </identity-store-mapping>
- </identity-store-mappings>
- <options>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- </options>
- </repository>
- </repositories>
- <stores>
- <attribute-stores/>
- <identity-stores>
- <identity-store>
- <id>Hibernate Identity Store</id>
-
<class>org.jboss.identity.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
- <external-config/>
- <supported-relationship-types>
-
<relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
-
<relationship-type>JBOSS_IDENTITY_ROLE</relationship-type>
- </supported-relationship-types>
- <supported-identity-object-types>
- <identity-object-type>
- <name>USER</name>
- <relationships>
- <!--<relationship>-->
-
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
-
<!--<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>-->
- <!--</relationship>-->
- <!--<relationship>-->
-
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
-
<!--<identity-object-type-ref>COMMUNITY</identity-object-type-ref>-->
- <!--</relationship>-->
- <!--<relationship>-->
-
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
-
<!--<identity-object-type-ref>OFFICE</identity-object-type-ref>-->
- <!--</relationship>-->
- <!--<relationship>-->
-
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
-
<!--<identity-object-type-ref>SECURITY</identity-object-type-ref>-->
- <!--</relationship>-->
- <!--<relationship>-->
-
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
-
<!--<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>-->
- <!--</relationship>-->
- <!--<relationship>-->
-
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
-
<!--<identity-object-type-ref>PROJECT</identity-object-type-ref>-->
- <!--</relationship>-->
- <!--<relationship>-->
-
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
-
<!--<identity-object-type-ref>PEOPLE</identity-object-type-ref>-->
- <!--</relationship>-->
- </relationships>
- <credentials>
- <credential-type>PASSWORD</credential-type>
- </credentials>
- <attributes>
- <attribute>
- <name>picture</name>
- <mapping>user.picture</mapping>
- <type>binary</type>
- <isRequired>false</isRequired>
- <isMultivalued>false</isMultivalued>
- <isReadOnly>false</isReadOnly>
- </attribute>
- </attributes>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>ORGANIZATION</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>DIVISION</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>ORGANIZATION_UNIT</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>DIVISION</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>OFFICE</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>PEOPLE</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>PROJECT</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>DIVISION</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>DEPARTMENT</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>PROJECT</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>PEOPLE</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>ADMINISTRATION</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>COMMUNITY</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>OFFICE</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>SECURITY</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>SYSTEM</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>SECURITY</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>COMMUNITY</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- </supported-identity-object-types>
- <options>
- <option>
- <name>hibernateConfiguration</name>
- <value>hibernate-jboss-identity.cfg.xml</value>
- </option>
- <!--<option>-->
-
<!--<name>hibernateSessionFactoryJNDIName</name>-->
-
<!--<value>java:/jbossidentity/HibernateStoreSessionFactory</value>-->
- <!--</option>-->
- <option>
- <name>populateRelationshipTypes</name>
- <value>true</value>
- </option>
- <option>
- <name>populateIdentityObjectTypes</name>
- <value>true</value>
- </option>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- <option>
- <name>isRealmAware</name>
- <value>true</value>
- </option>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- </options>
- </identity-store>
- <identity-store>
- <id>LDAP Identity Store</id>
-
<class>org.jboss.identity.idm.impl.store.ldap.LDAPIdentityStoreImpl</class>
- <external-config/>
- <supported-relationship-types>
-
<relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
- </supported-relationship-types>
- <supported-identity-object-types>
- <identity-object-type>
- <name>USER</name>
- <relationships/>
- <credentials>
- <credential-type>PASSWORD</credential-type>
- </credentials>
- <attributes>
- <attribute>
- <name>phone</name>
- <mapping>telephoneNumber</mapping>
- <type>text</type>
- <isRequired>false</isRequired>
- <isMultivalued>false</isMultivalued>
- <isReadOnly>false</isReadOnly>
- </attribute>
- <attribute>
- <name>description</name>
- <mapping>description</mapping>
- <type>text</type>
- <isRequired>false</isRequired>
- <isMultivalued>false</isMultivalued>
- <isReadOnly>false</isReadOnly>
- </attribute>
- <attribute>
- <name>carLicense</name>
- <mapping>carLicense</mapping>
- <type>text</type>
- <isRequired>false</isRequired>
- <isMultivalued>false</isMultivalued>
- <isReadOnly>false</isReadOnly>
- </attribute>
- </attributes>
- <options>
- <option>
- <name>idAttributeName</name>
- <value>uid</value>
- </option>
- <option>
- <name>passwordAttributeName</name>
- <value>userPassword</value>
- </option>
- <option>
- <name>ctxDNs</name>
-
<value>ou=People,o=test,dc=portal,dc=example,dc=com</value>
- </option>
- <option>
- <name>allowCreateEntry</name>
- <value>true</value>
- </option>
- <option>
- <name>createEntryAttributeValues</name>
- <value>objectClass=top</value>
- <value>objectClass=inetOrgPerson</value>
- <value>sn= </value>
- <value>cn= </value>
- </option>
- </options>
- </identity-object-type>
- <identity-object-type>
- <name>ORGANIZATION</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>OFFICE</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options>
- <option>
- <name>idAttributeName</name>
- <value>cn</value>
- </option>
- <option>
- <name>ctxDNs</name>
-
<value>ou=Organizations,o=test,dc=portal,dc=example,dc=com</value>
- </option>
- <!--<option>-->
- <!--<name>entrySearchFilter</name>-->
- <!--<value></value>-->
- <!--</option>-->
- <option>
- <name>allowCreateEntry</name>
- <value>true</value>
- </option>
- <option>
- <name>membershipAttributeName</name>
- <value>member</value>
- </option>
- <option>
- <name>isMembershipAttributeDN</name>
- <value>true</value>
- </option>
- <option>
- <name>allowEmptyMemberships</name>
- <value>true</value>
- </option>
- <option>
- <name>createEntryAttributeValues</name>
- <value>objectClass=top</value>
- <value>objectClass=groupOfNames</value>
- </option>
- </options>
- </identity-object-type>
- <identity-object-type>
- <name>ORGANIZATION_UNIT</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>OFFICE</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options>
- <option>
- <name>idAttributeName</name>
- <value>cn</value>
- </option>
- <option>
- <name>ctxDNs</name>
-
<value>ou=OrganizationUnits,o=test,dc=portal,dc=example,dc=com</value>
- </option>
- <!--<option>-->
- <!--<name>entrySearchFilter</name>-->
- <!--<value></value>-->
- <!--</option>-->
- <option>
- <name>allowCreateEntry</name>
- <value>true</value>
- </option>
- <option>
- <name>membershipAttributeName</name>
- <value>member</value>
- </option>
- <option>
- <name>isMembershipAttributeDN</name>
- <value>true</value>
- </option>
- <option>
- <name>allowEmptyMemberships</name>
- <value>true</value>
- </option>
- <option>
- <name>createEntryAttributeValues</name>
- <value>objectClass=top</value>
- <value>objectClass=groupOfNames</value>
- </option>
- </options>
- </identity-object-type>
- <identity-object-type>
- <name>DEPARTMENT</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options>
- <option>
- <name>idAttributeName</name>
- <value>cn</value>
- </option>
- <option>
- <name>ctxDNs</name>
-
<value>ou=Departments,o=test,dc=portal,dc=example,dc=com</value>
- </option>
- <!--<option>-->
- <!--<name>entrySearchFilter</name>-->
- <!--<value></value>-->
- <!--</option>-->
- <option>
- <name>allowCreateEntry</name>
- <value>true</value>
- </option>
- <option>
- <name>membershipAttributeName</name>
- <value>member</value>
- </option>
- <option>
- <name>isMembershipAttributeDN</name>
- <value>true</value>
- </option>
- <option>
- <name>allowEmptyMemberships</name>
- <value>true</value>
- </option>
- <option>
- <name>createEntryAttributeValues</name>
- <value>objectClass=top</value>
- <value>objectClass=groupOfNames</value>
- </option>
- </options>
- </identity-object-type>
- <identity-object-type>
- <name>OFFICE</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options>
- <option>
- <name>idAttributeName</name>
- <value>cn</value>
- </option>
- <option>
- <name>ctxDNs</name>
-
<value>ou=Offices,o=test,dc=portal,dc=example,dc=com</value>
- </option>
- <!--<option>-->
- <!--<name>entrySearchFilter</name>-->
- <!--<value></value>-->
- <!--</option>-->
- <option>
- <name>allowCreateEntry</name>
- <value>true</value>
- </option>
- <option>
- <name>membershipAttributeName</name>
- <value>member</value>
- </option>
- <option>
- <name>isMembershipAttributeDN</name>
- <value>true</value>
- </option>
- <option>
- <name>allowEmptyMemberships</name>
- <value>true</value>
- </option>
- <option>
- <name>createEntryAttributeValues</name>
- <value>objectClass=top</value>
- <value>objectClass=groupOfNames</value>
- </option>
- </options>
- </identity-object-type>
- </supported-identity-object-types>
- <options>
- <option>
- <name>providerURL</name>
- <value>ldap://localhost:10389</value>
- </option>
- <option>
- <name>adminDN</name>
- <value>cn=Directory Manager</value>
- </option>
- <option>
- <name>adminPassword</name>
- <value>password</value>
- </option>
- <option>
- <name>searchTimeLimit</name>
- <value>10000</value>
- </option>
- </options>
- </identity-store>
- </identity-stores>
- </stores>
-</jboss-identity>
\ No newline at end of file
Deleted: idm/trunk/idm-core/src/test/resources/organization-test-jboss-unit-config.xml
===================================================================
---
idm/trunk/idm-core/src/test/resources/organization-test-jboss-unit-config.xml 2009-05-09
10:22:47 UTC (rev 484)
+++
idm/trunk/idm-core/src/test/resources/organization-test-jboss-unit-config.xml 2009-05-09
11:10:49 UTC (rev 485)
@@ -1,792 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<jboss-identity xmlns="urn:jboss:identity:idm:config:v1_0_alpha"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:jboss:identity:idm:config:v1_0_alpha
identity-config.xsd">
- <realms>
- <realm>
- <id>realm://RedHat/DB</id>
- <repository-id-ref>RedHat Repository DB</repository-id-ref>
- <identity-type-mappings>
- <user-mapping>USER</user-mapping>
- </identity-type-mappings>
- </realm>
- <realm>
- <id>realm://portal/SamplePortal/DB</id>
- <repository-id-ref>Sample Portal Repository
DB</repository-id-ref>
- <identity-type-mappings>
- <user-mapping>USER</user-mapping>
- </identity-type-mappings>
- </realm>
- <realm>
- <id>realm://RedHat/DB_LDAP</id>
- <repository-id-ref>RedHat Repository DB+LDAP</repository-id-ref>
- <identity-type-mappings>
- <user-mapping>USER</user-mapping>
- </identity-type-mappings>
- </realm>
- <realm>
- <id>realm://portal/SamplePortal/DB_LDAP</id>
- <repository-id-ref>Sample Portal Repository
DB+LDAP</repository-id-ref>
- <identity-type-mappings>
- <user-mapping>USER</user-mapping>
- </identity-type-mappings>
- </realm>
- </realms>
- <repositories>
- <repository>
- <id>RedHat Repository DB</id>
-
<class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
- <external-config/>
- <default-identity-store-id>Hibernate Identity
Store</default-identity-store-id>
- <default-attribute-store-id>Hibernate Identity
Store</default-attribute-store-id>
- <options>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- </options>
- </repository>
- <repository>
- <id>Sample Portal Repository DB</id>
-
<class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
- <external-config/>
- <default-identity-store-id>Hibernate Identity
Store</default-identity-store-id>
- <default-attribute-store-id>Hibernate Identity
Store</default-attribute-store-id>
- <options>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- </options>
- </repository>
- <repository>
- <id>RedHat Repository DB+LDAP</id>
-
<class>org.jboss.identity.idm.impl.repository.FallbackIdentityStoreRepository</class>
- <external-config/>
- <default-identity-store-id>Hibernate Identity
Store</default-identity-store-id>
- <default-attribute-store-id>Hibernate Identity
Store</default-attribute-store-id>
- <identity-store-mappings>
- <identity-store-mapping>
- <identity-store-id>Hibernate Identity
Store</identity-store-id>
- <identity-object-types>
-
<identity-object-type>DIVISION</identity-object-type>
- <identity-object-type>PROJECT</identity-object-type>
- <identity-object-type>PEOPLE</identity-object-type>
- </identity-object-types>
- <options/>
- </identity-store-mapping>
- <identity-store-mapping>
- <identity-store-id>LDAP Identity
Store</identity-store-id>
- <identity-object-types>
- <identity-object-type>USER</identity-object-type>
-
<identity-object-type>ORGANIZATION</identity-object-type>
-
<identity-object-type>ORGANIZATION_UNIT</identity-object-type>
-
<identity-object-type>DEPARTMENT</identity-object-type>
- </identity-object-types>
- <options>
- <option>
- <name>cache</name>
- <value>true</value>
- </option>
- <option>
- <name>cache.config-file</name>
- <value>jboss-cache-config.xml</value>
- </option>
- </options>
- </identity-store-mapping>
- </identity-store-mappings>
- <options>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- </options>
- </repository>
- <repository>
- <id>Sample Portal Repository DB+LDAP</id>
-
<class>org.jboss.identity.idm.impl.repository.FallbackIdentityStoreRepository</class>
- <external-config/>
- <default-identity-store-id>Hibernate Identity
Store</default-identity-store-id>
- <default-attribute-store-id>Hibernate Identity
Store</default-attribute-store-id>
- <identity-store-mappings>
- <identity-store-mapping>
- <identity-store-id>Hibernate Identity
Store</identity-store-id>
- <identity-object-types>
- <identity-object-type>SYSTEM</identity-object-type>
-
<identity-object-type>ADMINISTRATION</identity-object-type>
-
<identity-object-type>COMMUNITY</identity-object-type>
-
<identity-object-type>DIVISION</identity-object-type>
-
<identity-object-type>SECURITY</identity-object-type>
- <identity-object-type>PEOPLE</identity-object-type>
- </identity-object-types>
- <options/>
- </identity-store-mapping>
- <identity-store-mapping>
- <identity-store-id>LDAP Identity
Store</identity-store-id>
- <identity-object-types>
- <identity-object-type>USER</identity-object-type>
-
<identity-object-type>DEPARTMENT</identity-object-type>
-
<identity-object-type>ORGANIZATION</identity-object-type>
-
<identity-object-type>ORGANIZATION_UNIT</identity-object-type>
- <identity-object-type>OFFICE</identity-object-type>
- </identity-object-types>
- <options>
- <option>
- <name>cache</name>
- <value>true</value>
- </option>
- <option>
- <name>cache.config-file</name>
- <value>jboss-cache-config.xml</value>
- </option>
- </options>
- </identity-store-mapping>
- </identity-store-mappings>
- <options>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- </options>
- </repository>
- </repositories>
- <stores>
- <attribute-stores/>
- <identity-stores>
- <identity-store>
- <id>Hibernate Identity Store</id>
-
<class>org.jboss.identity.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
- <external-config/>
- <supported-relationship-types>
-
<relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
-
<relationship-type>JBOSS_IDENTITY_ROLE</relationship-type>
- </supported-relationship-types>
- <supported-identity-object-types>
- <identity-object-type>
- <name>USER</name>
- <relationships>
- <!--<relationship>-->
-
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
-
<!--<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>-->
- <!--</relationship>-->
- <!--<relationship>-->
-
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
-
<!--<identity-object-type-ref>COMMUNITY</identity-object-type-ref>-->
- <!--</relationship>-->
- <!--<relationship>-->
-
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
-
<!--<identity-object-type-ref>OFFICE</identity-object-type-ref>-->
- <!--</relationship>-->
- <!--<relationship>-->
-
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
-
<!--<identity-object-type-ref>SECURITY</identity-object-type-ref>-->
- <!--</relationship>-->
- <!--<relationship>-->
-
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
-
<!--<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>-->
- <!--</relationship>-->
- <!--<relationship>-->
-
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
-
<!--<identity-object-type-ref>PROJECT</identity-object-type-ref>-->
- <!--</relationship>-->
- <!--<relationship>-->
-
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
-
<!--<identity-object-type-ref>PEOPLE</identity-object-type-ref>-->
- <!--</relationship>-->
- </relationships>
- <credentials>
- <credential-type>PASSWORD</credential-type>
- </credentials>
- <attributes>
- <attribute>
- <name>picture</name>
- <mapping>user.picture</mapping>
- <type>binary</type>
- <isRequired>false</isRequired>
- <isMultivalued>false</isMultivalued>
- <isReadOnly>false</isReadOnly>
- </attribute>
- </attributes>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>ORGANIZATION</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>DIVISION</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>ORGANIZATION_UNIT</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>DIVISION</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>OFFICE</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>PEOPLE</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>PROJECT</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>DIVISION</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>DEPARTMENT</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>PROJECT</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>PEOPLE</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>ADMINISTRATION</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>COMMUNITY</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>OFFICE</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>SECURITY</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>SYSTEM</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>SECURITY</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>COMMUNITY</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- </supported-identity-object-types>
- <options>
- <!--<option>-->
- <!--<name>hibernateConfiguration</name>-->
-
<!--<value>hibernate-jboss-identity.cfg.xml</value>-->
- <!--</option>-->
- <option>
- <name>hibernateSessionFactoryJNDIName</name>
-
<value>java:/jbossidentity/HibernateStoreSessionFactory</value>
- </option>
- <option>
- <name>populateRelationshipTypes</name>
- <value>true</value>
- </option>
- <option>
- <name>populateIdentityObjectTypes</name>
- <value>true</value>
- </option>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- <option>
- <name>isRealmAware</name>
- <value>true</value>
- </option>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- </options>
- </identity-store>
- <identity-store>
- <id>LDAP Identity Store</id>
-
<class>org.jboss.identity.idm.impl.store.ldap.LDAPIdentityStoreImpl</class>
- <external-config/>
- <supported-relationship-types>
-
<relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
- </supported-relationship-types>
- <supported-identity-object-types>
- <identity-object-type>
- <name>USER</name>
- <relationships/>
- <credentials>
- <credential-type>PASSWORD</credential-type>
- </credentials>
- <attributes>
- <attribute>
- <name>phone</name>
- <mapping>telephoneNumber</mapping>
- <type>text</type>
- <isRequired>false</isRequired>
- <isMultivalued>false</isMultivalued>
- <isReadOnly>false</isReadOnly>
- </attribute>
- <attribute>
- <name>description</name>
- <mapping>description</mapping>
- <type>text</type>
- <isRequired>false</isRequired>
- <isMultivalued>false</isMultivalued>
- <isReadOnly>false</isReadOnly>
- </attribute>
- <attribute>
- <name>carLicense</name>
- <mapping>carLicense</mapping>
- <type>text</type>
- <isRequired>false</isRequired>
- <isMultivalued>false</isMultivalued>
- <isReadOnly>false</isReadOnly>
- </attribute>
- </attributes>
- <options>
- <option>
- <name>idAttributeName</name>
- <value>uid</value>
- </option>
- <option>
- <name>passwordAttributeName</name>
- <value>userPassword</value>
- </option>
- <option>
- <name>ctxDNs</name>
-
<value>ou=People,o=test,dc=portal,dc=example,dc=com</value>
- </option>
- <option>
- <name>allowCreateEntry</name>
- <value>true</value>
- </option>
- <option>
- <name>createEntryAttributeValues</name>
- <value>objectClass=top</value>
- <value>objectClass=inetOrgPerson</value>
- <value>sn= </value>
- <value>cn= </value>
- </option>
- </options>
- </identity-object-type>
- <identity-object-type>
- <name>ORGANIZATION</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>OFFICE</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options>
- <option>
- <name>idAttributeName</name>
- <value>cn</value>
- </option>
- <option>
- <name>ctxDNs</name>
-
<value>ou=Organizations,o=test,dc=portal,dc=example,dc=com</value>
- </option>
- <!--<option>-->
- <!--<name>entrySearchFilter</name>-->
- <!--<value></value>-->
- <!--</option>-->
- <option>
- <name>allowCreateEntry</name>
- <value>true</value>
- </option>
- <option>
- <name>membershipAttributeName</name>
- <value>member</value>
- </option>
- <option>
- <name>isMembershipAttributeDN</name>
- <value>true</value>
- </option>
- <option>
- <name>allowEmptyMemberships</name>
- <value>true</value>
- </option>
- <option>
- <name>createEntryAttributeValues</name>
- <value>objectClass=top</value>
- <value>objectClass=groupOfNames</value>
- </option>
- </options>
- </identity-object-type>
- <identity-object-type>
- <name>ORGANIZATION_UNIT</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>OFFICE</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options>
- <option>
- <name>idAttributeName</name>
- <value>cn</value>
- </option>
- <option>
- <name>ctxDNs</name>
-
<value>ou=OrganizationUnits,o=test,dc=portal,dc=example,dc=com</value>
- </option>
- <!--<option>-->
- <!--<name>entrySearchFilter</name>-->
- <!--<value></value>-->
- <!--</option>-->
- <option>
- <name>allowCreateEntry</name>
- <value>true</value>
- </option>
- <option>
- <name>membershipAttributeName</name>
- <value>member</value>
- </option>
- <option>
- <name>isMembershipAttributeDN</name>
- <value>true</value>
- </option>
- <option>
- <name>allowEmptyMemberships</name>
- <value>true</value>
- </option>
- <option>
- <name>createEntryAttributeValues</name>
- <value>objectClass=top</value>
- <value>objectClass=groupOfNames</value>
- </option>
- </options>
- </identity-object-type>
- <identity-object-type>
- <name>DEPARTMENT</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options>
- <option>
- <name>idAttributeName</name>
- <value>cn</value>
- </option>
- <option>
- <name>ctxDNs</name>
-
<value>ou=Departments,o=test,dc=portal,dc=example,dc=com</value>
- </option>
- <!--<option>-->
- <!--<name>entrySearchFilter</name>-->
- <!--<value></value>-->
- <!--</option>-->
- <option>
- <name>allowCreateEntry</name>
- <value>true</value>
- </option>
- <option>
- <name>membershipAttributeName</name>
- <value>member</value>
- </option>
- <option>
- <name>isMembershipAttributeDN</name>
- <value>true</value>
- </option>
- <option>
- <name>allowEmptyMemberships</name>
- <value>true</value>
- </option>
- <option>
- <name>createEntryAttributeValues</name>
- <value>objectClass=top</value>
- <value>objectClass=groupOfNames</value>
- </option>
- </options>
- </identity-object-type>
- <identity-object-type>
- <name>OFFICE</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options>
- <option>
- <name>idAttributeName</name>
- <value>cn</value>
- </option>
- <option>
- <name>ctxDNs</name>
-
<value>ou=Offices,o=test,dc=portal,dc=example,dc=com</value>
- </option>
- <!--<option>-->
- <!--<name>entrySearchFilter</name>-->
- <!--<value></value>-->
- <!--</option>-->
- <option>
- <name>allowCreateEntry</name>
- <value>true</value>
- </option>
- <option>
- <name>membershipAttributeName</name>
- <value>member</value>
- </option>
- <option>
- <name>isMembershipAttributeDN</name>
- <value>true</value>
- </option>
- <option>
- <name>allowEmptyMemberships</name>
- <value>true</value>
- </option>
- <option>
- <name>createEntryAttributeValues</name>
- <value>objectClass=top</value>
- <value>objectClass=groupOfNames</value>
- </option>
- </options>
- </identity-object-type>
- </supported-identity-object-types>
- <options>
- <option>
- <name>providerURL</name>
- <value>ldap://localhost:10389</value>
- </option>
- <option>
- <name>adminDN</name>
- <value>cn=Directory Manager</value>
- </option>
- <option>
- <name>adminPassword</name>
- <value>password</value>
- </option>
- <option>
- <name>searchTimeLimit</name>
- <value>10000</value>
- </option>
- </options>
- </identity-store>
- </identity-stores>
- </stores>
-</jboss-identity>
\ No newline at end of file
Deleted: idm/trunk/idm-core/src/test/resources/store-test-config.xml
===================================================================
--- idm/trunk/idm-core/src/test/resources/store-test-config.xml 2009-05-09 10:22:47 UTC
(rev 484)
+++ idm/trunk/idm-core/src/test/resources/store-test-config.xml 2009-05-09 11:10:49 UTC
(rev 485)
@@ -1,373 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<jboss-identity xmlns="urn:jboss:identity:idm:config:v1_0_alpha"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:jboss:identity:idm:config:v1_0_alpha
identity-config.xsd">
- <realms>
- <realm>
- <id>realm://Dymmy</id>
- <repository-id-ref>X</repository-id-ref>
- <identity-type-mappings>
- <user-mapping>USER</user-mapping>
- </identity-type-mappings>
- </realm>
- </realms>
- <repositories>
- <repository>
- <id>X</id>
- <class>X</class>
- <external-config/>
-
<default-identity-store-id>HibernateTestStore</default-identity-store-id>
-
<default-attribute-store-id>HibernateTestStore</default-attribute-store-id>
- <!--<identity-store-mappings>-->
- <!--<identity-store-mapping>-->
-
<!--<identity-store-id>HibernateTestStore</identity-store-id>-->
- <!--<identity-object-types/>-->
- <!--<options/>-->
- <!--</identity-store-mapping>-->
- <!--</identity-store-mappings>-->
- </repository>
- </repositories>
- <stores>
- <attribute-stores/>
- <identity-stores>
- <identity-store>
- <id>HibernateTestStore</id>
-
<class>org.jboss.identity.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
- <external-config/>
- <supported-relationship-types>
-
<relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
-
<relationship-type>JBOSS_IDENTITY_ROLE</relationship-type>
- </supported-relationship-types>
- <supported-identity-object-types>
- <identity-object-type>
- <name>USER</name>
- <relationships/>
- <credentials>
- <credential-type>PASSWORD</credential-type>
- <credential-type>BINARY</credential-type>
- </credentials>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>GROUP</name>
- <relationships/>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>ORGANIZATION</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>ROLE</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>GROUP</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>ROLE</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- </supported-identity-object-types>
- <options>
- <!--<option>-->
- <!--<name>hibernateConfiguration</name>-->
-
<!--<value>hibernate-jboss-identity.cfg.xml</value>-->
- <!--</option>-->
- <option>
- <name>hibernateSessionFactoryJNDIName</name>
-
<value>java:/jbossidentity/HibernateStoreSessionFactory</value>
- </option>
- <option>
- <name>populateRelationshipTypes</name>
- <value>true</value>
- </option>
- <option>
- <name>populateIdentityObjectTypes</name>
- <value>true</value>
- </option>
- <option>
- <name>isRealmAware</name>
- <value>false</value>
- </option>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- </options>
- </identity-store>
- <identity-store>
- <id>LDAPTestStore</id>
-
<class>org.jboss.identity.idm.impl.store.ldap.LDAPIdentityStoreImpl</class>
- <external-config/>
- <supported-relationship-types>
-
<relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
- </supported-relationship-types>
- <supported-identity-object-types>
- <identity-object-type>
- <name>USER</name>
- <relationships/>
- <credentials>
- <credential-type>PASSWORD</credential-type>
- </credentials>
- <attributes>
- <attribute>
- <name>phone</name>
- <mapping>telephoneNumber</mapping>
- <type>text</type>
- <isRequired/>
- <isMultivalued>true</isMultivalued>
- <isReadOnly/>
- </attribute>
- <attribute>
- <name>description</name>
- <mapping>description</mapping>
- <type>text</type>
- <isRequired/>
- <isMultivalued>true</isMultivalued>
- <isReadOnly/>
- </attribute>
- <attribute>
- <name>carLicense</name>
- <mapping>carLicense</mapping>
- <type>text</type>
- <isRequired/>
- <isMultivalued>true</isMultivalued>
- <isReadOnly/>
- </attribute>
- </attributes>
- <options>
- <option>
- <name>idAttributeName</name>
- <value>uid</value>
- </option>
- <option>
- <name>passwordAttributeName</name>
- <value>userPassword</value>
- </option>
- <option>
- <name>ctxDNs</name>
-
<value>ou=People,o=test,dc=portal,dc=example,dc=com</value>
- </option>
- <option>
- <name>allowCreateEntry</name>
- <value>true</value>
- </option>
- <option>
- <name>createEntryAttributeValues</name>
- <value>objectClass=top</value>
- <value>objectClass=inetOrgPerson</value>
- <value>sn= </value>
- <value>cn= </value>
- </option>
- </options>
- </identity-object-type>
- <identity-object-type>
- <name>GROUP</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>ROLE</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>GROUP</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options>
- <option>
- <name>idAttributeName</name>
- <value>cn</value>
- </option>
- <option>
- <name>ctxDNs</name>
-
<value>ou=Groups,o=test,dc=portal,dc=example,dc=com</value>
- </option>
- <!--<option>-->
- <!--<name>entrySearchFilter</name>-->
- <!--<value></value>-->
- <!--</option>-->
- <option>
- <name>allowCreateEntry</name>
- <value>true</value>
- </option>
- <option>
- <name>membershipAttributeName</name>
- <value>member</value>
- </option>
- <option>
- <name>isMembershipAttributeDN</name>
- <value>true</value>
- </option>
- <option>
- <name>allowEmptyMemberships</name>
- <value>true</value>
- </option>
- <option>
- <name>createEntryAttributeValues</name>
- <value>objectClass=top</value>
- <value>objectClass=groupOfNames</value>
- </option>
- </options>
- </identity-object-type>
- <identity-object-type>
- <name>ORGANIZATION</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>ROLE</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>GROUP</identity-object-type-ref>
- </relationship>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options>
- <option>
- <name>idAttributeName</name>
- <value>cn</value>
- </option>
- <option>
- <name>ctxDNs</name>
-
<value>ou=Organizations,o=test,dc=portal,dc=example,dc=com</value>
- </option>
- <!--<option>-->
- <!--<name>entrySearchFilter</name>-->
- <!--<value></value>-->
- <!--</option>-->
- <option>
- <name>allowCreateEntry</name>
- <value>true</value>
- </option>
- <option>
- <name>membershipAttributeName</name>
- <value>member</value>
- </option>
- <option>
- <name>isMembershipAttributeDN</name>
- <value>true</value>
- </option>
- <option>
- <name>allowEmptyMemberships</name>
- <value>true</value>
- </option>
- <option>
- <name>createEntryAttributeValues</name>
- <value>objectClass=top</value>
- <value>objectClass=groupOfNames</value>
- </option>
- </options>
- </identity-object-type>
- <identity-object-type>
- <name>ROLE</name>
- <relationships>
- <relationship>
-
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
-
<identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options>
- <option>
- <name>idAttributeName</name>
- <value>cn</value>
- </option>
- <option>
- <name>ctxDNs</name>
-
<value>ou=Roles,o=test,dc=portal,dc=example,dc=com</value>
- </option>
- <!--<option>-->
- <!--<name>entrySearchFilter</name>-->
- <!--<value></value>-->
- <!--</option>-->
- <option>
- <name>allowCreateEntry</name>
- <value>true</value>
- </option>
- <option>
- <name>membershipAttributeName</name>
- <value>member</value>
- </option>
- <option>
- <name>isMembershipAttributeDN</name>
- <value>true</value>
- </option>
- <option>
- <name>allowEmptyMemberships</name>
- <value>true</value>
- </option>
- <option>
- <name>createEntryAttributeValues</name>
- <value>objectClass=top</value>
- <value>objectClass=groupOfNames</value>
- </option>
- </options>
- </identity-object-type>
- </supported-identity-object-types>
- <options>
- <option>
- <name>providerURL</name>
- <value>ldap://localhost:10389</value>
- </option>
- <option>
- <name>adminDN</name>
- <value>cn=Directory Manager</value>
- </option>
- <option>
- <name>adminPassword</name>
- <value>password</value>
- </option>
- <option>
- <name>searchTimeLimit</name>
- <value>10000</value>
- </option>
- </options>
- </identity-store>
- </identity-stores>
- </stores>
-</jboss-identity>
\ No newline at end of file
Added: idm/trunk/idm-core/src/test/resources/store-test-config.xml
===================================================================
--- idm/trunk/idm-core/src/test/resources/store-test-config.xml
(rev 0)
+++ idm/trunk/idm-core/src/test/resources/store-test-config.xml 2009-05-09 11:10:49 UTC
(rev 485)
@@ -0,0 +1,373 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jboss-identity xmlns="urn:jboss:identity:idm:config:v1_0_alpha"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:identity:idm:config:v1_0_alpha
identity-config.xsd">
+ <realms>
+ <realm>
+ <id>realm://Dymmy</id>
+ <repository-id-ref>X</repository-id-ref>
+ <identity-type-mappings>
+ <user-mapping>USER</user-mapping>
+ </identity-type-mappings>
+ </realm>
+ </realms>
+ <repositories>
+ <repository>
+ <id>X</id>
+ <class>X</class>
+ <external-config/>
+
<default-identity-store-id>HibernateTestStore</default-identity-store-id>
+
<default-attribute-store-id>HibernateTestStore</default-attribute-store-id>
+ <!--<identity-store-mappings>-->
+ <!--<identity-store-mapping>-->
+
<!--<identity-store-id>HibernateTestStore</identity-store-id>-->
+ <!--<identity-object-types/>-->
+ <!--<options/>-->
+ <!--</identity-store-mapping>-->
+ <!--</identity-store-mappings>-->
+ </repository>
+ </repositories>
+ <stores>
+ <attribute-stores/>
+ <identity-stores>
+ <identity-store>
+ <id>HibernateTestStore</id>
+
<class>org.jboss.identity.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
+ <external-config/>
+ <supported-relationship-types>
+
<relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
+
<relationship-type>JBOSS_IDENTITY_ROLE</relationship-type>
+ </supported-relationship-types>
+ <supported-identity-object-types>
+ <identity-object-type>
+ <name>USER</name>
+ <relationships/>
+ <credentials>
+ <credential-type>PASSWORD</credential-type>
+ <credential-type>BINARY</credential-type>
+ </credentials>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>GROUP</name>
+ <relationships/>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>ORGANIZATION</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ROLE</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>GROUP</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>ROLE</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ </supported-identity-object-types>
+ <options>
+ <!--<option>-->
+ <!--<name>hibernateConfiguration</name>-->
+
<!--<value>hibernate-jboss-identity.cfg.xml</value>-->
+ <!--</option>-->
+ <option>
+ <name>hibernateSessionFactoryJNDIName</name>
+
<value>java:/jbossidentity/HibernateStoreSessionFactory</value>
+ </option>
+ <option>
+ <name>populateRelationshipTypes</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>populateIdentityObjectTypes</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>isRealmAware</name>
+ <value>false</value>
+ </option>
+ <option>
+ <name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ </options>
+ </identity-store>
+ <identity-store>
+ <id>LDAPTestStore</id>
+
<class>org.jboss.identity.idm.impl.store.ldap.LDAPIdentityStoreImpl</class>
+ <external-config/>
+ <supported-relationship-types>
+
<relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
+ </supported-relationship-types>
+ <supported-identity-object-types>
+ <identity-object-type>
+ <name>USER</name>
+ <relationships/>
+ <credentials>
+ <credential-type>PASSWORD</credential-type>
+ </credentials>
+ <attributes>
+ <attribute>
+ <name>phone</name>
+ <mapping>telephoneNumber</mapping>
+ <type>text</type>
+ <isRequired/>
+ <isMultivalued>true</isMultivalued>
+ <isReadOnly/>
+ </attribute>
+ <attribute>
+ <name>description</name>
+ <mapping>description</mapping>
+ <type>text</type>
+ <isRequired/>
+ <isMultivalued>true</isMultivalued>
+ <isReadOnly/>
+ </attribute>
+ <attribute>
+ <name>carLicense</name>
+ <mapping>carLicense</mapping>
+ <type>text</type>
+ <isRequired/>
+ <isMultivalued>true</isMultivalued>
+ <isReadOnly/>
+ </attribute>
+ </attributes>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>uid</value>
+ </option>
+ <option>
+ <name>passwordAttributeName</name>
+ <value>userPassword</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+
<value>ou=People,o=test,dc=portal,dc=example,dc=com</value>
+ </option>
+ <option>
+ <name>allowCreateEntry</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>createEntryAttributeValues</name>
+ <value>objectClass=top</value>
+ <value>objectClass=inetOrgPerson</value>
+ <value>sn= </value>
+ <value>cn= </value>
+ </option>
+ </options>
+ </identity-object-type>
+ <identity-object-type>
+ <name>GROUP</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ROLE</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>GROUP</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+
<value>ou=Groups,o=test,dc=portal,dc=example,dc=com</value>
+ </option>
+ <!--<option>-->
+ <!--<name>entrySearchFilter</name>-->
+ <!--<value></value>-->
+ <!--</option>-->
+ <option>
+ <name>allowCreateEntry</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>membershipAttributeName</name>
+ <value>member</value>
+ </option>
+ <option>
+ <name>isMembershipAttributeDN</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowEmptyMemberships</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>createEntryAttributeValues</name>
+ <value>objectClass=top</value>
+ <value>objectClass=groupOfNames</value>
+ </option>
+ </options>
+ </identity-object-type>
+ <identity-object-type>
+ <name>ORGANIZATION</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ROLE</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>GROUP</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+
<value>ou=Organizations,o=test,dc=portal,dc=example,dc=com</value>
+ </option>
+ <!--<option>-->
+ <!--<name>entrySearchFilter</name>-->
+ <!--<value></value>-->
+ <!--</option>-->
+ <option>
+ <name>allowCreateEntry</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>membershipAttributeName</name>
+ <value>member</value>
+ </option>
+ <option>
+ <name>isMembershipAttributeDN</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowEmptyMemberships</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>createEntryAttributeValues</name>
+ <value>objectClass=top</value>
+ <value>objectClass=groupOfNames</value>
+ </option>
+ </options>
+ </identity-object-type>
+ <identity-object-type>
+ <name>ROLE</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+
<value>ou=Roles,o=test,dc=portal,dc=example,dc=com</value>
+ </option>
+ <!--<option>-->
+ <!--<name>entrySearchFilter</name>-->
+ <!--<value></value>-->
+ <!--</option>-->
+ <option>
+ <name>allowCreateEntry</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>membershipAttributeName</name>
+ <value>member</value>
+ </option>
+ <option>
+ <name>isMembershipAttributeDN</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowEmptyMemberships</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>createEntryAttributeValues</name>
+ <value>objectClass=top</value>
+ <value>objectClass=groupOfNames</value>
+ </option>
+ </options>
+ </identity-object-type>
+ </supported-identity-object-types>
+ <options>
+ <option>
+ <name>providerURL</name>
+ <value>ldap://localhost:10389</value>
+ </option>
+ <option>
+ <name>adminDN</name>
+ <value>cn=Directory Manager</value>
+ </option>
+ <option>
+ <name>adminPassword</name>
+ <value>password</value>
+ </option>
+ <option>
+ <name>searchTimeLimit</name>
+ <value>10000</value>
+ </option>
+ </options>
+ </identity-store>
+ </identity-stores>
+ </stores>
+</jboss-identity>
\ No newline at end of file
Added: idm/trunk/idm-hibernate/pom.xml
===================================================================
--- idm/trunk/idm-hibernate/pom.xml (rev 0)
+++ idm/trunk/idm-hibernate/pom.xml 2009-05-09 11:10:49 UTC (rev 485)
@@ -0,0 +1,207 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.jboss.identity</groupId>
+ <artifactId>idm-parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../parent</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>idm-hibernate</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss Identity IDM Hibernate</name>
+ <
url>http://labs.jboss.org/portal/jbosssecurity/</url>
+ <description>JBoss Identity IDM Hibernate</description>
+ <licenses>
+ <license>
+ <name>lgpl</name>
+ <
url>http://repository.jboss.com/licenses/lgpl.txt</url>
+ </license>
+ </licenses>
+ <organization>
+ <name>JBoss Inc.</name>
+ <url>http://www.jboss.org</url>
+ </organization>
+ <scm>
+
<
connection>scm:svn:http://anonsvn.jboss.org/repos/jbossidentity/trunk&...
+
<
developerConnection>scm:svn:https://svn.jboss.org/jbossidentity/trunk&...
+
<
url>http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossidentity/trunk<...
+ </scm>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.identity</groupId>
+ <artifactId>idm-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <!-- hibernate -->
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
+ <version>3.3.1.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-annotations</artifactId>
+ <version>3.4.0.GA</version>
+ </dependency>
+ <!--Javassist as Hibernate's bytecode provider-->
+ <dependency>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ <version>3.4.GA</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-cglib-repack</artifactId>
+ <version>2.1_3</version>
+ </dependency>
+
+
+ <!-- Hibernate logging set up -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.5.2</version>
+ </dependency>
+ <!--<dependency>-->
+ <!--<groupId>log4j</groupId>-->
+ <!--<artifactId>log4j</artifactId>-->
+ <!--<version>1.2.14</version>-->
+ <!--</dependency>-->
+
+
+ <dependency>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-core</artifactId>
+ <version>3.0.2.GA</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>dataSourceName</name>
+ <value>${dataSourceName}</value>
+ </property>
+ <property>
+ <name>directoryName</name>
+ <value>${directoryName}</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ <!--<plugin>-->
+ <!--<groupId>org.jboss.unit</groupId>-->
+
<!--<artifactId>jboss-unit-tooling-maven2</artifactId>-->
+ <!--<executions>-->
+ <!--<execution>-->
+ <!--<phase>test</phase>-->
+ <!--<goals>-->
+ <!--<goal>execute</goal>-->
+ <!--</goals>-->
+ <!--</execution>-->
+ <!--</executions>-->
+ <!--<configuration>-->
+
+ <!--<jpda>true</jpda>-->
+ <!--<jpdaPort>5005</jpdaPort>-->
+ <!--<jpdaSuspend>true</jpdaSuspend>-->
+
+ <!--<failOnError>true</failOnError>-->
+
+
+ <!--<testsuites>-->
+ <!--<testsuite>-->
+ <!--<config>jboss-unit.xml</config>-->
+ <!--<parameters>-->
+ <!--<parameter>-->
+ <!--<name>dataSourceName</name>-->
+ <!--<values>-->
+ <!--<value>hsqldb</value>-->
+ <!--<value>mysql5</value>-->
+ <!--<value>mysql4</value>-->
+
<!--<value>postgresql8</value>-->
+
<!--<value>sqlserver</value>-->
+ <!--<value>oracle9i</value>-->
+
<!--<value>oracle10g</value>-->
+ <!--</values>-->
+ <!--</parameter>-->
+ <!--</parameters>-->
+
+
+ <!--</testsuite>-->
+ <!--</testsuites>-->
+
+ <!--<reports>-->
+ <!--<xml>idm/target/tests/reports/xml</xml>-->
+
<!--<html>idm/target/tests/reports/html</html>-->
+ <!--</reports>-->
+ <!--</configuration>-->
+ <!--</plugin>-->
+
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>provided-jdbc-driver</id>
+ <dependencies>
+ <dependency>
+ <groupId>privided</groupId>
+ <artifactId>jdbc-driver</artifactId>
+ <version>NA</version>
+ <scope>system</scope>
+ <systemPath>${provided.jdbc.driver.path}</systemPath>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>provided-jdbc-driver2</id>
+ <dependencies>
+ <dependency>
+ <groupId>privided</groupId>
+ <artifactId>jdbc-driver2</artifactId>
+ <version>NA</version>
+ <scope>system</scope>
+ <systemPath>${provided.jdbc.driver.path2}</systemPath>
+ </dependency>
+ </dependencies>
+ </profile>
+ <!--<profile>-->
+ <!--<id>oracle-provided-jdbc-drivers</id>-->
+ <!--<dependencies>-->
+ <!--<dependency>-->
+ <!--<groupId>oracle</groupId>-->
+ <!--<artifactId>jdbc-driver1</artifactId>-->
+ <!--<version>NA</version>-->
+ <!--<scope>system</scope>-->
+
<!--<systemPath>${oracle.jdbc.driver1}</systemPath>-->
+ <!--</dependency>-->
+ <!--<dependency>-->
+ <!--<groupId>oracle</groupId>-->
+ <!--<artifactId>jdbc-driver2</artifactId>-->
+ <!--<version>NA</version>-->
+ <!--<scope>system</scope>-->
+
<!--<systemPath>${oracle.jdbc.driver1}</systemPath>-->
+ <!--</dependency>-->
+ <!--</dependencies>-->
+ <!--</profile>-->
+ </profiles>
+</project>
Copied: idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate
(from rev 482,
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/model/hibernate)
Copied: idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/store/hibernate
(from rev 482,
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/store/hibernate)
Added: idm/trunk/idm-ldap/pom.xml
===================================================================
--- idm/trunk/idm-ldap/pom.xml (rev 0)
+++ idm/trunk/idm-ldap/pom.xml 2009-05-09 11:10:49 UTC (rev 485)
@@ -0,0 +1,164 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.jboss.identity</groupId>
+ <artifactId>idm-parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../parent</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>idm-ldap</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss Identity IDM LDAP</name>
+ <
url>http://labs.jboss.org/portal/jbosssecurity/</url>
+ <description>JBoss Identity IDM LDAP</description>
+ <licenses>
+ <license>
+ <name>lgpl</name>
+ <
url>http://repository.jboss.com/licenses/lgpl.txt</url>
+ </license>
+ </licenses>
+ <organization>
+ <name>JBoss Inc.</name>
+ <url>http://www.jboss.org</url>
+ </organization>
+ <scm>
+
<
connection>scm:svn:http://anonsvn.jboss.org/repos/jbossidentity/trunk&...
+
<
developerConnection>scm:svn:https://svn.jboss.org/jbossidentity/trunk&...
+
<
url>http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossidentity/trunk<...
+ </scm>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.identity</groupId>
+ <artifactId>idm-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>jboss-unit</artifactId>
+ <version>1.2.2</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>dataSourceName</name>
+ <value>${dataSourceName}</value>
+ </property>
+ <property>
+ <name>directoryName</name>
+ <value>${directoryName}</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ <!--<plugin>-->
+ <!--<groupId>org.jboss.unit</groupId>-->
+
<!--<artifactId>jboss-unit-tooling-maven2</artifactId>-->
+ <!--<executions>-->
+ <!--<execution>-->
+ <!--<phase>test</phase>-->
+ <!--<goals>-->
+ <!--<goal>execute</goal>-->
+ <!--</goals>-->
+ <!--</execution>-->
+ <!--</executions>-->
+ <!--<configuration>-->
+
+ <!--<jpda>true</jpda>-->
+ <!--<jpdaPort>5005</jpdaPort>-->
+ <!--<jpdaSuspend>true</jpdaSuspend>-->
+
+ <!--<failOnError>true</failOnError>-->
+
+
+ <!--<testsuites>-->
+ <!--<testsuite>-->
+ <!--<config>jboss-unit.xml</config>-->
+ <!--<parameters>-->
+ <!--<parameter>-->
+ <!--<name>dataSourceName</name>-->
+ <!--<values>-->
+ <!--<value>hsqldb</value>-->
+ <!--<value>mysql5</value>-->
+ <!--<value>mysql4</value>-->
+
<!--<value>postgresql8</value>-->
+
<!--<value>sqlserver</value>-->
+ <!--<value>oracle9i</value>-->
+
<!--<value>oracle10g</value>-->
+ <!--</values>-->
+ <!--</parameter>-->
+ <!--</parameters>-->
+
+
+ <!--</testsuite>-->
+ <!--</testsuites>-->
+
+ <!--<reports>-->
+ <!--<xml>idm/target/tests/reports/xml</xml>-->
+
<!--<html>idm/target/tests/reports/html</html>-->
+ <!--</reports>-->
+ <!--</configuration>-->
+ <!--</plugin>-->
+
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>provided-jdbc-driver</id>
+ <dependencies>
+ <dependency>
+ <groupId>privided</groupId>
+ <artifactId>jdbc-driver</artifactId>
+ <version>NA</version>
+ <scope>system</scope>
+ <systemPath>${provided.jdbc.driver.path}</systemPath>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>provided-jdbc-driver2</id>
+ <dependencies>
+ <dependency>
+ <groupId>privided</groupId>
+ <artifactId>jdbc-driver2</artifactId>
+ <version>NA</version>
+ <scope>system</scope>
+ <systemPath>${provided.jdbc.driver.path2}</systemPath>
+ </dependency>
+ </dependencies>
+ </profile>
+ <!--<profile>-->
+ <!--<id>oracle-provided-jdbc-drivers</id>-->
+ <!--<dependencies>-->
+ <!--<dependency>-->
+ <!--<groupId>oracle</groupId>-->
+ <!--<artifactId>jdbc-driver1</artifactId>-->
+ <!--<version>NA</version>-->
+ <!--<scope>system</scope>-->
+
<!--<systemPath>${oracle.jdbc.driver1}</systemPath>-->
+ <!--</dependency>-->
+ <!--<dependency>-->
+ <!--<groupId>oracle</groupId>-->
+ <!--<artifactId>jdbc-driver2</artifactId>-->
+ <!--<version>NA</version>-->
+ <!--<scope>system</scope>-->
+
<!--<systemPath>${oracle.jdbc.driver1}</systemPath>-->
+ <!--</dependency>-->
+ <!--</dependencies>-->
+ <!--</profile>-->
+ </profiles>
+</project>
Copied: idm/trunk/idm-ldap/src/main/java/org/jboss/identity/idm/impl/model/ldap (from rev
482, idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/model/ldap)
Copied: idm/trunk/idm-ldap/src/main/java/org/jboss/identity/idm/impl/store/ldap (from rev
482, idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/store/ldap)
Added: idm/trunk/idm-testsuite/pom.xml
===================================================================
--- idm/trunk/idm-testsuite/pom.xml (rev 0)
+++ idm/trunk/idm-testsuite/pom.xml 2009-05-09 11:10:49 UTC (rev 485)
@@ -0,0 +1,284 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.jboss.identity</groupId>
+ <artifactId>idm-parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../parent</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>idm-testsuite</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss Identity IDM Testsuite</name>
+ <
url>http://labs.jboss.org/portal/jbosssecurity/</url>
+ <description>JBoss Identity IDM Testsuite</description>
+ <licenses>
+ <license>
+ <name>lgpl</name>
+ <
url>http://repository.jboss.com/licenses/lgpl.txt</url>
+ </license>
+ </licenses>
+ <organization>
+ <name>JBoss Inc.</name>
+ <url>http://www.jboss.org</url>
+ </organization>
+ <scm>
+
<
connection>scm:svn:http://anonsvn.jboss.org/repos/jbossidentity/trunk&...
+
<
developerConnection>scm:svn:https://svn.jboss.org/jbossidentity/trunk&...
+
<
url>http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossidentity/trunk<...
+ </scm>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.identity</groupId>
+ <artifactId>idm-cache</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.identity</groupId>
+ <artifactId>idm-hibernate</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.identity</groupId>
+ <artifactId>idm-ldap</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.identity</groupId>
+ <artifactId>idm-core</artifactId>
+ <version>${project.version}</version>
+ <classifier>tests</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <version>1.8.0.7</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>sun-opends</groupId>
+ <artifactId>OpenDS</artifactId>
+ <version>1.0.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>berkeleydb</groupId>
+ <artifactId>je</artifactId>
+ <version>3.2.76</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!--JBoss Unit-->
+
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>jboss-unit</artifactId>
+ <version>1.2.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>portal-test</artifactId>
+ <version>1.2.2</version>
+
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>hibernate</groupId>
+ <artifactId>hibernate3</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>sun-opends</groupId>
+ <artifactId>opends-core</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>jboss.jbossas.core-libs</groupId>
+ <artifactId>jboss-local-jdbc</artifactId>
+ <version>4.0.4.GA</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jboss.jbossas.core-libs</groupId>
+ <artifactId>jboss-common-jdbc-wrapper</artifactId>
+ <version>4.0.4.GA</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ <version>2.0.2.GA</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-logging-jdk</artifactId>
+ <version>2.0.2.GA</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-logging-log4j</artifactId>
+ <version>2.0.2.GA</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>apache-log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <version>5.1.6</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>8.3-604.jdbc3</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>net.sourceforge.jtds</groupId>
+ <artifactId>jtds</artifactId>
+ <version>1.2.2</version>
+ <scope>test</scope>
+ </dependency>
+
+
+
+
+ </dependencies>
+
+
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>dataSourceName</name>
+ <value>${dataSourceName}</value>
+ </property>
+ <property>
+ <name>directoryName</name>
+ <value>${directoryName}</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ <!--<plugin>-->
+ <!--<groupId>org.jboss.unit</groupId>-->
+
<!--<artifactId>jboss-unit-tooling-maven2</artifactId>-->
+ <!--<executions>-->
+ <!--<execution>-->
+ <!--<phase>test</phase>-->
+ <!--<goals>-->
+ <!--<goal>execute</goal>-->
+ <!--</goals>-->
+ <!--</execution>-->
+ <!--</executions>-->
+ <!--<configuration>-->
+
+ <!--<jpda>true</jpda>-->
+ <!--<jpdaPort>5005</jpdaPort>-->
+ <!--<jpdaSuspend>true</jpdaSuspend>-->
+
+ <!--<failOnError>true</failOnError>-->
+
+
+ <!--<testsuites>-->
+ <!--<testsuite>-->
+ <!--<config>jboss-unit.xml</config>-->
+ <!--<parameters>-->
+ <!--<parameter>-->
+ <!--<name>dataSourceName</name>-->
+ <!--<values>-->
+ <!--<value>hsqldb</value>-->
+ <!--<value>mysql5</value>-->
+ <!--<value>mysql4</value>-->
+
<!--<value>postgresql8</value>-->
+
<!--<value>sqlserver</value>-->
+ <!--<value>oracle9i</value>-->
+
<!--<value>oracle10g</value>-->
+ <!--</values>-->
+ <!--</parameter>-->
+ <!--</parameters>-->
+
+
+ <!--</testsuite>-->
+ <!--</testsuites>-->
+
+ <!--<reports>-->
+ <!--<xml>idm/target/tests/reports/xml</xml>-->
+
<!--<html>idm/target/tests/reports/html</html>-->
+ <!--</reports>-->
+ <!--</configuration>-->
+ <!--</plugin>-->
+
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>provided-jdbc-driver</id>
+ <dependencies>
+ <dependency>
+ <groupId>privided</groupId>
+ <artifactId>jdbc-driver</artifactId>
+ <version>NA</version>
+ <scope>system</scope>
+ <systemPath>${provided.jdbc.driver.path}</systemPath>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>provided-jdbc-driver2</id>
+ <dependencies>
+ <dependency>
+ <groupId>privided</groupId>
+ <artifactId>jdbc-driver2</artifactId>
+ <version>NA</version>
+ <scope>system</scope>
+ <systemPath>${provided.jdbc.driver.path2}</systemPath>
+ </dependency>
+ </dependencies>
+ </profile>
+ <!--<profile>-->
+ <!--<id>oracle-provided-jdbc-drivers</id>-->
+ <!--<dependencies>-->
+ <!--<dependency>-->
+ <!--<groupId>oracle</groupId>-->
+ <!--<artifactId>jdbc-driver1</artifactId>-->
+ <!--<version>NA</version>-->
+ <!--<scope>system</scope>-->
+
<!--<systemPath>${oracle.jdbc.driver1}</systemPath>-->
+ <!--</dependency>-->
+ <!--<dependency>-->
+ <!--<groupId>oracle</groupId>-->
+ <!--<artifactId>jdbc-driver2</artifactId>-->
+ <!--<version>NA</version>-->
+ <!--<scope>system</scope>-->
+
<!--<systemPath>${oracle.jdbc.driver1}</systemPath>-->
+ <!--</dependency>-->
+ <!--</dependencies>-->
+ <!--</profile>-->
+ </profiles>
+</project>
Copied:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/HibernateTestSupport.java
(from rev 482,
idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/impl/HibernateTestSupport.java)
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/HibernateTestSupport.java
(rev 0)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/HibernateTestSupport.java 2009-05-09
11:10:49 UTC (rev 485)
@@ -0,0 +1,135 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.impl;
+
+import
org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType;
+import org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType;
+import org.hibernate.SessionFactory;
+import org.hibernate.cfg.AnnotationConfiguration;
+
+import java.util.logging.Logger;
+import java.sql.Connection;
+import java.sql.DriverManager;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class HibernateTestSupport
+{
+ private static Logger logger =
Logger.getLogger(HibernateTestSupport.class.getName());
+
+ protected SessionFactory sessionFactory;
+
+ private Connection connection;
+
+ private final String databaseName;
+
+ private final String hibernateConfiguration;
+
+ public HibernateTestSupport(String databaseName, String hibernateConfiguration)
+ {
+ this.databaseName = databaseName;
+ this.hibernateConfiguration = hibernateConfiguration;
+ }
+
+ public SessionFactory getSessionFactory()
+ {
+ return sessionFactory;
+ }
+
+
+ public void start() throws Exception {
+ try {
+ logger.info("Starting in-memory HSQL database for unit tests");
+ Class.forName("org.hsqldb.jdbcDriver");
+ connection = DriverManager.getConnection("jdbc:hsqldb:mem:" +
databaseName, "sa", "");
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ logger.fine("Exception during HSQL database startup.");
+ throw ex;
+ }
+ try
+ {
+ logger.info("Building JPA EntityManager for unit tests");
+ //emFactory =
(HibernateEntityManagerFactory)Persistence.createEntityManagerFactory(persistenceUnit);
+ sessionFactory = new
AnnotationConfiguration().configure(hibernateConfiguration).buildSessionFactory();
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ logger.fine("Exception during JPA EntityManager instanciation.");
+ throw ex;
+ }
+ }
+
+ public void stop() throws Exception {
+ logger.info("Shuting down Hibernate JPA layer.");
+ if (sessionFactory != null)
+ {
+ sessionFactory.close();
+ }
+
+ logger.info("Stopping in-memory HSQL database.");
+ try
+ {
+ connection.createStatement().execute("SHUTDOWN");
+ }
+ catch (Exception ex) {
+ throw ex;
+ }
+ }
+
+ public void populateObjectTypes(String[] typeNames) throws Exception
+ {
+
+ sessionFactory.getCurrentSession().getTransaction().begin();
+
+ for (String typeName : typeNames)
+ {
+ HibernateIdentityObjectType hibernateType = new
HibernateIdentityObjectType(typeName);
+ sessionFactory.getCurrentSession().persist(hibernateType);
+ }
+
+ sessionFactory.getCurrentSession().getTransaction().commit();
+
+ }
+
+ public void populateRelationshipTypes(String[] typeNames) throws Exception
+ {
+
+ sessionFactory.getCurrentSession().getTransaction().begin();
+
+ for (String typeName : typeNames)
+ {
+ HibernateIdentityObjectRelationshipType hibernateType = new
HibernateIdentityObjectRelationshipType(typeName);
+ sessionFactory.getCurrentSession().persist(hibernateType);
+ }
+
+ sessionFactory.getCurrentSession().getTransaction().commit();
+ }
+
+
+}
Copied:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/IdentityTestPOJO.java
(from rev 482,
idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/impl/IdentityTestPOJO.java)
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/IdentityTestPOJO.java
(rev 0)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/IdentityTestPOJO.java 2009-05-09
11:10:49 UTC (rev 485)
@@ -0,0 +1,234 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.impl;
+
+import org.jboss.unit.api.pojo.annotations.Parameter;
+import static org.jboss.unit.api.Assert.assertTrue;
+import org.jboss.portal.test.framework.embedded.JNDISupport;
+import org.jboss.portal.test.framework.embedded.ConnectionManagerSupport;
+import org.jboss.portal.test.framework.embedded.TransactionManagerSupport;
+import org.jboss.portal.test.framework.embedded.DataSourceSupport;
+import org.jboss.portal.test.framework.embedded.HibernateSupport;
+import org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject;
+import org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute;
+import
org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute;
+import org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute;
+import org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential;
+import
org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType;
+import org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship;
+import
org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName;
+import
org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType;
+import org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType;
+import org.jboss.identity.idm.impl.model.hibernate.HibernateRealm;
+import
org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue;
+import org.jboss.identity.idm.test.HibernateAnnotationsSupport;
+import org.hibernate.SessionFactory;
+
+import java.util.List;
+import java.util.LinkedList;
+
+import junit.framework.TestCase;
+
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class IdentityTestPOJO extends TestCase
+{
+
+ private String identityConfig = "organization-test-jboss-unit-config.xml";
+
+ private String realmName;
+
+ private String dataSourceName = "hsqldb";
+
+ private String hibernateConfig = "datasources/hibernates.xml";
+
+ private String datasources = "datasources/datasources.xml";
+
+ private JNDISupport jndiSupport;
+
+ protected TransactionManagerSupport transactonManagerSupport;
+
+ protected ConnectionManagerSupport connectionManagerSupport;
+
+ protected DataSourceSupport dataSourceSupport;
+
+ protected HibernateSupport hibernateSupport;
+
+
+
+ public void start() throws Exception
+ {
+ overrideFromProperties();
+
+ jndiSupport = new JNDISupport();
+ jndiSupport.start();
+ transactonManagerSupport = new TransactionManagerSupport();
+ transactonManagerSupport.start();
+ connectionManagerSupport = new ConnectionManagerSupport();
+
connectionManagerSupport.setTransactionManager(transactonManagerSupport.getTransactionManager());
+ connectionManagerSupport.start();
+
+
+
+ DataSourceSupport.Config dataSourceConfig =
DataSourceSupport.Config.obtainConfig(datasources, dataSourceName);
+
+ HibernateSupport.Config hibernateSupportConfig =
HibernateSupport.getConfig(dataSourceName, hibernateConfig);
+
+ dataSourceSupport = new DataSourceSupport();
+
dataSourceSupport.setTransactionManager(transactonManagerSupport.getTransactionManager());
+
dataSourceSupport.setConnectionManagerReference(connectionManagerSupport.getConnectionManagerReference());
+ dataSourceSupport.setConfig(dataSourceConfig);
+ dataSourceSupport.start();
+
+ hibernateSupport = new HibernateAnnotationsSupport();
+ hibernateSupport.setConfig(hibernateSupportConfig);
+
hibernateSupport.setJNDIName("java:/jbossidentity/HibernateStoreSessionFactory");
+
+ List<String> annotatedClasses = new LinkedList<String>();
+ annotatedClasses.add(HibernateIdentityObject.class.getName());
+ annotatedClasses.add(HibernateIdentityObjectAttribute.class.getName());
+ annotatedClasses.add(HibernateIdentityObjectBinaryAttribute.class.getName());
+ annotatedClasses.add(HibernateIdentityObjectBinaryAttributeValue.class.getName());
+ annotatedClasses.add(HibernateIdentityObjectTextAttribute.class.getName());
+ annotatedClasses.add(HibernateIdentityObjectCredential.class.getName());
+ annotatedClasses.add(HibernateIdentityObjectCredentialType.class.getName());
+ annotatedClasses.add(HibernateIdentityObjectRelationship.class.getName());
+ annotatedClasses.add(HibernateIdentityObjectRelationshipName.class.getName());
+ annotatedClasses.add(HibernateIdentityObjectRelationshipType.class.getName());
+ annotatedClasses.add(HibernateIdentityObjectType.class.getName());
+ annotatedClasses.add(HibernateRealm.class.getName());
+
+ hibernateSupport.setMappings(annotatedClasses);
+
+ hibernateSupport.start();
+
+
+ }
+
+ public void stop() throws Exception
+ {
+ hibernateSupport.stop();
+ dataSourceSupport.stop();
+ connectionManagerSupport.stop();
+ transactonManagerSupport.stop();
+ jndiSupport.stop();
+
+
+ }
+
+ public void overrideFromProperties() throws Exception
+ {
+ String dsName =System.getProperties().getProperty("dataSourceName");
+
+ if (dsName != null && !dsName.startsWith("$"))
+ {
+ setDataSourceName(dsName);
+ }
+
+ }
+
+ public SessionFactory getSessionFactory()
+ {
+ return getHibernateSupport().getSessionFactory();
+ }
+
+
+
+
+ @Parameter(name="dataSourceName")
+ public void setDataSourceName(String dataSourceName)
+ {
+ this.dataSourceName = dataSourceName;
+ }
+
+ @Parameter(name="hibernateConfig")
+ public void setHibernateConfig(String hibernateConfig)
+ {
+ this.hibernateConfig = hibernateConfig;
+ }
+
+ @Parameter(name="datasources")
+ public void setDatasources(String datasources)
+ {
+ this.datasources = datasources;
+ }
+
+ @Parameter(name="identityConfig")
+ public void setIdentityConfig(String identityConfig)
+ {
+ this.identityConfig = identityConfig;
+ }
+
+ @Parameter(name="realmName")
+ public void setRealmName(String realmName)
+ {
+ this.realmName = realmName;
+ }
+
+ public String getDataSourceName()
+ {
+ return dataSourceName;
+ }
+
+ public String getHibernateConfig()
+ {
+ return hibernateConfig;
+ }
+
+ public String getDatasources()
+ {
+ return datasources;
+ }
+
+ public String getIdentityConfig()
+ {
+ return identityConfig;
+ }
+
+ public String getRealmName()
+ {
+ return realmName;
+ }
+
+ public HibernateSupport getHibernateSupport()
+ {
+ return hibernateSupport;
+ }
+
+ public void begin()
+ {
+ getHibernateSupport().openSession();
+ }
+
+ public void commit()
+ {
+ assertTrue(getHibernateSupport().commitTransaction());
+ }
+
+
+
+
+}
Copied:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/LDAPTestPOJO.java (from
rev 482, idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/impl/LDAPTestPOJO.java)
===================================================================
--- idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/LDAPTestPOJO.java
(rev 0)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/LDAPTestPOJO.java 2009-05-09
11:10:49 UTC (rev 485)
@@ -0,0 +1,185 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.impl;
+
+import org.jboss.identity.idm.opends.OpenDSService;
+import org.jboss.unit.api.pojo.annotations.Parameter;
+import org.opends.server.tools.LDAPModify;
+
+import javax.naming.Context;
+import javax.naming.NamingEnumeration;
+import javax.naming.Binding;
+import javax.naming.directory.DirContext;
+import javax.naming.ldap.InitialLdapContext;
+import javax.naming.ldap.LdapContext;
+import java.util.Hashtable;
+import java.io.File;
+import java.net.URL;
+import java.net.URISyntaxException;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class LDAPTestPOJO extends IdentityTestPOJO
+{
+
+ private String directoryName = "EmbeddedOpenDS";
+
+ public static final String LDAP_HOST = "localhost";
+
+ public static final String LDAP_PORT = "10389";
+
+ public static final String LDAP_PROVIDER_URL = "ldap://" + LDAP_HOST +
":" + LDAP_PORT;
+
+ public static final String LDAP_PRINCIPAL = "cn=Directory Manager";
+
+ public static final String LDAP_CREDENTIALS = "password";
+
+ public static Hashtable<String,String> env = new
Hashtable<String,String>();
+
+ static
+ {
+ env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
+ env.put(Context.PROVIDER_URL, LDAP_PROVIDER_URL);
+ env.put(Context.SECURITY_AUTHENTICATION, "simple");
+ env.put(Context.SECURITY_PRINCIPAL, LDAP_PRINCIPAL);
+ env.put(Context.SECURITY_CREDENTIALS, LDAP_CREDENTIALS);
+ }
+
+ OpenDSService openDSService = new OpenDSService(null);
+
+ @Override
+ public void start() throws Exception
+ {
+ super.start();
+
+
+ openDSService.start();
+
+
+ }
+
+ @Override
+ public void stop() throws Exception
+ {
+ super.stop();
+
+ cleanUp(new InitialLdapContext(env, null));
+ openDSService.stop();
+
+ }
+
+ public void overrideFromProperties() throws Exception
+ {
+ super.overrideFromProperties();
+
+ String dirName = System.getProperties().getProperty("directoryName");
+
+ if (dirName != null && !dirName.startsWith("$"))
+ {
+ setDirectoryName(dirName);
+ }
+
+ }
+
+ @Parameter
+ public void setDirectoryName(String directoryName)
+ {
+ this.directoryName = directoryName;
+ }
+
+ public String getDirectoryName()
+ {
+ return directoryName;
+ }
+
+ public void populate() throws Exception
+ {
+ populateLDIF("ldap/initial-opends.ldif");
+ }
+
+ public void populateClean() throws Exception
+ {
+ populateLDIF("ldap/initial-empty-opends.ldif");
+ }
+
+ public void populateLDIF(String ldif) throws Exception
+ {
+
+ URL ldifURL = Thread.currentThread().getContextClassLoader().getResource(ldif);
+
+ System.out.println("LDIF: " + ldifURL.toURI().getPath());
+
+ String[] cmd = new String[] {"-h", LDAP_HOST,
+ "-p", LDAP_PORT,
+ "-D", LDAP_PRINCIPAL,
+ "-w", LDAP_CREDENTIALS,
+ "-a", "-f", ldifURL.toURI().getPath()};
+
+ System.out.println("Populate success: " + (LDAPModify.mainModify(cmd,
false, System.out, System.err) == 0));
+
+ }
+
+ protected void cleanUp(DirContext ldapCtx) throws Exception
+ {
+ try
+ {
+ String dn = "dc=portal,dc=example,dc=com";
+
+ System.out.println("Removing: " + dn);
+
+ removeContext(ldapCtx, dn);
+ }
+ catch (Exception e)
+ {
+ //
+ }
+ }
+
+ //subsequent remove of javax.naming.Context
+ protected void removeContext(Context mainCtx, String name) throws Exception
+ {
+ Context deleteCtx = (Context)mainCtx.lookup(name);
+ NamingEnumeration subDirs = mainCtx.listBindings(name);
+
+ while (subDirs.hasMoreElements())
+ {
+ Binding binding = (Binding)subDirs.nextElement();
+ String subName = binding.getName();
+
+ removeContext(deleteCtx, subName);
+ }
+
+ mainCtx.unbind(name);
+ }
+
+
+ public LdapContext getLdapContext() throws Exception
+ {
+ return new InitialLdapContext(env, null);
+ }
+
+
+
+}
Added:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/APILDAPTestCase.java
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/APILDAPTestCase.java
(rev 0)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/APILDAPTestCase.java 2009-05-09
11:10:49 UTC (rev 485)
@@ -0,0 +1,137 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.impl.api;
+
+import junit.framework.TestCase;
+import org.jboss.identity.idm.impl.HibernateTestSupport;
+import org.jboss.identity.idm.impl.IdentityTestPOJO;
+import org.jboss.identity.idm.impl.LDAPTestPOJO;
+import org.jboss.identity.idm.impl.configuration.IdentityConfigurationImpl;
+import org.jboss.identity.idm.api.IdentitySessionFactory;
+import org.jboss.identity.idm.api.cfg.IdentityConfiguration;
+import org.jboss.identity.idm.opends.OpenDSService;
+import org.jboss.unit.api.pojo.annotations.Create;
+import org.jboss.unit.api.pojo.annotations.Destroy;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.opends.server.tools.LDAPModify;
+
+import javax.naming.directory.DirContext;
+import javax.naming.Context;
+import javax.naming.NamingEnumeration;
+import javax.naming.Binding;
+import javax.naming.ldap.InitialLdapContext;
+import java.util.Hashtable;
+import java.io.File;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class APILDAPTestCase extends LDAPTestPOJO implements APITestContext
+{
+
+ PersistenceManagerTest persistenceManagerTest;
+
+ RelationshipManagerTest relationshipManagerTest;
+
+ RoleManagerTest roleManagerTest;
+
+ UserQueryTest userQueryTest;
+
+ GroupQueryTest groupQueryTest;
+
+ RoleQueryTest roleQueryTest;
+
+ IdentitySessionFactory identitySessionFactory;
+
+ @Create
+ public void setUp() throws Exception
+ {
+ super.start();
+ persistenceManagerTest = new PersistenceManagerTest(this);
+ relationshipManagerTest = new RelationshipManagerTest(this);
+ roleManagerTest = new RoleManagerTest(this);
+
+ userQueryTest = new UserQueryTest(this);
+ groupQueryTest = new GroupQueryTest(this);
+ roleQueryTest = new RoleQueryTest(this);
+
+ setRealmName("realm://RedHat/DB_LDAP");
+
+ populateClean();
+
+
+ identitySessionFactory = new IdentityConfigurationImpl().
+ configure(getIdentityConfig()).buildIdentitySessionFactory();
+ }
+
+ @Destroy
+ public void tearDown() throws Exception
+ {
+ super.stop();
+ }
+
+ public IdentitySessionFactory getIdentitySessionFactory()
+ {
+ return identitySessionFactory;
+ }
+
+ @Test
+ public void testPersistenceManager() throws Exception
+ {
+ persistenceManagerTest.testMethods(getRealmName());
+ }
+
+ @Test
+ public void testRelationshipManager() throws Exception
+ {
+ relationshipManagerTest.testMethods(getRealmName());
+ }
+
+ @Test
+ public void testRelationshipManagerMergedRoleAssociations() throws Exception
+ {
+ relationshipManagerTest.testMergedRoleAssociations(getRealmName());
+ }
+
+ @Test
+ public void testRoleManager() throws Exception
+ {
+ roleManagerTest.testMethods(getRealmName());
+ }
+
+ public void testUserQuery() throws Exception
+ {
+ userQueryTest.testQuery(getRealmName());
+ }
+
+ public void testGroupQuery() throws Exception
+ {
+ groupQueryTest.testQuery(getRealmName());
+ }
+
+ public void testRoleQuery() throws Exception
+ {
+ roleQueryTest.testQuery(getRealmName());
+ }
+}
\ No newline at end of file
Added:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/APITestCase.java
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/APITestCase.java
(rev 0)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/APITestCase.java 2009-05-09
11:10:49 UTC (rev 485)
@@ -0,0 +1,138 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.impl.api;
+
+import junit.framework.TestCase;
+import org.jboss.identity.idm.impl.HibernateTestSupport;
+import org.jboss.identity.idm.impl.IdentityTestPOJO;
+import org.jboss.identity.idm.impl.configuration.IdentityConfigurationImpl;
+import org.jboss.identity.idm.api.IdentitySessionFactory;
+import org.jboss.identity.idm.api.cfg.IdentityConfiguration;
+import org.jboss.identity.idm.opends.OpenDSService;
+import org.jboss.unit.api.pojo.annotations.Create;
+import org.jboss.unit.api.pojo.annotations.Destroy;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.opends.server.tools.LDAPModify;
+
+import javax.naming.directory.DirContext;
+import javax.naming.Context;
+import javax.naming.NamingEnumeration;
+import javax.naming.Binding;
+import javax.naming.ldap.InitialLdapContext;
+import java.util.Hashtable;
+import java.io.File;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class APITestCase extends IdentityTestPOJO implements APITestContext
+{
+
+ PersistenceManagerTest persistenceManagerTest;
+
+ RelationshipManagerTest relationshipManagerTest;
+
+ RoleManagerTest roleManagerTest;
+
+ UserQueryTest userQueryTest;
+
+ GroupQueryTest groupQueryTest;
+
+ RoleQueryTest roleQueryTest;
+
+ IdentitySessionFactory identitySessionFactory;
+
+ @Create
+ public void setUp() throws Exception
+ {
+ super.start();
+ persistenceManagerTest = new PersistenceManagerTest(this);
+ relationshipManagerTest = new RelationshipManagerTest(this);
+ roleManagerTest = new RoleManagerTest(this);
+
+ userQueryTest = new UserQueryTest(this);
+ groupQueryTest = new GroupQueryTest(this);
+ roleQueryTest = new RoleQueryTest(this);
+
+ setRealmName("realm://RedHat/DB");
+
+
+ identitySessionFactory = new IdentityConfigurationImpl().
+ configure(getIdentityConfig()).buildIdentitySessionFactory();
+ }
+
+ @Destroy
+ public void tearDown() throws Exception
+ {
+ super.stop();
+ }
+
+ public IdentitySessionFactory getIdentitySessionFactory()
+ {
+ return identitySessionFactory;
+ }
+
+ @Test
+ public void testPersistenceManager() throws Exception
+ {
+ persistenceManagerTest.testMethods(getRealmName());
+ }
+
+ @Test
+ public void testRelationshipManager() throws Exception
+ {
+ relationshipManagerTest.testMethods(getRealmName());
+ }
+
+ @Test
+ public void testRelationshipManagerMergedRoleAssociations() throws Exception
+ {
+ relationshipManagerTest.testMergedRoleAssociations(getRealmName());
+ }
+
+ @Test
+ public void testRoleManager() throws Exception
+ {
+ roleManagerTest.testMethods(getRealmName());
+ }
+
+ @Test
+ public void testUserQuery() throws Exception
+ {
+ userQueryTest.testQuery(getRealmName());
+ }
+
+ @Test
+ public void testGroupQuery() throws Exception
+ {
+ groupQueryTest.testQuery(getRealmName());
+ }
+
+ @Test
+ public void testRoleQuery() throws Exception
+ {
+ roleQueryTest.testQuery(getRealmName());
+ }
+
+}
\ No newline at end of file
Added:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/APITestContext.java
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/APITestContext.java
(rev 0)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/APITestContext.java 2009-05-09
11:10:49 UTC (rev 485)
@@ -0,0 +1,41 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.impl.api;
+
+import org.jboss.identity.idm.api.IdentitySessionFactory;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface APITestContext
+{
+
+
+ IdentitySessionFactory getIdentitySessionFactory();
+
+ void begin();
+
+ void commit();
+
+}
Added:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/GroupQueryTest.java
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/GroupQueryTest.java
(rev 0)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/GroupQueryTest.java 2009-05-09
11:10:49 UTC (rev 485)
@@ -0,0 +1,128 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.impl.api;
+
+import org.jboss.identity.idm.api.IdentitySession;
+import org.jboss.identity.idm.api.User;
+import org.jboss.identity.idm.api.Group;
+import org.jboss.identity.idm.api.RoleType;
+import org.jboss.identity.idm.api.Role;
+import org.jboss.identity.idm.api.query.GroupQueryBuilder;
+import junit.framework.Assert;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class GroupQueryTest extends Assert
+{
+ private APITestContext ctx;
+
+ private String ORGANIZATION = "ORGANIZATION";
+ private String ORGANIZATION_UNIT = "ORGANIZATION_UNIT";
+ private String DEPARTMENT = "DEPARTMENT";
+
+ public GroupQueryTest(APITestContext testContext)
+ {
+ this.ctx = testContext;
+ }
+
+ public void testQuery(String realmName) throws Exception
+ {
+ ctx.begin();
+
+ IdentitySession ids =
ctx.getIdentitySessionFactory().getCurrentIdentitySession(realmName);
+
+ // Create stuff
+
+ User user1 = ids.getPersistenceManager().createUser("user1");
+ User user2 = ids.getPersistenceManager().createUser("user2");
+ User user3 = ids.getPersistenceManager().createUser("user3");
+ User user4 = ids.getPersistenceManager().createUser("user4");
+
+ Group group1 = ids.getPersistenceManager().createGroup("group1",
ORGANIZATION);
+ Group group2 = ids.getPersistenceManager().createGroup("group2",
ORGANIZATION_UNIT);
+ Group group3 = ids.getPersistenceManager().createGroup("group3",
ORGANIZATION_UNIT);
+ Group group4 = ids.getPersistenceManager().createGroup("group4",
DEPARTMENT);
+ Group group5 = ids.getPersistenceManager().createGroup("group5",
DEPARTMENT);
+
+ ids.getRelationshipManager().associateUser(group1, user1);
+ ids.getRelationshipManager().associateUser(group1, user2);
+ ids.getRelationshipManager().associateUser(group2, user3);
+ ids.getRelationshipManager().associateGroups(group2, group3);
+
+ RoleType rt1 = ids.getRoleManager().createRoleType("rt1");
+ RoleType rt2 = ids.getRoleManager().createRoleType("rt2");
+ RoleType rt3 = ids.getRoleManager().createRoleType("rt3");
+ RoleType rt4 = ids.getRoleManager().createRoleType("rt4");
+
+ Role role1 = ids.getRoleManager().createRole(rt1, user1, group1);
+ Role role2 = ids.getRoleManager().createRole(rt1, user1, group2);
+ Role role3 = ids.getRoleManager().createRole("rt2", user1.getId(),
group1.getId());
+
+ // Assertions
+
+ GroupQueryBuilder qb = ids.createGroupQueryBuilder();
+
+ qb.addAssociatedUser(user1);
+
+ assertEquals(1, ids.execute(qb.createQuery()).size());
+ assertEquals(group1, ids.uniqueResult(qb.createQuery()));
+
+ //
+ qb.reset();
+
+ qb.addAssociatedUser(user1);
+ qb.addAssociatedUser(user2);
+
+ assertEquals(1, ids.execute(qb.createQuery()).size());
+
+ //
+ qb.reset();
+
+ qb.addAssociatedUser(user1);
+ qb.addRelatedUser(user2);
+
+ assertEquals(1, ids.execute(qb.createQuery()).size());
+
+ //
+ qb.reset();
+
+ qb.addAssociatedUser(user1);
+ qb.addRelatedUser(user4);
+
+ assertEquals(0, ids.execute(qb.createQuery()).size());
+
+ //
+ qb.reset();
+
+ qb.addAssociatedUser(user3);
+ qb.addAssociatedGroup(group3, false);
+
+ assertEquals(1, ids.execute(qb.createQuery()).size());
+ assertEquals(group2, ids.uniqueResult(qb.createQuery()));
+
+
+ ctx.commit();
+ }
+}
Added:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/GroupTypeEnum.java
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/GroupTypeEnum.java
(rev 0)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/GroupTypeEnum.java 2009-05-09
11:10:49 UTC (rev 485)
@@ -0,0 +1,48 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+
+package org.jboss.identity.idm.impl.api;
+
+
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public enum GroupTypeEnum
+{
+ ADMINISTRATION,
+ ORGANIZATION,
+ DIVISION,
+ DEPARTMENT,
+ PROJECT,
+ SECURITY,
+ COMMUNITY,
+ OFFICE,
+ CUSTOM;
+
+ public String getName()
+ {
+ return this.name();
+ }
+}
Added:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/ModelTestCase.java
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/ModelTestCase.java
(rev 0)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/ModelTestCase.java 2009-05-09
11:10:49 UTC (rev 485)
@@ -0,0 +1,49 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.impl.api;
+
+import junit.framework.TestCase;
+import org.jboss.identity.idm.impl.api.model.GroupId;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class ModelTestCase extends TestCase
+{
+
+ public void testGroupId() throws Exception
+ {
+
+ GroupId id = new GroupId(GroupId.PREFIX + GroupId.SEPARATOR +
"groupTypeName" + GroupId.SEPARATOR + "groupName");
+ assertEquals("groupName", id.getName());
+ assertEquals("groupTypeName", id.getType());
+
+ id = new GroupId("groupName", "groupTypeName");
+ assertEquals("groupName", id.getName());
+ assertEquals("groupTypeName", id.getType());
+
+ }
+
+
+}
Added:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/OrganizationLDAPTestCase.java
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/OrganizationLDAPTestCase.java
(rev 0)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/OrganizationLDAPTestCase.java 2009-05-09
11:10:49 UTC (rev 485)
@@ -0,0 +1,109 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.impl.api;
+
+import org.jboss.identity.idm.impl.IdentityTestPOJO;
+import org.jboss.identity.idm.impl.LDAPTestPOJO;
+import org.jboss.identity.idm.impl.configuration.IdentityConfigurationImpl;
+import org.jboss.identity.idm.api.IdentitySessionFactory;
+import org.jboss.unit.api.pojo.annotations.Create;
+import org.jboss.unit.api.pojo.annotations.Destroy;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.api.pojo.annotations.Parameter;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class OrganizationLDAPTestCase extends LDAPTestPOJO implements APITestContext
+{
+ private OrganizationTest orgTest;
+
+ private IdentitySessionFactory identitySessionFactory;
+
+ private String samplePortalRealmName =
"realm://portal/SamplePortal/DB_LDAP";
+
+ private String sampleOrganizationRealmName = "realm://RedHat/DB_LDAP";
+
+
+ @Create
+ public void setUp() throws Exception
+ {
+ super.start();
+
+ orgTest = new OrganizationTest(this);
+
+ populateClean();
+
+ identitySessionFactory = new IdentityConfigurationImpl().
+ configure(getIdentityConfig()).buildIdentitySessionFactory();
+ }
+
+ @Destroy
+ public void tearDown() throws Exception
+ {
+ super.stop();
+ }
+
+ public IdentitySessionFactory getIdentitySessionFactory()
+ {
+ return identitySessionFactory;
+ }
+
+ @Test
+ public void testOrganization() throws Exception
+ {
+
+ orgTest.testRedHatOrganization(getSampleOrganizationRealmName());
+ }
+
+ @Test
+ public void testSamplePortal() throws Exception
+ {
+
+ orgTest.testSamplePortal(getSamplePortalRealmName());
+
+ }
+
+ public String getSamplePortalRealmName()
+ {
+ return samplePortalRealmName;
+ }
+
+ @Parameter
+ public void setSamplePortalRealmName(String samplePortalRealmName)
+ {
+ this.samplePortalRealmName = samplePortalRealmName;
+ }
+
+ public String getSampleOrganizationRealmName()
+ {
+ return sampleOrganizationRealmName;
+ }
+
+ @Parameter
+ public void setSampleOrganizationRealmName(String sampleOrganizationRealmName)
+ {
+ this.sampleOrganizationRealmName = sampleOrganizationRealmName;
+ }
+}
\ No newline at end of file
Added:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/OrganizationTest.java
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/OrganizationTest.java
(rev 0)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/OrganizationTest.java 2009-05-09
11:10:49 UTC (rev 485)
@@ -0,0 +1,592 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.impl.api;
+
+import org.jboss.identity.idm.api.IdentitySession;
+import org.jboss.identity.idm.api.Group;
+import org.jboss.identity.idm.api.User;
+import org.jboss.identity.idm.api.RoleType;
+import org.jboss.identity.idm.api.IdentitySessionFactory;
+import org.jboss.identity.idm.api.Attribute;
+import org.jboss.identity.idm.api.AttributeDescription;
+import org.jboss.identity.idm.api.Credential;
+import org.jboss.identity.idm.p3p.P3PConstants;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.Random;
+import java.util.Arrays;
+
+import junit.framework.Assert;
+
+/**
+ * Abstract test mapping real life structures using the API
+ *
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class OrganizationTest extends Assert
+{
+ APITestContext ctx;
+
+ public OrganizationTest(APITestContext ctx)
+ {
+ this.ctx = ctx;
+ }
+
+ public void setCtx(APITestContext ctx)
+ {
+ this.ctx = ctx;
+ }
+
+ public APITestContext getCtx()
+ {
+ return ctx;
+ }
+
+ public void testRedHatOrganization(String realmName) throws Exception
+ {
+ // GroupType
+
+ String ORGANIZATION = "ORGANIZATION";
+ String ORGANIZATION_UNIT = "ORGANIZATION_UNIT";
+ String DIVISION = "DIVISION";
+ String DEPARTMENT = "DEPARTMENT";
+ String PROJECT = "PROJECT";
+ String PEOPLE = "PEOPLE";
+
+ IdentitySessionFactory factory = ctx.getIdentitySessionFactory();
+
+ IdentitySession session = factory.createIdentitySession(realmName);
+
+ //ctx.begin();
+
+ ctx.begin();
+
+ // Organization structure
+
+ Group rhOrg = session.getPersistenceManager().createGroup("RedHat",
ORGANIZATION);
+
+ Group jbossDivision =
session.getPersistenceManager().createGroup("JBoss", DIVISION);
+ Group rhelDivision = session.getPersistenceManager().createGroup("RHEL",
DIVISION);
+
+ session.getRelationshipManager().associateGroups(rhOrg, jbossDivision);
+ session.getRelationshipManager().associateGroups(rhOrg, rhelDivision);
+
+ Group itDepartment = session.getPersistenceManager().createGroup("IT",
DEPARTMENT);
+ Group hrDepartment = session.getPersistenceManager().createGroup("HR",
DEPARTMENT);
+
+ session.getRelationshipManager().associateGroups(jbossDivision, itDepartment);
+ session.getRelationshipManager().associateGroups(jbossDivision, hrDepartment);
+
+ Group rndDepartment = session.getPersistenceManager().createGroup("RnD",
DEPARTMENT);
+
+ session.getRelationshipManager().associateGroups(itDepartment, rndDepartment);
+
+ Group projectsOU =
session.getPersistenceManager().createGroup("Projects", ORGANIZATION_UNIT);
+ Group commonFrameworksOU = session.getPersistenceManager().createGroup("Common
Frameworks", ORGANIZATION_UNIT);
+
+ session.getRelationshipManager().associateGroups(rndDepartment, projectsOU);
+
+ // Projects
+
+ Group portalProject =
session.getPersistenceManager().createGroup("Portal", PROJECT);
+ Group soaProject = session.getPersistenceManager().createGroup("SOA",
PROJECT);
+ Group jbpmProject = session.getPersistenceManager().createGroup("jBPM",
PROJECT);
+ Group seamProject = session.getPersistenceManager().createGroup("Seam",
PROJECT);
+ Group asProject = session.getPersistenceManager().createGroup("AS",
PROJECT);
+ Group securityProject =
session.getPersistenceManager().createGroup("Security", PROJECT);
+
+ session.getRelationshipManager().associateGroups(projectsOU, portalProject);
+ session.getRelationshipManager().associateGroups(projectsOU, soaProject);
+ session.getRelationshipManager().associateGroups(projectsOU, jbpmProject);
+ session.getRelationshipManager().associateGroups(projectsOU, asProject);
+ session.getRelationshipManager().associateGroups(projectsOU, seamProject);
+
+ // Check...
+ assertTrue(session.getRelationshipManager().isAssociated(projectsOU,
portalProject));
+ assertTrue(session.getRelationshipManager().isAssociated(projectsOU, soaProject));
+ assertTrue(session.getRelationshipManager().isAssociated(projectsOU,
jbpmProject));
+ assertTrue(session.getRelationshipManager().isAssociated(projectsOU, asProject));
+ assertTrue(session.getRelationshipManager().isAssociated(projectsOU,
seamProject));
+
+ // Portal is part of common frameworks
+ session.getRelationshipManager().associateGroups(commonFrameworksOU,
portalProject);
+
+ // People
+
+ Group employeesGroup =
session.getPersistenceManager().createGroup("Employees", PEOPLE);
+
+ // Management
+
+ User theuteUser = session.getPersistenceManager().createUser("theute");
+ User mlittleUser =
session.getPersistenceManager().createUser("mlittle");
+ User bgeorgesUser =
session.getPersistenceManager().createUser("bgeorges");
+ User asaldhanaUser =
session.getPersistenceManager().createUser("asaldhana");
+ User janderseUser =
session.getPersistenceManager().createUser("janderse");
+
+ // Portal Team
+
+ User bdawidowUser =
session.getPersistenceManager().createUser("bdawidow");
+ User claprunUser =
session.getPersistenceManager().createUser("claprun");
+ User whalesUser = session.getPersistenceManager().createUser("whales");
+ User sshahUser = session.getPersistenceManager().createUser("sshah");
+ User mwringeUser =
session.getPersistenceManager().createUser("mwringe");
+
+ // Store as employees
+
+ session.getRelationshipManager().associateUser(employeesGroup, theuteUser);
+ session.getRelationshipManager().associateUser(employeesGroup, mlittleUser);
+ session.getRelationshipManager().associateUser(employeesGroup, asaldhanaUser);
+ session.getRelationshipManager().associateUser(employeesGroup, bdawidowUser);
+ session.getRelationshipManager().associateUser(employeesGroup, claprunUser);
+ session.getRelationshipManager().associateUser(employeesGroup, whalesUser);
+ session.getRelationshipManager().associateUser(employeesGroup, sshahUser);
+ session.getRelationshipManager().associateUser(employeesGroup, mwringeUser);
+
+ // Portal team for management purposes
+
+ Group portalTeamGroup = session.getPersistenceManager().createGroup("Portal
Team", PEOPLE);
+ session.getRelationshipManager().associateUser(portalTeamGroup, bdawidowUser);
+ session.getRelationshipManager().associateUser(portalTeamGroup, claprunUser);
+ session.getRelationshipManager().associateUser(portalTeamGroup, whalesUser);
+ session.getRelationshipManager().associateUser(portalTeamGroup, sshahUser);
+ session.getRelationshipManager().associateUser(portalTeamGroup, mwringeUser);
+
+ // Portal team is under common frameworks
+
+ session.getRelationshipManager().associateGroups(commonFrameworksOU,
portalTeamGroup);
+
+ // Role Types
+
+ RoleType developerRT =
session.getRoleManager().createRoleType("Developer");
+ RoleType managerRT = session.getRoleManager().createRoleType("Manager");
+ RoleType leadDeveloperRT = session.getRoleManager().createRoleType("Lead
Developer");
+ RoleType productManagerRT = session.getRoleManager().createRoleType("Product
Manager");
+
+ // Assign roles
+
+ // Common frameworks manager
+
+ session.getRoleManager().createRole(managerRT, bgeorgesUser, commonFrameworksOU);
+
+ // Portal developers
+
+ session.getRoleManager().createRole(developerRT, theuteUser, portalProject);
+ session.getRoleManager().createRole(developerRT, bdawidowUser, portalProject);
+ session.getRoleManager().createRole(developerRT, claprunUser, portalProject);
+ session.getRoleManager().createRole(developerRT, whalesUser, portalProject);
+ session.getRoleManager().createRole(developerRT, sshahUser, portalProject);
+ session.getRoleManager().createRole(developerRT, mwringeUser, portalProject);
+
+ // Portal management
+ session.getRoleManager().createRole(leadDeveloperRT, theuteUser, portalProject);
+ session.getRoleManager().createRole(managerRT, theuteUser, portalTeamGroup);
+ session.getRoleManager().createRole(productManagerRT, janderseUser,
portalProject);
+
+ // SOA
+
+ session.getRoleManager().createRole(developerRT, mlittleUser, portalProject);
+ session.getRoleManager().createRole(productManagerRT, mlittleUser, portalProject);
+
+ // AS & Security
+
+ session.getRoleManager().createRole(developerRT, asaldhanaUser, asProject);
+ session.getRoleManager().createRole(developerRT, asaldhanaUser, securityProject);
+ session.getRoleManager().createRole(leadDeveloperRT, asaldhanaUser,
securityProject);
+
+
+ // Check what RoleTypes has user theute
+ Collection<RoleType> roleTypes =
session.getRoleManager().findUserRoleTypes(theuteUser);
+ assertEquals(3, roleTypes.size());
+ assertTrue(roleTypes.contains(developerRT));
+ assertTrue(roleTypes.contains(leadDeveloperRT));
+ assertTrue(roleTypes.contains(managerRT));
+ assertFalse(roleTypes.contains(productManagerRT));
+
+ assertTrue(session.getRoleManager().hasRole(theuteUser, portalProject,
developerRT));
+ assertTrue(session.getRoleManager().hasRole(theuteUser, portalProject,
leadDeveloperRT));
+ assertTrue(session.getRoleManager().hasRole(theuteUser, portalTeamGroup,
managerRT));
+
+ // Check where anil is Lead Developer and where Developer
+
+ roleTypes = session.getRoleManager().findUserRoleTypes(asaldhanaUser);
+ assertEquals(2, roleTypes.size());
+ assertTrue(roleTypes.contains(developerRT));
+ assertTrue(roleTypes.contains(leadDeveloperRT));
+
+ roleTypes = session.getRoleManager().findRoleTypes(asaldhanaUser,
securityProject);
+ assertEquals(2, roleTypes.size());
+ assertTrue(roleTypes.contains(leadDeveloperRT));
+
+ roleTypes = session.getRoleManager().findRoleTypes(asaldhanaUser, asProject);
+ assertEquals(1, roleTypes.size());
+ assertTrue(roleTypes.contains(developerRT));
+
+ // and simpler...
+ assertTrue(session.getRoleManager().hasRole(asaldhanaUser, asProject,
developerRT));
+
+ // Assert relationships
+
+ Collection<User> identities =
session.getRelationshipManager().findAssociatedUsers(portalTeamGroup, false);
+ assertEquals(5, identities.size());
+ assertTrue(identities.contains(claprunUser));
+ assertTrue(identities.contains(mwringeUser));
+ assertTrue(identities.contains(sshahUser));
+ assertTrue(identities.contains(whalesUser));
+ assertTrue(identities.contains(bdawidowUser));
+
+ Collection<Group> groups =
session.getRelationshipManager().findAssociatedGroups(rndDepartment, PROJECT, true,
false);
+ assertEquals(0, groups.size());
+
+ // Check to which group Anil belongs
+ groups = session.getRelationshipManager().findAssociatedGroups(asaldhanaUser,
PEOPLE);
+ assertEquals(1, groups.size());
+ assertTrue(groups.contains(employeesGroup));
+
+ // Now check sshah
+ groups = session.getRelationshipManager().findAssociatedGroups(sshahUser, PEOPLE);
+ assertEquals(2, groups.size());
+ assertTrue(groups.contains(employeesGroup));
+ assertTrue(groups.contains(portalTeamGroup));
+
+
+ // Check that binary attribute picture is mapped
+
+ AttributeDescription attributeDescription =
session.getAttributesManager().getAttributeDescription(bdawidowUser,
"picture");
+ assertNotNull(attributeDescription);
+ assertEquals("binary", attributeDescription.getType());
+
+
+ // Generate random binary data for binary attribute
+ Random random = new Random();
+
+ // 900 kilobytes
+ byte[] picture = new byte[921600];
+ random.nextBytes(picture);
+
+ // User attributes
+ Attribute[] userInfo = new Attribute[]
+ {
+ new SimpleAttribute(P3PConstants.INFO_USER_NAME_GIVEN, new
String[]{"Boleslaw"}),
+ new SimpleAttribute(P3PConstants.INFO_USER_NAME_FAMILY, new
String[]{"Dawidowicz"}),
+ new SimpleAttribute("picture", new byte[][]{picture})
+ };
+
+ session.getAttributesManager().addAttributes(bdawidowUser, userInfo);
+
+ Map<String, Attribute> attributes =
session.getAttributesManager().getAttributes(bdawidowUser);
+ assertEquals(3, attributes.keySet().size());
+ assertEquals("Dawidowicz",
(attributes.get(P3PConstants.INFO_USER_NAME_FAMILY)).getValue());
+ assertTrue(Arrays.equals((byte[])attributes.get("picture").getValue(),
picture));
+
+
+ // Credential
+ User anotherOne = bdawidowUser;
//session.getPersistenceManager().createUser("blah1");
+
+
assertTrue(session.getAttributesManager().isCredentialTypeSupported(PasswordCredential.TYPE));
+
+ // #1
+ session.getAttributesManager().updatePassword(anotherOne, "secret");
+ assertTrue(session.getAttributesManager().validatePassword(anotherOne,
"secret"));
+ assertFalse(session.getAttributesManager().validatePassword(anotherOne,
"secret2"));
+ assertFalse(session.getAttributesManager().validatePassword(anotherOne,
"secret3"));
+
+ // #1
+ session.getAttributesManager().updatePassword(anotherOne, "secret2");
+ assertTrue(session.getAttributesManager().validatePassword(anotherOne,
"secret2"));
+ assertFalse(session.getAttributesManager().validatePassword(anotherOne,
"secret"));
+ assertFalse(session.getAttributesManager().validatePassword(anotherOne,
"secret3"));
+
+
+ // #1
+ session.getAttributesManager().updatePassword(anotherOne, "secret3");
+ assertTrue(session.getAttributesManager().validatePassword(anotherOne,
"secret3"));
+ assertFalse(session.getAttributesManager().validatePassword(anotherOne,
"secret"));
+ assertFalse(session.getAttributesManager().validatePassword(anotherOne,
"secret2"));
+
+
+ // #2
+ Credential password = new PasswordCredential("secretPhrase");
+ session.getAttributesManager().updateCredential(anotherOne, password);
+ assertTrue(session.getAttributesManager().validateCredentials(anotherOne, new
Credential[]{password}));
+
+ // #3
+
+ if
(session.getAttributesManager().isCredentialTypeSupported(BinaryCredential.TYPE))
+ {
+ // 500 kilobytes
+ byte[] cert = new byte[512000];
+ random.nextBytes(cert);
+ Credential binaryCredential = new BinaryCredential(cert);
+ session.getAttributesManager().updateCredential(anotherOne, binaryCredential);
+ assertTrue(session.getAttributesManager().validateCredentials(anotherOne, new
Credential[]{binaryCredential}));
+ }
+
+
+ ctx.commit();
+
+ }
+
+ public void testSamplePortal(String realmName) throws Exception
+ {
+ String SYSTEM = "SYSTEM";
+ String ADMINISTRATION = "ADMINISTRATION";
+ String COMMUNITY = "COMMUNITY";
+ String ORGANIZATION = "ORGANIZATION";
+ String ORGANIZATION_UNIT = "ORGANIZATION_UNIT";
+ String OFFICE = "OFFICE";
+ String DIVISION = "DIVISION";
+ String DEPARTMENT = "DEPARTMENT";
+ String SECURITY = "SECURITY";
+ String PEOPLE = "PEOPLE";
+
+ IdentitySessionFactory factory = ctx.getIdentitySessionFactory();
+
+ IdentitySession session = factory.createIdentitySession(realmName);
+
+ ctx.begin();
+
+
+
+ // Create all role types
+ RoleType adminRT = session.getRoleManager().createRoleType("Admin");
+ RoleType accountAdminRT = session.getRoleManager().createRoleType("Account
Admin");
+ RoleType managerRT = session.getRoleManager().createRoleType("Manager");
+ RoleType officeManagerRT = session.getRoleManager().createRoleType("Office
Manager");
+ RoleType contributorRT =
session.getRoleManager().createRoleType("Contributor");
+ RoleType communityOwnerRT = session.getRoleManager().createRoleType("Community
Owner");
+ RoleType communityMemberRT =
session.getRoleManager().createRoleType("Community Member");
+ RoleType communityForumModeratorRT =
session.getRoleManager().createRoleType("Community Forum Moderator");
+ RoleType communityCMSAdminRT =
session.getRoleManager().createRoleType("Community CMS Admin");
+
+
+ // Create system root groups - groups containing all communities, global security
groups and organization
+
+ Group communityRootGroup =
session.getPersistenceManager().createGroup("COMMUNITY_ROOT", SYSTEM);
+ Group securityRootGroup =
session.getPersistenceManager().createGroup("SECURITY_ROOT", SYSTEM);
+ Group organizationRootGroup =
session.getPersistenceManager().createGroup("ORGANIZATION_ROOT",SYSTEM);
+ Group usersROOTGroup =
session.getPersistenceManager().createGroup("USERS_ROOT",SYSTEM);
+
+ ctx.commit();
+
+ ctx.begin();
+
+ // Communities
+
+ Group portalLoversCommunity =
session.getPersistenceManager().createGroup("Portal Lovers", COMMUNITY);
+ Group baseJumpingCommunity = session.getPersistenceManager().createGroup("BASE
Jumping", COMMUNITY);
+ Group geeksCommunity =
session.getPersistenceManager().createGroup("Geeks", COMMUNITY);
+
+ session.getRelationshipManager().associateGroups(communityRootGroup,
portalLoversCommunity);
+ session.getRelationshipManager().associateGroups(communityRootGroup,
baseJumpingCommunity);
+ session.getRelationshipManager().associateGroups(communityRootGroup,
geeksCommunity);
+
+ // Security groups - act like global portal roles
+
+ Group portalAdminGroup = session.getPersistenceManager().createGroup("Poral
Admin", SECURITY);
+ Group cmsAdminGroup = session.getPersistenceManager().createGroup("CMS
Admin", SECURITY);
+ Group userAdminGroup = session.getPersistenceManager().createGroup("User
Admin", SECURITY);
+ Group cmsEditorGroup = session.getPersistenceManager().createGroup("CMS
Editor", SECURITY);
+
+ session.getRelationshipManager().associateGroups(securityRootGroup,
portalAdminGroup);
+ session.getRelationshipManager().associateGroups(securityRootGroup,
cmsAdminGroup);
+ session.getRelationshipManager().associateGroups(securityRootGroup,
userAdminGroup);
+ session.getRelationshipManager().associateGroups(securityRootGroup,
cmsEditorGroup);
+
+ // Organization structure
+
+ Group acmeOrg = session.getPersistenceManager().createGroup("ACME",
ORGANIZATION);
+
+ session.getRelationshipManager().associateGroups(organizationRootGroup, acmeOrg);
+
+ Group departmentsOU =
session.getPersistenceManager().createGroup("Departments", ORGANIZATION_UNIT);
+ Group officesOU = session.getPersistenceManager().createGroup("Offices",
ORGANIZATION_UNIT);
+ Group employeesOU =
session.getPersistenceManager().createGroup("Employees", ORGANIZATION_UNIT);
+
+ session.getRelationshipManager().associateGroups(acmeOrg, departmentsOU);
+ session.getRelationshipManager().associateGroups(acmeOrg, officesOU);
+ session.getRelationshipManager().associateGroups(acmeOrg, employeesOU);
+
+ // Departments
+
+ Group hrDepart = session.getPersistenceManager().createGroup("HR",
DEPARTMENT);
+ Group financeDepart =
session.getPersistenceManager().createGroup("Finance", DEPARTMENT);
+ Group rndDepart = session.getPersistenceManager().createGroup("R&D",
DEPARTMENT);
+
+ session.getRelationshipManager().associateGroups(departmentsOU, hrDepart);
+ session.getRelationshipManager().associateGroups(departmentsOU, financeDepart);
+ session.getRelationshipManager().associateGroups(departmentsOU, rndDepart);
+
+ // Offices
+
+ Group parisOffice =session.getPersistenceManager().createGroup("Paris",
OFFICE);
+ Group londonOffice =session.getPersistenceManager().createGroup("London",
OFFICE);
+ Group nyOffice =session.getPersistenceManager().createGroup("New York",
OFFICE);
+
+ session.getRelationshipManager().associateGroups(officesOU, parisOffice);
+ session.getRelationshipManager().associateGroups(officesOU, londonOffice);
+ session.getRelationshipManager().associateGroups(officesOU, nyOffice);
+
+ // People
+
+ User anneUser = session.getPersistenceManager().createUser("anne");
+ User marieUser = session.getPersistenceManager().createUser("marie");
+ User eveUser = session.getPersistenceManager().createUser("eve");
+ User angelinaUser =
session.getPersistenceManager().createUser("angelina");
+ User joannaUser = session.getPersistenceManager().createUser("joanna");
+ User merilUser = session.getPersistenceManager().createUser("meril");
+ User johnUser = session.getPersistenceManager().createUser("john");
+ User stanUser = session.getPersistenceManager().createUser("stan");
+ User chrisUser = session.getPersistenceManager().createUser("chris");
+ User billUser = session.getPersistenceManager().createUser("bill");
+ User jackUser = session.getPersistenceManager().createUser("jack");
+
+ ctx.commit();
+
+ ctx.begin();
+
+ // All users are under people root
+
+ session.getRelationshipManager().associateUser(usersROOTGroup, anneUser);
+ session.getRelationshipManager().associateUser(usersROOTGroup, marieUser);
+ session.getRelationshipManager().associateUser(usersROOTGroup, eveUser);
+ session.getRelationshipManager().associateUser(usersROOTGroup, angelinaUser);
+ session.getRelationshipManager().associateUser(usersROOTGroup, joannaUser);
+ session.getRelationshipManager().associateUser(usersROOTGroup, merilUser);
+ session.getRelationshipManager().associateUser(usersROOTGroup, johnUser);
+ session.getRelationshipManager().associateUser(usersROOTGroup, stanUser);
+ session.getRelationshipManager().associateUser(usersROOTGroup, chrisUser);
+ session.getRelationshipManager().associateUser(usersROOTGroup, billUser);
+ session.getRelationshipManager().associateUser(usersROOTGroup, jackUser);
+
+ ctx.commit();
+
+ ctx.begin();
+
+ //
+
+
+ // Anna is...
+
+ // Anna Smith...
+
+
+ session.getAttributesManager().addAttribute(anneUser,
P3PConstants.INFO_USER_NAME_GIVEN, "Anne");
+ session.getAttributesManager().addAttribute(anneUser,
P3PConstants.INFO_USER_NAME_FAMILY, "Smith");
+ session.getAttributesManager().addAttribute(anneUser,
P3PConstants.INFO_USER_JOB_TITLE, "Senior Software Developer");
+ session.getAttributesManager().addAttribute(anneUser,
P3PConstants.INFO_USER_BUSINESS_INFO_ONLINE_EMAIL, "anne.smith(a)acme.com");
+ session.getAttributesManager().addAttribute(anneUser,
P3PConstants.INFO_USER_BUSINESS_INFO_TELECOM_MOBILE_NUMBER, "777 777 777 7
77");
+
+ // Anna works in Paris office and participates in BASE jumping community as a forum
moderator and CMS admin
+
+ session.getRelationshipManager().associateUser(parisOffice, anneUser);
+
+ // Anne could be just associated with BASE jumping community group using
RelationshipManager but insted Role mechanism
+ // is used to have more fine grained control of access rights inside of a
community
+
+
+ session.save();
+
+ ctx.commit();
+
+ ctx.begin();
+
+ session.getRoleManager().createRole(communityMemberRT, anneUser,
baseJumpingCommunity);
+ session.getRoleManager().createRole(communityForumModeratorRT, anneUser,
baseJumpingCommunity);
+ session.getRoleManager().createRole(communityCMSAdminRT, anneUser,
baseJumpingCommunity);
+
+ // Anne belongs to CMS portal admins security group
+
+ session.getRelationshipManager().associateUser(cmsAdminGroup, anneUser);
+
+ // Ann is also an owner of geeks community
+
+ session.getRoleManager().createRole(communityOwnerRT, anneUser, geeksCommunity);
+
+
+ //
+
+
+ // Angelina ...
+
+ session.getAttributesManager().addAttribute(angelinaUser,
P3PConstants.INFO_USER_NAME_GIVEN, "Angelina");
+ session.getAttributesManager().addAttribute(angelinaUser,
P3PConstants.INFO_USER_NAME_FAMILY, "Blond");
+ session.getAttributesManager().addAttribute(angelinaUser,
P3PConstants.INFO_USER_JOB_TITLE, "Very important looking job title");
+ session.getAttributesManager().addAttribute(angelinaUser,
P3PConstants.INFO_USER_BUSINESS_INFO_ONLINE_EMAIL, "angelina1979(a)acme.com");
+ session.getAttributesManager().addAttribute(angelinaUser,
P3PConstants.INFO_USER_BUSINESS_INFO_TELECOM_MOBILE_NUMBER, "888 88 88 8888");
+
+ // She works in London and is office manager there - se both RelationshipManager
and RoleManager used against
+ // the same pair of identity objects
+
+ session.getRelationshipManager().associateUser(londonOffice, angelinaUser);
+
+ session.getRoleManager().createRole(officeManagerRT, angelinaUser, londonOffice);
+
+ // Angelina is member of geeks community and manages cms content there
+
+ session.getRoleManager().createRole(communityMemberRT, angelinaUser,
geeksCommunity);
+ session.getRoleManager().createRole(communityCMSAdminRT, angelinaUser,
geeksCommunity);
+
+ // As office manager she also edits portal cms content
+
+ session.getRelationshipManager().associateUser(cmsEditorGroup, angelinaUser);
+
+
+ //
+
+
+ // Some assertions
+
+ // How many users do we have in whole acme org and how many people in paris and
london offices
+ assertEquals(11,
session.getRelationshipManager().findAssociatedUsers(usersROOTGroup, false).size());
+ assertEquals(1, session.getRelationshipManager().findAssociatedUsers(parisOffice,
false).size());
+ assertEquals(1, session.getRelationshipManager().findAssociatedUsers(londonOffice,
false).size());
+
+
+ // Is anne geeks community owner?
+ assertTrue(session.getRoleManager().hasRole(anneUser, geeksCommunity,
communityOwnerRT));
+
+ // Does she belong to cms admins
+ assertTrue(session.getRelationshipManager().isAssociated(cmsAdminGroup,
anneUser));
+
+ // Check all groups that anna belongs to
+ Collection<Group> groups =
session.getRelationshipManager().findAssociatedGroups(anneUser);
+ assertEquals(3, groups.size());
+ assertTrue(groups.contains(usersROOTGroup));
+ assertTrue(groups.contains(parisOffice));
+ assertTrue(groups.contains(cmsAdminGroup));
+
+
+
+ ctx.commit();
+
+ }
+
+
+
+
+
+
+
+}
Added:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/OrganizationTestCase.java
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/OrganizationTestCase.java
(rev 0)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/OrganizationTestCase.java 2009-05-09
11:10:49 UTC (rev 485)
@@ -0,0 +1,106 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.impl.api;
+
+import org.jboss.identity.idm.impl.IdentityTestPOJO;
+import org.jboss.identity.idm.impl.configuration.IdentityConfigurationImpl;
+import org.jboss.identity.idm.api.IdentitySessionFactory;
+import org.jboss.unit.api.pojo.annotations.Create;
+import org.jboss.unit.api.pojo.annotations.Destroy;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.api.pojo.annotations.Parameter;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class OrganizationTestCase extends IdentityTestPOJO implements APITestContext
+{
+ private OrganizationTest orgTest;
+
+ private IdentitySessionFactory identitySessionFactory;
+
+ private String samplePortalRealmName = "realm://portal/SamplePortal/DB";
+
+ private String sampleOrganizationRealmName = "realm://RedHat/DB";
+
+
+ @Create
+ public void setUp() throws Exception
+ {
+ super.start();
+
+ orgTest = new OrganizationTest(this);
+
+ identitySessionFactory = new IdentityConfigurationImpl().
+ configure(getIdentityConfig()).buildIdentitySessionFactory();
+ }
+
+ @Destroy
+ public void tearDown() throws Exception
+ {
+ super.stop();
+ }
+
+ public IdentitySessionFactory getIdentitySessionFactory()
+ {
+ return identitySessionFactory;
+ }
+
+ @Test
+ public void testOrganization() throws Exception
+ {
+
+ orgTest.testRedHatOrganization(getSampleOrganizationRealmName());
+ }
+
+ @Test
+ public void testSamplePortal() throws Exception
+ {
+
+ orgTest.testSamplePortal(getSamplePortalRealmName());
+
+ }
+
+ public String getSamplePortalRealmName()
+ {
+ return samplePortalRealmName;
+ }
+
+ @Parameter
+ public void setSamplePortalRealmName(String samplePortalRealmName)
+ {
+ this.samplePortalRealmName = samplePortalRealmName;
+ }
+
+ public String getSampleOrganizationRealmName()
+ {
+ return sampleOrganizationRealmName;
+ }
+
+ @Parameter
+ public void setSampleOrganizationRealmName(String sampleOrganizationRealmName)
+ {
+ this.sampleOrganizationRealmName = sampleOrganizationRealmName;
+ }
+}
\ No newline at end of file
Added:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/PersistenceManagerTest.java
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/PersistenceManagerTest.java
(rev 0)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/PersistenceManagerTest.java 2009-05-09
11:10:49 UTC (rev 485)
@@ -0,0 +1,179 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.impl.api;
+
+import org.jboss.identity.idm.api.IdentitySession;
+import org.jboss.identity.idm.api.Group;
+import org.jboss.identity.idm.api.User;
+import org.jboss.identity.idm.api.IdentitySessionFactory;
+import org.jboss.identity.idm.api.IdentitySearchCriteria;
+
+import junit.framework.Assert;
+
+/**
+ *
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class PersistenceManagerTest extends Assert
+{
+ //TODO:
+ //TODO: - force in removeGroup (NYI)
+ //TODO: - exception handling
+ //TODO: - search criteria
+ //TODO: - features description
+
+ APITestContext ctx;
+
+ private String ORGANIZATION = "ORGANIZATION";
+ private String ORGANIZATION_UNIT = "ORGANIZATION_UNIT";
+ private String DIVISION = "DIVISION";
+ private String DEPARTMENT = "DEPARTMENT";
+ private String PROJECT = "PROJECT";
+ private String PEOPLE = "PEOPLE";
+
+ public PersistenceManagerTest(APITestContext ctx)
+ {
+ this.ctx = ctx;
+ }
+
+ public void setCtx(APITestContext ctx)
+ {
+ this.ctx = ctx;
+ }
+
+ public APITestContext getCtx()
+ {
+ return ctx;
+ }
+
+ public void testMethods(String realmName) throws Exception
+ {
+ IdentitySessionFactory factory = ctx.getIdentitySessionFactory();
+
+ IdentitySession session = factory.createIdentitySession(realmName);
+
+
+
+ ctx.begin();
+
+ // Bad names
+
+ try
+ {
+ session.getPersistenceManager().createUser("lol/olo");
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ // expected
+ }
+
+ try
+ {
+ session.getPersistenceManager().createGroup("/toto", ORGANIZATION);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ // expected
+ }
+
+
+ // Create / Remove
+
+ // Group
+ Group group1 = session.getPersistenceManager().createGroup("groupName1",
ORGANIZATION);
+
+ assertNotNull(group1);
+ assertEquals(group1.getGroupType(), ORGANIZATION);
+ assertEquals(group1.getName(), "groupName1");
+
+
+ String group1Id =
session.getPersistenceManager().createGroupId("groupName1", ORGANIZATION);
+
+ assertEquals(group1Id, group1.getId());
+
+ session.getPersistenceManager().createGroup("groupName2", ORGANIZATION);
+ session.getPersistenceManager().createGroup("groupName3", PROJECT);
+
+ assertEquals(2, session.getPersistenceManager().getGroupTypeCount(ORGANIZATION));
+ assertEquals(1, session.getPersistenceManager().getGroupTypeCount(PROJECT));
+ assertEquals(0, session.getPersistenceManager().getGroupTypeCount(DEPARTMENT));
+
+ assertEquals(2, session.getPersistenceManager().findGroup(ORGANIZATION).size());
+ assertEquals(1, session.getPersistenceManager().findGroup(PROJECT).size());
+ assertEquals(0, session.getPersistenceManager().findGroup(DEPARTMENT).size());
+
+ session.getPersistenceManager().removeGroup(group1, false);
+ String id = session.getPersistenceManager().createGroupId("groupName2",
ORGANIZATION);
+ session.getPersistenceManager().removeGroup(id, false);
+ id = session.getPersistenceManager().createGroupId("groupName3",
PROJECT);
+ session.getPersistenceManager().removeGroup(id, false);
+
+ assertEquals(0, session.getPersistenceManager().findGroup(ORGANIZATION,
(IdentitySearchCriteria)null).size());
+ assertEquals(0, session.getPersistenceManager().findGroup(PROJECT).size());
+ assertEquals(0, session.getPersistenceManager().findGroup(DEPARTMENT).size());
+
+ assertEquals(0, session.getPersistenceManager().getGroupTypeCount(ORGANIZATION));
+ assertEquals(0, session.getPersistenceManager().getGroupTypeCount(PROJECT));
+ assertEquals(0, session.getPersistenceManager().getGroupTypeCount(DEPARTMENT));
+
+
+ //User
+
+ User u1 = session.getPersistenceManager().createUser("olo");
+
+ assertNotNull(u1);
+ assertEquals(u1.getId(), "olo");
+
+ session.getPersistenceManager().createUser("anna");
+
+ assertEquals(2, session.getPersistenceManager().getUserCount());
+
+ assertNotNull(session.getPersistenceManager().findUser("olo"));
+ assertNotNull(session.getPersistenceManager().findUser("anna"));
+
+ //TODO: this should throw some meaningfull exception or simply return null
+ //assertNull(session.getPersistenceManager().findUser("olaf"));
+
+ assertEquals(2,
session.getPersistenceManager().findUser((IdentitySearchCriteria)null).size());
+
+ session.getPersistenceManager().removeUser(u1, false);
+
+ assertEquals(1, session.getPersistenceManager().getUserCount());
+
+ session.getPersistenceManager().removeUser("anna", false);
+
+ assertEquals(0, session.getPersistenceManager().getUserCount());
+
+ assertEquals(0,
session.getPersistenceManager().findUser((IdentitySearchCriteria)null).size());
+
+
+ ctx.commit();
+
+ }
+
+
+
+}
\ No newline at end of file
Added:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/RelationshipManagerTest.java
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/RelationshipManagerTest.java
(rev 0)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/RelationshipManagerTest.java 2009-05-09
11:10:49 UTC (rev 485)
@@ -0,0 +1,370 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.impl.api;
+
+import org.jboss.identity.idm.api.IdentitySession;
+import org.jboss.identity.idm.api.Group;
+import org.jboss.identity.idm.api.User;
+import org.jboss.identity.idm.api.IdentitySessionFactory;
+import org.jboss.identity.idm.api.IdentitySearchCriteria;
+
+import java.util.Arrays;
+
+import junit.framework.Assert;
+
+/**
+ *
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class RelationshipManagerTest extends Assert
+{
+ //TODO:
+ //TODO: - inheritence in find methods
+ //TODO: - creating forbidden associations
+ //TODO: - exception handling
+ //TODO: - search criteria
+ //TODO: - features description
+
+ APITestContext ctx;
+
+ private String ORGANIZATION = "ORGANIZATION";
+ private String ORGANIZATION_UNIT = "ORGANIZATION_UNIT";
+ private String DIVISION = "DIVISION";
+ private String DEPARTMENT = "DEPARTMENT";
+ private String PROJECT = "PROJECT";
+ private String PEOPLE = "PEOPLE";
+
+ public RelationshipManagerTest(APITestContext ctx)
+ {
+ this.ctx = ctx;
+ }
+
+ public void setCtx(APITestContext ctx)
+ {
+ this.ctx = ctx;
+ }
+
+ public APITestContext getCtx()
+ {
+ return ctx;
+ }
+
+ public void testMethods(String realmName) throws Exception
+ {
+ IdentitySessionFactory factory = ctx.getIdentitySessionFactory();
+
+ IdentitySession session = factory.createIdentitySession(realmName);
+
+ ctx.begin();
+
+ // Create stuff
+ User user1 = session.getPersistenceManager().createUser("user1");
+ User user2 = session.getPersistenceManager().createUser("user2");
+ User user3 = session.getPersistenceManager().createUser("user3");
+ User user4 = session.getPersistenceManager().createUser("user4");
+
+ Group group1 = session.getPersistenceManager().createGroup("group1",
ORGANIZATION);
+ Group group2 = session.getPersistenceManager().createGroup("group2",
ORGANIZATION_UNIT);
+ Group group3 = session.getPersistenceManager().createGroup("group3",
ORGANIZATION_UNIT);
+ Group group4 = session.getPersistenceManager().createGroup("group4",
DEPARTMENT);
+ Group group5 = session.getPersistenceManager().createGroup("group5",
DEPARTMENT);
+
+
+ // Associate groups
+
+ session.getRelationshipManager().associateGroups(group1, group2);
+ session.getRelationshipManager().associateGroups(group1, group3);
+
+ // Assert
+
+ // isAssociated
+
+ assertTrue(session.getRelationshipManager().isAssociated(group1, group2));
+ assertTrue(session.getRelationshipManager().isAssociated(group1, group3));
+ assertFalse(session.getRelationshipManager().isAssociated(group1, group4));
+ assertFalse(session.getRelationshipManager().isAssociated(group2, group1));
+ assertFalse(session.getRelationshipManager().isAssociated(group2, group3));
+
+ assertTrue(session.getRelationshipManager().isAssociated(Arrays.asList(group1),
Arrays.asList(group2, group3)));
+ assertFalse(session.getRelationshipManager().isAssociated(Arrays.asList(group1,
group2), Arrays.asList(group2, group3)));
+ assertFalse(session.getRelationshipManager().isAssociated(Arrays.asList(group2,
group3), Arrays.asList(group1)));
+
+ assertTrue(session.getRelationshipManager().isAssociatedByIds(group1.getId(),
group2.getId()));
+ assertTrue(session.getRelationshipManager().isAssociatedByIds(group1.getId(),
group3.getId()));
+ assertFalse(session.getRelationshipManager().isAssociatedByIds(group1.getId(),
group4.getId()));
+ assertFalse(session.getRelationshipManager().isAssociatedByIds(group2.getId(),
group1.getId()));
+ assertFalse(session.getRelationshipManager().isAssociatedByIds(group2.getId(),
group3.getId()));
+
+ assertTrue(session.getRelationshipManager().
+ isAssociatedByIds(Arrays.asList(group1.getId()), Arrays.asList(group2.getId(),
group3.getId())));
+ assertFalse(session.getRelationshipManager().
+ isAssociatedByIds(Arrays.asList(group1.getId(), group2.getId()),
Arrays.asList(group2.getId(), group3.getId())));
+ assertFalse(session.getRelationshipManager().
+ isAssociatedByIds(Arrays.asList(group2.getId(), group3.getId()),
Arrays.asList(group1.getId())));
+
+
+ // Associate groups - other methods
+
+ // First disassociate and assert
+ session.getRelationshipManager().disassociateGroups(Arrays.asList(group1),
Arrays.asList(group2, group3));
+
+ assertFalse(session.getRelationshipManager().isAssociated(group1, group2));
+ assertFalse(session.getRelationshipManager().isAssociated(group1, group3));
+
+ // reassociate #1
+ session.getRelationshipManager().associateGroups(Arrays.asList(group1),
Arrays.asList(group2, group3));
+ assertTrue(session.getRelationshipManager().isAssociated(Arrays.asList(group1),
Arrays.asList(group2, group3)));
+
+
session.getRelationshipManager().disassociateGroupsByIds(Arrays.asList(group1.getId()),
Arrays.asList(group2.getId(), group3.getId()));
+
+ // reassociate #2
+
session.getRelationshipManager().associateGroupsByIds(Arrays.asList(group1.getId()),
Arrays.asList(group2.getId(), group3.getId()));
+ assertTrue(session.getRelationshipManager().isAssociated(Arrays.asList(group1),
Arrays.asList(group2, group3)));
+
+ session.getRelationshipManager().disassociateGroups(Arrays.asList(group1),
Arrays.asList(group2, group3));
+
+ // reassociate #3
+ session.getRelationshipManager().associateGroupsByIds(group1.getId(),
group2.getId());
+ session.getRelationshipManager().associateGroupsByIds(group1.getId(),
group3.getId());
+ assertTrue(session.getRelationshipManager().isAssociated(Arrays.asList(group1),
Arrays.asList(group2, group3)));
+
+ session.getRelationshipManager().disassociateGroups(Arrays.asList(group1),
Arrays.asList(group2, group3));
+
+
+ // Associate Group and Users
+
+ session.getRelationshipManager().associateUser(group1, user1);
+ session.getRelationshipManager().associateUser(group1, user2);
+
+ // isAssociated
+
+ assertTrue(session.getRelationshipManager().isAssociated(group1, user1));
+ assertTrue(session.getRelationshipManager().isAssociated(group1, user2));
+ assertFalse(session.getRelationshipManager().isAssociated(group1, user3));
+ assertFalse(session.getRelationshipManager().isAssociated(group2, user1));
+ assertFalse(session.getRelationshipManager().isAssociated(group2, user3));
+
+ assertTrue(session.getRelationshipManager().isAssociated(Arrays.asList(group1),
Arrays.asList(user1, user2)));
+ assertFalse(session.getRelationshipManager().isAssociated(Arrays.asList(group1,
group2), Arrays.asList(user1, user2)));
+ assertFalse(session.getRelationshipManager().isAssociated(Arrays.asList(group2),
Arrays.asList(user3)));
+
+ assertTrue(session.getRelationshipManager().isAssociatedByIds(group1.getId(),
user1.getId()));
+ assertTrue(session.getRelationshipManager().isAssociatedByIds(group1.getId(),
user2.getId()));
+ assertFalse(session.getRelationshipManager().isAssociatedByIds(group1.getId(),
user3.getId()));
+ assertFalse(session.getRelationshipManager().isAssociatedByIds(group2.getId(),
user1.getId()));
+ assertFalse(session.getRelationshipManager().isAssociatedByIds(group2.getId(),
user3.getId()));
+
+ assertTrue(session.getRelationshipManager().
+ isAssociatedByIds(Arrays.asList(group1.getId()), Arrays.asList(user1.getId(),
user2.getId())));
+ assertFalse(session.getRelationshipManager().
+ isAssociatedByIds(Arrays.asList(group1.getId(), group2.getId()),
Arrays.asList(user1.getId(), user2.getId())));
+ assertFalse(session.getRelationshipManager().
+ isAssociatedByIds(Arrays.asList(group2.getId(), group3.getId()),
Arrays.asList(user1.getId())));
+
+
+ // Associate groups / users - other methods
+
+ // First disassociate and assert
+ session.getRelationshipManager().disassociateUsers(Arrays.asList(group1),
Arrays.asList(user1, user2));
+
+ assertFalse(session.getRelationshipManager().isAssociated(group1, user1));
+ assertFalse(session.getRelationshipManager().isAssociated(group1, user2));
+
+ // reassociate #1
+ session.getRelationshipManager().associateUsers(Arrays.asList(group1),
Arrays.asList(user1, user2));
+ assertTrue(session.getRelationshipManager().isAssociated(Arrays.asList(group1),
Arrays.asList(user1, user2)));
+
+ session.getRelationshipManager().disassociateUsers(Arrays.asList(group1),
Arrays.asList(user1, user2));
+
+ // reassociate #2
+ session.getRelationshipManager().associateUsersByIds(Arrays.asList(group1.getId()),
Arrays.asList(user1.getId(), user2.getId()));
+ assertTrue(session.getRelationshipManager().isAssociated(Arrays.asList(group1),
Arrays.asList(user1, user2)));
+
+
session.getRelationshipManager().disassociateUsersByIds(Arrays.asList(group1.getId()),
Arrays.asList(user1.getId(), user2.getId()));
+
+ // reassociate #3
+ session.getRelationshipManager().associateUserByIds(group1.getId(),
user1.getId());
+ session.getRelationshipManager().associateUserByIds(group1.getId(),
user2.getId());
+
+ assertTrue(session.getRelationshipManager().isAssociated(Arrays.asList(group1),
Arrays.asList(user1, user2)));
+
+ session.getRelationshipManager().disassociateUsers(Arrays.asList(group1),
Arrays.asList(user1, user2));
+
+
+ ctx.commit();
+
+ ctx.begin();
+
+
+ // Find methods - prepopulate
+
+ session.getRelationshipManager().associateUsers(Arrays.asList(group1),
Arrays.asList(user1, user2, user3));
+ session.getRelationshipManager().associateUsers(Arrays.asList(group3),
Arrays.asList(user2, user3));
+ session.getRelationshipManager().associateGroups(Arrays.asList(group2),
Arrays.asList(group3, group4, group5));
+
+ assertTrue(session.getRelationshipManager().isAssociated(Arrays.asList(group1),
Arrays.asList(user1, user2, user3)));
+ assertTrue(session.getRelationshipManager().isAssociated(Arrays.asList(group2),
Arrays.asList(group3, group4, group5)));
+ assertTrue(session.getRelationshipManager().isAssociated(Arrays.asList(group3),
Arrays.asList(user2, user3)));
+
+ ctx.commit();
+ ctx.begin();
+
+ // Find users
+ //TODO: check if collections contain correct objects (not only size)
+
+ assertEquals(3, session.getRelationshipManager().findAssociatedUsers(group1,
false).size());
+ assertEquals(0, session.getRelationshipManager().findAssociatedUsers(group2,
false).size());
+
+ assertEquals(3, session.getRelationshipManager().findAssociatedUsers(group1, false,
null).size());
+ assertEquals(0, session.getRelationshipManager().findAssociatedUsers(group2, false,
null).size());
+
+ assertEquals(3,
session.getRelationshipManager().findAssociatedUsers(group1.getId(), false,
null).size());
+ assertEquals(0,
session.getRelationshipManager().findAssociatedUsers(group2.getId(), false,
null).size());
+
+ // Find groups
+
+ // #1
+ assertEquals(3, session.getRelationshipManager().findAssociatedGroups(group2, null,
true, false).size());
+ assertEquals(2, session.getRelationshipManager().findAssociatedGroups(group2,
DEPARTMENT, true, false).size());
+ assertEquals(1, session.getRelationshipManager().findAssociatedGroups(group2,
ORGANIZATION_UNIT, true, false).size());
+ assertEquals(0, session.getRelationshipManager().findAssociatedGroups(group2,
ORGANIZATION, true, false).size());
+
+ // #1
+ assertEquals(2,
session.getRelationshipManager().findAssociatedGroups(group2.getId(), DEPARTMENT, true,
false, null).size());
+ assertEquals(1,
session.getRelationshipManager().findAssociatedGroups(group2.getId(), ORGANIZATION_UNIT,
true, false, null).size());
+ assertEquals(0,
session.getRelationshipManager().findAssociatedGroups(group2.getId(), ORGANIZATION, true,
false, null).size());
+
+ // #3
+ assertEquals(1, session.getRelationshipManager().findAssociatedGroups(group3,
ORGANIZATION_UNIT, false, false).size());
+ assertEquals(1, session.getRelationshipManager().findAssociatedGroups(group4,
ORGANIZATION_UNIT, false, false).size());
+ assertEquals(0, session.getRelationshipManager().findAssociatedGroups(group2,
ORGANIZATION, false, false).size());
+ assertEquals(3, session.getRelationshipManager().findAssociatedGroups(group2, null,
true, false).size());
+
+ // #4
+ assertEquals(1,
session.getRelationshipManager().findAssociatedGroups(group3.getId(), ORGANIZATION_UNIT,
false, false, null).size());
+ assertEquals(1,
session.getRelationshipManager().findAssociatedGroups(group4.getId(), ORGANIZATION_UNIT,
false, false, null).size());
+ assertEquals(0,
session.getRelationshipManager().findAssociatedGroups(group2.getId(), ORGANIZATION, false,
false, null).size());
+
+ // #5
+ assertEquals(1,
session.getRelationshipManager().findAssociatedGroups(user1).size());
+ assertEquals(2,
session.getRelationshipManager().findAssociatedGroups(user2).size());
+ assertEquals(2,
session.getRelationshipManager().findAssociatedGroups(user3).size());
+ assertEquals(0,
session.getRelationshipManager().findAssociatedGroups(user4).size());
+
+ // #6
+ assertEquals(1,
session.getRelationshipManager().findAssociatedGroups(user1.getId(), null).size());
+ assertEquals(2,
session.getRelationshipManager().findAssociatedGroups(user2.getId(), null).size());
+ assertEquals(2,
session.getRelationshipManager().findAssociatedGroups(user3.getId(), null).size());
+ assertEquals(0,
session.getRelationshipManager().findAssociatedGroups(user4.getId(), null).size());
+
+ // #7
+ assertEquals(1, session.getRelationshipManager().findAssociatedGroups(user1,
ORGANIZATION).size());
+ assertEquals(0, session.getRelationshipManager().findAssociatedGroups(user1,
ORGANIZATION_UNIT).size());
+ assertEquals(2, session.getRelationshipManager().findAssociatedGroups(user2,
(String)null).size());
+ assertEquals(1, session.getRelationshipManager().findAssociatedGroups(user2,
ORGANIZATION).size());
+ assertEquals(1, session.getRelationshipManager().findAssociatedGroups(user2,
ORGANIZATION_UNIT).size());
+ assertEquals(1, session.getRelationshipManager().findAssociatedGroups(user3,
ORGANIZATION).size());
+ assertEquals(1, session.getRelationshipManager().findAssociatedGroups(user3,
ORGANIZATION_UNIT).size());
+ assertEquals(0, session.getRelationshipManager().findAssociatedGroups(user4,
ORGANIZATION).size());
+ assertEquals(0, session.getRelationshipManager().findAssociatedGroups(user4,
ORGANIZATION_UNIT).size());
+
+ // #7
+ assertEquals(1,
session.getRelationshipManager().findAssociatedGroups(user1.getId(), ORGANIZATION,
null).size());
+ assertEquals(0,
session.getRelationshipManager().findAssociatedGroups(user1.getId(), ORGANIZATION_UNIT,
null).size());
+ assertEquals(1,
session.getRelationshipManager().findAssociatedGroups(user2.getId(), ORGANIZATION,
null).size());
+ assertEquals(1,
session.getRelationshipManager().findAssociatedGroups(user2.getId(), ORGANIZATION_UNIT,
null).size());
+ assertEquals(1,
session.getRelationshipManager().findAssociatedGroups(user3.getId(), ORGANIZATION,
null).size());
+ assertEquals(1,
session.getRelationshipManager().findAssociatedGroups(user3.getId(), ORGANIZATION_UNIT,
null).size());
+ assertEquals(0,
session.getRelationshipManager().findAssociatedGroups(user4.getId(), ORGANIZATION,
null).size());
+ assertEquals(0,
session.getRelationshipManager().findAssociatedGroups(user4.getId(), ORGANIZATION_UNIT,
null).size());
+
+ // Cleanup and check
+ session.getRelationshipManager().disassociateUsers(Arrays.asList(group1),
Arrays.asList(user1, user2, user3));
+ session.getRelationshipManager().disassociateUsers(Arrays.asList(group3),
Arrays.asList(user2, user3));
+ session.getRelationshipManager().disassociateGroups(Arrays.asList(group2),
Arrays.asList(group3, group4));
+
+ assertFalse(session.getRelationshipManager().isAssociated(Arrays.asList(group1),
Arrays.asList(user1, user2, user3)));
+ assertFalse(session.getRelationshipManager().isAssociated(Arrays.asList(group2),
Arrays.asList(group3, group4, group5)));
+ assertFalse(session.getRelationshipManager().isAssociated(Arrays.asList(group3),
Arrays.asList(user2, user3)));
+
+ ctx.commit();
+
+ }
+
+ public void testMergedRoleAssociations(String realmName) throws Exception
+ {
+ IdentitySessionFactory factory = ctx.getIdentitySessionFactory();
+
+ IdentitySession session = factory.createIdentitySession(realmName);
+
+ ctx.begin();
+
+ // Create stuff
+ User user1 = session.getPersistenceManager().createUser("user1");
+ User user2 = session.getPersistenceManager().createUser("user2");
+ User user3 = session.getPersistenceManager().createUser("user3");
+ User user4 = session.getPersistenceManager().createUser("user4");
+
+ Group group1 = session.getPersistenceManager().createGroup("group1",
ORGANIZATION);
+ Group group2 = session.getPersistenceManager().createGroup("group2",
ORGANIZATION_UNIT);
+ Group group3 = session.getPersistenceManager().createGroup("group3",
ORGANIZATION_UNIT);
+ Group group4 = session.getPersistenceManager().createGroup("group4",
DEPARTMENT);
+ Group group5 = session.getPersistenceManager().createGroup("group5",
DEPARTMENT);
+
+ // Associate
+
+ session.getRelationshipManager().associateGroups(group1, group2);
+ session.getRelationshipManager().associateGroups(group1, group3);
+ session.getRelationshipManager().associateUser(group1, user1);
+ session.getRelationshipManager().associateUser(group1, user2);
+
+ session.getRoleManager().createRoleType("rt1");
+ session.getRoleManager().createRoleType("rt2");
+
+ session.getRoleManager().createRole("rt1", user1.getId(),
group1.getId());
+ session.getRoleManager().createRole("rt1", user3.getId(),
group1.getId());
+ session.getRoleManager().createRole("rt1", user4.getId(),
group1.getId());
+ session.getRoleManager().createRole("rt2", user3.getId(),
group1.getId());
+
+ session.getRoleManager().createRole("rt1", user3.getId(),
group2.getId());
+ session.getRoleManager().createRole("rt2", user2.getId(),
group3.getId());
+
+ // Assert
+
+ assertEquals(2, session.getRelationshipManager().findAssociatedUsers(group1, false,
null).size());
+ assertEquals(4, session.getRelationshipManager().findRelatedUsers(group1,
null).size());
+
+ assertEquals(0, session.getRelationshipManager().findAssociatedUsers(group2, false,
null).size());
+ assertEquals(1, session.getRelationshipManager().findRelatedUsers(group2,
null).size());
+
+ assertEquals(0, session.getRelationshipManager().findAssociatedGroups(user3,
(IdentitySearchCriteria)null).size());
+ assertEquals(2, session.getRelationshipManager().findRelatedGroups(user3, null,
null).size());
+
+ assertEquals(1, session.getRelationshipManager().findAssociatedGroups(user2,
(IdentitySearchCriteria)null).size());
+ assertEquals(2, session.getRelationshipManager().findRelatedGroups(user2, null,
null).size());
+
+ ctx.commit();
+
+ }
+}
\ No newline at end of file
Added:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/RoleManagerTest.java
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/RoleManagerTest.java
(rev 0)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/RoleManagerTest.java 2009-05-09
11:10:49 UTC (rev 485)
@@ -0,0 +1,287 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.impl.api;
+
+import org.jboss.identity.idm.api.IdentitySession;
+import org.jboss.identity.idm.api.Group;
+import org.jboss.identity.idm.api.User;
+import org.jboss.identity.idm.api.RoleType;
+import org.jboss.identity.idm.api.IdentitySessionFactory;
+import org.jboss.identity.idm.api.Role;
+
+import junit.framework.Assert;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Set;
+import java.util.HashSet;
+
+/**
+ *
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class RoleManagerTest extends Assert
+{
+ //TODO:
+ //TODO: - exception handling
+ //TODO: - search criteria
+ //TODO: - features description
+
+ APITestContext ctx;
+
+ private String ORGANIZATION = "ORGANIZATION";
+ private String ORGANIZATION_UNIT = "ORGANIZATION_UNIT";
+ private String DIVISION = "DIVISION";
+ private String DEPARTMENT = "DEPARTMENT";
+ private String PROJECT = "PROJECT";
+ private String PEOPLE = "PEOPLE";
+
+ public RoleManagerTest(APITestContext ctx)
+ {
+ this.ctx = ctx;
+ }
+
+ public void setCtx(APITestContext ctx)
+ {
+ this.ctx = ctx;
+ }
+
+ public APITestContext getCtx()
+ {
+ return ctx;
+ }
+
+ public void testMethods(String realmName) throws Exception
+ {
+ IdentitySessionFactory factory = ctx.getIdentitySessionFactory();
+
+ IdentitySession session = factory.createIdentitySession(realmName);
+
+ ctx.begin();
+
+
+
+ // RoleTypes - pure
+ assertEquals(0, session.getRoleManager().findRoleTypes(null).size());
+
+ // Create / remove
+ RoleType rt1 = session.getRoleManager().createRoleType("rt1");
+ RoleType rt2 = session.getRoleManager().createRoleType("rt2");
+ RoleType rt3 = session.getRoleManager().createRoleType("rt3");
+ RoleType rt4 = session.getRoleManager().createRoleType("rt4");
+
+ assertEquals(4, session.getRoleManager().findRoleTypes(null).size());
+
+ session.getRoleManager().removeRoleType(rt1);
+ session.getRoleManager().removeRoleType(rt2);
+
+ assertEquals(2, session.getRoleManager().findRoleTypes(null).size());
+
+ session.getRoleManager().removeRoleType("rt3");
+ session.getRoleManager().removeRoleType("rt4");
+
+ assertEquals(0, session.getRoleManager().findRoleTypes(null).size());
+
+ // Create all entities for tests
+
+ User user1 = session.getPersistenceManager().createUser("user1");
+ User user2 = session.getPersistenceManager().createUser("user2");
+ User user3 = session.getPersistenceManager().createUser("user3");
+ User user4 = session.getPersistenceManager().createUser("user4");
+
+ Group group1 = session.getPersistenceManager().createGroup("group1",
ORGANIZATION);
+ Group group2 = session.getPersistenceManager().createGroup("group2",
ORGANIZATION_UNIT);
+ Group group3 = session.getPersistenceManager().createGroup("group3",
ORGANIZATION_UNIT);
+ Group group4 = session.getPersistenceManager().createGroup("group4",
DEPARTMENT);
+ Group group5 = session.getPersistenceManager().createGroup("group5",
DEPARTMENT);
+
+ rt1 = session.getRoleManager().createRoleType("rt1");
+ rt2 = session.getRoleManager().createRoleType("rt2");
+ rt3 = session.getRoleManager().createRoleType("rt3");
+ rt4 = session.getRoleManager().createRoleType("rt4");
+
+ assertEquals(4, session.getRoleManager().findRoleTypes(null).size());
+
+
+
+
+ // Create/remove and find roles
+
+ Role role1 = session.getRoleManager().createRole(rt1, user1, group1);
+ Role role2 = session.getRoleManager().createRole(rt1, user1, group2);
+ Role role3 = session.getRoleManager().createRole("rt2", user1.getId(),
group1.getId());
+
+
+
+
+ //
+
+ assertEquals(2, session.getRoleManager().findRoles(user1, rt1).size());
+ assertEquals(1, session.getRoleManager().findRoles(user1, rt2).size());
+ assertEquals(1, session.getRoleManager().findRoles(group1, rt1).size());
+ assertEquals(1, session.getRoleManager().findRoles(group1, rt2).size());
+
+ //
+
+ assertEquals(2, session.getRoleManager().findGroupRoleTypes(group1).size());
+ assertEquals(1, session.getRoleManager().findGroupRoleTypes(group2.getId(),
null).size());
+
+ //
+
+ assertEquals(2, session.getRoleManager().findRoles(user1, rt1).size());
+ assertEquals(1, session.getRoleManager().findRoles(user1.getId(),
"rt2").size());
+ assertEquals(1, session.getRoleManager().findRoles(group1.getId(),
"rt1").size());
+ assertEquals(1, session.getRoleManager().findRoles(group1, rt1).size());
+
+ //
+
+ assertEquals(2, session.getRoleManager().findGroupsWithRelatedRole(user1,
null).size());
+ assertEquals(1, session.getRoleManager().findGroupsWithRelatedRole(user1.getId(),
ORGANIZATION, null).size());
+
+ //
+
+ assertEquals(2, session.getRoleManager().findRoleTypes(user1, group1).size());
+ assertEquals(1, session.getRoleManager().findRoleTypes(user1.getId(),
group2.getId(), null).size());
+
+ //
+
+ assertEquals(2, session.getRoleManager().findUserRoleTypes(user1).size());
+ assertEquals(0, session.getRoleManager().findUserRoleTypes(user2.getId(),
null).size());
+
+ //
+ assertTrue(session.getRoleManager().hasRole(user1, group1, rt1));
+ assertTrue(session.getRoleManager().hasRole(user1, group1, rt2));
+ assertTrue(session.getRoleManager().hasRole("user1", group2.getId(),
"rt1"));
+ assertFalse(session.getRoleManager().hasRole("user2", group2.getId(),
"rt1"));
+ assertFalse(session.getRoleManager().hasRole(user1, group1, rt3));
+ assertFalse(session.getRoleManager().hasRole(user1, group4, rt3));
+
+ // Role properties
+
+ assertEquals(0, session.getRoleManager().getProperties(role1).keySet().size());
+ assertEquals(0, session.getRoleManager().getProperties(rt1).keySet().size());
+ assertEquals(0,
session.getRoleManager().getProperties(rt1.getName()).keySet().size());
+
+ session.getRoleManager().setProperty(role1, "roleProp1",
"val1");
+ session.getRoleManager().setProperty(role1, "roleProp1",
"val2");
+ session.getRoleManager().setProperty(role1, "roleProp2",
"val1");
+ session.getRoleManager().setProperty(rt1, "rtProp1", "val1");
+ session.getRoleManager().setProperty(rt1.getName(), "rtProp1",
"val2");
+ session.getRoleManager().setProperty(rt1, "rtProp2", "val1");
+ session.getRoleManager().setProperty(rt1, "rtProp3", "val1");
+
+ assertEquals(2, session.getRoleManager().getProperties(role1).keySet().size());
+ assertEquals(3, session.getRoleManager().getProperties(rt1).keySet().size());
+ assertEquals(3,
session.getRoleManager().getProperties(rt1.getName()).keySet().size());
+
+ assertEquals("val2",
session.getRoleManager().getProperties(role1).get("roleProp1"));
+ assertEquals("val1",
session.getRoleManager().getProperties(role1).get("roleProp2"));
+ assertEquals("val2",
session.getRoleManager().getProperties(rt1).get("rtProp1"));
+ assertEquals("val1",
session.getRoleManager().getProperties(rt1).get("rtProp2"));
+ assertEquals("val1",
session.getRoleManager().getProperties(rt1).get("rtProp3"));
+
+
+ Map<String, String> props = new HashMap<String, String>();
+ props.put("prop5", "val1");
+
+ session.getRoleManager().setProperties(role2, props);
+
+ assertEquals(1, session.getRoleManager().getProperties(role2).keySet().size());
+
+ assertEquals("val1",
session.getRoleManager().getProperties(role2).get("prop5"));
+
+
+ props.put("prop6", "val3");
+ session.getRoleManager().setProperties(rt2, props);
+ session.getRoleManager().setProperties(rt3.getName(), props);
+
+ assertEquals(2, session.getRoleManager().getProperties(rt2).keySet().size());
+
+ assertEquals("val3",
session.getRoleManager().getProperties(rt2).get("prop6"));
+ assertEquals("val3",
session.getRoleManager().getProperties(rt3).get("prop6"));
+
+
+ session.getRoleManager().removeProperty(role2, "prop5");
+ assertEquals(0, session.getRoleManager().getProperties(role2).keySet().size());
+
+ session.getRoleManager().removeProperty(rt2, "prop6");
+ assertEquals(1, session.getRoleManager().getProperties(rt2).keySet().size());
+ session.getRoleManager().removeProperty(rt2, "prop5");
+ assertEquals(0, session.getRoleManager().getProperties(rt2).keySet().size());
+
+
+ // Remove roles
+
+ session.getRoleManager().removeRole(rt1, user1, group1);
+ session.getRoleManager().removeRole(role2);
+ session.getRoleManager().removeRole("rt2", user1.getId(),
group1.getId());
+
+ assertFalse(session.getRoleManager().hasRole(user1, group1, rt1));
+ assertFalse(session.getRoleManager().hasRole(user1, group1, rt2));
+ assertFalse(session.getRoleManager().hasRole("user1", group2.getId(),
"rt1"));
+
+ //
+
+ assertEquals(0, session.getRoleManager().findRoles(user1, rt1).size());
+ assertEquals(0, session.getRoleManager().findRoles(user1, rt2).size());
+ assertEquals(0, session.getRoleManager().findRoles(group1, rt1).size());
+ assertEquals(0, session.getRoleManager().findRoles(group1, rt2).size());
+
+ //
+
+ assertEquals(0, session.getRoleManager().findGroupRoleTypes(group1).size());
+ assertEquals(0, session.getRoleManager().findGroupRoleTypes(group2.getId(),
null).size());
+
+ //
+
+ assertEquals(0, session.getRoleManager().findRoles(user1, rt1).size());
+ assertEquals(0, session.getRoleManager().findRoles(user1.getId(),
"rt2").size());
+ assertEquals(0, session.getRoleManager().findRoles(group1.getId(),
"rt1").size());
+ assertEquals(0, session.getRoleManager().findRoles(group1, rt1).size());
+
+ //
+
+ assertEquals(0, session.getRoleManager().findGroupsWithRelatedRole(user1,
null).size());
+ assertEquals(0, session.getRoleManager().findGroupsWithRelatedRole(user1.getId(),
ORGANIZATION, null).size());
+
+ //
+
+ assertEquals(0, session.getRoleManager().findRoleTypes(user1, group1).size());
+ assertEquals(0, session.getRoleManager().findRoleTypes(user1.getId(),
group2.getId(), null).size());
+
+ //
+
+ assertEquals(0, session.getRoleManager().findUserRoleTypes(user1).size());
+ assertEquals(0, session.getRoleManager().findUserRoleTypes(user2.getId(),
null).size());
+
+
+
+
+ ctx.commit();
+
+ }
+
+
+
+}
\ No newline at end of file
Added:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/RoleQueryTest.java
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/RoleQueryTest.java
(rev 0)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/RoleQueryTest.java 2009-05-09
11:10:49 UTC (rev 485)
@@ -0,0 +1,116 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.impl.api;
+
+import org.jboss.identity.idm.api.IdentitySession;
+import org.jboss.identity.idm.api.User;
+import org.jboss.identity.idm.api.Group;
+import org.jboss.identity.idm.api.RoleType;
+import org.jboss.identity.idm.api.Role;
+import org.jboss.identity.idm.api.query.RoleQueryBuilder;
+import org.jboss.identity.idm.api.query.RoleQuery;
+import junit.framework.Assert;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class RoleQueryTest extends Assert
+{
+ private APITestContext ctx;
+
+ private String ORGANIZATION = "ORGANIZATION";
+ private String ORGANIZATION_UNIT = "ORGANIZATION_UNIT";
+ private String DEPARTMENT = "DEPARTMENT";
+
+ public RoleQueryTest(APITestContext testContext)
+ {
+ this.ctx = testContext;
+ }
+
+ public void testQuery(String realmName) throws Exception
+ {
+ ctx.begin();
+
+ IdentitySession ids =
ctx.getIdentitySessionFactory().getCurrentIdentitySession(realmName);
+
+ // Create some stuff...
+
+ User user1 = ids.getPersistenceManager().createUser("user1");
+ User user2 = ids.getPersistenceManager().createUser("user2");
+ User user3 = ids.getPersistenceManager().createUser("user3");
+ User user4 = ids.getPersistenceManager().createUser("user4");
+
+ Group group1 = ids.getPersistenceManager().createGroup("group1",
ORGANIZATION);
+ Group group2 = ids.getPersistenceManager().createGroup("group2",
ORGANIZATION_UNIT);
+ Group group3 = ids.getPersistenceManager().createGroup("group3",
ORGANIZATION_UNIT);
+ Group group4 = ids.getPersistenceManager().createGroup("group4",
DEPARTMENT);
+ Group group5 = ids.getPersistenceManager().createGroup("group5",
DEPARTMENT);
+
+ RoleType rt1 = ids.getRoleManager().createRoleType("rt1");
+ RoleType rt2 = ids.getRoleManager().createRoleType("rt2");
+ RoleType rt3 = ids.getRoleManager().createRoleType("rt3");
+ RoleType rt4 = ids.getRoleManager().createRoleType("rt4");
+
+ Role role1 = ids.getRoleManager().createRole(rt1, user1, group1);
+ Role role2 = ids.getRoleManager().createRole(rt1, user1, group2);
+ Role role3 = ids.getRoleManager().createRole("rt2", user1.getId(),
group1.getId());
+
+ // Test Query
+
+ //
+ RoleQueryBuilder rqb = ids.createRoleQueryBuilder();
+
+ rqb.setUser("user1");
+
+ RoleQuery rq = rqb.createQuery();
+
+ assertEquals(3, ids.execute(rq).size());
+
+ //
+ rqb.setGroup(group1);
+ rq = rqb.createQuery();
+
+ assertEquals(2, ids.execute(rq).size());
+
+ //
+ rqb.setRoleType(rt2);
+ rq = rqb.createQuery();
+
+ assertEquals(1, ids.execute(rq).size());
+
+
+ //
+ rqb.reset();
+
+ rqb.setGroup(group2);
+ rqb.setRoleType(rt1);
+
+ rq = rqb.createQuery();
+
+ assertEquals(1, ids.execute(rq).size());
+ assertEquals(role2, ids.uniqueResult(rq));
+
+ ctx.commit();
+ }
+}
Added:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/UserQueryTest.java
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/UserQueryTest.java
(rev 0)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/UserQueryTest.java 2009-05-09
11:10:49 UTC (rev 485)
@@ -0,0 +1,218 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.impl.api;
+
+import org.jboss.identity.idm.api.IdentitySession;
+import org.jboss.identity.idm.api.User;
+import org.jboss.identity.idm.api.Group;
+import org.jboss.identity.idm.api.RoleType;
+import org.jboss.identity.idm.api.Role;
+import org.jboss.identity.idm.api.SortOrder;
+import org.jboss.identity.idm.api.query.UserQuery;
+import org.jboss.identity.idm.api.query.UserQueryBuilder;
+import junit.framework.Assert;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class UserQueryTest extends Assert
+{
+ private APITestContext ctx;
+
+ private String ORGANIZATION = "ORGANIZATION";
+
+ private String ORGANIZATION_UNIT = "ORGANIZATION_UNIT";
+
+ private String DEPARTMENT = "DEPARTMENT";
+
+ public UserQueryTest(APITestContext testContext)
+ {
+ this.ctx = testContext;
+ }
+
+ public void testQuery(String realmName) throws Exception
+ {
+ ctx.begin();
+
+ IdentitySession ids =
ctx.getIdentitySessionFactory().getCurrentIdentitySession(realmName);
+
+ // Create stuff
+
+ User user1 = ids.getPersistenceManager().createUser("user1");
+ User user2 = ids.getPersistenceManager().createUser("user2");
+ User user3 = ids.getPersistenceManager().createUser("user3");
+ User user4 = ids.getPersistenceManager().createUser("user4");
+ User testUser1 = ids.getPersistenceManager().createUser("testUser1");
+ User testUser2 = ids.getPersistenceManager().createUser("testUser2");
+ User testUser3 = ids.getPersistenceManager().createUser("testUser3");
+ User testUser4 = ids.getPersistenceManager().createUser("testUser4");
+
+ Group group1 = ids.getPersistenceManager().createGroup("group1",
ORGANIZATION);
+ Group group2 = ids.getPersistenceManager().createGroup("group2",
ORGANIZATION_UNIT);
+ Group group3 = ids.getPersistenceManager().createGroup("group3",
ORGANIZATION_UNIT);
+ Group group4 = ids.getPersistenceManager().createGroup("group4",
DEPARTMENT);
+ Group group5 = ids.getPersistenceManager().createGroup("group5",
DEPARTMENT);
+
+ ids.getRelationshipManager().associateUser(group1, user1);
+ ids.getRelationshipManager().associateUser(group1, user2);
+
+ RoleType rt1 = ids.getRoleManager().createRoleType("rt1");
+ RoleType rt2 = ids.getRoleManager().createRoleType("rt2");
+ RoleType rt3 = ids.getRoleManager().createRoleType("rt3");
+ RoleType rt4 = ids.getRoleManager().createRoleType("rt4");
+
+ Role role1 = ids.getRoleManager().createRole(rt1, user1, group1);
+ Role role2 = ids.getRoleManager().createRole(rt1, user1, group2);
+ Role role3 = ids.getRoleManager().createRole("rt2", user1.getId(),
group1.getId());
+
+ // Asserts
+
+ //
+ UserQueryBuilder qb = ids.createUserQueryBuilder();
+
+ qb.withUserId("user1");
+ UserQuery q = qb.createQuery();
+
+ assertEquals(1, ids.execute(q).size());
+ assertEquals(1, ids.list(q).size());
+ assertEquals("user1", ids.uniqueResult(q).getId());
+
+ //
+ qb.reset();
+
+ qb.addAssociatedGroup(group2);
+
+ assertEquals(0, ids.execute(qb.createQuery()).size());
+
+ //
+ qb.reset();
+
+ qb.addAssociatedGroup(group1);
+
+ assertEquals(2, ids.execute(qb.createQuery()).size());
+
+ //
+ qb.reset();
+
+ qb.addAssociatedGroup(group1);
+ qb.withUserId(user1.getId());
+
+ assertEquals(1, ids.execute(qb.createQuery()).size());
+
+ //
+ qb.reset();
+
+ qb.addAssociatedGroup(group2);
+ qb.withUserId(user1.getId());
+
+ assertEquals(0, ids.execute(qb.createQuery()).size());
+
+ //
+ qb.reset();
+
+ qb.addAssociatedGroup(group1);
+ qb.addGroupConnectedWithRole(group2);
+
+ assertEquals(1, ids.execute(qb.createQuery()).size());
+ assertEquals(user1, ids.uniqueResult(qb.createQuery()));
+
+ //
+ qb.reset();
+
+ qb.addRelatedGroup(group1);
+
+ assertEquals(2, ids.execute(qb.createQuery()).size());
+
+ //
+ qb.reset();
+
+ qb.addRelatedGroup(group2);
+ qb.addAssociatedGroup(group1);
+
+ assertEquals(1, ids.execute(qb.createQuery()).size());
+ assertEquals(user1, ids.uniqueResult(qb.createQuery()));
+
+ //
+ qb.reset();
+
+ assertEquals(8, ids.execute(qb.createQuery()).size());
+
+
+ // Criteria
+
+ // All users
+ qb.reset();
+
+ assertEquals(8, ids.execute(qb.createQuery()).size());
+
+ // All users sorted
+ qb.reset();
+ qb.sort(SortOrder.ASCENDING);
+
+ List<User> results = ids.list(qb.createQuery());
+
+ assertEquals(testUser1, results.get(0));
+ assertEquals(user4, results.get(7));
+
+ // All users sorted desc
+ qb.reset();
+ qb.sort(SortOrder.DESCENDING);
+
+ results = ids.list(qb.createQuery());
+
+ assertEquals(testUser1, results.get(7));
+ assertEquals(user4, results.get(0));
+
+ //
+ qb.reset();
+ qb.sort(SortOrder.DESCENDING);
+ qb.idFilter("test*");
+
+ results = ids.list(qb.createQuery());
+
+ assertEquals(4, results.size());
+ assertEquals(testUser1, results.get(3));
+ assertEquals(testUser4, results.get(0));
+
+ //
+ qb.reset();
+ qb.sort(SortOrder.ASCENDING);
+ qb.idFilter("user*");
+ qb.page(1, 2);
+ results = ids.list(qb.createQuery());
+
+ assertEquals(2, results.size());
+ assertEquals(user2, results.get(0));
+ assertEquals(user3, results.get(1));
+
+
+
+ ctx.commit();
+ }
+
+
+
+}
Copied:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreTestCase.java
(from rev 482,
idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreTestCase.java)
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreTestCase.java
(rev 0)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreTestCase.java 2009-05-09
11:10:49 UTC (rev 485)
@@ -0,0 +1,306 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.impl.store.hibernate;
+
+import org.jboss.identity.idm.spi.model.IdentityObject;
+import org.jboss.identity.idm.spi.model.IdentityObjectAttribute;
+import org.jboss.identity.idm.spi.store.IdentityStoreInvocationContext;
+import org.jboss.identity.idm.spi.store.IdentityStore;
+import org.jboss.identity.idm.spi.store.IdentityStoreSession;
+import
org.jboss.identity.idm.spi.configuration.metadata.IdentityStoreConfigurationMetaData;
+import org.jboss.identity.idm.spi.configuration.metadata.IdentityConfigurationMetaData;
+import org.jboss.identity.idm.spi.configuration.IdentityStoreConfigurationContext;
+import org.jboss.identity.idm.spi.configuration.IdentityConfigurationContextRegistry;
+import org.jboss.identity.idm.impl.store.hibernate.HibernateIdentityStoreImpl;
+import org.jboss.identity.idm.impl.store.IdentityTypeEnum;
+import org.jboss.identity.idm.impl.store.CommonIdentityStoreTest;
+import org.jboss.identity.idm.impl.store.IdentityStoreTestContext;
+import org.jboss.identity.idm.impl.configuration.jaxb2.JAXB2IdentityConfiguration;
+import org.jboss.identity.idm.impl.configuration.IdentityStoreConfigurationContextImpl;
+import org.jboss.identity.idm.impl.configuration.IdentityConfigurationImpl;
+import org.jboss.identity.idm.impl.api.SimpleAttribute;
+import org.jboss.identity.idm.impl.IdentityTestPOJO;
+import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.unit.api.pojo.annotations.Create;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class HibernateIdentityStoreTestCase extends IdentityTestPOJO implements
IdentityStoreTestContext
+{
+
+ protected HibernateIdentityStoreImpl store;
+
+ protected IdentityStoreInvocationContext ctx;
+
+ protected CommonIdentityStoreTest commonTest;
+
+ public HibernateIdentityStoreTestCase()
+ {
+
+ }
+
+ @Create
+ public void setUp() throws Exception
+ {
+ super.start();
+
+ setIdentityConfig("store-test-config.xml");
+
+ commonTest = new CommonIdentityStoreTest(this);
+
+ IdentityConfigurationMetaData configurationMD = JAXB2IdentityConfiguration
+ .createConfigurationMetaData(getIdentityConfig());
+
+ IdentityConfigurationContextRegistry identityConfiguration =
(IdentityConfigurationContextRegistry)
+ new IdentityConfigurationImpl().configure(configurationMD);
+
+ IdentityStoreConfigurationMetaData storeMD = null;
+
+ for (IdentityStoreConfigurationMetaData metaData :
configurationMD.getIdentityStores())
+ {
+ if (metaData.getId().equals("HibernateTestStore"))
+ {
+ storeMD = metaData;
+ break;
+ }
+ }
+
+ IdentityStoreConfigurationContext context =
+ new IdentityStoreConfigurationContextImpl(configurationMD,
identityConfiguration, storeMD);
+
+ store = new HibernateIdentityStoreImpl("HibernateTestStore")
+ {
+
+ @Override
+ protected Session getHibernateSession(IdentityStoreInvocationContext ctx)
+ {
+ return getHibernateSupport().getSessionFactory().getCurrentSession();
+ }
+
+ @Override
+ protected SessionFactory
bootstrapHibernateSessionFactory(IdentityStoreConfigurationContext configurationContext)
throws IdentityException
+ {
+ return getHibernateSupport().getSessionFactory();
+ }
+
+ };
+
+ store.bootstrap(context);
+
+
+ ctx = new IdentityStoreInvocationContext()
+ {
+ public IdentityStoreSession getIdentityStoreSession()
+ {
+ return null;
+ }
+
+ public String getRealmId()
+ {
+ return "testRealm";
+ }
+ };
+
+
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ super.stop();
+ }
+
+ public void begin()
+ {
+ getHibernateSupport().openSession();
+ }
+
+ public void commit()
+ {
+ assertTrue(getHibernateSupport().commitTransaction());
+ }
+
+ public void flush() throws Exception
+ {
+
+ getHibernateSupport().getSessionFactory().getCurrentSession().flush();
+ }
+
+ public IdentityStore getStore()
+ {
+ return store;
+ }
+
+ public IdentityStoreInvocationContext getCtx()
+ {
+ return ctx;
+ }
+
+ // Tests
+
+ @Test
+ public void testStorePersistence() throws Exception
+ {
+
+ commonTest.testStorePersistence();
+
+ }
+
+ @Test
+ public void testFindMethods() throws Exception
+ {
+
+ commonTest.testFindMethods();
+
+ }
+
+ @Test
+ public void testAttributes() throws Exception
+ {
+
+ begin();
+
+ IdentityObject user1 = store.createIdentityObject(ctx, "Adam",
IdentityTypeEnum.USER);
+ IdentityObject user2 = store.createIdentityObject(ctx, "Eva",
IdentityTypeEnum.USER);
+
+ flush();
+
+ IdentityObjectAttribute[] attrs = new IdentityObjectAttribute[]{
+ new SimpleAttribute("key1", new String[]{"val1",
"val2", "val3"}),
+ new SimpleAttribute("key2", new String[]{"val1",
"val2", "val3", "val4"})
+ };
+
+ store.addAttributes(ctx, user1, attrs);
+
+ flush();
+
+ Map<String, IdentityObjectAttribute> persistedAttrs =
store.getAttributes(ctx, user1);
+
+ assertEquals(2, persistedAttrs.keySet().size());
+
+ assertTrue(persistedAttrs.containsKey("key1"));
+ assertEquals(3, persistedAttrs.get("key1").getSize());
+
+ assertTrue(persistedAttrs.containsKey("key2"));
+ assertEquals(4, persistedAttrs.get("key2").getSize());
+
+ flush();
+
+ attrs = new IdentityObjectAttribute[]{
+ new SimpleAttribute("key3", new String[]{"val1"})
+ };
+
+
+ store.addAttributes(ctx, user1, attrs);
+
+ flush();
+
+ persistedAttrs = store.getAttributes(ctx, user1);
+
+ assertEquals(3, persistedAttrs.keySet().size());
+
+ assertTrue(persistedAttrs.containsKey("key1"));
+ assertEquals(3, persistedAttrs.get("key1").getSize());
+
+ assertTrue(persistedAttrs.containsKey("key2"));
+ assertEquals(4, persistedAttrs.get("key2").getSize());
+
+ assertTrue(persistedAttrs.containsKey("key3"));
+ assertEquals(1, persistedAttrs.get("key3").getSize());
+
+ flush();
+
+ attrs = new IdentityObjectAttribute[]{
+ new SimpleAttribute("key3", new String[]{"val2"})
+ };
+
+ store.addAttributes(ctx, user1, attrs);
+
+ flush();
+
+ persistedAttrs = store.getAttributes(ctx, user1);
+
+ assertEquals(3, persistedAttrs.keySet().size());
+
+ assertTrue(persistedAttrs.containsKey("key3"));
+ assertEquals(2, persistedAttrs.get("key3").getSize());
+
+ flush();
+
+ store.updateAttributes(ctx, user1, attrs);
+
+ flush();
+
+ persistedAttrs = store.getAttributes(ctx, user1);
+
+ assertEquals(3, persistedAttrs.keySet().size());
+
+ assertTrue(persistedAttrs.containsKey("key3"));
+ assertEquals(1, persistedAttrs.get("key3").getSize());
+
+ flush();
+
+ store.removeAttributes(ctx, user1, new String[] {"key3"});
+
+ flush();
+
+ persistedAttrs = store.getAttributes(ctx, user1);
+
+ assertEquals(2, persistedAttrs.keySet().size());
+
+
+ commit();
+
+ }
+
+ @Test
+ public void testRelationships() throws Exception
+ {
+ commonTest.testRelationships();
+ }
+
+ @Test
+ public void testPasswordCredentials() throws Exception
+ {
+ commonTest.testPasswordCredential();
+ }
+
+ public void testBinaryCredentials() throws Exception
+ {
+ commonTest.testBinaryCredential();
+ }
+
+ @Test
+ public void testCriteria() throws Exception
+ {
+ commonTest.testCriteria();
+ }
+
+}
\ No newline at end of file
Copied:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/hibernate/HibernateModelTestCase.java
(from rev 482,
idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/impl/store/hibernate/HibernateModelTestCase.java)
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/hibernate/HibernateModelTestCase.java
(rev 0)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/hibernate/HibernateModelTestCase.java 2009-05-09
11:10:49 UTC (rev 485)
@@ -0,0 +1,341 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.impl.store.hibernate;
+
+import
org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType;
+import org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject;
+import org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType;
+import org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship;
+import org.jboss.identity.idm.impl.model.hibernate.HibernateRealm;
+import org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute;
+import org.jboss.identity.idm.impl.IdentityTestPOJO;
+import org.jboss.unit.api.pojo.annotations.Destroy;
+import org.jboss.unit.api.pojo.annotations.Create;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.hibernate.Session;
+import org.hibernate.Query;
+import static org.jboss.unit.api.Assert.*;
+
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class HibernateModelTestCase extends IdentityTestPOJO
+{
+ public HibernateModelTestCase()
+ {
+ }
+
+
+ @Create
+ public void setUp() throws Exception
+ {
+ super.start();
+ }
+
+ @Destroy
+ public void tearDown() throws Exception
+ {
+ super.stop();
+ }
+
+ @Test
+ public void testPersistence() {
+
+
+ begin();
+ Session session = getSessionFactory().getCurrentSession();
+
+
+ HibernateRealm realm = new HibernateRealm("default");
+ session.persist(realm);
+
+ //
+
+ HibernateIdentityObjectType iot = new HibernateIdentityObjectType();
+ iot.setName("User");
+
+ session.persist(iot);
+ assertTrue(session.contains(iot));
+
+
+ HibernateIdentityObject io = new HibernateIdentityObject();
+ io.setName("John Kowalski");
+ io.setRealm(realm);
+ io.setIdentityType(iot);
+
+ session.persist(io);
+ assertTrue(session.contains(io));
+
+ session.delete(io);
+ assertFalse(session.contains(io));
+
+ //
+
+
+
+ //
+
+ HibernateIdentityObjectRelationshipType iort = new
HibernateIdentityObjectRelationshipType();
+ iort.setName("Member");
+
+ session.persist(iort);
+ assertTrue(session.contains(iort));
+
+ //
+
+// JPAIdentityObjectRelationship ior = new JPAIdentityObjectRelationship();
+// ior.setType(iort);
+//
+// em.persist(ior);
+// assertTrue(em.contains(ior));
+
+// em.remove(ior);
+// assertFalse(em.contains(ior));
+
+ //
+
+ assertTrue(session.contains(iort));
+
+ session.delete(iort);
+ assertFalse(session.contains(iort));
+
+ commit();
+
+
+ }
+
+ @Test
+ public void testRelationships()
+ {
+ begin();
+
+
+ Session session = getSessionFactory().getCurrentSession();
+
+
+ HibernateRealm realm = new HibernateRealm("default");
+ session.persist(realm);
+
+ HibernateIdentityObjectType groupType = new
HibernateIdentityObjectType("Group");
+ session.persist(groupType);
+ HibernateIdentityObjectType userType = new
HibernateIdentityObjectType("User");
+ session.persist(userType);
+
+ HibernateIdentityObject user1 = new HibernateIdentityObject("user1",
userType, realm);
+ session.persist(user1);
+ HibernateIdentityObject user2 = new HibernateIdentityObject("user2",
userType, realm);
+ session.persist(user2);
+ HibernateIdentityObject user3 = new HibernateIdentityObject("user3",
userType, realm);
+ session.persist(user3);
+
+ HibernateIdentityObject group1 = new HibernateIdentityObject("group1",
groupType, realm);
+ session.persist(group1);
+ HibernateIdentityObject group2 = new HibernateIdentityObject("group2",
groupType, realm);
+ session.persist(group2);
+ HibernateIdentityObject group3 = new HibernateIdentityObject("group3",
groupType, realm);
+ session.persist(group3);
+
+ HibernateIdentityObjectRelationshipType memberType = new
HibernateIdentityObjectRelationshipType("member");
+ session.persist(memberType);
+
+ HibernateIdentityObjectRelationship relationship = new
HibernateIdentityObjectRelationship(memberType, group1, user1);
+ session.persist(relationship);
+ relationship = new HibernateIdentityObjectRelationship(memberType, group1, user2);
+ session.persist(relationship);
+ relationship = new HibernateIdentityObjectRelationship(memberType, group2, user3);
+ session.persist(relationship);
+ relationship = new HibernateIdentityObjectRelationship(memberType, group2,
group1);
+ session.persist(relationship);
+
+ commit();
+
+ //
+
+
+ begin();
+
+ session = getSessionFactory().getCurrentSession();
+
+ Query ioQuery = session.createQuery("select o from HibernateIdentityObject o
where o.name like :name");
+
+ group1 = (HibernateIdentityObject)ioQuery.setParameter("name",
"group1").uniqueResult();
+ assertEquals(2, group1.getFromRelationships().size());
+ assertEquals(1, group1.getToRelationships().size());
+ group2 = (HibernateIdentityObject)ioQuery.setParameter("name",
"group2").uniqueResult();
+ assertEquals(2, group2.getFromRelationships().size());
+ assertEquals(0, group2.getToRelationships().size());
+
+ user3 = (HibernateIdentityObject)ioQuery.setParameter("name",
"user3").uniqueResult();
+ assertEquals(1, user3.getToRelationships().size());
+ assertEquals(0, user3.getFromRelationships().size());
+ assertEquals("group2",
user3.getToRelationships().iterator().next().getFromIdentityObject().getName());
+ commit();
+
+ }
+
+ @Test
+ public void testNameTypeConstraint() throws Exception
+ {
+
+ begin();
+ Session session = getSessionFactory().getCurrentSession();
+
+
+
+ HibernateRealm realm = new HibernateRealm("default");
+ session.persist(realm);
+
+ HibernateIdentityObjectType groupType = new
HibernateIdentityObjectType("Group");
+ session.persist(groupType);
+ HibernateIdentityObjectType userType = new
HibernateIdentityObjectType("User");
+ session.persist(userType);
+
+ HibernateIdentityObject user1 = new HibernateIdentityObject("user1",
userType, realm);
+ session.persist(user1);
+ HibernateIdentityObject user2 = new HibernateIdentityObject("user2",
userType, realm);
+ session.persist(user2);
+
+ commit();
+
+
+
+ begin();
+
+ session = getSessionFactory().getCurrentSession();
+
+ try
+ {
+
+ HibernateIdentityObject user3 = new HibernateIdentityObject("user2",
userType, realm);
+ session.persist(user3);
+
+ assertFalse(getHibernateSupport().commitTransaction());
+
+ }
+ catch (Exception e)
+ {
+ // may be expected
+ getHibernateSupport().rollbackTransaction();
+ }
+
+
+
+ begin();
+
+ session = getSessionFactory().getCurrentSession();
+
+
+ HibernateIdentityObject user4 = new HibernateIdentityObject("group1",
userType, realm);
+ session.persist(user4);
+
+
+ HibernateIdentityObject group1 = new HibernateIdentityObject("group1",
groupType, realm);
+ session.persist(group1);
+ HibernateIdentityObject group2 = new HibernateIdentityObject("group2",
groupType, realm);
+ session.persist(group2);
+
+ //session.flush();
+
+ try
+ {
+
+ HibernateIdentityObject group3 = new HibernateIdentityObject("group2",
groupType, realm);
+ session.persist(group3);
+
+ // Should fail
+ assertFalse(getHibernateSupport().commitTransaction());
+ }
+ catch (Exception e)
+ {
+ //expected
+ getHibernateSupport().rollbackTransaction();
+ }
+
+
+
+ begin();
+
+ session = getSessionFactory().getCurrentSession();
+
+ HibernateIdentityObject group4 = new HibernateIdentityObject("user1",
groupType, realm);
+ session.persist(group4);
+
+ session.flush();
+
+ commit();
+
+
+
+
+
+ }
+
+ @Test
+ public void testAttributes() throws Exception
+ {
+ begin();
+
+ Session session = getSessionFactory().getCurrentSession();
+
+
+
+
+ HibernateRealm realm = new HibernateRealm("default");
+ session.persist(realm);
+
+ HibernateIdentityObjectType userType = new
HibernateIdentityObjectType("User");
+ session.persist(userType);
+ HibernateIdentityObject user1 = new HibernateIdentityObject("user1",
userType, realm);
+ session.persist(user1);
+
+// Set<String> values1 = new HashSet<String>();
+// values1.add("Val1");
+// values1.add("Val2");
+// values1.add("Val3");
+
+
+ user1.getAttributes().add(new HibernateIdentityObjectTextAttribute(user1,
"simple1", new String[]{"Val1", "Val2",
"Val3"}));
+ user1.getAttributes().add(new HibernateIdentityObjectTextAttribute(user1,
"simple2", new String[]{"Val1", "Val2",
"Val3"}));
+
+
+ commit();
+
+
+
+ begin();
+
+ session = getSessionFactory().getCurrentSession();
+
+ user1 = (HibernateIdentityObject)session.get(HibernateIdentityObject.class, new
Long(user1.getId()));
+ assertEquals(2, user1.getAttributes().size() );
+// assertNotNull(user1.getProfileAttributes().get("simple1"));
+// assertEquals(3, user1.getProfileAttributes().get("simple1").length);
+
+
+ commit();
+
+ }
+
+}
\ No newline at end of file
Copied:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/ldap/LDAPIdentityStoreTestCase.java
(from rev 482,
idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/impl/store/ldap/LDAPIdentityStoreTestCase.java)
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/ldap/LDAPIdentityStoreTestCase.java
(rev 0)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/ldap/LDAPIdentityStoreTestCase.java 2009-05-09
11:10:49 UTC (rev 485)
@@ -0,0 +1,430 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.impl.store.ldap;
+
+import org.jboss.identity.idm.spi.store.IdentityStore;
+import org.jboss.identity.idm.spi.store.IdentityStoreInvocationContext;
+import org.jboss.identity.idm.spi.store.IdentityStoreSession;
+import org.jboss.identity.idm.spi.model.IdentityObject;
+import org.jboss.identity.idm.spi.model.IdentityObjectAttribute;
+import org.jboss.identity.idm.spi.configuration.metadata.IdentityConfigurationMetaData;
+import
org.jboss.identity.idm.spi.configuration.metadata.IdentityStoreConfigurationMetaData;
+import org.jboss.identity.idm.spi.configuration.IdentityConfigurationContextRegistry;
+import org.jboss.identity.idm.spi.configuration.IdentityStoreConfigurationContext;
+import org.jboss.identity.idm.impl.store.IdentityTypeEnum;
+import org.jboss.identity.idm.impl.store.CommonIdentityStoreTest;
+import org.jboss.identity.idm.impl.store.IdentityStoreTestContext;
+import org.jboss.identity.idm.impl.configuration.jaxb2.JAXB2IdentityConfiguration;
+import org.jboss.identity.idm.impl.configuration.IdentityConfigurationImpl;
+import org.jboss.identity.idm.impl.configuration.IdentityStoreConfigurationContextImpl;
+import org.jboss.identity.idm.impl.api.SimpleAttribute;
+import org.jboss.identity.idm.impl.LDAPTestPOJO;
+import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.unit.api.pojo.annotations.Create;
+import org.jboss.unit.api.pojo.annotations.Destroy;
+import org.jboss.unit.api.pojo.annotations.Test;
+
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.naming.ldap.LdapContext;
+import javax.naming.ldap.InitialLdapContext;
+import java.util.Hashtable;
+import java.util.Map;
+
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class LDAPIdentityStoreTestCase extends LDAPTestPOJO implements
IdentityStoreTestContext
+{
+
+ CommonIdentityStoreTest commonTest;
+
+ IdentityStoreInvocationContext ctx;
+
+ IdentityStore store;
+
+ public LDAPIdentityStoreTestCase()
+ {
+
+ }
+
+ @Create
+ public void setUp() throws Exception
+ {
+ super.start();
+
+ setIdentityConfig("store-test-config.xml");
+
+ commonTest = new CommonIdentityStoreTest(this);
+
+ IdentityConfigurationMetaData configurationMD = JAXB2IdentityConfiguration
+ .createConfigurationMetaData(getIdentityConfig());
+
+ IdentityConfigurationContextRegistry registry =
(IdentityConfigurationContextRegistry) new IdentityConfigurationImpl().
+ configure(configurationMD);
+
+ IdentityStoreConfigurationMetaData storeMD = null;
+
+ for (IdentityStoreConfigurationMetaData metaData :
configurationMD.getIdentityStores())
+ {
+ if (metaData.getId().equals("LDAPTestStore"))
+ {
+ storeMD = metaData;
+ break;
+ }
+ }
+
+ IdentityStoreConfigurationContext context = new
IdentityStoreConfigurationContextImpl(configurationMD, registry, storeMD);
+
+ ctx = new IdentityStoreInvocationContext()
+ {
+ public IdentityStoreSession getIdentityStoreSession()
+ {
+ return new IdentityStoreSession(){
+
+ public Object getSessionContext() throws IdentityException
+ {
+ try
+ {
+ return getLdapContext();
+ }
+ catch (Exception e)
+ {
+ throw new IdentityException("Failed to obtain LDAP connection:
", e);
+ }
+ }
+
+ public void close() throws IdentityException
+ {
+
+ }
+
+ public void save() throws IdentityException
+ {
+
+ }
+
+ public void clear() throws IdentityException
+ {
+
+ }
+
+ public boolean isOpen()
+ {
+ return false;
+ }
+
+ public boolean isTransactionSupported()
+ {
+ return false;
+ }
+
+ public void startTransaction()
+ {
+
+ }
+
+ public void commitTransaction()
+ {
+
+ }
+
+ public void rollbackTransaction()
+ {
+
+ }
+
+ public boolean isTransactionActive()
+ {
+ return false;
+ }
+ };
+ }
+
+ public String getRealmId()
+ {
+ return "testRealm";
+ }
+ };
+
+ //populate();
+
+ store = new LDAPIdentityStoreImpl("LDAPTestStore");
+
+ store.bootstrap(context);
+ }
+
+ @Destroy
+ public void tearDown() throws Exception
+ {
+ super.stop();
+ }
+
+
+ public void flush() throws Exception
+ {
+ //nothing
+ }
+
+ public IdentityStore getStore()
+ {
+ return store;
+ }
+
+ public IdentityStoreInvocationContext getCtx()
+ {
+ return ctx;
+ }
+
+
+ // Tests
+
+// Just test if OpenDS is running and was populated...
+ @Test
+ public void testSimple() throws Exception
+ {
+ populate();
+
+ Hashtable<String,String> env = new Hashtable<String,String>();
+ env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
+ env.put(Context.PROVIDER_URL, LDAP_PROVIDER_URL);
+ env.put(Context.SECURITY_AUTHENTICATION, "simple");
+ env.put(Context.SECURITY_PRINCIPAL, LDAP_PRINCIPAL);
+ env.put(Context.SECURITY_CREDENTIALS, LDAP_CREDENTIALS);
+
+ LdapContext ldapCtx = null;
+ try
+ {
+ ldapCtx = new InitialLdapContext(env, null);
+
+// Do something ...
+ System.out.println("Attributes: " +
ldapCtx.getAttributes("o=test,dc=portal,dc=example,dc=com"));
+
+ }
+ catch (NamingException e)
+ {
+ e.printStackTrace();
+ }
+ finally
+ {
+ try
+ {
+ if (ldapCtx != null)
+ {
+ ldapCtx.close();
+ }
+ }
+ catch (NamingException e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ @Test
+ public void testIdentityObjectCount() throws Exception
+ {
+ populate();
+
+ assertEquals(7, store.getIdentityObjectsCount(ctx, IdentityTypeEnum.USER));
+ assertEquals(5, store.getIdentityObjectsCount(ctx, IdentityTypeEnum.ROLE));
+ assertEquals(2, store.getIdentityObjectsCount(ctx, IdentityTypeEnum.GROUP));
+ }
+
+ @Test
+ public void testFindCreateRemove() throws Exception
+ {
+ populate();
+
+ assertEquals(7, store.getIdentityObjectsCount(ctx, IdentityTypeEnum.USER));
+
+ IdentityObject io = store.findIdentityObject(ctx, "admin",
IdentityTypeEnum.USER);
+ assertEquals("admin", io.getName());
+ assertEquals("uid=admin,ou=People,o=test,dc=portal,dc=example,dc=com",
io.getId().toString());
+
+ //
+
+ store.removeIdentityObject(ctx, io);
+
+ assertEquals(6, store.getIdentityObjectsCount(ctx, IdentityTypeEnum.USER));
+
+ store.createIdentityObject(ctx, "newUserA", IdentityTypeEnum.USER);
+
+ assertEquals(7, store.getIdentityObjectsCount(ctx, IdentityTypeEnum.USER));
+
+ //
+
+ assertEquals(2, store.getIdentityObjectsCount(ctx, IdentityTypeEnum.GROUP));
+
+ store.createIdentityObject(ctx, "newGroupA", IdentityTypeEnum.GROUP);
+
+ assertEquals(3, store.getIdentityObjectsCount(ctx, IdentityTypeEnum.GROUP));
+
+ //
+
+ io = store.findIdentityObject(ctx,
"cn=newGroupA,ou=Groups,o=test,dc=portal,dc=example,dc=com");
+ assertEquals("newGroupA", io.getName());
+
+ }
+
+ @Test
+ public void testAttributes() throws Exception{
+
+ populate();
+
+ IdentityObject user1 = store.createIdentityObject(ctx, "Adam",
IdentityTypeEnum.USER);
+ IdentityObject user2 = store.createIdentityObject(ctx, "Eva",
IdentityTypeEnum.USER);
+
+ //
+
+ IdentityObjectAttribute[] attrs = new IdentityObjectAttribute[]{
+ new SimpleAttribute("phone", new String[]{"val1",
"val2", "val3"}),
+ new SimpleAttribute("description", new String[]{"val1",
"val2", "val3", "val4"}),
+
+ };
+
+ store.addAttributes(ctx, user1, attrs);
+
+ //
+
+ Map<String, IdentityObjectAttribute> persistedAttrs =
store.getAttributes(ctx, user1);
+
+ assertEquals(2, persistedAttrs.keySet().size());
+
+ assertTrue(persistedAttrs.containsKey("phone"));
+ assertEquals(3, persistedAttrs.get("phone").getSize());
+
+ assertTrue(persistedAttrs.containsKey("description"));
+ assertEquals(4, persistedAttrs.get("description").getSize());
+
+ //
+
+ attrs = new IdentityObjectAttribute[]{
+ new SimpleAttribute("carLicense", new String[]{"val1"})
+ };
+
+ store.addAttributes(ctx, user1, attrs);
+
+ //
+
+ persistedAttrs = store.getAttributes(ctx, user1);
+
+ assertEquals(3, persistedAttrs.keySet().size());
+
+ assertTrue(persistedAttrs.containsKey("phone"));
+ assertEquals(3, persistedAttrs.get("phone").getSize());
+
+ assertTrue(persistedAttrs.containsKey("description"));
+ assertEquals(4, persistedAttrs.get("description").getSize());
+
+ assertTrue(persistedAttrs.containsKey("carLicense"));
+ assertEquals(1, persistedAttrs.get("carLicense").getSize());
+
+ attrs = new IdentityObjectAttribute[]{
+ new SimpleAttribute("carLicense", new String[]{"val2"})
+ };
+
+ store.addAttributes(ctx, user1, attrs);
+
+ //
+
+ persistedAttrs = store.getAttributes(ctx, user1);
+
+ assertEquals(3, persistedAttrs.keySet().size());
+
+ assertTrue(persistedAttrs.containsKey("carLicense"));
+ assertEquals(2, persistedAttrs.get("carLicense").getSize());
+
+ //
+
+ store.updateAttributes(ctx, user1, attrs);
+
+ //
+
+ persistedAttrs = store.getAttributes(ctx, user1);
+
+ assertEquals(3, persistedAttrs.keySet().size());
+
+ assertTrue(persistedAttrs.containsKey("carLicense"));
+ assertEquals(1, persistedAttrs.get("carLicense").getSize());
+
+ //
+
+ String[] names = new String[]{"carLicense"};
+ store.removeAttributes(ctx, user1, names);
+
+ //
+
+ persistedAttrs = store.getAttributes(ctx, user1);
+
+ assertEquals(2, persistedAttrs.keySet().size());
+
+ }
+
+ @Test
+ public void testRelationships() throws Exception
+ {
+ populateClean();
+
+ commonTest.testRelationships();
+
+ }
+
+ @Test
+ public void testStorePersistence() throws Exception
+ {
+ populateClean();
+
+ commonTest.testStorePersistence();
+
+ }
+
+ @Test
+ public void testFindMethods() throws Exception
+ {
+ populateClean();
+
+ commonTest.testFindMethods();
+
+ }
+
+ @Test
+ public void testCriteria() throws Exception
+ {
+ populateClean();
+
+ commonTest.testCriteria();
+ }
+
+
+ @Test
+ public void testCredentials() throws Exception
+ {
+ populateClean();
+
+ commonTest.testPasswordCredential();
+ }
+
+}
Copied: idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/test (from rev 482,
idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/test)
Copied: idm/trunk/idm-testsuite/src/test/resources/datasources (from rev 482,
idm/trunk/idm-core/src/test/resources/datasources)
Copied:
idm/trunk/idm-testsuite/src/test/resources/hibernate-jboss-identity-classes.cfg.xml (from
rev 482, idm/trunk/idm-core/src/test/resources/hibernate-jboss-identity-classes.cfg.xml)
===================================================================
--- idm/trunk/idm-testsuite/src/test/resources/hibernate-jboss-identity-classes.cfg.xml
(rev 0)
+++
idm/trunk/idm-testsuite/src/test/resources/hibernate-jboss-identity-classes.cfg.xml 2009-05-09
11:10:49 UTC (rev 485)
@@ -0,0 +1,60 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+<hibernate-configuration>
+ <session-factory>
+
+ <property name="show_sql">false</property>
+ <property
name="cache.use_second_level_cache">true</property>
+ <property name="cache.use_query_cache">false</property>
+
+ <property
name="current_session_context_class">thread</property>
+
+ <!--<property
name="connection.datasource"></property>-->
+
+ <property
name="hibernate.connection.url">jdbc:hsqldb:mem:unit-testing-jpa1</property>
+ <property
name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
+ <property
name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
+ <property
name="hibernate.hbm2ddl.auto">create-drop</property>
+ <property
name="hibernate.connection.username">sa</property>
+ <property name="hibernate.connection.password"></property>
+
+ <!-- Mapping classes -->
+
+ <mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateRealm"/>
+ <mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject"/>
+ <mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential"/>
+ <mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType"/>
+ <mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute"/>
+ <mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute"/>
+ <mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute"/>
+ <mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType"/>
+ <mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship"/>
+ <mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType"/>
+ <mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName"/>
+ </session-factory>
+</hibernate-configuration>
\ No newline at end of file
Copied: idm/trunk/idm-testsuite/src/test/resources/hibernate-jboss-identity.cfg.xml (from
rev 482, idm/trunk/idm-core/src/test/resources/hibernate-jboss-identity.cfg.xml)
===================================================================
--- idm/trunk/idm-testsuite/src/test/resources/hibernate-jboss-identity.cfg.xml
(rev 0)
+++ idm/trunk/idm-testsuite/src/test/resources/hibernate-jboss-identity.cfg.xml 2009-05-09
11:10:49 UTC (rev 485)
@@ -0,0 +1,61 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+<hibernate-configuration>
+ <session-factory>
+
+ <property name="show_sql">false</property>
+ <property
name="cache.use_second_level_cache">true</property>
+ <property name="cache.use_query_cache">false</property>
+
+ <property
name="current_session_context_class">thread</property>
+
+ <!--<property
name="connection.datasource"></property>-->
+
+ <property
name="hibernate.connection.url">jdbc:hsqldb:mem:unit-testing-jpa1</property>
+ <property
name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
+ <property
name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
+ <property
name="hibernate.hbm2ddl.auto">create-drop</property>
+ <property
name="hibernate.connection.username">sa</property>
+ <property name="hibernate.connection.password"></property>
+
+ <!-- Mapping classes -->
+ <!-- all nessesary mappings are added programatically to the configuration
-->
+ <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateRealm"/>-->
+ <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject"/>-->
+ <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential"/>-->
+ <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType"/>-->
+ <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute"/>-->
+ <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute"/>-->
+ <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute"/>-->
+ <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType"/>-->
+ <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship"/>-->
+ <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType"/>-->
+ <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName"/>-->
+
+ </session-factory>
+</hibernate-configuration>
\ No newline at end of file
Copied: idm/trunk/idm-testsuite/src/test/resources/identity-config.xsd (from rev 482,
idm/trunk/idm-core/src/test/resources/identity-config.xsd)
===================================================================
--- idm/trunk/idm-testsuite/src/test/resources/identity-config.xsd
(rev 0)
+++ idm/trunk/idm-testsuite/src/test/resources/identity-config.xsd 2009-05-09 11:10:49 UTC
(rev 485)
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema attributeFormDefault="unqualified"
elementFormDefault="qualified"
targetNamespace="urn:jboss:identity:idm:config:v1_0_alpha"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:element name="jboss-identity" type="urn:jboss-identityType"
xmlns:urn="urn:jboss:identity:idm:config:v1_0_alpha">
+ <xs:annotation>
+
<
xs:documentation><xs:schemaattributeFormDefault="unqualifi...
+ </xs:annotation>
+ </xs:element>
+ <xs:complexType name="identity-object-typesType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="identity-object-type"
maxOccurs="unbounded" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="repositoryType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="id"/>
+ <xs:element type="xs:string" name="class"/>
+ <xs:element type="urn:external-configType"
name="external-config" minOccurs="0"
xmlns:urn="urn:jboss:identity:idm:config:v1_0_alpha"/>
+ <xs:element type="xs:string"
name="default-identity-store-id" minOccurs="0"/>
+ <xs:element type="xs:string"
name="default-attribute-store-id" minOccurs="0"/>
+ <xs:element type="urn:identity-store-mappingsType"
name="identity-store-mappings" minOccurs="0"
xmlns:urn="urn:jboss:identity:idm:config:v1_0_alpha"/>
+ <xs:element type="urn:optionsType" name="options"
minOccurs="0"
xmlns:urn="urn:jboss:identity:idm:config:v1_0_alpha"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="identity-storeType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="id"/>
+ <xs:element type="xs:string" name="class"/>
+ <xs:element type="urn:external-configType"
name="external-config"
xmlns:urn="urn:jboss:identity:idm:config:v1_0_alpha"/>
+ <xs:element type="urn:supported-relationship-typesType"
name="supported-relationship-types"
xmlns:urn="urn:jboss:identity:idm:config:v1_0_alpha"/>
+ <xs:element type="urn:supported-identity-object-typesType"
name="supported-identity-object-types"
xmlns:urn="urn:jboss:identity:idm:config:v1_0_alpha"/>
+ <xs:element name="options">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element type="urn:optionType" name="option"
maxOccurs="unbounded" minOccurs="0"
xmlns:urn="urn:jboss:identity:idm:config:v1_0_alpha"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="external-configType">
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute type="xs:string" name="override"
use="optional"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ <xs:complexType name="identity-store-mappingsType">
+ <xs:sequence>
+ <xs:element type="urn:identity-store-mappingType"
name="identity-store-mapping" maxOccurs="unbounded"
minOccurs="0"
xmlns:urn="urn:jboss:identity:idm:config:v1_0_alpha"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="storesType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="attribute-stores"/>
+ <xs:element type="urn:identity-storesType"
name="identity-stores"
xmlns:urn="urn:jboss:identity:idm:config:v1_0_alpha"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="jboss-identityType">
+ <xs:sequence>
+ <xs:element type="urn:realmsType" name="realms"
xmlns:urn="urn:jboss:identity:idm:config:v1_0_alpha"/>
+ <xs:element type="urn:repositoriesType" name="repositories"
xmlns:urn="urn:jboss:identity:idm:config:v1_0_alpha"/>
+ <xs:element type="urn:storesType" name="stores"
xmlns:urn="urn:jboss:identity:idm:config:v1_0_alpha"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="supported-identity-object-typesType">
+ <xs:sequence>
+ <xs:element type="urn:identity-object-typeType"
name="identity-object-type" maxOccurs="unbounded"
minOccurs="0"
xmlns:urn="urn:jboss:identity:idm:config:v1_0_alpha"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="optionType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="name"/>
+ <xs:element type="xs:string" name="value"
maxOccurs="unbounded" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="group-type-mappingType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="group-type-name"/>
+ <xs:element type="xs:string"
name="identity-object-type-name"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="credentialsType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="credential-type"
maxOccurs="unbounded" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="repositoriesType">
+ <xs:sequence>
+ <xs:element type="urn:repositoryType" name="repository"
maxOccurs="unbounded" minOccurs="0"
xmlns:urn="urn:jboss:identity:idm:config:v1_0_alpha"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="realmType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="id"/>
+ <xs:element type="xs:string" name="repository-id-ref"/>
+ <xs:element type="urn:identity-type-mappingsType"
name="identity-type-mappings" minOccurs="0"
xmlns:urn="urn:jboss:identity:idm:config:v1_0_alpha"/>
+ <xs:element type="urn:optionsType" name="options"
minOccurs="0"
xmlns:urn="urn:jboss:identity:idm:config:v1_0_alpha"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="relationshipsType">
+ <xs:sequence>
+ <xs:element type="urn:relationshipType" name="relationship"
maxOccurs="unbounded" minOccurs="0"
xmlns:urn="urn:jboss:identity:idm:config:v1_0_alpha"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="realmsType">
+ <xs:sequence>
+ <xs:element type="urn:realmType" name="realm"
maxOccurs="unbounded" minOccurs="0"
xmlns:urn="urn:jboss:identity:idm:config:v1_0_alpha"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="identity-type-mappingsType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="user-mapping"/>
+ <xs:element type="urn:group-type-mappingType"
name="group-type-mapping" maxOccurs="unbounded"
minOccurs="0"
xmlns:urn="urn:jboss:identity:idm:config:v1_0_alpha"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="supported-relationship-typesType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="relationship-type"
maxOccurs="unbounded" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="identity-storesType">
+ <xs:sequence>
+ <xs:element type="urn:identity-storeType"
name="identity-store" maxOccurs="unbounded" minOccurs="0"
xmlns:urn="urn:jboss:identity:idm:config:v1_0_alpha"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="attributesType">
+ <xs:sequence>
+ <xs:element type="urn:attributeType" name="attribute"
maxOccurs="unbounded" minOccurs="0"
xmlns:urn="urn:jboss:identity:idm:config:v1_0_alpha"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="identity-store-mappingType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="identity-store-id"/>
+ <xs:element type="urn:identity-object-typesType"
name="identity-object-types"
xmlns:urn="urn:jboss:identity:idm:config:v1_0_alpha"/>
+ <xs:element type="urn:optionsType" name="options"
xmlns:urn="urn:jboss:identity:idm:config:v1_0_alpha"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="relationshipType">
+ <xs:sequence>
+ <xs:element type="xs:string"
name="relationship-type-ref"/>
+ <xs:element type="xs:string"
name="identity-object-type-ref"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="optionsType">
+ <xs:sequence>
+ <xs:element type="urn:optionType" name="option"
maxOccurs="unbounded" minOccurs="0"
xmlns:urn="urn:jboss:identity:idm:config:v1_0_alpha"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="identity-object-typeType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="name"/>
+ <xs:element name="relationships">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element type="urn:relationshipType"
name="relationship" maxOccurs="unbounded" minOccurs="0"
xmlns:urn="urn:jboss:identity:idm:config:v1_0_alpha"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="credentials">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element type="xs:string" name="credential-type"
maxOccurs="unbounded" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="attributes">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element type="urn:attributeType" name="attribute"
maxOccurs="unbounded" minOccurs="0"
xmlns:urn="urn:jboss:identity:idm:config:v1_0_alpha"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="options">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element type="urn:optionType" name="option"
maxOccurs="unbounded" minOccurs="0"
xmlns:urn="urn:jboss:identity:idm:config:v1_0_alpha"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="attributeType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="name"/>
+ <xs:element type="xs:string" name="mapping"/>
+ <xs:element type="xs:string" name="type"/>
+ <xs:element name="isRequired">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value=""/>
+ <xs:enumeration value="true"/>
+ <xs:enumeration value="false"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="isMultivalued">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value=""/>
+ <xs:enumeration value="true"/>
+ <xs:enumeration value="false"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element type="xs:string" name="isReadOnly"
minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
\ No newline at end of file
Copied: idm/trunk/idm-testsuite/src/test/resources/ldap (from rev 482,
idm/trunk/idm-core/src/test/resources/ldap)
Copied: idm/trunk/idm-testsuite/src/test/resources/log4j.xml (from rev 482,
idm/trunk/idm-core/src/test/resources/log4j.xml)
===================================================================
--- idm/trunk/idm-testsuite/src/test/resources/log4j.xml (rev 0)
+++ idm/trunk/idm-testsuite/src/test/resources/log4j.xml 2009-05-09 11:10:49 UTC (rev
485)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration
xmlns:log4j="http://jakarta.apache.org/log4j/"
debug="false">
+ <appender name="CONSOLE"
class="org.apache.log4j.ConsoleAppender">
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern"
+ value="[%d{dd/MM/yy hh:mm:ss:sss z}] %5p %c{2}:
%m%n" />
+ </layout>
+ </appender>
+
+ <appender name="ASYNC"
class="org.apache.log4j.AsyncAppender">
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </appender>
+
+ <appender name="FILE"
class="org.apache.log4j.RollingFileAppender">
+ <param name="File" value="log4j-output.log"/>
+ <param name="MaxFileSize" value="1MB"/>
+ <param name="MaxBackupIndex" value="100"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern"
+ value="[%d{dd/MM/yy hh:mm:ss:sss z}] %5p %c{2}:
%m%n" />
+ </layout>
+ </appender>
+
+ <root>
+ <priority value="info"/>
+ <appender-ref ref="CONSOLE"/>
+ <!--<appender-ref ref="ASYNC"/>-->
+ </root>
+</log4j:configuration>
\ No newline at end of file
Copied: idm/trunk/idm-testsuite/src/test/resources/opends (from rev 482,
idm/trunk/idm-core/src/test/resources/opends)
Copied: idm/trunk/idm-testsuite/src/test/resources/organization-test-config.xml (from rev
482, idm/trunk/idm-core/src/test/resources/organization-test-config.xml)
===================================================================
--- idm/trunk/idm-testsuite/src/test/resources/organization-test-config.xml
(rev 0)
+++ idm/trunk/idm-testsuite/src/test/resources/organization-test-config.xml 2009-05-09
11:10:49 UTC (rev 485)
@@ -0,0 +1,792 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jboss-identity xmlns="urn:jboss:identity:idm:config:v1_0_alpha"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:identity:idm:config:v1_0_alpha
identity-config.xsd">
+ <realms>
+ <realm>
+ <id>realm://RedHat/DB</id>
+ <repository-id-ref>RedHat Repository DB</repository-id-ref>
+ <identity-type-mappings>
+ <user-mapping>USER</user-mapping>
+ </identity-type-mappings>
+ </realm>
+ <realm>
+ <id>realm://portal/SamplePortal/DB</id>
+ <repository-id-ref>Sample Portal Repository
DB</repository-id-ref>
+ <identity-type-mappings>
+ <user-mapping>USER</user-mapping>
+ </identity-type-mappings>
+ </realm>
+ <realm>
+ <id>realm://RedHat/DB_LDAP</id>
+ <repository-id-ref>RedHat Repository DB+LDAP</repository-id-ref>
+ <identity-type-mappings>
+ <user-mapping>USER</user-mapping>
+ </identity-type-mappings>
+ </realm>
+ <realm>
+ <id>realm://portal/SamplePortal/DB_LDAP</id>
+ <repository-id-ref>Sample Portal Repository
DB+LDAP</repository-id-ref>
+ <identity-type-mappings>
+ <user-mapping>USER</user-mapping>
+ </identity-type-mappings>
+ </realm>
+ </realms>
+ <repositories>
+ <repository>
+ <id>RedHat Repository DB</id>
+
<class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
+ <external-config/>
+ <default-identity-store-id>Hibernate Identity
Store</default-identity-store-id>
+ <default-attribute-store-id>Hibernate Identity
Store</default-attribute-store-id>
+ <options>
+ <option>
+ <name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ </options>
+ </repository>
+ <repository>
+ <id>Sample Portal Repository DB</id>
+
<class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
+ <external-config/>
+ <default-identity-store-id>Hibernate Identity
Store</default-identity-store-id>
+ <default-attribute-store-id>Hibernate Identity
Store</default-attribute-store-id>
+ <options>
+ <option>
+ <name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ </options>
+ </repository>
+ <repository>
+ <id>RedHat Repository DB+LDAP</id>
+
<class>org.jboss.identity.idm.impl.repository.FallbackIdentityStoreRepository</class>
+ <external-config/>
+ <default-identity-store-id>Hibernate Identity
Store</default-identity-store-id>
+ <default-attribute-store-id>Hibernate Identity
Store</default-attribute-store-id>
+ <identity-store-mappings>
+ <identity-store-mapping>
+ <identity-store-id>Hibernate Identity
Store</identity-store-id>
+ <identity-object-types>
+
<identity-object-type>DIVISION</identity-object-type>
+ <identity-object-type>PROJECT</identity-object-type>
+ <identity-object-type>PEOPLE</identity-object-type>
+ </identity-object-types>
+ <options/>
+ </identity-store-mapping>
+ <identity-store-mapping>
+ <identity-store-id>LDAP Identity
Store</identity-store-id>
+ <identity-object-types>
+ <identity-object-type>USER</identity-object-type>
+
<identity-object-type>ORGANIZATION</identity-object-type>
+
<identity-object-type>ORGANIZATION_UNIT</identity-object-type>
+
<identity-object-type>DEPARTMENT</identity-object-type>
+ </identity-object-types>
+ <options>
+ <option>
+ <name>cache</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>cache.config-file</name>
+
<value>src/test/resources/jboss-cache-config.xml</value>
+ </option>
+ </options>
+ </identity-store-mapping>
+ </identity-store-mappings>
+ <options>
+ <option>
+ <name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ </options>
+ </repository>
+ <repository>
+ <id>Sample Portal Repository DB+LDAP</id>
+
<class>org.jboss.identity.idm.impl.repository.FallbackIdentityStoreRepository</class>
+ <external-config/>
+ <default-identity-store-id>Hibernate Identity
Store</default-identity-store-id>
+ <default-attribute-store-id>Hibernate Identity
Store</default-attribute-store-id>
+ <identity-store-mappings>
+ <identity-store-mapping>
+ <identity-store-id>Hibernate Identity
Store</identity-store-id>
+ <identity-object-types>
+ <identity-object-type>SYSTEM</identity-object-type>
+
<identity-object-type>ADMINISTRATION</identity-object-type>
+
<identity-object-type>COMMUNITY</identity-object-type>
+
<identity-object-type>DIVISION</identity-object-type>
+
<identity-object-type>SECURITY</identity-object-type>
+ <identity-object-type>PEOPLE</identity-object-type>
+ </identity-object-types>
+ <options/>
+ </identity-store-mapping>
+ <identity-store-mapping>
+ <identity-store-id>LDAP Identity
Store</identity-store-id>
+ <identity-object-types>
+ <identity-object-type>USER</identity-object-type>
+
<identity-object-type>DEPARTMENT</identity-object-type>
+
<identity-object-type>ORGANIZATION</identity-object-type>
+
<identity-object-type>ORGANIZATION_UNIT</identity-object-type>
+ <identity-object-type>OFFICE</identity-object-type>
+ </identity-object-types>
+ <options>
+ <option>
+ <name>cache</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>cache.config-file</name>
+
<value>src/test/resources/jboss-cache-config.xml</value>
+ </option>
+ </options>
+ </identity-store-mapping>
+ </identity-store-mappings>
+ <options>
+ <option>
+ <name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ </options>
+ </repository>
+ </repositories>
+ <stores>
+ <attribute-stores/>
+ <identity-stores>
+ <identity-store>
+ <id>Hibernate Identity Store</id>
+
<class>org.jboss.identity.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
+ <external-config/>
+ <supported-relationship-types>
+
<relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
+
<relationship-type>JBOSS_IDENTITY_ROLE</relationship-type>
+ </supported-relationship-types>
+ <supported-identity-object-types>
+ <identity-object-type>
+ <name>USER</name>
+ <relationships>
+ <!--<relationship>-->
+
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
+
<!--<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>-->
+ <!--</relationship>-->
+ <!--<relationship>-->
+
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
+
<!--<identity-object-type-ref>COMMUNITY</identity-object-type-ref>-->
+ <!--</relationship>-->
+ <!--<relationship>-->
+
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
+
<!--<identity-object-type-ref>OFFICE</identity-object-type-ref>-->
+ <!--</relationship>-->
+ <!--<relationship>-->
+
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
+
<!--<identity-object-type-ref>SECURITY</identity-object-type-ref>-->
+ <!--</relationship>-->
+ <!--<relationship>-->
+
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
+
<!--<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>-->
+ <!--</relationship>-->
+ <!--<relationship>-->
+
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
+
<!--<identity-object-type-ref>PROJECT</identity-object-type-ref>-->
+ <!--</relationship>-->
+ <!--<relationship>-->
+
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
+
<!--<identity-object-type-ref>PEOPLE</identity-object-type-ref>-->
+ <!--</relationship>-->
+ </relationships>
+ <credentials>
+ <credential-type>PASSWORD</credential-type>
+ </credentials>
+ <attributes>
+ <attribute>
+ <name>picture</name>
+ <mapping>user.picture</mapping>
+ <type>binary</type>
+ <isRequired>false</isRequired>
+ <isMultivalued>false</isMultivalued>
+ <isReadOnly>false</isReadOnly>
+ </attribute>
+ </attributes>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>ORGANIZATION</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>DIVISION</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>ORGANIZATION_UNIT</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>DIVISION</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>OFFICE</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>PEOPLE</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>PROJECT</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>DIVISION</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>DEPARTMENT</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>PROJECT</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>PEOPLE</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>ADMINISTRATION</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>COMMUNITY</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>OFFICE</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>SECURITY</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>SYSTEM</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>SECURITY</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>COMMUNITY</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ </supported-identity-object-types>
+ <options>
+ <option>
+ <name>hibernateConfiguration</name>
+ <value>hibernate-jboss-identity.cfg.xml</value>
+ </option>
+ <!--<option>-->
+
<!--<name>hibernateSessionFactoryJNDIName</name>-->
+
<!--<value>java:/jbossidentity/HibernateStoreSessionFactory</value>-->
+ <!--</option>-->
+ <option>
+ <name>populateRelationshipTypes</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>populateIdentityObjectTypes</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>isRealmAware</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ </options>
+ </identity-store>
+ <identity-store>
+ <id>LDAP Identity Store</id>
+
<class>org.jboss.identity.idm.impl.store.ldap.LDAPIdentityStoreImpl</class>
+ <external-config/>
+ <supported-relationship-types>
+
<relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
+ </supported-relationship-types>
+ <supported-identity-object-types>
+ <identity-object-type>
+ <name>USER</name>
+ <relationships/>
+ <credentials>
+ <credential-type>PASSWORD</credential-type>
+ </credentials>
+ <attributes>
+ <attribute>
+ <name>phone</name>
+ <mapping>telephoneNumber</mapping>
+ <type>text</type>
+ <isRequired>false</isRequired>
+ <isMultivalued>false</isMultivalued>
+ <isReadOnly>false</isReadOnly>
+ </attribute>
+ <attribute>
+ <name>description</name>
+ <mapping>description</mapping>
+ <type>text</type>
+ <isRequired>false</isRequired>
+ <isMultivalued>false</isMultivalued>
+ <isReadOnly>false</isReadOnly>
+ </attribute>
+ <attribute>
+ <name>carLicense</name>
+ <mapping>carLicense</mapping>
+ <type>text</type>
+ <isRequired>false</isRequired>
+ <isMultivalued>false</isMultivalued>
+ <isReadOnly>false</isReadOnly>
+ </attribute>
+ </attributes>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>uid</value>
+ </option>
+ <option>
+ <name>passwordAttributeName</name>
+ <value>userPassword</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+
<value>ou=People,o=test,dc=portal,dc=example,dc=com</value>
+ </option>
+ <option>
+ <name>allowCreateEntry</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>createEntryAttributeValues</name>
+ <value>objectClass=top</value>
+ <value>objectClass=inetOrgPerson</value>
+ <value>sn= </value>
+ <value>cn= </value>
+ </option>
+ </options>
+ </identity-object-type>
+ <identity-object-type>
+ <name>ORGANIZATION</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>OFFICE</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+
<value>ou=Organizations,o=test,dc=portal,dc=example,dc=com</value>
+ </option>
+ <!--<option>-->
+ <!--<name>entrySearchFilter</name>-->
+ <!--<value></value>-->
+ <!--</option>-->
+ <option>
+ <name>allowCreateEntry</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>membershipAttributeName</name>
+ <value>member</value>
+ </option>
+ <option>
+ <name>isMembershipAttributeDN</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowEmptyMemberships</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>createEntryAttributeValues</name>
+ <value>objectClass=top</value>
+ <value>objectClass=groupOfNames</value>
+ </option>
+ </options>
+ </identity-object-type>
+ <identity-object-type>
+ <name>ORGANIZATION_UNIT</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>OFFICE</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+
<value>ou=OrganizationUnits,o=test,dc=portal,dc=example,dc=com</value>
+ </option>
+ <!--<option>-->
+ <!--<name>entrySearchFilter</name>-->
+ <!--<value></value>-->
+ <!--</option>-->
+ <option>
+ <name>allowCreateEntry</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>membershipAttributeName</name>
+ <value>member</value>
+ </option>
+ <option>
+ <name>isMembershipAttributeDN</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowEmptyMemberships</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>createEntryAttributeValues</name>
+ <value>objectClass=top</value>
+ <value>objectClass=groupOfNames</value>
+ </option>
+ </options>
+ </identity-object-type>
+ <identity-object-type>
+ <name>DEPARTMENT</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+
<value>ou=Departments,o=test,dc=portal,dc=example,dc=com</value>
+ </option>
+ <!--<option>-->
+ <!--<name>entrySearchFilter</name>-->
+ <!--<value></value>-->
+ <!--</option>-->
+ <option>
+ <name>allowCreateEntry</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>membershipAttributeName</name>
+ <value>member</value>
+ </option>
+ <option>
+ <name>isMembershipAttributeDN</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowEmptyMemberships</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>createEntryAttributeValues</name>
+ <value>objectClass=top</value>
+ <value>objectClass=groupOfNames</value>
+ </option>
+ </options>
+ </identity-object-type>
+ <identity-object-type>
+ <name>OFFICE</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+
<value>ou=Offices,o=test,dc=portal,dc=example,dc=com</value>
+ </option>
+ <!--<option>-->
+ <!--<name>entrySearchFilter</name>-->
+ <!--<value></value>-->
+ <!--</option>-->
+ <option>
+ <name>allowCreateEntry</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>membershipAttributeName</name>
+ <value>member</value>
+ </option>
+ <option>
+ <name>isMembershipAttributeDN</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowEmptyMemberships</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>createEntryAttributeValues</name>
+ <value>objectClass=top</value>
+ <value>objectClass=groupOfNames</value>
+ </option>
+ </options>
+ </identity-object-type>
+ </supported-identity-object-types>
+ <options>
+ <option>
+ <name>providerURL</name>
+ <value>ldap://localhost:10389</value>
+ </option>
+ <option>
+ <name>adminDN</name>
+ <value>cn=Directory Manager</value>
+ </option>
+ <option>
+ <name>adminPassword</name>
+ <value>password</value>
+ </option>
+ <option>
+ <name>searchTimeLimit</name>
+ <value>10000</value>
+ </option>
+ </options>
+ </identity-store>
+ </identity-stores>
+ </stores>
+</jboss-identity>
\ No newline at end of file
Copied: idm/trunk/idm-testsuite/src/test/resources/organization-test-jboss-unit-config.xml
(from rev 482,
idm/trunk/idm-core/src/test/resources/organization-test-jboss-unit-config.xml)
===================================================================
--- idm/trunk/idm-testsuite/src/test/resources/organization-test-jboss-unit-config.xml
(rev 0)
+++
idm/trunk/idm-testsuite/src/test/resources/organization-test-jboss-unit-config.xml 2009-05-09
11:10:49 UTC (rev 485)
@@ -0,0 +1,792 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jboss-identity xmlns="urn:jboss:identity:idm:config:v1_0_alpha"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:identity:idm:config:v1_0_alpha
identity-config.xsd">
+ <realms>
+ <realm>
+ <id>realm://RedHat/DB</id>
+ <repository-id-ref>RedHat Repository DB</repository-id-ref>
+ <identity-type-mappings>
+ <user-mapping>USER</user-mapping>
+ </identity-type-mappings>
+ </realm>
+ <realm>
+ <id>realm://portal/SamplePortal/DB</id>
+ <repository-id-ref>Sample Portal Repository
DB</repository-id-ref>
+ <identity-type-mappings>
+ <user-mapping>USER</user-mapping>
+ </identity-type-mappings>
+ </realm>
+ <realm>
+ <id>realm://RedHat/DB_LDAP</id>
+ <repository-id-ref>RedHat Repository DB+LDAP</repository-id-ref>
+ <identity-type-mappings>
+ <user-mapping>USER</user-mapping>
+ </identity-type-mappings>
+ </realm>
+ <realm>
+ <id>realm://portal/SamplePortal/DB_LDAP</id>
+ <repository-id-ref>Sample Portal Repository
DB+LDAP</repository-id-ref>
+ <identity-type-mappings>
+ <user-mapping>USER</user-mapping>
+ </identity-type-mappings>
+ </realm>
+ </realms>
+ <repositories>
+ <repository>
+ <id>RedHat Repository DB</id>
+
<class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
+ <external-config/>
+ <default-identity-store-id>Hibernate Identity
Store</default-identity-store-id>
+ <default-attribute-store-id>Hibernate Identity
Store</default-attribute-store-id>
+ <options>
+ <option>
+ <name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ </options>
+ </repository>
+ <repository>
+ <id>Sample Portal Repository DB</id>
+
<class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
+ <external-config/>
+ <default-identity-store-id>Hibernate Identity
Store</default-identity-store-id>
+ <default-attribute-store-id>Hibernate Identity
Store</default-attribute-store-id>
+ <options>
+ <option>
+ <name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ </options>
+ </repository>
+ <repository>
+ <id>RedHat Repository DB+LDAP</id>
+
<class>org.jboss.identity.idm.impl.repository.FallbackIdentityStoreRepository</class>
+ <external-config/>
+ <default-identity-store-id>Hibernate Identity
Store</default-identity-store-id>
+ <default-attribute-store-id>Hibernate Identity
Store</default-attribute-store-id>
+ <identity-store-mappings>
+ <identity-store-mapping>
+ <identity-store-id>Hibernate Identity
Store</identity-store-id>
+ <identity-object-types>
+
<identity-object-type>DIVISION</identity-object-type>
+ <identity-object-type>PROJECT</identity-object-type>
+ <identity-object-type>PEOPLE</identity-object-type>
+ </identity-object-types>
+ <options/>
+ </identity-store-mapping>
+ <identity-store-mapping>
+ <identity-store-id>LDAP Identity
Store</identity-store-id>
+ <identity-object-types>
+ <identity-object-type>USER</identity-object-type>
+
<identity-object-type>ORGANIZATION</identity-object-type>
+
<identity-object-type>ORGANIZATION_UNIT</identity-object-type>
+
<identity-object-type>DEPARTMENT</identity-object-type>
+ </identity-object-types>
+ <options>
+ <option>
+ <name>cache</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>cache.config-file</name>
+ <value>jboss-cache-config.xml</value>
+ </option>
+ </options>
+ </identity-store-mapping>
+ </identity-store-mappings>
+ <options>
+ <option>
+ <name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ </options>
+ </repository>
+ <repository>
+ <id>Sample Portal Repository DB+LDAP</id>
+
<class>org.jboss.identity.idm.impl.repository.FallbackIdentityStoreRepository</class>
+ <external-config/>
+ <default-identity-store-id>Hibernate Identity
Store</default-identity-store-id>
+ <default-attribute-store-id>Hibernate Identity
Store</default-attribute-store-id>
+ <identity-store-mappings>
+ <identity-store-mapping>
+ <identity-store-id>Hibernate Identity
Store</identity-store-id>
+ <identity-object-types>
+ <identity-object-type>SYSTEM</identity-object-type>
+
<identity-object-type>ADMINISTRATION</identity-object-type>
+
<identity-object-type>COMMUNITY</identity-object-type>
+
<identity-object-type>DIVISION</identity-object-type>
+
<identity-object-type>SECURITY</identity-object-type>
+ <identity-object-type>PEOPLE</identity-object-type>
+ </identity-object-types>
+ <options/>
+ </identity-store-mapping>
+ <identity-store-mapping>
+ <identity-store-id>LDAP Identity
Store</identity-store-id>
+ <identity-object-types>
+ <identity-object-type>USER</identity-object-type>
+
<identity-object-type>DEPARTMENT</identity-object-type>
+
<identity-object-type>ORGANIZATION</identity-object-type>
+
<identity-object-type>ORGANIZATION_UNIT</identity-object-type>
+ <identity-object-type>OFFICE</identity-object-type>
+ </identity-object-types>
+ <options>
+ <option>
+ <name>cache</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>cache.config-file</name>
+ <value>jboss-cache-config.xml</value>
+ </option>
+ </options>
+ </identity-store-mapping>
+ </identity-store-mappings>
+ <options>
+ <option>
+ <name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ </options>
+ </repository>
+ </repositories>
+ <stores>
+ <attribute-stores/>
+ <identity-stores>
+ <identity-store>
+ <id>Hibernate Identity Store</id>
+
<class>org.jboss.identity.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
+ <external-config/>
+ <supported-relationship-types>
+
<relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
+
<relationship-type>JBOSS_IDENTITY_ROLE</relationship-type>
+ </supported-relationship-types>
+ <supported-identity-object-types>
+ <identity-object-type>
+ <name>USER</name>
+ <relationships>
+ <!--<relationship>-->
+
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
+
<!--<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>-->
+ <!--</relationship>-->
+ <!--<relationship>-->
+
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
+
<!--<identity-object-type-ref>COMMUNITY</identity-object-type-ref>-->
+ <!--</relationship>-->
+ <!--<relationship>-->
+
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
+
<!--<identity-object-type-ref>OFFICE</identity-object-type-ref>-->
+ <!--</relationship>-->
+ <!--<relationship>-->
+
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
+
<!--<identity-object-type-ref>SECURITY</identity-object-type-ref>-->
+ <!--</relationship>-->
+ <!--<relationship>-->
+
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
+
<!--<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>-->
+ <!--</relationship>-->
+ <!--<relationship>-->
+
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
+
<!--<identity-object-type-ref>PROJECT</identity-object-type-ref>-->
+ <!--</relationship>-->
+ <!--<relationship>-->
+
<!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
+
<!--<identity-object-type-ref>PEOPLE</identity-object-type-ref>-->
+ <!--</relationship>-->
+ </relationships>
+ <credentials>
+ <credential-type>PASSWORD</credential-type>
+ </credentials>
+ <attributes>
+ <attribute>
+ <name>picture</name>
+ <mapping>user.picture</mapping>
+ <type>binary</type>
+ <isRequired>false</isRequired>
+ <isMultivalued>false</isMultivalued>
+ <isReadOnly>false</isReadOnly>
+ </attribute>
+ </attributes>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>ORGANIZATION</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>DIVISION</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>ORGANIZATION_UNIT</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>DIVISION</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>OFFICE</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>PEOPLE</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>PROJECT</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>DIVISION</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>DEPARTMENT</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>PROJECT</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>PEOPLE</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>ADMINISTRATION</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>COMMUNITY</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>OFFICE</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>SECURITY</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>SYSTEM</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>SECURITY</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>COMMUNITY</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ </supported-identity-object-types>
+ <options>
+ <!--<option>-->
+ <!--<name>hibernateConfiguration</name>-->
+
<!--<value>hibernate-jboss-identity.cfg.xml</value>-->
+ <!--</option>-->
+ <option>
+ <name>hibernateSessionFactoryJNDIName</name>
+
<value>java:/jbossidentity/HibernateStoreSessionFactory</value>
+ </option>
+ <option>
+ <name>populateRelationshipTypes</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>populateIdentityObjectTypes</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>isRealmAware</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ </options>
+ </identity-store>
+ <identity-store>
+ <id>LDAP Identity Store</id>
+
<class>org.jboss.identity.idm.impl.store.ldap.LDAPIdentityStoreImpl</class>
+ <external-config/>
+ <supported-relationship-types>
+
<relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
+ </supported-relationship-types>
+ <supported-identity-object-types>
+ <identity-object-type>
+ <name>USER</name>
+ <relationships/>
+ <credentials>
+ <credential-type>PASSWORD</credential-type>
+ </credentials>
+ <attributes>
+ <attribute>
+ <name>phone</name>
+ <mapping>telephoneNumber</mapping>
+ <type>text</type>
+ <isRequired>false</isRequired>
+ <isMultivalued>false</isMultivalued>
+ <isReadOnly>false</isReadOnly>
+ </attribute>
+ <attribute>
+ <name>description</name>
+ <mapping>description</mapping>
+ <type>text</type>
+ <isRequired>false</isRequired>
+ <isMultivalued>false</isMultivalued>
+ <isReadOnly>false</isReadOnly>
+ </attribute>
+ <attribute>
+ <name>carLicense</name>
+ <mapping>carLicense</mapping>
+ <type>text</type>
+ <isRequired>false</isRequired>
+ <isMultivalued>false</isMultivalued>
+ <isReadOnly>false</isReadOnly>
+ </attribute>
+ </attributes>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>uid</value>
+ </option>
+ <option>
+ <name>passwordAttributeName</name>
+ <value>userPassword</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+
<value>ou=People,o=test,dc=portal,dc=example,dc=com</value>
+ </option>
+ <option>
+ <name>allowCreateEntry</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>createEntryAttributeValues</name>
+ <value>objectClass=top</value>
+ <value>objectClass=inetOrgPerson</value>
+ <value>sn= </value>
+ <value>cn= </value>
+ </option>
+ </options>
+ </identity-object-type>
+ <identity-object-type>
+ <name>ORGANIZATION</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>OFFICE</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+
<value>ou=Organizations,o=test,dc=portal,dc=example,dc=com</value>
+ </option>
+ <!--<option>-->
+ <!--<name>entrySearchFilter</name>-->
+ <!--<value></value>-->
+ <!--</option>-->
+ <option>
+ <name>allowCreateEntry</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>membershipAttributeName</name>
+ <value>member</value>
+ </option>
+ <option>
+ <name>isMembershipAttributeDN</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowEmptyMemberships</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>createEntryAttributeValues</name>
+ <value>objectClass=top</value>
+ <value>objectClass=groupOfNames</value>
+ </option>
+ </options>
+ </identity-object-type>
+ <identity-object-type>
+ <name>ORGANIZATION_UNIT</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>OFFICE</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+
<value>ou=OrganizationUnits,o=test,dc=portal,dc=example,dc=com</value>
+ </option>
+ <!--<option>-->
+ <!--<name>entrySearchFilter</name>-->
+ <!--<value></value>-->
+ <!--</option>-->
+ <option>
+ <name>allowCreateEntry</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>membershipAttributeName</name>
+ <value>member</value>
+ </option>
+ <option>
+ <name>isMembershipAttributeDN</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowEmptyMemberships</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>createEntryAttributeValues</name>
+ <value>objectClass=top</value>
+ <value>objectClass=groupOfNames</value>
+ </option>
+ </options>
+ </identity-object-type>
+ <identity-object-type>
+ <name>DEPARTMENT</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+
<value>ou=Departments,o=test,dc=portal,dc=example,dc=com</value>
+ </option>
+ <!--<option>-->
+ <!--<name>entrySearchFilter</name>-->
+ <!--<value></value>-->
+ <!--</option>-->
+ <option>
+ <name>allowCreateEntry</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>membershipAttributeName</name>
+ <value>member</value>
+ </option>
+ <option>
+ <name>isMembershipAttributeDN</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowEmptyMemberships</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>createEntryAttributeValues</name>
+ <value>objectClass=top</value>
+ <value>objectClass=groupOfNames</value>
+ </option>
+ </options>
+ </identity-object-type>
+ <identity-object-type>
+ <name>OFFICE</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+
<value>ou=Offices,o=test,dc=portal,dc=example,dc=com</value>
+ </option>
+ <!--<option>-->
+ <!--<name>entrySearchFilter</name>-->
+ <!--<value></value>-->
+ <!--</option>-->
+ <option>
+ <name>allowCreateEntry</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>membershipAttributeName</name>
+ <value>member</value>
+ </option>
+ <option>
+ <name>isMembershipAttributeDN</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowEmptyMemberships</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>createEntryAttributeValues</name>
+ <value>objectClass=top</value>
+ <value>objectClass=groupOfNames</value>
+ </option>
+ </options>
+ </identity-object-type>
+ </supported-identity-object-types>
+ <options>
+ <option>
+ <name>providerURL</name>
+ <value>ldap://localhost:10389</value>
+ </option>
+ <option>
+ <name>adminDN</name>
+ <value>cn=Directory Manager</value>
+ </option>
+ <option>
+ <name>adminPassword</name>
+ <value>password</value>
+ </option>
+ <option>
+ <name>searchTimeLimit</name>
+ <value>10000</value>
+ </option>
+ </options>
+ </identity-store>
+ </identity-stores>
+ </stores>
+</jboss-identity>
\ No newline at end of file
Copied: idm/trunk/idm-testsuite/src/test/resources/store-test-config.xml (from rev 482,
idm/trunk/idm-core/src/test/resources/store-test-config.xml)
===================================================================
--- idm/trunk/idm-testsuite/src/test/resources/store-test-config.xml
(rev 0)
+++ idm/trunk/idm-testsuite/src/test/resources/store-test-config.xml 2009-05-09 11:10:49
UTC (rev 485)
@@ -0,0 +1,373 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jboss-identity xmlns="urn:jboss:identity:idm:config:v1_0_alpha"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:identity:idm:config:v1_0_alpha
identity-config.xsd">
+ <realms>
+ <realm>
+ <id>realm://Dymmy</id>
+ <repository-id-ref>X</repository-id-ref>
+ <identity-type-mappings>
+ <user-mapping>USER</user-mapping>
+ </identity-type-mappings>
+ </realm>
+ </realms>
+ <repositories>
+ <repository>
+ <id>X</id>
+ <class>X</class>
+ <external-config/>
+
<default-identity-store-id>HibernateTestStore</default-identity-store-id>
+
<default-attribute-store-id>HibernateTestStore</default-attribute-store-id>
+ <!--<identity-store-mappings>-->
+ <!--<identity-store-mapping>-->
+
<!--<identity-store-id>HibernateTestStore</identity-store-id>-->
+ <!--<identity-object-types/>-->
+ <!--<options/>-->
+ <!--</identity-store-mapping>-->
+ <!--</identity-store-mappings>-->
+ </repository>
+ </repositories>
+ <stores>
+ <attribute-stores/>
+ <identity-stores>
+ <identity-store>
+ <id>HibernateTestStore</id>
+
<class>org.jboss.identity.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
+ <external-config/>
+ <supported-relationship-types>
+
<relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
+
<relationship-type>JBOSS_IDENTITY_ROLE</relationship-type>
+ </supported-relationship-types>
+ <supported-identity-object-types>
+ <identity-object-type>
+ <name>USER</name>
+ <relationships/>
+ <credentials>
+ <credential-type>PASSWORD</credential-type>
+ <credential-type>BINARY</credential-type>
+ </credentials>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>GROUP</name>
+ <relationships/>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>ORGANIZATION</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ROLE</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>GROUP</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>ROLE</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ </supported-identity-object-types>
+ <options>
+ <!--<option>-->
+ <!--<name>hibernateConfiguration</name>-->
+
<!--<value>hibernate-jboss-identity.cfg.xml</value>-->
+ <!--</option>-->
+ <option>
+ <name>hibernateSessionFactoryJNDIName</name>
+
<value>java:/jbossidentity/HibernateStoreSessionFactory</value>
+ </option>
+ <option>
+ <name>populateRelationshipTypes</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>populateIdentityObjectTypes</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>isRealmAware</name>
+ <value>false</value>
+ </option>
+ <option>
+ <name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ </options>
+ </identity-store>
+ <identity-store>
+ <id>LDAPTestStore</id>
+
<class>org.jboss.identity.idm.impl.store.ldap.LDAPIdentityStoreImpl</class>
+ <external-config/>
+ <supported-relationship-types>
+
<relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
+ </supported-relationship-types>
+ <supported-identity-object-types>
+ <identity-object-type>
+ <name>USER</name>
+ <relationships/>
+ <credentials>
+ <credential-type>PASSWORD</credential-type>
+ </credentials>
+ <attributes>
+ <attribute>
+ <name>phone</name>
+ <mapping>telephoneNumber</mapping>
+ <type>text</type>
+ <isRequired/>
+ <isMultivalued>true</isMultivalued>
+ <isReadOnly/>
+ </attribute>
+ <attribute>
+ <name>description</name>
+ <mapping>description</mapping>
+ <type>text</type>
+ <isRequired/>
+ <isMultivalued>true</isMultivalued>
+ <isReadOnly/>
+ </attribute>
+ <attribute>
+ <name>carLicense</name>
+ <mapping>carLicense</mapping>
+ <type>text</type>
+ <isRequired/>
+ <isMultivalued>true</isMultivalued>
+ <isReadOnly/>
+ </attribute>
+ </attributes>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>uid</value>
+ </option>
+ <option>
+ <name>passwordAttributeName</name>
+ <value>userPassword</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+
<value>ou=People,o=test,dc=portal,dc=example,dc=com</value>
+ </option>
+ <option>
+ <name>allowCreateEntry</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>createEntryAttributeValues</name>
+ <value>objectClass=top</value>
+ <value>objectClass=inetOrgPerson</value>
+ <value>sn= </value>
+ <value>cn= </value>
+ </option>
+ </options>
+ </identity-object-type>
+ <identity-object-type>
+ <name>GROUP</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ROLE</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>GROUP</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+
<value>ou=Groups,o=test,dc=portal,dc=example,dc=com</value>
+ </option>
+ <!--<option>-->
+ <!--<name>entrySearchFilter</name>-->
+ <!--<value></value>-->
+ <!--</option>-->
+ <option>
+ <name>allowCreateEntry</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>membershipAttributeName</name>
+ <value>member</value>
+ </option>
+ <option>
+ <name>isMembershipAttributeDN</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowEmptyMemberships</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>createEntryAttributeValues</name>
+ <value>objectClass=top</value>
+ <value>objectClass=groupOfNames</value>
+ </option>
+ </options>
+ </identity-object-type>
+ <identity-object-type>
+ <name>ORGANIZATION</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ROLE</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>GROUP</identity-object-type-ref>
+ </relationship>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+
<value>ou=Organizations,o=test,dc=portal,dc=example,dc=com</value>
+ </option>
+ <!--<option>-->
+ <!--<name>entrySearchFilter</name>-->
+ <!--<value></value>-->
+ <!--</option>-->
+ <option>
+ <name>allowCreateEntry</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>membershipAttributeName</name>
+ <value>member</value>
+ </option>
+ <option>
+ <name>isMembershipAttributeDN</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowEmptyMemberships</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>createEntryAttributeValues</name>
+ <value>objectClass=top</value>
+ <value>objectClass=groupOfNames</value>
+ </option>
+ </options>
+ </identity-object-type>
+ <identity-object-type>
+ <name>ROLE</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+
<value>ou=Roles,o=test,dc=portal,dc=example,dc=com</value>
+ </option>
+ <!--<option>-->
+ <!--<name>entrySearchFilter</name>-->
+ <!--<value></value>-->
+ <!--</option>-->
+ <option>
+ <name>allowCreateEntry</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>membershipAttributeName</name>
+ <value>member</value>
+ </option>
+ <option>
+ <name>isMembershipAttributeDN</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowEmptyMemberships</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>createEntryAttributeValues</name>
+ <value>objectClass=top</value>
+ <value>objectClass=groupOfNames</value>
+ </option>
+ </options>
+ </identity-object-type>
+ </supported-identity-object-types>
+ <options>
+ <option>
+ <name>providerURL</name>
+ <value>ldap://localhost:10389</value>
+ </option>
+ <option>
+ <name>adminDN</name>
+ <value>cn=Directory Manager</value>
+ </option>
+ <option>
+ <name>adminPassword</name>
+ <value>password</value>
+ </option>
+ <option>
+ <name>searchTimeLimit</name>
+ <value>10000</value>
+ </option>
+ </options>
+ </identity-store>
+ </identity-stores>
+ </stores>
+</jboss-identity>
\ No newline at end of file
Property changes on: idm/trunk/idm-testsuite/src/test/resources/store-test-config.xml
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: idm/trunk/pom.xml
===================================================================
--- idm/trunk/pom.xml 2009-05-09 10:22:47 UTC (rev 484)
+++ idm/trunk/pom.xml 2009-05-09 11:10:49 UTC (rev 485)
@@ -19,7 +19,11 @@
<module>idm-spi</module>
<module>idm-api</module>
<module>idm-core</module>
+ <module>idm-hibernate</module>
+ <module>idm-ldap</module>
+ <module>idm-cache</module>
<module>idm-auth</module>
+ <module>idm-testsuite</module>
<module>integration</module>
<module>assembly</module>
</modules>