[jboss-cvs] JBossAS SVN: r64152 - in branches/Branch_4_4: messaging/src/etc/server-jbm/default/deploy/jboss-messaging.sar and 6 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Jul 20 01:03:01 EDT 2007
Author: clebert.suconic at jboss.com
Date: 2007-07-20 01:03:00 -0400 (Fri, 20 Jul 2007)
New Revision: 64152
Added:
branches/Branch_4_4/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossMessagingJoramUnitTestCase.java
Removed:
branches/Branch_4_4/testsuite/src/main/org/jboss/test/jbossmessaging/test/JoramUnitTestCase.java
Modified:
branches/Branch_4_4/build/build-thirdparty.xml
branches/Branch_4_4/messaging/src/etc/server-jbm/default/deploy/jboss-messaging.sar/hsqldb-persistence-service.xml
branches/Branch_4_4/server/src/etc/conf/default/login-config.xml
branches/Branch_4_4/server/src/etc/conf/default/props/messaging-users.properties
branches/Branch_4_4/testsuite/build.xml
branches/Branch_4_4/testsuite/imports/server-config.xml
branches/Branch_4_4/testsuite/src/main/org/jboss/test/jbossmessaging/JBossMessagingAdmin.java
Log:
Fixing JBossMessaging tests (security parameters)
Modified: branches/Branch_4_4/build/build-thirdparty.xml
===================================================================
--- branches/Branch_4_4/build/build-thirdparty.xml 2007-07-20 04:43:13 UTC (rev 64151)
+++ branches/Branch_4_4/build/build-thirdparty.xml 2007-07-20 05:03:00 UTC (rev 64152)
@@ -99,7 +99,7 @@
<componentref name="joesnmp" version="0.3.4-brew"/>
<componentref name="juddi" version="0.9RC4-brew"/>
<componentref name="junit" version="3.8.2-brew"/>
- <componentref name="objectweb-joramtests" version="1.3"/>
+ <componentref name="objectweb-joramtests" version="1.4"/>
<componentref name="odmg" version="3.0-brew"/>
<componentref name="oswego-concurrent" version="1.3.4-brew"/>
<componentref name="quartz" version="1.5.2-brew"/>
Modified: branches/Branch_4_4/messaging/src/etc/server-jbm/default/deploy/jboss-messaging.sar/hsqldb-persistence-service.xml
===================================================================
--- branches/Branch_4_4/messaging/src/etc/server-jbm/default/deploy/jboss-messaging.sar/hsqldb-persistence-service.xml 2007-07-20 04:43:13 UTC (rev 64151)
+++ branches/Branch_4_4/messaging/src/etc/server-jbm/default/deploy/jboss-messaging.sar/hsqldb-persistence-service.xml 2007-07-20 05:03:00 UTC (rev 64152)
@@ -84,7 +84,20 @@
<attribute name="CreateTablesOnStartup">true</attribute>
<attribute name="SqlProperties"><![CDATA[
-POPULATE.TABLES.1=INSERT INTO JBM_USER (USER_ID,PASSWD,CLIENTID) VALUES ('dilbert','dogbert','dilbert-id')
+POPULATE.TABLES.1 = INSERT INTO JBM_USER (USER_ID, PASSWD) VALUES ('guest', 'guest')
+POPULATE.TABLES.2 = INSERT INTO JBM_USER (USER_ID, PASSWD) VALUES ('j2ee', 'j2ee')
+POPULATE.TABLES.3 = INSERT INTO JBM_USER (USER_ID, PASSWD, CLIENTID) VALUES ('john', 'needle', 'DurableSubscriberExample')
+POPULATE.TABLES.4 = INSERT INTO JBM_USER (USER_ID, PASSWD) VALUES ('nobody', 'nobody')
+POPULATE.TABLES.5 = INSERT INTO JBM_USER (USER_ID, PASSWD) VALUES ('dynsub', 'dynsub')
+POPULATE.TABLES.6 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('guest','guest')
+POPULATE.TABLES.7 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('j2ee','guest')
+POPULATE.TABLES.8 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('john','guest')
+POPULATE.TABLES.9 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('subscriber','john')
+POPULATE.TABLES.10 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('publisher','john')
+POPULATE.TABLES.11 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('publisher','dynsub')
+POPULATE.TABLES.12 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('durpublisher','john')
+POPULATE.TABLES.13 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('durpublisher','dynsub')
+POPULATE.TABLES.14 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('noacc','nobody')
]]></attribute>
</mbean>
Modified: branches/Branch_4_4/server/src/etc/conf/default/login-config.xml
===================================================================
--- branches/Branch_4_4/server/src/etc/conf/default/login-config.xml 2007-07-20 04:43:13 UTC (rev 64151)
+++ branches/Branch_4_4/server/src/etc/conf/default/login-config.xml 2007-07-20 05:03:00 UTC (rev 64152)
@@ -135,13 +135,15 @@
</application-policy>
<application-policy name="messaging">
- <authentication>
- <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="required">
- <module-option name="unauthenticatedIdentity">guest</module-option>
- <module-option name="usersProperties">props/messaging-users.properties</module-option>
- <module-option name="rolesProperties">props/messaging-roles.properties</module-option>
- </login-module>
- </authentication>
+ <authentication>
+ <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule"
+ flag = "required">
+ <module-option name = "unauthenticatedIdentity">guest</module-option>
+ <module-option name = "dsJndiName">java:/DefaultDS</module-option>
+ <module-option name = "principalsQuery">SELECT PASSWD FROM JBM_USER WHERE USERID=?</module-option>
+ <module-option name = "rolesQuery">SELECT ROLEID, 'Roles' FROM JBM_ROLE WHERE USERID=?</module-option>
+ </login-module>
+ </authentication>
</application-policy>
<!-- The default login configuration used by any security domain that
Modified: branches/Branch_4_4/server/src/etc/conf/default/props/messaging-users.properties
===================================================================
--- branches/Branch_4_4/server/src/etc/conf/default/props/messaging-users.properties 2007-07-20 04:43:13 UTC (rev 64151)
+++ branches/Branch_4_4/server/src/etc/conf/default/props/messaging-users.properties 2007-07-20 05:03:00 UTC (rev 64152)
@@ -4,4 +4,4 @@
# user=password
#
guest=guest
-
\ No newline at end of file
+john=needle
Modified: branches/Branch_4_4/testsuite/build.xml
===================================================================
--- branches/Branch_4_4/testsuite/build.xml 2007-07-20 04:43:13 UTC (rev 64151)
+++ branches/Branch_4_4/testsuite/build.xml 2007-07-20 05:03:00 UTC (rev 64152)
@@ -168,6 +168,7 @@
<path refid="jboss.jmx.classpath"/>
<path refid="jboss.management.classpath"/>
<path refid="jboss.messaging-mq.classpath"/>
+ <path refid="jboss.messaging.classpath"/>
<path refid="jboss.naming.classpath"/>
<path refid="jboss.security.classpath"/>
<path refid="jboss.server.classpath"/>
@@ -706,6 +707,11 @@
<include name="org/jboss/test/jbossmessaging/ra/*UnitTestCase.class"/>
<include name="org/jboss/test/jms/integration/**/*Test.class"/>
</patternset>
+
+ <patternset id="jbossmessaging.excludes">
+ <include name="org/jboss/test/jbossmessaging/*/*UnitTestCase.class"/>
+ <include name="org/jboss/test/jms/integration/**/*Test.class"/>
+ </patternset>
<!-- Tests that are currently broken -->
@@ -752,6 +758,7 @@
<patternset refid="tc-sso.excludes"/>
<patternset refid="tc-ssl.excludes"/>
<patternset refid="webservice.excludes"/>
+ <patternset refid="jbossmessaging.excludes"/>
</patternset>
<!-- A target that allows for conditional dependency on the compilation and
@@ -787,6 +794,7 @@
<antcall target="tests-unified"/>
<antcall target="tests-aop-scoped"/>
<antcall target="tests-classloader-leak"/>
+ <antcall target="tests-jbossmessaging"/>
<antcall target="tests-report"/>
<record name="${basedir}/build.log" action="stop"/>
</target>
@@ -2528,6 +2536,8 @@
<copy todir="${build.lib}">
<fileset dir="${jboss.jms.integration.tests.lib}"/>
</copy> -->
+
+ <server:start name="soa"/>
<mkdir dir="${build.reports}"/>
<mkdir dir="${build.testlog}"/>
@@ -2573,6 +2583,9 @@
</fileset>
</batchtest>
</junit>
+
+ <server:stop name="soa"/>
+
</target>
<!--
Modified: branches/Branch_4_4/testsuite/imports/server-config.xml
===================================================================
--- branches/Branch_4_4/testsuite/imports/server-config.xml 2007-07-20 04:43:13 UTC (rev 64151)
+++ branches/Branch_4_4/testsuite/imports/server-config.xml 2007-07-20 05:03:00 UTC (rev 64152)
@@ -83,6 +83,13 @@
<sysproperty key="java.endorsed.dirs" value="${jboss.dist}/lib/endorsed" />
<sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
</server>
+ <server name="soa" host="${node0}">
+ <jvmarg value="${jpda.cmdline}" />
+ <jvmarg value="-Xmx128m" />
+ <jvmarg value="-XX:MaxPermSize=128m" />
+ <sysproperty key="java.endorsed.dirs" value="${jboss.dist}/lib/endorsed" />
+ <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
+ </server>
<server name="securitymgr" config="default" host="${node0}">
<jvmarg value="${jpda.cmdline}" />
<jvmarg value="-Xmx64m" />
Modified: branches/Branch_4_4/testsuite/src/main/org/jboss/test/jbossmessaging/JBossMessagingAdmin.java
===================================================================
--- branches/Branch_4_4/testsuite/src/main/org/jboss/test/jbossmessaging/JBossMessagingAdmin.java 2007-07-20 04:43:13 UTC (rev 64151)
+++ branches/Branch_4_4/testsuite/src/main/org/jboss/test/jbossmessaging/JBossMessagingAdmin.java 2007-07-20 05:03:00 UTC (rev 64152)
@@ -63,6 +63,10 @@
}
}
+ public JBossMessagingAdmin(Class clazz) throws Exception
+ {
+ this();
+ }
public JBossMessagingAdmin() throws Exception
{
try {
Copied: branches/Branch_4_4/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossMessagingJoramUnitTestCase.java (from rev 64130, branches/Branch_4_4/testsuite/src/main/org/jboss/test/jbossmessaging/test/JoramUnitTestCase.java)
===================================================================
--- branches/Branch_4_4/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossMessagingJoramUnitTestCase.java (rev 0)
+++ branches/Branch_4_4/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossMessagingJoramUnitTestCase.java 2007-07-20 05:03:00 UTC (rev 64152)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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.jbossmessaging.test;
+
+import junit.framework.Test;
+
+import org.jboss.test.AbstractTestDelegate;
+import org.jboss.test.jbossmq.test.JBossMQJoramUnitTestCase;
+
+/**
+ * Joram unit tests
+ *
+ * @author <a href="mailto:clebert.suconic at jboss.com">Clebert Suconic</a>
+ * @version $Revision$
+ */
+public class JBossMessagingJoramUnitTestCase extends org.jboss.test.jms.JoramUnitTestCase
+{
+ public JBossMessagingJoramUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ /**
+ * Get the test delegate
+ *
+ * @param clazz the test class
+ * @return the delegate
+ * @throws Exception for any error
+ */
+ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception
+ {
+ return getDelegate(clazz, "org.jboss.test.jbossmessaging.JBossMessagingAdmin");
+ }
+
+ public static Test suite() throws Exception
+ {
+ return getTestSuite(JBossMessagingJoramUnitTestCase.class);
+ }
+
+}
Deleted: branches/Branch_4_4/testsuite/src/main/org/jboss/test/jbossmessaging/test/JoramUnitTestCase.java
===================================================================
--- branches/Branch_4_4/testsuite/src/main/org/jboss/test/jbossmessaging/test/JoramUnitTestCase.java 2007-07-20 04:43:13 UTC (rev 64151)
+++ branches/Branch_4_4/testsuite/src/main/org/jboss/test/jbossmessaging/test/JoramUnitTestCase.java 2007-07-20 05:03:00 UTC (rev 64152)
@@ -1,221 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., 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.jbossmessaging.test;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Properties;
-
-import junit.framework.AssertionFailedError;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestListener;
-import junit.framework.TestResult;
-import junit.framework.TestSuite;
-
-import org.jboss.test.JBossTestSetup;
-import org.jboss.test.jbossmessaging.JMSTestCase;
-
-import org.objectweb.jtests.jms.conform.connection.ConnectionTest;
-import org.objectweb.jtests.jms.conform.connection.TopicConnectionTest;
-import org.objectweb.jtests.jms.conform.message.MessageBodyTest;
-import org.objectweb.jtests.jms.conform.message.MessageDefaultTest;
-import org.objectweb.jtests.jms.conform.message.MessageTypeTest;
-import org.objectweb.jtests.jms.conform.message.headers.MessageHeaderTest;
-import org.objectweb.jtests.jms.conform.message.properties.JMSXPropertyTest;
-import org.objectweb.jtests.jms.conform.message.properties.MessagePropertyConversionTest;
-import org.objectweb.jtests.jms.conform.message.properties.MessagePropertyTest;
-import org.objectweb.jtests.jms.conform.queue.QueueBrowserTest;
-import org.objectweb.jtests.jms.conform.queue.TemporaryQueueTest;
-import org.objectweb.jtests.jms.conform.selector.SelectorSyntaxTest;
-import org.objectweb.jtests.jms.conform.selector.SelectorTest;
-import org.objectweb.jtests.jms.conform.session.QueueSessionTest;
-import org.objectweb.jtests.jms.conform.session.SessionTest;
-import org.objectweb.jtests.jms.conform.session.TopicSessionTest;
-import org.objectweb.jtests.jms.conform.session.UnifiedSessionTest;
-import org.objectweb.jtests.jms.conform.topic.TemporaryTopicTest;
-
-/**
- * Joram unit tests
- *
- * @author <a href="mailto:richard.achmatowicz at jboss.com">Richard Achmatowicz</a>
- * @author <a href="mailto:clebert.suconic at jboss.com">Clebert Suconic</a>
- * @version $Revision$
- */
-public class JoramUnitTestCase extends JMSTestCase
-{
- public JoramUnitTestCase(String name)
- {
- super(name);
- }
-
- /** Used to similuate tests while renaming its names. */
- private static class DummyTestCase extends TestCase
- {
- DummyTestCase(String name)
- {
- super (name);
- }
- }
-
- /**
- * One of the goals of this class also is to keep original classNames into testNames. So, you will realize several proxies existent here to
- * keep these class names while executing method names.
- */
- static class TestProxy extends TestCase
- {
- Hashtable hashTests = new Hashtable();
-
-
-
- public TestProxy(Test testcase, String name)
- {
- super(name);
- this.testcase = testcase;
- }
-
- public int countTestCases()
- {
- return testcase.countTestCases();
- }
-
- /**
- * Create a dummy test renaming its content
- * @param test
- * @return
- */
- private Test createDummyTest(Test test)
- {
- Test dummyTest = (Test)hashTests.get(test);
- if (dummyTest==null)
- {
- if (test instanceof TestCase)
- {
- dummyTest = new DummyTestCase(this.getName() + ":"+ ((TestCase)test).getName());
- } else
- if (test instanceof TestSuite)
- {
- dummyTest = new DummyTestCase(this.getName() + ":"+ ((TestCase)test).getName());
- }
- else
- {
- dummyTest = new DummyTestCase(test.getClass().getName());
- }
-
- hashTests.put(test,dummyTest);
- }
-
- return dummyTest;
- }
-
- public void run(final TestResult result)
- {
- TestResult subResult = new TestResult();
- subResult.addListener(new TestListener()
- {
- public void addError(Test subtest, Throwable throwable)
- {
- Test dummyTest = createDummyTest(subtest);
- result.addError(dummyTest, throwable);
- }
-
- public void addFailure(Test subtest, AssertionFailedError assertionFailedError)
- {
- Test dummyTest = createDummyTest(subtest);
- result.addFailure(dummyTest, assertionFailedError);
- }
-
- public void endTest(Test subtest)
- {
- Test dummyTest = createDummyTest(subtest);
- result.endTest(dummyTest);
- }
-
- public void startTest(Test subtest)
- {
- Test dummyTest = createDummyTest(subtest);
- result.startTest(dummyTest);
- }
- });
- testcase.run(subResult);
- }
-
- Test testcase;
- }
-
-
-
-
-
- public static junit.framework.Test suite() throws Exception
- {
- TestSuite suite = new TestSuite();
-
- // suite.addTest(new TestProxy(TopicConnectionTest.suite(),TopicConnectionTest.class.getName())); -- This test is flawed... as getClientID is considered a JMS operation
- suite.addTest(new TestProxy(ConnectionTest.suite(), ConnectionTest.class.getName()));
- suite.addTest(new TestProxy(MessageBodyTest.suite(), MessageBodyTest.class.getName()));
- suite.addTest(new TestProxy(MessageDefaultTest.suite(), MessageDefaultTest.class.getName()));
- suite.addTest(new TestProxy(MessageTypeTest.suite(), MessageTypeTest.class.getName()));
- suite.addTest(new TestProxy(MessageHeaderTest.suite(), MessageHeaderTest.class.getName()));
- suite.addTest(new TestProxy(JMSXPropertyTest.suite(), JMSXPropertyTest.class.getName()));
- suite.addTest(new TestProxy(MessagePropertyConversionTest.suite(), MessagePropertyConversionTest.class.getName()));
- suite.addTest(new TestProxy(MessagePropertyTest.suite(), MessagePropertyTest.class.getName()));
- suite.addTest(new TestProxy(QueueBrowserTest.suite(), QueueBrowserTest.class.getName()));
- suite.addTest(new TestProxy(TemporaryQueueTest.suite(), TemporaryQueueTest.class.getName()));
- suite.addTest(new TestProxy(SelectorSyntaxTest.suite(), SelectorSyntaxTest.class.getName()));
- suite.addTest(new TestProxy(SelectorTest.suite(), SelectorTest.class.getName()));
- suite.addTest(new TestProxy(QueueSessionTest.suite(), QueueSessionTest.class.getName()));
- suite.addTest(new TestProxy(SessionTest.suite(), SessionTest.class.getName()));
- suite.addTest(new TestProxy(TopicSessionTest.suite(), TopicSessionTest.class.getName()));
- suite.addTest(new TestProxy(UnifiedSessionTest.suite(), UnifiedSessionTest.class.getName()));
- suite.addTest(new TestProxy(TemporaryTopicTest.suite(), TemporaryTopicTest.class.getName()));
-
- // Create an initializer for the test suite
- Test wrapper = new JBossTestSetup(suite)
- {
- protected void setUp() throws Exception
- {
- super.setUp();
- // Push the jbm provider props to the system props
- Properties props = JMSTestCase.getProviderProperties();
- Iterator iter = props.keySet().iterator();
- while( iter.hasNext() )
- {
- String key = (String) iter.next();
- String value = props.getProperty(key);
- System.setProperty(key, value);
- }
- }
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
- };
-
- return wrapper;
- }
-
- public static void main(String[] args)
- {
- }
-} // SecurityTest
More information about the jboss-cvs-commits
mailing list