JBoss Portal SVN: r8677 - in modules/test/trunk/unit/src/main/org/jboss: unit/info and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-17 09:16:16 -0400 (Wed, 17 Oct 2007)
New Revision: 8677
Added:
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/MethodAndMethodArgumentAnnotatedWithParameter1.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/MethodAndMethodArgumentAnnotatedWithParameter2.java
Removed:
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/ClassHavingSamePropertyParameterAndMethodArgumentParameter.java
Modified:
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/AbstractPOJOTests.java
modules/test/trunk/unit/src/main/org/jboss/unit/info/TestInfo.java
modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestCaseDef.java
modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestProviderSupport.java
Log:
specify the contract for getParameters() on TestInfo and implemented test case for it
Modified: modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/AbstractPOJOTests.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/AbstractPOJOTests.java 2007-10-17 13:07:31 UTC (rev 8676)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/AbstractPOJOTests.java 2007-10-17 13:16:16 UTC (rev 8677)
@@ -25,6 +25,7 @@
import org.jboss.unit.api.Assert;
import static org.jboss.unit.util.CollectionTools.*;
+import static org.jboss.unit.api.Assert.*;
import java.util.Map;
import java.util.Collections;
@@ -63,7 +64,7 @@
testMethodAnnotatedWithTag();
//
- testClassHavingSamePropertyParameterAndMethodArgumentParameter();
+ testMethodAndMethodArgumentAnnotatedWithParameter();
//
testClassWithoutDefaultConstructor();
@@ -144,12 +145,15 @@
invoke(driver, clazz, "testFoo", AbstractPOJOTest.InvokeResult.PASS, true);
}
- private void testClassHavingSamePropertyParameterAndMethodArgumentParameter()
+ private void testMethodAndMethodArgumentAnnotatedWithParameter()
{
- AbstractPOJOTest driver = assertCanBuildSuite(ClassHavingSamePropertyParameterAndMethodArgumentParameter.class);
+ AbstractPOJOTest driver1 = assertCanBuildSuite(MethodAndMethodArgumentAnnotatedWithParameter1.class);
+ invoke(driver1, MethodAndMethodArgumentAnnotatedWithParameter1.class, "testFoo", AbstractPOJOTest.InvokeResult.PASS, true);
+ assertTrue(driver1.getParameterNames().containsAll(driver1.getTestCaseParameterNames("testFoo")));
- //
- invoke(driver, ClassHavingSamePropertyParameterAndMethodArgumentParameter.class, "testFoo", AbstractPOJOTest.InvokeResult.PASS, true);
+ AbstractPOJOTest driver2 = assertCanBuildSuite(MethodAndMethodArgumentAnnotatedWithParameter2.class);
+ invoke(driver2, MethodAndMethodArgumentAnnotatedWithParameter2.class, "testFoo", AbstractPOJOTest.InvokeResult.PASS, true);
+ assertTrue(driver2.getParameterNames().containsAll(driver2.getTestCaseParameterNames("testFoo")));
}
private void testClassWithFailingConstructor()
Deleted: modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/ClassHavingSamePropertyParameterAndMethodArgumentParameter.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/ClassHavingSamePropertyParameterAndMethodArgumentParameter.java 2007-10-17 13:07:31 UTC (rev 8676)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/ClassHavingSamePropertyParameterAndMethodArgumentParameter.java 2007-10-17 13:16:16 UTC (rev 8677)
@@ -1,51 +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.test.unit.pojo;
-
-import org.jboss.unit.api.pojo.annotations.Parameter;
-import org.jboss.unit.api.pojo.annotations.Test;
-
-import java.util.Collections;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class ClassHavingSamePropertyParameterAndMethodArgumentParameter
-{
-
- @Parameter
- public void setFoo(String foo)
- {
- POJOAssert.buffer1 = foo;
- }
-
- @Test
- public void testFoo(@Parameter(name="foo") String foo)
- {
- if (POJOAssert.buffer1 != null && POJOAssert.buffer1.equals(foo))
- {
- POJOAssert.call(ClassHavingSamePropertyParameterAndMethodArgumentParameter.class, Collections.singletonMap("foo", POJOAssert.buffer1));
- }
- }
-}
Copied: modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/MethodAndMethodArgumentAnnotatedWithParameter1.java (from rev 8670, modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/ClassHavingSamePropertyParameterAndMethodArgumentParameter.java)
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/MethodAndMethodArgumentAnnotatedWithParameter1.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/MethodAndMethodArgumentAnnotatedWithParameter1.java 2007-10-17 13:16:16 UTC (rev 8677)
@@ -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.test.unit.pojo;
+
+import org.jboss.unit.api.pojo.annotations.Parameter;
+import org.jboss.unit.api.pojo.annotations.Test;
+
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class MethodAndMethodArgumentAnnotatedWithParameter1
+{
+
+ @Parameter
+ public void setFoo(String foo)
+ {
+ POJOAssert.buffer1 = foo;
+ }
+
+ @Test
+ public void testFoo(@Parameter(name="foo") String foo)
+ {
+ POJOAssert.call(MethodAndMethodArgumentAnnotatedWithParameter1.class, Collections.singletonMap("foo", POJOAssert.buffer1));
+ }
+}
Added: modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/MethodAndMethodArgumentAnnotatedWithParameter2.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/MethodAndMethodArgumentAnnotatedWithParameter2.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/MethodAndMethodArgumentAnnotatedWithParameter2.java 2007-10-17 13:16:16 UTC (rev 8677)
@@ -0,0 +1,52 @@
+/******************************************************************************
+ * 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.test.unit.pojo;
+
+import org.jboss.unit.api.pojo.annotations.Parameter;
+import org.jboss.unit.api.pojo.annotations.Test;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class MethodAndMethodArgumentAnnotatedWithParameter2
+{
+
+ @Parameter
+ public void setBar(String bar)
+ {
+ POJOAssert.buffer1 = bar;
+ }
+
+ @Test
+ public void testFoo(@Parameter(name="foo") String foo)
+ {
+ Map<String, String> map = new HashMap<String, String>();
+ map.put("bar", POJOAssert.buffer1);
+ map.put("foo", foo);
+ POJOAssert.call(MethodAndMethodArgumentAnnotatedWithParameter2.class, map);
+ }
+}
\ No newline at end of file
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/info/TestInfo.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/info/TestInfo.java 2007-10-17 13:07:31 UTC (rev 8676)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/info/TestInfo.java 2007-10-17 13:16:16 UTC (rev 8677)
@@ -50,7 +50,9 @@
String getDescription();
/**
- * Return a map of parameters.
+ * Returns a map of parameters required to execute the test related to this description. For a test case
+ * it returns a map of parameters to execute this test case. For a test suite it returns a map
+ * formed by the union of the maps returned by the children of the test suite.
*
* @return the parameters
*/
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestCaseDef.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestCaseDef.java 2007-10-17 13:07:31 UTC (rev 8676)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestCaseDef.java 2007-10-17 13:16:16 UTC (rev 8677)
@@ -48,10 +48,10 @@
final String description;
/** . */
- final LinkedHashMap<String,ArgumentTestParameter> arguments;
+ final LinkedHashMap<String, ArgumentTestParameter> arguments;
/** . */
- final Map<String,TestParameter> parameters;
+ final Map<String, TestParameter> parameters;
/** . */
final Set<String> keywords;
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestProviderSupport.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestProviderSupport.java 2007-10-17 13:07:31 UTC (rev 8676)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/spi/pojo/TestProviderSupport.java 2007-10-17 13:16:16 UTC (rev 8677)
@@ -73,7 +73,7 @@
private final Method destroy;
/** . */
- final Map<String, PropertyTestParameter> suiteParameters;
+ final Map<String, PropertyTestParameter> propertyParameters;
/** . */
private final Constructor ctor;
@@ -81,6 +81,9 @@
/** . */
private final Set<String> suiteKeywords;
+ /** . */
+ final Map<String, TestParameter> suiteParameters;
+
public TestProviderSupport(Class testClass)
{
if (testClass == null)
@@ -137,7 +140,7 @@
}
//
- Map<String, PropertyTestParameter> suiteParameters = new HashMap<String, PropertyTestParameter>();
+ Map<String, PropertyTestParameter> propertyParameters = new HashMap<String, PropertyTestParameter>();
Map<String, TestCaseDef> testCases = new HashMap<String, TestCaseDef>();
Method create = null;
Method destroy = null;
@@ -230,11 +233,11 @@
}
//
- PropertyTestParameter parameter = suiteParameters.get(name);
+ PropertyTestParameter parameter = propertyParameters.get(name);
if (parameter == null)
{
parameter = new PropertyTestParameter(name, description);
- suiteParameters.put(name, parameter);
+ propertyParameters.put(name, parameter);
}
//
@@ -396,7 +399,8 @@
keywords.addAll(CollectionTools.set(tagMethodAnnotation.value()));
}
- Map<String,TestParameter> parameters = new HashMap<String, TestParameter>(suiteParameters);
+ //
+ Map<String,TestParameter> parameters = new HashMap<String, TestParameter>(propertyParameters);
parameters.putAll(methodParameters);
//
@@ -410,15 +414,26 @@
}
}
- //
+ // Set the state computed from the annotations
this.suiteName = suiteName;
this.suiteDescription = suiteDescription;
this.suiteKeywords = suiteKeywords;
- this.suiteParameters = suiteParameters;
+ this.propertyParameters = propertyParameters;
this.testCases = testCases;
this.ctor = ctor;
this.create = create;
this.destroy = destroy;
+
+ // Compute the suite parameters
+ Map<String, TestParameter> suiteParameters = new HashMap<String, TestParameter>();
+ for (TestCaseDef testCase : testCases.values())
+ {
+ suiteParameters.putAll(testCase.arguments);
+ }
+ suiteParameters.putAll(propertyParameters);
+
+ // Set the state computed from the existing state
+ this.suiteParameters = suiteParameters;
}
public TestSuiteDescriptor getDescriptor()
@@ -493,7 +508,7 @@
testCase.parametrization = parametrization;
//
- for (PropertyTestParameter parameter : suiteParameters.values())
+ for (PropertyTestParameter parameter : propertyParameters.values())
{
if (!parametrization.containsKey(parameter.getName()))
{
16 years, 8 months
JBoss Portal SVN: r8676 - modules/identity/trunk/identity.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-10-17 09:07:31 -0400 (Wed, 17 Oct 2007)
New Revision: 8676
Modified:
modules/identity/trunk/identity/build.xml
Log:
- forgot to comment out...
Modified: modules/identity/trunk/identity/build.xml
===================================================================
--- modules/identity/trunk/identity/build.xml 2007-10-17 13:05:03 UTC (rev 8675)
+++ modules/identity/trunk/identity/build.xml 2007-10-17 13:07:31 UTC (rev 8676)
@@ -344,7 +344,7 @@
<jboss-unit>
<tests config="./output/resources/test/jboss-unit.xml" suiteName="IdentityTests">
- <include keywords="DB,generic"/>
+ <!--<include keywords="DB,generic"/>-->
</tests>
<reports>
16 years, 8 months
JBoss Portal SVN: r8675 - in modules/identity/trunk: build/ide/intellij/idea60/modules/identity and 13 other directories.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-10-17 09:05:03 -0400 (Wed, 17 Oct 2007)
New Revision: 8675
Added:
modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/GenericTest.java
modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/GenericTestPOJO.java
modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/IdentityTestPOJO.java
modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/db/DBGenericTest.java
modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPExtRoleModuleTest.java
modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPExtUserModuleTest.java
modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPGenericTest.java
modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleRoleModuleTest.java
modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleUserModuleTest.java
modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticGroupMembershipModuleTest.java
modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticRoleMembershipModuleTest.java
modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPTestPOJO.java
modules/identity/trunk/identity/src/resources/log4j.properties
modules/identity/trunk/identity/src/resources/test/jboss-unit.xml
Removed:
modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/IdentityTest.java
modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/db/DBIdentityTestCase.java
modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/db/DBTestCase.java
modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPExtRoleModuleTestCase.java
modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPExtUserModuleTestCase.java
modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPIdentityTestCase.java
modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPMembershipModuleTestCase.java
modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleRoleModuleTestCase.java
modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleUserModuleTestCase.java
modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticGroupMembershipModuleTestCase.java
modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticRoleMembershipModuleTestCase.java
modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPTestCase.java
Modified:
modules/identity/trunk/build/build-thirdparty.xml
modules/identity/trunk/build/ide/intellij/idea60/modules/identity/identity.iml
modules/identity/trunk/identity/build.xml
modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/TestServiceLoader.java
modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPUserProfileModuleTestCase.java
modules/identity/trunk/identity/src/resources/portal-identity-test-jar/org/jboss/portal/test/identity/db-beans.xml
modules/identity/trunk/identity/src/resources/portal-identity-test-jar/org/jboss/portal/test/identity/ldap-beans.xml
modules/identity/trunk/identity/src/resources/test/config/standardidentity-config.xml
modules/identity/trunk/sso/build.xml
modules/identity/trunk/sso/src/main/org/jboss/portal/identity/sso/cas/CASAuthenticationHandler.java
modules/identity/trunk/sso/src/main/org/jboss/portal/test/identity/sso/CASTestCase.java
modules/identity/trunk/sso/src/main/org/jboss/portal/test/identity/sso/EasySSLProtocolSocketFactory.java
modules/identity/trunk/sso/src/main/org/jboss/portal/test/identity/sso/EasyX509TrustManager.java
modules/identity/trunk/sso/src/main/org/jboss/portal/test/identity/sso/JOSSOTestCase.java
modules/identity/trunk/testsuite/build.xml
modules/identity/trunk/tools/etc/buildfragments/defaults.ent
Log:
- migrate identity testsuite to jboss unit
- sso tests temporarily commented out
Modified: modules/identity/trunk/build/build-thirdparty.xml
===================================================================
--- modules/identity/trunk/build/build-thirdparty.xml 2007-10-17 11:11:09 UTC (rev 8674)
+++ modules/identity/trunk/build/build-thirdparty.xml 2007-10-17 13:05:03 UTC (rev 8675)
@@ -47,18 +47,42 @@
are pushed to the http://repository.jboss.com site.
-->
+
+ <!--Embedded stuff-->
+ <componentref name="jbossas/core-libs" version="4.0.4.GA"/>
+
+
+
<componentref name="jboss-portal/modules/common" version="trunk-SNAPSHOT"/>
<componentref name="jboss-portal/modules/test" version="trunk-SNAPSHOT"/>
+
<componentref name="apache-log4j" version="1.2.8"/>
- <componentref name="apache-logging" version="1.0.5.SP1-jboss"/>
+ <componentref name="apache-logging" version="1.0.5.SP1-jboss"/>
<componentref name="apache-xerces" version="2.7.1"/>
<componentref name="apache-httpclient" version="3.0.1"/>
- <componentref name="junit" version="3.8.1"/>
- <componentref name="jboss/microcontainer" version="1.0.2"/>
+ <componentref name="junit" version="3.8.1"/>
+
+
+
+ <componentref name="jboss/common-core" version="2.2.1.GA"/>
+ <componentref name="jboss/common-logging-log4j" version="2.0.2.GA"/>
+ <componentref name="jboss/common-logging-jdk" version="2.0.2.GA"/>
+ <componentref name="jboss/common-logging-spi" version="2.0.2.GA"/>
+ <componentref name="jboss/aop" version="2.0.0.alpha6"/>
+ <componentref name="jboss/security" version="2.0.0.GA"/>
+ <componentref name="jboss/jboss-jacc-api" version="1.1-SNAPSHOT"/>
+ <componentref name="jboss/jboss-transaction-api" version="1.0.1-SNAPSHOT"/>
+
+
+ <componentref name="trove" version="1.0.2"/>
+ <componentref name="apache-xerces" version="2.7.1"/>
+
+
+
+ <componentref name="jboss/microcontainer" version="2.0.0.Beta4"/>
<componentref name="jboss/backport-concurrent" version="2.1.0.GA"/>
- <componentref name="jboss/jbossxb" version="1.0.0.CR4"/>
+ <componentref name="jboss/jbossxb" version="2.0.0.CR4"/>
<componentref name="jboss/test" version="1.0.0.CR1"/>
- <componentref name="jbossas/core-libs" version="4.0.4.GA"/>
<componentref name="sleepycat" version="3.0.12"/>
<componentref name="hibernate" version="3.2.0.CR2"/>
<componentref name="sun-opends" version="snapshot"/>
Modified: modules/identity/trunk/build/ide/intellij/idea60/modules/identity/identity.iml
===================================================================
--- modules/identity/trunk/build/ide/intellij/idea60/modules/identity/identity.iml 2007-10-17 11:11:09 UTC (rev 8674)
+++ modules/identity/trunk/build/ide/intellij/idea60/modules/identity/identity.iml 2007-10-17 13:05:03 UTC (rev 8675)
@@ -163,6 +163,348 @@
<SOURCES />
</library>
</orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-container-metadata.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-vfs.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-classloader.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-client-spi-sources.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-managed-sources.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-spi-sources.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-aop-mc-int.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-vfs-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-impl.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-client-sources.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-aop-mc-int-sources.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-dependency-sources.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-structure-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-core-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-client-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-container-metadata-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-kernel.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-impl-sources.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-classloader-sources.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-structure-spi-sources.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-client.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-kernel-sources.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-metatype.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-core-sources.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-vfs-sources.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-vfs-spi-sources.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-managed.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-metatype-sources.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-core-spi-sources.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-core.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-container-sources.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-portal/modules/test/lib/jboss-unit-remote-lib.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-portal/modules/test/lib/jboss-unit-tooling-lib.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-portal/modules/test/lib/jboss-unit-lib.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-portal/modules/test/lib/jboss-unit-mc-lib.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-portal/modules/test/lib/portal-test-generic-lib.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-portal/modules/test/lib/portal-test-jboss-lib.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
<component name="VcsManagerConfiguration">
Modified: modules/identity/trunk/identity/build.xml
===================================================================
--- modules/identity/trunk/identity/build.xml 2007-10-17 11:11:09 UTC (rev 8674)
+++ modules/identity/trunk/identity/build.xml 2007-10-17 13:05:03 UTC (rev 8675)
@@ -95,18 +95,66 @@
<path refid="jboss.microcontainer.classpath"/>
<path refid="jboss.jbossxb.classpath"/>
<path refid="apache.xerces.classpath"/>
- <path refid="jbossas/core.libs.classpath"/>
<path refid="oswego.concurrent.classpath"/>
<path refid="hibernate.hibernate.classpath"/>
<path refid="apache.log4j.classpath"/>
<path refid="junit.junit.classpath"/>
<path refid="apache.tomcat.classpath"/>
+
+ <path refid="jboss/common.core.classpath"/>
+ <path refid="jboss/common.logging.spi.classpath"/>
+ <path refid="jboss.security.classpath"/>
+ <path refid="jboss/jboss.jacc.api.classpath"/>
+ <path refid="jboss/jboss.transaction.api.classpath"/>
+
+ <path refid="jboss.aop.classpath"/>
+ <path refid="oswego.concurrent.classpath"/>
+ <path refid="sun.opends.classpath"/>
+
<pathelement location="${project.tools}/lib/ant.jar"/>
+
+ <pathelement location="${jboss.portal/modules/test.lib}/jboss-unit-lib.jar"/>
+ <pathelement location="${jboss.portal/modules/test.lib}/jboss-unit-mc-lib.jar"/>
+
+
+
<!--<path refid="sun.opends.classpath"/>-->
</path>
+ <path id="test.classpath">
+ <path location="${build.resources}/test"/>
+
+ <path refid="library.classpath"/>
+
+ <path refid="apache.logging.classpath"/>
+ <path refid="dom4j.dom4j.classpath"/>
+ <path refid="jboss/common.logging.jdk.classpath"/>
+ <path refid="jboss.aop.classpath"/>
+ <path refid="javassist.javassist.classpath"/>
+ <path refid="trove.trove.classpath"/>
+ <path refid="apache.xerces.classpath"/>
+ <path refid="asm.asm.classpath"/>
+ <path refid="antlr.antlr.classpath"/>
+ <path refid="cglib.cglib.classpath"/>
+ <path refid="apache.collections.classpath"/>
+ <path refid="jbossas/core.libs.classpath"/>
+ <path refid="hsqldb.hsqldb.classpath"/>
+
+
+ <pathelement location="${jboss.portal/modules/test.lib}/jboss-unit-remote-lib.jar"/>
+ <pathelement location="${jboss.portal/modules/test.lib}/jboss-unit-tooling-lib.jar"/>
+
+ <pathelement location="${build.lib}/portal-identity-lib.jar"/>
+ <pathelement location="${build.lib}/portal-identity-test-lib.jar"/>
+ <pathelement location="${jboss.portal/modules/test.resources}"/>
+ <pathelement location="${jboss.portal/modules/test.lib}/ldap.zip"/>
+ <pathelement location="${build.resources}/hibernate"/>
+ <pathelement location="${build.resources}"/>
+
+ </path>
+
<path id="javac.classpath">
- <pathelement location="${build.classes}"/>
+ <pathelement location="${build.classes}"/>
</path>
<!-- Configure modules -->
@@ -142,14 +190,13 @@
description="Compile all source files."
depends="generate-parsers,
compile-classes,
- compile-classes15,
_default:compile-etc,
_default:compile-resources">
<!-- Add module specific elements here. -->
</target>
- <target name="compile-classes" depends="_buildmagic:init" unless="HAVE_JDK_1.5">
+ <target name="compile-classes" depends="_buildmagic:init">
<mkdir dir="${build.classes}"/>
<!-- Hack, required to avoid duplicate javac targets -->
@@ -181,47 +228,11 @@
<include name="${javac.includes}"/>
<exclude name="${javac.excludes}"/>
- <exclude name="org/jboss/portal/test/identity/ldap/**"/>
</javac>
</target>
- <target name="compile-classes15" depends="_buildmagic:init" if="HAVE_JDK_1.5">
- <mkdir dir="${build.classes}"/>
-
- <!-- Hack, required to avoid duplicate javac targets -->
- <mkdir dir="${build.gen.classes}"/>
-
- <!-- Remove classes which depend on changed files, so they will rebuild. -->
- <depend srcdir="${source.java}:${build.gen.classes}"
- destdir="${build.classes}"
- dump="${javac.depend.dump}"
- closure="${javac.depend.closure}">
- <include name="${javac.includes}"/>
- <exclude name="${javac.excludes}"/>
- </depend>
-
- <javac destdir="${build.classes}"
- optimize="${javac.optimize}"
- target="${javac.target}"
- debug="${javac.debug}"
- source="${javac.source}"
- depend="${javac.depend}"
- verbose="${javac.verbose}"
- deprecation="${javac.deprecation}"
- includeAntRuntime="${javac.include.ant.runtime}"
- includeJavaRuntime="${javac.include.java.runtime}"
- failonerror="${javac.fail.onerror}">
- <src path="${source.java}:${build.gen.classes}"/>
- <classpath refid="javac.classpath"/>
- <classpath refid="sun.opends.classpath"/>
-
-
- <include name="${javac.includes}"/>
- <exclude name="${javac.excludes}"/>
- </javac>
- </target>
-
+
<target name="generate-parsers" depends="init">
</target>
@@ -256,36 +267,22 @@
<!-- generates artifacts used for tests, requires output to be previously run
-->
- <target name="package-tests" depends="init,
- output, package-tests15">
+ <target name="package-tests" depends="init, output">
<jar jarfile="${build.lib}/portal-identity-test-lib.jar">
<fileset dir="${build.classes}" includes="org/jboss/portal/test/**"/>
<fileset dir="${build.resources}/portal-identity-test-jar"/>
</jar>
- </target>
-
- <target name="package-tests15" if="HAVE_JDK_1.5">
- <!--test-identity.sar -->
<jar jarfile="${build.lib}/test-identity.sar">
<fileset dir="${build.resources}/test-identity-sar"/>
<fileset dir="${jboss.portal/modules/test.lib}" includes="portal-test-jboss-lib-jdk5.jar"/>
<fileset dir="${sun.opends.lib}" includes="OpenDS.jar"/>
<fileset dir="${sleepycat.sleepycat.lib}" includes="je.jar"/>
</jar>
+
</target>
-<!-- <target name="package-opends" depends="init, output" if="HAVE_JDK_1.5">
-
- <jar jarfile="${build.lib}/opends.sar">
- <fileset dir="${build.resources}/opends-sar"/>
- <fileset dir="${jboss.portal/modules/test.lib}" includes="portal-test-jboss-lib.jar"/>
- <fileset dir="${sun.opends.lib}" includes="OpenDS.jar"/>
- <fileset dir="${sleepycat.sleepycat.lib}" includes="je.jar"/>
- </jar>
- </target>-->
-
<!-- ================================================================== -->
<!-- Cleaning -->
<!-- ================================================================== -->
@@ -315,20 +312,6 @@
<target name="help" depends="_default:help"/>
-
- <!--<target name="deploy-opends" depends="init, package-opends" if="HAVE_JDK_1.5" >
- <mkdir dir="${jboss.home}/server/default/conf/opends"/>
- <copy todir="${jboss.home}/server/default/conf/opends" overwrite="true" failonerror="false">
- <fileset dir="../test/output/etc/opends"/>
- </copy>
- <copy todir="${jboss.home}/server/default/conf/opends" overwrite="true" failonerror="false">
- <fileset dir="./output/etc/opends"/>
- </copy>
- <copy file="${build.lib}/opends.sar" todir="${jboss.home}/server/${portal.deploy.dir}" failonerror="false"/>
- </target>-->
-
-
-
<target name="deploy-ldap" depends="init, package-tests" if="HAVE_JDK_1.5" >
<mkdir dir="${jboss.home}/server/default/conf/opends"/>
<unzip src="${jboss.portal/modules/test.lib}/opends.zip" dest="${jboss.home}/server/default/conf/opends" overwrite="true"/>
@@ -343,187 +326,43 @@
<!--<delete dir="${jboss.home}/server/default/conf/opends" failonerror="false" deleteonexit="true" quiet="true"/>-->
</target>
- <target name="tests" depends="init, tests15">
- <property name="proto-libs" value="${project.root}/proto-libs"/>
-
-
-
- <execute-tests>
-<!--
-
- <x-sysproperty>
- <jvmarg value="-Xdebug"/>
- <jvmarg value="-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"/>
- </x-sysproperty>
--->
-
-
- <x-test>
- <test todir="${test.reports}" name="org.jboss.portal.test.identity.db.DBIdentityTestCase"/>
- </x-test>
- <x-classpath>
- <pathelement location="${build.lib}/portal-identity-lib.jar"/>
- <pathelement location="${build.lib}/portal-identity-test-lib.jar"/>
- <pathelement location="${jboss.portal/modules/test.resources}"/>
- <!--<pathelement location="${jboss.portal-identity.root}/resources/test"/>-->
- <pathelement location="${build.resources}/hibernate"/>
- <pathelement location="${build.resources}"/>
-
-
- <path refid="apache.commons.classpath"/>
- <path refid="dom4j.dom4j.classpath"/>
- <path refid="jboss.microcontainer.classpath"/>
- <path refid="jboss.jbossxb.classpath"/>
- <path refid="apache.xerces.classpath"/>
- <path refid="oswego.concurrent.classpath"/>
- <path refid="apache.logging.classpath"/>
- <path refid="apache.log4j.classpath"/>
- <path refid="hibernate.hibernate.classpath"/>
- <path refid="antlr.antlr.classpath"/>
- <path refid="asm.asm.classpath"/>
- <path refid="apache.collections.classpath"/>
- <path refid="jbossas/core.libs.classpath"/>
- <path refid="junit.junit.classpath"/>
- <path refid="apache.logging.classpath"/>
- <path refid="cglib.cglib.classpath"/>
- <path refid="jboss.portal/modules/test.classpath"/>
- <path refid="jboss.portal/modules/common.classpath"/>
- <!--<path refid="jboss.portal-jems.classpath"/>-->
- <path refid="sun.jaf.classpath"/>
- </x-classpath>
- </execute-tests>
-
-
-
- </target>
-
-
- <target name="tests15" depends="init" if="HAVE_JDK_1.5">
- <property name="proto-libs" value="${project.root}/proto-libs"/>
+ <target name="tests" depends="init">
<antcall target="deploy-ldap"/>
- <execute-tests>
-<!--
-
- <x-sysproperty>
- <jvmarg value="-Xdebug"/>
- <jvmarg value="-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"/>
- </x-sysproperty>
--->
-
-
- <x-test>
- <test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPIdentityTestCase"/>
- <test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPSimpleUserModuleTestCase"/>
- <test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPSimpleRoleModuleTestCase"/>
- <test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPStaticGroupMembershipModuleTestCase"/>
- <test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPStaticRoleMembershipModuleTestCase"/>
- <test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPUserProfileModuleTestCase"/>
- <test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPExtUserModuleTestCase"/>
- <test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPExtRoleModuleTestCase"/>
-
-
- </x-test>
- <x-classpath>
- <pathelement location="${build.lib}/portal-identity-lib.jar"/>
- <pathelement location="${build.lib}/portal-identity-test-lib.jar"/>
- <pathelement location="${jboss.portal/modules/test.resources}"/>
- <!--<pathelement location="${jboss.portal-identity.root}/resources/test"/>-->
- <pathelement location="${jboss.portal/modules/test.lib}/ldap.zip"/>
- <pathelement location="${build.resources}/hibernate"/>
- <pathelement location="${build.resources}"/>
-
-
-
- <path refid="apache.commons.classpath"/>
- <path refid="sun.opends.classpath"/>
- <path refid="dom4j.dom4j.classpath"/>
- <path refid="jboss.microcontainer.classpath"/>
- <path refid="jboss.jbossxb.classpath"/>
- <path refid="apache.xerces.classpath"/>
- <path refid="oswego.concurrent.classpath"/>
- <path refid="apache.logging.classpath"/>
- <path refid="apache.log4j.classpath"/>
- <path refid="hibernate.hibernate.classpath"/>
- <path refid="antlr.antlr.classpath"/>
- <path refid="asm.asm.classpath"/>
- <path refid="apache.collections.classpath"/>
- <path refid="jbossas/core.libs.classpath"/>
- <path refid="junit.junit.classpath"/>
- <path refid="apache.logging.classpath"/>
- <path refid="cglib.cglib.classpath"/>
- <path refid="jboss.portal/modules/test.classpath"/>
- <path refid="jboss.portal/modules/common.classpath"/>
- <!--<path refid="jboss.portal-jems.classpath"/>-->
- <path refid="sleepycat.sleepycat.classpath"/>
- <path refid="sun.jaf.classpath"/>
- </x-classpath>
- </execute-tests>
- <antcall target="undeploy-ldap"/>
-
+ <antcall target="test-identity"/>
</target>
+ <target name="test-identity" depends="init, configure, package-tests">
+ <path id="jboss.unit.tooling.test.classpath">
+ <pathelement location="${jboss.portal/modules/test.lib}/jboss-unit-tooling-lib.jar"/>
+ <path refid="library.classpath"/>
+ </path>
+ <taskdef
+ name="jboss-unit"
+ classname="org.jboss.unit.tooling.ant.JBossUnitTask"
+ classpathref="jboss.unit.tooling.test.classpath"/>
+ <jboss-unit>
- <target name="tests-dev" depends="init, package-tests" if="HAVE_JDK_1.5">
- <property name="proto-libs" value="${project.root}/proto-libs"/>
- <execute-tests>
-<!--
+ <tests config="./output/resources/test/jboss-unit.xml" suiteName="IdentityTests">
+ <include keywords="DB,generic"/>
+ </tests>
- <x-sysproperty>
- <jvmarg value="-Xdebug"/>
- <jvmarg value="-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"/>
- </x-sysproperty>
--->
+ <reports>
+ <xml toDir="output/tests"/>
+ </reports>
-
- <x-test>
- <!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.db.DBIdentityTestCase"/>
- <test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPIdentityTestCase"/>-->
- <!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPSimpleUserModuleTestCase"/>-->
- <!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPSimpleRoleModuleTestCase"/>-->
- <test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPStaticGroupMembershipModuleTestCase"/>
- <!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPStaticRoleMembershipModuleTestCase"/>-->
- <!--<test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPUserProfileModuleTestCase"/>
- <test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPExtUserModuleTestCase"/>
- <test todir="${test.reports}" name="org.jboss.portal.test.identity.ldap.LDAPExtRoleModuleTestCase"/>-->
- </x-test>
- <x-classpath>
- <pathelement location="${build.lib}/portal-identity-lib.jar"/>
- <pathelement location="${build.lib}/portal-identity-test-lib.jar"/>
- <pathelement location="${jboss.portal/modules/test.resources}"/>
- <pathelement location="${jboss.portal/modules/test.lib}/ldap.zip"/>
- <!--<pathelement location="${jboss.portal-identity.root}/resources/test"/>-->
- <pathelement location="${build.resources}/hibernate"/>
- <pathelement location="${build.resources}"/>
-
- <!--temp-->
- <!--<pathelement location="/home/bdaw/Workshop/libs/mysql-connector-java-5.0.4/mysql-connector-java-5.0.4-bin.jar"/>-->
-
-
- <!--<path refid="beanshell.beanshell.classpath"/>-->
- <!--<path refid="apache.commons.classpath"/>-->
- <path refid="sun.opends.classpath"/>
- <path refid="dom4j.dom4j.classpath"/>
- <path refid="jboss.microcontainer.classpath"/>
- <path refid="jboss.jbossxb.classpath"/>
- <path refid="apache.xerces.classpath"/>
- <path refid="oswego.concurrent.classpath"/>
- <path refid="apache.logging.classpath"/>
- <path refid="apache.log4j.classpath"/>
- <path refid="hibernate.hibernate.classpath"/>
- <path refid="antlr.antlr.classpath"/>
- <path refid="asm.asm.classpath"/>
- <path refid="apache.collections.classpath"/>
- <path refid="jbossas/core.libs.classpath"/>
- <path refid="junit.junit.classpath"/>
- <path refid="apache.logging.classpath"/>
- <path refid="cglib.cglib.classpath"/>
- <path refid="jboss.portal/modules/test.classpath"/>
- <path refid="jboss.portal/modules/common.classpath"/>
- <!--<path refid="jboss.portal-jems.classpath"/>-->
- <path refid="sleepycat.sleepycat.classpath"/>
- <!--<path refid="sun.jaf.classpath"/>-->
- </x-classpath>
- </execute-tests>
+ <classpath>
+ <path refid="test.classpath"/>
+ </classpath>
+
+ </jboss-unit >
+ <!--<junitreport todir="output/tests">-->
+ <!--<fileset dir="output/tests">-->
+ <!--<include name="TEST-*.xml"/>-->
+ <!--</fileset>-->
+ <!--<report format="frames"-->
+ <!--todir="output/tests"/>-->
+ <!--</junitreport>-->
</target>
+
</project>
Copied: modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/GenericTest.java (from rev 8668, modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/IdentityTest.java)
===================================================================
--- modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/GenericTest.java (rev 0)
+++ modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/GenericTest.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -0,0 +1,747 @@
+package org.jboss.portal.test.identity;
+
+import org.jboss.unit.api.Assert;
+
+
+import org.jboss.portal.identity.UserModule;
+import org.jboss.portal.identity.RoleModule;
+import org.jboss.portal.identity.MembershipModule;
+import org.jboss.portal.identity.UserProfileModule;
+import org.jboss.portal.identity.User;
+import org.jboss.portal.identity.Role;
+import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.CachedUserImpl;
+import org.jboss.portal.common.util.CollectionBuilder;
+import org.jboss.portal.common.p3p.P3PConstants;
+
+import java.util.Set;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Map;
+import java.util.Date;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public class GenericTest
+{
+
+ /** . */
+ private GenericTest.Context ctx;
+
+
+ public GenericTest(Context ctx)
+ {
+ this.ctx = ctx;
+ }
+
+ public void setContext(GenericTest.Context ctx)
+ {
+ this.ctx = ctx;
+ }
+
+ public void testFindUsersUsingFilter() throws Exception
+ {
+ populate();
+ ctx.begin();
+ Set set1 = ctx.getUserModule().findUsersFilteredByUserName("user", 0, 10);
+
+
+ Set userNames = new HashSet();
+
+ for (Iterator iterator = set1.iterator(); iterator.hasNext();)
+ {
+ User u = (User)iterator.next();
+ userNames.add(u.getUserName());
+ }
+
+
+ Assert.assertTrue(userNames.contains("user1"));
+ Assert.assertTrue(userNames.contains("user2"));
+
+
+ //
+ Set set2 = ctx.getUserModule().findUsersFilteredByUserName("blah", 0, 10);
+ Assert.assertEquals(0, set2.size());
+
+ //
+ Set set3 = ctx.getUserModule().findUsersFilteredByUserName("", 0, 10);
+
+ userNames = new HashSet();
+
+ for (Iterator iterator = set3.iterator(); iterator.hasNext();)
+ {
+ User u = (User)iterator.next();
+ userNames.add(u.getUserName());
+ }
+
+ Assert.assertTrue(userNames.contains("admin"));
+ Assert.assertTrue(userNames.contains("user1"));
+ Assert.assertTrue(userNames.contains("user2"));
+
+ //
+ Set set4 = ctx.getUserModule().findUsersFilteredByUserName("user1", 0, 10);
+
+
+ Iterator it = set4.iterator();
+ User user = (User)it.next();
+ Assert.assertEquals("user1", user.getUserName());
+ ctx.commit();
+ }
+
+ public void testFindUser1() throws Exception
+ {
+ populate();
+ ctx.begin();
+ User u1 = ctx.getUserModule().findUserByUserName("user1");
+ Assert.assertNotNull(u1);
+ Assert.assertEquals("user1", u1.getUserName());
+ Assert.assertNotNull(ctx.getMembershipModule().getRoles(u1));
+ Assert.assertEquals(1, ctx.getMembershipModule().getRoles(u1).size());
+ Assert.assertEquals("role1", ((Role)ctx.getMembershipModule().getRoles(u1).iterator().next()).getName());
+ Assert.assertEquals(u1.getId(), ctx.getUserModule().findUserById(u1.getId()).getId());
+ ctx.commit();
+ }
+
+ public void testFindUser2() throws Exception
+ {
+ populate();
+ ctx.begin();
+ Set roleNames = new HashSet(Arrays.asList(new Object[]{"role1", "role2"}));
+ User u2 = ctx.getUserModule().findUserByUserName("user2");
+ Assert.assertNotNull(u2);
+ Assert.assertEquals("user2", u2.getUserName());
+ Assert.assertNotNull(ctx.getMembershipModule().getRoles(u2));
+ Assert.assertEquals(2, ctx.getMembershipModule().getRoles(u2).size());
+ Iterator iterator = ctx.getMembershipModule().getRoles(u2).iterator();
+ Assert.assertTrue(roleNames.contains(((Role)iterator.next()).getName()));
+ Assert.assertTrue(roleNames.contains(((Role)iterator.next()).getName()));
+ Assert.assertEquals(u2.getId(), ctx.getUserModule().findUserById(u2.getId()).getId());
+ ctx.commit();
+ }
+
+ public void testFindUsers() throws Exception
+ {
+ populate();
+ ctx.begin();
+ Set c1 = ctx.getUserModule().findUsers(0, 1);
+ Assert.assertNotNull(c1);
+ Assert.assertEquals(1, c1.size());
+
+ Set c2 = ctx.getUserModule().findUsers(1, 1);
+ Assert.assertNotNull(c2);
+ Assert.assertEquals(1, c2.size());
+
+ Set c3 = ctx.getUserModule().findUsers(0, 2);
+ Assert.assertNotNull(c3);
+ Assert.assertEquals(2, c3.size());
+
+ Set s1 = new HashSet();
+ s1.add(((User)c1.iterator().next()).getUserName());
+ s1.add(((User)c2.iterator().next()).getUserName());
+ Set s2 = new HashSet();
+ Iterator iterator = c3.iterator();
+ s2.add(((User)iterator.next()).getUserName());
+ s2.add(((User)iterator.next()).getUserName());
+ Assert.assertEquals(s1, s2);
+ ctx.commit();
+ }
+
+ public void testCreateUser() throws Exception
+ {
+ populate();
+ ctx.begin();
+ User u3 = ctx.getUserModule().createUser("user3", "password");
+ Role g1 = ctx.getRoleModule().findRoleByName("role1");
+ ctx.getMembershipModule().assignRoles(u3, Collections.singleton(g1));
+ Assert.assertEquals("user3", u3.getUserName());
+ Assert.assertNotNull(ctx.getMembershipModule().getRoles(u3));
+ Assert.assertEquals(1, ctx.getMembershipModule().getRoles(u3).size());
+ Assert.assertEquals("role1", ((Role)ctx.getMembershipModule().getRoles(u3).iterator().next()).getName());
+ ctx.commit();
+
+ ctx.begin();
+ u3 = ctx.getUserModule().findUserByUserName("user3");
+ Assert.assertNotNull(u3);
+ Assert.assertEquals("user3", u3.getUserName());
+
+ //test if CachedUserImpl will be handled properly
+ u3 = new CachedUserImpl(u3.getId(), u3.getUserName());
+
+ Assert.assertNotNull(ctx.getMembershipModule().getRoles(u3));
+ Assert.assertEquals(1, ctx.getMembershipModule().getRoles(u3).size());
+ Assert.assertEquals("role1", ((Role)ctx.getMembershipModule().getRoles(u3).iterator().next()).getName());
+ ctx.commit();
+ }
+
+ // public void testCreateDuplicateUser() throws Exception
+ // {
+ // try
+ // {
+ // ctx.getUserModule().createUser("user1");
+ // fail("Expected exception on duplicate user");
+ // }
+ // catch (ModuleException expected)
+ // {
+ // }
+ // }
+
+ public void testCreateRole() throws Exception
+ {
+ populate();
+ ctx.begin();
+ Role g3 = ctx.getRoleModule().createRole("role3", "roleName");
+ Assert.assertEquals("role3", g3.getName());
+ ctx.commit();
+
+ ctx.begin();
+ g3 = ctx.getRoleModule().findRoleByName("role3");
+ Assert.assertNotNull(g3);
+ Assert.assertEquals("role3", g3.getName());
+ ctx.commit();
+ }
+
+ // public void testCreateDuplicateRole() throws Exception
+ // {
+ // try
+ // {
+ // ctx.getRoleModule().createRole("user1");
+ // fail("Expected exception on duplicate role");
+ // }
+ // catch (ModuleException expected)
+ // {
+ // }
+ // }
+
+ public void testCountUser() throws Exception
+ {
+ populate();
+ ctx.begin();
+ Assert.assertEquals(3, ctx.getUserModule().getUserCount());
+ ctx.commit();
+ }
+
+ public void testRemoveNonExistingRole() throws Exception
+ {
+ populate();
+ ctx.begin();
+ try
+ {
+ ctx.getRoleModule().removeRole(new Long(Long.MAX_VALUE));
+ Assert.fail("Expected exception");
+ }
+ catch (IdentityException expected)
+ {
+ }
+ ctx.commit();
+ }
+
+ public void testRemoveRole() throws Exception
+ {
+ populate();
+ ctx.begin();
+ Role g1 = ctx.getRoleModule().findRoleByName("role1");
+ Object id = g1.getId();
+ ctx.getRoleModule().removeRole(id);
+ try
+ {
+ ctx.getRoleModule().findRoleById(id);
+ Assert.fail("Expected exception");
+ }
+ catch (IdentityException expected)
+ {
+ }
+ ctx.commit();
+
+ ctx.begin();
+ try
+ {
+ ctx.getRoleModule().findRoleById(id);
+ Assert.fail("Expected exception");
+ }
+ catch (IdentityException expected)
+ {
+ }
+ User u1 = ctx.getUserModule().findUserByUserName("user1");
+ Assert.assertNotNull(u1);
+ Assert.assertEquals("user1", u1.getUserName());
+ ctx.commit();
+ }
+
+ public void testRemoveUser() throws Exception
+ {
+ populate();
+ ctx.begin();
+ User u1 = ctx.getUserModule().findUserByUserName("user1");
+ Object id = u1.getId();
+ ctx.getUserModule().removeUser(id);
+ try
+ {
+ ctx.getUserModule().findUserById(id);
+ Assert.fail("Expected exception");
+ }
+ catch (IdentityException expected)
+ {
+ }
+ ctx.commit();
+
+ ctx.begin();
+ try
+ {
+ ctx.getUserModule().findUserById(id);
+ Assert.fail("Expected exception");
+ }
+ catch (IdentityException expected)
+ {
+ }
+ Role g1 = ctx.getRoleModule().findRoleByName("role1");
+ Assert.assertNotNull(g1);
+ Assert.assertEquals("role1", g1.getName());
+ Role g2 = ctx.getRoleModule().findRoleByName("role2");
+ Assert.assertNotNull(g2);
+ Assert.assertEquals("role2", g2.getName());
+ ctx.commit();
+
+ ctx.begin();
+
+ try
+ {
+ ctx.getUserModule().removeUser(new Long(9999999));
+ Assert.fail();
+ }
+ catch (IdentityException e)
+ {
+ //expected
+ }
+
+ ctx.commit();
+ }
+
+ public void testFindRoles() throws Exception
+ {
+ populate();
+ ctx.begin();
+ Set roleNames = new HashSet(Arrays.asList(new Object[]{"role1", "role2"}));
+ Set roles = ctx.getRoleModule().findRoles();
+
+ Assert.assertEquals(2, roles.size());
+ Iterator iterator = roles.iterator();
+ Assert.assertTrue(roleNames.contains(((Role)iterator.next()).getName()));
+ Assert.assertTrue(roleNames.contains(((Role)iterator.next()).getName()));
+ ctx.commit();
+ }
+
+ public void testFindRoleMembers() throws Exception
+ {
+ populate();
+ ctx.begin();
+ Set set1 = ctx.getMembershipModule().findRoleMembers("role1", 0, 10, "user");
+
+ Set userNames = new HashSet();
+
+ for (Iterator iterator = set1.iterator(); iterator.hasNext();)
+ {
+ User u = (User)iterator.next();
+ userNames.add(u.getUserName());
+ }
+
+ Assert.assertTrue(userNames.contains("user1"));
+ Assert.assertTrue(userNames.contains("user2"));
+
+
+
+ //
+ Set set2 = ctx.getMembershipModule().findRoleMembers("role1", 0, 10, "blah");
+ Assert.assertEquals(0, set2.size());
+
+ //
+ Set set3 = ctx.getMembershipModule().findRoleMembers("role1", 0, 10, "");
+
+ userNames = new HashSet();
+
+ for (Iterator iterator = set3.iterator(); iterator.hasNext();)
+ {
+ User u = (User)iterator.next();
+ userNames.add(u.getUserName());
+ }
+
+ Assert.assertTrue(userNames.contains("user1"));
+ Assert.assertTrue(userNames.contains("user2"));
+ Assert.assertTrue(userNames.contains("admin"));
+
+
+ //
+ Set set4 = ctx.getMembershipModule().findRoleMembers("role1", 0, 10, "user1");
+ Iterator i = set4.iterator();
+ User user = (User)i.next();
+ Assert.assertEquals("user1", user.getUserName());
+
+ ctx.commit();
+ }
+
+ public void testNonStandardUserNames() throws Exception
+ {
+ populate();
+ ctx.begin();
+
+ Role role = ctx.getRoleModule().createRole("TestRole", "DisplayName");
+
+ Set users = new HashSet();
+
+ User user = ctx.getUserModule().createUser("user, Test", "password");
+ users.add(user);
+ user = ctx.getUserModule().createUser("user1, Test", "password");
+ users.add(user);
+ user = ctx.getUserModule().createUser("user2, Test", "password");
+ users.add(user);
+
+ //
+
+ //create names with RFC 2253 exceptions
+ user = ctx.getUserModule().createUser("test ++", "password");
+ users.add(user);
+ //user = ctx.getUserModule().createUser("test \"", "password");
+ users.add(user);
+ //ctx.getUserModule().createUser("test \\", "password");
+ //users.add(user);
+ user = ctx.getUserModule().createUser("test <", "password");
+ users.add(user);
+ user = ctx.getUserModule().createUser("test >", "password");
+ users.add(user);
+ user = ctx.getUserModule().createUser("test ;", "password");
+ users.add(user);
+
+ ctx.getMembershipModule().assignUsers(role, users);
+
+ ctx.commit();
+
+ ctx.begin();
+
+ role = ctx.getRoleModule().findRoleByName("TestRole");
+
+ users = ctx.getMembershipModule().getUsers(role);
+
+ Assert.assertEquals(7, users.size());
+
+ Assert.assertNotNull(ctx.getUserModule().findUserByUserName("user, Test"));
+ Assert.assertNotNull(ctx.getUserModule().findUserByUserName("user1, Test"));
+ Assert.assertNotNull(ctx.getUserModule().findUserByUserName("user2, Test"));
+
+ Assert.assertNotNull(ctx.getUserModule().findUserByUserName("test ++"));
+ //assertNotNull(ctx.getUserModule().findUserByUserName("test \""));
+ //assertNotNull(ctx.getUserModule().findUserByUserName("test \\"));
+ Assert.assertNotNull(ctx.getUserModule().findUserByUserName("test <"));
+ Assert.assertNotNull(ctx.getUserModule().findUserByUserName("test >"));
+ Assert.assertNotNull(ctx.getUserModule().findUserByUserName("test ;"));
+
+ ctx.commit();
+ }
+
+ public void testDynamicProperty() throws Exception
+ {
+ populate();
+ ctx.begin();
+ /*User user = ctx.getUserModule().createUser("testname", "testpassword");
+ Map map = ctx.getUserProfileModule().getProperties(user);
+ assertNull(map.get("foo"));
+ //assertFalse(map.isReadOnly("foo"));
+ map.put("foo", "value");
+ assertEquals("value", map.get("foo"));
+ //assertFalse(map.isReadOnly("foo"));
+ ctx.commit();
+
+ ctx.begin();
+ user = ctx.getUserModule().findUserByUserName("testname");
+ map = ctx.getUserProfileModule().getProperties(user);
+ assertEquals("value", map.get("foo"));
+ //assertFalse(map.isReadOnly("foo"));*/
+ ctx.commit();
+ }
+
+ public void testStaticProperty() throws Exception
+ {
+ populate();
+ ctx.begin();
+
+ //
+ User user = ctx.getUserModule().createUser("testname", "testpassword");
+
+ //test if CachedUserImpl is handled properly
+ user = new CachedUserImpl(user.getId(), user.getUserName());
+
+ Map map = ctx.getUserProfileModule().getProperties(user);
+ //assertEquals("testname", map.get(P3PConstants.INFO_USER_NAME_NICKNAME));
+
+ // Test cannot remove property
+ try
+ {
+ map.remove(P3PConstants.INFO_USER_NAME_GIVEN);
+ Assert.fail("Should not be able to remove property from a map");
+ }
+ catch (Exception expected)
+ {
+ }
+
+ /*// Test read only property
+ //assertTrue(map.isReadOnly(P3PConstants.INFO_USER_NAME_NICKNAME));
+ try
+ {
+ .put(P3PConstants.INFO_USER_NAME_NICKNAME, "anothername");
+ fail("Should not be capable to modify a read only static property");
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }*/
+
+ // Test non nullable and writable property
+ /*try
+ {
+ map.put(User.INFO_USER_VIEW_EMAIL_VIEW_REAL, null);
+ fail("Should not be capable to nullify a non nullable static property");
+ }
+ catch (NullPointerException expected)
+ {
+ }*/
+ //map.put(User.INFO_USER_VIEW_EMAIL_VIEW_REAL, "true");
+ ctx.getUserProfileModule().setProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL, Boolean.TRUE);
+ Assert.assertEquals(Boolean.TRUE.toString(), ctx.getUserProfileModule().getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL).toString());
+
+ // Test boolean property
+ ctx.getUserProfileModule().setProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL, Boolean.FALSE);
+ //assertEquals(Boolean.FALSE.toString(), map.get(User.INFO_USER_VIEW_EMAIL_VIEW_REAL).toString());
+ Assert.assertEquals(Boolean.FALSE.toString(), ctx.getUserProfileModule().getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL).toString());
+
+ ctx.getUserProfileModule().setProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL, Boolean.TRUE);
+ //assertEquals(Boolean.TRUE.toString(), map.get(User.INFO_USER_VIEW_EMAIL_VIEW_REAL).toString());
+ Assert.assertEquals(Boolean.TRUE.toString(), ctx.getUserProfileModule().getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL).toString());
+
+ ctx.getUserProfileModule().setProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL, Boolean.FALSE);
+ //assertEquals(Boolean.FALSE.toString(), map.get(User.INFO_USER_VIEW_EMAIL_VIEW_REAL).toString());
+ Assert.assertEquals(Boolean.FALSE.toString(), ctx.getUserProfileModule().getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL).toString());
+
+ ctx.getUserProfileModule().setProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL, Boolean.TRUE);
+ //assertEquals(Boolean.TRUE.toString(), map.get(User.INFO_USER_VIEW_EMAIL_VIEW_REAL).toString());
+ Assert.assertEquals(Boolean.TRUE.toString(), ctx.getUserProfileModule().getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL).toString());
+ try
+ {
+ ctx.getUserProfileModule().setProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL, "true");
+ Assert.fail("Should not be capable to set a bad value to boolean property");
+ }
+ catch (Exception expected)
+ {
+ }
+
+ // Test date
+ //Date date = ((HibernateUserImpl)user.getRegistrationDate();
+ Date date = (Date)ctx.getUserProfileModule().getProperty(user, User.INFO_USER_REGISTRATION_DATE);
+
+ // property mapped as java.util.Date \
+ try
+ {
+ ctx.getUserProfileModule().setProperty(user, User.INFO_USER_REGISTRATION_DATE, new Date());
+ Assert.fail();
+ }
+ catch (IdentityException e)
+ {
+ // should fail on read-only property
+ }
+
+ //just to check the cast...
+ date = (Date)ctx.getUserProfileModule().getProperty(user, User.INFO_USER_REGISTRATION_DATE);
+
+ // properties mapped in ldap (if ldap module present and delegated)
+ ctx.getUserProfileModule().setProperty(user, User.INFO_USER_OCCUPATION, "portal developer");
+ String occup = (String)ctx.getUserProfileModule().getProperty(user, User.INFO_USER_OCCUPATION);
+ Assert.assertEquals("portal developer", occup);
+
+ ctx.getUserProfileModule().setProperty(user, User.INFO_USER_EMAIL_REAL, "dev(a)portal.com");
+ String email = (String)ctx.getUserProfileModule().getProperty(user, User.INFO_USER_EMAIL_REAL);
+ Assert.assertEquals("dev(a)portal.com", email);
+
+ //property mapped as java.lang.Boolean
+ ctx.getUserProfileModule().setProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL, Boolean.TRUE);
+
+ Boolean view = (Boolean)ctx.getUserProfileModule().getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL);
+ Assert.assertEquals(Boolean.TRUE.toString(),view.toString());
+
+ ctx.commit();
+ }
+
+ public void testNullProperty() throws Exception
+ {
+ populate();
+ ctx.begin();
+
+ User user = ctx.getUserModule().createUser("testname", "testpassword");
+
+ ctx.getUserProfileModule().setProperty(user, User.INFO_USER_THEME, "some theme value");
+
+ Object o = ctx.getUserProfileModule().getProperty(user, User.INFO_USER_THEME);
+
+ Assert.assertNotNull(o);
+ Assert.assertEquals(o.toString(), "some theme value");
+
+ ctx.getUserProfileModule().setProperty(user, User.INFO_USER_THEME, null);
+
+ o = ctx.getUserProfileModule().getProperty(user, User.INFO_USER_THEME);
+
+ Assert.assertNull(o);
+
+ ctx.commit();
+
+ }
+
+ public void testFindUserRoles() throws Exception
+ {
+ populate();
+ ctx.begin();
+
+
+ ctx.commit();
+ }
+
+ public void testGetProperties() throws Exception
+ {
+ populate();
+ ctx.begin();
+
+ User user = ctx.getUserModule().createUser("testname", "testpassword");
+
+ // Set few properties for both LDAP and DB mappings
+ //ctx.getUserProfileModule().setProperty(user, "user.name.nickName", "blah");
+ ctx.getUserProfileModule().setProperty(user, "user.name.family", "blah");
+ ctx.getUserProfileModule().setProperty(user, "user.name.given", "blah");
+
+ //LDAP
+ ctx.getUserProfileModule().setProperty(user, "user.business-info.online.email", "blah");
+ ctx.getUserProfileModule().setProperty(user, "portal.user.occupation", "blah");
+
+ // Check if they exist - should be merged
+ Map props = ctx.getUserProfileModule().getProperties(user);
+
+
+ //assertTrue(props.containsKey("user.name.nickName"));
+ Assert.assertTrue(props.containsKey("user.name.family"));
+ Assert.assertTrue(props.containsKey("user.name.given"));
+ Assert.assertTrue(props.containsKey("user.business-info.online.email"));
+ Assert.assertTrue(props.containsKey("portal.user.occupation"));
+
+
+ ctx.commit();
+ }
+
+
+ public void testFindUsers2() throws Exception
+ {
+ populate();
+ ctx.begin();
+
+ ctx.getUserModule().createUser("test1", "test1");
+ ctx.getUserModule().createUser("test2", "test2");
+ ctx.getUserModule().createUser("test3", "test3");
+ ctx.getUserModule().createUser("test4", "test4");
+ ctx.getUserModule().createUser("test5", "test5");
+ ctx.getUserModule().createUser("test6", "test6");
+ ctx.getUserModule().createUser("test7", "testx");
+ ctx.getUserModule().createUser("test8", "testx");
+
+
+ Assert.assertEquals(11, ctx.getUserModule().getUserCount());
+
+ Set users = ctx.getUserModule().findUsers(0, 4);
+
+ Assert.assertEquals(4, users.size());
+
+ users = ctx.getUserModule().findUsers(0, 10);
+
+ Assert.assertEquals(10, users.size());
+
+ users = ctx.getUserModule().findUsers(10,1);
+
+ Assert.assertEquals(1, users.size());
+
+ users = ctx.getUserModule().findUsers(10,10);
+
+ Assert.assertEquals(1, users.size());
+
+ users = ctx.getUserModule().findUsers(10,20);
+
+ Assert.assertEquals(1, users.size());
+
+ ctx.getUserModule().createUser("test9", "testx");
+ ctx.getUserModule().createUser("test10", "testx");
+ ctx.getUserModule().createUser("test11", "testx");
+ ctx.getUserModule().createUser("test12", "testx");
+ ctx.getUserModule().createUser("test13", "testx");
+ ctx.getUserModule().createUser("test14", "testx");
+ ctx.getUserModule().createUser("test15", "testx");
+ ctx.getUserModule().createUser("test16", "testx");
+ ctx.getUserModule().createUser("test17", "testx");
+ ctx.getUserModule().createUser("test18", "testx");
+ ctx.getUserModule().createUser("test19", "testx");
+ ctx.getUserModule().createUser("test20", "testx");
+ ctx.getUserModule().createUser("test21", "testx");
+ ctx.getUserModule().createUser("test22", "testx");
+ ctx.getUserModule().createUser("test23", "testx");
+
+ Assert.assertEquals(26, ctx.getUserModule().getUserCount());
+
+ users = ctx.getUserModule().findUsers(10, 10);
+
+ Assert.assertEquals(10, users.size());
+
+ users = ctx.getUserModule().findUsers(20, 1);
+
+ Assert.assertEquals(1, users.size());
+
+ users = ctx.getUserModule().findUsers(20, 6);
+
+ Assert.assertEquals(6, users.size());
+
+ users = ctx.getUserModule().findUsers(20, 10);
+
+ Assert.assertEquals(6, users.size());
+ ctx.commit();
+ }
+
+
+
+
+
+//
+ public void populate() throws Exception
+ {
+ ctx.begin();
+ User admin = ctx.getUserModule().createUser("admin", "");
+ User u1 = ctx.getUserModule().createUser("user1", "");
+ User u2 = ctx.getUserModule().createUser("user2", "");
+ Role g1 = ctx.getRoleModule().createRole("role1", "role1");
+ Role g2 = ctx.getRoleModule().createRole("role2", "role2");
+ ctx.getMembershipModule().assignRoles(u1, Collections.singleton(g1));
+ ctx.getMembershipModule().assignRoles(u2, new CollectionBuilder().add(g1).add(g2).toHashSet());
+ ctx.getMembershipModule().assignRoles(admin, new CollectionBuilder().add(g1).add(g2).toHashSet());
+ ctx.commit();
+ }
+
+
+
+
+
+ public interface Context
+ {
+ void begin();
+
+ void commit();
+
+ public UserModule getUserModule();
+
+ public RoleModule getRoleModule();
+
+ public MembershipModule getMembershipModule();
+
+ public UserProfileModule getUserProfileModule();
+ }
+}
Added: modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/GenericTestPOJO.java
===================================================================
--- modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/GenericTestPOJO.java (rev 0)
+++ modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/GenericTestPOJO.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -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.portal.test.identity;
+
+import static org.jboss.unit.api.Assert.*;
+import org.jboss.unit.api.pojo.annotations.Test;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class GenericTestPOJO extends IdentityTestPOJO implements GenericTest.Context
+{
+ protected GenericTest genericTest = new GenericTest(this);
+
+ public void begin()
+ {
+ getHibernateSupport().openSession();
+ }
+
+ public void commit()
+ {
+ assertTrue(getHibernateSupport().commitTransaction());
+ }
+
+
+
+}
Deleted: modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/IdentityTest.java
===================================================================
--- modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/IdentityTest.java 2007-10-17 11:11:09 UTC (rev 8674)
+++ modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/IdentityTest.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -1,747 +0,0 @@
-package org.jboss.portal.test.identity;
-
-import junit.framework.Assert;
-import org.jboss.portal.identity.UserModule;
-import org.jboss.portal.identity.RoleModule;
-import org.jboss.portal.identity.MembershipModule;
-import org.jboss.portal.identity.UserProfileModule;
-import org.jboss.portal.identity.User;
-import org.jboss.portal.identity.Role;
-import org.jboss.portal.identity.IdentityException;
-import org.jboss.portal.identity.ProfileMap;
-import org.jboss.portal.identity.NoSuchUserException;
-import org.jboss.portal.identity.CachedUserImpl;
-import org.jboss.portal.common.util.CollectionBuilder;
-import org.jboss.portal.common.p3p.P3PConstants;
-
-import java.util.Set;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Map;
-import java.util.Date;
-import java.text.SimpleDateFormat;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class IdentityTest extends Assert
-{
-
- /** . */
- private UserModule userModule;
-
- /** . */
- private RoleModule roleModule;
-
- /** . */
- private MembershipModule membershipModule;
-
- /** . */
- private UserProfileModule userProfileModule;
-
-
- /** . */
- private IdentityTest.Context ctx;
-
- public void setUserModule(UserModule userModule)
- {
- this.userModule = userModule;
- }
-
- public void setRoleModule(RoleModule roleModule)
- {
- this.roleModule = roleModule;
- }
-
- public void setMembershipModule(MembershipModule membershipModule)
- {
- this.membershipModule = membershipModule;
- }
-
- public void setUserProfileModule(UserProfileModule userProfileModule)
- {
- this.userProfileModule = userProfileModule;
- }
-
- public void setContext(IdentityTest.Context ctx)
- {
- this.ctx = ctx;
- }
-
- public void testFindUsersUsingFilter() throws Exception
- {
- ctx.begin();
- Set set1 = userModule.findUsersFilteredByUserName("user", 0, 10);
-
-
- Set userNames = new HashSet();
-
- for (Iterator iterator = set1.iterator(); iterator.hasNext();)
- {
- User u = (User)iterator.next();
- userNames.add(u.getUserName());
- }
-
- assertTrue(userNames.contains("user1"));
- assertTrue(userNames.contains("user2"));
-
-
- //
- Set set2 = userModule.findUsersFilteredByUserName("blah", 0, 10);
- assertEquals(0, set2.size());
-
- //
- Set set3 = userModule.findUsersFilteredByUserName("", 0, 10);
-
- userNames = new HashSet();
-
- for (Iterator iterator = set3.iterator(); iterator.hasNext();)
- {
- User u = (User)iterator.next();
- userNames.add(u.getUserName());
- }
-
- assertTrue(userNames.contains("admin"));
- assertTrue(userNames.contains("user1"));
- assertTrue(userNames.contains("user2"));
-
- //
- Set set4 = userModule.findUsersFilteredByUserName("user1", 0, 10);
-
-
- Iterator it = set4.iterator();
- User user = (User)it.next();
- assertEquals("user1", user.getUserName());
- ctx.commit();
- }
-
- public void testFindUser1() throws Exception
- {
- ctx.begin();
- User u1 = userModule.findUserByUserName("user1");
- assertNotNull(u1);
- Assert.assertEquals("user1", u1.getUserName());
- assertNotNull(membershipModule.getRoles(u1));
- Assert.assertEquals(1, membershipModule.getRoles(u1).size());
- Assert.assertEquals("role1", ((Role)membershipModule.getRoles(u1).iterator().next()).getName());
- Assert.assertEquals(u1.getId(), userModule.findUserById(u1.getId()).getId());
- ctx.commit();
- }
-
- public void testFindUser2() throws Exception
- {
- ctx.begin();
- Set roleNames = new HashSet(Arrays.asList(new Object[]{"role1", "role2"}));
- User u2 = userModule.findUserByUserName("user2");
- assertNotNull(u2);
- Assert.assertEquals("user2", u2.getUserName());
- assertNotNull(membershipModule.getRoles(u2));
- Assert.assertEquals(2, membershipModule.getRoles(u2).size());
- Iterator iterator = membershipModule.getRoles(u2).iterator();
- assertTrue(roleNames.contains(((Role)iterator.next()).getName()));
- assertTrue(roleNames.contains(((Role)iterator.next()).getName()));
- Assert.assertEquals(u2.getId(), userModule.findUserById(u2.getId()).getId());
- ctx.commit();
- }
-
- public void testFindUsers() throws Exception
- {
- ctx.begin();
- Set c1 = userModule.findUsers(0, 1);
- assertNotNull(c1);
- assertEquals(1, c1.size());
-
- Set c2 = userModule.findUsers(1, 1);
- assertNotNull(c2);
- assertEquals(1, c2.size());
-
- Set c3 = userModule.findUsers(0, 2);
- assertNotNull(c3);
- assertEquals(2, c3.size());
-
- Set s1 = new HashSet();
- s1.add(((User)c1.iterator().next()).getUserName());
- s1.add(((User)c2.iterator().next()).getUserName());
- Set s2 = new HashSet();
- Iterator iterator = c3.iterator();
- s2.add(((User)iterator.next()).getUserName());
- s2.add(((User)iterator.next()).getUserName());
- assertEquals(s1, s2);
- ctx.commit();
- }
-
- public void testCreateUser() throws Exception
- {
- ctx.begin();
- User u3 = userModule.createUser("user3", "password");
- Role g1 = roleModule.findRoleByName("role1");
- membershipModule.assignRoles(u3, Collections.singleton(g1));
- Assert.assertEquals("user3", u3.getUserName());
- assertNotNull(membershipModule.getRoles(u3));
- Assert.assertEquals(1, membershipModule.getRoles(u3).size());
- Assert.assertEquals("role1", ((Role)membershipModule.getRoles(u3).iterator().next()).getName());
- ctx.commit();
-
- ctx.begin();
- u3 = userModule.findUserByUserName("user3");
- assertNotNull(u3);
- Assert.assertEquals("user3", u3.getUserName());
-
- //test if CachedUserImpl will be handled properly
- u3 = new CachedUserImpl(u3.getId(), u3.getUserName());
-
- assertNotNull(membershipModule.getRoles(u3));
- Assert.assertEquals(1, membershipModule.getRoles(u3).size());
- Assert.assertEquals("role1", ((Role)membershipModule.getRoles(u3).iterator().next()).getName());
- ctx.commit();
- }
-
- // public void testCreateDuplicateUser() throws Exception
- // {
- // try
- // {
- // userModule.createUser("user1");
- // fail("Expected exception on duplicate user");
- // }
- // catch (ModuleException expected)
- // {
- // }
- // }
-
- public void testCreateRole() throws Exception
- {
- ctx.begin();
- Role g3 = roleModule.createRole("role3", "roleName");
- Assert.assertEquals("role3", g3.getName());
- ctx.commit();
-
- ctx.begin();
- g3 = roleModule.findRoleByName("role3");
- assertNotNull(g3);
- Assert.assertEquals("role3", g3.getName());
- ctx.commit();
- }
-
- // public void testCreateDuplicateRole() throws Exception
- // {
- // try
- // {
- // roleModule.createRole("user1");
- // fail("Expected exception on duplicate role");
- // }
- // catch (ModuleException expected)
- // {
- // }
- // }
-
- public void testCountUser() throws Exception
- {
- ctx.begin();
- Assert.assertEquals(3, userModule.getUserCount());
- ctx.commit();
- }
-
- public void testRemoveNonExistingRole() throws Exception
- {
- ctx.begin();
- try
- {
- roleModule.removeRole(new Long(Long.MAX_VALUE));
- fail("Expected exception");
- }
- catch (IdentityException expected)
- {
- }
- ctx.commit();
- }
-
- public void testRemoveRole() throws Exception
- {
- ctx.begin();
- Role g1 = roleModule.findRoleByName("role1");
- Object id = g1.getId();
- roleModule.removeRole(id);
- try
- {
- roleModule.findRoleById(id);
- fail("Expected exception");
- }
- catch (IdentityException expected)
- {
- }
- ctx.commit();
-
- ctx.begin();
- try
- {
- roleModule.findRoleById(id);
- fail("Expected exception");
- }
- catch (IdentityException expected)
- {
- }
- User u1 = userModule.findUserByUserName("user1");
- assertNotNull(u1);
- Assert.assertEquals("user1", u1.getUserName());
- ctx.commit();
- }
-
- public void testRemoveUser() throws Exception
- {
- ctx.begin();
- User u1 = userModule.findUserByUserName("user1");
- Object id = u1.getId();
- userModule.removeUser(id);
- try
- {
- userModule.findUserById(id);
- fail("Expected exception");
- }
- catch (IdentityException expected)
- {
- }
- ctx.commit();
-
- ctx.begin();
- try
- {
- userModule.findUserById(id);
- fail("Expected exception");
- }
- catch (IdentityException expected)
- {
- }
- Role g1 = roleModule.findRoleByName("role1");
- assertNotNull(g1);
- Assert.assertEquals("role1", g1.getName());
- Role g2 = roleModule.findRoleByName("role2");
- assertNotNull(g2);
- Assert.assertEquals("role2", g2.getName());
- ctx.commit();
-
- ctx.begin();
-
- try
- {
- userModule.removeUser(new Long(9999999));
- fail();
- }
- catch (IdentityException e)
- {
- //expected
- }
-
- ctx.commit();
- }
-
- public void testFindRoles() throws Exception
- {
- ctx.begin();
- Set roleNames = new HashSet(Arrays.asList(new Object[]{"role1", "role2"}));
- Set roles = roleModule.findRoles();
-
- assertEquals(2, roles.size());
- Iterator iterator = roles.iterator();
- assertTrue(roleNames.contains(((Role)iterator.next()).getName()));
- assertTrue(roleNames.contains(((Role)iterator.next()).getName()));
- ctx.commit();
- }
-
- public void testFindRoleMembers() throws Exception
- {
- ctx.begin();
- Set set1 = membershipModule.findRoleMembers("role1", 0, 10, "user");
-
- Set userNames = new HashSet();
-
- for (Iterator iterator = set1.iterator(); iterator.hasNext();)
- {
- User u = (User)iterator.next();
- userNames.add(u.getUserName());
- }
-
- assertTrue(userNames.contains("user1"));
- assertTrue(userNames.contains("user2"));
-
-
-
- //
- Set set2 = membershipModule.findRoleMembers("role1", 0, 10, "blah");
- assertEquals(0, set2.size());
-
- //
- Set set3 = membershipModule.findRoleMembers("role1", 0, 10, "");
-
- userNames = new HashSet();
-
- for (Iterator iterator = set3.iterator(); iterator.hasNext();)
- {
- User u = (User)iterator.next();
- userNames.add(u.getUserName());
- }
-
- assertTrue(userNames.contains("user1"));
- assertTrue(userNames.contains("user2"));
- assertTrue(userNames.contains("admin"));
-
-
- //
- Set set4 = membershipModule.findRoleMembers("role1", 0, 10, "user1");
- Iterator i = set4.iterator();
- User user = (User)i.next();
- assertEquals("user1", user.getUserName());
-
- ctx.commit();
- }
-
- public void testNonStandardUserNames() throws Exception
- {
- ctx.begin();
-
- Role role = roleModule.createRole("TestRole", "DisplayName");
-
- Set users = new HashSet();
-
- User user = userModule.createUser("user, Test", "password");
- users.add(user);
- user = userModule.createUser("user1, Test", "password");
- users.add(user);
- user = userModule.createUser("user2, Test", "password");
- users.add(user);
-
- //
-
- //create names with RFC 2253 exceptions
- user = userModule.createUser("test ++", "password");
- users.add(user);
- //user = userModule.createUser("test \"", "password");
- users.add(user);
- //userModule.createUser("test \\", "password");
- //users.add(user);
- user = userModule.createUser("test <", "password");
- users.add(user);
- user = userModule.createUser("test >", "password");
- users.add(user);
- user = userModule.createUser("test ;", "password");
- users.add(user);
-
- membershipModule.assignUsers(role, users);
-
- ctx.commit();
-
- ctx.begin();
-
- role = roleModule.findRoleByName("TestRole");
-
- users = membershipModule.getUsers(role);
-
- assertEquals(7, users.size());
-
- assertNotNull(userModule.findUserByUserName("user, Test"));
- assertNotNull(userModule.findUserByUserName("user1, Test"));
- assertNotNull(userModule.findUserByUserName("user2, Test"));
-
- assertNotNull(userModule.findUserByUserName("test ++"));
- //assertNotNull(userModule.findUserByUserName("test \""));
- //assertNotNull(userModule.findUserByUserName("test \\"));
- assertNotNull(userModule.findUserByUserName("test <"));
- assertNotNull(userModule.findUserByUserName("test >"));
- assertNotNull(userModule.findUserByUserName("test ;"));
-
- ctx.commit();
- }
-
- public void testDynamicProperty() throws Exception
- {
- ctx.begin();
- /*User user = userModule.createUser("testname", "testpassword");
- Map map = userProfileModule.getProperties(user);
- assertNull(map.get("foo"));
- //assertFalse(map.isReadOnly("foo"));
- map.put("foo", "value");
- assertEquals("value", map.get("foo"));
- //assertFalse(map.isReadOnly("foo"));
- ctx.commit();
-
- ctx.begin();
- user = userModule.findUserByUserName("testname");
- map = userProfileModule.getProperties(user);
- assertEquals("value", map.get("foo"));
- //assertFalse(map.isReadOnly("foo"));*/
- ctx.commit();
- }
-
- public void testStaticProperty() throws Exception
- {
- ctx.begin();
-
- //
- User user = userModule.createUser("testname", "testpassword");
-
- //test if CachedUserImpl is handled properly
- user = new CachedUserImpl(user.getId(), user.getUserName());
-
- Map map = userProfileModule.getProperties(user);
- //assertEquals("testname", map.get(P3PConstants.INFO_USER_NAME_NICKNAME));
-
- // Test cannot remove property
- try
- {
- map.remove(P3PConstants.INFO_USER_NAME_GIVEN);
- fail("Should not be able to remove property from a map");
- }
- catch (Exception expected)
- {
- }
-
- /*// Test read only property
- //assertTrue(map.isReadOnly(P3PConstants.INFO_USER_NAME_NICKNAME));
- try
- {
- .put(P3PConstants.INFO_USER_NAME_NICKNAME, "anothername");
- fail("Should not be capable to modify a read only static property");
- }
- catch (IllegalArgumentException expected)
- {
- }*/
-
- // Test non nullable and writable property
- /*try
- {
- map.put(User.INFO_USER_VIEW_EMAIL_VIEW_REAL, null);
- fail("Should not be capable to nullify a non nullable static property");
- }
- catch (NullPointerException expected)
- {
- }*/
- //map.put(User.INFO_USER_VIEW_EMAIL_VIEW_REAL, "true");
- userProfileModule.setProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL, Boolean.TRUE);
- assertEquals(Boolean.TRUE.toString(), userProfileModule.getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL).toString());
-
- // Test boolean property
- userProfileModule.setProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL, Boolean.FALSE);
- //assertEquals(Boolean.FALSE.toString(), map.get(User.INFO_USER_VIEW_EMAIL_VIEW_REAL).toString());
- assertEquals(Boolean.FALSE.toString(), userProfileModule.getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL).toString());
-
- userProfileModule.setProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL, Boolean.TRUE);
- //assertEquals(Boolean.TRUE.toString(), map.get(User.INFO_USER_VIEW_EMAIL_VIEW_REAL).toString());
- assertEquals(Boolean.TRUE.toString(), userProfileModule.getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL).toString());
-
- userProfileModule.setProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL, Boolean.FALSE);
- //assertEquals(Boolean.FALSE.toString(), map.get(User.INFO_USER_VIEW_EMAIL_VIEW_REAL).toString());
- assertEquals(Boolean.FALSE.toString(), userProfileModule.getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL).toString());
-
- userProfileModule.setProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL, Boolean.TRUE);
- //assertEquals(Boolean.TRUE.toString(), map.get(User.INFO_USER_VIEW_EMAIL_VIEW_REAL).toString());
- assertEquals(Boolean.TRUE.toString(), userProfileModule.getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL).toString());
- try
- {
- userProfileModule.setProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL, "true");
- fail("Should not be capable to set a bad value to boolean property");
- }
- catch (Exception expected)
- {
- }
-
- // Test date
- //Date date = ((HibernateUserImpl)user.getRegistrationDate();
- Date date = (Date)userProfileModule.getProperty(user, User.INFO_USER_REGISTRATION_DATE);
-
- // property mapped as java.util.Date \
- try
- {
- userProfileModule.setProperty(user, User.INFO_USER_REGISTRATION_DATE, new Date());
- fail();
- }
- catch (IdentityException e)
- {
- // should fail on read-only property
- }
-
- //just to check the cast...
- date = (Date)userProfileModule.getProperty(user, User.INFO_USER_REGISTRATION_DATE);
-
- // properties mapped in ldap (if ldap module present and delegated)
- userProfileModule.setProperty(user, User.INFO_USER_OCCUPATION, "portal developer");
- String occup = (String)userProfileModule.getProperty(user, User.INFO_USER_OCCUPATION);
- assertEquals("portal developer", occup);
-
- userProfileModule.setProperty(user, User.INFO_USER_EMAIL_REAL, "dev(a)portal.com");
- String email = (String)userProfileModule.getProperty(user, User.INFO_USER_EMAIL_REAL);
- assertEquals("dev(a)portal.com", email);
-
- //property mapped as java.lang.Boolean
- userProfileModule.setProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL, Boolean.TRUE);
-
- Boolean view = (Boolean)userProfileModule.getProperty(user, User.INFO_USER_VIEW_EMAIL_VIEW_REAL);
- assertEquals(Boolean.TRUE.toString(),view.toString());
-
- ctx.commit();
- }
-
- public void testNullProperty() throws Exception
- {
- ctx.begin();
-
- User user = userModule.createUser("testname", "testpassword");
-
- userProfileModule.setProperty(user, User.INFO_USER_THEME, "some theme value");
-
- Object o = userProfileModule.getProperty(user, User.INFO_USER_THEME);
-
- assertNotNull(o);
- assertEquals(o.toString(), "some theme value");
-
- userProfileModule.setProperty(user, User.INFO_USER_THEME, null);
-
- o = userProfileModule.getProperty(user, User.INFO_USER_THEME);
-
- assertNull(o);
-
- ctx.commit();
-
- }
-
- public void testFindUserRoles() throws Exception
- {
- ctx.begin();
-
-
- ctx.commit();
- }
-
- public void testGetProperties() throws Exception
- {
- ctx.begin();
-
- User user = userModule.createUser("testname", "testpassword");
-
- // Set few properties for both LDAP and DB mappings
- //userProfileModule.setProperty(user, "user.name.nickName", "blah");
- userProfileModule.setProperty(user, "user.name.family", "blah");
- userProfileModule.setProperty(user, "user.name.given", "blah");
-
- //LDAP
- userProfileModule.setProperty(user, "user.business-info.online.email", "blah");
- userProfileModule.setProperty(user, "portal.user.occupation", "blah");
-
- // Check if they exist - should be merged
- Map props = userProfileModule.getProperties(user);
-
-
- //assertTrue(props.containsKey("user.name.nickName"));
- assertTrue(props.containsKey("user.name.family"));
- assertTrue(props.containsKey("user.name.given"));
- assertTrue(props.containsKey("user.business-info.online.email"));
- assertTrue(props.containsKey("portal.user.occupation"));
-
-
- ctx.commit();
- }
-
-
- public void testFindUsers2() throws Exception
- {
- ctx.begin();
-
- userModule.createUser("test1", "test1");
- userModule.createUser("test2", "test2");
- userModule.createUser("test3", "test3");
- userModule.createUser("test4", "test4");
- userModule.createUser("test5", "test5");
- userModule.createUser("test6", "test6");
- userModule.createUser("test7", "testx");
- userModule.createUser("test8", "testx");
-
-
- assertEquals(11, userModule.getUserCount());
-
- Set users = userModule.findUsers(0, 4);
-
- assertEquals(4, users.size());
-
- users = userModule.findUsers(0, 10);
-
- assertEquals(10, users.size());
-
- users = userModule.findUsers(10,1);
-
- assertEquals(1, users.size());
-
- users = userModule.findUsers(10,10);
-
- assertEquals(1, users.size());
-
- users = userModule.findUsers(10,20);
-
- assertEquals(1, users.size());
-
- userModule.createUser("test9", "testx");
- userModule.createUser("test10", "testx");
- userModule.createUser("test11", "testx");
- userModule.createUser("test12", "testx");
- userModule.createUser("test13", "testx");
- userModule.createUser("test14", "testx");
- userModule.createUser("test15", "testx");
- userModule.createUser("test16", "testx");
- userModule.createUser("test17", "testx");
- userModule.createUser("test18", "testx");
- userModule.createUser("test19", "testx");
- userModule.createUser("test20", "testx");
- userModule.createUser("test21", "testx");
- userModule.createUser("test22", "testx");
- userModule.createUser("test23", "testx");
-
- assertEquals(26, userModule.getUserCount());
-
- users = userModule.findUsers(10, 10);
-
- assertEquals(10, users.size());
-
- users = userModule.findUsers(20, 1);
-
- assertEquals(1, users.size());
-
- users = userModule.findUsers(20, 6);
-
- assertEquals(6, users.size());
-
- users = userModule.findUsers(20, 10);
-
- assertEquals(6, users.size());
- ctx.commit();
- }
-
-
-
-
-
-//
- public void populate() throws Exception
- {
- ctx.begin();
- User admin = userModule.createUser("admin", "");
- User u1 = userModule.createUser("user1", "");
- User u2 = userModule.createUser("user2", "");
- Role g1 = roleModule.createRole("role1", "role1");
- Role g2 = roleModule.createRole("role2", "role2");
- membershipModule.assignRoles(u1, Collections.singleton(g1));
- membershipModule.assignRoles(u2, new CollectionBuilder().add(g1).add(g2).toHashSet());
- membershipModule.assignRoles(admin, new CollectionBuilder().add(g1).add(g2).toHashSet());
- ctx.commit();
- }
-
-
-
-
-
- public interface Context
- {
- void begin();
-
- void commit();
- }
-}
Added: modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/IdentityTestPOJO.java
===================================================================
--- modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/IdentityTestPOJO.java (rev 0)
+++ modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/IdentityTestPOJO.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -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.portal.test.identity;
+
+import org.jboss.portal.test.framework.embedded.HibernateSupport;
+import org.jboss.portal.identity.IdentityContext;
+import org.jboss.portal.identity.UserModule;
+import org.jboss.portal.identity.RoleModule;
+import org.jboss.portal.identity.MembershipModule;
+import org.jboss.portal.identity.UserProfileModule;
+import org.jboss.unit.api.pojo.annotations.Parameter;
+import org.jboss.beans.metadata.plugins.annotations.Inject;
+import org.apache.log4j.Appender;
+import org.apache.log4j.ConsoleAppender;
+import org.apache.log4j.Logger;
+import org.apache.log4j.SimpleLayout;
+import org.apache.log4j.Level;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 0.1 $
+ */
+
+public class IdentityTestPOJO
+{
+
+// static
+// {
+// Appender appender = new ConsoleAppender(new SimpleLayout());
+// Logger.getRoot().addAppender(appender);
+// Logger.getRoot().setLevel(Level.INFO);
+// Logger.getLogger("org.jboss.portal.identity").setLevel(Level.DEBUG);
+// }
+
+ private String dataSourceName;
+
+ private HibernateSupport hibernateSupport;
+
+ private IdentityContext identityContext;
+
+ private UserModule userModule;
+
+ private RoleModule roleModule;
+
+ private MembershipModule membershipModule;
+
+ private UserProfileModule userProfileModule;
+
+ private String standardIdentityConfig;
+
+ private String identityConfig;
+
+ private String datasources = "datasources.xml";
+
+
+ @Parameter(name="dataSourceName")
+ public void setDataSourceName(String dataSourceName)
+ {
+ this.dataSourceName = dataSourceName;
+ }
+
+ @Parameter(name="standardIdentityConfig")
+ public void setStandardIdentityConfig(String standardIdentityConfig)
+ {
+ this.standardIdentityConfig = standardIdentityConfig;
+ }
+
+ @Parameter(name="identityConfig")
+ public void setIdentityConfig(String customIdentityConfig)
+ {
+ this.identityConfig = customIdentityConfig;
+ }
+
+ @Parameter(name="datasources")
+ public void setDatasources(String datasources)
+ {
+ this.datasources = datasources;
+ }
+
+ @Inject(bean="HibernateSupport")
+ public void setHibernateSupport(HibernateSupport support)
+ {
+ hibernateSupport = support;
+ }
+
+ @Inject(bean="IdentityContext")
+ public void setIdentityContext(IdentityContext identityContext)
+ {
+ this.identityContext = identityContext;
+ }
+
+ @Inject(bean="UserModule")
+ public void setUserModule(UserModule userModule)
+ {
+ this.userModule = userModule;
+ }
+
+ @Inject(bean="RoleModule")
+ public void setRoleModule(RoleModule roleModule)
+ {
+ this.roleModule = roleModule;
+ }
+
+ @Inject(bean="MembershipModule")
+ public void setMembershipModule(MembershipModule membershipModule)
+ {
+ this.membershipModule = membershipModule;
+ }
+
+ @Inject(bean="UserProfileModule")
+ public void setUserProfileModule(UserProfileModule userProfileModule)
+ {
+ this.userProfileModule = userProfileModule;
+ }
+
+ public String getDataSourceName()
+ {
+ return dataSourceName;
+ }
+
+ public String getDatasources()
+ {
+ return datasources;
+ }
+
+ public HibernateSupport getHibernateSupport()
+ {
+ return hibernateSupport;
+ }
+
+ public UserModule getUserModule()
+ {
+ return userModule;
+ }
+
+ public RoleModule getRoleModule()
+ {
+ return roleModule;
+ }
+
+ public MembershipModule getMembershipModule()
+ {
+ return membershipModule;
+ }
+
+ public UserProfileModule getUserProfileModule()
+ {
+ return userProfileModule;
+ }
+
+ public String getStandardIdentityConfig()
+ {
+ return standardIdentityConfig;
+ }
+
+ public String getIdentityConfig()
+ {
+ return identityConfig;
+ }
+
+ public IdentityContext getIdentityContext()
+ {
+ return identityContext;
+ }
+}
Modified: modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/TestServiceLoader.java
===================================================================
--- modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/TestServiceLoader.java 2007-10-17 11:11:09 UTC (rev 8674)
+++ modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/TestServiceLoader.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -43,6 +43,8 @@
import org.jboss.portal.identity.service.RoleModuleService;
import org.jboss.portal.identity.service.MembershipModuleService;
import org.jboss.portal.identity.metadata.service.IdentityServicesMetaData;
+import org.jboss.portal.test.framework.embedded.DataSourceSupport;
+import org.jboss.portal.test.framework.embedded.DSConfig;
import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
import org.jboss.kernel.spi.dependency.KernelControllerContext;
import org.jboss.kernel.Kernel;
@@ -55,17 +57,25 @@
public class TestServiceLoader
{
- public IdentityContext loadServices(String defaultConfigFile, String configFile) throws Exception
+ public IdentityContext loadServices(String defaultConfigFile, DSConfig directoryConfig) throws Exception
{
+ return loadServices(defaultConfigFile, directoryConfig.getConfigFile());
+ }
+
+
+ public IdentityContext loadServices(String defaultConfigFile, String identityConfig) throws Exception
+ {
//initialize microcontainer stuff
try
{
+
+
BasicBootstrap bootstrap = new BasicBootstrap();
bootstrap.run();
Kernel kernel = bootstrap.getKernel();
- IdentityServicesMetaData servicesMetaData = new IdentityServicesMetaData(defaultConfigFile, configFile);
+ IdentityServicesMetaData servicesMetaData = new IdentityServicesMetaData(defaultConfigFile, identityConfig);
IdentityContext identityContext = bootstrapIdentityContext(kernel);
Copied: modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/db/DBGenericTest.java (from rev 8656, modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/db/DBIdentityTestCase.java)
===================================================================
--- modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/db/DBGenericTest.java (rev 0)
+++ modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/db/DBGenericTest.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -0,0 +1,191 @@
+/*
+* 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.portal.test.identity.db;
+
+import org.jboss.portal.identity.ProfileMap;
+import org.jboss.portal.identity.User;
+import org.jboss.portal.identity.db.HibernateUserImpl;
+import org.jboss.portal.test.identity.GenericTestPOJO;
+import static org.jboss.unit.api.Assert.*;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.api.pojo.annotations.Tag;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5748 $
+ */
+
+@Bootstrap(resourceName = "/org/jboss/portal/test/identity/db-beans.xml")
+@Tag(value = {"DB","generic"})
+public class DBGenericTest extends GenericTestPOJO
+{
+ private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(DBGenericTest.class);
+
+ @Test
+ @Tag(value = {"DB","generic"})
+ public void testWorking() throws Exception
+ {
+
+ }
+
+ @Test
+ @Tag(value = {"DB","generic"})
+ public void testDynamicProperty() throws Exception
+ {
+ begin();
+ User user = getUserModule().createUser("testname", "testpassword");
+ ProfileMap map = ((HibernateUserImpl)user).getProfileMap();
+ assertNull(map.get("foo"));
+ assertFalse(map.isReadOnly("foo"));
+ map.put("foo", "value");
+ assertEquals("value", map.get("foo"));
+ assertFalse(map.isReadOnly("foo"));
+ commit();
+
+ begin();
+ user = getUserModule().findUserByUserName("testname");
+ map = ((HibernateUserImpl)user).getProfileMap();
+ assertEquals("value", map.get("foo"));
+ assertFalse(map.isReadOnly("foo"));
+ commit();
+ }
+
+ @Test
+ @Tag(value = {"DB","generic"})
+ public void testFindUsersUsingFilter() throws Exception
+ {
+ genericTest.testFindUsersUsingFilter();
+ }
+
+ @Test
+ @Tag(value = {"DB","generic"})
+ public void testFindUser1() throws Exception
+ {
+ genericTest.testFindUser1();
+ }
+
+ @Test
+ @Tag(value = {"DB","generic"})
+ public void testFindUser2() throws Exception
+ {
+ genericTest.testFindUser2();
+ }
+
+ @Test
+ @Tag(value = {"DB","generic"})
+ public void testFindUsers() throws Exception
+ {
+ genericTest.testFindUsers();
+ }
+
+ @Test
+ @Tag(value = {"DB","generic"})
+ public void testFindUsers2() throws Exception
+ {
+ genericTest.testFindUsers2();
+ }
+
+ @Test
+ @Tag(value = {"DB","generic"})
+ public void testNonStandardUserNames() throws Exception
+ {
+ genericTest.testNonStandardUserNames();
+ }
+
+ @Test
+ @Tag(value = {"DB","generic"})
+ public void testCreateUser() throws Exception
+ {
+ genericTest.testCreateUser();
+ }
+
+ @Test
+ @Tag(value = {"DB","generic"})
+ public void testCreateRole() throws Exception
+ {
+ genericTest.testCreateRole();
+ }
+
+ @Test
+ @Tag(value = {"DB","generic"})
+ public void testCountUser() throws Exception
+ {
+ genericTest.testCountUser();
+ }
+
+ @Test
+ @Tag(value = {"DB","generic"})
+ public void testRemoveNonExistingRole() throws Exception
+ {
+ genericTest.testRemoveNonExistingRole();
+ }
+
+ @Test
+ @Tag(value = {"DB","generic"})
+ public void testRemoveRole() throws Exception
+ {
+ genericTest.testRemoveRole();
+ }
+
+ @Test
+ @Tag(value = {"DB","generic"})
+ public void testRemoveUser() throws Exception
+ {
+ genericTest.testRemoveUser();
+ }
+
+ @Test
+ @Tag(value = {"DB","generic"})
+ public void testFindRoles() throws Exception
+ {
+ genericTest.testFindRoles();
+ }
+
+ @Test
+ @Tag(value = {"DB","generic"})
+ public void testFindRoleMembers() throws Exception
+ {
+ genericTest.testFindRoleMembers();
+ }
+
+ @Test
+ @Tag(value = {"DB","generic"})
+ public void testNullProperty() throws Exception
+ {
+ genericTest.testNullProperty();
+ }
+
+ @Test
+ @Tag(value = {"DB","generic"})
+ public void testGetProperties() throws Exception
+ {
+ genericTest.testGetProperties();
+ }
+
+ @Test
+ @Tag(value = {"DB","generic"})
+ public void testStaticProperty() throws Exception
+ {
+ genericTest.testStaticProperty();
+ }
+}
Deleted: modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/db/DBIdentityTestCase.java
===================================================================
--- modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/db/DBIdentityTestCase.java 2007-10-17 11:11:09 UTC (rev 8674)
+++ modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/db/DBIdentityTestCase.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -1,206 +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.portal.test.identity.db;
-
-import org.jboss.portal.identity.db.HibernateUserImpl;
-import org.jboss.portal.identity.*;
-import org.jboss.portal.identity.service.UserModuleService;
-import org.jboss.portal.identity.service.UserProfileModuleService;
-import org.jboss.portal.identity.service.MembershipModuleService;
-import org.jboss.portal.identity.service.RoleModuleService;
-import org.jboss.portal.test.identity.IdentityTest;
-import org.jboss.portal.test.identity.TestServiceLoader;
-import junit.framework.TestSuite;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5748 $
- */
-public class DBIdentityTestCase extends DBTestCase
-{
- private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(DBTestCase.class);
-
- public static TestSuite suite() throws Exception
- {
- System.out.println("###");
- return createTestSuite(DBIdentityTestCase.class);
- }
-
- public void setUp() throws Exception
- {
-
- //generate hibernate mappings based on the profile file
-// ProfileInfo info = new ProfileInfoSupport(ConfigurationParser.parseProfileConfiguration("test/config/profile-config.xml"));
-// String pattern = "<property name=\"@name@\" column=\"@column@\" type=\"java.lang.String\" update=\"true\" insert=\"true\" unique=\"false\"/>";
-// HibernateHelper.generateProfileMappings("hibernate/domain-template-single.hbm.xml",
-// "resources/hibernate/domain-identity.hbm.xml",
-// pattern,
-// info,
-// Thread.currentThread().getContextClassLoader());
-
-
-
- //initialize microcontainer stuff
- super.setUp();
-
-
- //bootstrap identity modules
-// IdentityServiceControllerImpl controller = new IdentityServiceControllerImpl();
-// controller.setConfigFile("test/config/db-config.xml");
-// controller.setDefaultConfigFile("test/config/standardidentity-config.xml");
-// controller.setRegisterMBeans(false);
-// controller.start();
-// identityContext = controller.getIdentityContext();
- identityContext = new TestServiceLoader().loadServices("test/config/standardidentity-config.xml", "test/config/db-config.xml");
-
- this.userModule = (UserModuleService)identityContext.getObject(IdentityContext.TYPE_USER_MODULE);
- this.roleModule = (RoleModuleService)identityContext.getObject(IdentityContext.TYPE_ROLE_MODULE);
- this.membershipModule = (MembershipModuleService)identityContext.getObject(IdentityContext.TYPE_MEMBERSHIP_MODULE);
- this.userProfileModule = (UserProfileModuleService)identityContext.getObject(IdentityContext.TYPE_USER_PROFILE_MODULE);
-
- //
- utc = new IdentityTest();
- utc.setUserModule(userModule);
- utc.setRoleModule(roleModule);
- utc.setMembershipModule(membershipModule);
- utc.setUserProfileModule(userProfileModule);
- utc.setContext(this);
- utc.populate();
- }
-
-
-
-
-
-
- public void testWorking() throws Exception
- {
-
- }
-
- //
-
- public void testFindUsersUsingFilter() throws Exception
- {
- utc.testFindUsersUsingFilter();
- }
-
- public void testFindUser1() throws Exception
- {
- utc.testFindUser1();
- }
-
- public void testFindUser2() throws Exception
- {
- utc.testFindUser2();
- }
-
- public void testFindUsers() throws Exception
- {
- utc.testFindUsers();
- }
-
- public void testFindUsers2() throws Exception
- {
- utc.testFindUsers2();
- }
-
- public void testNonStandardUserNames() throws Exception
- {
- utc.testNonStandardUserNames();
- }
-
- public void testCreateUser() throws Exception
- {
- utc.testCreateUser();
- }
-
- public void testCreateRole() throws Exception
- {
- utc.testCreateRole();
- }
-
- public void testCountUser() throws Exception
- {
- utc.testCountUser();
- }
-
- public void testRemoveNonExistingRole() throws Exception
- {
- utc.testRemoveNonExistingRole();
- }
-
- public void testRemoveRole() throws Exception
- {
- utc.testRemoveRole();
- }
-
- public void testRemoveUser() throws Exception
- {
- utc.testRemoveUser();
- }
-
- public void testFindRoles() throws Exception
- {
- utc.testFindRoles();
- }
-
- public void testFindRoleMembers() throws Exception
- {
- utc.testFindRoleMembers();
- }
-
- public void testDynamicProperty() throws Exception
- {
- begin();
- User user = userModule.createUser("testname", "testpassword");
- ProfileMap map = ((HibernateUserImpl)user).getProfileMap();
- assertNull(map.get("foo"));
- assertFalse(map.isReadOnly("foo"));
- map.put("foo", "value");
- assertEquals("value", map.get("foo"));
- assertFalse(map.isReadOnly("foo"));
- commit();
-
- begin();
- user = userModule.findUserByUserName("testname");
- map = ((HibernateUserImpl)user).getProfileMap();
- assertEquals("value", map.get("foo"));
- assertFalse(map.isReadOnly("foo"));
- commit();
- }
-
- public void testNullProperty() throws Exception
- {
- utc.testNullProperty();
- }
-
- public void testGetProperties() throws Exception
- {
- utc.testGetProperties();
- }
-
- public void testStaticProperty() throws Exception
- {
- utc.testStaticProperty();
- }
-}
Deleted: modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/db/DBTestCase.java
===================================================================
--- modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/db/DBTestCase.java 2007-10-17 11:11:09 UTC (rev 8674)
+++ modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/db/DBTestCase.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -1,201 +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.portal.test.identity.db;
-
-import org.jboss.portal.test.framework.embedded.DataSourceSupport;
-import org.jboss.portal.test.framework.embedded.HibernateSupport;
-import org.jboss.portal.test.framework.mc.TestRuntimeContext;
-import org.jboss.portal.test.identity.IdentityTest;
-import org.jboss.portal.test.framework.junit.POJOJUnitTest;
-import org.jboss.portal.test.framework.junit.JUnitAdapter;
-import org.jboss.portal.identity.IdentityContext;
-import org.jboss.portal.identity.service.UserProfileModuleService;
-import org.jboss.portal.identity.service.MembershipModuleService;
-import org.jboss.portal.identity.service.RoleModuleService;
-import org.jboss.portal.identity.service.UserModuleService;
-import org.apache.log4j.Appender;
-import org.apache.log4j.ConsoleAppender;
-import org.apache.log4j.SimpleLayout;
-import org.apache.log4j.Logger;
-import org.apache.log4j.Level;
-import junit.framework.TestSuite;
-
-import java.net.URL;
-import java.util.Map;
-import java.util.HashMap;
-
-/**
- * @author <a href="mailto:boleslaw dot dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
- * @version $Revision: 1.1 $
- */
-public abstract class DBTestCase extends junit.framework.TestCase implements IdentityTest.Context
-{
-
- static
- {
- Appender appender = new ConsoleAppender(new SimpleLayout());
- Logger.getRoot().addAppender(appender);
- Logger.getRoot().setLevel(Level.DEBUG);
- Logger.getLogger("org.hibernate").setLevel(Level.ERROR);
- Logger.getLogger("org.jboss.portal.identity").setLevel(Level.DEBUG);
- }
-
- public static TestSuite createTestSuite(Class clazz) throws Exception
- {
- URL configsURL = Thread.currentThread().getContextClassLoader().getResource("datasources.xml");
- Map parameterMap = new HashMap();
- parameterMap.put("DataSourceConfig", DataSourceSupport.Config.fromXML2(configsURL));
- POJOJUnitTest abc = new POJOJUnitTest(clazz);
- JUnitAdapter adapter = new JUnitAdapter(abc, parameterMap);
- TestSuite suite = new TestSuite();
- suite.addTest(adapter);
- return suite;
- }
-
-
- /**
- * .
- */
- protected DataSourceSupport.Config dataSourceConfigParameter;
-
- /**
- * .
- */
- protected TestRuntimeContext runtimeContext;
-
- /**
- * .
- */
- protected HibernateSupport hibernate;
-
- /**
- * .
- */
- protected IdentityContext identityContext;
-
- /** . */
- protected IdentityTest utc;
-
- /**
- * .
- */
- protected UserModuleService userModule;
-
- /**
- * .
- */
- protected RoleModuleService roleModule;
-
- /**
- * .
- */
- protected MembershipModuleService membershipModule;
-
- /**
- * .
- */
- protected UserProfileModuleService userProfileModule;
-
- public DataSourceSupport.Config getDataSourceConfigParameter()
- {
- return dataSourceConfigParameter;
- }
-
- public void setDataSourceConfigParameter(DataSourceSupport.Config dataSourceConfig)
- {
- this.dataSourceConfigParameter = dataSourceConfig;
- }
-
- public HibernateSupport getHibernate()
- {
- return hibernate;
- }
-
- public void setHibernate(HibernateSupport hibernate)
- {
- this.hibernate = hibernate;
- }
-
-
- public String getName()
- {
- return super.getName() + "," + dataSourceConfigParameter.getName();
- }
-
-
- protected void setUp() throws Exception
- {
- hibernate = new HibernateSupport();
-
-
- runtimeContext = new TestRuntimeContext("org/jboss/portal/test/identity/db-beans.xml");
- runtimeContext.addBean("DBTestBean", this);
- runtimeContext.addBean("HibernateSupport", hibernate);
- runtimeContext.addBean("DataSourceConfig", dataSourceConfigParameter);
-
- HibernateSupport.Config config = HibernateSupport.getConfig(dataSourceConfigParameter.getName());
- //add hibernate properties for dynamic entities
- //config.getProperties().put("hibernate.default_entity_mode","dynamic-map");
-
- runtimeContext.addBean("HibernateConfig", config);
- runtimeContext.start();
- }
-
-
-
- public void tearDown() throws Exception
- {
- utc.setUserModule(null);
- utc.setRoleModule(null);
- utc.setMembershipModule(null);
- utc.setUserProfileModule(null);
- utc.setContext(null);
- utc = null;
-
- //
-// roleModule.destroy();
-// userModule.destroy();
-// membershipModule.destroy();
-// userProfileModule.destroy();
-
- roleModule = null;
- userModule = null;
- membershipModule = null;
- userProfileModule = null;
-
- //
- runtimeContext.stop();
- }
-
-
- public void begin()
- {
- hibernate.openSession();
- }
-
- public void commit()
- {
- assertTrue(hibernate.commitTransaction());
- }
-
-
-}
Copied: modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPExtRoleModuleTest.java (from rev 8668, modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPExtRoleModuleTestCase.java)
===================================================================
--- modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPExtRoleModuleTest.java (rev 0)
+++ modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPExtRoleModuleTest.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -0,0 +1,201 @@
+package org.jboss.portal.test.identity.ldap;
+
+//import org.jboss.portal.identity.IdentityServiceControllerImpl;
+import org.jboss.portal.identity.IdentityException;
+ import org.jboss.portal.identity.User;
+import org.jboss.portal.identity.Role;
+import org.jboss.portal.identity.ldap.LDAPRoleImpl;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+import static org.jboss.unit.api.Assert.*;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.api.pojo.annotations.Tag;
+
+
+import java.util.Set;
+import java.util.List;
+import java.util.LinkedList;
+import java.util.Iterator;
+import java.util.HashSet;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
+ * @version $Revision: 1.1 $
+ */
+@Bootstrap(resourceName = "/org/jboss/portal/test/identity/ldap-beans.xml")
+@Tag(value = {"LDAP","RoleModule","ExtRoleModule"})
+public class LDAPExtRoleModuleTest extends LDAPTestPOJO
+{
+ private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(LDAPExtRoleModuleTest.class);
+
+
+ @Test
+ public void testFindRoleByName() throws Exception
+ {
+ LDAPRoleImpl ldapr = (LDAPRoleImpl)getRoleModule().findRoleByName("Echo");
+ assertEquals(ldapr.getDn().toLowerCase(), ("cn=Echo,ou=Roles," + suffix).toLowerCase());
+ assertEquals(ldapr.getName(), "Echo");
+ }
+
+ /*public void testRemoveRole() throws Exception
+ {
+ LDAPRoleImpl ldapr = (LDAPRoleImpl)getRoleModule().findRoleByName("Echo");
+ assertEquals(ldapr.getDn().toLowerCase(), ("cn=Echo,ou=Roles," + suffix).toLowerCase());
+ assertEquals(ldapr.getName(), "Echo");
+ getRoleModule().removeRole(ldapr.getId());
+ try
+ {
+ ldapr = (LDAPRoleImpl)getRoleModule().findRoleByName("Echo");
+ fail();
+ }
+ catch (IdentityException e)
+ {
+ //expected
+ }
+ //assertNull(ldapr);
+ }
+
+ public void testCreateRole() throws Exception
+ {
+ LDAPRoleImpl ldapr = (LDAPRoleImpl)getRoleModule().createRole("testRole", "testDisplayName");
+ assertNotNull(ldapr);
+ assertEquals("testRole", ldapr.getName());
+ //assertEquals("testDisplayName",ldapr.getDisplayName());
+
+ ldapr = (LDAPRoleImpl)getRoleModule().findRoleByName("testRole");
+ assertNotNull(ldapr);
+ getRoleModule().removeRole(ldapr.getId());
+
+
+ try
+ {
+ getRoleModule().findRoleByName("testRole");
+ fail("shouldn reach this");
+ }
+ catch (Exception e)
+ {
+ //expected
+ }
+ //assertNull(ldapr);
+
+ }*/
+
+ @Test
+ public void testgetRoleCount() throws Exception
+ {
+ LDAPRoleImpl ldapr = (LDAPRoleImpl)getRoleModule().findRoleByName("Echo");
+ assertEquals(ldapr.getDn().toLowerCase(), ("cn=Echo,ou=Roles," + suffix).toLowerCase());
+ assertEquals(ldapr.getName(), "Echo");
+
+ int count = getRoleModule().getRolesCount();
+ assertEquals(4, count);
+ }
+
+ @Test
+ public void testFindRolesByNames() throws Exception
+ {
+ Set roles = getRoleModule().findRolesByNames(new String[] {"Echo"});
+
+ assertEquals(1, roles.size());
+
+ List roleNames = new LinkedList();
+
+ for (Iterator iterator = roles.iterator(); iterator.hasNext();)
+ {
+ LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
+ roleNames.add(role.getDn().toLowerCase());
+ }
+ assertTrue(roleNames.contains(("cn=Echo,ou=Roles," + suffix).toLowerCase()));
+
+
+ //
+ roles = getRoleModule().findRolesByNames(new String[] {"Echo", "Echo1"});
+
+ assertEquals(2, roles.size());
+
+ roleNames = new LinkedList();
+
+ for (Iterator iterator = roles.iterator(); iterator.hasNext();)
+ {
+ LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
+ roleNames.add(role.getDn().toLowerCase());
+ }
+ assertTrue(roleNames.contains(("cn=Echo,ou=Roles," + suffix).toLowerCase()));
+ assertTrue(roleNames.contains(("cn=Echo1,ou=Roles," + suffix).toLowerCase()));
+
+ //
+ roles = getRoleModule().findRolesByNames(new String[] {"Echo", "Echo1", "TheDuke"});
+
+ assertEquals(3, roles.size());
+
+ roleNames = new LinkedList();
+
+ for (Iterator iterator = roles.iterator(); iterator.hasNext();)
+ {
+ LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
+ roleNames.add(role.getDn().toLowerCase());
+ }
+ assertTrue(roleNames.contains(("cn=Echo,ou=Roles," + suffix).toLowerCase()));
+ assertTrue(roleNames.contains(("cn=Echo1,ou=Roles," + suffix).toLowerCase()));
+ assertTrue(roleNames.contains(("cn=TheDuke,ou=Roles," + suffix).toLowerCase()));
+ }
+
+ @Test
+ public void testSearchCtx() throws Exception
+ {
+ LDAPRoleImpl ldapr = (LDAPRoleImpl)getRoleModule().findRoleByName("User11");
+ assertEquals(ldapr.getDn().toLowerCase(), ("cn=User11,ou=Roles1," + suffix).toLowerCase());
+ assertEquals(ldapr.getName(), "User11");
+
+ try
+ {
+ ldapr = (LDAPRoleImpl)getRoleModule().findRoleByName("User21");
+ fail();
+ }
+ catch (IdentityException e)
+ {
+ //expected
+ }
+
+ }
+
+ @Test
+ public void testNonStandardName() throws Exception
+ {
+ User u = getUserModule().findUserByUserName("jduke1");
+ assertNotNull(u);
+
+ Set roles = getMembershipModule().getRoles(u);
+
+ assertEquals(2, roles.size());
+
+ Set roleNames = new HashSet();
+ for (Iterator iterator = roles.iterator(); iterator.hasNext();)
+ {
+ Role role = (Role)iterator.next();
+ roleNames.add(role.getName());
+ System.out.println("ROlE NAME: " + role.getName());
+ }
+
+
+ assertTrue(roleNames.contains("Echo"));
+ assertTrue(roleNames.contains("User11"));
+
+
+ u = getUserModule().findUserByUserName("jduke4, Duke");
+ assertNotNull(u);
+
+ roles = getMembershipModule().getRoles(u);
+
+ roleNames = new HashSet();
+ for (Iterator iterator = roles.iterator(); iterator.hasNext();)
+ {
+ Role role = (Role)iterator.next();
+ roleNames.add(role.getName());
+ }
+
+ assertTrue(roleNames.contains("Echo"));
+ assertTrue(roleNames.contains("User11"));
+
+
+ }
+}
Deleted: modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPExtRoleModuleTestCase.java
===================================================================
--- modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPExtRoleModuleTestCase.java 2007-10-17 11:11:09 UTC (rev 8674)
+++ modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPExtRoleModuleTestCase.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -1,262 +0,0 @@
-package org.jboss.portal.test.identity.ldap;
-
-import junit.framework.TestSuite;
-import org.jboss.portal.identity.RoleModule;
-//import org.jboss.portal.identity.IdentityServiceControllerImpl;
-import org.jboss.portal.identity.IdentityContext;
-import org.jboss.portal.identity.IdentityException;
-import org.jboss.portal.identity.UserModule;
-import org.jboss.portal.identity.MembershipModule;
-import org.jboss.portal.identity.UserProfileModule;
-import org.jboss.portal.identity.User;
-import org.jboss.portal.identity.Role;
-import org.jboss.portal.identity.ldap.LDAPRoleImpl;
-import org.jboss.portal.test.identity.TestServiceLoader;
-
-import java.util.Set;
-import java.util.List;
-import java.util.LinkedList;
-import java.util.Iterator;
-import java.util.HashSet;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
- * @version $Revision: 1.1 $
- */
-public class LDAPExtRoleModuleTestCase extends LDAPTestCase
-{
- private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(LDAPExtRoleModuleTestCase.class);
-
- public static TestSuite suite() throws Exception
- {
- return createTestSuite(LDAPExtRoleModuleTestCase.class, "directories-extrolemodule.xml", "datasources.xml");
- }
-
- UserModule userModule;
-
- RoleModule roleModule;
-
- MembershipModule membershipModule;
-
- UserProfileModule userProfileModule;
-
-
- private String suffix;
-
- public void setUp() throws Exception
- {
-
- super.setUp();
-
- /*IdentityContextImpl context = new IdentityContextImpl();
- context.start();
- identityContext = context;
-
- SimpleConfigurationImpl configuration = new SimpleConfigurationImpl();
- configuration.setIdentityContext(identityContext);
- configuration.setConfigFile(getDirectoryServerConfigParameter().getConfigFile());
- configuration.start();
-
- LDAPConnectionContext connection = new LDAPConnectionContext();
- connection.setIdentityContext(identityContext);
- connection.start();
-
- LDAPRoleModuleImpl roleModule = new LDAPRoleModuleImpl();
- roleModule.setIdentityContext(identityContext);
- //roleModule.setContainerDN("ou=Roles,dc=jboss,dc=org");
- //roleModule.setRidAttributeID("cn");
- roleModule.start();
- this.roleModule = roleModule;*/
-
-// IdentityServiceControllerImpl controller = new IdentityServiceControllerImpl();
-// controller.setConfigFile(getDirectoryServerConfigParameter().getConfigFile());
-// controller.setDefaultConfigFile("test/config/standardidentity-config.xml");
-// controller.setRegisterMBeans(false);
-// controller.start();
-// identityContext = controller.getIdentityContext();
- identityContext = new TestServiceLoader().loadServices("test/config/standardidentity-config.xml", getDirectoryServerConfigParameter().getConfigFile());
-
- userModule = (UserModule)identityContext.getObject(IdentityContext.TYPE_USER_MODULE);
- userModule = (UserModule)identityContext.getObject(IdentityContext.TYPE_USER_MODULE);
- roleModule = (RoleModule)identityContext.getObject(IdentityContext.TYPE_ROLE_MODULE);
- membershipModule = (MembershipModule)identityContext.getObject(IdentityContext.TYPE_MEMBERSHIP_MODULE);
- userProfileModule = (UserProfileModule)identityContext.getObject(IdentityContext.TYPE_USER_PROFILE_MODULE);
-
- suffix = getDirectoryServerConfigParameter().getCleanUpDN();
-
- populate();
-
- }
-
-
- /*public void testFirstSimple() throws Exception
- {
- log.info("test framework works ;]");
- }*/
-
- public void testFindRoleByName() throws Exception
- {
- LDAPRoleImpl ldapr = (LDAPRoleImpl)roleModule.findRoleByName("Echo");
- assertEquals(ldapr.getDn().toLowerCase(), ("cn=Echo,ou=Roles," + suffix).toLowerCase());
- assertEquals(ldapr.getName(), "Echo");
- }
-
- /*public void testRemoveRole() throws Exception
- {
- LDAPRoleImpl ldapr = (LDAPRoleImpl)roleModule.findRoleByName("Echo");
- assertEquals(ldapr.getDn().toLowerCase(), ("cn=Echo,ou=Roles," + suffix).toLowerCase());
- assertEquals(ldapr.getName(), "Echo");
- roleModule.removeRole(ldapr.getId());
- try
- {
- ldapr = (LDAPRoleImpl)roleModule.findRoleByName("Echo");
- fail();
- }
- catch (IdentityException e)
- {
- //expected
- }
- //assertNull(ldapr);
- }
-
- public void testCreateRole() throws Exception
- {
- LDAPRoleImpl ldapr = (LDAPRoleImpl)roleModule.createRole("testRole", "testDisplayName");
- assertNotNull(ldapr);
- assertEquals("testRole", ldapr.getName());
- //assertEquals("testDisplayName",ldapr.getDisplayName());
-
- ldapr = (LDAPRoleImpl)roleModule.findRoleByName("testRole");
- assertNotNull(ldapr);
- roleModule.removeRole(ldapr.getId());
-
-
- try
- {
- roleModule.findRoleByName("testRole");
- fail("shouldn reach this");
- }
- catch (Exception e)
- {
- //expected
- }
- //assertNull(ldapr);
-
- }*/
-
- public void testgetRoleCount() throws Exception
- {
- LDAPRoleImpl ldapr = (LDAPRoleImpl)roleModule.findRoleByName("Echo");
- assertEquals(ldapr.getDn().toLowerCase(), ("cn=Echo,ou=Roles," + suffix).toLowerCase());
- assertEquals(ldapr.getName(), "Echo");
-
- int count = roleModule.getRolesCount();
- assertEquals(4, count);
- }
-
- public void testFindRolesByNames() throws Exception
- {
- Set roles = roleModule.findRolesByNames(new String[] {"Echo"});
-
- assertEquals(1, roles.size());
-
- List roleNames = new LinkedList();
-
- for (Iterator iterator = roles.iterator(); iterator.hasNext();)
- {
- LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
- roleNames.add(role.getDn().toLowerCase());
- }
- assertTrue(roleNames.contains(("cn=Echo,ou=Roles," + suffix).toLowerCase()));
-
-
- //
- roles = roleModule.findRolesByNames(new String[] {"Echo", "Echo1"});
-
- assertEquals(2, roles.size());
-
- roleNames = new LinkedList();
-
- for (Iterator iterator = roles.iterator(); iterator.hasNext();)
- {
- LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
- roleNames.add(role.getDn().toLowerCase());
- }
- assertTrue(roleNames.contains(("cn=Echo,ou=Roles," + suffix).toLowerCase()));
- assertTrue(roleNames.contains(("cn=Echo1,ou=Roles," + suffix).toLowerCase()));
-
- //
- roles = roleModule.findRolesByNames(new String[] {"Echo", "Echo1", "TheDuke"});
-
- assertEquals(3, roles.size());
-
- roleNames = new LinkedList();
-
- for (Iterator iterator = roles.iterator(); iterator.hasNext();)
- {
- LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
- roleNames.add(role.getDn().toLowerCase());
- }
- assertTrue(roleNames.contains(("cn=Echo,ou=Roles," + suffix).toLowerCase()));
- assertTrue(roleNames.contains(("cn=Echo1,ou=Roles," + suffix).toLowerCase()));
- assertTrue(roleNames.contains(("cn=TheDuke,ou=Roles," + suffix).toLowerCase()));
- }
-
- public void testSearchCtx() throws Exception
- {
- LDAPRoleImpl ldapr = (LDAPRoleImpl)roleModule.findRoleByName("User11");
- assertEquals(ldapr.getDn().toLowerCase(), ("cn=User11,ou=Roles1," + suffix).toLowerCase());
- assertEquals(ldapr.getName(), "User11");
-
- try
- {
- ldapr = (LDAPRoleImpl)roleModule.findRoleByName("User21");
- fail();
- }
- catch (IdentityException e)
- {
- //expected
- }
-
- }
-
- public void testNonStandardName() throws Exception
- {
- User u = userModule.findUserByUserName("jduke1");
- assertNotNull(u);
-
- Set roles = membershipModule.getRoles(u);
-
- assertEquals(2, roles.size());
-
- Set roleNames = new HashSet();
- for (Iterator iterator = roles.iterator(); iterator.hasNext();)
- {
- Role role = (Role)iterator.next();
- roleNames.add(role.getName());
- System.out.println("ROlE NAME: " + role.getName());
- }
-
-
- assertTrue(roleNames.contains("Echo"));
- assertTrue(roleNames.contains("User11"));
-
-
- u = userModule.findUserByUserName("jduke4, Duke");
- assertNotNull(u);
-
- roles = membershipModule.getRoles(u);
-
- roleNames = new HashSet();
- for (Iterator iterator = roles.iterator(); iterator.hasNext();)
- {
- Role role = (Role)iterator.next();
- roleNames.add(role.getName());
- }
-
- assertTrue(roleNames.contains("Echo"));
- assertTrue(roleNames.contains("User11"));
-
-
- }
-}
Copied: modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPExtUserModuleTest.java (from rev 8668, modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPExtUserModuleTestCase.java)
===================================================================
--- modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPExtUserModuleTest.java (rev 0)
+++ modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPExtUserModuleTest.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -0,0 +1,141 @@
+package org.jboss.portal.test.identity.ldap;
+
+//import org.jboss.portal.identity.IdentityServiceControllerImpl;
+import org.jboss.portal.identity.User;
+import org.jboss.portal.identity.Role;
+import org.jboss.portal.identity.NoSuchUserException;
+import org.jboss.portal.identity.ldap.LDAPUserImpl;
+ import org.jboss.unit.mc.api.annotations.Bootstrap;
+import static org.jboss.unit.api.Assert.*;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.api.pojo.annotations.Tag;
+
+import java.util.Set;
+import java.util.HashSet;
+import java.util.Iterator;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
+ * @version $Revision: 1.1 $
+ */
+@Bootstrap(resourceName = "/org/jboss/portal/test/identity/ldap-beans.xml")
+@Tag(value = {"LDAP","UserModule","ExtUserModule"})
+public class LDAPExtUserModuleTest extends LDAPTestPOJO
+{
+ private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(LDAPExtUserModuleTest.class);
+
+ @Test
+ public void testFirstSimple() throws Exception
+ {
+ log.info("test framework works ;]");
+ }
+
+ @Test
+ public void testFindUserByName() throws Exception
+ {
+ LDAPUserImpl ldapu = (LDAPUserImpl)getUserModule().findUserByUserName("jduke");
+ assertEquals(ldapu.getDn().toLowerCase(), (userPrefix + "=jduke,ou=People," + suffix).toLowerCase());
+ assertEquals(ldapu.getUserName(), "jduke");
+ }
+
+ @Test
+ public void testgetUserCount() throws Exception
+ {
+ LDAPUserImpl ldapu = (LDAPUserImpl)getUserModule().findUserByUserName("jduke");
+ assertEquals(ldapu.getDn().toLowerCase(),(userPrefix + "=jduke,ou=People," + suffix).toLowerCase());
+ assertEquals(ldapu.getUserName(), "jduke");
+
+ int count = getUserModule().getUserCount();
+ assertEquals(7, count);
+ }
+
+ //TODO: test findUsers
+
+ @Test
+ public void testFindUsersFilteredByName() throws Exception
+ {
+ getUserModule().findUsersFilteredByUserName("jduke",0,1);
+ //assertEquals(ldapu.getUserName(), "jduke");
+
+ }
+
+ @Test
+ public void testPassword() throws Exception
+ {
+ //getUserModule().createUser("testUser", "testPassword");
+ User u = getUserModule().findUserByUserName("jduke");
+ assertNotNull(u);
+ assertEquals("jduke", u.getUserName());
+ assertTrue(u.validatePassword("theduke"));
+
+ getUserProfileModule().setProperty(u, User.INFO_USER_EMAIL_REAL, "testRealEmail");
+ assertTrue(u.validatePassword("theduke"));
+
+
+ assertTrue(!u.validatePassword("dodo"));
+ u.updatePassword("dodo");
+ assertTrue(u.validatePassword("dodo"));
+
+ }
+
+ @Test
+ public void testSearchCtx() throws Exception
+ {
+ //users should be visable in both configured search contexts
+ User u = getUserModule().findUserByUserName("user11");
+ assertNotNull(u);
+ assertEquals("user11", u.getUserName());
+ assertTrue(u.validatePassword("theduke"));
+
+ //and not in not configured context
+ try
+ {
+ u = getUserModule().findUserByUserName("user21");
+ fail();
+ }
+ catch (NoSuchUserException e)
+ {
+ //expected
+ }
+
+
+ }
+
+ @Test
+ public void testNonStandardName() throws Exception
+ {
+ User u = getUserModule().findUserByUserName("jduke1");
+ assertNotNull(u);
+
+ Set roles = getMembershipModule().getRoles(u);
+
+ assertEquals(1, roles.size());
+
+ Set roleNames = new HashSet();
+ for (Iterator iterator = roles.iterator(); iterator.hasNext();)
+ {
+ Role role = (Role)iterator.next();
+ roleNames.add(role.getName());
+ System.out.println("ROlE NAME: " + role.getName());
+ }
+
+
+ assertTrue(roleNames.contains("Echo"));
+
+
+ u = getUserModule().findUserByUserName("jduke4, Duke");
+ assertNotNull(u);
+
+ roles = getMembershipModule().getRoles(u);
+
+ roleNames = new HashSet();
+ for (Iterator iterator = roles.iterator(); iterator.hasNext();)
+ {
+ Role role = (Role)iterator.next();
+ roleNames.add(role.getName());
+ }
+
+ assertTrue(roleNames.contains("Echo"));
+
+ }
+}
Deleted: modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPExtUserModuleTestCase.java
===================================================================
--- modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPExtUserModuleTestCase.java 2007-10-17 11:11:09 UTC (rev 8674)
+++ modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPExtUserModuleTestCase.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -1,197 +0,0 @@
-package org.jboss.portal.test.identity.ldap;
-
-import junit.framework.TestSuite;
-import org.jboss.portal.identity.UserModule;
-import org.jboss.portal.identity.RoleModule;
-import org.jboss.portal.identity.MembershipModule;
-import org.jboss.portal.identity.UserProfileModule;
-//import org.jboss.portal.identity.IdentityServiceControllerImpl;
-import org.jboss.portal.identity.IdentityContext;
-import org.jboss.portal.identity.IdentityConfiguration;
-import org.jboss.portal.identity.User;
-import org.jboss.portal.identity.Role;
-import org.jboss.portal.identity.NoSuchUserException;
-import org.jboss.portal.identity.ldap.LDAPUserImpl;
-import org.jboss.portal.test.identity.TestServiceLoader;
-import org.apache.log4j.Appender;
-import org.apache.log4j.ConsoleAppender;
-import org.apache.log4j.SimpleLayout;
-import org.apache.log4j.Logger;
-import org.apache.log4j.Level;
-
-import java.util.Set;
-import java.util.HashSet;
-import java.util.Iterator;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
- * @version $Revision: 1.1 $
- */
-public class LDAPExtUserModuleTestCase extends LDAPTestCase
-{
- private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(LDAPExtUserModuleTestCase.class);
-
- public static TestSuite suite() throws Exception
- {
- System.out.println("###");
- return createTestSuite(LDAPExtUserModuleTestCase.class, "directories-extusermodule.xml", "datasources.xml");
- }
-
- static
- {
- Appender appender = new ConsoleAppender(new SimpleLayout());
- Logger.getRoot().addAppender(appender);
- Logger.getRoot().setLevel(Level.INFO);
- Logger.getLogger("org.jboss.portal.identity").setLevel(Level.DEBUG);
- }
-
- UserModule userModule;
-
- RoleModule roleModule;
-
- MembershipModule membershipModule;
-
- UserProfileModule userProfileModule;
-
-
-
- private String suffix;
-
- private String userPrefix;
-
- public void setUp() throws Exception
- {
- super.setUp();
-
-// IdentityServiceControllerImpl controller = new IdentityServiceControllerImpl();
-// controller.setConfigFile(getDirectoryServerConfigParameter().getConfigFile());
-// controller.setDefaultConfigFile("test/config/standardidentity-config.xml");
-// controller.setRegisterMBeans(false);
-// controller.start();
-// identityContext = controller.getIdentityContext();
-
- identityContext = new TestServiceLoader().loadServices("test/config/standardidentity-config.xml", getDirectoryServerConfigParameter().getConfigFile());
-
- userModule = (UserModule)identityContext.getObject(IdentityContext.TYPE_USER_MODULE);
- userModule = (UserModule)identityContext.getObject(IdentityContext.TYPE_USER_MODULE);
- roleModule = (RoleModule)identityContext.getObject(IdentityContext.TYPE_ROLE_MODULE);
- membershipModule = (MembershipModule)identityContext.getObject(IdentityContext.TYPE_MEMBERSHIP_MODULE);
- userProfileModule = (UserProfileModule)identityContext.getObject(IdentityContext.TYPE_USER_PROFILE_MODULE);
-
-
- suffix = getDirectoryServerConfigParameter().getCleanUpDN();
- userPrefix = ((IdentityConfiguration)identityContext.getObject(IdentityContext.TYPE_IDENTITY_CONFIGURATION)).getValue(IdentityConfiguration.USER_UID_ATTRIBUTE_ID);
-
- populate();
- }
-
-
- public void testFirstSimple() throws Exception
- {
- log.info("test framework works ;]");
- }
-
- public void testFindUserByName() throws Exception
- {
- LDAPUserImpl ldapu = (LDAPUserImpl)userModule.findUserByUserName("jduke");
- assertEquals(ldapu.getDn().toLowerCase(), (userPrefix + "=jduke,ou=People," + suffix).toLowerCase());
- assertEquals(ldapu.getUserName(), "jduke");
- }
-
- public void testgetUserCount() throws Exception
- {
- LDAPUserImpl ldapu = (LDAPUserImpl)userModule.findUserByUserName("jduke");
- assertEquals(ldapu.getDn().toLowerCase(),(userPrefix + "=jduke,ou=People," + suffix).toLowerCase());
- assertEquals(ldapu.getUserName(), "jduke");
-
- int count = userModule.getUserCount();
- assertEquals(7, count);
- }
-
- //TODO: test findUsers
-
- public void testFindUsersFilteredByName() throws Exception
- {
- userModule.findUsersFilteredByUserName("jduke",0,1);
- //assertEquals(ldapu.getUserName(), "jduke");
-
- }
-
- public void testPassword() throws Exception
- {
- //userModule.createUser("testUser", "testPassword");
- User u = userModule.findUserByUserName("jduke");
- assertNotNull(u);
- assertEquals("jduke", u.getUserName());
- assertTrue(u.validatePassword("theduke"));
-
- userProfileModule.setProperty(u, User.INFO_USER_EMAIL_REAL, "testRealEmail");
- assertTrue(u.validatePassword("theduke"));
-
-
- assertTrue(!u.validatePassword("dodo"));
- u.updatePassword("dodo");
- assertTrue(u.validatePassword("dodo"));
-
- }
-
- public void testSearchCtx() throws Exception
- {
- //users should be visable in both configured search contexts
- User u = userModule.findUserByUserName("user11");
- assertNotNull(u);
- assertEquals("user11", u.getUserName());
- assertTrue(u.validatePassword("theduke"));
-
- //and not in not configured context
- try
- {
- u = userModule.findUserByUserName("user21");
- fail();
- }
- catch (NoSuchUserException e)
- {
- //expected
- }
-
-
- }
-
- public void testNonStandardName() throws Exception
- {
- User u = userModule.findUserByUserName("jduke1");
- assertNotNull(u);
-
- Set roles = membershipModule.getRoles(u);
-
- assertEquals(1, roles.size());
-
- Set roleNames = new HashSet();
- for (Iterator iterator = roles.iterator(); iterator.hasNext();)
- {
- Role role = (Role)iterator.next();
- roleNames.add(role.getName());
- System.out.println("ROlE NAME: " + role.getName());
- }
-
-
- assertTrue(roleNames.contains("Echo"));
-
-
- u = userModule.findUserByUserName("jduke4, Duke");
- assertNotNull(u);
-
- roles = membershipModule.getRoles(u);
-
- roleNames = new HashSet();
- for (Iterator iterator = roles.iterator(); iterator.hasNext();)
- {
- Role role = (Role)iterator.next();
- roleNames.add(role.getName());
- }
-
- assertTrue(roleNames.contains("Echo"));
-
-
- }
-}
Added: modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPGenericTest.java
===================================================================
--- modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPGenericTest.java (rev 0)
+++ modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPGenericTest.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -0,0 +1,172 @@
+/*
+* 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.portal.test.identity.ldap;
+
+import org.jboss.portal.test.identity.GenericTestPOJO;
+import org.jboss.portal.test.identity.GenericTest;
+import org.jboss.unit.api.pojo.annotations.Parameter;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.api.pojo.annotations.Destroy;
+import org.jboss.unit.api.pojo.annotations.Create;
+import org.jboss.unit.api.pojo.annotations.Tag;
+import static org.jboss.unit.api.Assert.assertTrue;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+@Bootstrap(resourceName = "/org/jboss/portal/test/identity/ldap-beans.xml")
+@Tag(value = {"LDAP","generic"})
+public class LDAPGenericTest extends LDAPTestPOJO implements GenericTest.Context
+{
+
+ private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(LDAPGenericTest.class);
+
+ protected GenericTest genericTest = new GenericTest(this);
+
+ public void begin()
+ {
+ getHibernateSupport().openSession();
+ }
+
+ public void commit()
+ {
+ assertTrue(getHibernateSupport().commitTransaction());
+ }
+
+ @Create
+ public void create()
+ {
+ populate();
+ }
+
+ @Destroy
+ public void cleanup()
+ {
+ cleanUp();
+ }
+
+ @Test
+ public void testFindUsersUsingFilter() throws Exception
+ {
+ genericTest.testFindUsersUsingFilter();
+ }
+
+ @Test
+ public void testFindUser1() throws Exception
+ {
+ genericTest.testFindUser1();
+ }
+
+ @Test
+ public void testFindUser2() throws Exception
+ {
+ genericTest.testFindUser2();
+ }
+
+ @Test
+ public void testFindUsers() throws Exception
+ {
+ genericTest.testFindUsers();
+ }
+
+ @Test
+ public void testFindUsers2() throws Exception
+ {
+ genericTest.testFindUsers2();
+ }
+
+ @Test
+ public void testNonStandardUserNames() throws Exception
+ {
+ genericTest.testNonStandardUserNames();
+ }
+
+ @Test
+ public void testCreateUser() throws Exception
+ {
+ genericTest.testCreateUser();
+ }
+
+ @Test
+ public void testCreateRole() throws Exception
+ {
+ genericTest.testCreateRole();
+ }
+
+ @Test
+ public void testCountUser() throws Exception
+ {
+ genericTest.testCountUser();
+ }
+
+ @Test
+ public void testRemoveNonExistingRole() throws Exception
+ {
+ genericTest.testRemoveNonExistingRole();
+ }
+
+ @Test
+ public void testRemoveRole() throws Exception
+ {
+ genericTest.testRemoveRole();
+ }
+
+ @Test
+ public void testRemoveUser() throws Exception
+ {
+ genericTest.testRemoveUser();
+ }
+
+ @Test
+ public void testFindRoles() throws Exception
+ {
+ genericTest.testFindRoles();
+ }
+
+ @Test
+ public void testFindRoleMembers() throws Exception
+ {
+ genericTest.testFindRoleMembers();
+ }
+
+ @Test
+ public void testNullProperty() throws Exception
+ {
+ genericTest.testNullProperty();
+ }
+
+ @Test
+ public void testGetProperties() throws Exception
+ {
+ genericTest.testGetProperties();
+ }
+
+ @Test
+ public void testStaticProperty() throws Exception
+ {
+ genericTest.testStaticProperty();
+ }
+}
+
\ No newline at end of file
Deleted: modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPIdentityTestCase.java
===================================================================
--- modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPIdentityTestCase.java 2007-10-17 11:11:09 UTC (rev 8674)
+++ modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPIdentityTestCase.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -1,190 +0,0 @@
-package org.jboss.portal.test.identity.ldap;
-
-import org.jboss.portal.test.identity.IdentityTest;
-import org.jboss.portal.test.identity.TestServiceLoader;
-//import org.jboss.portal.identity.IdentityServiceControllerImpl;
-import org.jboss.portal.identity.IdentityContext;
-import org.jboss.portal.identity.UserModule;
-import org.jboss.portal.identity.RoleModule;
-import org.jboss.portal.identity.MembershipModule;
-import org.jboss.portal.identity.UserProfileModule;
-import org.jboss.portal.identity.service.UserModuleService;
-import org.jboss.portal.identity.service.RoleModuleService;
-import org.jboss.portal.identity.service.MembershipModuleService;
-import org.jboss.portal.identity.service.UserProfileModuleService;
-import org.apache.log4j.Appender;
-import org.apache.log4j.ConsoleAppender;
-import org.apache.log4j.SimpleLayout;
-import org.apache.log4j.Logger;
-import org.apache.log4j.Level;
-import junit.framework.TestSuite;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5748 $
- */
-public class LDAPIdentityTestCase extends LDAPTestCase implements IdentityTest.Context
-{
- private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(LDAPIdentityTestCase.class);
-
- static
- {
- Appender appender = new ConsoleAppender(new SimpleLayout());
- Logger.getRoot().addAppender(appender);
- Logger.getRoot().setLevel(Level.INFO);
- Logger.getLogger("org.jboss.portal.identity").setLevel(Level.INFO);
- }
-
- public static TestSuite suite() throws Exception
- {
- System.out.println("###");
- return createTestSuite(LDAPIdentityTestCase.class, "directories-identity.xml", "datasources.xml");
- }
-
- private UserModule userModule;
-
- private RoleModule roleModule;
-
- private MembershipModule membershipModule;
-
- private UserProfileModule userProfileModule;
-
- private IdentityTest utc;
-
-
-
- public void setUp() throws Exception
- {
- super.setUp();
-
- //bootstrap identity modules
-// IdentityServiceControllerImpl controller = new IdentityServiceControllerImpl();
-// controller.setConfigFile(getDirectoryServerConfigParameter().getConfigFile());
-// controller.setDefaultConfigFile("test/config/standardidentity-config.xml");
-// controller.setRegisterMBeans(false);
-// controller.start();
-//
-// identityContext = controller.getIdentityContext();
-
- identityContext = new TestServiceLoader().loadServices("test/config/standardidentity-config.xml", getDirectoryServerConfigParameter().getConfigFile());
-
-
- this.userModule = (UserModuleService)identityContext.getObject(IdentityContext.TYPE_USER_MODULE);
- this.roleModule = (RoleModuleService)identityContext.getObject(IdentityContext.TYPE_ROLE_MODULE);
- this.membershipModule = (MembershipModuleService)identityContext.getObject(IdentityContext.TYPE_MEMBERSHIP_MODULE);
- this.userProfileModule = (UserProfileModuleService)identityContext.getObject(IdentityContext.TYPE_USER_PROFILE_MODULE);
-
- populate();
- //
- utc = new IdentityTest();
- utc.setUserModule(userModule);
- utc.setRoleModule(roleModule);
- utc.setMembershipModule(membershipModule);
- utc.setUserProfileModule(userProfileModule);
- utc.setContext(this);
- utc.populate();
- }
-
-
-
-
-
-
- public void testWorking() throws Exception
- {
-
- }
-
- //
-
- public void testFindUsersUsingFilter() throws Exception
- {
- utc.testFindUsersUsingFilter();
- }
-
- public void testFindUser1() throws Exception
- {
- utc.testFindUser1();
- }
-
- public void testFindUser2() throws Exception
- {
- utc.testFindUser2();
- }
-
- public void testFindUsers() throws Exception
- {
- utc.testFindUsers();
- }
-
- public void testFindUsers2() throws Exception
- {
- utc.testFindUsers2();
- }
-
- public void testNonStandardUserNames() throws Exception
- {
- utc.testNonStandardUserNames();
- }
-
- public void testCreateUser() throws Exception
- {
- utc.testCreateUser();
- }
-
- public void testCreateRole() throws Exception
- {
- utc.testCreateRole();
- }
-
- public void testCountUser() throws Exception
- {
- utc.testCountUser();
- }
-
- public void testRemoveNonExistingRole() throws Exception
- {
- utc.testRemoveNonExistingRole();
- }
-
- public void testRemoveRole() throws Exception
- {
- utc.testRemoveRole();
- }
-
- public void testRemoveUser() throws Exception
- {
- utc.testRemoveUser();
- }
-
- public void testFindRoles() throws Exception
- {
- utc.testFindRoles();
- }
-
- public void testFindRoleMembers() throws Exception
- {
- utc.testFindRoleMembers();
- }
-
- public void testDynamicProperty() throws Exception
- {
- utc.testDynamicProperty();
- }
-
- public void testGetProperties() throws Exception
- {
- utc.testGetProperties();
- }
-
- public void testStaticProperty() throws Exception
- {
- utc.testStaticProperty();
- }
-
- public void testNullProperty() throws Exception
- {
- utc.testNullProperty();
- }
-
-}
Deleted: modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPMembershipModuleTestCase.java
===================================================================
--- modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPMembershipModuleTestCase.java 2007-10-17 11:11:09 UTC (rev 8674)
+++ modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPMembershipModuleTestCase.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -1,40 +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.portal.test.identity.ldap;
-
-import org.jboss.portal.test.identity.ldap.LDAPTestCase;
-//import org.jboss.portal.test.identity.MembershipStrategyTest;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
- * @version $Revision: 1.1 $
- */
-public abstract class LDAPMembershipModuleTestCase extends LDAPTestCase
-{
-
- public void setUp() throws Exception
- {
- super.setUp();
- }
-
-}
Copied: modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleRoleModuleTest.java (from rev 8668, modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleRoleModuleTestCase.java)
===================================================================
--- modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleRoleModuleTest.java (rev 0)
+++ modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleRoleModuleTest.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -0,0 +1,159 @@
+/******************************************************************************
+ * 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.portal.test.identity.ldap;
+
+import org.jboss.portal.identity.ldap.LDAPRoleImpl;
+import org.jboss.portal.identity.IdentityException;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.api.pojo.annotations.Tag;
+import static org.jboss.unit.api.Assert.*;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+
+import java.util.Set;
+import java.util.LinkedList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
+ * @version $Revision: 1.1 $
+ */
+@Bootstrap(resourceName = "/org/jboss/portal/test/identity/ldap-beans.xml")
+@Tag(value = {"LDAP","RoleModule","SimpleRoleModule"})
+public class LDAPSimpleRoleModuleTest extends LDAPTestPOJO
+{
+ private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(LDAPSimpleRoleModuleTest.class);
+
+ @Test
+ public void testFindRoleByName() throws Exception
+ {
+ LDAPRoleImpl ldapr = (LDAPRoleImpl)getRoleModule().findRoleByName("Echo");
+ assertEquals(ldapr.getDn().toLowerCase(), ("cn=Echo,ou=Roles," + suffix).toLowerCase());
+ assertEquals(ldapr.getName(), "Echo");
+ }
+
+ @Test
+ public void testRemoveRole() throws Exception
+ {
+ LDAPRoleImpl ldapr = (LDAPRoleImpl)getRoleModule().findRoleByName("Echo");
+ assertEquals(ldapr.getDn().toLowerCase(), ("cn=Echo,ou=Roles," + suffix).toLowerCase());
+ assertEquals(ldapr.getName(), "Echo");
+ getRoleModule().removeRole(ldapr.getId());
+ try
+ {
+ ldapr = (LDAPRoleImpl)getRoleModule().findRoleByName("Echo");
+ fail();
+ }
+ catch (IdentityException e)
+ {
+ //expected
+ }
+ //assertNull(ldapr);
+ }
+
+ @Test
+ public void testCreateRole() throws Exception
+ {
+ LDAPRoleImpl ldapr = (LDAPRoleImpl)getRoleModule().createRole("testRole", "testDisplayName");
+ assertNotNull(ldapr);
+ assertEquals("testRole", ldapr.getName());
+ //assertEquals("testDisplayName",ldapr.getDisplayName());
+
+ ldapr = (LDAPRoleImpl)getRoleModule().findRoleByName("testRole");
+ assertNotNull(ldapr);
+ getRoleModule().removeRole(ldapr.getId());
+
+
+ try
+ {
+ getRoleModule().findRoleByName("testRole");
+ fail("shouldn reach this");
+ }
+ catch (Exception e)
+ {
+ //expected
+ }
+ //assertNull(ldapr);
+
+ }
+
+ @Test
+ public void testgetRoleCount() throws Exception
+ {
+ LDAPRoleImpl ldapr = (LDAPRoleImpl)getRoleModule().findRoleByName("Echo");
+ assertEquals(ldapr.getDn().toLowerCase(), ("cn=Echo,ou=Roles," + suffix).toLowerCase());
+ assertEquals(ldapr.getName(), "Echo");
+
+ int count = getRoleModule().getRolesCount();
+ assertEquals(3, count);
+ }
+
+ @Test
+ public void testFindRolesByNames() throws Exception
+ {
+ Set roles = getRoleModule().findRolesByNames(new String[] {"Echo"});
+
+ assertEquals(1, roles.size());
+
+ List roleNames = new LinkedList();
+
+ for (Iterator iterator = roles.iterator(); iterator.hasNext();)
+ {
+ LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
+ roleNames.add(role.getDn().toLowerCase());
+ }
+ assertTrue(roleNames.contains(("cn=Echo,ou=Roles," + suffix).toLowerCase()));
+
+
+ //
+ roles = getRoleModule().findRolesByNames(new String[] {"Echo", "Echo1"});
+
+ assertEquals(2, roles.size());
+
+ roleNames = new LinkedList();
+
+ for (Iterator iterator = roles.iterator(); iterator.hasNext();)
+ {
+ LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
+ roleNames.add(role.getDn().toLowerCase());
+ }
+ assertTrue(roleNames.contains(("cn=Echo,ou=Roles," + suffix).toLowerCase()));
+ assertTrue(roleNames.contains(("cn=Echo1,ou=Roles," + suffix).toLowerCase()));
+
+ //
+ roles = getRoleModule().findRolesByNames(new String[] {"Echo", "Echo1", "TheDuke"});
+
+ assertEquals(3, roles.size());
+
+ roleNames = new LinkedList();
+
+ for (Iterator iterator = roles.iterator(); iterator.hasNext();)
+ {
+ LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
+ roleNames.add(role.getDn().toLowerCase());
+ }
+ assertTrue(roleNames.contains(("cn=Echo,ou=Roles," + suffix).toLowerCase()));
+ assertTrue(roleNames.contains(("cn=Echo1,ou=Roles," + suffix).toLowerCase()));
+ assertTrue(roleNames.contains(("cn=TheDuke,ou=Roles," + suffix).toLowerCase()));
+ }
+}
Deleted: modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleRoleModuleTestCase.java
===================================================================
--- modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleRoleModuleTestCase.java 2007-10-17 11:11:09 UTC (rev 8674)
+++ modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleRoleModuleTestCase.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -1,211 +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.portal.test.identity.ldap;
-
-import junit.framework.TestSuite;
-import org.jboss.portal.identity.RoleModule;
-import org.jboss.portal.identity.ldap.LDAPRoleImpl;
-import org.jboss.portal.identity.IdentityContext;
-//import org.jboss.portal.identity.IdentityServiceControllerImpl;
-import org.jboss.portal.identity.IdentityException;
-import org.jboss.portal.test.identity.ldap.LDAPTestCase;
-import org.jboss.portal.test.identity.TestServiceLoader;
-
-import java.util.Set;
-import java.util.LinkedList;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
- * @version $Revision: 1.1 $
- */
-public class LDAPSimpleRoleModuleTestCase extends LDAPTestCase
-{
- private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(LDAPSimpleRoleModuleTestCase.class);
-
- public static TestSuite suite() throws Exception
- {
- return createTestSuite(LDAPSimpleRoleModuleTestCase.class, "directories-simplerolemodule.xml", "datasources.xml");
- }
-
- RoleModule roleModule;
-
- private String suffix;
-
- public void setUp() throws Exception
- {
-
- super.setUp();
-
- /*IdentityContextImpl context = new IdentityContextImpl();
- context.start();
- identityContext = context;
-
- SimpleConfigurationImpl configuration = new SimpleConfigurationImpl();
- configuration.setIdentityContext(identityContext);
- configuration.setConfigFile(getDirectoryServerConfigParameter().getConfigFile());
- configuration.start();
-
- LDAPConnectionContext connection = new LDAPConnectionContext();
- connection.setIdentityContext(identityContext);
- connection.start();
-
- LDAPRoleModuleImpl roleModule = new LDAPRoleModuleImpl();
- roleModule.setIdentityContext(identityContext);
- //roleModule.setContainerDN("ou=Roles,dc=jboss,dc=org");
- //roleModule.setRidAttributeID("cn");
- roleModule.start();
- this.roleModule = roleModule;*/
-
-// IdentityServiceControllerImpl controller = new IdentityServiceControllerImpl();
-// controller.setConfigFile(getDirectoryServerConfigParameter().getConfigFile());
-// controller.setDefaultConfigFile("test/config/standardidentity-config.xml");
-// controller.setRegisterMBeans(false);
-// controller.start();
-// identityContext = controller.getIdentityContext();
-
- identityContext = new TestServiceLoader().loadServices("test/config/standardidentity-config.xml", getDirectoryServerConfigParameter().getConfigFile());
-
- this.roleModule = (RoleModule)identityContext.getObject(IdentityContext.TYPE_ROLE_MODULE);
-
- suffix = getDirectoryServerConfigParameter().getCleanUpDN();
-
- populate();
-
- }
-
-
- /*public void testFirstSimple() throws Exception
- {
- log.info("test framework works ;]");
- }*/
-
- public void testFindRoleByName() throws Exception
- {
- LDAPRoleImpl ldapr = (LDAPRoleImpl)roleModule.findRoleByName("Echo");
- assertEquals(ldapr.getDn().toLowerCase(), ("cn=Echo,ou=Roles," + suffix).toLowerCase());
- assertEquals(ldapr.getName(), "Echo");
- }
-
- public void testRemoveRole() throws Exception
- {
- LDAPRoleImpl ldapr = (LDAPRoleImpl)roleModule.findRoleByName("Echo");
- assertEquals(ldapr.getDn().toLowerCase(), ("cn=Echo,ou=Roles," + suffix).toLowerCase());
- assertEquals(ldapr.getName(), "Echo");
- roleModule.removeRole(ldapr.getId());
- try
- {
- ldapr = (LDAPRoleImpl)roleModule.findRoleByName("Echo");
- fail();
- }
- catch (IdentityException e)
- {
- //expected
- }
- //assertNull(ldapr);
- }
-
- public void testCreateRole() throws Exception
- {
- LDAPRoleImpl ldapr = (LDAPRoleImpl)roleModule.createRole("testRole", "testDisplayName");
- assertNotNull(ldapr);
- assertEquals("testRole", ldapr.getName());
- //assertEquals("testDisplayName",ldapr.getDisplayName());
-
- ldapr = (LDAPRoleImpl)roleModule.findRoleByName("testRole");
- assertNotNull(ldapr);
- roleModule.removeRole(ldapr.getId());
-
-
- try
- {
- roleModule.findRoleByName("testRole");
- fail("shouldn reach this");
- }
- catch (Exception e)
- {
- //expected
- }
- //assertNull(ldapr);
-
- }
-
- public void testgetRoleCount() throws Exception
- {
- LDAPRoleImpl ldapr = (LDAPRoleImpl)roleModule.findRoleByName("Echo");
- assertEquals(ldapr.getDn().toLowerCase(), ("cn=Echo,ou=Roles," + suffix).toLowerCase());
- assertEquals(ldapr.getName(), "Echo");
-
- int count = roleModule.getRolesCount();
- assertEquals(3, count);
- }
-
- public void testFindRolesByNames() throws Exception
- {
- Set roles = roleModule.findRolesByNames(new String[] {"Echo"});
-
- assertEquals(1, roles.size());
-
- List roleNames = new LinkedList();
-
- for (Iterator iterator = roles.iterator(); iterator.hasNext();)
- {
- LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
- roleNames.add(role.getDn().toLowerCase());
- }
- assertTrue(roleNames.contains(("cn=Echo,ou=Roles," + suffix).toLowerCase()));
-
-
- //
- roles = roleModule.findRolesByNames(new String[] {"Echo", "Echo1"});
-
- assertEquals(2, roles.size());
-
- roleNames = new LinkedList();
-
- for (Iterator iterator = roles.iterator(); iterator.hasNext();)
- {
- LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
- roleNames.add(role.getDn().toLowerCase());
- }
- assertTrue(roleNames.contains(("cn=Echo,ou=Roles," + suffix).toLowerCase()));
- assertTrue(roleNames.contains(("cn=Echo1,ou=Roles," + suffix).toLowerCase()));
-
- //
- roles = roleModule.findRolesByNames(new String[] {"Echo", "Echo1", "TheDuke"});
-
- assertEquals(3, roles.size());
-
- roleNames = new LinkedList();
-
- for (Iterator iterator = roles.iterator(); iterator.hasNext();)
- {
- LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
- roleNames.add(role.getDn().toLowerCase());
- }
- assertTrue(roleNames.contains(("cn=Echo,ou=Roles," + suffix).toLowerCase()));
- assertTrue(roleNames.contains(("cn=Echo1,ou=Roles," + suffix).toLowerCase()));
- assertTrue(roleNames.contains(("cn=TheDuke,ou=Roles," + suffix).toLowerCase()));
- }
-}
Copied: modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleUserModuleTest.java (from rev 8668, modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleUserModuleTestCase.java)
===================================================================
--- modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleUserModuleTest.java (rev 0)
+++ modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleUserModuleTest.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -0,0 +1,143 @@
+/******************************************************************************
+ * 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.portal.test.identity.ldap;
+
+import org.jboss.portal.identity.ldap.LDAPUserImpl;
+import org.jboss.portal.identity.User;
+import org.jboss.portal.identity.Role;
+import org.jboss.portal.identity.IdentityException;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.api.pojo.annotations.Tag;
+import static org.jboss.unit.api.Assert.*;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+
+import java.util.Set;
+import java.util.HashSet;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
+ * @version $Revision: 1.1 $
+ */
+@Bootstrap(resourceName = "/org/jboss/portal/test/identity/ldap-beans.xml")
+@Tag(value = {"LDAP","UserModule","SimpleUserModule"})
+public class LDAPSimpleUserModuleTest extends LDAPTestPOJO
+{
+ private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(LDAPSimpleUserModuleTest.class);
+
+ @Test
+ public void testFirstSimple() throws Exception
+ {
+
+ log.info("test framework works ;]");
+ }
+
+ @Test
+ public void testFindUserByName() throws Exception
+ {
+ LDAPUserImpl ldapu = (LDAPUserImpl)getUserModule().findUserByUserName("jduke");
+ assertEquals(ldapu.getDn().toLowerCase(), (userPrefix + "=jduke,ou=People," + suffix).toLowerCase());
+ assertEquals(ldapu.getUserName(), "jduke");
+ }
+
+ @Test
+ public void testRemoveUser() throws Exception
+ {
+ LDAPUserImpl ldapu = (LDAPUserImpl)getUserModule().findUserByUserName("jduke");
+ assertNotNull(ldapu);
+ assertEquals(ldapu.getDn().toLowerCase(), (userPrefix + "=jduke,ou=People," + suffix).toLowerCase());
+ getUserModule().removeUser(ldapu.getId());
+ try
+ {
+ getUserModule().findUserByUserName("jduke");
+ fail();
+ }
+ catch (IdentityException e)
+ {
+ //expected
+ }
+ //assertNull(ldapu);
+ }
+
+ @Test
+ public void testCreateUser() throws Exception
+ {
+ LDAPUserImpl ldapu = (LDAPUserImpl)getUserModule().createUser("testUser", "testPassword");
+ assertNotNull(ldapu);
+ assertEquals("testUser", ldapu.getUserName());
+
+ ldapu = (LDAPUserImpl)getUserModule().findUserByUserName("testUser");
+ assertNotNull(ldapu);
+ getUserModule().removeUser(ldapu.getId());
+
+ try
+ {
+ ldapu = (LDAPUserImpl)getUserModule().findUserByUserName("testUser");
+ fail();
+ }
+ catch (IdentityException e)
+ {
+ //expected
+ }
+ //assertNull(ldapu);
+
+ }
+
+ @Test
+ public void testgetUserCount() throws Exception
+ {
+ LDAPUserImpl ldapu = (LDAPUserImpl)getUserModule().findUserByUserName("jduke");
+ assertEquals(ldapu.getDn().toLowerCase(),(userPrefix + "=jduke,ou=People," + suffix).toLowerCase());
+ assertEquals(ldapu.getUserName(), "jduke");
+
+ int count = getUserModule().getUserCount();
+ assertEquals(5, count);
+ }
+
+ @Test
+ public void testPassword() throws Exception
+ {
+ getUserModule().createUser("testUser", "testPassword");
+ User u = getUserModule().findUserByUserName("testUser");
+ assertNotNull(u);
+ assertEquals("testUser", u.getUserName());
+ assertTrue(u.validatePassword("testPassword"));
+
+ Role r = getRoleModule().createRole("testRole", "testDisplayName");
+ Set a = new HashSet();
+ a.add(r);
+ getMembershipModule().assignRoles(u, a);
+ assertTrue(u.validatePassword("testPassword"));
+
+ getUserProfileModule().setProperty(u, User.INFO_USER_EMAIL_REAL, "testRealEmail");
+ assertTrue(u.validatePassword("testPassword"));
+
+
+ assertTrue(!u.validatePassword("1testPassword1"));
+ u.updatePassword("1testPassword1");
+ assertTrue(u.validatePassword("1testPassword1"));
+
+ }
+
+
+
+}
Deleted: modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleUserModuleTestCase.java
===================================================================
--- modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleUserModuleTestCase.java 2007-10-17 11:11:09 UTC (rev 8674)
+++ modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleUserModuleTestCase.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -1,187 +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.portal.test.identity.ldap;
-
-import junit.framework.TestSuite;
-import org.jboss.portal.identity.UserModule;
-import org.jboss.portal.identity.ldap.LDAPUserImpl;
-//import org.jboss.portal.identity.IdentityServiceControllerImpl;
-import org.jboss.portal.identity.IdentityContext;
-import org.jboss.portal.identity.User;
-import org.jboss.portal.identity.RoleModule;
-import org.jboss.portal.identity.MembershipModule;
-import org.jboss.portal.identity.UserProfileModule;
-import org.jboss.portal.identity.Role;
-import org.jboss.portal.identity.IdentityException;
-import org.jboss.portal.identity.IdentityConfiguration;
-import org.jboss.portal.test.identity.ldap.LDAPTestCase;
-import org.jboss.portal.test.identity.TestServiceLoader;
-
-import java.util.Set;
-import java.util.HashSet;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
- * @version $Revision: 1.1 $
- */
-public class LDAPSimpleUserModuleTestCase extends LDAPTestCase
-{
- private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(LDAPSimpleUserModuleTestCase.class);
-
- public static TestSuite suite() throws Exception
- {
- System.out.println("###");
- return createTestSuite(LDAPSimpleUserModuleTestCase.class, "directories-simpleusermodule.xml", "datasources.xml");
- }
-
- UserModule userModule;
-
- RoleModule roleModule;
-
- MembershipModule membershipModule;
-
- UserProfileModule userProfileModule;
-
-
-
- private String suffix;
-
- private String userPrefix;
-
- public void setUp() throws Exception
- {
- super.setUp();
-
-// IdentityServiceControllerImpl controller = new IdentityServiceControllerImpl();
-// controller.setConfigFile(getDirectoryServerConfigParameter().getConfigFile());
-// controller.setDefaultConfigFile("test/config/standardidentity-config.xml");
-// controller.setRegisterMBeans(false);
-// controller.start();
-// identityContext = controller.getIdentityContext();
-
- identityContext = new TestServiceLoader().loadServices("test/config/standardidentity-config.xml", getDirectoryServerConfigParameter().getConfigFile());
-
- userModule = (UserModule)identityContext.getObject(IdentityContext.TYPE_USER_MODULE);
- userModule = (UserModule)identityContext.getObject(IdentityContext.TYPE_USER_MODULE);
- roleModule = (RoleModule)identityContext.getObject(IdentityContext.TYPE_ROLE_MODULE);
- membershipModule = (MembershipModule)identityContext.getObject(IdentityContext.TYPE_MEMBERSHIP_MODULE);
- userProfileModule = (UserProfileModule)identityContext.getObject(IdentityContext.TYPE_USER_PROFILE_MODULE);
-
-
- suffix = getDirectoryServerConfigParameter().getCleanUpDN();
- userPrefix = ((IdentityConfiguration)identityContext.getObject(IdentityContext.TYPE_IDENTITY_CONFIGURATION)).getValue(IdentityConfiguration.USER_UID_ATTRIBUTE_ID);
-
- populate();
- }
-
-
- public void testFirstSimple() throws Exception
- {
- log.info("test framework works ;]");
- }
-
- public void testFindUserByName() throws Exception
- {
- LDAPUserImpl ldapu = (LDAPUserImpl)userModule.findUserByUserName("jduke");
- assertEquals(ldapu.getDn().toLowerCase(), (userPrefix + "=jduke,ou=People," + suffix).toLowerCase());
- assertEquals(ldapu.getUserName(), "jduke");
- }
-
- public void testRemoveUser() throws Exception
- {
- LDAPUserImpl ldapu = (LDAPUserImpl)userModule.findUserByUserName("jduke");
- assertNotNull(ldapu);
- assertEquals(ldapu.getDn().toLowerCase(), (userPrefix + "=jduke,ou=People," + suffix).toLowerCase());
- userModule.removeUser(ldapu.getId());
- try
- {
- userModule.findUserByUserName("jduke");
- fail();
- }
- catch (IdentityException e)
- {
- //expected
- }
- //assertNull(ldapu);
- }
-
- public void testCreateUser() throws Exception
- {
- LDAPUserImpl ldapu = (LDAPUserImpl)userModule.createUser("testUser", "testPassword");
- assertNotNull(ldapu);
- assertEquals("testUser", ldapu.getUserName());
-
- ldapu = (LDAPUserImpl)userModule.findUserByUserName("testUser");
- assertNotNull(ldapu);
- userModule.removeUser(ldapu.getId());
-
- try
- {
- ldapu = (LDAPUserImpl)userModule.findUserByUserName("testUser");
- fail();
- }
- catch (IdentityException e)
- {
- //expected
- }
- //assertNull(ldapu);
-
- }
-
- public void testgetUserCount() throws Exception
- {
- LDAPUserImpl ldapu = (LDAPUserImpl)userModule.findUserByUserName("jduke");
- assertEquals(ldapu.getDn().toLowerCase(),(userPrefix + "=jduke,ou=People," + suffix).toLowerCase());
- assertEquals(ldapu.getUserName(), "jduke");
-
- int count = userModule.getUserCount();
- assertEquals(5, count);
- }
-
- public void testPassword() throws Exception
- {
- userModule.createUser("testUser", "testPassword");
- User u = userModule.findUserByUserName("testUser");
- assertNotNull(u);
- assertEquals("testUser", u.getUserName());
- assertTrue(u.validatePassword("testPassword"));
-
- Role r = roleModule.createRole("testRole", "testDisplayName");
- Set a = new HashSet();
- a.add(r);
- membershipModule.assignRoles(u, a);
- assertTrue(u.validatePassword("testPassword"));
-
- userProfileModule.setProperty(u, User.INFO_USER_EMAIL_REAL, "testRealEmail");
- assertTrue(u.validatePassword("testPassword"));
-
-
- assertTrue(!u.validatePassword("1testPassword1"));
- u.updatePassword("1testPassword1");
- assertTrue(u.validatePassword("1testPassword1"));
-
- }
-
-
-
-}
Copied: modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticGroupMembershipModuleTest.java (from rev 8668, modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticGroupMembershipModuleTestCase.java)
===================================================================
--- modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticGroupMembershipModuleTest.java (rev 0)
+++ modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticGroupMembershipModuleTest.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -0,0 +1,158 @@
+/******************************************************************************
+ * 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.portal.test.identity.ldap;
+
+import org.jboss.portal.identity.ldap.LDAPRoleImpl;
+import org.jboss.portal.identity.ldap.LDAPUserImpl;
+import static org.jboss.unit.api.Assert.*;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.api.pojo.annotations.Tag;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+
+
+import java.util.Set;
+import java.util.Iterator;
+import java.util.HashSet;
+import java.util.List;
+import java.util.LinkedList;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
+ * @version $Revision: 1.1 $
+ */
+@Bootstrap(resourceName = "/org/jboss/portal/test/identity/ldap-beans.xml")
+@Tag(value = {"LDAP","MembershipModule","StaticGroupMembershipModule"})
+public class LDAPStaticGroupMembershipModuleTest extends LDAPTestPOJO
+{
+
+ private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(LDAPStaticGroupMembershipModuleTest.class);
+
+
+ @Test
+ public void testGetUsers() throws Exception
+ {
+ LDAPRoleImpl role = (LDAPRoleImpl)getRoleModule().findRoleByName("Echo");
+ Set users = getMembershipModule().getUsers(role);
+ assertEquals(3, users.size());
+
+ List names = new LinkedList();
+
+ for (Iterator iterator = users.iterator(); iterator.hasNext();)
+ {
+ LDAPUserImpl user = (LDAPUserImpl)iterator.next();
+ // fix assert for OpenLDAP (\2C --> \,)
+ names.add(user.getDn().replaceAll("\\\\2C", "\\\\,").toLowerCase());
+ }
+ assertTrue(names.contains((userPrefix + "=jduke1,ou=People," + suffix).toLowerCase()));
+ assertTrue(names.contains((userPrefix + "=jduke3,ou=People," + suffix).toLowerCase()));
+ assertTrue(names.contains((userPrefix + "=jduke4\\, Duke,ou=People," + suffix).toLowerCase()));
+ }
+
+ @Test
+ public void testGetRoles() throws Exception
+ {
+ LDAPUserImpl user = (LDAPUserImpl)getUserModule().findUserByUserName("jduke1");
+ Set roles = getMembershipModule().getRoles(user);
+ assertEquals(1, roles.size());
+
+ List roleNames = new LinkedList();
+
+ for (Iterator iterator = roles.iterator(); iterator.hasNext();)
+ {
+ LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
+ roleNames.add(role.getDn().toLowerCase());
+ }
+ assertTrue(roleNames.contains(("cn=Echo,ou=Roles," + suffix).toLowerCase()));
+
+ user = (LDAPUserImpl)getUserModule().findUserByUserName("jduke3");
+ roles = getMembershipModule().getRoles(user);
+ assertEquals(2, roles.size());
+
+ roleNames = new LinkedList();
+
+ for (Iterator iterator = roles.iterator(); iterator.hasNext();)
+ {
+ LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
+ roleNames.add(role.getDn().toLowerCase());
+ }
+ assertTrue(roleNames.contains(("cn=Echo,ou=Roles," + suffix).toLowerCase()));
+ assertTrue(roleNames.contains(("cn=Echo1,ou=Roles," + suffix).toLowerCase()));
+
+ }
+
+ @Test
+ public void testAssignRoles() throws Exception
+ {
+ Set users = new HashSet();
+ users.add((LDAPUserImpl)getUserModule().findUserByUserName("jduke1"));
+ users.add((LDAPUserImpl)getUserModule().findUserByUserName("jduke4, Duke"));
+ LDAPRoleImpl role = (LDAPRoleImpl)getRoleModule().findRoleByName("Echo1");
+ getMembershipModule().assignUsers(role,users);
+
+ users = getMembershipModule().getUsers(role);
+
+ assertEquals(2, users.size());
+
+ List names = new LinkedList();
+
+ for (Iterator iterator = users.iterator(); iterator.hasNext();)
+ {
+ LDAPUserImpl user = (LDAPUserImpl)iterator.next();
+ // fix assert for OpenLDAP (\2C --> \,)
+ names.add(user.getDn().replaceAll("\\\\2C", "\\\\,").toLowerCase());
+ }
+
+ assertTrue(names.contains((userPrefix + "=jduke1,ou=People," + suffix).toLowerCase()));
+ assertTrue(names.contains((userPrefix + "=jduke4\\, Duke,ou=People," + suffix).toLowerCase()));
+ }
+
+ @Test
+ public void testAssignUsers() throws Exception
+ {
+ Set users = new HashSet();
+ users.add(getUserModule().findUserByUserName("jduke3"));
+ users.add(getUserModule().findUserByUserName("jduke4, Duke"));
+ LDAPRoleImpl role = (LDAPRoleImpl)getRoleModule().findRoleByName("Echo1");
+ getMembershipModule().assignUsers(role,users);
+
+ users = getMembershipModule().getUsers(role);
+
+ assertEquals(2, users.size());
+
+ List names = new LinkedList();
+
+ for (Iterator iterator = users.iterator(); iterator.hasNext();)
+ {
+ LDAPUserImpl user = (LDAPUserImpl)iterator.next();
+ // fix assert for OpenLDAP (\2C --> \,)
+ names.add(user.getDn().replaceAll("\\\\2C", "\\\\,").toLowerCase());
+ }
+
+ assertTrue(names.contains((userPrefix + "=jduke3,ou=People," + suffix).toLowerCase()));
+ assertTrue(names.contains((userPrefix + "=jduke4\\, Duke,ou=People," + suffix).toLowerCase()));
+
+ }
+
+
+
+}
Deleted: modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticGroupMembershipModuleTestCase.java
===================================================================
--- modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticGroupMembershipModuleTestCase.java 2007-10-17 11:11:09 UTC (rev 8674)
+++ modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticGroupMembershipModuleTestCase.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -1,202 +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.portal.test.identity.ldap;
-
-import junit.framework.TestSuite;
-import org.jboss.portal.test.identity.ldap.LDAPMembershipModuleTestCase;
-import org.jboss.portal.test.identity.TestServiceLoader;
-import org.jboss.portal.identity.MembershipModule;
-import org.jboss.portal.identity.ldap.LDAPRoleImpl;
-import org.jboss.portal.identity.ldap.LDAPUserImpl;
-import org.jboss.portal.identity.IdentityContext;
-import org.jboss.portal.identity.UserModule;
-import org.jboss.portal.identity.RoleModule;
-//import org.jboss.portal.identity.IdentityServiceControllerImpl;
-import org.jboss.portal.identity.IdentityConfiguration;
-
-
-import java.util.Set;
-import java.util.Iterator;
-import java.util.HashSet;
-import java.util.List;
-import java.util.LinkedList;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
- * @version $Revision: 1.1 $
- */
-public class LDAPStaticGroupMembershipModuleTestCase extends LDAPMembershipModuleTestCase
-{
-
- private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(LDAPStaticGroupMembershipModuleTestCase.class);
-
- public static TestSuite suite() throws Exception
- {
- return createTestSuite(LDAPStaticGroupMembershipModuleTestCase.class, "directories-staticgroupmembership.xml", "datasources.xml");
- }
-
- private UserModule userModule;
-
- private RoleModule roleModule;
-
- private MembershipModule membershipModule;
-
- private String suffix;
-
- private String prefix;
-
- public void setUp() throws Exception
- {
- super.setUp();
-
-// IdentityServiceControllerImpl controller = new IdentityServiceControllerImpl();
-// controller.setConfigFile(getDirectoryServerConfigParameter().getConfigFile());
-// controller.setDefaultConfigFile("test/config/standardidentity-config.xml");
-// controller.setRegisterMBeans(false);
-// controller.start();
-// identityContext = controller.getIdentityContext();
-
- identityContext = new TestServiceLoader().loadServices("test/config/standardidentity-config.xml", getDirectoryServerConfigParameter().getConfigFile());
-
- userModule = (UserModule)identityContext.getObject(IdentityContext.TYPE_USER_MODULE);
- roleModule = (RoleModule)identityContext.getObject(IdentityContext.TYPE_ROLE_MODULE);
- membershipModule = (MembershipModule)identityContext.getObject(IdentityContext.TYPE_MEMBERSHIP_MODULE);
-
- suffix = getDirectoryServerConfigParameter().getCleanUpDN();
-
- prefix = ((IdentityConfiguration)identityContext.getObject(IdentityContext.TYPE_IDENTITY_CONFIGURATION)).getValue(IdentityConfiguration.USER_UID_ATTRIBUTE_ID);
-
-
- populate();
- }
-
- //TODO:extend this
- public void testGetUsers() throws Exception
- {
- LDAPRoleImpl role = (LDAPRoleImpl)roleModule.findRoleByName("Echo");
- Set users = membershipModule.getUsers(role);
- assertEquals(3, users.size());
-
- List names = new LinkedList();
-
- for (Iterator iterator = users.iterator(); iterator.hasNext();)
- {
- LDAPUserImpl user = (LDAPUserImpl)iterator.next();
- // fix assert for OpenLDAP (\2C --> \,)
- names.add(user.getDn().replaceAll("\\\\2C", "\\\\,").toLowerCase());
- }
- assertTrue(names.contains((prefix + "=jduke1,ou=People," + suffix).toLowerCase()));
- assertTrue(names.contains((prefix + "=jduke3,ou=People," + suffix).toLowerCase()));
- assertTrue(names.contains((prefix + "=jduke4\\, Duke,ou=People," + suffix).toLowerCase()));
- }
-
- //TODO:extend this
- public void testGetRoles() throws Exception
- {
- LDAPUserImpl user = (LDAPUserImpl)userModule.findUserByUserName("jduke1");
- Set roles = membershipModule.getRoles(user);
- assertEquals(1, roles.size());
-
- List roleNames = new LinkedList();
-
- for (Iterator iterator = roles.iterator(); iterator.hasNext();)
- {
- LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
- roleNames.add(role.getDn().toLowerCase());
- }
- assertTrue(roleNames.contains(("cn=Echo,ou=Roles," + suffix).toLowerCase()));
-
- user = (LDAPUserImpl)userModule.findUserByUserName("jduke3");
- roles = membershipModule.getRoles(user);
- assertEquals(2, roles.size());
-
- roleNames = new LinkedList();
-
- for (Iterator iterator = roles.iterator(); iterator.hasNext();)
- {
- LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
- roleNames.add(role.getDn().toLowerCase());
- }
- assertTrue(roleNames.contains(("cn=Echo,ou=Roles," + suffix).toLowerCase()));
- assertTrue(roleNames.contains(("cn=Echo1,ou=Roles," + suffix).toLowerCase()));
-
- }
-
-
- //TODO:extend this
- public void testAssignRoles() throws Exception
- {
- Set users = new HashSet();
- users.add((LDAPUserImpl)userModule.findUserByUserName("jduke1"));
- users.add((LDAPUserImpl)userModule.findUserByUserName("jduke4, Duke"));
- LDAPRoleImpl role = (LDAPRoleImpl)roleModule.findRoleByName("Echo1");
- membershipModule.assignUsers(role,users);
-
- users = membershipModule.getUsers(role);
-
- assertEquals(2, users.size());
-
- List names = new LinkedList();
-
- for (Iterator iterator = users.iterator(); iterator.hasNext();)
- {
- LDAPUserImpl user = (LDAPUserImpl)iterator.next();
- // fix assert for OpenLDAP (\2C --> \,)
- names.add(user.getDn().replaceAll("\\\\2C", "\\\\,").toLowerCase());
- }
-
- assertTrue(names.contains((prefix + "=jduke1,ou=People," + suffix).toLowerCase()));
- assertTrue(names.contains((prefix + "=jduke4\\, Duke,ou=People," + suffix).toLowerCase()));
- }
-
-
- //TODO:extend this
- public void testAssignUsers() throws Exception
- {
- Set users = new HashSet();
- users.add(userModule.findUserByUserName("jduke3"));
- users.add(userModule.findUserByUserName("jduke4, Duke"));
- LDAPRoleImpl role = (LDAPRoleImpl)roleModule.findRoleByName("Echo1");
- membershipModule.assignUsers(role,users);
-
- users = membershipModule.getUsers(role);
-
- assertEquals(2, users.size());
-
- List names = new LinkedList();
-
- for (Iterator iterator = users.iterator(); iterator.hasNext();)
- {
- LDAPUserImpl user = (LDAPUserImpl)iterator.next();
- // fix assert for OpenLDAP (\2C --> \,)
- names.add(user.getDn().replaceAll("\\\\2C", "\\\\,").toLowerCase());
- }
-
- assertTrue(names.contains((prefix + "=jduke3,ou=People," + suffix).toLowerCase()));
- assertTrue(names.contains((prefix + "=jduke4\\, Duke,ou=People," + suffix).toLowerCase()));
-
- }
-
-
-
-}
Copied: modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticRoleMembershipModuleTest.java (from rev 8668, modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticRoleMembershipModuleTestCase.java)
===================================================================
--- modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticRoleMembershipModuleTest.java (rev 0)
+++ modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticRoleMembershipModuleTest.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -0,0 +1,228 @@
+/*
+* 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.portal.test.identity.ldap;
+
+import org.jboss.portal.identity.ldap.LDAPRoleImpl;
+import org.jboss.portal.identity.ldap.LDAPUserImpl;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+import static org.jboss.unit.api.Assert.*;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.api.pojo.annotations.Tag;
+
+
+import java.util.Set;
+import java.util.List;
+import java.util.LinkedList;
+import java.util.Iterator;
+import java.util.HashSet;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
+ * @version $Revision: 1.1 $
+ */
+@Bootstrap(resourceName = "/org/jboss/portal/test/identity/ldap-beans.xml")
+@Tag(value = {"LDAP","MembershipModule","StaticRoleMembershipModule"})
+public class LDAPStaticRoleMembershipModuleTest extends LDAPTestPOJO
+{
+
+ private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(LDAPStaticRoleMembershipModuleTest.class);
+
+ @Test
+ public void testGetUsers() throws Exception
+ {
+ LDAPRoleImpl role = (LDAPRoleImpl)getRoleModule().findRoleByName("Echo");
+ Set users = getMembershipModule().getUsers(role);
+ assertEquals(3, users.size());
+
+ List names = new LinkedList();
+
+ for (Iterator iterator = users.iterator(); iterator.hasNext();)
+ {
+ LDAPUserImpl user = (LDAPUserImpl)iterator.next();
+ names.add(user.getDn().toLowerCase());
+ }
+ assertTrue(names.contains((userPrefix + "=jduke,ou=People,o=example2," + suffix).toLowerCase()));
+ assertTrue(names.contains((userPrefix + "=jduke1,ou=People,o=example2," + suffix).toLowerCase()));
+ assertTrue(names.contains((userPrefix + "=jduke2,ou=People,o=example2," + suffix).toLowerCase()));
+
+ role = (LDAPRoleImpl)getRoleModule().findRoleByName("Echo1");
+ users = getMembershipModule().getUsers(role);
+ assertEquals(2, users.size());
+
+ names = new LinkedList();
+
+ for (Iterator iterator = users.iterator(); iterator.hasNext();)
+ {
+ LDAPUserImpl user = (LDAPUserImpl)iterator.next();
+ names.add(user.getDn().toLowerCase());
+ }
+ assertTrue(names.contains((userPrefix + "=jduke1,ou=People,o=example2," + suffix).toLowerCase()));
+ assertTrue(names.contains((userPrefix + "=jduke2,ou=People,o=example2," + suffix).toLowerCase()));
+
+ role = (LDAPRoleImpl)getRoleModule().findRoleByName("TheDuke");
+ users = getMembershipModule().getUsers(role);
+ assertEquals(1, users.size());
+
+ names = new LinkedList();
+
+ for (Iterator iterator = users.iterator(); iterator.hasNext();)
+ {
+ LDAPUserImpl user = (LDAPUserImpl)iterator.next();
+ names.add(user.getDn().toLowerCase());
+ }
+ assertTrue(names.contains((userPrefix + "=jduke2,ou=People,o=example2," + suffix).toLowerCase()));
+
+ role = (LDAPRoleImpl)getRoleModule().findRoleByName("EmptyRole");
+ users = getMembershipModule().getUsers(role);
+ assertEquals(0, users.size());
+
+ }
+
+ @Test
+ public void testGetRoles() throws Exception
+ {
+ LDAPUserImpl user = (LDAPUserImpl)getUserModule().findUserByUserName("jduke");
+ Set roles = getMembershipModule().getRoles(user);
+ assertEquals(1, roles.size());
+
+ List roleNames = new LinkedList();
+
+ for (Iterator iterator = roles.iterator(); iterator.hasNext();)
+ {
+ LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
+ roleNames.add(role.getDn().toLowerCase());
+ }
+ assertTrue(roleNames.contains(("cn=Echo,ou=Roles,o=example2," + suffix).toLowerCase()));
+
+ user = (LDAPUserImpl)getUserModule().findUserByUserName("jduke1");
+ roles = getMembershipModule().getRoles(user);
+ assertEquals(2, roles.size());
+
+ roleNames = new LinkedList();
+
+ for (Iterator iterator = roles.iterator(); iterator.hasNext();)
+ {
+ LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
+ roleNames.add(role.getDn().toLowerCase());
+ }
+ assertTrue(roleNames.contains(("cn=Echo,ou=Roles,o=example2," + suffix).toLowerCase()));
+ assertTrue(roleNames.contains(("cn=Echo1,ou=Roles,o=example2," + suffix).toLowerCase()));
+
+ user = (LDAPUserImpl)getUserModule().findUserByUserName("jduke2");
+ roles = getMembershipModule().getRoles(user);
+ assertEquals(3, roles.size());
+
+ roleNames = new LinkedList();
+
+ for (Iterator iterator = roles.iterator(); iterator.hasNext();)
+ {
+ LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
+ roleNames.add(role.getDn().toLowerCase());
+ }
+ assertTrue(roleNames.contains(("cn=Echo,ou=Roles,o=example2," + suffix).toLowerCase()));
+ assertTrue(roleNames.contains(("cn=Echo1,ou=Roles,o=example2," + suffix).toLowerCase()));
+ assertTrue(roleNames.contains(("cn=TheDuke,ou=Roles,o=example2," + suffix).toLowerCase()));
+
+ user = (LDAPUserImpl)getUserModule().findUserByUserName("jduke3");
+ roles = getMembershipModule().getRoles(user);
+ assertEquals(0, roles.size());
+
+ }
+
+ @Test
+ public void testAssignRoles() throws Exception
+ {
+ Set roles = new HashSet();
+ roles.add(getRoleModule().findRoleByName("Echo"));
+ roles.add(getRoleModule().findRoleByName("TheDuke"));
+ LDAPUserImpl user = (LDAPUserImpl)getUserModule().findUserByUserName("jduke");
+ LDAPUserImpl user1 = (LDAPUserImpl)getUserModule().findUserByUserName("jduke4");
+ getMembershipModule().assignRoles(user,roles);
+ getMembershipModule().assignRoles(user1,roles);
+
+ roles = getMembershipModule().getRoles(user);
+
+ assertEquals(2, roles.size());
+
+ List names = new LinkedList();
+
+ for (Iterator iterator = roles.iterator(); iterator.hasNext();)
+ {
+ LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
+ names.add(role.getDn().toLowerCase());
+ }
+
+ assertTrue(names.contains(("cn=Echo,ou=Roles,o=example2," + suffix).toLowerCase()));
+ assertTrue(names.contains(("cn=TheDuke,ou=Roles,o=example2," + suffix).toLowerCase()));
+
+ roles = getMembershipModule().getRoles(user1);
+
+ assertEquals(2, roles.size());
+
+ names = new LinkedList();
+
+ for (Iterator iterator = roles.iterator(); iterator.hasNext();)
+ {
+ LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
+ names.add(role.getDn().toLowerCase());
+ }
+
+ assertTrue(names.contains(("cn=Echo,ou=Roles,o=example2," + suffix).toLowerCase()));
+ assertTrue(names.contains(("cn=TheDuke,ou=Roles,o=example2," + suffix).toLowerCase()));
+
+ getMembershipModule().assignRoles(user1,new HashSet());
+ roles = getMembershipModule().getRoles(user1);
+
+ assertEquals(0, roles.size());
+
+ }
+
+ @Test
+ public void testAssignUsers() throws Exception
+ {
+ Set users = new HashSet();
+ users.add(getUserModule().findUserByUserName("jduke3"));
+ users.add(getUserModule().findUserByUserName("jduke4"));
+ LDAPRoleImpl role = (LDAPRoleImpl)getRoleModule().findRoleByName("Echo1");
+ getMembershipModule().assignUsers(role,users);
+
+ users = getMembershipModule().getUsers(role);
+
+ assertEquals(2, users.size());
+
+ List names = new LinkedList();
+
+ for (Iterator iterator = users.iterator(); iterator.hasNext();)
+ {
+ LDAPUserImpl user = (LDAPUserImpl)iterator.next();
+ names.add(user.getDn().toLowerCase());
+ }
+
+ assertTrue(names.contains((userPrefix + "=jduke3,ou=People,o=example2," + suffix).toLowerCase()));
+ assertTrue(names.contains((userPrefix + "=jduke4,ou=People,o=example2," + suffix).toLowerCase()));
+
+ getMembershipModule().assignUsers(role,new HashSet());
+ users = getMembershipModule().getUsers(role);
+
+ assertEquals(0, users.size());
+ }
+}
Deleted: modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticRoleMembershipModuleTestCase.java
===================================================================
--- modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticRoleMembershipModuleTestCase.java 2007-10-17 11:11:09 UTC (rev 8674)
+++ modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticRoleMembershipModuleTestCase.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -1,295 +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.portal.test.identity.ldap;
-
-import junit.framework.TestSuite;
-import org.jboss.portal.identity.UserModule;
-import org.jboss.portal.identity.RoleModule;
-import org.jboss.portal.identity.MembershipModule;
-import org.jboss.portal.identity.IdentityConfiguration;
-import org.jboss.portal.identity.IdentityContext;
-//import org.jboss.portal.identity.IdentityServiceControllerImpl;
-import org.jboss.portal.identity.service.MembershipModuleService;
-import org.jboss.portal.identity.ldap.LDAPRoleImpl;
-import org.jboss.portal.identity.ldap.LDAPUserImpl;
-import org.jboss.portal.identity.ldap.LDAPStaticRoleMembershipModuleImpl;
-import org.jboss.portal.test.identity.TestServiceLoader;
-
-
-import java.util.Set;
-import java.util.List;
-import java.util.LinkedList;
-import java.util.Iterator;
-import java.util.HashSet;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
- * @version $Revision: 1.1 $
- */
-public class LDAPStaticRoleMembershipModuleTestCase extends LDAPMembershipModuleTestCase
-{
-
- private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(LDAPStaticRoleMembershipModuleTestCase.class);
-
- public static TestSuite suite() throws Exception
- {
- return createTestSuite(LDAPStaticRoleMembershipModuleTestCase.class, "directories-staticrolemembership.xml", "datasources.xml");
- }
-
- private UserModule userModule;
-
- private RoleModule roleModule;
-
- private MembershipModule membershipModule;
-
- private String suffix;
-
- private String prefix;
-
- public void setUp() throws Exception
- {
- super.setUp();
-
-// IdentityServiceControllerImpl controller = new IdentityServiceControllerImpl();
-// controller.setConfigFile(getDirectoryServerConfigParameter().getConfigFile());
-// controller.setDefaultConfigFile("test/config/standardidentity-config.xml");
-// controller.setRegisterMBeans(false);
-// controller.start();
-// identityContext = controller.getIdentityContext();
-
- identityContext = new TestServiceLoader().loadServices("test/config/standardidentity-config.xml", getDirectoryServerConfigParameter().getConfigFile());
-
-
- //swap the module for the proper one for this test
- //identityContext.unregister(IdentityContext.TYPE_MEMBERSHIP_MODULE);
- ((MembershipModuleService)identityContext.getObject(IdentityContext.TYPE_MEMBERSHIP_MODULE)).stop();
- MembershipModuleService membership = new LDAPStaticRoleMembershipModuleImpl();
- membership.setIdentityContext(identityContext);
- membership.setConnectionJNDIName("java:/portal/LDAPConnectionContext");
- membership.start();
-
- userModule = (UserModule)identityContext.getObject(IdentityContext.TYPE_USER_MODULE);
- roleModule = (RoleModule)identityContext.getObject(IdentityContext.TYPE_ROLE_MODULE);
- membershipModule = (MembershipModule)identityContext.getObject(IdentityContext.TYPE_MEMBERSHIP_MODULE);
-
- suffix = getDirectoryServerConfigParameter().getCleanUpDN();
-
- /*IdentityConfiguration configuration = (IdentityConfiguration)identityContext.getObject(IdentityContext.TYPE_IDENTITY_CONFIGURATION);
- Set values = new HashSet();
- values.add("ou=Roles,o=example2," + suffix);
- configuration.setValues(IdentityConfiguration.GROUP_COMMON,IdentityConfiguration.ROLE_CONTAINER_DN, values);
- values = new HashSet();
- values.add("ou=People,o=example2," + suffix);
- configuration.setValues(IdentityConfiguration.GROUP_COMMON, IdentityConfiguration.USER_CONTAINER_DN, values);
- values = new HashSet();
- values.add("memberOf");
- configuration.setValues(IdentityConfiguration.GROUP_COMMON,IdentityConfiguration.MEMBERSHIP_ATTRIBUTE_ID, values);*/
-
- prefix = ((IdentityConfiguration)identityContext.getObject(IdentityContext.TYPE_IDENTITY_CONFIGURATION)).getValue(IdentityConfiguration.USER_UID_ATTRIBUTE_ID);
-
-
-
- populate();
- }
-
- //TODO:extend this
- public void testGetUsers() throws Exception
- {
- LDAPRoleImpl role = (LDAPRoleImpl)roleModule.findRoleByName("Echo");
- Set users = membershipModule.getUsers(role);
- assertEquals(3, users.size());
-
- List names = new LinkedList();
-
- for (Iterator iterator = users.iterator(); iterator.hasNext();)
- {
- LDAPUserImpl user = (LDAPUserImpl)iterator.next();
- names.add(user.getDn().toLowerCase());
- }
- assertTrue(names.contains((prefix + "=jduke,ou=People,o=example2," + suffix).toLowerCase()));
- assertTrue(names.contains((prefix + "=jduke1,ou=People,o=example2," + suffix).toLowerCase()));
- assertTrue(names.contains((prefix + "=jduke2,ou=People,o=example2," + suffix).toLowerCase()));
-
- role = (LDAPRoleImpl)roleModule.findRoleByName("Echo1");
- users = membershipModule.getUsers(role);
- assertEquals(2, users.size());
-
- names = new LinkedList();
-
- for (Iterator iterator = users.iterator(); iterator.hasNext();)
- {
- LDAPUserImpl user = (LDAPUserImpl)iterator.next();
- names.add(user.getDn().toLowerCase());
- }
- assertTrue(names.contains((prefix + "=jduke1,ou=People,o=example2," + suffix).toLowerCase()));
- assertTrue(names.contains((prefix + "=jduke2,ou=People,o=example2," + suffix).toLowerCase()));
-
- role = (LDAPRoleImpl)roleModule.findRoleByName("TheDuke");
- users = membershipModule.getUsers(role);
- assertEquals(1, users.size());
-
- names = new LinkedList();
-
- for (Iterator iterator = users.iterator(); iterator.hasNext();)
- {
- LDAPUserImpl user = (LDAPUserImpl)iterator.next();
- names.add(user.getDn().toLowerCase());
- }
- assertTrue(names.contains((prefix + "=jduke2,ou=People,o=example2," + suffix).toLowerCase()));
-
- role = (LDAPRoleImpl)roleModule.findRoleByName("EmptyRole");
- users = membershipModule.getUsers(role);
- assertEquals(0, users.size());
-
- }
-
- //TODO:extend this
- public void testGetRoles() throws Exception
- {
- LDAPUserImpl user = (LDAPUserImpl)userModule.findUserByUserName("jduke");
- Set roles = membershipModule.getRoles(user);
- assertEquals(1, roles.size());
-
- List roleNames = new LinkedList();
-
- for (Iterator iterator = roles.iterator(); iterator.hasNext();)
- {
- LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
- roleNames.add(role.getDn().toLowerCase());
- }
- assertTrue(roleNames.contains(("cn=Echo,ou=Roles,o=example2," + suffix).toLowerCase()));
-
- user = (LDAPUserImpl)userModule.findUserByUserName("jduke1");
- roles = membershipModule.getRoles(user);
- assertEquals(2, roles.size());
-
- roleNames = new LinkedList();
-
- for (Iterator iterator = roles.iterator(); iterator.hasNext();)
- {
- LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
- roleNames.add(role.getDn().toLowerCase());
- }
- assertTrue(roleNames.contains(("cn=Echo,ou=Roles,o=example2," + suffix).toLowerCase()));
- assertTrue(roleNames.contains(("cn=Echo1,ou=Roles,o=example2," + suffix).toLowerCase()));
-
- user = (LDAPUserImpl)userModule.findUserByUserName("jduke2");
- roles = membershipModule.getRoles(user);
- assertEquals(3, roles.size());
-
- roleNames = new LinkedList();
-
- for (Iterator iterator = roles.iterator(); iterator.hasNext();)
- {
- LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
- roleNames.add(role.getDn().toLowerCase());
- }
- assertTrue(roleNames.contains(("cn=Echo,ou=Roles,o=example2," + suffix).toLowerCase()));
- assertTrue(roleNames.contains(("cn=Echo1,ou=Roles,o=example2," + suffix).toLowerCase()));
- assertTrue(roleNames.contains(("cn=TheDuke,ou=Roles,o=example2," + suffix).toLowerCase()));
-
- user = (LDAPUserImpl)userModule.findUserByUserName("jduke3");
- roles = membershipModule.getRoles(user);
- assertEquals(0, roles.size());
-
- }
-
-
- //TODO:extend this
- public void testAssignRoles() throws Exception
- {
- Set roles = new HashSet();
- roles.add(roleModule.findRoleByName("Echo"));
- roles.add(roleModule.findRoleByName("TheDuke"));
- LDAPUserImpl user = (LDAPUserImpl)userModule.findUserByUserName("jduke");
- LDAPUserImpl user1 = (LDAPUserImpl)userModule.findUserByUserName("jduke4");
- membershipModule.assignRoles(user,roles);
- membershipModule.assignRoles(user1,roles);
-
- roles = membershipModule.getRoles(user);
-
- assertEquals(2, roles.size());
-
- List names = new LinkedList();
-
- for (Iterator iterator = roles.iterator(); iterator.hasNext();)
- {
- LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
- names.add(role.getDn().toLowerCase());
- }
-
- assertTrue(names.contains(("cn=Echo,ou=Roles,o=example2," + suffix).toLowerCase()));
- assertTrue(names.contains(("cn=TheDuke,ou=Roles,o=example2," + suffix).toLowerCase()));
-
- roles = membershipModule.getRoles(user1);
-
- assertEquals(2, roles.size());
-
- names = new LinkedList();
-
- for (Iterator iterator = roles.iterator(); iterator.hasNext();)
- {
- LDAPRoleImpl role = (LDAPRoleImpl)iterator.next();
- names.add(role.getDn().toLowerCase());
- }
-
- assertTrue(names.contains(("cn=Echo,ou=Roles,o=example2," + suffix).toLowerCase()));
- assertTrue(names.contains(("cn=TheDuke,ou=Roles,o=example2," + suffix).toLowerCase()));
-
- membershipModule.assignRoles(user1,new HashSet());
- roles = membershipModule.getRoles(user1);
-
- assertEquals(0, roles.size());
-
- }
-
-
- //TODO:extend this
- public void testAssignUsers() throws Exception
- {
- Set users = new HashSet();
- users.add(userModule.findUserByUserName("jduke3"));
- users.add(userModule.findUserByUserName("jduke4"));
- LDAPRoleImpl role = (LDAPRoleImpl)roleModule.findRoleByName("Echo1");
- membershipModule.assignUsers(role,users);
-
- users = membershipModule.getUsers(role);
-
- assertEquals(2, users.size());
-
- List names = new LinkedList();
-
- for (Iterator iterator = users.iterator(); iterator.hasNext();)
- {
- LDAPUserImpl user = (LDAPUserImpl)iterator.next();
- names.add(user.getDn().toLowerCase());
- }
-
- assertTrue(names.contains((prefix + "=jduke3,ou=People,o=example2," + suffix).toLowerCase()));
- assertTrue(names.contains((prefix + "=jduke4,ou=People,o=example2," + suffix).toLowerCase()));
-
- membershipModule.assignUsers(role,new HashSet());
- users = membershipModule.getUsers(role);
-
- assertEquals(0, users.size());
- }
-}
Deleted: modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPTestCase.java
===================================================================
--- modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPTestCase.java 2007-10-17 11:11:09 UTC (rev 8674)
+++ modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPTestCase.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -1,294 +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.portal.test.identity.ldap;
-
-//import org.apache.directory.server.protocol.shared.store.LdifFileLoader;
-import org.apache.log4j.Appender;
-import org.apache.log4j.ConsoleAppender;
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.apache.log4j.SimpleLayout;
-import org.jboss.portal.identity.IdentityContext;
-import org.jboss.portal.test.framework.mc.TestRuntimeContext;
-import org.jboss.portal.test.framework.embedded.DSConfig;
-import org.jboss.portal.test.framework.embedded.DataSourceSupport;
-import org.jboss.portal.test.framework.embedded.HibernateSupport;
-import org.jboss.portal.test.framework.junit.JUnitAdapter;
-import org.jboss.portal.test.framework.junit.POJOJUnitTest;
-import org.opends.server.tools.LDAPModify;
-//import org.jboss.portal.test.framework.embedded.apacheds.ApacheDSService;
-
-import javax.naming.Binding;
-import javax.naming.Context;
-import javax.naming.NamingEnumeration;
-import javax.naming.directory.DirContext;
-import javax.naming.directory.InitialDirContext;
-import java.net.URL;
-import java.util.Hashtable;
-import java.util.Map;
-import java.util.HashMap;
-import java.io.File;
-
-import junit.framework.TestSuite;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @author <a href="mailto:boleslaw dot dawidowicz at jboss dot com">Boleslaw Dawidowicz</a>
- * @version $Revision: 5247 $
- */
-public abstract class LDAPTestCase extends junit.framework.TestCase
-{
-
- private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(LDAPTestCase.class);
-
- static
- {
- Appender appender = new ConsoleAppender(new SimpleLayout());
- Logger.getRoot().addAppender(appender);
- Logger.getRoot().setLevel(Level.INFO);
- Logger.getLogger("org.jboss.portal.identity").setLevel(Level.DEBUG);
- }
-
- public static TestSuite createTestSuite(Class clazz, String directories, String datasources) throws Exception
- {
- URL directoriesURL = Thread.currentThread().getContextClassLoader().getResource(directories);
- URL datasourcesURL = Thread.currentThread().getContextClassLoader().getResource(datasources);
- Map parameterMap = new HashMap();
- parameterMap.put("DirectoryServerConfig", DSConfig.fromXML2(directoriesURL));
- parameterMap.put("DataSourceConfig", DataSourceSupport.Config.fromXML2(datasourcesURL));
- POJOJUnitTest abc = new POJOJUnitTest(clazz);
- JUnitAdapter adapter = new JUnitAdapter(abc, parameterMap);
- TestSuite suite = new TestSuite();
- suite.addTest(adapter);
- return suite;
- }
-
- public static TestSuite createTestSuite(Class clazz) throws Exception
- {
- return createTestSuite(clazz, "directories.xml", "datasources.xml");
- }
-
- public LDAPTestCase()
- {
-
- }
-
- public LDAPTestCase(DSConfig dsConfig)
- {
- this.directoryServerConfigParameter = dsConfig;
- }
-
- protected TestRuntimeContext runtimeContext;
-
- protected IdentityContext identityContext;
-
- private DSConfig directoryServerConfigParameter;
-
- protected DataSourceSupport.Config dataSourceConfigParameter;
- //protected OpenDSService embeddedDSService;
-
- protected HibernateSupport hibernate;
-
- public String getName()
- {
- return super.getName() + "," + directoryServerConfigParameter.getName() + "," + directoryServerConfigParameter.getDescription();
- }
-
- public DSConfig getDirectoryServerConfigParameter()
- {
- return directoryServerConfigParameter;
- }
-
- public void setDirectoryServerConfigParameter(DSConfig directoryServerConfigParameter)
- {
- this.directoryServerConfigParameter = directoryServerConfigParameter;
- }
-
- public DataSourceSupport.Config getDataSourceConfigParameter()
- {
- return dataSourceConfigParameter;
- }
-
- public void setDataSourceConfigParameter(DataSourceSupport.Config dataSourceConfig)
- {
- this.dataSourceConfigParameter = dataSourceConfig;
- }
-
- public void setUp() throws Exception
- {
- hibernate = new HibernateSupport();
-
- runtimeContext = new TestRuntimeContext("org/jboss/portal/test/identity/ldap-beans.xml");
- runtimeContext.addBean("LDAPTestBean", this);
-
- runtimeContext.addBean("HibernateSupport", hibernate);
- runtimeContext.addBean("DataSourceConfig", dataSourceConfigParameter);
- HibernateSupport.Config config = HibernateSupport.getConfig(dataSourceConfigParameter.getName());
- runtimeContext.addBean("HibernateConfig", config);
- runtimeContext.start();
-
- runtimeContext.start();
-
- //populate();
- }
-
- public void tearDown() throws Exception
- {
-
- //on exit remove dc=jboss,dc=org
- cleanUp();
-
- runtimeContext.stop();
-
- /*if (embeddedDSService != null && directoryServerConfigParameter.isUseEmbedded())
- {
- embeddedDSService.stop();
- }*/
- }
-
-
- public void begin()
- {
- hibernate.openSession();
- }
-
-
- public void commit()
- {
- assertTrue(hibernate.commitTransaction());
- }
-
- protected void populate()
- {
- try
- {
- //on start load the content into ldap
- log.info("Populate directory...");
-
- DirContext ctx = getDirContext();
- ClassLoader tcl = Thread.currentThread().getContextClassLoader();
-
- //URL ldif = tcl.getResource("ldap/ldif/example1.ldif");
- URL ldif = tcl.getResource(directoryServerConfigParameter.getPopulateLdif());
-
- if (ldif == null)
- {
- log.error("ldif not found: " + directoryServerConfigParameter.getPopulateLdif());
- }
- log.info("ldif to load by loader: " + ldif.getPath());
-
- /* LdifFileLoader loader = new LdifFileLoader(ctx, ldi+f.getPath());
- loader.execute();*/
-
- //String fileurl = this.getResourceURL("security/opends/ldif/example1.ldif");
- //URL url = this.getDeployURL(fileurl);
- log.debug("ldap add ldif url="+ldif);
- File file = new File(ldif.getPath());
- String[] cmd = new String[] {"-h", directoryServerConfigParameter.getHost(),
- "-p", directoryServerConfigParameter.getPort(),
- "-D", directoryServerConfigParameter.getAdminDN(),
- "-w", directoryServerConfigParameter.getAdminPassword(),
- "-a", "-f",file.getPath()};
-
- System.out.println("Populate success: :" + (LDAPModify.mainModify(cmd) == 0));
- }
- catch (Exception e)
- {
- log.info("fail to import initial ldif for tests", e);
- }
- }
-
- protected void cleanUp()
- {
- try
- {
- log.info("Cleanup directory...");
- DirContext ctx = getDirContext();
- String fullDN = directoryServerConfigParameter.getCleanUpDN();
- //String[] parts = fullDN.split(",");
-
- String removeContext = fullDN;
-
- String suffix = fullDN.substring(fullDN.indexOf(",")+1,fullDN.length());
-
- log.debug("Clean up: \'" + removeContext + "\' from \'" + suffix + "\'");
-
-
- DirContext org = ctx;
-
-
- removeContext(org, removeContext);
- }
- catch (Exception e)
- {
- log.info("fail to unbind content from tests", e);
- }
- }
-
-
- protected DirContext getDirContext() throws Exception
- {
- Hashtable env = new Hashtable();
- env.put(Context.INITIAL_CONTEXT_FACTORY, directoryServerConfigParameter.getContextFactory());
-
- env.put(Context.PROVIDER_URL, directoryServerConfigParameter.getURL());
- //env.put(Context.SECURITY_AUTHENTICATION, "simple");
- env.put(Context.SECURITY_PRINCIPAL, directoryServerConfigParameter.getAdminDN());
- env.put(Context.SECURITY_CREDENTIALS, directoryServerConfigParameter.getAdminPassword());
- return new InitialDirContext(env);
- }
-
- //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 LDAPConnectionContext createConnectionContext()
- {
- *//*return new LDAPConnectionContext(directoryServerConfigParameter.getName(),
- directoryServerConfigParameter.getURL(),
- directoryServerConfigParameter.getContextFactory(),
- directoryServerConfigParameter.getAdminDN(),
- directoryServerConfigParameter.getAdminPassword(),
- null,
- "simple");*//*
- LDAPConnectionContext conn = new LDAPConnectionContext();
- conn.setIdentityContext(identityContext);
-
-
- }*/
-
-
-}
Copied: modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPTestPOJO.java (from rev 8668, modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPTestCase.java)
===================================================================
--- modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPTestPOJO.java (rev 0)
+++ modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPTestPOJO.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -0,0 +1,231 @@
+/******************************************************************************
+ * 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.portal.test.identity.ldap;
+
+import org.jboss.beans.metadata.plugins.annotations.Inject;
+import org.jboss.portal.test.framework.embedded.DSConfig;
+import org.jboss.portal.test.identity.IdentityTestPOJO;
+import org.jboss.portal.identity.IdentityConfiguration;
+import org.jboss.portal.identity.IdentityContext;
+import org.jboss.unit.api.pojo.annotations.Parameter;
+import org.jboss.unit.api.pojo.annotations.Create;
+import org.jboss.unit.api.pojo.annotations.Destroy;
+import org.opends.server.tools.LDAPModify;
+
+import javax.naming.Binding;
+import javax.naming.Context;
+import javax.naming.NamingEnumeration;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.InitialDirContext;
+import java.io.File;
+import java.net.URL;
+import java.util.Hashtable;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:boleslaw dot dawidowicz at jboss dot com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 5247 $
+ */
+
+public abstract class LDAPTestPOJO extends IdentityTestPOJO
+{
+
+ private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(LDAPTestPOJO.class);
+
+ protected DSConfig directoryConfig;
+
+ private String directories;
+
+ private String directoryName;
+
+ protected String suffix;
+
+ protected String userPrefix;
+
+
+
+
+ @Create
+ public void create() throws Exception
+ {
+ suffix = getDirectoryConfig().getCleanUpDN();
+ userPrefix = ((IdentityConfiguration)getIdentityContext().getObject(IdentityContext.TYPE_IDENTITY_CONFIGURATION)).getValue(IdentityConfiguration.USER_UID_ATTRIBUTE_ID);
+
+ populate();
+ }
+
+ @Destroy
+ public void cleanup()
+ {
+ cleanUp();
+ }
+
+ @Parameter(name = "directories")
+ public void setDirectories(String directories)
+ {
+ this.directories = directories;
+ }
+
+ @Parameter(name="directoryName")
+ public void setDirectoryName(String directoryName)
+ {
+ this.directoryName = directoryName;
+ }
+
+ @Inject(bean = "DirectoryConfig")
+ public void setDirectoryConfig(DSConfig directoryConfig)
+ {
+ this.directoryConfig = directoryConfig;
+ }
+
+ public DSConfig getDirectoryConfig()
+ {
+ return directoryConfig;
+ }
+
+ public String getDirectories()
+ {
+ return directories;
+ }
+
+ public String getDirectoryName()
+ {
+ return directoryName;
+ }
+
+
+ protected void populate()
+ {
+ try
+ {
+ //on start load the content into ldap
+ log.info("Populate directory...");
+
+ DirContext ctx = getDirContext();
+ ClassLoader tcl = Thread.currentThread().getContextClassLoader();
+
+ //URL ldif = tcl.getResource("ldap/ldif/example1.ldif");
+
+ URL ldif = tcl.getResource(getDirectoryConfig().getPopulateLdif());
+
+ if (ldif == null)
+ {
+ log.error("ldif not found: " + getDirectoryConfig().getPopulateLdif());
+ }
+ System.out.println("ldif to load by loader: " + ldif.getPath());
+
+ /* LdifFileLoader loader = new LdifFileLoader(ctx, ldi+f.getPath());
+ loader.execute();*/
+
+ //String fileurl = this.getResourceURL("security/opends/ldif/example1.ldif");
+ //URL url = this.getDeployURL(fileurl);
+ log.debug("ldap add ldif url="+ldif);
+ File file = new File(ldif.getPath());
+ String[] cmd = new String[] {"-h", getDirectoryConfig().getHost(),
+ "-p", getDirectoryConfig().getPort(),
+ "-D", getDirectoryConfig().getAdminDN(),
+ "-w", getDirectoryConfig().getAdminPassword(),
+ "-a", "-f",file.getPath()};
+
+ System.out.println("Populate success: :" + (LDAPModify.mainModify(cmd) == 0));
+ }
+ catch (Exception e)
+ {
+ log.info("fail to import initial ldif for tests", e);
+ }
+ }
+
+ protected void cleanUp()
+ {
+ try
+ {
+ log.info("Cleanup directory...");
+ DirContext ctx = getDirContext();
+ String fullDN = getDirectoryConfig().getCleanUpDN();
+ //String[] parts = fullDN.split(",");
+
+ String removeContext = fullDN;
+
+ String suffix = fullDN.substring(fullDN.indexOf(",")+1,fullDN.length());
+
+ log.debug("Clean up: \'" + removeContext + "\' from \'" + suffix + "\'");
+
+
+ DirContext org = ctx;
+
+
+ removeContext(org, removeContext);
+ }
+ catch (Exception e)
+ {
+ log.info("fail to unbind content from tests", e);
+ }
+ }
+
+
+ protected DirContext getDirContext() throws Exception
+ {
+ Hashtable env = new Hashtable();
+ env.put(Context.INITIAL_CONTEXT_FACTORY, getDirectoryConfig().getContextFactory());
+
+ env.put(Context.PROVIDER_URL, getDirectoryConfig().getURL());
+ //env.put(Context.SECURITY_AUTHENTICATION, "simple");
+ env.put(Context.SECURITY_PRINCIPAL, getDirectoryConfig().getAdminDN());
+ env.put(Context.SECURITY_CREDENTIALS, getDirectoryConfig().getAdminPassword());
+ return new InitialDirContext(env);
+ }
+
+ //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 LDAPConnectionContext createConnectionContext()
+ {
+ *//*return new LDAPConnectionContext(getDirectoryConfig().getName(),
+ getDirectoryConfig().getURL(),
+ getDirectoryConfig().getContextFactory(),
+ getDirectoryConfig().getAdminDN(),
+ getDirectoryConfig().getAdminPassword(),
+ null,
+ "simple");*//*
+ LDAPConnectionContext conn = new LDAPConnectionContext();
+ conn.setIdentityContext(identityContext);
+
+
+ }*/
+
+
+}
Modified: modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPUserProfileModuleTestCase.java
===================================================================
--- modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPUserProfileModuleTestCase.java 2007-10-17 11:11:09 UTC (rev 8674)
+++ modules/identity/trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPUserProfileModuleTestCase.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -21,81 +21,56 @@
*/
package org.jboss.portal.test.identity.ldap;
-import junit.framework.TestSuite;
import org.jboss.portal.identity.UserModule;
import org.jboss.portal.identity.RoleModule;
import org.jboss.portal.identity.MembershipModule;
-//import org.jboss.portal.identity.IdentityServiceControllerImpl;
-import org.jboss.portal.identity.IdentityContext;
import org.jboss.portal.identity.UserProfileModule;
import org.jboss.portal.identity.User;
import org.jboss.portal.identity.ldap.LDAPUserImpl;
-import org.jboss.portal.test.identity.TestServiceLoader;
+import static org.jboss.unit.api.Assert.*;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.api.pojo.annotations.Tag;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+
/**
* @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
* @version $Revision: 1.1 $
*/
-public class LDAPUserProfileModuleTestCase extends LDAPTestCase
+@Bootstrap(resourceName = "/org/jboss/portal/test/identity/ldap-beans.xml")
+@Tag(value = {"LDAP","UserProfileModule"})
+public class LDAPUserProfileModuleTestCase extends LDAPTestPOJO
{
private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(LDAPUserProfileModuleTestCase.class);
- public static TestSuite suite() throws Exception
+ public void begin()
{
- return createTestSuite(LDAPUserProfileModuleTestCase.class, "directories-userprofilemodule.xml", "datasources.xml");
+ getHibernateSupport().openSession();
}
- private UserModule userModule;
-
- private RoleModule roleModule;
-
- private MembershipModule membershipModule;
-
- private UserProfileModule userProfileModule;
-
- private String suffix;
-
- public void setUp() throws Exception
+ public void commit()
{
- super.setUp();
-
-// IdentityServiceControllerImpl controller = new IdentityServiceControllerImpl();
-// controller.setConfigFile(getDirectoryServerConfigParameter().getConfigFile());
-// controller.setDefaultConfigFile("test/config/standardidentity-config.xml");
-// controller.setRegisterMBeans(false);
-// controller.start();
-// identityContext = controller.getIdentityContext();
-
- identityContext = new TestServiceLoader().loadServices("test/config/standardidentity-config.xml", getDirectoryServerConfigParameter().getConfigFile());
-
- userModule = (UserModule)identityContext.getObject(IdentityContext.TYPE_USER_MODULE);
- roleModule = (RoleModule)identityContext.getObject(IdentityContext.TYPE_ROLE_MODULE);
- membershipModule = (MembershipModule)identityContext.getObject(IdentityContext.TYPE_MEMBERSHIP_MODULE);
- userProfileModule = (UserProfileModule)identityContext.getObject(IdentityContext.TYPE_USER_PROFILE_MODULE);
-
- suffix = getDirectoryServerConfigParameter().getCleanUpDN();
-
-
- populate();
+ assertTrue(getHibernateSupport().commitTransaction());
}
+ @Test
public void testSetPropertyWithDB() throws Exception
{
begin();
- LDAPUserImpl ldapu = (LDAPUserImpl)userModule.findUserByUserName("jduke");
- assertEquals("email(a)email.com", userProfileModule.getProperty(ldapu, User.INFO_USER_EMAIL_REAL));
- userProfileModule.setProperty(ldapu, User.INFO_USER_EMAIL_REAL, "toto(a)toto.com");
- assertEquals("toto(a)toto.com", userProfileModule.getProperty(ldapu, User.INFO_USER_EMAIL_REAL));
+ LDAPUserImpl ldapu = (LDAPUserImpl)getUserModule().findUserByUserName("jduke");
+ assertEquals("email(a)email.com", getUserProfileModule().getProperty(ldapu, User.INFO_USER_EMAIL_REAL));
+ getUserProfileModule().setProperty(ldapu, User.INFO_USER_EMAIL_REAL, "toto(a)toto.com");
+ assertEquals("toto(a)toto.com", getUserProfileModule().getProperty(ldapu, User.INFO_USER_EMAIL_REAL));
-// userProfileModule.setProperty(ldapu, User.INFO_USER_SIGNATURE, "sig sig");
-// assertEquals("sig sig", userProfileModule.getProperty(ldapu, User.INFO_USER_SIGNATURE));
+// ctx.getUserProfileModule().setProperty(ldapu, User.INFO_USER_SIGNATURE, "sig sig");
+// assertEquals("sig sig", ctx.getUserProfileModule().getProperty(ldapu, User.INFO_USER_SIGNATURE));
- userProfileModule.setProperty(ldapu, User.INFO_USER_IM_SKYPE, "skype me");
- assertEquals("skype me", userProfileModule.getProperty(ldapu, User.INFO_USER_IM_SKYPE));
+ getUserProfileModule().setProperty(ldapu, User.INFO_USER_IM_SKYPE, "skype me");
+ assertEquals("skype me", getUserProfileModule().getProperty(ldapu, User.INFO_USER_IM_SKYPE));
- userProfileModule.setProperty(ldapu, User.INFO_USER_OCCUPATION, "krawiec");
- assertEquals("krawiec", userProfileModule.getProperty(ldapu, User.INFO_USER_OCCUPATION));
+ getUserProfileModule().setProperty(ldapu, User.INFO_USER_OCCUPATION, "krawiec");
+ assertEquals("krawiec", getUserProfileModule().getProperty(ldapu, User.INFO_USER_OCCUPATION));
commit();
}
Added: modules/identity/trunk/identity/src/resources/log4j.properties
===================================================================
--- modules/identity/trunk/identity/src/resources/log4j.properties (rev 0)
+++ modules/identity/trunk/identity/src/resources/log4j.properties 2007-10-17 13:05:03 UTC (rev 8675)
@@ -0,0 +1,10 @@
+# Set root category priority to INFO and its only appender to CONSOLE.
+log4j.rootCategory=INFO
+#log4j.rootCategory=INFO, CONSOLE, LOGFILE
+
+# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.Threshold=INFO
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=- %m%n
+
Modified: modules/identity/trunk/identity/src/resources/portal-identity-test-jar/org/jboss/portal/test/identity/db-beans.xml
===================================================================
--- modules/identity/trunk/identity/src/resources/portal-identity-test-jar/org/jboss/portal/test/identity/db-beans.xml 2007-10-17 11:11:09 UTC (rev 8674)
+++ modules/identity/trunk/identity/src/resources/portal-identity-test-jar/org/jboss/portal/test/identity/db-beans.xml 2007-10-17 13:05:03 UTC (rev 8675)
@@ -27,17 +27,18 @@
xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
xmlns="urn:jboss:bean-deployer">
+
+
<bean name="DataSourceConfig" class="org.jboss.portal.test.framework.embedded.DataSourceSupport$Config">
- <constructor factoryMethod="getBean">
- <factory bean="BeanFactory"/>
- <parameter>DataSourceConfig</parameter>
+ <constructor factoryMethod="obtainConfig" factoryClass="org.jboss.portal.test.framework.embedded.DataSourceSupport$Config">
+ <parameter><inject bean="TestCase" property="datasources" state="Instantiated"/></parameter>
+ <parameter><inject bean="TestCase" property="dataSourceName" state="Instantiated"/></parameter>
</constructor>
</bean>
<bean name="HibernateConfig" class="org.jboss.portal.test.framework.embedded.HibernateSupport$Config">
- <constructor factoryMethod="getBean">
- <factory bean="BeanFactory"/>
- <parameter>HibernateConfig</parameter>
+ <constructor factoryMethod="getConfig" factoryClass="org.jboss.portal.test.framework.embedded.HibernateSupport">
+ <parameter><inject bean="TestCase" property="dataSourceName" state="Instantiated"/></parameter>
</constructor>
</bean>
@@ -58,26 +59,56 @@
</bean>
<bean name="HibernateSupport" class="org.jboss.portal.test.framework.embedded.HibernateSupport">
- <constructor factoryMethod="getBean">
- <factory bean="BeanFactory"/>
- <parameter>HibernateSupport</parameter>
- </constructor>
<property name="config"><inject bean="HibernateConfig"/></property>
- <property name="jNDIName">java:/portal/IdentitySessionFactory</property>
+ <property name="JNDIName">java:/portal/IdentitySessionFactory</property>
<property name="mappings">
<list elementClass="java.lang.String">
<value>domain-identity.hbm.xml</value>
- <!--<value>domain-single.hbm.xml</value>-->
</list>
</property>
</bean>
- <bean name="DBTestBean" class="org.jboss.portal.test.identity.db.DBIdentityTestCase">
- <constructor factoryMethod="getBean">
- <factory bean="BeanFactory"/>
- <parameter>DBTestBean</parameter>
+ <bean name="IdentityTestServiceLoader" class="org.jboss.portal.test.identity.TestServiceLoader">
+ <depends>JNDISupport</depends>
+ <depends>HibernateSupport</depends>
+ <depends>DataSourceSupport</depends>
+ </bean>
+
+ <bean name="IdentityContext" class="org.jboss.portal.identity.IdentityContext">
+ <constructor factoryMethod="loadServices">
+ <factory bean="IdentityTestServiceLoader"/>
+ <parameter class="java.lang.String"><inject bean="TestCase" property="standardIdentityConfig" state="Instantiated"/></parameter>
+ <parameter class="java.lang.String"><inject bean="TestCase" property="identityConfig" state="Instantiated"/></parameter>
</constructor>
- <!--<property name="hibernate" class="org.jboss.portal.test.framework.embedded.HibernateSupport"><inject bean="HibernateSupport"/></property>-->
</bean>
+ <bean name="UserModule" class="org.jboss.portal.identity.UserModule">
+ <constructor factoryMethod="getObject">
+ <factory bean="IdentityContext" />
+ <parameter>User</parameter>
+ </constructor>
+ </bean>
+
+ <bean name="RoleModule" class="org.jboss.portal.identity.RoleModule">
+ <constructor factoryMethod="getObject">
+ <factory bean="IdentityContext" />
+ <parameter>Role</parameter>
+ </constructor>
+ </bean>
+
+ <bean name="MembershipModule" class="org.jboss.portal.identity.MembershipModule">
+ <constructor factoryMethod="getObject">
+ <factory bean="IdentityContext" />
+ <parameter>Membership</parameter>
+ </constructor>
+ </bean>
+
+ <bean name="UserProfileModule" class="org.jboss.portal.identity.UserProfileModule">
+ <constructor factoryMethod="getObject">
+ <factory bean="IdentityContext" />
+ <parameter>UserProfile</parameter>
+ </constructor>
+ </bean>
+
+
</deployment>
Modified: modules/identity/trunk/identity/src/resources/portal-identity-test-jar/org/jboss/portal/test/identity/ldap-beans.xml
===================================================================
--- modules/identity/trunk/identity/src/resources/portal-identity-test-jar/org/jboss/portal/test/identity/ldap-beans.xml 2007-10-17 11:11:09 UTC (rev 8674)
+++ modules/identity/trunk/identity/src/resources/portal-identity-test-jar/org/jboss/portal/test/identity/ldap-beans.xml 2007-10-17 13:05:03 UTC (rev 8675)
@@ -27,17 +27,25 @@
xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
xmlns="urn:jboss:bean-deployer">
+
+
<bean name="DataSourceConfig" class="org.jboss.portal.test.framework.embedded.DataSourceSupport$Config">
- <constructor factoryMethod="getBean">
- <factory bean="BeanFactory"/>
- <parameter>DataSourceConfig</parameter>
+ <constructor factoryMethod="obtainConfig" factoryClass="org.jboss.portal.test.framework.embedded.DataSourceSupport$Config">
+ <parameter><inject bean="TestCase" property="datasources" state="Instantiated"/></parameter>
+ <parameter><inject bean="TestCase" property="dataSourceName" state="Instantiated"/></parameter>
</constructor>
</bean>
+ <bean name="DirectoryConfig" class="org.jboss.portal.test.framework.embedded.DSConfig">
+ <constructor factoryMethod="obtainConfig" factoryClass="org.jboss.portal.test.framework.embedded.DSConfig">
+ <parameter><inject bean="TestCase" property="directories" state="Instantiated"/></parameter>
+ <parameter><inject bean="TestCase" property="directoryName" state="Instantiated"/></parameter>
+ </constructor>
+ </bean>
+
<bean name="HibernateConfig" class="org.jboss.portal.test.framework.embedded.HibernateSupport$Config">
- <constructor factoryMethod="getBean">
- <factory bean="BeanFactory"/>
- <parameter>HibernateConfig</parameter>
+ <constructor factoryMethod="getConfig" factoryClass="org.jboss.portal.test.framework.embedded.HibernateSupport">
+ <parameter><inject bean="TestCase" property="dataSourceName" state="Instantiated"/></parameter>
</constructor>
</bean>
@@ -58,26 +66,56 @@
</bean>
<bean name="HibernateSupport" class="org.jboss.portal.test.framework.embedded.HibernateSupport">
- <constructor factoryMethod="getBean">
- <factory bean="BeanFactory"/>
- <parameter>HibernateSupport</parameter>
- </constructor>
<property name="config"><inject bean="HibernateConfig"/></property>
- <property name="jNDIName">java:/portal/IdentitySessionFactory</property>
+ <property name="JNDIName">java:/portal/IdentitySessionFactory</property>
<property name="mappings">
<list elementClass="java.lang.String">
<value>domain-identity.hbm.xml</value>
- <!--<value>domain-single.hbm.xml</value>-->
</list>
</property>
</bean>
+ <bean name="IdentityTestServiceLoader" class="org.jboss.portal.test.identity.TestServiceLoader">
+ <depends>JNDISupport</depends>
+ <depends>HibernateSupport</depends>
+ <depends>DataSourceSupport</depends>
+ </bean>
- <bean name="LDAPTestBean" class="org.jboss.portal.test.identity.ldap.LDAPTestCase">
- <constructor factoryMethod="getBean">
- <factory bean="BeanFactory"/>
- <parameter>LDAPTestBean</parameter>
+ <bean name="IdentityContext" class="org.jboss.portal.identity.IdentityContext">
+ <constructor factoryMethod="loadServices">
+ <factory bean="IdentityTestServiceLoader"/>
+ <parameter class="java.lang.String"><inject bean="TestCase" property="standardIdentityConfig" state="Instantiated"/></parameter>
+ <parameter class="org.jboss.portal.test.framework.embedded.DSConfig"><inject bean="DirectoryConfig"/></parameter>
</constructor>
</bean>
+ <bean name="UserModule" class="org.jboss.portal.identity.UserModule">
+ <constructor factoryMethod="getObject">
+ <factory bean="IdentityContext" />
+ <parameter>User</parameter>
+ </constructor>
+ </bean>
+
+ <bean name="RoleModule" class="org.jboss.portal.identity.RoleModule">
+ <constructor factoryMethod="getObject">
+ <factory bean="IdentityContext" />
+ <parameter>Role</parameter>
+ </constructor>
+ </bean>
+
+ <bean name="MembershipModule" class="org.jboss.portal.identity.MembershipModule">
+ <constructor factoryMethod="getObject">
+ <factory bean="IdentityContext" />
+ <parameter>Membership</parameter>
+ </constructor>
+ </bean>
+
+ <bean name="UserProfileModule" class="org.jboss.portal.identity.UserProfileModule">
+ <constructor factoryMethod="getObject">
+ <factory bean="IdentityContext" />
+ <parameter>UserProfile</parameter>
+ </constructor>
+ </bean>
+
+
</deployment>
Modified: modules/identity/trunk/identity/src/resources/test/config/standardidentity-config.xml
===================================================================
--- modules/identity/trunk/identity/src/resources/test/config/standardidentity-config.xml 2007-10-17 11:11:09 UTC (rev 8674)
+++ modules/identity/trunk/identity/src/resources/test/config/standardidentity-config.xml 2007-10-17 13:05:03 UTC (rev 8675)
@@ -56,7 +56,7 @@
<value>password</value>
</option>
<option>
- <name>jNDIName</name>
+ <name>JNDIName</name>
<value>java:/portal/LDAPConnectionContext</value>
</option>
</config>
@@ -75,7 +75,7 @@
<!--set of options that are passed to a class constructor-->
<config>
<option>
- <name>jNDIName</name>
+ <name>JNDIName</name>
<value>java:/portal/UserProfileModule</value>
</option>
<option>
@@ -107,7 +107,7 @@
<value>java:/portal/IdentitySessionFactory</value>
</option>
<option>
- <name>jNDIName</name>
+ <name>JNDIName</name>
<value>java:/portal/UserModule</value>
</option>
</config>
@@ -129,7 +129,7 @@
<value>java:/portal/IdentitySessionFactory</value>
</option>
<option>
- <name>jNDIName</name>
+ <name>JNDIName</name>
<value>java:/portal/RoleModule</value>
</option>
</config>
@@ -151,7 +151,7 @@
<value>java:/portal/IdentitySessionFactory</value>
</option>
<option>
- <name>jNDIName</name>
+ <name>JNDIName</name>
<value>java:/portal/MembershipModule</value>
</option>
</config>
@@ -173,7 +173,7 @@
<value>java:/portal/IdentitySessionFactory</value>
</option>
<option>
- <name>jNDIName</name>
+ <name>JNDIName</name>
<value>java:/portal/DBUserProfileModule</value>
</option>
</config>
@@ -192,7 +192,7 @@
<!--set of options that are passed to a class constructor-->
<config>
<option>
- <name>jNDIName</name>
+ <name>JNDIName</name>
<value>java:/portal/UserModule</value>
</option>
<option>
@@ -214,7 +214,7 @@
<!--set of options that are passed to a class constructor-->
<config>
<option>
- <name>jNDIName</name>
+ <name>JNDIName</name>
<value>java:/portal/RoleModule</value>
</option>
<option>
@@ -236,7 +236,7 @@
<!--set of options that are passed to a class constructor-->
<config>
<option>
- <name>jNDIName</name>
+ <name>JNDIName</name>
<value>java:/portal/MembershipModule</value>
</option>
<option>
@@ -271,7 +271,7 @@
<value>ldap-profile.xml</value>
</option>-->
<option>
- <name>jNDIName</name>
+ <name>JNDIName</name>
<value>java:/portal/LDAPUserProfileModule</value>
</option>
<option>
Added: modules/identity/trunk/identity/src/resources/test/jboss-unit.xml
===================================================================
--- modules/identity/trunk/identity/src/resources/test/jboss-unit.xml (rev 0)
+++ modules/identity/trunk/identity/src/resources/test/jboss-unit.xml 2007-10-17 13:05:03 UTC (rev 8675)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jboss-unit
+ xmlns="urn:jboss:jboss-unit:1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:jboss-unit:1.0 jboss-unit_1_0.xsd">
+ <pojo>
+ <parameter name="datasources" value="datasources.xml"/>
+ <parameter name="dataSourceName" value="hsqldb"/>
+ <parameter name="standardIdentityConfig" value="test/config/standardidentity-config.xml"/>
+ <parameter name="identityConfig" value="test/config/db-config.xml"/>
+ <test >
+ <class name="org.jboss.portal.test.identity.db.DBGenericTest"/>
+ </test>
+ </pojo>
+ <pojo>
+
+ <parameter name="standardIdentityConfig" value="test/config/standardidentity-config.xml"/>
+ <parameter name="identityConfig" value="test/config/db-config.xml"/>
+
+ <parameter name="datasources" value="datasources.xml"/>
+ <parameter name="directories" value="directories.xml"/>
+
+ <parameter name="dataSourceName" value="hsqldb"/>
+
+ <parameter name="directoryName">
+ <value>OpenDS</value>
+ <value>Sun DS</value>
+ <value>RedHatDS</value>
+ <value>OpenLDAP</value>
+ </parameter>
+
+ <test>
+ <class name="org.jboss.portal.test.identity.ldap.LDAPGenericTest"/>
+ <parameter name="directories" value="directories-identity.xml"/>
+ </test>
+
+ <test>
+ <class name="org.jboss.portal.test.identity.ldap.LDAPSimpleUserModuleTest"/>
+
+ <parameter name="directories" value="directories-simpleusermodule.xml"/>
+ </test>
+
+ <test>
+ <class name="org.jboss.portal.test.identity.ldap.LDAPSimpleRoleModuleTest"/>
+
+ <parameter name="directories" value="directories-simplerolemodule.xml"/>
+ </test>
+
+ <test>
+ <class name="org.jboss.portal.test.identity.ldap.LDAPExtUserModuleTest"/>
+
+ <parameter name="directories" value="directories-extusermodule.xml"/>
+ </test>
+
+ <test>
+ <class name="org.jboss.portal.test.identity.ldap.LDAPExtRoleModuleTest"/>
+
+ <parameter name="directories" value="directories-extrolemodule.xml"/>
+ </test>
+
+ <test>
+ <class name="org.jboss.portal.test.identity.ldap.LDAPStaticGroupMembershipModuleTest"/>
+
+ <parameter name="directories" value="directories-staticgroupmembership.xml"/>
+ </test>
+
+ <test>
+ <class name="org.jboss.portal.test.identity.ldap.LDAPStaticRoleMembershipModuleTest"/>
+
+ <parameter name="directories" value="directories-staticrolemembership.xml"/>
+ </test>
+
+ <test>
+ <class name="org.jboss.portal.test.identity.ldap.LDAPUserProfileModuleTestCase"/>
+
+ <parameter name="directories" value="directories-userprofilemodule.xml"/>
+ </test>
+ </pojo>
+</jboss-unit>
Modified: modules/identity/trunk/sso/build.xml
===================================================================
--- modules/identity/trunk/sso/build.xml 2007-10-17 11:11:09 UTC (rev 8674)
+++ modules/identity/trunk/sso/build.xml 2007-10-17 13:05:03 UTC (rev 8675)
@@ -95,7 +95,12 @@
<path refid="jboss.microcontainer.classpath"/>
<path refid="jboss.jbossxb.classpath"/>
<path refid="apache.xerces.classpath"/>
- <path refid="jbossas/core.libs.classpath"/>
+ <!--<path refid="jbossas/core.libs.classpath"/>-->
+
+
+ <path refid="jboss/common.logging.spi.classpath"/>
+ <path refid="jboss/jboss.jacc.api.classpath"/>
+
<path refid="oswego.concurrent.classpath"/>
<path refid="hibernate.hibernate.classpath"/>
<path refid="apache.log4j.classpath"/>
Modified: modules/identity/trunk/sso/src/main/org/jboss/portal/identity/sso/cas/CASAuthenticationHandler.java
===================================================================
--- modules/identity/trunk/sso/src/main/org/jboss/portal/identity/sso/cas/CASAuthenticationHandler.java 2007-10-17 11:11:09 UTC (rev 8674)
+++ modules/identity/trunk/sso/src/main/org/jboss/portal/identity/sso/cas/CASAuthenticationHandler.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -62,7 +62,7 @@
//Perform this operation in the context of a UserTransaction
status = authService.authenticate(username, password);
-
+
return status;
}
catch(Exception e)
Modified: modules/identity/trunk/sso/src/main/org/jboss/portal/test/identity/sso/CASTestCase.java
===================================================================
--- modules/identity/trunk/sso/src/main/org/jboss/portal/test/identity/sso/CASTestCase.java 2007-10-17 11:11:09 UTC (rev 8674)
+++ modules/identity/trunk/sso/src/main/org/jboss/portal/test/identity/sso/CASTestCase.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -1,683 +1,683 @@
-/******************************************************************************
- * 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.portal.test.identity.sso;
-
-import java.util.Map;
-import java.util.Set;
-import java.util.Iterator;
-import java.util.HashMap;
-
-import org.jboss.portal.test.framework.mc.TestRuntimeContext;
-
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.Cookie;
-import org.apache.commons.httpclient.NameValuePair;
-import org.apache.commons.httpclient.methods.GetMethod;
-import org.apache.commons.httpclient.methods.PostMethod;
-import org.apache.commons.httpclient.protocol.Protocol;
-
-import junit.framework.TestCase;
-
-/**
- * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
- *
- */
-public class CASTestCase extends TestCase
-{
- /**
- *
- */
- private String firstPortal = null;
- private String secondPortal = null;
- private String sameHostSecondPortal = null;
- private String userLoggedInIndicator = null;
- private String username = null;
- private String password = null;
-
- /**
- *
- */
- protected TestRuntimeContext runtimeContext = null;
-
- /**
- *
- */
- protected void setUp() throws Exception
- {
- super.setUp();
-
- this.runtimeContext = new TestRuntimeContext("org/jboss/portal/test/identity/sso-beans.xml");
-
- this.runtimeContext.addBean("CASConfig", this);
- this.runtimeContext.addBean("JOSSOConfig", new JOSSOTestCase());
-
- this.runtimeContext.start();
-
- //SSL setup
- Protocol.registerProtocol("https",new Protocol("https", new EasySSLProtocolSocketFactory(), 443));
- }
-
- /**
- *
- */
- protected void tearDown() throws Exception
- {
- super.tearDown();
-
- //Service stoppage
- this.runtimeContext.stop();
-
- //Data cleanup
- this.runtimeContext = null;
- }
-
- /**
- *
- * @return
- */
- public String getUserLoggedInIndicator()
- {
- return userLoggedInIndicator;
- }
-
- /**
- *
- * @param userLoggedInIndicator
- */
- public void setUserLoggedInIndicator(String userLoggedInIndicator)
- {
- this.userLoggedInIndicator = userLoggedInIndicator;
- }
-
- /**
- *
- * @return
- */
- public String getPassword()
- {
- return password;
- }
-
- /**
- *
- * @param password
- */
- public void setPassword(String password)
- {
- this.password = password;
- }
-
- /**
- *
- * @return
- */
- public String getUsername()
- {
- return username;
- }
-
- /**
- *
- * @param username
- */
- public void setUsername(String username)
- {
- this.username = username;
- }
-
- /**
- *
- * @return
- */
- public String getFirstPortal()
- {
- return firstPortal;
- }
-
- /**
- *
- * @param firstPortal
- */
- public void setFirstPortal(String firstPortal)
- {
- this.firstPortal = firstPortal;
- }
-
- /**
- *
- * @return
- */
- public String getSecondPortal()
- {
- return secondPortal;
- }
-
- /**
- *
- * @param secondPortal
- */
- public void setSecondPortal(String secondPortal)
- {
- this.secondPortal = secondPortal;
- }
-
- /**
- *
- * @return
- */
- public String getSameHostSecondPortal()
- {
- return sameHostSecondPortal;
- }
-
- /**
- *
- * @param sameHostSecondPortal
- */
- public void setSameHostSecondPortal(String sameHostSecondPortal)
- {
- this.sameHostSecondPortal = sameHostSecondPortal;
- }
-
- /**
- * This tests the scenario when the two portals are deployed on separate hosts/servers
- *
- * @throws Exception
- */
- public void testMultiHostDeployment() throws Exception
- {
- Cookie casCookie = null;
- String firstPortalFinalResponse = null;
- String secondPortalFinalResponse = null;
-
- //Load the main portal page on firstPortalContext
- String firstContextPortalUrl = this.firstPortal;
- WebConversation portalConversation = this.startConversation(firstContextPortalUrl);
- TestCase.assertFalse(this.isUserLoggedIn(portalConversation.getResponse()));
-
- //Click the Login link on the firstPortalContext
- String firstContextLoginUrl = firstContextPortalUrl + "/auth/portal/default/default";
- this.sendGet(firstContextLoginUrl, portalConversation);
-
- //Perform redirect to the CAS Server
- TestCase.assertNotNull(portalConversation.getRedirectLocation());
- TestCase.assertEquals(portalConversation.getStatusCode(), 302);
- String casLocation = portalConversation.getRedirectLocation();
- WebConversation casConversation = this.startConversation(casLocation);
- String response = casConversation.getResponse();
- //Extract the conversionId from the response
- int searchIndex = response.indexOf("value=\"_c")+7;
- int endIndex = response.indexOf('"', searchIndex);
- String lt = response.substring(searchIndex,endIndex);
-
- //Perform HTTP Post based authentication with the CAS Server
- Map postParams = new HashMap();
- postParams.put("username", this.username);
- postParams.put("password", this.password);
- postParams.put("_eventId", "submit");
- postParams.put("lt",lt);
- this.sendPost(casLocation,postParams, casConversation);
-
- //The Portal Session should now be autenticated
- TestCase.assertNotNull(casConversation.getRedirectLocation());
- TestCase.assertEquals(casConversation.getStatusCode(), 302);
- TestCase.assertTrue(casConversation.getRedirectLocation().indexOf(firstContextLoginUrl) != -1);
- TestCase.assertNotNull(casConversation.getCasCookie());
- String goBack = casConversation.getRedirectLocation();
- casCookie = casConversation.getCasCookie();
- portalConversation = this.startConversation(goBack);
- firstPortalFinalResponse = portalConversation.getResponse();
- TestCase.assertTrue(this.isUserLoggedIn(firstPortalFinalResponse));
-
- //Load the main portal page on secondPortalContext
- String secondContextPortalUrl = this.secondPortal;
- portalConversation = this.startConversation(secondContextPortalUrl);
-
- //Click the Login Link on the secondPortalContext
- String secondContextLoginUrl = secondContextPortalUrl + "/auth/portal/default/default";
- this.sendGet(secondContextLoginUrl, portalConversation);
-
- //Perform re-direct to the CAS Server but this time sending in the CAS cookie
- TestCase.assertNotNull(portalConversation.getRedirectLocation());
- TestCase.assertEquals(portalConversation.getStatusCode(), 302);
- casLocation = portalConversation.getRedirectLocation();
- casConversation = this.startConversation(casLocation,casCookie);
-
-
- //Assert the redirect and it should be to the CAS Server, but this time
- //It should end up with an Authenticated session back to the secondPortalContext
- secondPortalFinalResponse = casConversation.getResponse();
- TestCase.assertTrue(this.isUserLoggedIn(secondPortalFinalResponse));
-
- //Assert and make sure its the same user logged into both Portals
- String firstPortalUser = this.extractLoggedInUser(firstPortalFinalResponse);
- String secondPortalUser = this.extractLoggedInUser(secondPortalFinalResponse);
- TestCase.assertEquals(firstPortalUser, this.username);
- TestCase.assertEquals(secondPortalUser, this.username);
- TestCase.assertEquals(firstPortalUser, secondPortalUser);
- }
-
- /**
- * This tests the scenario where the two portals are deployed within the same host/server but under
- * different web contexts
- *
- * @throws Exception
- */
- public void testSameHostDeployment() throws Exception
- {
- Cookie casCookie = null;
- String firstPortalFinalResponse = null;
- String secondPortalFinalResponse = null;
-
- //Load the main portal page on firstPortalContext
- String firstContextPortalUrl = this.firstPortal;
- WebConversation portalConversation = this.startConversation(firstContextPortalUrl);
- TestCase.assertFalse(this.isUserLoggedIn(portalConversation.getResponse()));
-
- //Click the Login link on the firstPortalContext
- String firstContextLoginUrl = firstContextPortalUrl + "/auth/portal/default/default";
- this.sendGet(firstContextLoginUrl, portalConversation);
-
- //Perform redirect to the CAS Server
- TestCase.assertNotNull(portalConversation.getRedirectLocation());
- TestCase.assertEquals(portalConversation.getStatusCode(), 302);
- String casLocation = portalConversation.getRedirectLocation();
- WebConversation casConversation = this.startConversation(casLocation);
- String response = casConversation.getResponse();
- //Extract the conversionId from the response
- int searchIndex = response.indexOf("value=\"_c")+7;
- int endIndex = response.indexOf('"', searchIndex);
- String lt = response.substring(searchIndex,endIndex);
-
- //Perform HTTP Post based authentication with the CAS Server
- Map postParams = new HashMap();
- postParams.put("username", this.username);
- postParams.put("password", this.password);
- postParams.put("_eventId", "submit");
- postParams.put("lt",lt);
- this.sendPost(casLocation,postParams, casConversation);
-
- //The Portal Session should now be autenticated
- TestCase.assertNotNull(casConversation.getRedirectLocation());
- TestCase.assertEquals(casConversation.getStatusCode(), 302);
- TestCase.assertTrue(casConversation.getRedirectLocation().indexOf(firstContextLoginUrl) != -1);
- TestCase.assertNotNull(casConversation.getCasCookie());
- String goBack = casConversation.getRedirectLocation();
- casCookie = casConversation.getCasCookie();
- portalConversation = this.startConversation(goBack);
- firstPortalFinalResponse = portalConversation.getResponse();
- TestCase.assertTrue(this.isUserLoggedIn(firstPortalFinalResponse));
-
- //Load the main portal page on secondPortalContext
- String secondContextPortalUrl = this.sameHostSecondPortal;
- portalConversation = this.startConversation(secondContextPortalUrl);
-
- //Click the Login Link on the secondPortalContext
- String secondContextLoginUrl = secondContextPortalUrl + "/auth/portal/default/default";
- this.sendGet(secondContextLoginUrl, portalConversation);
-
- //Perform re-direct to the CAS Server but this time sending in the CAS cookie
- TestCase.assertNotNull(portalConversation.getRedirectLocation());
- TestCase.assertEquals(portalConversation.getStatusCode(), 302);
- casLocation = portalConversation.getRedirectLocation();
- casConversation = this.startConversation(casLocation,casCookie);
-
-
- //Assert the redirect and it should be to the CAS Server, but this time
- //It should end up with an Authenticated session back to the secondPortalContext
- secondPortalFinalResponse = casConversation.getResponse();
- TestCase.assertTrue(this.isUserLoggedIn(secondPortalFinalResponse));
-
- //Assert and make sure its the same user logged into both Portals
- String firstPortalUser = this.extractLoggedInUser(firstPortalFinalResponse);
- String secondPortalUser = this.extractLoggedInUser(secondPortalFinalResponse);
- TestCase.assertEquals(firstPortalUser, this.username);
- TestCase.assertEquals(secondPortalUser, this.username);
- TestCase.assertEquals(firstPortalUser, secondPortalUser);
- }
-
- /**
- *
- * @param portalUrl
- * @return
- * @throws Exception
- */
- private WebConversation startConversation(String portalUrl) throws Exception
- {
- WebConversation conversation = null;
-
- HttpClient httpClient = new HttpClient();
- GetMethod getMethod = new GetMethod(portalUrl);
- try
- {
- conversation = new WebConversation();
-
- int statusCode = httpClient.executeMethod(getMethod);
- String response = getMethod.getResponseBodyAsString();
-
- Cookie[] cookies = httpClient.getState().getCookies();
- for(int i=0;i<cookies.length;i++)
- {
- if(cookies[i].getName().equals("JSESSIONID"))
- {
- conversation.setSessionId(cookies[i].getValue());
- }
- }
-
- conversation.setClient(httpClient);
- conversation.setStatusCode(statusCode);
- conversation.setResponse(response);
- }
- finally
- {
- if(getMethod != null)
- {
- getMethod.releaseConnection();
- }
- }
-
- return conversation;
- }
-
- /**
- *
- * @param portalUrl
- * @return
- * @throws Exception
- */
- private WebConversation startConversation(String portalUrl, Cookie casCookie) throws Exception
- {
- WebConversation conversation = null;
-
- HttpClient httpClient = new HttpClient();
- GetMethod getMethod = new GetMethod(portalUrl);
-
- //Set casCookie to be sent in
- getMethod.setRequestHeader("Cookie",casCookie.getName()+"="+casCookie.getValue());
-
- try
- {
- conversation = new WebConversation();
-
- int statusCode = httpClient.executeMethod(getMethod);
- String response = getMethod.getResponseBodyAsString();
-
- Cookie[] cookies = httpClient.getState().getCookies();
- for(int i=0;i<cookies.length;i++)
- {
- if(cookies[i].getName().equals("JSESSIONID"))
- {
- conversation.setSessionId(cookies[i].getValue());
- }
- }
-
- conversation.setClient(httpClient);
- conversation.setStatusCode(statusCode);
- conversation.setResponse(response);
- }
- finally
- {
- if(getMethod != null)
- {
- getMethod.releaseConnection();
- }
- }
-
- return conversation;
- }
-
- /**
- *
- * @param portalUrl
- * @param conversation
- * @throws Exception
- */
- private void sendGet(String portalUrl,WebConversation conversation) throws Exception
- {
- HttpClient httpClient = conversation.getClient();
-
- GetMethod getMethod = new GetMethod(portalUrl);
- getMethod.setFollowRedirects(false);
- try
- {
- int statusCode = httpClient.executeMethod(getMethod);
-
- String response = getMethod.getResponseBodyAsString();
-
- Cookie[] cookies = httpClient.getState().getCookies();
- for(int i=0;i<cookies.length;i++)
- {
- if(cookies[i].getName().equals("JSESSIONID"))
- {
- conversation.setSessionId(cookies[i].getValue());
- }
- }
-
- conversation.setStatusCode(statusCode);
- conversation.setResponse(response);
-
- if(statusCode == 302)
- {
- //Store the redirect location
- String location = getMethod.getResponseHeader("Location").getValue();
- conversation.setRedirectLocation(location);
- }
- }
- finally
- {
- if(getMethod != null)
- {
- getMethod.releaseConnection();
- }
- }
- }
-
-
- /**
- *
- * @param url
- * @param parameters
- * @param conversation
- * @throws Exception
- */
- private void sendPost(String url,Map parameters,WebConversation conversation) throws Exception
- {
- HttpClient httpClient = conversation.getClient();
-
- PostMethod postMethod = new PostMethod(url);
-
- //Add post parameters
- Set keySet = parameters.keySet();
- NameValuePair[] postdata = new NameValuePair[keySet.size()];
- int index = 0;
- for(Iterator itr=keySet.iterator();itr.hasNext();)
- {
- String name = (String)itr.next();
- String value = (String)parameters.get(name);
- postdata[index++] = new NameValuePair(name,value);
- }
- postMethod.setRequestBody(postdata);
- try
- {
- int statusCode = httpClient.executeMethod(postMethod);
-
- String response = postMethod.getResponseBodyAsString();
-
- Cookie[] cookies = httpClient.getState().getCookies();
- for(int i=0;i<cookies.length;i++)
- {
- if(cookies[i].getName().equals("JSESSIONID"))
- {
- conversation.setSessionId(cookies[i].getValue());
- }
- if(cookies[i].getName().equals("CASTGC"))
- {
- conversation.setCasCookie(cookies[i]);
- }
- }
-
- conversation.setStatusCode(statusCode);
- conversation.setResponse(response);
-
- if(statusCode == 302)
- {
- //Store the redirect location
- String location = postMethod.getResponseHeader("Location").getValue();
- conversation.setRedirectLocation(location);
- }
- }
- finally
- {
- if(postMethod != null)
- {
- postMethod.releaseConnection();
- }
- }
- }
-
- /**
- *
- * @param response
- * @return
- */
- private boolean isUserLoggedIn(String response)
- {
- boolean isUserLoggedIn = false;
-
- isUserLoggedIn = (response.indexOf(this.userLoggedInIndicator) != -1);
-
- return isUserLoggedIn;
- }
-
- /**
- *
- * @param response
- * @return
- */
- private String extractLoggedInUser(String response)
- {
- String loggedInUser = null;
-
- int startIndex = response.indexOf(this.userLoggedInIndicator) + this.userLoggedInIndicator.length();
- int endIndex = response.indexOf("<",startIndex);
-
- loggedInUser = response.substring(startIndex,endIndex).trim();
-
- return loggedInUser;
- }
-
- /**
- *
- * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
- *
- */
- private static class WebConversation
- {
- /**
- *
- */
- private HttpClient client = null;
- private String sessionId = null;
- private int statusCode = 0;
- private String response = null;
- private String redirectLocation = null;
- private Cookie casCookie = null;
-
- /**
- *
- *
- */
- public WebConversation()
- {
-
- }
-
- /**
- *
- * @return
- */
- public HttpClient getClient()
- {
- return this.client;
- }
-
- /**
- *
- * @param client
- */
- public void setClient(HttpClient client)
- {
- this.client = client;
- }
-
- public String getResponse()
- {
- return response;
- }
-
- public void setResponse(String response)
- {
- this.response = response;
- }
-
- public int getStatusCode()
- {
- return statusCode;
- }
-
- public void setStatusCode(int statusCode)
- {
- this.statusCode = statusCode;
- }
-
- public String getSessionId()
- {
- return sessionId;
- }
-
- public void setSessionId(String sessionId)
- {
- this.sessionId = sessionId;
- }
-
- public String getRedirectLocation()
- {
- return redirectLocation;
- }
-
- public void setRedirectLocation(String redirectLocation)
- {
- this.redirectLocation = redirectLocation;
- }
-
- public Cookie getCasCookie()
- {
- return casCookie;
- }
-
- public void setCasCookie(Cookie casCookie)
- {
- this.casCookie = casCookie;
- }
- }
-}
+///******************************************************************************
+// * 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.portal.test.identity.sso;
+//
+//import java.util.Map;
+//import java.util.Set;
+//import java.util.Iterator;
+//import java.util.HashMap;
+//
+//import org.jboss.portal.test.framework.mc.TestRuntimeContext;
+//
+//import org.apache.commons.httpclient.HttpClient;
+//import org.apache.commons.httpclient.Cookie;
+//import org.apache.commons.httpclient.NameValuePair;
+//import org.apache.commons.httpclient.methods.GetMethod;
+//import org.apache.commons.httpclient.methods.PostMethod;
+//import org.apache.commons.httpclient.protocol.Protocol;
+//
+//import junit.framework.TestCase;
+//
+///**
+// * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+// *
+// */
+//public class CASTestCase extends TestCase
+//{
+// /**
+// *
+// */
+// private String firstPortal = null;
+// private String secondPortal = null;
+// private String sameHostSecondPortal = null;
+// private String userLoggedInIndicator = null;
+// private String username = null;
+// private String password = null;
+//
+// /**
+// *
+// */
+// protected TestRuntimeContext runtimeContext = null;
+//
+// /**
+// *
+// */
+// protected void setUp() throws Exception
+// {
+// super.setUp();
+//
+// this.runtimeContext = new TestRuntimeContext("org/jboss/portal/test/identity/sso-beans.xml");
+//
+// this.runtimeContext.addBean("CASConfig", this);
+// this.runtimeContext.addBean("JOSSOConfig", new JOSSOTestCase());
+//
+// this.runtimeContext.start();
+//
+// //SSL setup
+// Protocol.registerProtocol("https",new Protocol("https", new EasySSLProtocolSocketFactory(), 443));
+// }
+//
+// /**
+// *
+// */
+// protected void tearDown() throws Exception
+// {
+// super.tearDown();
+//
+// //Service stoppage
+// this.runtimeContext.stop();
+//
+// //Data cleanup
+// this.runtimeContext = null;
+// }
+//
+// /**
+// *
+// * @return
+// */
+// public String getUserLoggedInIndicator()
+// {
+// return userLoggedInIndicator;
+// }
+//
+// /**
+// *
+// * @param userLoggedInIndicator
+// */
+// public void setUserLoggedInIndicator(String userLoggedInIndicator)
+// {
+// this.userLoggedInIndicator = userLoggedInIndicator;
+// }
+//
+// /**
+// *
+// * @return
+// */
+// public String getPassword()
+// {
+// return password;
+// }
+//
+// /**
+// *
+// * @param password
+// */
+// public void setPassword(String password)
+// {
+// this.password = password;
+// }
+//
+// /**
+// *
+// * @return
+// */
+// public String getUsername()
+// {
+// return username;
+// }
+//
+// /**
+// *
+// * @param username
+// */
+// public void setUsername(String username)
+// {
+// this.username = username;
+// }
+//
+// /**
+// *
+// * @return
+// */
+// public String getFirstPortal()
+// {
+// return firstPortal;
+// }
+//
+// /**
+// *
+// * @param firstPortal
+// */
+// public void setFirstPortal(String firstPortal)
+// {
+// this.firstPortal = firstPortal;
+// }
+//
+// /**
+// *
+// * @return
+// */
+// public String getSecondPortal()
+// {
+// return secondPortal;
+// }
+//
+// /**
+// *
+// * @param secondPortal
+// */
+// public void setSecondPortal(String secondPortal)
+// {
+// this.secondPortal = secondPortal;
+// }
+//
+// /**
+// *
+// * @return
+// */
+// public String getSameHostSecondPortal()
+// {
+// return sameHostSecondPortal;
+// }
+//
+// /**
+// *
+// * @param sameHostSecondPortal
+// */
+// public void setSameHostSecondPortal(String sameHostSecondPortal)
+// {
+// this.sameHostSecondPortal = sameHostSecondPortal;
+// }
+//
+// /**
+// * This tests the scenario when the two portals are deployed on separate hosts/servers
+// *
+// * @throws Exception
+// */
+// public void testMultiHostDeployment() throws Exception
+// {
+// Cookie casCookie = null;
+// String firstPortalFinalResponse = null;
+// String secondPortalFinalResponse = null;
+//
+// //Load the main portal page on firstPortalContext
+// String firstContextPortalUrl = this.firstPortal;
+// WebConversation portalConversation = this.startConversation(firstContextPortalUrl);
+// TestCase.assertFalse(this.isUserLoggedIn(portalConversation.getResponse()));
+//
+// //Click the Login link on the firstPortalContext
+// String firstContextLoginUrl = firstContextPortalUrl + "/auth/portal/default/default";
+// this.sendGet(firstContextLoginUrl, portalConversation);
+//
+// //Perform redirect to the CAS Server
+// TestCase.assertNotNull(portalConversation.getRedirectLocation());
+// TestCase.assertEquals(portalConversation.getStatusCode(), 302);
+// String casLocation = portalConversation.getRedirectLocation();
+// WebConversation casConversation = this.startConversation(casLocation);
+// String response = casConversation.getResponse();
+// //Extract the conversionId from the response
+// int searchIndex = response.indexOf("value=\"_c")+7;
+// int endIndex = response.indexOf('"', searchIndex);
+// String lt = response.substring(searchIndex,endIndex);
+//
+// //Perform HTTP Post based authentication with the CAS Server
+// Map postParams = new HashMap();
+// postParams.put("username", this.username);
+// postParams.put("password", this.password);
+// postParams.put("_eventId", "submit");
+// postParams.put("lt",lt);
+// this.sendPost(casLocation,postParams, casConversation);
+//
+// //The Portal Session should now be autenticated
+// TestCase.assertNotNull(casConversation.getRedirectLocation());
+// TestCase.assertEquals(casConversation.getStatusCode(), 302);
+// TestCase.assertTrue(casConversation.getRedirectLocation().indexOf(firstContextLoginUrl) != -1);
+// TestCase.assertNotNull(casConversation.getCasCookie());
+// String goBack = casConversation.getRedirectLocation();
+// casCookie = casConversation.getCasCookie();
+// portalConversation = this.startConversation(goBack);
+// firstPortalFinalResponse = portalConversation.getResponse();
+// TestCase.assertTrue(this.isUserLoggedIn(firstPortalFinalResponse));
+//
+// //Load the main portal page on secondPortalContext
+// String secondContextPortalUrl = this.secondPortal;
+// portalConversation = this.startConversation(secondContextPortalUrl);
+//
+// //Click the Login Link on the secondPortalContext
+// String secondContextLoginUrl = secondContextPortalUrl + "/auth/portal/default/default";
+// this.sendGet(secondContextLoginUrl, portalConversation);
+//
+// //Perform re-direct to the CAS Server but this time sending in the CAS cookie
+// TestCase.assertNotNull(portalConversation.getRedirectLocation());
+// TestCase.assertEquals(portalConversation.getStatusCode(), 302);
+// casLocation = portalConversation.getRedirectLocation();
+// casConversation = this.startConversation(casLocation,casCookie);
+//
+//
+// //Assert the redirect and it should be to the CAS Server, but this time
+// //It should end up with an Authenticated session back to the secondPortalContext
+// secondPortalFinalResponse = casConversation.getResponse();
+// TestCase.assertTrue(this.isUserLoggedIn(secondPortalFinalResponse));
+//
+// //Assert and make sure its the same user logged into both Portals
+// String firstPortalUser = this.extractLoggedInUser(firstPortalFinalResponse);
+// String secondPortalUser = this.extractLoggedInUser(secondPortalFinalResponse);
+// TestCase.assertEquals(firstPortalUser, this.username);
+// TestCase.assertEquals(secondPortalUser, this.username);
+// TestCase.assertEquals(firstPortalUser, secondPortalUser);
+// }
+//
+// /**
+// * This tests the scenario where the two portals are deployed within the same host/server but under
+// * different web contexts
+// *
+// * @throws Exception
+// */
+// public void testSameHostDeployment() throws Exception
+// {
+// Cookie casCookie = null;
+// String firstPortalFinalResponse = null;
+// String secondPortalFinalResponse = null;
+//
+// //Load the main portal page on firstPortalContext
+// String firstContextPortalUrl = this.firstPortal;
+// WebConversation portalConversation = this.startConversation(firstContextPortalUrl);
+// TestCase.assertFalse(this.isUserLoggedIn(portalConversation.getResponse()));
+//
+// //Click the Login link on the firstPortalContext
+// String firstContextLoginUrl = firstContextPortalUrl + "/auth/portal/default/default";
+// this.sendGet(firstContextLoginUrl, portalConversation);
+//
+// //Perform redirect to the CAS Server
+// TestCase.assertNotNull(portalConversation.getRedirectLocation());
+// TestCase.assertEquals(portalConversation.getStatusCode(), 302);
+// String casLocation = portalConversation.getRedirectLocation();
+// WebConversation casConversation = this.startConversation(casLocation);
+// String response = casConversation.getResponse();
+// //Extract the conversionId from the response
+// int searchIndex = response.indexOf("value=\"_c")+7;
+// int endIndex = response.indexOf('"', searchIndex);
+// String lt = response.substring(searchIndex,endIndex);
+//
+// //Perform HTTP Post based authentication with the CAS Server
+// Map postParams = new HashMap();
+// postParams.put("username", this.username);
+// postParams.put("password", this.password);
+// postParams.put("_eventId", "submit");
+// postParams.put("lt",lt);
+// this.sendPost(casLocation,postParams, casConversation);
+//
+// //The Portal Session should now be autenticated
+// TestCase.assertNotNull(casConversation.getRedirectLocation());
+// TestCase.assertEquals(casConversation.getStatusCode(), 302);
+// TestCase.assertTrue(casConversation.getRedirectLocation().indexOf(firstContextLoginUrl) != -1);
+// TestCase.assertNotNull(casConversation.getCasCookie());
+// String goBack = casConversation.getRedirectLocation();
+// casCookie = casConversation.getCasCookie();
+// portalConversation = this.startConversation(goBack);
+// firstPortalFinalResponse = portalConversation.getResponse();
+// TestCase.assertTrue(this.isUserLoggedIn(firstPortalFinalResponse));
+//
+// //Load the main portal page on secondPortalContext
+// String secondContextPortalUrl = this.sameHostSecondPortal;
+// portalConversation = this.startConversation(secondContextPortalUrl);
+//
+// //Click the Login Link on the secondPortalContext
+// String secondContextLoginUrl = secondContextPortalUrl + "/auth/portal/default/default";
+// this.sendGet(secondContextLoginUrl, portalConversation);
+//
+// //Perform re-direct to the CAS Server but this time sending in the CAS cookie
+// TestCase.assertNotNull(portalConversation.getRedirectLocation());
+// TestCase.assertEquals(portalConversation.getStatusCode(), 302);
+// casLocation = portalConversation.getRedirectLocation();
+// casConversation = this.startConversation(casLocation,casCookie);
+//
+//
+// //Assert the redirect and it should be to the CAS Server, but this time
+// //It should end up with an Authenticated session back to the secondPortalContext
+// secondPortalFinalResponse = casConversation.getResponse();
+// TestCase.assertTrue(this.isUserLoggedIn(secondPortalFinalResponse));
+//
+// //Assert and make sure its the same user logged into both Portals
+// String firstPortalUser = this.extractLoggedInUser(firstPortalFinalResponse);
+// String secondPortalUser = this.extractLoggedInUser(secondPortalFinalResponse);
+// TestCase.assertEquals(firstPortalUser, this.username);
+// TestCase.assertEquals(secondPortalUser, this.username);
+// TestCase.assertEquals(firstPortalUser, secondPortalUser);
+// }
+//
+// /**
+// *
+// * @param portalUrl
+// * @return
+// * @throws Exception
+// */
+// private WebConversation startConversation(String portalUrl) throws Exception
+// {
+// WebConversation conversation = null;
+//
+// HttpClient httpClient = new HttpClient();
+// GetMethod getMethod = new GetMethod(portalUrl);
+// try
+// {
+// conversation = new WebConversation();
+//
+// int statusCode = httpClient.executeMethod(getMethod);
+// String response = getMethod.getResponseBodyAsString();
+//
+// Cookie[] cookies = httpClient.getState().getCookies();
+// for(int i=0;i<cookies.length;i++)
+// {
+// if(cookies[i].getName().equals("JSESSIONID"))
+// {
+// conversation.setSessionId(cookies[i].getValue());
+// }
+// }
+//
+// conversation.setClient(httpClient);
+// conversation.setStatusCode(statusCode);
+// conversation.setResponse(response);
+// }
+// finally
+// {
+// if(getMethod != null)
+// {
+// getMethod.releaseConnection();
+// }
+// }
+//
+// return conversation;
+// }
+//
+// /**
+// *
+// * @param portalUrl
+// * @return
+// * @throws Exception
+// */
+// private WebConversation startConversation(String portalUrl, Cookie casCookie) throws Exception
+// {
+// WebConversation conversation = null;
+//
+// HttpClient httpClient = new HttpClient();
+// GetMethod getMethod = new GetMethod(portalUrl);
+//
+// //Set casCookie to be sent in
+// getMethod.setRequestHeader("Cookie",casCookie.getName()+"="+casCookie.getValue());
+//
+// try
+// {
+// conversation = new WebConversation();
+//
+// int statusCode = httpClient.executeMethod(getMethod);
+// String response = getMethod.getResponseBodyAsString();
+//
+// Cookie[] cookies = httpClient.getState().getCookies();
+// for(int i=0;i<cookies.length;i++)
+// {
+// if(cookies[i].getName().equals("JSESSIONID"))
+// {
+// conversation.setSessionId(cookies[i].getValue());
+// }
+// }
+//
+// conversation.setClient(httpClient);
+// conversation.setStatusCode(statusCode);
+// conversation.setResponse(response);
+// }
+// finally
+// {
+// if(getMethod != null)
+// {
+// getMethod.releaseConnection();
+// }
+// }
+//
+// return conversation;
+// }
+//
+// /**
+// *
+// * @param portalUrl
+// * @param conversation
+// * @throws Exception
+// */
+// private void sendGet(String portalUrl,WebConversation conversation) throws Exception
+// {
+// HttpClient httpClient = conversation.getClient();
+//
+// GetMethod getMethod = new GetMethod(portalUrl);
+// getMethod.setFollowRedirects(false);
+// try
+// {
+// int statusCode = httpClient.executeMethod(getMethod);
+//
+// String response = getMethod.getResponseBodyAsString();
+//
+// Cookie[] cookies = httpClient.getState().getCookies();
+// for(int i=0;i<cookies.length;i++)
+// {
+// if(cookies[i].getName().equals("JSESSIONID"))
+// {
+// conversation.setSessionId(cookies[i].getValue());
+// }
+// }
+//
+// conversation.setStatusCode(statusCode);
+// conversation.setResponse(response);
+//
+// if(statusCode == 302)
+// {
+// //Store the redirect location
+// String location = getMethod.getResponseHeader("Location").getValue();
+// conversation.setRedirectLocation(location);
+// }
+// }
+// finally
+// {
+// if(getMethod != null)
+// {
+// getMethod.releaseConnection();
+// }
+// }
+// }
+//
+//
+// /**
+// *
+// * @param url
+// * @param parameters
+// * @param conversation
+// * @throws Exception
+// */
+// private void sendPost(String url,Map parameters,WebConversation conversation) throws Exception
+// {
+// HttpClient httpClient = conversation.getClient();
+//
+// PostMethod postMethod = new PostMethod(url);
+//
+// //Add post parameters
+// Set keySet = parameters.keySet();
+// NameValuePair[] postdata = new NameValuePair[keySet.size()];
+// int index = 0;
+// for(Iterator itr=keySet.iterator();itr.hasNext();)
+// {
+// String name = (String)itr.next();
+// String value = (String)parameters.get(name);
+// postdata[index++] = new NameValuePair(name,value);
+// }
+// postMethod.setRequestBody(postdata);
+// try
+// {
+// int statusCode = httpClient.executeMethod(postMethod);
+//
+// String response = postMethod.getResponseBodyAsString();
+//
+// Cookie[] cookies = httpClient.getState().getCookies();
+// for(int i=0;i<cookies.length;i++)
+// {
+// if(cookies[i].getName().equals("JSESSIONID"))
+// {
+// conversation.setSessionId(cookies[i].getValue());
+// }
+// if(cookies[i].getName().equals("CASTGC"))
+// {
+// conversation.setCasCookie(cookies[i]);
+// }
+// }
+//
+// conversation.setStatusCode(statusCode);
+// conversation.setResponse(response);
+//
+// if(statusCode == 302)
+// {
+// //Store the redirect location
+// String location = postMethod.getResponseHeader("Location").getValue();
+// conversation.setRedirectLocation(location);
+// }
+// }
+// finally
+// {
+// if(postMethod != null)
+// {
+// postMethod.releaseConnection();
+// }
+// }
+// }
+//
+// /**
+// *
+// * @param response
+// * @return
+// */
+// private boolean isUserLoggedIn(String response)
+// {
+// boolean isUserLoggedIn = false;
+//
+// isUserLoggedIn = (response.indexOf(this.userLoggedInIndicator) != -1);
+//
+// return isUserLoggedIn;
+// }
+//
+// /**
+// *
+// * @param response
+// * @return
+// */
+// private String extractLoggedInUser(String response)
+// {
+// String loggedInUser = null;
+//
+// int startIndex = response.indexOf(this.userLoggedInIndicator) + this.userLoggedInIndicator.length();
+// int endIndex = response.indexOf("<",startIndex);
+//
+// loggedInUser = response.substring(startIndex,endIndex).trim();
+//
+// return loggedInUser;
+// }
+//
+// /**
+// *
+// * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+// *
+// */
+// private static class WebConversation
+// {
+// /**
+// *
+// */
+// private HttpClient client = null;
+// private String sessionId = null;
+// private int statusCode = 0;
+// private String response = null;
+// private String redirectLocation = null;
+// private Cookie casCookie = null;
+//
+// /**
+// *
+// *
+// */
+// public WebConversation()
+// {
+//
+// }
+//
+// /**
+// *
+// * @return
+// */
+// public HttpClient getClient()
+// {
+// return this.client;
+// }
+//
+// /**
+// *
+// * @param client
+// */
+// public void setClient(HttpClient client)
+// {
+// this.client = client;
+// }
+//
+// public String getResponse()
+// {
+// return response;
+// }
+//
+// public void setResponse(String response)
+// {
+// this.response = response;
+// }
+//
+// public int getStatusCode()
+// {
+// return statusCode;
+// }
+//
+// public void setStatusCode(int statusCode)
+// {
+// this.statusCode = statusCode;
+// }
+//
+// public String getSessionId()
+// {
+// return sessionId;
+// }
+//
+// public void setSessionId(String sessionId)
+// {
+// this.sessionId = sessionId;
+// }
+//
+// public String getRedirectLocation()
+// {
+// return redirectLocation;
+// }
+//
+// public void setRedirectLocation(String redirectLocation)
+// {
+// this.redirectLocation = redirectLocation;
+// }
+//
+// public Cookie getCasCookie()
+// {
+// return casCookie;
+// }
+//
+// public void setCasCookie(Cookie casCookie)
+// {
+// this.casCookie = casCookie;
+// }
+// }
+//}
Modified: modules/identity/trunk/sso/src/main/org/jboss/portal/test/identity/sso/EasySSLProtocolSocketFactory.java
===================================================================
--- modules/identity/trunk/sso/src/main/org/jboss/portal/test/identity/sso/EasySSLProtocolSocketFactory.java 2007-10-17 11:11:09 UTC (rev 8674)
+++ modules/identity/trunk/sso/src/main/org/jboss/portal/test/identity/sso/EasySSLProtocolSocketFactory.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -1,233 +1,233 @@
-/*
- * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//httpclient/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasySSLProtocolSocketFactory.java,v 1.7 2004/06/11 19:26:27 olegk Exp $
- * $Revision$
- * $Date$
- *
- * ====================================================================
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.jboss.portal.test.identity.sso;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.Socket;
-import java.net.SocketAddress;
-import java.net.UnknownHostException;
-
-import org.apache.commons.httpclient.ConnectTimeoutException;
-import org.apache.commons.httpclient.HttpClientError;
-import org.apache.commons.httpclient.params.HttpConnectionParams;
-import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory;
-
-import javax.net.SocketFactory;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.TrustManager;
-
-/**
- * <p>
- * EasySSLProtocolSocketFactory can be used to creats SSL {@link Socket}s that
- * accept self-signed certificates.
- * </p>
- * <p>
- * This socket factory SHOULD NOT be used for productive systems due to security
- * reasons, unless it is a concious decision and you are perfectly aware of
- * security implications of accepting self-signed certificates
- * </p>
- *
- * <p>
- * Example of using custom protocol socket factory for a specific host:
- *
- * <pre>
- * Protocol easyhttps = new Protocol("https", new EasySSLProtocolSocketFactory(),
- * 443);
- * HttpClient client = new HttpClient();
- * client.getHostConfiguration().setHost("localhost", 443, easyhttps);
- * // use relative url only
- * GetMethod httpget = new GetMethod("/");
- * client.executeMethod(httpget);
- * </pre>
- *
- * </p>
- * <p>
- * Example of using custom protocol socket factory per default instead of the
- * standard one:
- *
- * <pre>
- * Protocol easyhttps = new Protocol("https", new EasySSLProtocolSocketFactory(),
- * 443);
- * Protocol.registerProtocol("https", easyhttps);
- * HttpClient client = new HttpClient();
- * GetMethod httpget = new GetMethod("https://localhost/");
- * client.executeMethod(httpget);
- * </pre>
- *
- * </p>
- *
- * @author <a href="mailto:oleg -at- ural.ru">Oleg Kalnichevski</a>
- *
- * <p>
- * DISCLAIMER: HttpClient developers DO NOT actively support this component. The
- * component is provided as a reference material, which may be inappropriate for
- * use without additional customization.
- * </p>
- */
-
-public class EasySSLProtocolSocketFactory implements
- SecureProtocolSocketFactory
-{
-
- private SSLContext sslcontext = null;
-
- /**
- * Constructor for EasySSLProtocolSocketFactory.
- */
- public EasySSLProtocolSocketFactory()
- {
- super();
- }
-
- private static SSLContext createEasySSLContext()
- {
- try
- {
- SSLContext context = SSLContext.getInstance("SSL");
- context.init(null, new TrustManager[]
- { new EasyX509TrustManager(null) }, null);
- return context;
- }
- catch (Exception e)
- {
- throw new HttpClientError(e.toString());
- }
- }
-
- private SSLContext getSSLContext()
- {
- if (this.sslcontext == null)
- {
- this.sslcontext = createEasySSLContext();
- }
- return this.sslcontext;
- }
-
- /**
- * @see SecureProtocolSocketFactory#createSocket(java.lang.String,int,java.net.InetAddress,int)
- */
- public Socket createSocket(String host, int port, InetAddress clientHost,
- int clientPort) throws IOException, UnknownHostException
- {
-
- return getSSLContext().getSocketFactory().createSocket(host, port,
- clientHost, clientPort);
- }
-
- /**
- * Attempts to get a new socket connection to the given host within the given
- * time limit.
- * <p>
- * To circumvent the limitations of older JREs that do not support connect
- * timeout a controller thread is executed. The controller thread attempts to
- * create a new socket within the given limit of time. If socket constructor
- * does not return until the timeout expires, the controller terminates and
- * throws an {@link ConnectTimeoutException}
- * </p>
- *
- * @param host
- * the host name/IP
- * @param port
- * the port on the host
- * @param clientHost
- * the local host name/IP to bind the socket to
- * @param clientPort
- * the port on the local machine
- * @param params
- * {@link HttpConnectionParams Http connection parameters}
- *
- * @return Socket a new socket
- *
- * @throws IOException
- * if an I/O error occurs while creating the socket
- * @throws UnknownHostException
- * if the IP address of the host cannot be determined
- */
- public Socket createSocket(final String host, final int port,
- final InetAddress localAddress, final int localPort,
- final HttpConnectionParams params) throws IOException,
- UnknownHostException, ConnectTimeoutException
- {
- if (params == null)
- {
- throw new IllegalArgumentException("Parameters may not be null");
- }
- int timeout = params.getConnectionTimeout();
- SocketFactory socketfactory = getSSLContext().getSocketFactory();
- if (timeout == 0)
- {
- return socketfactory.createSocket(host, port, localAddress, localPort);
- }
- else
- {
- Socket socket = socketfactory.createSocket();
- SocketAddress localaddr = new InetSocketAddress(localAddress,
- localPort);
- SocketAddress remoteaddr = new InetSocketAddress(host, port);
- socket.bind(localaddr);
- socket.connect(remoteaddr, timeout);
- return socket;
- }
- }
-
- /**
- * @see SecureProtocolSocketFactory#createSocket(java.lang.String,int)
- */
- public Socket createSocket(String host, int port) throws IOException,
- UnknownHostException
- {
- return getSSLContext().getSocketFactory().createSocket(host, port);
- }
-
- /**
- * @see SecureProtocolSocketFactory#createSocket(java.net.Socket,java.lang.String,int,boolean)
- */
- public Socket createSocket(Socket socket, String host, int port,
- boolean autoClose) throws IOException, UnknownHostException
- {
- return getSSLContext().getSocketFactory().createSocket(socket, host,
- port, autoClose);
- }
-
- public boolean equals(Object obj)
- {
- return ((obj != null) && obj.getClass().equals(
- EasySSLProtocolSocketFactory.class));
- }
-
- public int hashCode()
- {
- return EasySSLProtocolSocketFactory.class.hashCode();
- }
-
-}
+///*
+// * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//httpclient/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasySSLProtocolSocketFactory.java,v 1.7 2004/06/11 19:26:27 olegk Exp $
+// * $Revision$
+// * $Date$
+// *
+// * ====================================================================
+// *
+// * Licensed to the Apache Software Foundation (ASF) under one or more
+// * contributor license agreements. See the NOTICE file distributed with
+// * this work for additional information regarding copyright ownership.
+// * The ASF licenses this file to You under the Apache License, Version 2.0
+// * (the "License"); you may not use this file except in compliance with
+// * the License. You may obtain a copy of the License at
+// *
+// * http://www.apache.org/licenses/LICENSE-2.0
+// *
+// * Unless required by applicable law or agreed to in writing, software
+// * distributed under the License is distributed on an "AS IS" BASIS,
+// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// * See the License for the specific language governing permissions and
+// * limitations under the License.
+// * ====================================================================
+// *
+// * This software consists of voluntary contributions made by many
+// * individuals on behalf of the Apache Software Foundation. For more
+// * information on the Apache Software Foundation, please see
+// * <http://www.apache.org/>.
+// *
+// */
+//
+//package org.jboss.portal.test.identity.sso;
+//
+//import java.io.IOException;
+//import java.net.InetAddress;
+//import java.net.InetSocketAddress;
+//import java.net.Socket;
+//import java.net.SocketAddress;
+//import java.net.UnknownHostException;
+//
+//import org.apache.commons.httpclient.ConnectTimeoutException;
+//import org.apache.commons.httpclient.HttpClientError;
+//import org.apache.commons.httpclient.params.HttpConnectionParams;
+//import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory;
+//
+//import javax.net.SocketFactory;
+//import javax.net.ssl.SSLContext;
+//import javax.net.ssl.TrustManager;
+//
+///**
+// * <p>
+// * EasySSLProtocolSocketFactory can be used to creats SSL {@link Socket}s that
+// * accept self-signed certificates.
+// * </p>
+// * <p>
+// * This socket factory SHOULD NOT be used for productive systems due to security
+// * reasons, unless it is a concious decision and you are perfectly aware of
+// * security implications of accepting self-signed certificates
+// * </p>
+// *
+// * <p>
+// * Example of using custom protocol socket factory for a specific host:
+// *
+// * <pre>
+// * Protocol easyhttps = new Protocol("https", new EasySSLProtocolSocketFactory(),
+// * 443);
+// * HttpClient client = new HttpClient();
+// * client.getHostConfiguration().setHost("localhost", 443, easyhttps);
+// * // use relative url only
+// * GetMethod httpget = new GetMethod("/");
+// * client.executeMethod(httpget);
+// * </pre>
+// *
+// * </p>
+// * <p>
+// * Example of using custom protocol socket factory per default instead of the
+// * standard one:
+// *
+// * <pre>
+// * Protocol easyhttps = new Protocol("https", new EasySSLProtocolSocketFactory(),
+// * 443);
+// * Protocol.registerProtocol("https", easyhttps);
+// * HttpClient client = new HttpClient();
+// * GetMethod httpget = new GetMethod("https://localhost/");
+// * client.executeMethod(httpget);
+// * </pre>
+// *
+// * </p>
+// *
+// * @author <a href="mailto:oleg -at- ural.ru">Oleg Kalnichevski</a>
+// *
+// * <p>
+// * DISCLAIMER: HttpClient developers DO NOT actively support this component. The
+// * component is provided as a reference material, which may be inappropriate for
+// * use without additional customization.
+// * </p>
+// */
+//
+//public class EasySSLProtocolSocketFactory implements
+// SecureProtocolSocketFactory
+//{
+//
+// private SSLContext sslcontext = null;
+//
+// /**
+// * Constructor for EasySSLProtocolSocketFactory.
+// */
+// public EasySSLProtocolSocketFactory()
+// {
+// super();
+// }
+//
+// private static SSLContext createEasySSLContext()
+// {
+// try
+// {
+// SSLContext context = SSLContext.getInstance("SSL");
+// context.init(null, new TrustManager[]
+// { new EasyX509TrustManager(null) }, null);
+// return context;
+// }
+// catch (Exception e)
+// {
+// throw new HttpClientError(e.toString());
+// }
+// }
+//
+// private SSLContext getSSLContext()
+// {
+// if (this.sslcontext == null)
+// {
+// this.sslcontext = createEasySSLContext();
+// }
+// return this.sslcontext;
+// }
+//
+// /**
+// * @see SecureProtocolSocketFactory#createSocket(java.lang.String,int,java.net.InetAddress,int)
+// */
+// public Socket createSocket(String host, int port, InetAddress clientHost,
+// int clientPort) throws IOException, UnknownHostException
+// {
+//
+// return getSSLContext().getSocketFactory().createSocket(host, port,
+// clientHost, clientPort);
+// }
+//
+// /**
+// * Attempts to get a new socket connection to the given host within the given
+// * time limit.
+// * <p>
+// * To circumvent the limitations of older JREs that do not support connect
+// * timeout a controller thread is executed. The controller thread attempts to
+// * create a new socket within the given limit of time. If socket constructor
+// * does not return until the timeout expires, the controller terminates and
+// * throws an {@link ConnectTimeoutException}
+// * </p>
+// *
+// * @param host
+// * the host name/IP
+// * @param port
+// * the port on the host
+// * @param clientHost
+// * the local host name/IP to bind the socket to
+// * @param clientPort
+// * the port on the local machine
+// * @param params
+// * {@link HttpConnectionParams Http connection parameters}
+// *
+// * @return Socket a new socket
+// *
+// * @throws IOException
+// * if an I/O error occurs while creating the socket
+// * @throws UnknownHostException
+// * if the IP address of the host cannot be determined
+// */
+// public Socket createSocket(final String host, final int port,
+// final InetAddress localAddress, final int localPort,
+// final HttpConnectionParams params) throws IOException,
+// UnknownHostException, ConnectTimeoutException
+// {
+// if (params == null)
+// {
+// throw new IllegalArgumentException("Parameters may not be null");
+// }
+// int timeout = params.getConnectionTimeout();
+// SocketFactory socketfactory = getSSLContext().getSocketFactory();
+// if (timeout == 0)
+// {
+// return socketfactory.createSocket(host, port, localAddress, localPort);
+// }
+// else
+// {
+// Socket socket = socketfactory.createSocket();
+// SocketAddress localaddr = new InetSocketAddress(localAddress,
+// localPort);
+// SocketAddress remoteaddr = new InetSocketAddress(host, port);
+// socket.bind(localaddr);
+// socket.connect(remoteaddr, timeout);
+// return socket;
+// }
+// }
+//
+// /**
+// * @see SecureProtocolSocketFactory#createSocket(java.lang.String,int)
+// */
+// public Socket createSocket(String host, int port) throws IOException,
+// UnknownHostException
+// {
+// return getSSLContext().getSocketFactory().createSocket(host, port);
+// }
+//
+// /**
+// * @see SecureProtocolSocketFactory#createSocket(java.net.Socket,java.lang.String,int,boolean)
+// */
+// public Socket createSocket(Socket socket, String host, int port,
+// boolean autoClose) throws IOException, UnknownHostException
+// {
+// return getSSLContext().getSocketFactory().createSocket(socket, host,
+// port, autoClose);
+// }
+//
+// public boolean equals(Object obj)
+// {
+// return ((obj != null) && obj.getClass().equals(
+// EasySSLProtocolSocketFactory.class));
+// }
+//
+// public int hashCode()
+// {
+// return EasySSLProtocolSocketFactory.class.hashCode();
+// }
+//
+//}
Modified: modules/identity/trunk/sso/src/main/org/jboss/portal/test/identity/sso/EasyX509TrustManager.java
===================================================================
--- modules/identity/trunk/sso/src/main/org/jboss/portal/test/identity/sso/EasyX509TrustManager.java 2007-10-17 11:11:09 UTC (rev 8674)
+++ modules/identity/trunk/sso/src/main/org/jboss/portal/test/identity/sso/EasyX509TrustManager.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -1,109 +1,109 @@
-/*
-* ====================================================================
-*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-* ====================================================================
-*
-* This software consists of voluntary contributions made by many
-* individuals on behalf of the Apache Software Foundation. For more
-* information on the Apache Software Foundation, please see
-* <http://www.apache.org/>.
-*
-*/
-
-package org.jboss.portal.test.identity.sso;
-
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
-
-import javax.net.ssl.TrustManagerFactory;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.X509TrustManager;
-
-/**
-* <p>
-* EasyX509TrustManager unlike default {@link X509TrustManager} accepts
-* self-signed certificates.
-* </p>
-* <p>
-* This trust manager SHOULD NOT be used for productive systems
-* due to security reasons, unless it is a concious decision and
-* you are perfectly aware of security implications of accepting
-* self-signed certificates
-* </p>
-*
-* @author <a href="mailto:adrian.sutton@ephox.com">Adrian Sutton</a>
-* @author <a href="mailto:oleg@ural.ru">Oleg Kalnichevski</a>
-*
-* <p>
-* DISCLAIMER: HttpClient developers DO NOT actively support this component.
-* The component is provided as a reference material, which may be inappropriate
-* for use without additional customization.
-* </p>
-*/
-
-public class EasyX509TrustManager implements X509TrustManager
-{
- private X509TrustManager standardTrustManager = null;
-
- /**
- * Constructor for EasyX509TrustManager.
- */
- public EasyX509TrustManager(KeyStore keystore) throws NoSuchAlgorithmException, KeyStoreException {
- super();
- TrustManagerFactory factory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
- factory.init(keystore);
- TrustManager[] trustmanagers = factory.getTrustManagers();
- if (trustmanagers.length == 0) {
- throw new NoSuchAlgorithmException("no trust manager found");
- }
- this.standardTrustManager = (X509TrustManager)trustmanagers[0];
- }
-
- /**
- * @see javax.net.ssl.X509TrustManager#checkClientTrusted(X509Certificate[],String authType)
- */
- public void checkClientTrusted(X509Certificate[] certificates,String authType) throws CertificateException {
- standardTrustManager.checkClientTrusted(certificates,authType);
- }
-
- /**
- * @see javax.net.ssl.X509TrustManager#checkServerTrusted(X509Certificate[],String authType)
- */
- public void checkServerTrusted(X509Certificate[] certificates,String authType) throws CertificateException {
- /*if ((certificates != null) && LOG.isDebugEnabled()) {
- LOG.debug("Server certificate chain:");
- for (int i = 0; i < certificates.length; i++) {
- LOG.debug("X509Certificate[" + i + "]=" + certificates[i]);
- }
- }*/
- if ((certificates != null) && (certificates.length == 1)) {
- certificates[0].checkValidity();
- } else {
- standardTrustManager.checkServerTrusted(certificates,authType);
- }
- }
-
- /**
- * @see javax.net.ssl.X509TrustManager#getAcceptedIssuers()
- */
- public X509Certificate[] getAcceptedIssuers() {
- return this.standardTrustManager.getAcceptedIssuers();
- }
-}
\ No newline at end of file
+///*
+//* ====================================================================
+//*
+//* Licensed to the Apache Software Foundation (ASF) under one or more
+//* contributor license agreements. See the NOTICE file distributed with
+//* this work for additional information regarding copyright ownership.
+//* The ASF licenses this file to You under the Apache License, Version 2.0
+//* (the "License"); you may not use this file except in compliance with
+//* the License. You may obtain a copy of the License at
+//*
+//* http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing, software
+//* distributed under the License is distributed on an "AS IS" BASIS,
+//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//* See the License for the specific language governing permissions and
+//* limitations under the License.
+//* ====================================================================
+//*
+//* This software consists of voluntary contributions made by many
+//* individuals on behalf of the Apache Software Foundation. For more
+//* information on the Apache Software Foundation, please see
+//* <http://www.apache.org/>.
+//*
+//*/
+//
+//package org.jboss.portal.test.identity.sso;
+//
+//import java.security.KeyStore;
+//import java.security.KeyStoreException;
+//import java.security.NoSuchAlgorithmException;
+//import java.security.cert.CertificateException;
+//import java.security.cert.X509Certificate;
+//
+//import javax.net.ssl.TrustManagerFactory;
+//import javax.net.ssl.TrustManager;
+//import javax.net.ssl.X509TrustManager;
+//
+///**
+//* <p>
+//* EasyX509TrustManager unlike default {@link X509TrustManager} accepts
+//* self-signed certificates.
+//* </p>
+//* <p>
+//* This trust manager SHOULD NOT be used for productive systems
+//* due to security reasons, unless it is a concious decision and
+//* you are perfectly aware of security implications of accepting
+//* self-signed certificates
+//* </p>
+//*
+//* @author <a href="mailto:adrian.sutton@ephox.com">Adrian Sutton</a>
+//* @author <a href="mailto:oleg@ural.ru">Oleg Kalnichevski</a>
+//*
+//* <p>
+//* DISCLAIMER: HttpClient developers DO NOT actively support this component.
+//* The component is provided as a reference material, which may be inappropriate
+//* for use without additional customization.
+//* </p>
+//*/
+//
+//public class EasyX509TrustManager implements X509TrustManager
+//{
+// private X509TrustManager standardTrustManager = null;
+//
+// /**
+// * Constructor for EasyX509TrustManager.
+// */
+// public EasyX509TrustManager(KeyStore keystore) throws NoSuchAlgorithmException, KeyStoreException {
+// super();
+// TrustManagerFactory factory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
+// factory.init(keystore);
+// TrustManager[] trustmanagers = factory.getTrustManagers();
+// if (trustmanagers.length == 0) {
+// throw new NoSuchAlgorithmException("no trust manager found");
+// }
+// this.standardTrustManager = (X509TrustManager)trustmanagers[0];
+// }
+//
+// /**
+// * @see javax.net.ssl.X509TrustManager#checkClientTrusted(X509Certificate[],String authType)
+// */
+// public void checkClientTrusted(X509Certificate[] certificates,String authType) throws CertificateException {
+// standardTrustManager.checkClientTrusted(certificates,authType);
+// }
+//
+// /**
+// * @see javax.net.ssl.X509TrustManager#checkServerTrusted(X509Certificate[],String authType)
+// */
+// public void checkServerTrusted(X509Certificate[] certificates,String authType) throws CertificateException {
+// /*if ((certificates != null) && LOG.isDebugEnabled()) {
+// LOG.debug("Server certificate chain:");
+// for (int i = 0; i < certificates.length; i++) {
+// LOG.debug("X509Certificate[" + i + "]=" + certificates[i]);
+// }
+// }*/
+// if ((certificates != null) && (certificates.length == 1)) {
+// certificates[0].checkValidity();
+// } else {
+// standardTrustManager.checkServerTrusted(certificates,authType);
+// }
+// }
+//
+// /**
+// * @see javax.net.ssl.X509TrustManager#getAcceptedIssuers()
+// */
+// public X509Certificate[] getAcceptedIssuers() {
+// return this.standardTrustManager.getAcceptedIssuers();
+// }
+//}
\ No newline at end of file
Modified: modules/identity/trunk/sso/src/main/org/jboss/portal/test/identity/sso/JOSSOTestCase.java
===================================================================
--- modules/identity/trunk/sso/src/main/org/jboss/portal/test/identity/sso/JOSSOTestCase.java 2007-10-17 11:11:09 UTC (rev 8674)
+++ modules/identity/trunk/sso/src/main/org/jboss/portal/test/identity/sso/JOSSOTestCase.java 2007-10-17 13:05:03 UTC (rev 8675)
@@ -1,726 +1,726 @@
-/******************************************************************************
- * 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.portal.test.identity.sso;
-
-import java.util.Map;
-import java.util.Set;
-import java.util.Iterator;
-import java.util.HashMap;
-
-import org.jboss.portal.test.framework.mc.TestRuntimeContext;
-
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.Cookie;
-import org.apache.commons.httpclient.NameValuePair;
-import org.apache.commons.httpclient.methods.GetMethod;
-import org.apache.commons.httpclient.methods.PostMethod;
-import org.apache.commons.httpclient.protocol.Protocol;
-
-import junit.framework.TestCase;
-
-/**
- * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
- *
- */
-public class JOSSOTestCase extends TestCase
-{
- /**
- *
- */
- private String firstPortal = null;
- private String secondPortal = null;
- private String sameHostSecondPortal = null;
- private String jossoServer = null;
- private String userLoggedInIndicator = null;
- private String username = null;
- private String password = null;
-
- /**
- *
- */
- protected TestRuntimeContext runtimeContext = null;
-
- /**
- *
- */
- protected void setUp() throws Exception
- {
- super.setUp();
-
- this.runtimeContext = new TestRuntimeContext("org/jboss/portal/test/identity/sso-beans.xml");
-
- this.runtimeContext.addBean("JOSSOConfig", this);
- this.runtimeContext.addBean("CASConfig", new CASTestCase());
-
- this.runtimeContext.start();
-
- //SSL setup
- Protocol.registerProtocol("https",new Protocol("https", new EasySSLProtocolSocketFactory(), 443));
- }
-
- /**
- *
- */
- protected void tearDown() throws Exception
- {
- super.tearDown();
-
- //Service stoppage
- this.runtimeContext.stop();
-
- //Data cleanup
- this.runtimeContext = null;
- }
-
- /**
- *
- * @return
- */
- public String getUserLoggedInIndicator()
- {
- return userLoggedInIndicator;
- }
-
- /**
- *
- * @param userLoggedInIndicator
- */
- public void setUserLoggedInIndicator(String userLoggedInIndicator)
- {
- this.userLoggedInIndicator = userLoggedInIndicator;
- }
-
- /**
- *
- * @return
- */
- public String getPassword()
- {
- return password;
- }
-
- /**
- *
- * @param password
- */
- public void setPassword(String password)
- {
- this.password = password;
- }
-
- /**
- *
- * @return
- */
- public String getUsername()
- {
- return username;
- }
-
- /**
- *
- * @param username
- */
- public void setUsername(String username)
- {
- this.username = username;
- }
-
- /**
- *
- * @return
- */
- public String getFirstPortal()
- {
- return firstPortal;
- }
-
- /**
- *
- * @param firstPortal
- */
- public void setFirstPortal(String firstPortal)
- {
- this.firstPortal = firstPortal;
- }
-
- /**
- *
- * @return
- */
- public String getSecondPortal()
- {
- return secondPortal;
- }
-
- /**
- *
- * @param secondPortal
- */
- public void setSecondPortal(String secondPortal)
- {
- this.secondPortal = secondPortal;
- }
-
- /**
- *
- * @return
- */
- public String getJossoServer()
- {
- return jossoServer;
- }
-
- /**
- *
- * @param jossoServer
- */
- public void setJossoServer(String jossoServer)
- {
- this.jossoServer = jossoServer;
- }
-
- /**
- *
- * @return
- */
- public String getSameHostSecondPortal()
- {
- return sameHostSecondPortal;
- }
-
- /**
- *
- * @param sameHostSecondPortal
- */
- public void setSameHostSecondPortal(String sameHostSecondPortal)
- {
- this.sameHostSecondPortal = sameHostSecondPortal;
- }
-
- /**
- * This tests the scenario when the two portals are deployed on separate hosts/servers
- *
- * @throws Exception
- */
- public void testMultiHostDeployment() throws Exception
- {
- Cookie ssoCookie = null;
- String firstPortalFinalResponse = null;
- String secondPortalFinalResponse = null;
-
- //Load the main portal page on firstPortalContext
- String firstContextPortalUrl = this.firstPortal;
- WebConversation portalConversation = this.startConversation(firstContextPortalUrl);
- TestCase.assertFalse(this.isUserLoggedIn(portalConversation.getResponse()));
-
- //Click the Login link on the firstPortalContext
- String firstContextLoginUrl = firstContextPortalUrl + "/auth/portal/default/default";
- this.sendGet(firstContextLoginUrl, portalConversation);
-
- //Navigate to a secured resource on the portal
- TestCase.assertNotNull(portalConversation.getRedirectLocation());
- TestCase.assertEquals(portalConversation.getStatusCode(), 302);
- String portalToJOSSO = portalConversation.getRedirectLocation();
- this.sendGet(portalToJOSSO, portalConversation);
-
- //When authentication is triggered, move over to the JOSSO server establishing an SSO session with JOSSO
- String jossoLocation = portalConversation.getRedirectLocation();
- WebConversation ssoConversation = this.startConversation(jossoLocation);
- String response = ssoConversation.getResponse();
-
- //Extract the josso post action value
- int searchIndex = response.indexOf("action=\"")+9;
- int endIndex = response.indexOf('"', searchIndex);
- String action = response.substring(searchIndex,endIndex);
-
- //Perform HTTP Post based authentication with the JOSSO Server
- Map postParams = new HashMap();
- postParams.put("josso_username", this.username);
- postParams.put("josso_password", this.password);
- postParams.put("josso_cmd", "login");
- this.sendPost("http://"+ this.jossoServer +"/"+action,postParams, ssoConversation);
-
- //Go back to the Portal since login has succeeded, starting with assertion on the JOSSO Agent installed on the Portal
- String assertUrl = ssoConversation.getRedirectLocation();
- this.sendGet(assertUrl, portalConversation);
-
- //Now go back to the original Portal resource requested. This time user should have an authenticated session established
- TestCase.assertNotNull(portalConversation.getRedirectLocation());
- TestCase.assertEquals(portalConversation.getStatusCode(), 302);
- TestCase.assertTrue(portalConversation.getRedirectLocation().indexOf(firstContextLoginUrl) != -1);
- TestCase.assertNotNull(portalConversation.getSSOCookie());
- String goBack = portalConversation.getRedirectLocation();
- ssoCookie = ssoConversation.getSSOCookie();
- this.sendGet(goBack, portalConversation);
- firstPortalFinalResponse = portalConversation.getResponse();
- TestCase.assertTrue(this.isUserLoggedIn(firstPortalFinalResponse));
-
- //Load the main portal page on secondPortalContext
- String secondContextPortalUrl = this.secondPortal;
- portalConversation = this.startConversation(secondContextPortalUrl);
-
- //Click the Login Link on the secondPortalContext
- String secondContextLoginUrl = secondContextPortalUrl + "/auth/portal/default/default";
- this.sendGet(secondContextLoginUrl, portalConversation);
-
- //Perform re-direct to the JOSSO Server but this time sending in the JOSSO cookie
- TestCase.assertNotNull(portalConversation.getRedirectLocation());
- TestCase.assertEquals(portalConversation.getStatusCode(), 302);
- portalToJOSSO = portalConversation.getRedirectLocation();
- this.sendGet(portalToJOSSO, portalConversation);
-
-
- //Assert the redirect and it should be to the JOSSO Server, but this time
- //It should end up with an Authenticated session back to the secondPortalContext
- jossoLocation = portalConversation.getRedirectLocation();
- ssoConversation = this.startConversation(jossoLocation,ssoCookie);
- secondPortalFinalResponse = ssoConversation.getResponse();
- TestCase.assertTrue(this.isUserLoggedIn(secondPortalFinalResponse));
-
- //Assert and make sure its the same user logged into both Portals
- String firstPortalUser = this.extractLoggedInUser(firstPortalFinalResponse);
- String secondPortalUser = this.extractLoggedInUser(secondPortalFinalResponse);
- TestCase.assertEquals(firstPortalUser, this.username);
- TestCase.assertEquals(secondPortalUser, this.username);
- TestCase.assertEquals(firstPortalUser, secondPortalUser);
- }
-
- /**
- * This tests the scenario where the two portals are deployed within the same host/server but under
- * different web contexts
- *
- * @throws Exception
- */
- public void testSameHostDeployment() throws Exception
- {
- Cookie ssoCookie = null;
- String firstPortalFinalResponse = null;
- String secondPortalFinalResponse = null;
-
- //Load the main portal page on firstPortalContext
- String firstContextPortalUrl = this.firstPortal;
- WebConversation portalConversation = this.startConversation(firstContextPortalUrl);
- TestCase.assertFalse(this.isUserLoggedIn(portalConversation.getResponse()));
-
- //Click the Login link on the firstPortalContext
- String firstContextLoginUrl = firstContextPortalUrl + "/auth/portal/default/default";
- this.sendGet(firstContextLoginUrl, portalConversation);
-
- //Navigate to a secured resource on the portal
- TestCase.assertNotNull(portalConversation.getRedirectLocation());
- TestCase.assertEquals(portalConversation.getStatusCode(), 302);
- String portalToJOSSO = portalConversation.getRedirectLocation();
- this.sendGet(portalToJOSSO, portalConversation);
-
- //When authentication is triggered, move over to the JOSSO server establishing an SSO session with JOSSO
- String jossoLocation = portalConversation.getRedirectLocation();
- WebConversation ssoConversation = this.startConversation(jossoLocation);
- String response = ssoConversation.getResponse();
-
- //Extract the josso post action value
- int searchIndex = response.indexOf("action=\"")+9;
- int endIndex = response.indexOf('"', searchIndex);
- String action = response.substring(searchIndex,endIndex);
-
- //Perform HTTP Post based authentication with the JOSSO Server
- Map postParams = new HashMap();
- postParams.put("josso_username", this.username);
- postParams.put("josso_password", this.password);
- postParams.put("josso_cmd", "login");
- this.sendPost("http://"+ this.jossoServer +"/"+action,postParams, ssoConversation);
-
- //Go back to the Portal since login has succeeded, starting with assertion on the JOSSO Agent installed on the Portal
- String assertUrl = ssoConversation.getRedirectLocation();
- this.sendGet(assertUrl, portalConversation);
-
- //Now go back to the original Portal resource requested. This time user should have an authenticated session established
- TestCase.assertNotNull(portalConversation.getRedirectLocation());
- TestCase.assertEquals(portalConversation.getStatusCode(), 302);
- TestCase.assertTrue(portalConversation.getRedirectLocation().indexOf(firstContextLoginUrl) != -1);
- TestCase.assertNotNull(portalConversation.getSSOCookie());
- String goBack = portalConversation.getRedirectLocation();
- ssoCookie = ssoConversation.getSSOCookie();
- this.sendGet(goBack, portalConversation);
- firstPortalFinalResponse = portalConversation.getResponse();
- TestCase.assertTrue(this.isUserLoggedIn(firstPortalFinalResponse));
-
- //Load the main portal page on secondPortalContext
- String secondContextPortalUrl = this.sameHostSecondPortal;
- portalConversation = this.startConversation(secondContextPortalUrl);
-
- //Click the Login Link on the secondPortalContext
- String secondContextLoginUrl = secondContextPortalUrl + "/auth/portal/default/default";
- this.sendGet(secondContextLoginUrl, portalConversation);
-
- //Perform re-direct to the JOSSO Server but this time sending in the JOSSO cookie
- TestCase.assertNotNull(portalConversation.getRedirectLocation());
- TestCase.assertEquals(portalConversation.getStatusCode(), 302);
- portalToJOSSO = portalConversation.getRedirectLocation();
- this.sendGet(portalToJOSSO, portalConversation);
-
-
- //Assert the redirect and it should be to the JOSSO Server, but this time
- //It should end up with an Authenticated session back to the secondPortalContext
- jossoLocation = portalConversation.getRedirectLocation();
- ssoConversation = this.startConversation(jossoLocation,ssoCookie);
- secondPortalFinalResponse = ssoConversation.getResponse();
- TestCase.assertTrue(this.isUserLoggedIn(secondPortalFinalResponse));
-
- //Assert and make sure its the same user logged into both Portals
- String firstPortalUser = this.extractLoggedInUser(firstPortalFinalResponse);
- String secondPortalUser = this.extractLoggedInUser(secondPortalFinalResponse);
- TestCase.assertEquals(firstPortalUser, this.username);
- TestCase.assertEquals(secondPortalUser, this.username);
- TestCase.assertEquals(firstPortalUser, secondPortalUser);
- }
-
- /**
- *
- * @param portalUrl
- * @return
- * @throws Exception
- */
- private WebConversation startConversation(String portalUrl) throws Exception
- {
- WebConversation conversation = null;
-
- HttpClient httpClient = new HttpClient();
- GetMethod getMethod = new GetMethod(portalUrl);
- try
- {
- conversation = new WebConversation();
-
- int statusCode = httpClient.executeMethod(getMethod);
- String response = getMethod.getResponseBodyAsString();
-
- Cookie[] cookies = httpClient.getState().getCookies();
- for(int i=0;i<cookies.length;i++)
- {
- if(cookies[i].getName().equals("JSESSIONID"))
- {
- conversation.setSessionId(cookies[i].getValue());
- }
- }
-
- conversation.setClient(httpClient);
- conversation.setStatusCode(statusCode);
- conversation.setResponse(response);
- }
- finally
- {
- if(getMethod != null)
- {
- getMethod.releaseConnection();
- }
- }
-
- return conversation;
- }
-
- /**
- *
- * @param portalUrl
- * @return
- * @throws Exception
- */
- private WebConversation startConversation(String portalUrl, Cookie ssoCookie) throws Exception
- {
- WebConversation conversation = null;
-
- HttpClient httpClient = new HttpClient();
- GetMethod getMethod = new GetMethod(portalUrl);
-
- //Set ssoCookie to be sent in
- getMethod.setRequestHeader("Cookie",ssoCookie.getName()+"="+ssoCookie.getValue());
-
- try
- {
- conversation = new WebConversation();
-
- int statusCode = httpClient.executeMethod(getMethod);
- String response = getMethod.getResponseBodyAsString();
-
- Cookie[] cookies = httpClient.getState().getCookies();
- for(int i=0;i<cookies.length;i++)
- {
- if(cookies[i].getName().equals("JSESSIONID"))
- {
- conversation.setSessionId(cookies[i].getValue());
- }
- }
-
- conversation.setClient(httpClient);
- conversation.setStatusCode(statusCode);
- conversation.setResponse(response);
- }
- finally
- {
- if(getMethod != null)
- {
- getMethod.releaseConnection();
- }
- }
-
- return conversation;
- }
-
- /**
- *
- * @param portalUrl
- * @param conversation
- * @throws Exception
- */
- private void sendGet(String portalUrl,WebConversation conversation) throws Exception
- {
- HttpClient httpClient = conversation.getClient();
-
- GetMethod getMethod = new GetMethod(portalUrl);
- getMethod.setFollowRedirects(false);
- try
- {
- int statusCode = httpClient.executeMethod(getMethod);
-
- String response = getMethod.getResponseBodyAsString();
-
- Cookie[] cookies = httpClient.getState().getCookies();
- for(int i=0;i<cookies.length;i++)
- {
- if(cookies[i].getName().equals("JSESSIONID"))
- {
- conversation.setSessionId(cookies[i].getValue());
- }
- if(cookies[i].getName().equals("JOSSO_SESSIONID"))
- {
- conversation.setSSOCookie(cookies[i]);
- }
- }
-
- conversation.setStatusCode(statusCode);
- conversation.setResponse(response);
-
- if(statusCode == 302)
- {
- //Store the redirect location
- String location = getMethod.getResponseHeader("Location").getValue();
- conversation.setRedirectLocation(location);
- }
- }
- finally
- {
- if(getMethod != null)
- {
- getMethod.releaseConnection();
- }
- }
- }
-
-
- /**
- *
- * @param url
- * @param parameters
- * @param conversation
- * @throws Exception
- */
- private void sendPost(String url,Map parameters,WebConversation conversation) throws Exception
- {
- HttpClient httpClient = conversation.getClient();
-
- PostMethod postMethod = new PostMethod(url);
-
- //Add post parameters
- Set keySet = parameters.keySet();
- NameValuePair[] postdata = new NameValuePair[keySet.size()];
- int index = 0;
- for(Iterator itr=keySet.iterator();itr.hasNext();)
- {
- String name = (String)itr.next();
- String value = (String)parameters.get(name);
- postdata[index++] = new NameValuePair(name,value);
- }
- postMethod.setRequestBody(postdata);
- try
- {
- int statusCode = httpClient.executeMethod(postMethod);
-
- String response = postMethod.getResponseBodyAsString();
-
- Cookie[] cookies = httpClient.getState().getCookies();
- for(int i=0;i<cookies.length;i++)
- {
- if(cookies[i].getName().equals("JSESSIONID"))
- {
- conversation.setSessionId(cookies[i].getValue());
- }
- if(cookies[i].getName().equals("JOSSO_SESSIONID"))
- {
- conversation.setSSOCookie(cookies[i]);
- }
- }
-
- conversation.setStatusCode(statusCode);
- conversation.setResponse(response);
-
- if(statusCode == 302)
- {
- //Store the redirect location
- String location = postMethod.getResponseHeader("Location").getValue();
- conversation.setRedirectLocation(location);
- }
- }
- finally
- {
- if(postMethod != null)
- {
- postMethod.releaseConnection();
- }
- }
- }
-
- /**
- *
- * @param response
- * @return
- */
- private boolean isUserLoggedIn(String response)
- {
- boolean isUserLoggedIn = false;
-
- isUserLoggedIn = (response.indexOf(this.userLoggedInIndicator) != -1);
-
- return isUserLoggedIn;
- }
-
- /**
- *
- * @param response
- * @return
- */
- private String extractLoggedInUser(String response)
- {
- String loggedInUser = null;
-
- int startIndex = response.indexOf(this.userLoggedInIndicator) + this.userLoggedInIndicator.length();
- int endIndex = response.indexOf("<",startIndex);
-
- loggedInUser = response.substring(startIndex,endIndex).trim();
-
- return loggedInUser;
- }
-
- /**
- *
- * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
- *
- */
- private static class WebConversation
- {
- /**
- *
- */
- private HttpClient client = null;
- private String sessionId = null;
- private int statusCode = 0;
- private String response = null;
- private String redirectLocation = null;
- private Cookie ssoCookie = null;
-
- /**
- *
- *
- */
- public WebConversation()
- {
-
- }
-
- /**
- *
- * @return
- */
- public HttpClient getClient()
- {
- return this.client;
- }
-
- /**
- *
- * @param client
- */
- public void setClient(HttpClient client)
- {
- this.client = client;
- }
-
- public String getResponse()
- {
- return response;
- }
-
- public void setResponse(String response)
- {
- this.response = response;
- }
-
- public int getStatusCode()
- {
- return statusCode;
- }
-
- public void setStatusCode(int statusCode)
- {
- this.statusCode = statusCode;
- }
-
- public String getSessionId()
- {
- return sessionId;
- }
-
- public void setSessionId(String sessionId)
- {
- this.sessionId = sessionId;
- }
-
- public String getRedirectLocation()
- {
- return redirectLocation;
- }
-
- public void setRedirectLocation(String redirectLocation)
- {
- this.redirectLocation = redirectLocation;
- }
-
- public Cookie getSSOCookie()
- {
- return ssoCookie;
- }
-
- public void setSSOCookie(Cookie ssoCookie)
- {
- this.ssoCookie = ssoCookie;
- }
- }
-}
+///******************************************************************************
+// * 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.portal.test.identity.sso;
+//
+//import java.util.Map;
+//import java.util.Set;
+//import java.util.Iterator;
+//import java.util.HashMap;
+//
+//import org.jboss.portal.test.framework.mc.TestRuntimeContext;
+//
+//import org.apache.commons.httpclient.HttpClient;
+//import org.apache.commons.httpclient.Cookie;
+//import org.apache.commons.httpclient.NameValuePair;
+//import org.apache.commons.httpclient.methods.GetMethod;
+//import org.apache.commons.httpclient.methods.PostMethod;
+//import org.apache.commons.httpclient.protocol.Protocol;
+//
+//import junit.framework.TestCase;
+//
+///**
+// * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+// *
+// */
+//public class JOSSOTestCase extends TestCase
+//{
+// /**
+// *
+// */
+// private String firstPortal = null;
+// private String secondPortal = null;
+// private String sameHostSecondPortal = null;
+// private String jossoServer = null;
+// private String userLoggedInIndicator = null;
+// private String username = null;
+// private String password = null;
+//
+// /**
+// *
+// */
+// protected TestRuntimeContext runtimeContext = null;
+//
+// /**
+// *
+// */
+// protected void setUp() throws Exception
+// {
+// super.setUp();
+//
+// this.runtimeContext = new TestRuntimeContext("org/jboss/portal/test/identity/sso-beans.xml");
+//
+// this.runtimeContext.addBean("JOSSOConfig", this);
+// this.runtimeContext.addBean("CASConfig", new CASTestCase());
+//
+// this.runtimeContext.start();
+//
+// //SSL setup
+// Protocol.registerProtocol("https",new Protocol("https", new EasySSLProtocolSocketFactory(), 443));
+// }
+//
+// /**
+// *
+// */
+// protected void tearDown() throws Exception
+// {
+// super.tearDown();
+//
+// //Service stoppage
+// this.runtimeContext.stop();
+//
+// //Data cleanup
+// this.runtimeContext = null;
+// }
+//
+// /**
+// *
+// * @return
+// */
+// public String getUserLoggedInIndicator()
+// {
+// return userLoggedInIndicator;
+// }
+//
+// /**
+// *
+// * @param userLoggedInIndicator
+// */
+// public void setUserLoggedInIndicator(String userLoggedInIndicator)
+// {
+// this.userLoggedInIndicator = userLoggedInIndicator;
+// }
+//
+// /**
+// *
+// * @return
+// */
+// public String getPassword()
+// {
+// return password;
+// }
+//
+// /**
+// *
+// * @param password
+// */
+// public void setPassword(String password)
+// {
+// this.password = password;
+// }
+//
+// /**
+// *
+// * @return
+// */
+// public String getUsername()
+// {
+// return username;
+// }
+//
+// /**
+// *
+// * @param username
+// */
+// public void setUsername(String username)
+// {
+// this.username = username;
+// }
+//
+// /**
+// *
+// * @return
+// */
+// public String getFirstPortal()
+// {
+// return firstPortal;
+// }
+//
+// /**
+// *
+// * @param firstPortal
+// */
+// public void setFirstPortal(String firstPortal)
+// {
+// this.firstPortal = firstPortal;
+// }
+//
+// /**
+// *
+// * @return
+// */
+// public String getSecondPortal()
+// {
+// return secondPortal;
+// }
+//
+// /**
+// *
+// * @param secondPortal
+// */
+// public void setSecondPortal(String secondPortal)
+// {
+// this.secondPortal = secondPortal;
+// }
+//
+// /**
+// *
+// * @return
+// */
+// public String getJossoServer()
+// {
+// return jossoServer;
+// }
+//
+// /**
+// *
+// * @param jossoServer
+// */
+// public void setJossoServer(String jossoServer)
+// {
+// this.jossoServer = jossoServer;
+// }
+//
+// /**
+// *
+// * @return
+// */
+// public String getSameHostSecondPortal()
+// {
+// return sameHostSecondPortal;
+// }
+//
+// /**
+// *
+// * @param sameHostSecondPortal
+// */
+// public void setSameHostSecondPortal(String sameHostSecondPortal)
+// {
+// this.sameHostSecondPortal = sameHostSecondPortal;
+// }
+//
+// /**
+// * This tests the scenario when the two portals are deployed on separate hosts/servers
+// *
+// * @throws Exception
+// */
+// public void testMultiHostDeployment() throws Exception
+// {
+// Cookie ssoCookie = null;
+// String firstPortalFinalResponse = null;
+// String secondPortalFinalResponse = null;
+//
+// //Load the main portal page on firstPortalContext
+// String firstContextPortalUrl = this.firstPortal;
+// WebConversation portalConversation = this.startConversation(firstContextPortalUrl);
+// TestCase.assertFalse(this.isUserLoggedIn(portalConversation.getResponse()));
+//
+// //Click the Login link on the firstPortalContext
+// String firstContextLoginUrl = firstContextPortalUrl + "/auth/portal/default/default";
+// this.sendGet(firstContextLoginUrl, portalConversation);
+//
+// //Navigate to a secured resource on the portal
+// TestCase.assertNotNull(portalConversation.getRedirectLocation());
+// TestCase.assertEquals(portalConversation.getStatusCode(), 302);
+// String portalToJOSSO = portalConversation.getRedirectLocation();
+// this.sendGet(portalToJOSSO, portalConversation);
+//
+// //When authentication is triggered, move over to the JOSSO server establishing an SSO session with JOSSO
+// String jossoLocation = portalConversation.getRedirectLocation();
+// WebConversation ssoConversation = this.startConversation(jossoLocation);
+// String response = ssoConversation.getResponse();
+//
+// //Extract the josso post action value
+// int searchIndex = response.indexOf("action=\"")+9;
+// int endIndex = response.indexOf('"', searchIndex);
+// String action = response.substring(searchIndex,endIndex);
+//
+// //Perform HTTP Post based authentication with the JOSSO Server
+// Map postParams = new HashMap();
+// postParams.put("josso_username", this.username);
+// postParams.put("josso_password", this.password);
+// postParams.put("josso_cmd", "login");
+// this.sendPost("http://"+ this.jossoServer +"/"+action,postParams, ssoConversation);
+//
+// //Go back to the Portal since login has succeeded, starting with assertion on the JOSSO Agent installed on the Portal
+// String assertUrl = ssoConversation.getRedirectLocation();
+// this.sendGet(assertUrl, portalConversation);
+//
+// //Now go back to the original Portal resource requested. This time user should have an authenticated session established
+// TestCase.assertNotNull(portalConversation.getRedirectLocation());
+// TestCase.assertEquals(portalConversation.getStatusCode(), 302);
+// TestCase.assertTrue(portalConversation.getRedirectLocation().indexOf(firstContextLoginUrl) != -1);
+// TestCase.assertNotNull(portalConversation.getSSOCookie());
+// String goBack = portalConversation.getRedirectLocation();
+// ssoCookie = ssoConversation.getSSOCookie();
+// this.sendGet(goBack, portalConversation);
+// firstPortalFinalResponse = portalConversation.getResponse();
+// TestCase.assertTrue(this.isUserLoggedIn(firstPortalFinalResponse));
+//
+// //Load the main portal page on secondPortalContext
+// String secondContextPortalUrl = this.secondPortal;
+// portalConversation = this.startConversation(secondContextPortalUrl);
+//
+// //Click the Login Link on the secondPortalContext
+// String secondContextLoginUrl = secondContextPortalUrl + "/auth/portal/default/default";
+// this.sendGet(secondContextLoginUrl, portalConversation);
+//
+// //Perform re-direct to the JOSSO Server but this time sending in the JOSSO cookie
+// TestCase.assertNotNull(portalConversation.getRedirectLocation());
+// TestCase.assertEquals(portalConversation.getStatusCode(), 302);
+// portalToJOSSO = portalConversation.getRedirectLocation();
+// this.sendGet(portalToJOSSO, portalConversation);
+//
+//
+// //Assert the redirect and it should be to the JOSSO Server, but this time
+// //It should end up with an Authenticated session back to the secondPortalContext
+// jossoLocation = portalConversation.getRedirectLocation();
+// ssoConversation = this.startConversation(jossoLocation,ssoCookie);
+// secondPortalFinalResponse = ssoConversation.getResponse();
+// TestCase.assertTrue(this.isUserLoggedIn(secondPortalFinalResponse));
+//
+// //Assert and make sure its the same user logged into both Portals
+// String firstPortalUser = this.extractLoggedInUser(firstPortalFinalResponse);
+// String secondPortalUser = this.extractLoggedInUser(secondPortalFinalResponse);
+// TestCase.assertEquals(firstPortalUser, this.username);
+// TestCase.assertEquals(secondPortalUser, this.username);
+// TestCase.assertEquals(firstPortalUser, secondPortalUser);
+// }
+//
+// /**
+// * This tests the scenario where the two portals are deployed within the same host/server but under
+// * different web contexts
+// *
+// * @throws Exception
+// */
+// public void testSameHostDeployment() throws Exception
+// {
+// Cookie ssoCookie = null;
+// String firstPortalFinalResponse = null;
+// String secondPortalFinalResponse = null;
+//
+// //Load the main portal page on firstPortalContext
+// String firstContextPortalUrl = this.firstPortal;
+// WebConversation portalConversation = this.startConversation(firstContextPortalUrl);
+// TestCase.assertFalse(this.isUserLoggedIn(portalConversation.getResponse()));
+//
+// //Click the Login link on the firstPortalContext
+// String firstContextLoginUrl = firstContextPortalUrl + "/auth/portal/default/default";
+// this.sendGet(firstContextLoginUrl, portalConversation);
+//
+// //Navigate to a secured resource on the portal
+// TestCase.assertNotNull(portalConversation.getRedirectLocation());
+// TestCase.assertEquals(portalConversation.getStatusCode(), 302);
+// String portalToJOSSO = portalConversation.getRedirectLocation();
+// this.sendGet(portalToJOSSO, portalConversation);
+//
+// //When authentication is triggered, move over to the JOSSO server establishing an SSO session with JOSSO
+// String jossoLocation = portalConversation.getRedirectLocation();
+// WebConversation ssoConversation = this.startConversation(jossoLocation);
+// String response = ssoConversation.getResponse();
+//
+// //Extract the josso post action value
+// int searchIndex = response.indexOf("action=\"")+9;
+// int endIndex = response.indexOf('"', searchIndex);
+// String action = response.substring(searchIndex,endIndex);
+//
+// //Perform HTTP Post based authentication with the JOSSO Server
+// Map postParams = new HashMap();
+// postParams.put("josso_username", this.username);
+// postParams.put("josso_password", this.password);
+// postParams.put("josso_cmd", "login");
+// this.sendPost("http://"+ this.jossoServer +"/"+action,postParams, ssoConversation);
+//
+// //Go back to the Portal since login has succeeded, starting with assertion on the JOSSO Agent installed on the Portal
+// String assertUrl = ssoConversation.getRedirectLocation();
+// this.sendGet(assertUrl, portalConversation);
+//
+// //Now go back to the original Portal resource requested. This time user should have an authenticated session established
+// TestCase.assertNotNull(portalConversation.getRedirectLocation());
+// TestCase.assertEquals(portalConversation.getStatusCode(), 302);
+// TestCase.assertTrue(portalConversation.getRedirectLocation().indexOf(firstContextLoginUrl) != -1);
+// TestCase.assertNotNull(portalConversation.getSSOCookie());
+// String goBack = portalConversation.getRedirectLocation();
+// ssoCookie = ssoConversation.getSSOCookie();
+// this.sendGet(goBack, portalConversation);
+// firstPortalFinalResponse = portalConversation.getResponse();
+// TestCase.assertTrue(this.isUserLoggedIn(firstPortalFinalResponse));
+//
+// //Load the main portal page on secondPortalContext
+// String secondContextPortalUrl = this.sameHostSecondPortal;
+// portalConversation = this.startConversation(secondContextPortalUrl);
+//
+// //Click the Login Link on the secondPortalContext
+// String secondContextLoginUrl = secondContextPortalUrl + "/auth/portal/default/default";
+// this.sendGet(secondContextLoginUrl, portalConversation);
+//
+// //Perform re-direct to the JOSSO Server but this time sending in the JOSSO cookie
+// TestCase.assertNotNull(portalConversation.getRedirectLocation());
+// TestCase.assertEquals(portalConversation.getStatusCode(), 302);
+// portalToJOSSO = portalConversation.getRedirectLocation();
+// this.sendGet(portalToJOSSO, portalConversation);
+//
+//
+// //Assert the redirect and it should be to the JOSSO Server, but this time
+// //It should end up with an Authenticated session back to the secondPortalContext
+// jossoLocation = portalConversation.getRedirectLocation();
+// ssoConversation = this.startConversation(jossoLocation,ssoCookie);
+// secondPortalFinalResponse = ssoConversation.getResponse();
+// TestCase.assertTrue(this.isUserLoggedIn(secondPortalFinalResponse));
+//
+// //Assert and make sure its the same user logged into both Portals
+// String firstPortalUser = this.extractLoggedInUser(firstPortalFinalResponse);
+// String secondPortalUser = this.extractLoggedInUser(secondPortalFinalResponse);
+// TestCase.assertEquals(firstPortalUser, this.username);
+// TestCase.assertEquals(secondPortalUser, this.username);
+// TestCase.assertEquals(firstPortalUser, secondPortalUser);
+// }
+//
+// /**
+// *
+// * @param portalUrl
+// * @return
+// * @throws Exception
+// */
+// private WebConversation startConversation(String portalUrl) throws Exception
+// {
+// WebConversation conversation = null;
+//
+// HttpClient httpClient = new HttpClient();
+// GetMethod getMethod = new GetMethod(portalUrl);
+// try
+// {
+// conversation = new WebConversation();
+//
+// int statusCode = httpClient.executeMethod(getMethod);
+// String response = getMethod.getResponseBodyAsString();
+//
+// Cookie[] cookies = httpClient.getState().getCookies();
+// for(int i=0;i<cookies.length;i++)
+// {
+// if(cookies[i].getName().equals("JSESSIONID"))
+// {
+// conversation.setSessionId(cookies[i].getValue());
+// }
+// }
+//
+// conversation.setClient(httpClient);
+// conversation.setStatusCode(statusCode);
+// conversation.setResponse(response);
+// }
+// finally
+// {
+// if(getMethod != null)
+// {
+// getMethod.releaseConnection();
+// }
+// }
+//
+// return conversation;
+// }
+//
+// /**
+// *
+// * @param portalUrl
+// * @return
+// * @throws Exception
+// */
+// private WebConversation startConversation(String portalUrl, Cookie ssoCookie) throws Exception
+// {
+// WebConversation conversation = null;
+//
+// HttpClient httpClient = new HttpClient();
+// GetMethod getMethod = new GetMethod(portalUrl);
+//
+// //Set ssoCookie to be sent in
+// getMethod.setRequestHeader("Cookie",ssoCookie.getName()+"="+ssoCookie.getValue());
+//
+// try
+// {
+// conversation = new WebConversation();
+//
+// int statusCode = httpClient.executeMethod(getMethod);
+// String response = getMethod.getResponseBodyAsString();
+//
+// Cookie[] cookies = httpClient.getState().getCookies();
+// for(int i=0;i<cookies.length;i++)
+// {
+// if(cookies[i].getName().equals("JSESSIONID"))
+// {
+// conversation.setSessionId(cookies[i].getValue());
+// }
+// }
+//
+// conversation.setClient(httpClient);
+// conversation.setStatusCode(statusCode);
+// conversation.setResponse(response);
+// }
+// finally
+// {
+// if(getMethod != null)
+// {
+// getMethod.releaseConnection();
+// }
+// }
+//
+// return conversation;
+// }
+//
+// /**
+// *
+// * @param portalUrl
+// * @param conversation
+// * @throws Exception
+// */
+// private void sendGet(String portalUrl,WebConversation conversation) throws Exception
+// {
+// HttpClient httpClient = conversation.getClient();
+//
+// GetMethod getMethod = new GetMethod(portalUrl);
+// getMethod.setFollowRedirects(false);
+// try
+// {
+// int statusCode = httpClient.executeMethod(getMethod);
+//
+// String response = getMethod.getResponseBodyAsString();
+//
+// Cookie[] cookies = httpClient.getState().getCookies();
+// for(int i=0;i<cookies.length;i++)
+// {
+// if(cookies[i].getName().equals("JSESSIONID"))
+// {
+// conversation.setSessionId(cookies[i].getValue());
+// }
+// if(cookies[i].getName().equals("JOSSO_SESSIONID"))
+// {
+// conversation.setSSOCookie(cookies[i]);
+// }
+// }
+//
+// conversation.setStatusCode(statusCode);
+// conversation.setResponse(response);
+//
+// if(statusCode == 302)
+// {
+// //Store the redirect location
+// String location = getMethod.getResponseHeader("Location").getValue();
+// conversation.setRedirectLocation(location);
+// }
+// }
+// finally
+// {
+// if(getMethod != null)
+// {
+// getMethod.releaseConnection();
+// }
+// }
+// }
+//
+//
+// /**
+// *
+// * @param url
+// * @param parameters
+// * @param conversation
+// * @throws Exception
+// */
+// private void sendPost(String url,Map parameters,WebConversation conversation) throws Exception
+// {
+// HttpClient httpClient = conversation.getClient();
+//
+// PostMethod postMethod = new PostMethod(url);
+//
+// //Add post parameters
+// Set keySet = parameters.keySet();
+// NameValuePair[] postdata = new NameValuePair[keySet.size()];
+// int index = 0;
+// for(Iterator itr=keySet.iterator();itr.hasNext();)
+// {
+// String name = (String)itr.next();
+// String value = (String)parameters.get(name);
+// postdata[index++] = new NameValuePair(name,value);
+// }
+// postMethod.setRequestBody(postdata);
+// try
+// {
+// int statusCode = httpClient.executeMethod(postMethod);
+//
+// String response = postMethod.getResponseBodyAsString();
+//
+// Cookie[] cookies = httpClient.getState().getCookies();
+// for(int i=0;i<cookies.length;i++)
+// {
+// if(cookies[i].getName().equals("JSESSIONID"))
+// {
+// conversation.setSessionId(cookies[i].getValue());
+// }
+// if(cookies[i].getName().equals("JOSSO_SESSIONID"))
+// {
+// conversation.setSSOCookie(cookies[i]);
+// }
+// }
+//
+// conversation.setStatusCode(statusCode);
+// conversation.setResponse(response);
+//
+// if(statusCode == 302)
+// {
+// //Store the redirect location
+// String location = postMethod.getResponseHeader("Location").getValue();
+// conversation.setRedirectLocation(location);
+// }
+// }
+// finally
+// {
+// if(postMethod != null)
+// {
+// postMethod.releaseConnection();
+// }
+// }
+// }
+//
+// /**
+// *
+// * @param response
+// * @return
+// */
+// private boolean isUserLoggedIn(String response)
+// {
+// boolean isUserLoggedIn = false;
+//
+// isUserLoggedIn = (response.indexOf(this.userLoggedInIndicator) != -1);
+//
+// return isUserLoggedIn;
+// }
+//
+// /**
+// *
+// * @param response
+// * @return
+// */
+// private String extractLoggedInUser(String response)
+// {
+// String loggedInUser = null;
+//
+// int startIndex = response.indexOf(this.userLoggedInIndicator) + this.userLoggedInIndicator.length();
+// int endIndex = response.indexOf("<",startIndex);
+//
+// loggedInUser = response.substring(startIndex,endIndex).trim();
+//
+// return loggedInUser;
+// }
+//
+// /**
+// *
+// * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+// *
+// */
+// private static class WebConversation
+// {
+// /**
+// *
+// */
+// private HttpClient client = null;
+// private String sessionId = null;
+// private int statusCode = 0;
+// private String response = null;
+// private String redirectLocation = null;
+// private Cookie ssoCookie = null;
+//
+// /**
+// *
+// *
+// */
+// public WebConversation()
+// {
+//
+// }
+//
+// /**
+// *
+// * @return
+// */
+// public HttpClient getClient()
+// {
+// return this.client;
+// }
+//
+// /**
+// *
+// * @param client
+// */
+// public void setClient(HttpClient client)
+// {
+// this.client = client;
+// }
+//
+// public String getResponse()
+// {
+// return response;
+// }
+//
+// public void setResponse(String response)
+// {
+// this.response = response;
+// }
+//
+// public int getStatusCode()
+// {
+// return statusCode;
+// }
+//
+// public void setStatusCode(int statusCode)
+// {
+// this.statusCode = statusCode;
+// }
+//
+// public String getSessionId()
+// {
+// return sessionId;
+// }
+//
+// public void setSessionId(String sessionId)
+// {
+// this.sessionId = sessionId;
+// }
+//
+// public String getRedirectLocation()
+// {
+// return redirectLocation;
+// }
+//
+// public void setRedirectLocation(String redirectLocation)
+// {
+// this.redirectLocation = redirectLocation;
+// }
+//
+// public Cookie getSSOCookie()
+// {
+// return ssoCookie;
+// }
+//
+// public void setSSOCookie(Cookie ssoCookie)
+// {
+// this.ssoCookie = ssoCookie;
+// }
+// }
+//}
Modified: modules/identity/trunk/testsuite/build.xml
===================================================================
--- modules/identity/trunk/testsuite/build.xml 2007-10-17 11:11:09 UTC (rev 8674)
+++ modules/identity/trunk/testsuite/build.xml 2007-10-17 13:05:03 UTC (rev 8675)
@@ -117,11 +117,11 @@
<target name="tests" depends="init">
<server:start name="default"/>
<sequential>
- <antcall target="agent-deploy"/>
+ <!--<antcall target="agent-deploy"/>-->
<antcall target="internal-test-module">
<param name="module" value="identity"/>
</antcall>
- <antcall target="agent-undeploy"/>
+ <!--<antcall target="agent-undeploy"/>-->
</sequential>
<server:stop name="default"/>
<antcall target="reports"/>
@@ -140,32 +140,8 @@
<target name="clean">
<!-- remove generated test xml files -->
<delete>
- <fileset dir="../cms" includes="output/tests/*.log"/>
- <fileset dir="../cms" includes="output/tests/TEST-*.xml,output/tests/TEST-*.txt"/>
- <fileset dir="../core" includes="output/tests/*.log"/>
- <fileset dir="../core" includes="output/tests/TEST-*.xml,output/tests/TEST-*.txt"/>
- <fileset dir="../format" includes="*.log"/>
- <fileset dir="../format" includes="output/tests/TEST-*.xml,output/tests/TEST-*.txt"/>
- <fileset dir="../faces" includes="*.log"/>
- <fileset dir="../faces" includes="output/tests/TEST-*.xml,output/tests/TEST-*.txt"/>
- <fileset dir="../server" includes="*.log"/>
- <fileset dir="../server" includes="output/tests/TEST-*.xml,output/tests/TEST-*.txt"/>
- <fileset dir="../portlet" includes="*.log"/>
- <fileset dir="../portlet" includes="output/tests/TEST-*.xml,output/tests/TEST-*.txt"/>
- <fileset dir="../portlet-federation" includes="*.log"/>
- <fileset dir="../portlet-federation" includes="output/tests/TEST-*.xml,output/tests/TEST-*.txt"/>
- <fileset dir="../portlet-server" includes="*.log"/>
- <fileset dir="../portlet-server" includes="output/tests/TEST-*.xml,output/tests/TEST-*.txt"/>
- <fileset dir="../security" includes="*.log"/>
- <fileset dir="../security" includes="output/tests/TEST-*.xml,output/tests/TEST-*.txt"/>
<fileset dir="../identity" includes="*.log"/>
<fileset dir="../identity" includes="output/tests/TEST-*.xml,output/tests/TEST-*.txt"/>
- <fileset dir="../wsrp" includes="*.log"/>
- <fileset dir="../wsrp" includes="output/tests/TEST-*.xml,output/tests/TEST-*.txt"/>
-<!--
- <fileset dir="../theme" includes="*.log"/>
- <fileset dir="../theme" includes="output/tests/TEST-*.xml,output/tests/TEST-*.txt"/>
--->
</delete>
<!-- remove testsuite output dir -->
<delete includeEmptyDirs="true" quiet="true">
@@ -174,14 +150,14 @@
</target>
<!-- Deployment of agent -->
- <target name="agent-deploy">
- <deploy file="${jboss.portal/modules/test.lib}/portal-test-agent.sar" config="default"/>
- </target>
+ <!--<target name="agent-deploy">-->
+ <!--<deploy file="${jboss.portal/modules/test.lib}/portal-test-agent.sar" config="default"/>-->
+ <!--</target>-->
<!-- Undeployment of agent -->
- <target name="agent-undeploy">
- <undeploy file="${jboss.portal/modules/test.lib}/portal-test.sar" config="default"/>
- </target>
+ <!--<target name="agent-undeploy">-->
+ <!--<undeploy file="${jboss.portal/modules/test.lib}/portal-test.sar" config="default"/>-->
+ <!--</target>-->
<target name="help">
<echo message="To run individual module tests use the test-module target with -Dmodule=the module you want to test,
Modified: modules/identity/trunk/tools/etc/buildfragments/defaults.ent
===================================================================
--- modules/identity/trunk/tools/etc/buildfragments/defaults.ent 2007-10-17 11:11:09 UTC (rev 8674)
+++ modules/identity/trunk/tools/etc/buildfragments/defaults.ent 2007-10-17 13:05:03 UTC (rev 8675)
@@ -118,8 +118,8 @@
<property name="javac.depend.cachedir" value="${build.cache}/depends"/>
- <property name="javac.source" value="1.4"/>
- <property name="javac.target" value="1.4"/>
+ <property name="javac.source" value="1.5"/>
+ <property name="javac.target" value="1.5"/>
<property name="rmic.stubVersion" value="1.2"/>
<!-- classpath and local.classpath must have a value using with a path -->
16 years, 8 months
JBoss Portal SVN: r8674 - modules/web/trunk/build.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-10-17 07:11:09 -0400 (Wed, 17 Oct 2007)
New Revision: 8674
Modified:
modules/web/trunk/build/build-thirdparty.xml
Log:
make web module use test module 1.0.0 jars
Modified: modules/web/trunk/build/build-thirdparty.xml
===================================================================
--- modules/web/trunk/build/build-thirdparty.xml 2007-10-17 10:48:42 UTC (rev 8673)
+++ modules/web/trunk/build/build-thirdparty.xml 2007-10-17 11:11:09 UTC (rev 8674)
@@ -48,7 +48,7 @@
-->
<componentref name="jboss-portal/modules/common" version="trunk-SNAPSHOT"/>
- <componentref name="jboss-portal/modules/test" version="trunk-SNAPSHOT"/>
+ <componentref name="jboss-portal/modules/test" version="1.0.0"/>
<componentref name="sun-servlet" version="2.4"/>
<componentref name="apache-tomcat" version="5.0.30"/>
<componentref name="sun-jaf" version="1.0.2"/>
16 years, 8 months
JBoss Portal SVN: r8673 - modules/portlet/trunk/build.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-10-17 06:48:42 -0400 (Wed, 17 Oct 2007)
New Revision: 8673
Modified:
modules/portlet/trunk/build/build-thirdparty.xml
Log:
make portlet module use test module 1.0.0 jars
Modified: modules/portlet/trunk/build/build-thirdparty.xml
===================================================================
--- modules/portlet/trunk/build/build-thirdparty.xml 2007-10-16 19:46:34 UTC (rev 8672)
+++ modules/portlet/trunk/build/build-thirdparty.xml 2007-10-17 10:48:42 UTC (rev 8673)
@@ -48,7 +48,7 @@
<componentref name="jboss-portal/modules/common" version="trunk-SNAPSHOT"/>
<componentref name="jboss-portal/modules/web" version="trunk-SNAPSHOT"/>
- <componentref name="jboss-portal/modules/test" version="trunk-SNAPSHOT"/>
+ <componentref name="jboss-portal/modules/test" version="1.0.0"/>
<componentref name="sun-servlet" version="2.4"/>
<componentref name="sun-jaf" version="1.1"/>
16 years, 8 months
JBoss Portal SVN: r8672 - in modules/test/trunk/build/ide/intellij/idea70: modules/mc and 7 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-16 15:46:34 -0400 (Tue, 16 Oct 2007)
New Revision: 8672
Modified:
modules/test/trunk/build/ide/intellij/idea70/jboss-portal-test.ipr
modules/test/trunk/build/ide/intellij/idea70/modules/mc/mc.iml
modules/test/trunk/build/ide/intellij/idea70/modules/remote/remote.iml
modules/test/trunk/build/ide/intellij/idea70/modules/test/test.iml
modules/test/trunk/build/ide/intellij/idea70/modules/testsuite/testsuite.iml
modules/test/trunk/build/ide/intellij/idea70/modules/thirdparty/thirdparty.iml
modules/test/trunk/build/ide/intellij/idea70/modules/tooling/tooling.iml
modules/test/trunk/build/ide/intellij/idea70/modules/tools/tools.iml
modules/test/trunk/build/ide/intellij/idea70/modules/unit/unit.iml
Log:
update project file for idea70
Modified: modules/test/trunk/build/ide/intellij/idea70/jboss-portal-test.ipr
===================================================================
--- modules/test/trunk/build/ide/intellij/idea70/jboss-portal-test.ipr 2007-10-16 19:43:30 UTC (rev 8671)
+++ modules/test/trunk/build/ide/intellij/idea70/jboss-portal-test.ipr 2007-10-16 19:46:34 UTC (rev 8672)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project version="4" relativePaths="false">
+<project relativePaths="false" version="4">
<component name="AntConfiguration">
<defaultAnt bundledAnt="true" />
</component>
@@ -33,11 +33,12 @@
<entry name="?*.tld" />
</wildcardResourcePatterns>
</component>
- <component name="DataSourceManagerImpl" />
<component name="DependenciesAnalyzeManager">
<option name="myForwardDirection" value="false" />
</component>
- <component name="DependencyValidationManager" />
+ <component name="DependencyValidationManager">
+ <option name="SKIP_IMPORT_STATEMENTS" value="false" />
+ </component>
<component name="EclipseCompilerSettings">
<option name="DEBUGGING_INFO" value="true" />
<option name="GENERATE_NO_WARNINGS" value="true" />
@@ -53,14 +54,13 @@
<option name="MAXIMUM_HEAP_SIZE" value="128" />
</component>
<component name="EntryPointsManager">
- <entry_points />
+ <entry_points version="2.0" />
</component>
<component name="ExportToHTMLSettings">
<option name="PRINT_LINE_NUMBERS" value="false" />
<option name="OPEN_IN_BROWSER" value="false" />
<option name="OUTPUT_DIRECTORY" />
</component>
- <component name="GUI Designer component loader factory" />
<component name="IdProvider" IDEtalkID="E2A438D8B6AE84F43587A2210E562521" />
<component name="InspectionProjectProfileManager">
<option name="PROJECT_PROFILE" value="Project Default" />
@@ -70,26 +70,9 @@
<profile version="1.0" is_locked="false">
<option name="myName" value="Project Default" />
<option name="myLocal" value="false" />
- <used_levels>
- <error>
- <option name="myName" value="ERROR" />
- <option name="myVal" value="200" />
- </error>
- <warning>
- <option name="myName" value="WARNING" />
- <option name="myVal" value="100" />
- </warning>
- <information>
- <option name="myName" value="INFO" />
- <option name="myVal" value="100" />
- </information>
- <server>
- <option name="myName" value="SERVER PROBLEM" />
- <option name="myVal" value="100" />
- </server>
- </used_levels>
</profile>
</profiles>
+ <list size="0" />
</component>
<component name="JavacSettings">
<option name="DEBUGGING_INFO" value="true" />
@@ -250,18 +233,29 @@
</item>
</group>
</component>
+ <component name="ProjectFileVersion" converted="true" />
<component name="ProjectModuleManager">
<modules>
+ <module fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea70/modules/mc/mc.iml" filepath="$PROJECT_DIR$/build/ide/intellij/idea70/modules/mc/mc.iml" />
+ <module fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea70/modules/remote/remote.iml" filepath="$PROJECT_DIR$/build/ide/intellij/idea70/modules/remote/remote.iml" />
<module fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea70/modules/test/test.iml" filepath="$PROJECT_DIR$/build/ide/intellij/idea70/modules/test/test.iml" />
<module fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea70/modules/testsuite/testsuite.iml" filepath="$PROJECT_DIR$/build/ide/intellij/idea70/modules/testsuite/testsuite.iml" />
<module fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea70/modules/thirdparty/thirdparty.iml" filepath="$PROJECT_DIR$/build/ide/intellij/idea70/modules/thirdparty/thirdparty.iml" />
+ <module fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea70/modules/tooling/tooling.iml" filepath="$PROJECT_DIR$/build/ide/intellij/idea70/modules/tooling/tooling.iml" />
<module fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea70/modules/tools/tools.iml" filepath="$PROJECT_DIR$/build/ide/intellij/idea70/modules/tools/tools.iml" />
+ <module fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea70/modules/unit/unit.iml" filepath="$PROJECT_DIR$/build/ide/intellij/idea70/modules/unit/unit.iml" />
</modules>
</component>
<component name="ProjectRootManager" version="2" assert-keyword="true" jdk-15="false" project-jdk-name="1.5" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/output" />
</component>
- <component name="ProjectRunConfigurationManager" />
+ <component name="ResourceManagerContainer">
+ <option name="myResourceBundles">
+ <value>
+ <list size="0" />
+ </value>
+ </option>
+ </component>
<component name="RmicSettings">
<option name="IS_EANABLED" value="false" />
<option name="DEBUGGING_INFO" value="true" />
@@ -269,10 +263,17 @@
<option name="GENERATE_IIOP_STUBS" value="false" />
<option name="ADDITIONAL_OPTIONS_STRING" value="" />
</component>
- <component name="StarteamVcsAdapter" />
- <component name="VssVcs">
- <SourceSafePersistencyRemovedFolder>$PROJECT_DIR$/wsrp/src/resources/test</SourceSafePersistencyRemovedFolder>
+ <component name="VcsDirectoryMappings">
+ <mapping directory="" vcs="" />
+ <mapping directory="$PROJECT_DIR$/mc" vcs="svn" />
+ <mapping directory="$PROJECT_DIR$/remote" vcs="svn" />
+ <mapping directory="$PROJECT_DIR$/test" vcs="svn" />
+ <mapping directory="$PROJECT_DIR$/testsuite" vcs="svn" />
+ <mapping directory="$PROJECT_DIR$/tooling" vcs="svn" />
+ <mapping directory="$PROJECT_DIR$/tools" vcs="svn" />
+ <mapping directory="$PROJECT_DIR$/unit" vcs="svn" />
</component>
+ <component name="WebServicesPlugin" addRequiredLibraries="true" />
<component name="com.intellij.jsf.UserDefinedFacesConfigs">
<option name="USER_DEFINED_CONFIGS">
<value>
@@ -453,12 +454,10 @@
<option name="useAlternate" value="false" />
</LanguageOptions>
</component>
- <component name="libraryTable" />
<component name="uidesigner-configuration">
<option name="INSTRUMENT_CLASSES" value="true" />
<option name="COPY_FORMS_RUNTIME_TO_OUTPUT" value="true" />
<option name="DEFAULT_LAYOUT_MANAGER" value="GridLayoutManager" />
</component>
- <UsedPathMacros />
</project>
Modified: modules/test/trunk/build/ide/intellij/idea70/modules/mc/mc.iml
===================================================================
--- modules/test/trunk/build/ide/intellij/idea70/modules/mc/mc.iml 2007-10-16 19:43:30 UTC (rev 8671)
+++ modules/test/trunk/build/ide/intellij/idea70/modules/mc/mc.iml 2007-10-16 19:46:34 UTC (rev 8672)
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<module version="4" relativePaths="true" type="JAVA_MODULE">
- <component name="ModuleRootManager" />
+<module relativePaths="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$/../../../../../../mc">
Modified: modules/test/trunk/build/ide/intellij/idea70/modules/remote/remote.iml
===================================================================
--- modules/test/trunk/build/ide/intellij/idea70/modules/remote/remote.iml 2007-10-16 19:43:30 UTC (rev 8671)
+++ modules/test/trunk/build/ide/intellij/idea70/modules/remote/remote.iml 2007-10-16 19:46:34 UTC (rev 8672)
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<module version="4" relativePaths="true" type="JAVA_MODULE">
- <component name="ModuleRootManager" />
+<module relativePaths="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$/../../../../../../remote">
Modified: modules/test/trunk/build/ide/intellij/idea70/modules/test/test.iml
===================================================================
--- modules/test/trunk/build/ide/intellij/idea70/modules/test/test.iml 2007-10-16 19:43:30 UTC (rev 8671)
+++ modules/test/trunk/build/ide/intellij/idea70/modules/test/test.iml 2007-10-16 19:46:34 UTC (rev 8672)
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<module version="4" relativePaths="true" type="JAVA_MODULE">
- <component name="ModuleRootManager" />
+<module relativePaths="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/../../../../../../test/classes" />
<exclude-output />
Modified: modules/test/trunk/build/ide/intellij/idea70/modules/testsuite/testsuite.iml
===================================================================
--- modules/test/trunk/build/ide/intellij/idea70/modules/testsuite/testsuite.iml 2007-10-16 19:43:30 UTC (rev 8671)
+++ modules/test/trunk/build/ide/intellij/idea70/modules/testsuite/testsuite.iml 2007-10-16 19:46:34 UTC (rev 8672)
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<module version="4" relativePaths="true" type="JAVA_MODULE">
- <component name="ModuleRootManager" />
+<module relativePaths="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/../../../../../../testsuite/classes" />
<exclude-output />
Modified: modules/test/trunk/build/ide/intellij/idea70/modules/thirdparty/thirdparty.iml
===================================================================
--- modules/test/trunk/build/ide/intellij/idea70/modules/thirdparty/thirdparty.iml 2007-10-16 19:43:30 UTC (rev 8671)
+++ modules/test/trunk/build/ide/intellij/idea70/modules/thirdparty/thirdparty.iml 2007-10-16 19:46:34 UTC (rev 8672)
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<module version="4" relativePaths="true" type="JAVA_MODULE">
- <component name="ModuleRootManager" />
+<module relativePaths="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/../../../../../../thirdparty/classes" />
<exclude-output />
Modified: modules/test/trunk/build/ide/intellij/idea70/modules/tooling/tooling.iml
===================================================================
--- modules/test/trunk/build/ide/intellij/idea70/modules/tooling/tooling.iml 2007-10-16 19:43:30 UTC (rev 8671)
+++ modules/test/trunk/build/ide/intellij/idea70/modules/tooling/tooling.iml 2007-10-16 19:46:34 UTC (rev 8672)
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<module version="4" relativePaths="true" type="JAVA_MODULE">
- <component name="ModuleRootManager" />
+<module relativePaths="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$/../../../../../../tooling">
Modified: modules/test/trunk/build/ide/intellij/idea70/modules/tools/tools.iml
===================================================================
--- modules/test/trunk/build/ide/intellij/idea70/modules/tools/tools.iml 2007-10-16 19:43:30 UTC (rev 8671)
+++ modules/test/trunk/build/ide/intellij/idea70/modules/tools/tools.iml 2007-10-16 19:46:34 UTC (rev 8672)
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<module version="4" relativePaths="true" type="JAVA_MODULE">
- <component name="ModuleRootManager" />
+<module relativePaths="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/../../../../../../tools/classes" />
<exclude-output />
Modified: modules/test/trunk/build/ide/intellij/idea70/modules/unit/unit.iml
===================================================================
--- modules/test/trunk/build/ide/intellij/idea70/modules/unit/unit.iml 2007-10-16 19:43:30 UTC (rev 8671)
+++ modules/test/trunk/build/ide/intellij/idea70/modules/unit/unit.iml 2007-10-16 19:46:34 UTC (rev 8672)
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<module version="4" relativePaths="true" type="JAVA_MODULE">
- <component name="ModuleRootManager" />
+<module relativePaths="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$/../../../../../../unit">
16 years, 8 months
JBoss Portal SVN: r8671 - in modules/test/trunk/build/ide/intellij: idea70 and 14 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-16 15:43:30 -0400 (Tue, 16 Oct 2007)
New Revision: 8671
Added:
modules/test/trunk/build/ide/intellij/idea70/
modules/test/trunk/build/ide/intellij/idea70/config/
modules/test/trunk/build/ide/intellij/idea70/config/codestyles/
modules/test/trunk/build/ide/intellij/idea70/config/codestyles/jboss.xml
modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/
modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/StandartTestCasePortlet.java
modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/includes/
modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/includes/Body Header.java
modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/includes/File Header.java
modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/internal/
modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/internal/AnnotationType.java
modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/internal/Class.java
modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/internal/Enum.java
modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/internal/Interface.java
modules/test/trunk/build/ide/intellij/idea70/jboss-portal-test.ipr
modules/test/trunk/build/ide/intellij/idea70/modules/
modules/test/trunk/build/ide/intellij/idea70/modules/mc/
modules/test/trunk/build/ide/intellij/idea70/modules/mc/mc.iml
modules/test/trunk/build/ide/intellij/idea70/modules/remote/
modules/test/trunk/build/ide/intellij/idea70/modules/remote/remote.iml
modules/test/trunk/build/ide/intellij/idea70/modules/test/
modules/test/trunk/build/ide/intellij/idea70/modules/test/test.iml
modules/test/trunk/build/ide/intellij/idea70/modules/testsuite/
modules/test/trunk/build/ide/intellij/idea70/modules/testsuite/testsuite.iml
modules/test/trunk/build/ide/intellij/idea70/modules/thirdparty/
modules/test/trunk/build/ide/intellij/idea70/modules/thirdparty/thirdparty.iml
modules/test/trunk/build/ide/intellij/idea70/modules/tooling/
modules/test/trunk/build/ide/intellij/idea70/modules/tooling/tooling.iml
modules/test/trunk/build/ide/intellij/idea70/modules/tools/
modules/test/trunk/build/ide/intellij/idea70/modules/tools/tools.iml
modules/test/trunk/build/ide/intellij/idea70/modules/unit/
modules/test/trunk/build/ide/intellij/idea70/modules/unit/unit.iml
modules/test/trunk/build/ide/intellij/idea70/readme.txt
Log:
adding files for idea 7.0 in module test
Added: modules/test/trunk/build/ide/intellij/idea70/config/codestyles/jboss.xml
===================================================================
--- modules/test/trunk/build/ide/intellij/idea70/config/codestyles/jboss.xml (rev 0)
+++ modules/test/trunk/build/ide/intellij/idea70/config/codestyles/jboss.xml 2007-10-16 19:43:30 UTC (rev 8671)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<code_scheme name="jboss">
+ <option name="JAVA_INDENT_OPTIONS">
+ <value>
+ <option name="INDENT_SIZE" value="3" />
+ <option name="CONTINUATION_INDENT_SIZE" value="3" />
+ <option name="TAB_SIZE" value="3" />
+ <option name="USE_TAB_CHARACTER" value="false" />
+ <option name="SMART_TABS" value="false" />
+ <option name="LABEL_INDENT_SIZE" value="0" />
+ <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+ </value>
+ </option>
+ <option name="BRACE_STYLE" value="2" />
+ <option name="CLASS_BRACE_STYLE" value="2" />
+ <option name="METHOD_BRACE_STYLE" value="2" />
+ <option name="ELSE_ON_NEW_LINE" value="true" />
+ <option name="WHILE_ON_NEW_LINE" value="true" />
+ <option name="CATCH_ON_NEW_LINE" value="true" />
+ <option name="FINALLY_ON_NEW_LINE" value="true" />
+ <option name="SPACE_AFTER_TYPE_CAST" value="false" />
+ <option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="5000" />
+ <option name="WRAP_COMMENTS" value="true" />
+ <option name="IF_BRACE_FORCE" value="3" />
+ <option name="DOWHILE_BRACE_FORCE" value="3" />
+ <option name="WHILE_BRACE_FORCE" value="3" />
+ <option name="FOR_BRACE_FORCE" value="3" />
+ <option name="JD_DO_NOT_WRAP_ONE_LINE_COMMENTS" value="true" />
+ <option name="XML_KEEP_WHITESPACES" value="true" />
+</code_scheme>
+
Property changes on: modules/test/trunk/build/ide/intellij/idea70/config/codestyles/jboss.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/StandartTestCasePortlet.java
===================================================================
--- modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/StandartTestCasePortlet.java (rev 0)
+++ modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/StandartTestCasePortlet.java 2007-10-16 19:43:30 UTC (rev 8671)
@@ -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 ${PACKAGE_NAME};
+
+import org.jboss.portal.test.framework.container.server.result.AssertResult;
+import org.jboss.portal.test.framework.container.server.result.InvokeGetResult;
+import org.jboss.portal.test.framework.container.server.result.FailureResult;
+import org.jboss.portal.test.framework.container.server.result.ServerResult;
+import org.jboss.portal.test.framework.container.server.TestContext;
+import org.jboss.portal.test.portlet.AbstractTestPortlet;
+
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletException;
+import javax.portlet.PortletSecurityException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletPreferences;
+import javax.portlet.ValidatorException;
+import javax.portlet.PortletURL;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
+ * @version $Revision: 1951 $
+
+ */
+public class ${NAME} extends AbstractTestPortlet
+{
+
+
+ private AssertResult ares;
+
+ public void doProcessAction(final ActionRequest request, ActionResponse response) throws PortletException, PortletSecurityException, IOException
+ {
+ int requestCount = TestContext.getCurrentRequestCount();
+ if (ares == null)
+ {
+ if (requestCount == 1)
+ {
+ ares = new AssertResult();
+ ares.execute(new AssertResult.Test()
+ {
+ public void run() throws Exception
+ {
+
+ }
+ });
+ }
+ }
+ else if (!ares.isFailed())
+ {
+ if (requestCount == 2)
+ {
+ ares.execute(new AssertResult.Test()
+ {
+ public void run() throws Exception
+ {
+
+ }
+ });
+ }
+ }
+ }
+
+ public void doRender(final RenderRequest request, RenderResponse response) throws PortletException, PortletSecurityException, IOException
+ {
+ ServerResult result = null;
+
+ int requestCount = TestContext.getCurrentRequestCount();
+ if (ares == null)
+ {
+ if (requestCount == 0)
+ {
+ PortletURL url = response.createActionURL();
+ result = new InvokeGetResult(url.toString());
+ AbstractTestPortlet.marshall(result, response, TestContext.getCurrentTestCaseId());
+ }
+ else
+ {
+ AbstractTestPortlet.marshall(new FailureResult("The assert result was expected to be not null"), response, TestContext.getCurrentTestCaseId());
+ }
+ }
+ else if (ares.isFailed())
+ {
+ AbstractTestPortlet.marshall(ares, response, TestContext.getCurrentTestCaseId());
+ }
+ else
+ {
+ if (requestCount == 0)
+ {
+ AbstractTestPortlet.marshall(new FailureResult("The assert result was expected to be not null"), response, TestContext.getCurrentTestCaseId());
+ }
+ else if (requestCount == 1)
+ {
+ PortletURL url = response.createActionURL();
+ result = new InvokeGetResult(url.toString());
+ AbstractTestPortlet.marshall(result, response, TestContext.getCurrentTestCaseId());
+ }
+ else if (requestCount == 2)
+ {
+ AbstractTestPortlet.marshall(ares, response, TestContext.getCurrentTestCaseId());
+ }
+ }
+ }
+
+}
Property changes on: modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/StandartTestCasePortlet.java
___________________________________________________________________
Name: svn:executable
+ *
Added: modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/includes/Body Header.java
===================================================================
--- modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/includes/Body Header.java (rev 0)
+++ modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/includes/Body Header.java 2007-10-16 19:43:30 UTC (rev 8671)
@@ -0,0 +1,4 @@
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
Property changes on: modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/includes/Body Header.java
___________________________________________________________________
Name: svn:executable
+ *
Added: modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/includes/File Header.java
===================================================================
--- modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/includes/File Header.java (rev 0)
+++ modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/includes/File Header.java 2007-10-16 19:43:30 UTC (rev 8671)
@@ -0,0 +1,22 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
\ No newline at end of file
Property changes on: modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/includes/File Header.java
___________________________________________________________________
Name: svn:executable
+ *
Added: modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/internal/AnnotationType.java
===================================================================
--- modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/internal/AnnotationType.java (rev 0)
+++ modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/internal/AnnotationType.java 2007-10-16 19:43:30 UTC (rev 8671)
@@ -0,0 +1,5 @@
+#parse("File Header.java")
+package ${PACKAGE_NAME};
+#parse("Body Header.java")
+public @interface ${NAME} {
+}
Property changes on: modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/internal/AnnotationType.java
___________________________________________________________________
Name: svn:executable
+ *
Added: modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/internal/Class.java
===================================================================
--- modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/internal/Class.java (rev 0)
+++ modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/internal/Class.java 2007-10-16 19:43:30 UTC (rev 8671)
@@ -0,0 +1,5 @@
+#parse("File Header.java")
+package ${PACKAGE_NAME};
+#parse("Body Header.java")
+public class ${NAME} {
+}
Property changes on: modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/internal/Class.java
___________________________________________________________________
Name: svn:executable
+ *
Added: modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/internal/Enum.java
===================================================================
--- modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/internal/Enum.java (rev 0)
+++ modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/internal/Enum.java 2007-10-16 19:43:30 UTC (rev 8671)
@@ -0,0 +1,5 @@
+#parse("File Header.java")
+package ${PACKAGE_NAME};
+#parse("Body Header.java")
+public enum ${NAME} {
+}
Property changes on: modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/internal/Enum.java
___________________________________________________________________
Name: svn:executable
+ *
Added: modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/internal/Interface.java
===================================================================
--- modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/internal/Interface.java (rev 0)
+++ modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/internal/Interface.java 2007-10-16 19:43:30 UTC (rev 8671)
@@ -0,0 +1,5 @@
+#parse("File Header.java")
+package ${PACKAGE_NAME};
+#parse("Body Header.java")
+public interface ${NAME} {
+}
Property changes on: modules/test/trunk/build/ide/intellij/idea70/config/fileTemplates/internal/Interface.java
___________________________________________________________________
Name: svn:executable
+ *
Added: modules/test/trunk/build/ide/intellij/idea70/jboss-portal-test.ipr
===================================================================
--- modules/test/trunk/build/ide/intellij/idea70/jboss-portal-test.ipr (rev 0)
+++ modules/test/trunk/build/ide/intellij/idea70/jboss-portal-test.ipr 2007-10-16 19:43:30 UTC (rev 8671)
@@ -0,0 +1,464 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4" relativePaths="false">
+ <component name="AntConfiguration">
+ <defaultAnt bundledAnt="true" />
+ </component>
+ <component name="BuildJarProjectSettings">
+ <option name="BUILD_JARS_ON_MAKE" value="false" />
+ </component>
+ <component name="CodeStyleProjectProfileManger">
+ <option name="PROJECT_PROFILE" />
+ <option name="USE_PROJECT_LEVEL_SETTINGS" value="false" />
+ </component>
+ <component name="CodeStyleSettingsManager">
+ <option name="PER_PROJECT_SETTINGS" />
+ <option name="USE_PER_PROJECT_SETTINGS" value="false" />
+ </component>
+ <component name="CompilerConfiguration">
+ <option name="DEFAULT_COMPILER" value="Javac" />
+ <option name="DEPLOY_AFTER_MAKE" value="0" />
+ <resourceExtensions>
+ <entry name=".+\.(properties|xml|html|dtd|tld)" />
+ <entry name=".+\.(gif|png|jpeg|jpg)" />
+ </resourceExtensions>
+ <wildcardResourcePatterns>
+ <entry name="?*.properties" />
+ <entry name="?*.xml" />
+ <entry name="?*.gif" />
+ <entry name="?*.png" />
+ <entry name="?*.jpeg" />
+ <entry name="?*.jpg" />
+ <entry name="?*.html" />
+ <entry name="?*.dtd" />
+ <entry name="?*.tld" />
+ </wildcardResourcePatterns>
+ </component>
+ <component name="DataSourceManagerImpl" />
+ <component name="DependenciesAnalyzeManager">
+ <option name="myForwardDirection" value="false" />
+ </component>
+ <component name="DependencyValidationManager" />
+ <component name="EclipseCompilerSettings">
+ <option name="DEBUGGING_INFO" value="true" />
+ <option name="GENERATE_NO_WARNINGS" value="true" />
+ <option name="DEPRECATION" value="false" />
+ <option name="ADDITIONAL_OPTIONS_STRING" value="" />
+ <option name="MAXIMUM_HEAP_SIZE" value="128" />
+ </component>
+ <component name="EclipseEmbeddedCompilerSettings">
+ <option name="DEBUGGING_INFO" value="true" />
+ <option name="GENERATE_NO_WARNINGS" value="true" />
+ <option name="DEPRECATION" value="false" />
+ <option name="ADDITIONAL_OPTIONS_STRING" value="" />
+ <option name="MAXIMUM_HEAP_SIZE" value="128" />
+ </component>
+ <component name="EntryPointsManager">
+ <entry_points />
+ </component>
+ <component name="ExportToHTMLSettings">
+ <option name="PRINT_LINE_NUMBERS" value="false" />
+ <option name="OPEN_IN_BROWSER" value="false" />
+ <option name="OUTPUT_DIRECTORY" />
+ </component>
+ <component name="GUI Designer component loader factory" />
+ <component name="IdProvider" IDEtalkID="E2A438D8B6AE84F43587A2210E562521" />
+ <component name="InspectionProjectProfileManager">
+ <option name="PROJECT_PROFILE" value="Project Default" />
+ <option name="USE_PROJECT_LEVEL_SETTINGS" value="false" />
+ <scopes />
+ <profiles>
+ <profile version="1.0" is_locked="false">
+ <option name="myName" value="Project Default" />
+ <option name="myLocal" value="false" />
+ <used_levels>
+ <error>
+ <option name="myName" value="ERROR" />
+ <option name="myVal" value="200" />
+ </error>
+ <warning>
+ <option name="myName" value="WARNING" />
+ <option name="myVal" value="100" />
+ </warning>
+ <information>
+ <option name="myName" value="INFO" />
+ <option name="myVal" value="100" />
+ </information>
+ <server>
+ <option name="myName" value="SERVER PROBLEM" />
+ <option name="myVal" value="100" />
+ </server>
+ </used_levels>
+ </profile>
+ </profiles>
+ </component>
+ <component name="JavacSettings">
+ <option name="DEBUGGING_INFO" value="true" />
+ <option name="GENERATE_NO_WARNINGS" value="false" />
+ <option name="DEPRECATION" value="true" />
+ <option name="ADDITIONAL_OPTIONS_STRING" value="" />
+ <option name="MAXIMUM_HEAP_SIZE" value="128" />
+ </component>
+ <component name="JavadocGenerationManager">
+ <option name="OUTPUT_DIRECTORY" />
+ <option name="OPTION_SCOPE" value="protected" />
+ <option name="OPTION_HIERARCHY" value="true" />
+ <option name="OPTION_NAVIGATOR" value="true" />
+ <option name="OPTION_INDEX" value="true" />
+ <option name="OPTION_SEPARATE_INDEX" value="true" />
+ <option name="OPTION_DOCUMENT_TAG_USE" value="false" />
+ <option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false" />
+ <option name="OPTION_DOCUMENT_TAG_VERSION" value="false" />
+ <option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true" />
+ <option name="OPTION_DEPRECATED_LIST" value="true" />
+ <option name="OTHER_OPTIONS" value="" />
+ <option name="HEAP_SIZE" />
+ <option name="LOCALE" />
+ <option name="OPEN_IN_BROWSER" value="true" />
+ </component>
+ <component name="JikesSettings">
+ <option name="JIKES_PATH" value="" />
+ <option name="DEBUGGING_INFO" value="true" />
+ <option name="DEPRECATION" value="true" />
+ <option name="GENERATE_NO_WARNINGS" value="false" />
+ <option name="IS_EMACS_ERRORS_MODE" value="true" />
+ <option name="ADDITIONAL_OPTIONS_STRING" value="" />
+ </component>
+ <component name="LogConsolePreferences">
+ <option name="FILTER_ERRORS" value="false" />
+ <option name="FILTER_WARNINGS" value="false" />
+ <option name="FILTER_INFO" value="true" />
+ <option name="CUSTOM_FILTER" />
+ </component>
+ <component name="Palette2">
+ <group name="Swing">
+ <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
+ </item>
+ <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
+ </item>
+ <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
+ </item>
+ <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
+ <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
+ </item>
+ <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
+ <initial-values>
+ <property name="text" value="Button" />
+ </initial-values>
+ </item>
+ <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+ <initial-values>
+ <property name="text" value="RadioButton" />
+ </initial-values>
+ </item>
+ <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+ <initial-values>
+ <property name="text" value="CheckBox" />
+ </initial-values>
+ </item>
+ <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
+ <initial-values>
+ <property name="text" value="Label" />
+ </initial-values>
+ </item>
+ <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+ <preferred-size width="150" height="-1" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+ <preferred-size width="150" height="-1" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+ <preferred-size width="150" height="-1" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
+ </item>
+ <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+ <preferred-size width="200" height="200" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+ <preferred-size width="200" height="200" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+ </item>
+ <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+ </item>
+ <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
+ </item>
+ <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
+ </item>
+ <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
+ <preferred-size width="-1" height="20" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
+ </item>
+ <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
+ </item>
+ </group>
+ </component>
+ <component name="ProjectModuleManager">
+ <modules>
+ <module fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea70/modules/test/test.iml" filepath="$PROJECT_DIR$/build/ide/intellij/idea70/modules/test/test.iml" />
+ <module fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea70/modules/testsuite/testsuite.iml" filepath="$PROJECT_DIR$/build/ide/intellij/idea70/modules/testsuite/testsuite.iml" />
+ <module fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea70/modules/thirdparty/thirdparty.iml" filepath="$PROJECT_DIR$/build/ide/intellij/idea70/modules/thirdparty/thirdparty.iml" />
+ <module fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea70/modules/tools/tools.iml" filepath="$PROJECT_DIR$/build/ide/intellij/idea70/modules/tools/tools.iml" />
+ </modules>
+ </component>
+ <component name="ProjectRootManager" version="2" assert-keyword="true" jdk-15="false" project-jdk-name="1.5" project-jdk-type="JavaSDK">
+ <output url="file://$PROJECT_DIR$/output" />
+ </component>
+ <component name="ProjectRunConfigurationManager" />
+ <component name="RmicSettings">
+ <option name="IS_EANABLED" value="false" />
+ <option name="DEBUGGING_INFO" value="true" />
+ <option name="GENERATE_NO_WARNINGS" value="false" />
+ <option name="GENERATE_IIOP_STUBS" value="false" />
+ <option name="ADDITIONAL_OPTIONS_STRING" value="" />
+ </component>
+ <component name="StarteamVcsAdapter" />
+ <component name="VssVcs">
+ <SourceSafePersistencyRemovedFolder>$PROJECT_DIR$/wsrp/src/resources/test</SourceSafePersistencyRemovedFolder>
+ </component>
+ <component name="com.intellij.jsf.UserDefinedFacesConfigs">
+ <option name="USER_DEFINED_CONFIGS">
+ <value>
+ <list size="0" />
+ </value>
+ </option>
+ </component>
+ <component name="copyright">
+ <Base>
+ <setting name="state" value="1" />
+ </Base>
+ <LanguageOptions name="$TEMPLATE$">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="true" />
+ <option name="separateAfter" value="true" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="true" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="JBoss, a division of Red Hat Copyright &#36;today.year, 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 Fr!
anklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site: http://www.fsf.org." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="4" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="CSS">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="1" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="HTML">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="1" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JAVA">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JSP">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="1" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JavaScript">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="1" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="Properties">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="1" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="XML">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ </component>
+ <component name="libraryTable" />
+ <component name="uidesigner-configuration">
+ <option name="INSTRUMENT_CLASSES" value="true" />
+ <option name="COPY_FORMS_RUNTIME_TO_OUTPUT" value="true" />
+ <option name="DEFAULT_LAYOUT_MANAGER" value="GridLayoutManager" />
+ </component>
+ <UsedPathMacros />
+</project>
+
Added: modules/test/trunk/build/ide/intellij/idea70/modules/mc/mc.iml
===================================================================
--- modules/test/trunk/build/ide/intellij/idea70/modules/mc/mc.iml (rev 0)
+++ modules/test/trunk/build/ide/intellij/idea70/modules/mc/mc.iml 2007-10-16 19:43:30 UTC (rev 8671)
@@ -0,0 +1,181 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$/../../../../../../mc">
+ <sourceFolder url="file://$MODULE_DIR$/../../../../../../mc/src/main" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="unit" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-dependency.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-container.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-aop-mc-int.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-managed.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-metatype.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-classloader.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-client.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-client-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-impl.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-container-metadata-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-core-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-kernel.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-vfs-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-vfs.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-core.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-container-metadata.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-structure-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ </component>
+ <component name="VcsManagerConfiguration">
+ <option name="ACTIVE_VCS_NAME" value="svn" />
+ <option name="USE_PROJECT_VCS" value="false" />
+ </component>
+</module>
+
Added: modules/test/trunk/build/ide/intellij/idea70/modules/remote/remote.iml
===================================================================
--- modules/test/trunk/build/ide/intellij/idea70/modules/remote/remote.iml (rev 0)
+++ modules/test/trunk/build/ide/intellij/idea70/modules/remote/remote.iml 2007-10-16 19:43:30 UTC (rev 8671)
@@ -0,0 +1,209 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$/../../../../../../remote">
+ <sourceFolder url="file://$MODULE_DIR$/../../../../../../remote/src/main" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="unit" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/apache-httpclient/lib/commons-httpclient.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-portal/modules/common/lib/portal-common-lib.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/apache-log4j/lib/log4j.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module" module-name="test" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-managed.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-vfs-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-metatype.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-impl.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-kernel.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-container-metadata-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-classloader.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-client-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-container-metadata.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-dependency.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-container.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-core.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-vfs.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-core-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-client.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-aop-mc-int.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-structure-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ </component>
+ <component name="VcsManagerConfiguration">
+ <option name="ACTIVE_VCS_NAME" value="svn" />
+ <option name="USE_PROJECT_VCS" value="false" />
+ </component>
+</module>
+
Added: modules/test/trunk/build/ide/intellij/idea70/modules/test/test.iml
===================================================================
--- modules/test/trunk/build/ide/intellij/idea70/modules/test/test.iml (rev 0)
+++ modules/test/trunk/build/ide/intellij/idea70/modules/test/test.iml 2007-10-16 19:43:30 UTC (rev 8671)
@@ -0,0 +1,535 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/../../../../../../test/classes" />
+ <exclude-output />
+ <content url="file://$MODULE_DIR$/../../../../../../test">
+ <sourceFolder url="file://$MODULE_DIR$/../../../../../../test/src/main" isTestSource="false" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../test/output" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/apache-httpclient/lib/commons-httpclient.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/dom4j/lib/dom4j.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/hibernate/lib/hibernate3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jbossas/core-libs/lib/jnpserver.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jbossas/core-libs/lib/jboss-jca.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jbossas/core-libs/lib/jnp-client.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jbossas/core-libs/lib/jboss-saaj.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jbossas/core-libs/lib/jboss-aspect-library.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jbossas/core-libs/lib/jboss-common.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jbossas/core-libs/lib/jboss-local-jdbc.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jbossas/core-libs/lib/jboss-jaxrpc.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jbossas/core-libs/lib/jbosssx.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jbossas/core-libs/lib/jbossha.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jbossas/core-libs/lib/jboss.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jbossas/core-libs/lib/jboss-common-client.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jbossas/core-libs/lib/jboss-system.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jbossas/core-libs/lib/jmx-invoker-adaptor-client.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jbossas/core-libs/lib/jboss-jmx.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jbossas/core-libs/lib/jboss-common-jdbc-wrapper.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jbossas/core-libs/lib/jboss-xml-binding.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jbossas/core-libs/lib/jboss-j2ee.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jbossas/core-libs/lib/jboss-transaction.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jbossas/core-libs/lib/jboss-hibernate.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jbossas/core-libs/lib/namespace.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/apache-log4j/lib/log4j.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/junit/lib/junit.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-container.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-dependency.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/sun-opends/lib/OpenDS.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../test/selenium-java-client-driver-backport.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-portal/modules/common/lib/portal-common-lib.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/sun-servlet/lib/servlet-api.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/remoting/lib/jboss-remoting.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/codehaus/cargo/lib/cargo-ant-0.9.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/codehaus/cargo/lib/cargo-core-uberjar-0.9.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/testng/lib/testng-5.5-jdk15.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-container-metadata.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-kernel.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ </component>
+ <component name="VcsManagerConfiguration">
+ <option name="ACTIVE_VCS_NAME" value="svn" />
+ <option name="USE_PROJECT_VCS" value="false" />
+ </component>
+ <component name="copyright">
+ <Base>
+ <setting name="state" value="1" />
+ </Base>
+ <LanguageOptions name="$TEMPLATE$">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="true" />
+ <option name="separateAfter" value="true" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="true" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="JBoss, a division of Red Hat Copyright &#36;today.year, 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 Fr!
anklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site: http://www.fsf.org." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="4" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="CSS">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="HTML">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JAVA">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JSP">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JavaScript">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="Properties">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="XML">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ </component>
+</module>
+
Added: modules/test/trunk/build/ide/intellij/idea70/modules/testsuite/testsuite.iml
===================================================================
--- modules/test/trunk/build/ide/intellij/idea70/modules/testsuite/testsuite.iml (rev 0)
+++ modules/test/trunk/build/ide/intellij/idea70/modules/testsuite/testsuite.iml 2007-10-16 19:43:30 UTC (rev 8671)
@@ -0,0 +1,192 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/../../../../../../testsuite/classes" />
+ <exclude-output />
+ <content url="file://$MODULE_DIR$/../../../../../../testsuite">
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../testsuite/output" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntryProperties />
+ </component>
+ <component name="VcsManagerConfiguration">
+ <option name="ACTIVE_VCS_NAME" value="svn" />
+ <option name="USE_PROJECT_VCS" value="false" />
+ </component>
+ <component name="copyright">
+ <Base>
+ <setting name="state" value="1" />
+ </Base>
+ <LanguageOptions name="$TEMPLATE$">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="true" />
+ <option name="separateAfter" value="true" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="true" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="JBoss, a division of Red Hat Copyright &#36;today.year, 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 Fr!
anklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site: http://www.fsf.org." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="4" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="CSS">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="HTML">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JAVA">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JSP">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JavaScript">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="Properties">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="XML">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ </component>
+</module>
+
Added: modules/test/trunk/build/ide/intellij/idea70/modules/thirdparty/thirdparty.iml
===================================================================
--- modules/test/trunk/build/ide/intellij/idea70/modules/thirdparty/thirdparty.iml (rev 0)
+++ modules/test/trunk/build/ide/intellij/idea70/modules/thirdparty/thirdparty.iml 2007-10-16 19:43:30 UTC (rev 8671)
@@ -0,0 +1,245 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/../../../../../../thirdparty/classes" />
+ <exclude-output />
+ <content url="file://$MODULE_DIR$/../../../../../../thirdparty">
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/antlr" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/apache-ant" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/apache-codec" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/apache-collections" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/apache-fileupload" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/apache-httpclient" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/apache-lang" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/apache-log4j" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/apache-logging" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/apache-lucene" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/apache-myfaces" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/apache-net" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/apache-tomahawk" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/apache-xerces" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/apache-xmlsec" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/asm" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/aspectj" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/beanshell" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/cglib" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/dbunit" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/dom4j" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/ehcache" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/el" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/facelets" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/hibernate" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/hsqldb" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/httpunit" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/ibm-wsdl4j" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/jackrabbit" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/jakarta-cactus" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/jakarta-io" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/javassist" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/jboss" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/jbossas" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/jbpm" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/jcr" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/jetty" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/jflex" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/jgroups" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/jsunit" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/junit" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/jwebunit" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/licenses" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/nekohtml" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/odmg" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/oswego-concurrent" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/portals-bridges" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/qdox" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/sleepycat" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/slf4j" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/sun-jaf" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/sun-javacc" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/sun-javamail" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/sun-opends" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/sun-servlet" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/trove" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/wutka-dtdparser" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../../../../thirdparty/xdoclet" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntryProperties />
+ </component>
+ <component name="copyright">
+ <Base>
+ <setting name="state" value="1" />
+ </Base>
+ <LanguageOptions name="$TEMPLATE$">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="true" />
+ <option name="separateAfter" value="true" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="true" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="JBoss, a division of Red Hat Copyright &#36;today.year, 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 Fr!
anklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site: http://www.fsf.org." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="4" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="CSS">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="HTML">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JAVA">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JSP">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JavaScript">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="Properties">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="XML">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ </component>
+</module>
+
Added: modules/test/trunk/build/ide/intellij/idea70/modules/tooling/tooling.iml
===================================================================
--- modules/test/trunk/build/ide/intellij/idea70/modules/tooling/tooling.iml (rev 0)
+++ modules/test/trunk/build/ide/intellij/idea70/modules/tooling/tooling.iml 2007-10-16 19:43:30 UTC (rev 8671)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$/../../../../../../tooling">
+ <sourceFolder url="file://$MODULE_DIR$/../../../../../../tooling/src/main" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="unit" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/apache-ant/lib/ant.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../tools/lib/ant-junit.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ </component>
+ <component name="VcsManagerConfiguration">
+ <option name="ACTIVE_VCS_NAME" value="svn" />
+ <option name="USE_PROJECT_VCS" value="false" />
+ </component>
+</module>
+
Added: modules/test/trunk/build/ide/intellij/idea70/modules/tools/tools.iml
===================================================================
--- modules/test/trunk/build/ide/intellij/idea70/modules/tools/tools.iml (rev 0)
+++ modules/test/trunk/build/ide/intellij/idea70/modules/tools/tools.iml 2007-10-16 19:43:30 UTC (rev 8671)
@@ -0,0 +1,201 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/../../../../../../tools/classes" />
+ <exclude-output />
+ <content url="file://$MODULE_DIR$/../../../../../../tools">
+ <sourceFolder url="file://$MODULE_DIR$/../../../../../../tools/src/main" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/wutka-dtdparser/lib/dtdparser121.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ </component>
+ <component name="VcsManagerConfiguration">
+ <option name="ACTIVE_VCS_NAME" value="svn" />
+ <option name="USE_PROJECT_VCS" value="false" />
+ </component>
+ <component name="copyright">
+ <Base>
+ <setting name="state" value="1" />
+ </Base>
+ <LanguageOptions name="$TEMPLATE$">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="true" />
+ <option name="separateAfter" value="true" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="true" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="JBoss, a division of Red Hat Copyright &#36;today.year, 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 Fr!
anklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site: http://www.fsf.org." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="4" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="CSS">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="HTML">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JAVA">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JSP">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JavaScript">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="Properties">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="XML">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ </component>
+</module>
+
Added: modules/test/trunk/build/ide/intellij/idea70/modules/unit/unit.iml
===================================================================
--- modules/test/trunk/build/ide/intellij/idea70/modules/unit/unit.iml (rev 0)
+++ modules/test/trunk/build/ide/intellij/idea70/modules/unit/unit.iml 2007-10-16 19:43:30 UTC (rev 8671)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$/../../../../../../unit">
+ <sourceFolder url="file://$MODULE_DIR$/../../../../../../unit/src/main" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/apache-log4j/lib/log4j.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ </component>
+ <component name="VcsManagerConfiguration">
+ <option name="ACTIVE_VCS_NAME" value="svn" />
+ <option name="USE_PROJECT_VCS" value="false" />
+ </component>
+</module>
+
Added: modules/test/trunk/build/ide/intellij/idea70/readme.txt
===================================================================
--- modules/test/trunk/build/ide/intellij/idea70/readme.txt (rev 0)
+++ modules/test/trunk/build/ide/intellij/idea70/readme.txt 2007-10-16 19:43:30 UTC (rev 8671)
@@ -0,0 +1,10 @@
+- Main project file and modules:
+Copy jboss-portal.ipr to the root of the Portal source directory. You might need to change the JDK to use but
+it should otherwise work out the box. Alternatively, you can create a new project file at the root of your Portal
+installation and import the module files (*.iml) found in the modules directory manually.
+
+- Codestyles and headers:
+The config directory contains standard settings for the JBoss Portal project regarding headers and code style. If
+you intend to commit code to JBoss Portal, you need to update your IDEA installation to use these files. Please
+refer to the IDEA manual on how to precisely do it, the short version being that you can replace the files found
+in your IDEA preference directory by the ones found in the config directory.
Property changes on: modules/test/trunk/build/ide/intellij/idea70/readme.txt
___________________________________________________________________
Name: svn:executable
+ *
16 years, 8 months
JBoss Portal SVN: r8670 - in modules/test/trunk: tooling/src/main/org/jboss/unit/tooling/ant and 1 other directories.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-10-16 11:05:25 -0400 (Tue, 16 Oct 2007)
New Revision: 8670
Modified:
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/DSConfig.java
modules/test/trunk/tooling/src/main/org/jboss/unit/tooling/ant/ToolingConstants.java
modules/test/trunk/unit/src/main/org/jboss/unit/tooling/Main.java
Log:
- improve LDAP config support for tests
- make Main print whole test output at the end of the run.
Modified: modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/DSConfig.java
===================================================================
--- modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/DSConfig.java 2007-10-16 12:16:32 UTC (rev 8669)
+++ modules/test/trunk/test/src/main/org/jboss/portal/test/framework/embedded/DSConfig.java 2007-10-16 15:05:25 UTC (rev 8670)
@@ -31,9 +31,7 @@
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Iterator;
-import java.util.List;
/**
* Configuration of LDAP Directory Server used for tests. Corresponds with directories.xml file
@@ -118,6 +116,30 @@
// return new MultiValuedTestParameterValue(list);
// }
+ public static DSConfig obtainConfig(String directories, String directoryName) throws Exception
+ {
+ if (directoryName != null && directoryName.length() > 0)
+ {
+ URL url = Thread.currentThread().getContextClassLoader().getResource(directories);
+
+ DSConfig[] configs = fromXML(url);
+
+ for (DSConfig config : configs)
+ {
+ if (config.getName().equals(directoryName))
+ {
+ return config;
+ }
+ }
+
+ throw new IllegalStateException("Could not obtain Config for {directoryName:directories} - {" + directoryName + ":" + directories + "}" );
+ }
+ else
+ {
+ return null;
+ }
+ }
+
public static DSConfig[] fromXML(URL url) throws Exception
{
ArrayList configs = new ArrayList();
Modified: modules/test/trunk/tooling/src/main/org/jboss/unit/tooling/ant/ToolingConstants.java
===================================================================
--- modules/test/trunk/tooling/src/main/org/jboss/unit/tooling/ant/ToolingConstants.java 2007-10-16 12:16:32 UTC (rev 8669)
+++ modules/test/trunk/tooling/src/main/org/jboss/unit/tooling/ant/ToolingConstants.java 2007-10-16 15:05:25 UTC (rev 8670)
@@ -33,6 +33,10 @@
public static final String JBOSS_UNIT_PROPERTY = "jboss.unit.property";
+ public static final String JBOSS_UNIT_PARAMETER = "jboss.unit.parameter";
+
+ public static final String JBOSS_UNIT_PARAMETERS = "jboss.unit.parameters";
+
public static final String OPT_ID = "--id";
public static final String OPT_IDS = "--ids";
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/tooling/Main.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/tooling/Main.java 2007-10-16 12:16:32 UTC (rev 8669)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/tooling/Main.java 2007-10-16 15:05:25 UTC (rev 8670)
@@ -28,12 +28,14 @@
import org.jboss.unit.runner.impl.TestRunnerEventBroadcaster;
import org.jboss.unit.runner.model.TestSuiteDef;
import org.jboss.unit.tooling.filter.MainTestFilter;
+import org.jboss.unit.report.impl.writer.PrintListener;
import java.util.Set;
import java.util.HashSet;
import java.util.Map;
import java.util.HashMap;
import java.util.Collections;
+import java.io.StringWriter;
/**
* @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
@@ -54,8 +56,12 @@
public static final String JBOSS_UNIT_PROPERTIES = "jboss.unit.properties";
- public static final String JBOSS_UNIT_PROPERTY = "jboss.unit.property";
+ public static final String JBOSS_UNIT_PROPERTY = "jboss.unit.property";
+ public static final String JBOSS_UNIT_PARAMETER = "jboss.unit.parameter";
+
+ public static final String JBOSS_UNIT_PARAMETERS = "jboss.unit.parameters";
+
public static final String OPT_ID = "--id";
public static final String OPT_IDS = "--ids";
@@ -147,7 +153,7 @@
this.broadcaster = broadcaster;
}
- public void execute()
+ public void execute() throws Exception
{
// For now lets just be verbose. Later we need some real logging + 'debug' switch
System.out.println("TestRunnerContext contains: ");
@@ -159,9 +165,16 @@
//
// System.out.println(key + "=" + System.getProperty((String)key));
// }
-
+
+ StringWriter sw = new StringWriter();
+ broadcaster.addListener(new PrintListener(sw));
+
TestRunnerContextSupport runnerContext = new TestRunnerContextSupport(properties, new ParametrizationSet(), mainFilter, broadcaster);
runner.run(runnerContext);
+
+ sw.close();
+
+ System.out.println(sw.toString());
}
public static void main(String[] args) throws Exception
16 years, 8 months
JBoss Portal SVN: r8669 - modules/test/trunk/build/ide/intellij/idea60/modules/unit.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-16 08:16:32 -0400 (Tue, 16 Oct 2007)
New Revision: 8669
Removed:
modules/test/trunk/build/ide/intellij/idea60/modules/unit/tooling.iml
Log:
removed misplaced tooling iml
Deleted: modules/test/trunk/build/ide/intellij/idea60/modules/unit/tooling.iml
===================================================================
--- modules/test/trunk/build/ide/intellij/idea60/modules/unit/tooling.iml 2007-10-15 22:45:01 UTC (rev 8668)
+++ modules/test/trunk/build/ide/intellij/idea60/modules/unit/tooling.iml 2007-10-16 12:16:32 UTC (rev 8669)
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module version="4" relativePaths="true" type="JAVA_MODULE">
- <component name="ModuleRootManager" />
- <component name="NewModuleRootManager" inherit-compiler-output="true">
- <exclude-output />
- <content url="file://$MODULE_DIR$/../../../../../../tooling">
- <sourceFolder url="file://$MODULE_DIR$/../../../../../../tooling/src/main" isTestSource="false" />
- <excludeFolder url="file://$MODULE_DIR$/../../../../../../tooling/output" />
- </content>
- <orderEntry type="inheritedJdk" />
- <orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module-library">
- <library>
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/apache-ant/lib/ant-launcher.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library">
- <library>
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/apache-ant/lib/ant.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module" module-name="unit" />
- <orderEntryProperties />
- </component>
- <component name="VcsManagerConfiguration">
- <option name="ACTIVE_VCS_NAME" value="svn" />
- <option name="USE_PROJECT_VCS" value="false" />
- </component>
-</module>
-
16 years, 8 months
JBoss Portal SVN: r8668 - in modules/test/trunk: unit/src/main/org/jboss/test/unit/runner and 3 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-15 18:45:01 -0400 (Mon, 15 Oct 2007)
New Revision: 8668
Added:
modules/test/trunk/unit/src/main/org/jboss/unit/driver/DriverException.java
Modified:
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverClient.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/EventList.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/TestDriverRunnerTests.java
modules/test/trunk/unit/src/main/org/jboss/unit/driver/TestDriver.java
modules/test/trunk/unit/src/main/org/jboss/unit/driver/impl/composite/CompositeTestDriver.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/driver/TestDriverRunner.java
Log:
added support for failure during test driver init by throwing an exception + the test cases for testing failures behavior during init/destroy phases
Modified: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverClient.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverClient.java 2007-10-15 22:09:35 UTC (rev 8667)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverClient.java 2007-10-15 22:45:01 UTC (rev 8668)
@@ -26,6 +26,7 @@
import org.jboss.unit.driver.DriverCommand;
import org.jboss.unit.driver.DriverResponse;
import org.jboss.unit.driver.DriverContext;
+import org.jboss.unit.driver.DriverException;
import org.jboss.unit.driver.response.FailureResponse;
import org.jboss.unit.driver.command.StartTestCommand;
import org.jboss.unit.info.TestInfo;
@@ -132,11 +133,10 @@
return (RemoteTestDriver)node.lookupService(RemoteTestDriver.SERVICE_ID);
}
- private FailureResponse failed;
private KernelDeployment deployment;
private BeanXMLDeployer beanDeployer;
- public void initDriver(DriverContext context)
+ public void initDriver(DriverContext context) throws DriverException
{
this.context = context;
@@ -160,9 +160,7 @@
}
catch (Throwable throwable)
{
- throwable.printStackTrace();
- failed = new FailureResponse(Failure.createFailure("Could not startup kernel", throwable));
- return;
+ throw new DriverException("Could not start the kernel", throwable);
}
// Now deploy beans
@@ -183,8 +181,7 @@
}
catch (Throwable throwable)
{
- throwable.printStackTrace();
- failed = new FailureResponse(Failure.createFailure("Could not deploy beans", throwable));
+ throw new DriverException("Could not deploy the beans", throwable);
}
// Always retrieve meta data from the default node
Modified: modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/EventList.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/EventList.java 2007-10-15 22:09:35 UTC (rev 8667)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/EventList.java 2007-10-15 22:45:01 UTC (rev 8668)
@@ -33,6 +33,7 @@
import org.jboss.unit.runner.event.EndRunnerEvent;
import org.jboss.unit.runner.event.StartTestSuiteEvent;
import org.jboss.unit.runner.event.EndTestSuiteEvent;
+import org.jboss.unit.runner.event.RunnerFailureEvent;
import static org.jboss.unit.api.Assert.*;
import org.jboss.unit.TestId;
@@ -54,6 +55,18 @@
events.add(event);
}
+ protected RunnerFailureEvent assertRunnerFailureEvent(int index)
+ {
+ assertTrue(events.size() > index);
+ TestRunnerEvent event = assertNotNull(events.get(index));
+ return assertRunnerFailureEvent(event);
+ }
+
+ protected RunnerFailureEvent assertRunnerFailureEvent(TestRunnerEvent event)
+ {
+ return assertInstanceOf(event, RunnerFailureEvent.class);
+ }
+
protected StartRunnerEvent assertStartRunnerEvent(int index)
{
assertTrue(events.size() > index);
Modified: modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/TestDriverRunnerTests.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/TestDriverRunnerTests.java 2007-10-15 22:09:35 UTC (rev 8667)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/TestDriverRunnerTests.java 2007-10-15 22:45:01 UTC (rev 8668)
@@ -30,11 +30,15 @@
import org.jboss.unit.runner.event.EndTestCaseEvent;
import org.jboss.unit.driver.DriverResponse;
import org.jboss.unit.driver.DriverCommand;
+import org.jboss.unit.driver.TestDriver;
+import org.jboss.unit.driver.DriverContext;
+import org.jboss.unit.driver.DriverException;
import org.jboss.unit.driver.response.EndTestResponse;
import org.jboss.unit.driver.response.FailureResponse;
import org.jboss.unit.info.impl.SimpleTestCaseInfo;
import org.jboss.unit.info.impl.SimpleParameterInfo;
import org.jboss.unit.info.impl.SimpleTestSuiteInfo;
+import org.jboss.unit.info.TestInfo;
import org.jboss.unit.TestId;
import org.jboss.unit.FailureType;
import org.jboss.unit.Failure;
@@ -75,8 +79,188 @@
//
testEvents1();
+
+ //
+ testInit();
+ testInitThrowsDriverException();
+ testInitThrowsRuntimeException();
+ testInitThrowsError();
+
+ //
+ testDestroyThrowsRuntimeException();
+ testDestroyThrowsError();
}
+ private static void testDestroyThrowsError()
+ {
+ final Error error = new Error();
+ FailureTestDriver testDriver = new FailureTestDriver()
+ {
+ public void destroyDriver()
+ {
+ throw error;
+ }
+ };
+
+ //
+ TestDriverRunner runner = new TestDriverRunner(testDriver, new TestId());
+ EventList listener = new EventList();
+ try
+ {
+ runner.run(new TestRunnerContextSupport(listener));
+ fail();
+ }
+ catch (Error e)
+ {
+ assertSame(error, e);
+ }
+
+ //
+ assertEquals(3, listener.events.size());
+ listener.assertStartRunnerEvent(0);
+ listener.assertStartTestEvent(1, new TestId());
+ listener.assertEndTestEvent(2, new TestId(), new TestSuccess(0));
+ }
+
+ private static void testDestroyThrowsRuntimeException()
+ {
+ FailureTestDriver testDriver = new FailureTestDriver()
+ {
+ public void destroyDriver()
+ {
+ throw new RuntimeException();
+ }
+ };
+
+ //
+ TestDriverRunner runner = new TestDriverRunner(testDriver, new TestId());
+ EventList listener = new EventList();
+ runner.run(new TestRunnerContextSupport(listener));
+
+ //
+ assertEquals(4, listener.events.size());
+ listener.assertStartRunnerEvent(0);
+ listener.assertStartTestEvent(1, new TestId());
+ listener.assertEndTestEvent(2, new TestId(), new TestSuccess(0));
+ listener.assertEndRunnerEvent(3);
+ }
+
+ private static void testInit()
+ {
+ FailureTestDriver testDriver = new FailureTestDriver()
+ {
+ public void initDriver(DriverContext context) throws DriverException
+ {
+ }
+ };
+
+ //
+ TestDriverRunner runner = new TestDriverRunner(testDriver, new TestId());
+ EventList listener = new EventList();
+ runner.run(new TestRunnerContextSupport(listener));
+
+ //
+ assertTrue(testDriver.invoked1);
+ assertTrue(testDriver.invoked2);
+ assertTrue(testDriver.invoked3);
+
+ //
+ assertEquals(4, listener.events.size());
+ listener.assertStartRunnerEvent(0);
+ listener.assertStartTestEvent(1, new TestId());
+ listener.assertEndTestEvent(2, new TestId(), new TestSuccess(0));
+ listener.assertEndRunnerEvent(3);
+ }
+
+ private static void testInitThrowsDriverException()
+ {
+ FailureTestDriver testDriver = new FailureTestDriver()
+ {
+ public void initDriver(DriverContext context) throws DriverException
+ {
+ throw new DriverException();
+ }
+ };
+
+ //
+ TestDriverRunner runner = new TestDriverRunner(testDriver, new TestId());
+ EventList listener = new EventList();
+ runner.run(new TestRunnerContextSupport(listener));
+
+ //
+ assertFalse(testDriver.invoked1);
+ assertFalse(testDriver.invoked2);
+ assertFalse(testDriver.invoked3);
+
+ //
+ assertEquals(3, listener.events.size());
+ listener.assertStartRunnerEvent(0);
+ listener.assertRunnerFailureEvent(1);
+ listener.assertEndRunnerEvent(2);
+ }
+
+ private static void testInitThrowsRuntimeException()
+ {
+ FailureTestDriver testDriver = new FailureTestDriver()
+ {
+ public void initDriver(DriverContext context) throws DriverException
+ {
+ throw new RuntimeException();
+ }
+ };
+
+ //
+ TestDriverRunner runner = new TestDriverRunner(testDriver, new TestId());
+ EventList listener = new EventList();
+ runner.run(new TestRunnerContextSupport(listener));
+
+ //
+ assertFalse(testDriver.invoked1);
+ assertFalse(testDriver.invoked2);
+ assertFalse(testDriver.invoked3);
+
+ //
+ assertEquals(3, listener.events.size());
+ listener.assertStartRunnerEvent(0);
+ listener.assertRunnerFailureEvent(1);
+ listener.assertEndRunnerEvent(2);
+ }
+
+ private static void testInitThrowsError()
+ {
+ final Error error = new Error();
+ FailureTestDriver testDriver = new FailureTestDriver()
+ {
+ public void initDriver(DriverContext context) throws DriverException
+ {
+ throw error;
+ }
+ };
+
+ //
+ TestDriverRunner runner = new TestDriverRunner(testDriver, new TestId());
+ EventList listener = new EventList();
+
+ try
+ {
+ runner.run(new TestRunnerContextSupport(listener));
+ fail();
+ }
+ catch (Error e)
+ {
+ assertSame(error, e);
+ }
+
+ //
+ assertFalse(testDriver.invoked1);
+ assertFalse(testDriver.invoked2);
+ assertFalse(testDriver.invoked3);
+
+ //
+ assertEquals(1, listener.events.size());
+ listener.assertStartRunnerEvent(0);
+ }
+
private static void testEvents1()
{
TestDriverImpl testDriver = new TestDriverImpl()
@@ -407,4 +591,29 @@
listener.assertStartTestEvent(2, new TestId("Foo"));
}
+ private abstract static class FailureTestDriver implements TestDriver
+ {
+ boolean invoked0 = false;
+ boolean invoked1 = false;
+ boolean invoked2 = false;
+ boolean invoked3 = false;
+ public void initDriver(DriverContext context) throws DriverException
+ {
+ invoked0 = true;
+ }
+ public TestInfo getInfo()
+ {
+ invoked1 = true;
+ return new SimpleTestCaseInfo("Foo");
+ }
+ public DriverResponse invoke(TestId id, DriverCommand command)
+ {
+ invoked2 = true;
+ return new EndTestResponse();
+ }
+ public void destroyDriver()
+ {
+ invoked3 = true;
+ }
+ }
}
Added: modules/test/trunk/unit/src/main/org/jboss/unit/driver/DriverException.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/driver/DriverException.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/driver/DriverException.java 2007-10-15 22:45:01 UTC (rev 8668)
@@ -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.unit.driver;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class DriverException extends Exception
+{
+ public DriverException()
+ {
+ }
+
+ public DriverException(String string)
+ {
+ super(string);
+ }
+
+ public DriverException(String string, Throwable throwable)
+ {
+ super(string, throwable);
+ }
+
+ public DriverException(Throwable throwable)
+ {
+ super(throwable);
+ }
+}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/driver/TestDriver.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/driver/TestDriver.java 2007-10-15 22:09:35 UTC (rev 8667)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/driver/TestDriver.java 2007-10-15 22:45:01 UTC (rev 8668)
@@ -38,8 +38,9 @@
* Initialize the test driver.
*
* @param context the driver context
+ * @throws DriverException if anything occurs that would prevent the initialization of the driver
*/
- void initDriver(DriverContext context);
+ void initDriver(DriverContext context) throws DriverException;
/**
* Destroy the test driver.
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/driver/impl/composite/CompositeTestDriver.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/driver/impl/composite/CompositeTestDriver.java 2007-10-15 22:09:35 UTC (rev 8667)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/driver/impl/composite/CompositeTestDriver.java 2007-10-15 22:45:01 UTC (rev 8668)
@@ -26,6 +26,7 @@
import org.jboss.unit.driver.DriverResponse;
import org.jboss.unit.driver.DriverCommand;
import org.jboss.unit.driver.AbstractTestDriver;
+import org.jboss.unit.driver.DriverException;
import org.jboss.unit.driver.response.FailureResponse;
import org.jboss.unit.info.impl.SimpleTestSuiteInfo;
import org.jboss.unit.info.TestInfo;
@@ -95,7 +96,7 @@
return drivers.get(name);
}
- public void mount(TestDriver driver)
+ public void mount(TestDriver driver) throws DriverException
{
synchronized(TestDriver.class)
{
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/driver/TestDriverRunner.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/driver/TestDriverRunner.java 2007-10-15 22:09:35 UTC (rev 8667)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/driver/TestDriverRunner.java 2007-10-15 22:45:01 UTC (rev 8668)
@@ -113,7 +113,7 @@
//
try
{
- TestSuiteInfo info = (TestSuiteInfo)driver.getInfo();
+ TestInfo info = driver.getInfo();
//
internalRun(context, info, testId, new TestId());
@@ -125,7 +125,7 @@
{
driver.destroyDriver();
}
- catch (Throwable ignore)
+ catch (RuntimeException ignore)
{
}
}
16 years, 8 months