JBoss Portal SVN: r11795 - in branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core: model/portal and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-09-03 08:15:06 -0400 (Wed, 03 Sep 2008)
New Revision: 11795
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/portal/AbstractPortalObjectContainer.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/PortalObjectContainer.java
Log:
- Added getObject(id, expectedClass) method for convenience.
Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/portal/AbstractPortalObjectContainer.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/portal/AbstractPortalObjectContainer.java 2008-09-03 09:46:26 UTC (rev 11794)
+++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/portal/AbstractPortalObjectContainer.java 2008-09-03 12:15:06 UTC (rev 11795)
@@ -22,6 +22,7 @@
******************************************************************************/
package org.jboss.portal.core.impl.model.portal;
+import org.jboss.portal.common.util.ParameterValidation;
import org.jboss.portal.core.model.content.ContentType;
import org.jboss.portal.core.model.content.spi.ContentProvider;
import org.jboss.portal.core.model.content.spi.ContentProviderRegistry;
@@ -82,14 +83,25 @@
public PortalObject getObject(PortalObjectId id) throws IllegalArgumentException
{
- if (id == null)
- {
- throw new IllegalArgumentException("No null id accepted");
- }
+ ParameterValidation.throwIllegalArgExceptionIfNull(id, "id");
ObjectNode node = getObjectNode(id);
return node == null ? null : node.getObject();
}
+ public <T extends PortalObject> T getObject(PortalObjectId id, Class<T> expectedType) throws IllegalArgumentException
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(expectedType, "expected type");
+ PortalObject object = getObject(id);
+
+ // only return the object if it matches the expected class
+ if(expectedType.isInstance(object))
+ {
+ return expectedType.cast(object);
+ }
+
+ return null;
+ }
+
public Context getContext(String namespace)
{
if (namespace == null)
Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/PortalObjectContainer.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/PortalObjectContainer.java 2008-09-03 09:46:26 UTC (rev 11794)
+++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/PortalObjectContainer.java 2008-09-03 12:15:06 UTC (rev 11795)
@@ -42,6 +42,19 @@
PortalObject getObject(PortalObjectId id) throws IllegalArgumentException;
/**
+ * Returns the portal object of the specified type identified with the specified identified or <code>null</code> if
+ * it cannot be found.
+ *
+ * @param id the portal object identifier
+ * @param expectedType the expected type of the object to be retrieved
+ * @param <T> a class extending PortalObject
+ * @return the PortalObject identified by the specified id or <code>null</code> if it cannot be found
+ * @throws IllegalArgumentException if the specified id or the specified class is <code>null</code>
+ * @since 2.7
+ */
+ <T extends PortalObject> T getObject(PortalObjectId id, Class<T> expectedType) throws IllegalArgumentException;
+
+ /**
* Returns the default root object.
*
* @return a root object
17 years, 8 months
JBoss Portal SVN: r11794 - in branches/JBoss_Portal_Branch_2_7/cms: src/main/org/jboss/portal/test/cms/security and 1 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-09-03 05:46:26 -0400 (Wed, 03 Sep 2008)
New Revision: 11794
Added:
branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/test/cms/security/DummyCommand.java
branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/test/cms/security/TestACLEnforcer.java
branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/test/cms/security/TestAuthorizationManagerImpl.java
branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/test/cms/security/TestNewReadCommand.java
branches/JBoss_Portal_Branch_2_7/cms/src/resources/portal-cms-jar/org/jboss/portal/cms/jboss-beans-security-test.xml
Modified:
branches/JBoss_Portal_Branch_2_7/cms/build.xml
Log:
Added TestCase for extending the CMS with new secured commands
Modified: branches/JBoss_Portal_Branch_2_7/cms/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/cms/build.xml 2008-09-03 09:03:36 UTC (rev 11793)
+++ branches/JBoss_Portal_Branch_2_7/cms/build.xml 2008-09-03 09:46:26 UTC (rev 11794)
@@ -418,6 +418,7 @@
<test todir="${test.reports}" name="org.jboss.portal.test.cms.security.TestReadAccess"/>
<test todir="${test.reports}" name="org.jboss.portal.test.cms.security.TestWriteAccess"/>
<test todir="${test.reports}" name="org.jboss.portal.test.cms.security.TestManageAccess"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.cms.security.TestNewReadCommand"/>
<test todir="${test.reports}" name="org.jboss.portal.test.cms.workflow.TestApprovedPublish"/>
<test todir="${test.reports}" name="org.jboss.portal.test.cms.workflow.TestDeniedPublish"/>
Copied: branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/test/cms/security/DummyCommand.java (from rev 11793, branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/security/DummyCommand.java)
===================================================================
--- branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/test/cms/security/DummyCommand.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/test/cms/security/DummyCommand.java 2008-09-03 09:46:26 UTC (rev 11794)
@@ -0,0 +1,50 @@
+/******************************************************************************
+ * 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.cms.security;
+
+import org.jboss.portal.cms.CMSException;
+import org.jboss.portal.cms.impl.jcr.JCRCommand;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class DummyCommand extends JCRCommand
+{
+ public String path;
+
+ public DummyCommand(String path)
+ {
+ this.path = path;
+ }
+
+ @Override
+ public Object execute() throws CMSException
+ {
+ System.out.println(path);
+ return null;
+ }
+
+
+}
+
Copied: branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/test/cms/security/TestACLEnforcer.java (from rev 11793, branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/security/TestACLEnforcer.java)
===================================================================
--- branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/test/cms/security/TestACLEnforcer.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/test/cms/security/TestACLEnforcer.java 2008-09-03 09:46:26 UTC (rev 11794)
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * 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.cms.security;
+
+import org.jboss.portal.cms.impl.jcr.JCRCommand;
+import org.jboss.portal.cms.impl.jcr.command.ACLEnforcer;
+import org.jboss.portal.cms.security.AuthorizationManager;
+import org.jboss.portal.identity.User;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class TestACLEnforcer extends ACLEnforcer
+{
+ public TestACLEnforcer(AuthorizationManager authorizationManager)
+ {
+ super(authorizationManager);
+ addACLCommand(Type.READ, DummyCommand.class.getName());
+ }
+
+ protected boolean hasReadAccess(User user, JCRCommand command)
+ {
+ boolean hasReadAccess = super.hasReadAccess(user, command);
+
+ String path = null;
+ if (command instanceof DummyCommand)
+ {
+ path = ((DummyCommand)command).path;
+ }
+
+ if (path != null)
+ {
+ hasReadAccess = this.hasReadAccess(user, path);
+ }
+
+ return hasReadAccess;
+ }
+}
+
Copied: branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/test/cms/security/TestAuthorizationManagerImpl.java (from rev 11793, branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/security/TestAuthorizationManagerImpl.java)
===================================================================
--- branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/test/cms/security/TestAuthorizationManagerImpl.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/test/cms/security/TestAuthorizationManagerImpl.java 2008-09-03 09:46:26 UTC (rev 11794)
@@ -0,0 +1,40 @@
+/******************************************************************************
+ * 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.cms.security;
+
+import org.jboss.portal.cms.security.AuthorizationManagerImpl;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class TestAuthorizationManagerImpl extends AuthorizationManagerImpl
+{
+
+ public void startService() throws Exception
+ {
+ super.startService();
+ setEnforcer(new TestACLEnforcer(this));
+ }
+}
+
Copied: branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/test/cms/security/TestNewReadCommand.java (from rev 11793, branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/security/TestNewReadCommand.java)
===================================================================
--- branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/test/cms/security/TestNewReadCommand.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_7/cms/src/main/org/jboss/portal/test/cms/security/TestNewReadCommand.java 2008-09-03 09:46:26 UTC (rev 11794)
@@ -0,0 +1,197 @@
+/******************************************************************************
+ * 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.cms.security;
+
+import java.util.List;
+import java.util.Locale;
+
+import javax.naming.InitialContext;
+
+import junit.framework.TestSuite;
+
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.Transaction;
+import org.jboss.portal.cms.CMSException;
+import org.jboss.portal.cms.Command;
+import org.jboss.portal.cms.impl.interceptors.ACLInterceptor;
+import org.jboss.portal.cms.impl.jcr.JCRCMS;
+import org.jboss.portal.cms.model.File;
+import org.jboss.portal.cms.model.Folder;
+import org.jboss.portal.cms.security.AuthorizationProviderImpl;
+import org.jboss.portal.common.invocation.Interceptor;
+import org.jboss.portal.identity.IdentityContext;
+import org.jboss.portal.identity.IdentityServiceController;
+import org.jboss.portal.identity.UserModule;
+import org.jboss.portal.server.impl.invocation.JBossInterceptorStack;
+import org.jboss.portal.test.cms.commands.AbstractCommandTestCase;
+import org.jboss.portal.test.cms.commands.CMSInterceptorStackFactory;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class TestNewReadCommand extends AbstractCommandTestCase
+{
+ String rejectFolderPath = "/default/private";
+ String allowedFolderPath = "/default/images";
+ String rejectFilePath = "/default/private/license.html";
+ String allowedFilePath = "/default/images/check.gif";
+
+ /**
+ *
+ */
+ protected UserModule userModule = null;
+
+ /**
+ *
+ */
+ public TestNewReadCommand()
+ {
+ super();
+ }
+
+
+ public static TestSuite suite() throws Exception
+ {
+ return createTestSuite(TestNewReadCommand.class);
+ }
+
+ /**
+ *
+ */
+ public void setUp() throws Exception
+ {
+ //override the configration location to include workflow services
+ this.configuration = "org/jboss/portal/cms/jboss-beans-security-test.xml";
+ super.setUp();
+
+ ACLInterceptor aclInterceptor = this.getACLInterceptor();
+
+ //Setup the interceptor stack
+ CMSInterceptorStackFactory stackFactory = new CMSInterceptorStackFactory();
+ Interceptor[] interceptors = new Interceptor[1];
+ interceptors[0] = aclInterceptor;
+ JBossInterceptorStack stack = new JBossInterceptorStack(interceptors);
+ stackFactory.setInterceptorStack(stack);
+
+ this.service.setStackFactory(stackFactory);
+
+ //Register the IdentityService with the JCR service
+ IdentityServiceController identityService = ((AuthorizationProviderImpl)aclInterceptor.getAuthorizationManager().getProvider()).
+ getIdentityServiceController();
+ this.userModule = (UserModule)identityService.getIdentityContext().getObject(IdentityContext.TYPE_USER_MODULE);
+ }
+
+ /**
+ *
+ */
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ this.userModule = null;
+ }
+
+
+ /** @return */
+ protected ACLInterceptor getACLInterceptor() throws Exception
+ {
+ ACLInterceptor aclInterceptor = (ACLInterceptor)new InitialContext().lookup("java:/portal/cms/ACLInterceptor");
+ return aclInterceptor;
+ }
+
+ /** @param username */
+ protected void runAs(String username) throws Exception
+ {
+ SessionFactory sessionFactory = (SessionFactory)new InitialContext().lookup("java:/SessionFactory");
+ Session session = sessionFactory.openSession();
+ Transaction tx = session.beginTransaction();
+ JCRCMS.getUserInfo().set(this.userModule.findUserByUserName(username));
+ tx.commit();
+ session.close();
+ }
+
+ /**
+ * @param folderPath
+ * @throws CMSException
+ */
+ private void runAccessScenario(String folderPath) throws CMSException
+ {
+ //Get the specified folder
+ Command command = new DummyCommand(folderPath);
+ this.service.execute(command);
+ }
+
+ /** @throws Exception */
+ public void testAnonymous() throws Exception
+ {
+ try
+ {
+ this.runAccessScenario(this.rejectFilePath);
+ assertTrue("Access should not have been granted to" + this.rejectFilePath,
+ false);
+ }
+ catch (CMSException cme)
+ {
+ // assert and make sure access was not granted
+ String cmeMessage = cme.toString();
+ assertTrue(cmeMessage.indexOf("Access to this resource is denied") != -1);
+ }
+
+ try
+ {
+ this.runAccessScenario(this.rejectFolderPath);
+ assertTrue("Access should not have been granted to" + this.rejectFolderPath,
+ false);
+ }
+ catch (CMSException cme)
+ {
+ // assert and make sure access was not granted
+ String cmeMessage = cme.toString();
+ assertTrue(cmeMessage.indexOf("Access to this resource is denied") != -1);
+ }
+
+ try
+ {
+ this.runAccessScenario(this.allowedFilePath);
+ }
+ catch (CMSException cme)
+ {
+ // assert and make sure access was not granted
+ String cmeMessage = cme.toString();
+ assertTrue(cmeMessage.indexOf("Access to this resource is denied") == -1);
+ }
+
+ try
+ {
+ this.runAccessScenario(this.allowedFolderPath);
+ }
+ catch (CMSException cme)
+ {
+ // assert and make sure access was not granted
+ String cmeMessage = cme.toString();
+ assertTrue(cmeMessage.indexOf("Access to this resource is denied") == -1);
+ }
+ }
+}
+
Copied: branches/JBoss_Portal_Branch_2_7/cms/src/resources/portal-cms-jar/org/jboss/portal/cms/jboss-beans-security-test.xml (from rev 11793, branches/JBoss_Portal_Branch_2_6/cms/src/resources/portal-cms-jar/org/jboss/portal/cms/jboss-beans-security-test.xml)
===================================================================
--- branches/JBoss_Portal_Branch_2_7/cms/src/resources/portal-cms-jar/org/jboss/portal/cms/jboss-beans-security-test.xml (rev 0)
+++ branches/JBoss_Portal_Branch_2_7/cms/src/resources/portal-cms-jar/org/jboss/portal/cms/jboss-beans-security-test.xml 2008-09-03 09:46:26 UTC (rev 11794)
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ 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>
+ </bean>
+
+ <bean name="HibernateConfig" class="org.jboss.portal.test.framework.embedded.HibernateSupport$Config">
+ <constructor factoryMethod="getBean">
+ <factory bean="BeanFactory"/>
+ <parameter>HibernateConfig</parameter>
+ </constructor>
+ </bean>
+
+ <bean name="JNDISupport" class="org.jboss.portal.test.framework.embedded.JNDISupport">
+ </bean>
+
+ <bean name="TransactionManagerSupport" class="org.jboss.portal.test.framework.embedded.TransactionManagerSupport">
+ </bean>
+
+ <bean name="ConnectionManagerSupport" class="org.jboss.portal.test.framework.embedded.ConnectionManagerSupport">
+ <property name="transactionManager"><inject bean="TransactionManagerSupport" property="transactionManager"/></property>
+ </bean>
+
+ <bean name="DataSourceSupport" class="org.jboss.portal.test.framework.embedded.DataSourceSupport">
+ <property name="transactionManager"><inject bean="TransactionManagerSupport" property="transactionManager"/></property>
+ <property name="connectionManagerReference"><inject bean="ConnectionManagerSupport"
+ property="connectionManagerReference"/></property>
+ <property name="config"><inject bean="DataSourceConfig"/></property>
+ </bean>
+
+ <bean name="HibernateSupport" class="org.jboss.portal.test.framework.embedded.HibernateSupport">
+ <property name="config"><inject bean="HibernateConfig"/></property>
+ <property name="jNDIName">java:/SessionFactory</property>
+ <property name="mappings">
+ <list elementClass="java.lang.String">
+ <value>domain.hbm.xml</value>
+ <value>domain-identity.hbm.xml</value>
+ </list>
+ </property>
+ </bean>
+
+ <bean name="IdentityServiceController" class="org.jboss.portal.core.identity.service.IdentityServiceControllerImpl">
+ <property name="configFile">db-config.xml</property>
+ <property name="defaultConfigFile">standardidentity-config.xml</property>
+ <property name="registerMBeans">false</property>
+ </bean>
+
+ <bean name="IdentityDataLoader" class="org.jboss.portal.test.cms.security.IdentityDataLoader">
+ <property name="identityServiceController"><inject bean="IdentityServiceController"/></property>
+ <property name="identitySessionFactory">java:/SessionFactory</property>
+ </bean>
+
+ <!-- setup for cms security testing -->
+ <bean name="AuthorizationProvider" class="org.jboss.portal.cms.security.AuthorizationProviderImpl">
+ <property name="identityServiceController"><inject bean="IdentityServiceController"/></property>
+ <property name="cmsRootUserName">admin</property>
+ </bean>
+
+ <bean name="AuthorizationManager" class="org.jboss.portal.test.cms.security.TestAuthorizationManagerImpl">
+ <property name="provider"><inject bean="AuthorizationProvider"/></property>
+ <property name="jNDIName">java:portal/cms/AuthorizationManager</property>
+ </bean>
+
+ <bean name="ACLInterceptor" class="org.jboss.portal.cms.impl.interceptors.ACLInterceptor">
+ <property name="authorizationManager"><inject bean="AuthorizationManager"/></property>
+ <property name="jNDIName">java:/portal/cms/ACLInterceptor</property>
+ <property name="cmsSessionFactory">java:/SessionFactory</property>
+ <property name="identitySessionFactory">java:/SessionFactory</property>
+ <property name="defaultPolicy">
+ <![CDATA[
+ <policy>
+ <!-- permissions on the root cms node -->
+ <criteria name="path" value="/">
+ <permission name="cms" action="read">
+ <role name="Anonymous"/>
+ </permission>
+ <permission name="cms" action="write">
+ <role name="User"/>
+ </permission>
+ <permission name="cms" action="manage">
+ <role name="Admin"/>
+ </permission>
+ </criteria>
+ <!-- permissions on the default cms node -->
+ <criteria name="path" value="/default">
+ <permission name="cms" action="read">
+ <role name="Anonymous"/>
+ </permission>
+ <permission name="cms" action="write">
+ <role name="User"/>
+ </permission>
+ <permission name="cms" action="manage">
+ <role name="Admin"/>
+ </permission>
+ </criteria>
+ <!-- permissions on the private/protected node -->
+ <criteria name="path" value="/default/private">
+ <permission name="cms" action="manage">
+ <role name="Admin"/>
+ </permission>
+ </criteria>
+ <!--
+ permissions on the /default/support.html node used to test atomicity of copy/move operations
+ -->
+ <criteria name="path" value="/default/support.html">
+ <permission name="cms" action="manage">
+ <role name="User"/>
+ </permission>
+ </criteria>
+ </policy>
+ ]]>
+ </property>
+ </bean>
+</deployment>
17 years, 8 months
JBoss Portal SVN: r11793 - in branches/JBoss_Portal_Branch_2_6/cms: src/main/org/jboss/portal/test/cms/security and 1 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-09-03 05:03:36 -0400 (Wed, 03 Sep 2008)
New Revision: 11793
Added:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/security/DummyCommand.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/security/TestACLEnforcer.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/security/TestAuthorizationManagerImpl.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/security/TestNewReadCommand.java
branches/JBoss_Portal_Branch_2_6/cms/src/resources/portal-cms-jar/org/jboss/portal/cms/jboss-beans-security-test.xml
Modified:
branches/JBoss_Portal_Branch_2_6/cms/build.xml
Log:
Added TestCase for extending the CMS with new secured commands
Modified: branches/JBoss_Portal_Branch_2_6/cms/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/build.xml 2008-09-02 22:46:46 UTC (rev 11792)
+++ branches/JBoss_Portal_Branch_2_6/cms/build.xml 2008-09-03 09:03:36 UTC (rev 11793)
@@ -430,6 +430,7 @@
<test todir="${test.reports}" name="org.jboss.portal.test.cms.security.TestReadAccess"/>
<test todir="${test.reports}" name="org.jboss.portal.test.cms.security.TestWriteAccess"/>
<test todir="${test.reports}" name="org.jboss.portal.test.cms.security.TestManageAccess"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.cms.security.TestNewReadCommand"/>
<test todir="${test.reports}" name="org.jboss.portal.test.cms.workflow.TestApprovedPublish"/>
<test todir="${test.reports}" name="org.jboss.portal.test.cms.workflow.TestDeniedPublish"/>
Added: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/security/DummyCommand.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/security/DummyCommand.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/security/DummyCommand.java 2008-09-03 09:03:36 UTC (rev 11793)
@@ -0,0 +1,50 @@
+/******************************************************************************
+ * 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.cms.security;
+
+import org.jboss.portal.cms.CMSException;
+import org.jboss.portal.cms.impl.jcr.JCRCommand;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class DummyCommand extends JCRCommand
+{
+ public String path;
+
+ public DummyCommand(String path)
+ {
+ this.path = path;
+ }
+
+ @Override
+ public Object execute() throws CMSException
+ {
+ System.out.println(path);
+ return null;
+ }
+
+
+}
+
Added: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/security/TestACLEnforcer.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/security/TestACLEnforcer.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/security/TestACLEnforcer.java 2008-09-03 09:03:36 UTC (rev 11793)
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * 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.cms.security;
+
+import org.jboss.portal.cms.impl.jcr.JCRCommand;
+import org.jboss.portal.cms.impl.jcr.command.ACLEnforcer;
+import org.jboss.portal.cms.security.AuthorizationManager;
+import org.jboss.portal.identity.User;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class TestACLEnforcer extends ACLEnforcer
+{
+ public TestACLEnforcer(AuthorizationManager authorizationManager)
+ {
+ super(authorizationManager);
+ addACLCommand(Type.READ, DummyCommand.class.getName());
+ }
+
+ protected boolean hasReadAccess(User user, JCRCommand command)
+ {
+ boolean hasReadAccess = super.hasReadAccess(user, command);
+
+ String path = null;
+ if (command instanceof DummyCommand)
+ {
+ path = ((DummyCommand)command).path;
+ }
+
+ if (path != null)
+ {
+ hasReadAccess = this.hasReadAccess(user, path);
+ }
+
+ return hasReadAccess;
+ }
+}
+
Added: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/security/TestAuthorizationManagerImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/security/TestAuthorizationManagerImpl.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/security/TestAuthorizationManagerImpl.java 2008-09-03 09:03:36 UTC (rev 11793)
@@ -0,0 +1,40 @@
+/******************************************************************************
+ * 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.cms.security;
+
+import org.jboss.portal.cms.security.AuthorizationManagerImpl;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class TestAuthorizationManagerImpl extends AuthorizationManagerImpl
+{
+
+ public void startService() throws Exception
+ {
+ super.startService();
+ setEnforcer(new TestACLEnforcer(this));
+ }
+}
+
Added: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/security/TestNewReadCommand.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/security/TestNewReadCommand.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/security/TestNewReadCommand.java 2008-09-03 09:03:36 UTC (rev 11793)
@@ -0,0 +1,197 @@
+/******************************************************************************
+ * 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.cms.security;
+
+import java.util.List;
+import java.util.Locale;
+
+import javax.naming.InitialContext;
+
+import junit.framework.TestSuite;
+
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.Transaction;
+import org.jboss.portal.cms.CMSException;
+import org.jboss.portal.cms.Command;
+import org.jboss.portal.cms.impl.interceptors.ACLInterceptor;
+import org.jboss.portal.cms.impl.jcr.JCRCMS;
+import org.jboss.portal.cms.model.File;
+import org.jboss.portal.cms.model.Folder;
+import org.jboss.portal.cms.security.AuthorizationProviderImpl;
+import org.jboss.portal.common.invocation.Interceptor;
+import org.jboss.portal.identity.IdentityContext;
+import org.jboss.portal.identity.IdentityServiceController;
+import org.jboss.portal.identity.UserModule;
+import org.jboss.portal.server.impl.invocation.JBossInterceptorStack;
+import org.jboss.portal.test.cms.commands.AbstractCommandTestCase;
+import org.jboss.portal.test.cms.commands.CMSInterceptorStackFactory;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class TestNewReadCommand extends AbstractCommandTestCase
+{
+ String rejectFolderPath = "/default/private";
+ String allowedFolderPath = "/default/images";
+ String rejectFilePath = "/default/private/license.html";
+ String allowedFilePath = "/default/images/check.gif";
+
+ /**
+ *
+ */
+ protected UserModule userModule = null;
+
+ /**
+ *
+ */
+ public TestNewReadCommand()
+ {
+ super();
+ }
+
+
+ public static TestSuite suite() throws Exception
+ {
+ return createTestSuite(TestNewReadCommand.class);
+ }
+
+ /**
+ *
+ */
+ public void setUp() throws Exception
+ {
+ //override the configration location to include workflow services
+ this.configuration = "org/jboss/portal/cms/jboss-beans-security-test.xml";
+ super.setUp();
+
+ ACLInterceptor aclInterceptor = this.getACLInterceptor();
+
+ //Setup the interceptor stack
+ CMSInterceptorStackFactory stackFactory = new CMSInterceptorStackFactory();
+ Interceptor[] interceptors = new Interceptor[1];
+ interceptors[0] = aclInterceptor;
+ JBossInterceptorStack stack = new JBossInterceptorStack(interceptors);
+ stackFactory.setInterceptorStack(stack);
+
+ this.service.setStackFactory(stackFactory);
+
+ //Register the IdentityService with the JCR service
+ IdentityServiceController identityService = ((AuthorizationProviderImpl)aclInterceptor.getAuthorizationManager().getProvider()).
+ getIdentityServiceController();
+ this.userModule = (UserModule)identityService.getIdentityContext().getObject(IdentityContext.TYPE_USER_MODULE);
+ }
+
+ /**
+ *
+ */
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ this.userModule = null;
+ }
+
+
+ /** @return */
+ protected ACLInterceptor getACLInterceptor() throws Exception
+ {
+ ACLInterceptor aclInterceptor = (ACLInterceptor)new InitialContext().lookup("java:/portal/cms/ACLInterceptor");
+ return aclInterceptor;
+ }
+
+ /** @param username */
+ protected void runAs(String username) throws Exception
+ {
+ SessionFactory sessionFactory = (SessionFactory)new InitialContext().lookup("java:/SessionFactory");
+ Session session = sessionFactory.openSession();
+ Transaction tx = session.beginTransaction();
+ JCRCMS.getUserInfo().set(this.userModule.findUserByUserName(username));
+ tx.commit();
+ session.close();
+ }
+
+ /**
+ * @param folderPath
+ * @throws CMSException
+ */
+ private void runAccessScenario(String folderPath) throws CMSException
+ {
+ //Get the specified folder
+ Command command = new DummyCommand(folderPath);
+ this.service.execute(command);
+ }
+
+ /** @throws Exception */
+ public void testAnonymous() throws Exception
+ {
+ try
+ {
+ this.runAccessScenario(this.rejectFilePath);
+ assertTrue("Access should not have been granted to" + this.rejectFilePath,
+ false);
+ }
+ catch (CMSException cme)
+ {
+ // assert and make sure access was not granted
+ String cmeMessage = cme.toString();
+ assertTrue(cmeMessage.indexOf("Access to this resource is denied") != -1);
+ }
+
+ try
+ {
+ this.runAccessScenario(this.rejectFolderPath);
+ assertTrue("Access should not have been granted to" + this.rejectFolderPath,
+ false);
+ }
+ catch (CMSException cme)
+ {
+ // assert and make sure access was not granted
+ String cmeMessage = cme.toString();
+ assertTrue(cmeMessage.indexOf("Access to this resource is denied") != -1);
+ }
+
+ try
+ {
+ this.runAccessScenario(this.allowedFilePath);
+ }
+ catch (CMSException cme)
+ {
+ // assert and make sure access was not granted
+ String cmeMessage = cme.toString();
+ assertTrue(cmeMessage.indexOf("Access to this resource is denied") == -1);
+ }
+
+ try
+ {
+ this.runAccessScenario(this.allowedFolderPath);
+ }
+ catch (CMSException cme)
+ {
+ // assert and make sure access was not granted
+ String cmeMessage = cme.toString();
+ assertTrue(cmeMessage.indexOf("Access to this resource is denied") == -1);
+ }
+ }
+}
+
Added: branches/JBoss_Portal_Branch_2_6/cms/src/resources/portal-cms-jar/org/jboss/portal/cms/jboss-beans-security-test.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/resources/portal-cms-jar/org/jboss/portal/cms/jboss-beans-security-test.xml (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/resources/portal-cms-jar/org/jboss/portal/cms/jboss-beans-security-test.xml 2008-09-03 09:03:36 UTC (rev 11793)
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ 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>
+ </bean>
+
+ <bean name="HibernateConfig" class="org.jboss.portal.test.framework.embedded.HibernateSupport$Config">
+ <constructor factoryMethod="getBean">
+ <factory bean="BeanFactory"/>
+ <parameter>HibernateConfig</parameter>
+ </constructor>
+ </bean>
+
+ <bean name="JNDISupport" class="org.jboss.portal.test.framework.embedded.JNDISupport">
+ </bean>
+
+ <bean name="TransactionManagerSupport" class="org.jboss.portal.test.framework.embedded.TransactionManagerSupport">
+ </bean>
+
+ <bean name="ConnectionManagerSupport" class="org.jboss.portal.test.framework.embedded.ConnectionManagerSupport">
+ <property name="transactionManager"><inject bean="TransactionManagerSupport" property="transactionManager"/></property>
+ </bean>
+
+ <bean name="DataSourceSupport" class="org.jboss.portal.test.framework.embedded.DataSourceSupport">
+ <property name="transactionManager"><inject bean="TransactionManagerSupport" property="transactionManager"/></property>
+ <property name="connectionManagerReference"><inject bean="ConnectionManagerSupport"
+ property="connectionManagerReference"/></property>
+ <property name="config"><inject bean="DataSourceConfig"/></property>
+ </bean>
+
+ <bean name="HibernateSupport" class="org.jboss.portal.test.framework.embedded.HibernateSupport">
+ <property name="config"><inject bean="HibernateConfig"/></property>
+ <property name="jNDIName">java:/SessionFactory</property>
+ <property name="mappings">
+ <list elementClass="java.lang.String">
+ <value>domain.hbm.xml</value>
+ <value>domain-identity.hbm.xml</value>
+ </list>
+ </property>
+ </bean>
+
+ <bean name="IdentityServiceController" class="org.jboss.portal.core.identity.service.IdentityServiceControllerImpl">
+ <property name="configFile">db-config.xml</property>
+ <property name="defaultConfigFile">standardidentity-config.xml</property>
+ <property name="registerMBeans">false</property>
+ </bean>
+
+ <bean name="IdentityDataLoader" class="org.jboss.portal.test.cms.security.IdentityDataLoader">
+ <property name="identityServiceController"><inject bean="IdentityServiceController"/></property>
+ <property name="identitySessionFactory">java:/SessionFactory</property>
+ </bean>
+
+ <!-- setup for cms security testing -->
+ <bean name="AuthorizationProvider" class="org.jboss.portal.cms.security.AuthorizationProviderImpl">
+ <property name="identityServiceController"><inject bean="IdentityServiceController"/></property>
+ <property name="cmsRootUserName">admin</property>
+ </bean>
+
+ <bean name="AuthorizationManager" class="org.jboss.portal.test.cms.security.TestAuthorizationManagerImpl">
+ <property name="provider"><inject bean="AuthorizationProvider"/></property>
+ <property name="jNDIName">java:portal/cms/AuthorizationManager</property>
+ </bean>
+
+ <bean name="ACLInterceptor" class="org.jboss.portal.cms.impl.interceptors.ACLInterceptor">
+ <property name="authorizationManager"><inject bean="AuthorizationManager"/></property>
+ <property name="jNDIName">java:/portal/cms/ACLInterceptor</property>
+ <property name="cmsSessionFactory">java:/SessionFactory</property>
+ <property name="identitySessionFactory">java:/SessionFactory</property>
+ <property name="defaultPolicy">
+ <![CDATA[
+ <policy>
+ <!-- permissions on the root cms node -->
+ <criteria name="path" value="/">
+ <permission name="cms" action="read">
+ <role name="Anonymous"/>
+ </permission>
+ <permission name="cms" action="write">
+ <role name="User"/>
+ </permission>
+ <permission name="cms" action="manage">
+ <role name="Admin"/>
+ </permission>
+ </criteria>
+ <!-- permissions on the default cms node -->
+ <criteria name="path" value="/default">
+ <permission name="cms" action="read">
+ <role name="Anonymous"/>
+ </permission>
+ <permission name="cms" action="write">
+ <role name="User"/>
+ </permission>
+ <permission name="cms" action="manage">
+ <role name="Admin"/>
+ </permission>
+ </criteria>
+ <!-- permissions on the private/protected node -->
+ <criteria name="path" value="/default/private">
+ <permission name="cms" action="manage">
+ <role name="Admin"/>
+ </permission>
+ </criteria>
+ <!--
+ permissions on the /default/support.html node used to test atomicity of copy/move operations
+ -->
+ <criteria name="path" value="/default/support.html">
+ <permission name="cms" action="manage">
+ <role name="User"/>
+ </permission>
+ </criteria>
+ </policy>
+ ]]>
+ </property>
+ </bean>
+</deployment>
Property changes on: branches/JBoss_Portal_Branch_2_6/cms/src/resources/portal-cms-jar/org/jboss/portal/cms/jboss-beans-security-test.xml
___________________________________________________________________
Name: svn:executable
+ *
17 years, 8 months
JBoss Portal SVN: r11792 - branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-09-02 18:46:46 -0400 (Tue, 02 Sep 2008)
New Revision: 11792
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/CoordinationManagerBean.java
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/EventWiringManagerBean.java
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/ParameterBindingManagerBean.java
Log:
- Properly refresh page when needed (except that without working persistence, this is kind of moot right now >_<).
- Fixed ParameterBindingManagerBean.resolveFrom to use the proper separator length.
- Do not recreate EventWiringInfoCreator each time the page is redisplayed.
- Still no idea why persistence isn't working...
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/CoordinationManagerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/CoordinationManagerBean.java 2008-09-02 21:31:05 UTC (rev 11791)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/CoordinationManagerBean.java 2008-09-02 22:46:46 UTC (rev 11792)
@@ -263,6 +263,7 @@
try
{
getCoordinationService().setEventWiringImplicitMode(getSelectedPage(), !usingExplicitEvents);
+ refresh();
}
catch (IllegalCoordinationException e)
{
@@ -287,6 +288,7 @@
try
{
getCoordinationService().setParameterBindingImplicitMode(getSelectedPage(), !usingExplicitParameters);
+ refresh();
}
catch (IllegalCoordinationException e)
{
@@ -469,10 +471,7 @@
try
{
selectedType.bean().delete(selectedName);
-
- // reload data: we need to make sure we select the current page
- pomb.selectObject(selectedObjectId);
- editCoordination();
+ refresh();
}
catch (IllegalCoordinationException e)
{
@@ -486,6 +485,16 @@
return EDIT_COORDINATION;
}
+ /**
+ * Refreshes the page data.
+ */
+ private void refresh()
+ {
+ // need to make sure that POMB has a selection...
+ pomb.selectObject(selectedObjectId);
+ editCoordination();
+ }
+
public void setNewName(String newName)
{
this.newName = newName;
@@ -501,10 +510,7 @@
if (selectedType != null)
{
selectedType.bean().rename(selectedName, newName);
-
- // reload data: we need to make sure we select the current page
- pomb.selectObject(selectedObjectId);
- editCoordination();
+ refresh();
}
// reset selection
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/EventWiringManagerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/EventWiringManagerBean.java 2008-09-02 21:31:05 UTC (rev 11791)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/EventWiringManagerBean.java 2008-09-02 22:46:46 UTC (rev 11792)
@@ -153,7 +153,10 @@
public List<QNameSelectItem> getSourceEvents()
{
// create new wiring
- currentWiring = new EventWiringInfoCreator();
+ if (currentWiring == null)
+ {
+ currentWiring = new EventWiringInfoCreator();
+ }
// return list of produced events
return getPossibleEvents(eventNameToWindowSources);
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/ParameterBindingManagerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/ParameterBindingManagerBean.java 2008-09-02 21:31:05 UTC (rev 11791)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/ParameterBindingManagerBean.java 2008-09-02 22:46:46 UTC (rev 11792)
@@ -287,7 +287,7 @@
{
int separatorIndex = pairAsString.indexOf(SEP);
String name = pairAsString.substring(0, separatorIndex);
- String windowName = pairAsString.substring(separatorIndex + 1);
+ String windowName = pairAsString.substring(separatorIndex + SEP.length());
return new String[] {name, windowName};
}
17 years, 8 months
JBoss Portal SVN: r11791 - in branches/JBoss_Portal_Branch_2_7/core-admin/src: resources/portal-admin-war/WEB-INF/classes and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-09-02 17:31:05 -0400 (Tue, 02 Sep 2008)
New Revision: 11791
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/ParameterBindingManagerBean.java
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties
Log:
- Tweaked display of parameter window pairs.
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/ParameterBindingManagerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/ParameterBindingManagerBean.java 2008-09-02 21:30:19 UTC (rev 11790)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/ParameterBindingManagerBean.java 2008-09-02 21:31:05 UTC (rev 11791)
@@ -244,6 +244,7 @@
private QName name;
public static final int PARAM_NAME = 0;
public static final int WINDOW_NAME = 1;
+ private static final String SEP = " <-> ";
public ParameterWindowPair(ParameterInfo info, Window window)
{
@@ -268,7 +269,7 @@
public String getSeparator()
{
- return ":";
+ return SEP;
}
@Override
@@ -279,12 +280,12 @@
static String asString(QName qname, Window window)
{
- return qname + ":" + window.getName();
+ return qname + SEP + window.getName();
}
public static String[] resolveFrom(String pairAsString)
{
- int separatorIndex = pairAsString.indexOf(':');
+ int separatorIndex = pairAsString.indexOf(SEP);
String name = pairAsString.substring(0, separatorIndex);
String windowName = pairAsString.substring(separatorIndex + 1);
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties 2008-09-02 21:30:19 UTC (rev 11790)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties 2008-09-02 21:31:05 UTC (rev 11791)
@@ -274,7 +274,7 @@
COORDINATION_PARAMETER_MANAGE_EXISTING=Manage existing parameter bindings:
COORDINATION_PARAMETER_EXISTING_NONE=No existing parameter bindings.
COORDINATION_PARAMETER_EXISTING_NAME=Name
-COORDINATION_PARAMETER_EXISTING_PAIRS=Parameter:window pairs
+COORDINATION_PARAMETER_EXISTING_PAIRS=Parameter <-> window pairs
COORDINATION_PARAMETER_EXISTING_ACTIONS=Actions
COORDINATION_PARAMETER_CREATE=Create new parameter binding:
COORDINATION_PARAMETER_CREATE_NO_PAIRS=No available public render parameters. Cannot create new parameter bindings.
17 years, 8 months
JBoss Portal SVN: r11790 - in branches/JBoss_Portal_Branch_2_7/core-admin/src: resources/portal-admin-war/WEB-INF and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-09-02 17:30:19 -0400 (Tue, 02 Sep 2008)
New Revision: 11790
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/CoordinationManagerBean.java
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
Log:
- Fixed issue with page reloading.
- More documentation.
- Re-organized faces-config.xml somewhat.
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/CoordinationManagerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/CoordinationManagerBean.java 2008-09-02 21:27:13 UTC (rev 11789)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/CoordinationManagerBean.java 2008-09-02 21:30:19 UTC (rev 11790)
@@ -181,7 +181,7 @@
selectedPage = (Page)portalObject;
//perform surgery on portalobjectmanager
- pomb.selectObject(pomb.getPortalObjectContainer().getObject(selectedPage.getId()));
+ pomb.selectObject(selectedPage.getId());
return selectedPage;
}
@@ -306,7 +306,7 @@
aliasManager = replaceInSession("aliasManager", new AliasBindingManagerBean(this));
eventManager = replaceInSession("eventManager", new EventWiringManagerBean(this));
parameterManager = replaceInSession("parameterManager", new ParameterBindingManagerBean(this));
-
+
// Extract metadata only on window children and only if needed
if (isExplicitEventsUsed() || isExplicitParametersUsed())
{
@@ -381,11 +381,15 @@
}
/**
- *
- * @param beanName
- * @param newBean
- * @param <T>
- * @return
+ * Replaces the bean identified by the given name by the specified new one. Passing <code>null</code> for the new
+ * bean value will remove the bean reference from the session. If a bean was previously assigned to this name, then
+ * only a bean of the same type (as defined by {@link Class#isAssignableFrom(Class)}) can be assigned to this name.
+ * todo: JSF COMMON
+ *
+ * @param beanName the name identifying the bean to be replaced
+ * @param newBean the new value for the bean to be replaced or <code>null</code> if the bean is to be removed
+ * @param <T> the type of the given bean
+ * @return the new value for the bean or <code>null</code> if the remove semantics was used
*/
<T> T replaceInSession(String beanName, T newBean)
{
@@ -393,7 +397,7 @@
Map<String, Object> sessionMap = getFacesSessionMap();
// if we passed null, use the remove semantics
- if(newBean == null)
+ if (newBean == null)
{
sessionMap.remove(beanName);
return null;
@@ -415,7 +419,7 @@
* todo: JSF COMMON
*
* @param name name of the parameter which value we want to retrieve
- * @return
+ * @return
*/
public String getFacesParam(String name)
{
@@ -465,6 +469,9 @@
try
{
selectedType.bean().delete(selectedName);
+
+ // reload data: we need to make sure we select the current page
+ pomb.selectObject(selectedObjectId);
editCoordination();
}
catch (IllegalCoordinationException e)
@@ -494,6 +501,9 @@
if (selectedType != null)
{
selectedType.bean().rename(selectedName, newName);
+
+ // reload data: we need to make sure we select the current page
+ pomb.selectObject(selectedObjectId);
editCoordination();
}
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2008-09-02 21:27:13 UTC (rev 11789)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2008-09-02 21:30:19 UTC (rev 11790)
@@ -344,28 +344,6 @@
</managed-bean>
<managed-bean>
- <managed-bean-name>coordinationManager</managed-bean-name>
- <managed-bean-class>org.jboss.portal.core.admin.ui.coordination.CoordinationManagerBean</managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
- <managed-property>
- <property-name>pomb</property-name>
- <value>#{portalobjectmgr}</value>
- </managed-property>
- <managed-property>
- <property-name>eventManager</property-name>
- <value>#{eventManager}</value>
- </managed-property>
- <managed-property>
- <property-name>parameterManager</property-name>
- <value>#{parameterManager}</value>
- </managed-property>
- <managed-property>
- <property-name>aliasManager</property-name>
- <value>#{aliasManager}</value>
- </managed-property>
- </managed-bean>
-
- <managed-bean>
<managed-bean-name>renameDashboardPageAction</managed-bean-name>
<managed-bean-class>org.jboss.portal.core.admin.ui.actions.RenameAction</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
@@ -420,7 +398,31 @@
<value>org.jboss.portal.core.admin.ui.ControlPropertiesBean</value>
</managed-property>
</managed-bean>
+
+
+ <!-- Coordination -->
<managed-bean>
+ <managed-bean-name>coordinationManager</managed-bean-name>
+ <managed-bean-class>org.jboss.portal.core.admin.ui.coordination.CoordinationManagerBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>pomb</property-name>
+ <value>#{portalobjectmgr}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>eventManager</property-name>
+ <value>#{eventManager}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>parameterManager</property-name>
+ <value>#{parameterManager}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>aliasManager</property-name>
+ <value>#{aliasManager}</value>
+ </managed-property>
+ </managed-bean>
+ <managed-bean>
<managed-bean-name>eventManager</managed-bean-name>
<managed-bean-class>org.jboss.portal.core.admin.ui.coordination.EventWiringManagerBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
17 years, 8 months
JBoss Portal SVN: r11789 - branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-09-02 17:27:13 -0400 (Tue, 02 Sep 2008)
New Revision: 11789
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/AliasBindingManagerBean.java
Log:
- rename was not retrieving the proper object.
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/AliasBindingManagerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/AliasBindingManagerBean.java 2008-09-02 21:24:58 UTC (rev 11788)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/AliasBindingManagerBean.java 2008-09-02 21:27:13 UTC (rev 11789)
@@ -165,7 +165,7 @@
public String rename(String oldName, String newName) throws IllegalCoordinationException
{
- DisplayAliasBinding binding = displayAliasBindings.get(newName);
+ DisplayAliasBinding binding = displayAliasBindings.get(oldName);
if (binding != null)
{
AliasBindingInfo alias = binding.getAlias();
17 years, 8 months
JBoss Portal SVN: r11788 - branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-09-02 17:24:58 -0400 (Tue, 02 Sep 2008)
New Revision: 11788
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
Log:
- Improved getSelectedPortalObjectId to be more useful.
- Made selectObject(PortalObjectId) public.
- Generification.
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2008-09-02 18:55:16 UTC (rev 11787)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2008-09-02 21:24:58 UTC (rev 11788)
@@ -67,7 +67,6 @@
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -192,12 +191,12 @@
public List getAvailableContentTypes()
{
- LinkedList types = new LinkedList();
+ LinkedList<SelectItem> types = new LinkedList<SelectItem>();
//
- for (Iterator i = ContentProviderRegistryService.getInstance().getContentTypes().iterator(); i.hasNext();)
+ for (Object o : ContentProviderRegistryService.getInstance().getContentTypes())
{
- ContentType contentType = (ContentType)i.next();
+ ContentType contentType = (ContentType)o;
SelectItem item = new SelectItem();
item.setValue(contentType);
item.setLabel(contentType.toString());
@@ -434,7 +433,7 @@
}
}
- private void selectObject(PortalObjectId id)
+ public void selectObject(PortalObjectId id)
{
if (id == null)
{
@@ -510,7 +509,7 @@
PortalObjectId poid = getSelectedPortalObjectId();
Map<String, String> pmap = getRequestParameterMap();
- maximizedStateExists = Boolean.valueOf((String)pmap.get("maximizedStateExists"));
+ maximizedStateExists = Boolean.valueOf(pmap.get("maximizedStateExists"));
PortalObject object = portalObjectContainer.getObject(poid);
@@ -563,17 +562,24 @@
{
// Get id
Map<String, String> pmap = getRequestParameterMap();
- String id = (String)pmap.get("id");
+ String id = pmap.get("id");
- // Set the state from the id
- return PortalObjectId.parse(id, PortalObjectPath.LEGACY_BASE64_FORMAT);
+ // set the state from the id
+ PortalObjectId portalObjectId = null;
+ if(id != null)
+ {
+ portalObjectId = PortalObjectId.parse(id, PortalObjectPath.LEGACY_BASE64_FORMAT);
+ }
+ selectObject(portalObjectId);
+
+ return selectedId;
}
public void selectPlugin()
{
// Get plugin
Map<String, String> pmap = getRequestParameterMap();
- selectedPlugin = (String)pmap.get("plugin");
+ selectedPlugin = pmap.get("plugin");
}
public Map<String, String> getRequestParameterMap()
@@ -689,32 +695,29 @@
theme = new ThemeBean(selectedObject);
//
- Collection portals = getSelectedObject().getChildren(PortalObject.PORTAL_MASK);
- ArrayList portalList = new ArrayList(portals.size() + 1);
- for (Iterator iterator = portals.iterator(); iterator.hasNext();)
+ Collection<PortalObject> portals = getSelectedObject().getChildren(PortalObject.PORTAL_MASK);
+ ArrayList<SelectItem> portalList = new ArrayList<SelectItem>(portals.size() + 1);
+ for (PortalObject portal : portals)
{
- PortalObject o = (PortalObject)iterator.next();
- SelectItem item = new SelectItem(o.getName());
- portalList.add(item);
+ portalList.add(new SelectItem(portal.getName()));
}
portalList.add(new SelectItem("", "no selection"));
- portalItems = (SelectItem[])portalList.toArray(new SelectItem[portalList.size()]);
+ portalItems = portalList.toArray(new SelectItem[portalList.size()]);
//
- Collection pages = getSelectedObject().getChildren(PortalObject.PAGE_MASK);
- ArrayList list = new ArrayList(pages.size() + 1);
- for (Iterator iterator = pages.iterator(); iterator.hasNext();)
+ Collection<PortalObject> pages = getSelectedObject().getChildren(PortalObject.PAGE_MASK);
+ ArrayList<SelectItem> list = new ArrayList<SelectItem>(pages.size() + 1);
+ for (PortalObject page : pages)
{
- PortalObject o = (PortalObject)iterator.next();
- SelectItem item = new SelectItem(o.getName());
+ SelectItem item = new SelectItem(page.getName());
list.add(item);
}
list.add(new SelectItem("", "no selection"));
- portalPageItems = (SelectItem[])list.toArray(new SelectItem[list.size()]);
+ portalPageItems = list.toArray(new SelectItem[list.size()]);
//
PortalObject o = getSelectedObject();
- ArrayList path = new ArrayList();
+ ArrayList<PortalObject> path = new ArrayList<PortalObject>();
while (o != null)
{
path.add(o);
@@ -723,7 +726,7 @@
Collections.reverse(path);
selectedObjectPath = path;
- //
+ // rather dirty code...
List tmp = new ArrayList(instanceContainer.getDefinitions());
Collections.sort(tmp, InstanceManagerBean.INSTANCE_COMPARATOR);
for (int i = 0; i < tmp.size(); i++)
@@ -925,9 +928,9 @@
int i = 1;
ResourceBundle rb = ResourceBundle.getBundle("Resource", FacesContext.getCurrentInstance().getExternalContext().getRequestLocale());
result[0] = new SelectItem("", rb.getString("NO_BOUND_LISTENER"));
- for (Iterator idsIt = ids.iterator(); idsIt.hasNext();)
+ for (Object id : ids)
{
- result[i++] = new SelectItem(idsIt.next());
+ result[i++] = new SelectItem(id);
}
return result;
17 years, 8 months
JBoss Portal SVN: r11787 - in modules/cms/trunk: cms-jackrabbit and 1 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-09-02 14:55:16 -0400 (Tue, 02 Sep 2008)
New Revision: 11787
Modified:
modules/cms/trunk/build/pom.xml
modules/cms/trunk/cms-jackrabbit/installLocalDependencies.sh
modules/cms/trunk/cms-jackrabbit/pom.xml
modules/cms/trunk/cms-jackrabbit/src/test/resources/jboss-beans-workflow.xml
modules/cms/trunk/cms-jackrabbit/src/test/resources/jbpm-hibernate.cfg.xml
Log:
Removed some dependencies
Modified: modules/cms/trunk/build/pom.xml
===================================================================
--- modules/cms/trunk/build/pom.xml 2008-09-02 15:04:18 UTC (rev 11786)
+++ modules/cms/trunk/build/pom.xml 2008-09-02 18:55:16 UTC (rev 11787)
@@ -32,8 +32,10 @@
<version.jboss.cache>1.4.1.SP3</version.jboss.cache>
<version.jgroups>2.4.1</version.jgroups>
<version.jboss.hibernate>3.2.4.SP1</version.jboss.hibernate>
- <version.jboss.logging>2.0.2.GA</version.jboss.logging>
- <version.jboss.jbossas.core-libs>4.0.4.GA</version.jboss.jbossas.core-libs>
+ <version.jbpm>3.2.2</version.jbpm>
+ <version.jboss.jbossas>4.2.2.GA</version.jboss.jbossas>
+ <version.jboss.jdbc-wrapper>4.0.4.GA</version.jboss.jdbc-wrapper>
+ <version.jboss.logging>2.0.2.GA</version.jboss.logging>
<version.dom4j>1.6.1</version.dom4j>
<version.cglib>2.1_3</version.cglib>
<version.hsqldb>1.8.0.2</version.hsqldb>
@@ -209,6 +211,11 @@
<version>${version.dom4j}</version>
</dependency>
<dependency>
+ <groupId>org.jbpm</groupId>
+ <artifactId>jbpm-jpdl</artifactId>
+ <version>${version.jbpm}</version>
+ </dependency>
+ <dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>${version.cglib}</version>
@@ -239,14 +246,34 @@
<version>${version.ehcache}</version>
</dependency>
<dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-system</artifactId>
+ <version>${version.jboss.jbossas}</version>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jbossha</artifactId>
+ <version>${version.jboss.jbossas}</version>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss</artifactId>
+ <version>${version.jboss.jbossas}</version>
+ </dependency>
+ <dependency>
<groupId>jboss.jbossas.core-libs</groupId>
<artifactId>jboss-local-jdbc</artifactId>
- <version>${version.jboss.jbossas.core-libs}</version>
+ <version>${version.jboss.jbossas}</version>
</dependency>
<dependency>
<groupId>jboss.jbossas.core-libs</groupId>
+ <artifactId>jboss-local-jdbc</artifactId>
+ <version>${version.jboss.jbossas}</version>
+ </dependency>
+ <dependency>
+ <groupId>jboss.jbossas.core-libs</groupId>
<artifactId>jboss-common-jdbc-wrapper</artifactId>
- <version>${version.jboss.jbossas.core-libs}</version>
+ <version>${version.jboss.jdbc-wrapper}</version>
</dependency>
</dependencies>
</dependencyManagement>
Modified: modules/cms/trunk/cms-jackrabbit/installLocalDependencies.sh
===================================================================
--- modules/cms/trunk/cms-jackrabbit/installLocalDependencies.sh 2008-09-02 15:04:18 UTC (rev 11786)
+++ modules/cms/trunk/cms-jackrabbit/installLocalDependencies.sh 2008-09-02 18:55:16 UTC (rev 11787)
@@ -4,24 +4,4 @@
mvn install:install-file -DgroupId=local -DartifactId=portal-security-lib -Dversion=2.7 -Dpackaging=jar -Dfile=local/jboss-portal/2.7/portal-security-lib.jar
mvn install:install-file -DgroupId=local -DartifactId=portal-server-lib -Dversion=2.7 -Dpackaging=jar -Dfile=local/jboss-portal/2.7/portal-server-lib.jar
mvn install:install-file -DgroupId=local -DartifactId=portal-workflow-lib -Dversion=2.7 -Dpackaging=jar -Dfile=local/jboss-portal/2.7/portal-workflow-lib.jar
-mvn install:install-file -DgroupId=local -DartifactId=portal-test-generic-lib -Dversion=2.7 -Dpackaging=jar -Dfile=local/jboss-portal/2.7/portal-test-generic-lib.jar
-mvn install:install-file -DgroupId=local -DartifactId=portal-test-jboss-lib -Dversion=2.7 -Dpackaging=jar -Dfile=local/jboss-portal/2.7/portal-test-jboss-lib.jar
-mvn install:install-file -DgroupId=local -DartifactId=portal-test-lib -Dversion=2.7 -Dpackaging=jar -Dfile=local/jboss-portal/2.7/portal-test-lib.jar
-mvn install:install-file -DgroupId=local -DartifactId=jbpm-identity -Dversion=3.2.GA -Dpackaging=jar -Dfile=local/jbpm/3.2.GA/jbpm-identity.jar
-mvn install:install-file -DgroupId=local -DartifactId=jbpm-jpdl -Dversion=3.2.GA -Dpackaging=jar -Dfile=local/jbpm/3.2.GA/jbpm-jpdl.jar
-
-mvn install:install-file -DgroupId=local -DartifactId=jboss -Dversion=4.0.4.GA -Dpackaging=jar -Dfile=local/jboss.jar
-mvn install:install-file -DgroupId=local -DartifactId=jboss-common -Dversion=4.0.4.GA -Dpackaging=jar -Dfile=local/jboss-common.jar
-mvn install:install-file -DgroupId=local -DartifactId=jboss-common-jdbc-wrapper -Dversion=4.0.4.GA -Dpackaging=jar -Dfile=local/jboss-common-jdbc-wrapper.jar
-mvn install:install-file -DgroupId=local -DartifactId=jboss-container -Dversion=4.0.4.GA -Dpackaging=jar -Dfile=local/jboss-container.jar
-mvn install:install-file -DgroupId=local -DartifactId=jboss-dependency -Dversion=4.0.4.GA -Dpackaging=jar -Dfile=local/jboss-dependency.jar
-mvn install:install-file -DgroupId=local -DartifactId=jbossha -Dversion=4.0.4.GA -Dpackaging=jar -Dfile=local/jbossha.jar
-mvn install:install-file -DgroupId=local -DartifactId=jboss-jca -Dversion=4.0.4.GA -Dpackaging=jar -Dfile=local/jboss-jca.jar
-mvn install:install-file -DgroupId=local -DartifactId=jboss-local-jdbc -Dversion=4.0.4.GA -Dpackaging=jar -Dfile=local/jboss-local-jdbc.jar
-mvn install:install-file -DgroupId=local -DartifactId=jboss-microcontainer -Dversion=4.0.4.GA -Dpackaging=jar -Dfile=local/jboss-microcontainer.jar
-mvn install:install-file -DgroupId=local -DartifactId=jboss-system -Dversion=4.0.4.GA -Dpackaging=jar -Dfile=local/jboss-system.jar
-mvn install:install-file -DgroupId=local -DartifactId=jboss-transaction -Dversion=4.0.4.GA -Dpackaging=jar -Dfile=local/jboss-transaction.jar
-mvn install:install-file -DgroupId=local -DartifactId=jboss-xml-binding -Dversion=4.0.4.GA -Dpackaging=jar -Dfile=local/jboss-xml-binding.jar
-mvn install:install-file -DgroupId=local -DartifactId=jnp-client -Dversion=4.0.4.GA -Dpackaging=jar -Dfile=local/jnp-client.jar
-mvn install:install-file -DgroupId=local -DartifactId=jnpserver -Dversion=4.0.4.GA -Dpackaging=jar -Dfile=local/jnpserver.jar
Modified: modules/cms/trunk/cms-jackrabbit/pom.xml
===================================================================
--- modules/cms/trunk/cms-jackrabbit/pom.xml 2008-09-02 15:04:18 UTC (rev 11786)
+++ modules/cms/trunk/cms-jackrabbit/pom.xml 2008-09-02 18:55:16 UTC (rev 11787)
@@ -1,5 +1,6 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.jboss.portal.cms</groupId>
<artifactId>module-parent</artifactId>
@@ -10,82 +11,73 @@
<artifactId>cms-jackrabbit</artifactId>
<packaging>jar</packaging>
<name>JBoss Portal CMS based on JackRabbit 1.4</name>
-
+
<!--
- Deals with dependencies not yet found in remote maven repositories
- TODO: need to clean/sort this out. For now use the installLocalDependencies.sh script
+ Deals with dependencies not yet found in remote maven repositories
+ TODO: need to clean/sort this out. For now use the installLocalDependencies.sh script
-->
<properties>
- <local.version.jboss.portal>2.7</local.version.jboss.portal>
- <local.version.jbpm>3.2.GA</local.version.jbpm>
- <local.version.jboss.as>4.0.4.GA</local.version.jboss.as>
+ <local.version.jboss.portal>2.7</local.version.jboss.portal>
</properties>
<dependencies>
<dependency>
- <groupId>javax.jcr</groupId>
- <artifactId>jcr</artifactId>
+ <groupId>javax.jcr</groupId>
+ <artifactId>jcr</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.jackrabbit</groupId>
- <artifactId>jackrabbit-core</artifactId>
+ <groupId>org.apache.jackrabbit</groupId>
+ <artifactId>jackrabbit-core</artifactId>
</dependency>
-
<dependency>
- <groupId>org.jboss.cache</groupId>
- <artifactId>jbosscache-core</artifactId>
- </dependency>
- <dependency>
- <groupId>jgroups</groupId>
- <artifactId>jgroups</artifactId>
- </dependency>
-
- <dependency>
- <groupId>hibernate</groupId>
- <artifactId>hibernate3</artifactId>
- </dependency>
-
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.portal.common</groupId>
- <artifactId>common-common</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.portal.identity</groupId>
- <artifactId>identity-identity</artifactId>
- </dependency>
-
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-logging-jdk</artifactId>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-logging-log4j</artifactId>
- </dependency>
-
-
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-core</artifactId>
+ </dependency>
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
+ <groupId>jgroups</groupId>
+ <artifactId>jgroups</artifactId>
</dependency>
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
+ <groupId>hibernate</groupId>
+ <artifactId>hibernate3</artifactId>
</dependency>
- <dependency>
- <groupId>apache-log4j</groupId>
- <artifactId>log4j</artifactId>
- </dependency>
-
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.portal.common</groupId>
+ <artifactId>common-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.portal.identity</groupId>
+ <artifactId>identity-identity</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-logging-jdk</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-logging-log4j</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>apache-log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+
<!-- local dependencies -->
<dependency>
<groupId>local</groupId>
@@ -112,36 +104,25 @@
<artifactId>portal-server-lib</artifactId>
<version>${local.version.jboss.portal}</version>
</dependency>
-
<dependency>
- <groupId>local</groupId>
- <artifactId>jbpm-identity</artifactId>
- <version>${local.version.jbpm}</version>
- </dependency>
- <dependency>
- <groupId>local</groupId>
+ <groupId>org.jbpm</groupId>
<artifactId>jbpm-jpdl</artifactId>
- <version>${local.version.jbpm}</version>
</dependency>
-
<dependency>
- <groupId>local</groupId>
+ <groupId>jboss</groupId>
<artifactId>jboss-system</artifactId>
- <version>${local.version.jboss.as}</version>
</dependency>
<dependency>
- <groupId>local</groupId>
+ <groupId>jboss</groupId>
+ <artifactId>jbossha</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
<artifactId>jboss</artifactId>
- <version>${local.version.jboss.as}</version>
</dependency>
+
+ <!--TEST SCOPE-->
<dependency>
- <groupId>local</groupId>
- <artifactId>jbossha</artifactId>
- <version>${local.version.jboss.as}</version>
- </dependency>
-
- <!--TEST SCOPE-->
- <dependency>
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-unit</artifactId>
<scope>test</scope>
@@ -168,48 +149,46 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- <scope>test</scope>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <scope>test</scope>
</dependency>
- <dependency>
- <groupId>jboss.jbossas.core-libs</groupId>
- <artifactId>jboss-local-jdbc</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>jboss.jbossas.core-libs</groupId>
- <artifactId>jboss-common-jdbc-wrapper</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>cglib</groupId>
- <artifactId>cglib</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
- <groupId>bsh</groupId>
- <artifactId>bsh</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>antlr</groupId>
- <artifactId>antlr</artifactId>
- <scope>test</scope>
- </dependency>
+ <groupId>jboss.jbossas.core-libs</groupId>
+ <artifactId>jboss-local-jdbc</artifactId>
+ <scope>test</scope>
+ </dependency>
<dependency>
- <groupId>net.sf.ehcache</groupId>
- <artifactId>ehcache</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
+ <groupId>jboss.jbossas.core-libs</groupId>
+ <artifactId>jboss-common-jdbc-wrapper</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>bsh</groupId>
+ <artifactId>bsh</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>antlr</groupId>
+ <artifactId>antlr</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.ehcache</groupId>
+ <artifactId>ehcache</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>local</groupId>
<artifactId>portal-core-lib</artifactId>
<version>${local.version.jboss.portal}</version>
- <scope>test</scope>
+ <scope>test</scope>
</dependency>
-
-
</dependencies>
<build>
@@ -238,13 +217,15 @@
<configuration>
<tasks>
- <property name="compile_classpath" refid="maven.compile.classpath"/>
- <property name="runtime_classpath" refid="maven.runtime.classpath"/>
- <property name="test_classpath" refid="maven.test.classpath"/>
- <property name="plugin_classpath" refid="maven.plugin.classpath"/>
+ <property name="compile_classpath"
+ refid="maven.compile.classpath" />
+ <property name="runtime_classpath"
+ refid="maven.runtime.classpath" />
+ <property name="test_classpath" refid="maven.test.classpath" />
+ <property name="plugin_classpath" refid="maven.plugin.classpath" />
<ant antfile="${basedir}/build.xml">
- <target name="test"/>
+ <target name="test" />
</ant>
</tasks>
@@ -255,50 +236,50 @@
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>testSuiteCleanupBeforeCompile</id>
- <phase>compile</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <delete dir="repotest"/>
- <delete dir="repotest-hsqldb"/>
- <delete file="test.properties"/>
- <delete file="test.script"/>
- </tasks>
- </configuration>
- </execution>
- <execution>
- <id>testCleanupAfterTest</id>
- <phase>test</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <delete dir="repotest"/>
- <delete dir="repotest-hsqldb"/>
- <delete file="test.properties"/>
- <delete file="test.script"/>
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <compilerArgument>-nowarn</compilerArgument>
- </configuration>
- </plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>testSuiteCleanupBeforeCompile</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <delete dir="repotest" />
+ <delete dir="repotest-hsqldb" />
+ <delete file="test.properties" />
+ <delete file="test.script" />
+ </tasks>
+ </configuration>
+ </execution>
+ <execution>
+ <id>testCleanupAfterTest</id>
+ <phase>test</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <delete dir="repotest" />
+ <delete dir="repotest-hsqldb" />
+ <delete file="test.properties" />
+ <delete file="test.script" />
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <compilerArgument>-nowarn</compilerArgument>
+ </configuration>
+ </plugin>
</plugins>
- </build>
- </project>
+ </build>
+</project>
Modified: modules/cms/trunk/cms-jackrabbit/src/test/resources/jboss-beans-workflow.xml
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/resources/jboss-beans-workflow.xml 2008-09-02 15:04:18 UTC (rev 11786)
+++ modules/cms/trunk/cms-jackrabbit/src/test/resources/jboss-beans-workflow.xml 2008-09-02 18:55:16 UTC (rev 11787)
@@ -65,9 +65,11 @@
<value>domain.hbm.xml</value>
<value>domain-identity.hbm.xml</value>
<value>org/jbpm/graph/action/Script.hbm.xml</value>
+<!--
<value>org/jbpm/identity/User.hbm.xml</value>
<value>org/jbpm/identity/Group.hbm.xml</value>
<value>org/jbpm/identity/Membership.hbm.xml</value>
+ -->
<value>org/jbpm/db/hibernate.queries.hbm.xml</value>
<value>org/jbpm/graph/action/MailAction.hbm.xml</value>
<value>org/jbpm/graph/def/ProcessDefinition.hbm.xml</value>
Modified: modules/cms/trunk/cms-jackrabbit/src/test/resources/jbpm-hibernate.cfg.xml
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/resources/jbpm-hibernate.cfg.xml 2008-09-02 15:04:18 UTC (rev 11786)
+++ modules/cms/trunk/cms-jackrabbit/src/test/resources/jbpm-hibernate.cfg.xml 2008-09-02 18:55:16 UTC (rev 11787)
@@ -43,10 +43,12 @@
<!-- Uncomment the following 3 lines if you -->
<!-- want to use the jBPM identity mgmgt -->
<!-- component. -->
- <!-- identity mappings (begin) -->
+ <!-- identity mappings (begin) -->
+ <!--
<mapping resource="org/jbpm/identity/User.hbm.xml"/>
<mapping resource="org/jbpm/identity/Group.hbm.xml"/>
- <mapping resource="org/jbpm/identity/Membership.hbm.xml"/>
+ <mapping resource="org/jbpm/identity/Membership.hbm.xml"/>
+ -->
<!-- identity mappings (end) -->
<!-- following mapping files have a dependendy on -->
17 years, 8 months
JBoss Portal SVN: r11786 - in modules/cms/trunk: .settings and 7 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-09-02 11:04:18 -0400 (Tue, 02 Sep 2008)
New Revision: 11786
Added:
modules/cms/trunk/.settings/
modules/cms/trunk/.settings/org.eclipse.jdt.ui.prefs
modules/cms/trunk/.settings/org.maven.ide.eclipse.prefs
modules/cms/trunk/cms-jackrabbit/build.xml
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/TestServiceLoader.java
modules/cms/trunk/cms-jackrabbit/src/test/resources/jboss-unit.xml
Modified:
modules/cms/trunk/.classpath
modules/cms/trunk/.project
modules/cms/trunk/build/pom.xml
modules/cms/trunk/cms-jackrabbit/pom.xml
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/AbstractCMSTestCase.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/TestJackrabbit.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/TestRegEx.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/TestRepositoryUtil.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/AbstractCommandTestCase.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileArchiveUpload.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileCopy.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileCreate.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileCreateFailed.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileDelete.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileGet.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileGetList.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileGetVersion.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileSize.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileUpdate.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFolderCopy.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFolderCreate.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFolderDelete.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFolderGet.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFolderUpdate.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestRepositoryBootStrap.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestSearch.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/security/SecureCommandTestCase.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/security/TestManageAccess.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/security/TestReadAccess.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/security/TestWriteAccess.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/workflow/AbstractWorkflowTestCase.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/workflow/TestApprovedPublish.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/workflow/TestDeniedPublish.java
modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/workflow/TestWorkflowEnvironment.java
modules/cms/trunk/cms-jackrabbit/src/test/resources/jboss-beans-security.xml
modules/cms/trunk/cms-jackrabbit/src/test/resources/jboss-beans-workflow.xml
modules/cms/trunk/cms-jackrabbit/src/test/resources/jboss-beans.xml
modules/cms/trunk/cms-jackrabbit/src/test/resources/standardidentity-config.xml
Log:
Use JBoss Unit (removes some dependencies, more to do)
Modified: modules/cms/trunk/.classpath
===================================================================
--- modules/cms/trunk/.classpath 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/.classpath 2008-09-02 15:04:18 UTC (rev 11786)
@@ -1,67 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="cms-jackrabbit/src/main/java"/>
- <classpathentry kind="src" path="cms-jackrabbit/src/test/java"/>
+ <classpathentry kind="src" output="cms-jackrabbit/target/classes" path="cms-jackrabbit/src/main/java"/>
+ <classpathentry kind="src" output="cms-jackrabbit/target/test-classes" path="cms-jackrabbit/src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="cms-jackrabbit/target/classes" path="cms-jackrabbit/src/main/resources"/>
+ <classpathentry excluding="**" kind="src" output="cms-jackrabbit/target/test-classes" path="cms-jackrabbit/src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-
- <classpathentry kind="var" path="M2_REPO/javax/activation/activation/1.1/activation-1.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/ant/ant/1.6.5/ant-1.6.5.jar"/>
- <classpathentry kind="var" path="M2_REPO/ant/ant-junit/1.6.5/ant-junit-1.6.5.jar"/>
- <classpathentry kind="var" path="M2_REPO/ant/ant-launcher/1.6.5/ant-launcher-1.6.5.jar"/>
- <classpathentry kind="var" path="M2_REPO/ant/ant-nodeps/1.6.5/ant-nodeps-1.6.5.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/codehaus/cargo/cargo-core-uberjar/0.8/cargo-core-uberjar-0.8.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/portal/common/common-common/1.2.0-SNAPSHOT/common-common-1.2.0-SNAPSHOT.jar"/>
- <classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.2/commons-codec-1.2.jar"/>
- <classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/3.1/commons-collections-3.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.jar"/>
- <classpathentry kind="var" path="M2_REPO/commons-httpclient/commons-httpclient/3.0.1/commons-httpclient-3.0.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar"/>
- <classpathentry kind="var" path="M2_REPO/concurrent/concurrent/1.3.4/concurrent-1.3.4.jar"/>
- <classpathentry kind="var" path="M2_REPO/oswego-concurrent/concurrent/1.3.4/concurrent-1.3.4.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/derby/derby/10.2.1.6/derby-10.2.1.6.jar"/>
- <classpathentry kind="var" path="M2_REPO/hibernate/hibernate3/3.2.4.SP1/hibernate3-3.2.4.SP1.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/portal/identity/identity-identity/1.0.2/identity-identity-1.0.2.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/jackrabbit/jackrabbit-api/1.4/jackrabbit-api-1.4.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/jackrabbit/jackrabbit-core/1.4.5/jackrabbit-core-1.4.5.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/jackrabbit/jackrabbit-jcr-commons/1.4/jackrabbit-jcr-commons-1.4.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/jackrabbit/jackrabbit-spi/1.4/jackrabbit-spi-1.4.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/jackrabbit/jackrabbit-spi-commons/1.4/jackrabbit-spi-commons-1.4.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/jackrabbit/jackrabbit-text-extractors/1.4/jackrabbit-text-extractors-1.4.jar"/>
- <classpathentry kind="var" path="M2_REPO/local/jboss/4.0.4.GA/jboss-4.0.4.GA.jar"/>
- <classpathentry kind="var" path="M2_REPO/jboss/jboss-common-core/2.0.2.GA/jboss-common-core-2.0.2.GA.jar"/>
- <classpathentry kind="var" path="M2_REPO/jboss/jboss-j2ee/4.2.0.GA/jboss-j2ee-4.2.0.GA.jar"/>
- <classpathentry kind="var" path="M2_REPO/jboss/jboss-jmx/4.2.0.GA/jboss-jmx-4.2.0.GA.jar"/>
- <classpathentry kind="var" path="M2_REPO/jboss/jboss-logging-jdk/2.0.2.GA/jboss-logging-jdk-2.0.2.GA.jar"/>
- <classpathentry kind="var" path="M2_REPO/jboss/jboss-logging-log4j/2.0.2.GA/jboss-logging-log4j-2.0.2.GA.jar"/>
- <classpathentry kind="var" path="M2_REPO/jboss/jboss-logging-spi/2.0.2.GA/jboss-logging-spi-2.0.2.GA.jar"/>
- <classpathentry kind="var" path="M2_REPO/local/jboss-system/4.0.4.GA/jboss-system-4.0.4.GA.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/cache/jbosscache-core/1.4.1.SP3/jbosscache-core-1.4.1.SP3.jar"/>
- <classpathentry kind="var" path="M2_REPO/local/jbossha/4.0.4.GA/jbossha-4.0.4.GA.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jbpm/jbpm-jpdl/3.2.3/jbpm-jpdl-3.2.3.jar"/>
- <classpathentry kind="var" path="M2_REPO/javax/jcr/jcr/1.0/jcr-1.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/jgroups/jgroups/2.4.1/jgroups-2.4.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.2/junit-3.8.2.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/lucene/lucene-core/2.2.0/lucene-core-2.2.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/nekohtml/nekohtml/0.9.4/nekohtml-0.9.4.jar"/>
- <classpathentry kind="var" path="M2_REPO/pdfbox/pdfbox/0.6.4/pdfbox-0.6.4.jar"/>
- <classpathentry kind="var" path="M2_REPO/poi/poi/2.5.1-final-20040804/poi-2.5.1-final-20040804.jar"/>
- <classpathentry kind="var" path="M2_REPO/local/portal-jems-lib/2.7/portal-jems-lib-2.7.jar"/>
- <classpathentry kind="var" path="M2_REPO/local/portal-search-lib/2.7/portal-search-lib-2.7.jar"/>
- <classpathentry kind="var" path="M2_REPO/local/portal-security-lib/2.7/portal-security-lib-2.7.jar"/>
- <classpathentry kind="var" path="M2_REPO/local/portal-server-lib/2.7/portal-server-lib-2.7.jar"/>
- <classpathentry kind="var" path="M2_REPO/local/portal-test-generic-lib/2.7/portal-test-generic-lib-2.7.jar"/>
- <classpathentry kind="var" path="M2_REPO/local/portal-test-jboss-lib/2.7/portal-test-jboss-lib-2.7.jar"/>
- <classpathentry kind="var" path="M2_REPO/local/portal-test-lib/2.7/portal-test-lib-2.7.jar"/>
- <classpathentry kind="var" path="M2_REPO/local/portal-workflow-lib/2.7/portal-workflow-lib-2.7.jar"/>
- <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.3.0/slf4j-api-1.3.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-simple/1.3.0/slf4j-simple-1.3.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/textmining/tm-extractors/0.4/tm-extractors-0.4.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-slide/webdavlib/2.0/webdavlib-2.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/xerces/xercesImpl/2.8.1/xercesImpl-2.8.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-xerces/xml-apis/2.7.1/xml-apis-2.7.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/1.3.03/xml-apis-1.3.03.jar"/>
- <classpathentry kind="var" path="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
</classpath>
Modified: modules/cms/trunk/.project
===================================================================
--- modules/cms/trunk/.project 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/.project 2008-09-02 15:04:18 UTC (rev 11786)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>module-cms-trunk</name>
+ <name>module-cms</name>
<comment></comment>
<projects>
</projects>
@@ -10,8 +10,14 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
</natures>
</projectDescription>
Added: modules/cms/trunk/.settings/org.eclipse.jdt.ui.prefs
===================================================================
--- modules/cms/trunk/.settings/org.eclipse.jdt.ui.prefs (rev 0)
+++ modules/cms/trunk/.settings/org.eclipse.jdt.ui.prefs 2008-09-02 15:04:18 UTC (rev 11786)
@@ -0,0 +1,3 @@
+#Mon Sep 01 19:39:51 CEST 2008
+eclipse.preferences.version=1
+internal.default.compliance=user
Added: modules/cms/trunk/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- modules/cms/trunk/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ modules/cms/trunk/.settings/org.maven.ide.eclipse.prefs 2008-09-02 15:04:18 UTC (rev 11786)
@@ -0,0 +1,8 @@
+#Mon Sep 01 19:37:03 CEST 2008
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=true
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+version=1
Modified: modules/cms/trunk/build/pom.xml
===================================================================
--- modules/cms/trunk/build/pom.xml 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/build/pom.xml 2008-09-02 15:04:18 UTC (rev 11786)
@@ -33,6 +33,7 @@
<version.jgroups>2.4.1</version.jgroups>
<version.jboss.hibernate>3.2.4.SP1</version.jboss.hibernate>
<version.jboss.logging>2.0.2.GA</version.jboss.logging>
+ <version.jboss.jbossas.core-libs>4.0.4.GA</version.jboss.jbossas.core-libs>
<version.dom4j>1.6.1</version.dom4j>
<version.cglib>2.1_3</version.cglib>
<version.hsqldb>1.8.0.2</version.hsqldb>
@@ -46,6 +47,7 @@
<version.jboss.portal.common>1.2.0</version.jboss.portal.common>
<version.jboss.portal.identity>1.0.2</version.jboss.portal.identity>
+ <version.jboss.portal.test>1.2.0.Beta2</version.jboss.portal.test>
</properties>
@@ -100,6 +102,37 @@
<dependencyManagement>
<dependencies>
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>jboss-unit</artifactId>
+ <version>${version.jboss.portal.test}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>opends</artifactId>
+ <version>${version.jboss.portal.test}</version>
+ <type>sar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>jboss-unit-mc</artifactId>
+ <version>${version.jboss.portal.test}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>portal-test</artifactId>
+ <version>${version.jboss.portal.test}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>jboss-unit-tooling-maven2</artifactId>
+ <version>${version.jboss.portal.test}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>jboss-unit-tooling-ant</artifactId>
+ <version>${version.jboss.portal.test}</version>
+ </dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
@@ -205,6 +238,16 @@
<artifactId>ehcache</artifactId>
<version>${version.ehcache}</version>
</dependency>
+ <dependency>
+ <groupId>jboss.jbossas.core-libs</groupId>
+ <artifactId>jboss-local-jdbc</artifactId>
+ <version>${version.jboss.jbossas.core-libs}</version>
+ </dependency>
+ <dependency>
+ <groupId>jboss.jbossas.core-libs</groupId>
+ <artifactId>jboss-common-jdbc-wrapper</artifactId>
+ <version>${version.jboss.jbossas.core-libs}</version>
+ </dependency>
</dependencies>
</dependencyManagement>
Added: modules/cms/trunk/cms-jackrabbit/build.xml
===================================================================
--- modules/cms/trunk/cms-jackrabbit/build.xml (rev 0)
+++ modules/cms/trunk/cms-jackrabbit/build.xml 2008-09-02 15:04:18 UTC (rev 11786)
@@ -0,0 +1,44 @@
+<?xml version="1.0"?>
+<project name="cms-test" xmlns:artifact="urn:maven-artifact-ant">
+
+ <target name="test" unless="maven.test.skip">
+
+ <!--<echo message="compile classpath: ${compile_classpath}"/>-->
+ <!--<echo message="runtime classpath: ${runtime_classpath}"/>-->
+ <!--<echo message="test classpath: ${test_classpath}"/>-->
+ <!--<echo message="plugin classpath: ${plugin_classpath}"/>-->
+
+ <property name="target" value="${basedir}/target"/>
+
+ <property name="jboss-unit" value="${target}/jboss-unit"/>
+
+
+ <mkdir dir="${jboss-unit}"/>
+
+ <ant>
+ <target name="jboss-unit"/>
+ </ant>
+ </target>
+
+ <target name="jboss-unit">
+ <taskdef name="jboss-unit" classname="org.jboss.unit.tooling.ant.JBossUnitTask" classpath="${test_classpath}"/>
+ <jboss-unit>
+ <tests config="src/test/resources/jboss-unit.xml" suiteName="CMSTests">
+ <!--<include keywords="DB,generic"/>-->
+ </tests>
+
+ <reports>
+ <xml toDir="target/jboss-unit/reports/xml"/>
+ <html toDir="target/jboss-unit/reports/html"/>
+ </reports>
+
+ <classpath>
+ <pathelement path="${test_classpath}"/>
+ </classpath>
+
+ </jboss-unit>
+
+ </target>
+
+
+</project>
\ No newline at end of file
Modified: modules/cms/trunk/cms-jackrabbit/pom.xml
===================================================================
--- modules/cms/trunk/cms-jackrabbit/pom.xml 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/pom.xml 2008-09-02 15:04:18 UTC (rev 11786)
@@ -112,26 +112,6 @@
<artifactId>portal-server-lib</artifactId>
<version>${local.version.jboss.portal}</version>
</dependency>
- <dependency>
- <groupId>local</groupId>
- <artifactId>portal-test-lib</artifactId>
- <version>${local.version.jboss.portal}</version>
- </dependency>
- <dependency>
- <groupId>local</groupId>
- <artifactId>portal-test-generic-lib</artifactId>
- <version>${local.version.jboss.portal}</version>
- </dependency>
- <dependency>
- <groupId>local</groupId>
- <artifactId>portal-test-jboss-lib</artifactId>
- <version>${local.version.jboss.portal}</version>
- </dependency>
- <dependency>
- <groupId>local</groupId>
- <artifactId>portal-core-lib</artifactId>
- <version>${local.version.jboss.portal}</version>
- </dependency>
<dependency>
<groupId>local</groupId>
@@ -159,113 +139,122 @@
<artifactId>jbossha</artifactId>
<version>${local.version.jboss.as}</version>
</dependency>
- <!-- test dependencies -->
+
+ <!--TEST SCOPE-->
<dependency>
- <groupId>local</groupId>
- <artifactId>jboss-microcontainer</artifactId>
- <version>${local.version.jboss.as}</version>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>jboss-unit</artifactId>
<scope>test</scope>
- </dependency>
- <dependency>
- <groupId>local</groupId>
- <artifactId>jboss-container</artifactId>
- <version>${local.version.jboss.as}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>local</groupId>
- <artifactId>jboss-dependency</artifactId>
- <version>${local.version.jboss.as}</version>
- <scope>test</scope>
</dependency>
<dependency>
- <groupId>local</groupId>
- <artifactId>jboss-common</artifactId>
- <version>${local.version.jboss.as}</version>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>opends</artifactId>
+ <type>sar</type>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>local</groupId>
- <artifactId>jboss-xml-binding</artifactId>
- <version>${local.version.jboss.as}</version>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>jboss-unit-mc</artifactId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>local</groupId>
- <artifactId>jnp-client</artifactId>
- <version>${local.version.jboss.as}</version>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>jboss-unit-tooling-ant</artifactId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>local</groupId>
- <artifactId>jnpserver</artifactId>
- <version>${local.version.jboss.as}</version>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>portal-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>local</groupId>
- <artifactId>jboss-transaction</artifactId>
- <version>${local.version.jboss.as}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>local</groupId>
- <artifactId>jboss-jca</artifactId>
- <version>${local.version.jboss.as}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>local</groupId>
- <artifactId>jboss-local-jdbc</artifactId>
- <version>${local.version.jboss.as}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>local</groupId>
- <artifactId>jboss-common-jdbc-wrapper</artifactId>
- <version>${local.version.jboss.as}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>dom4j</groupId>
- <artifactId>dom4j</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>cglib</groupId>
- <artifactId>cglib</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>antlr</groupId>
- <artifactId>antlr</artifactId>
+ <dependency>
+ <groupId>jboss.jbossas.core-libs</groupId>
+ <artifactId>jboss-local-jdbc</artifactId>
<scope>test</scope>
- </dependency>
+ </dependency>
+ <dependency>
+ <groupId>jboss.jbossas.core-libs</groupId>
+ <artifactId>jboss-common-jdbc-wrapper</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib</artifactId>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>bsh</groupId>
<artifactId>bsh</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>antlr</groupId>
+ <artifactId>antlr</artifactId>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>local</groupId>
+ <artifactId>portal-core-lib</artifactId>
+ <version>${local.version.jboss.portal}</version>
+ <scope>test</scope>
+ </dependency>
+
+
</dependencies>
<build>
<plugins>
+ <plugin>
+ <groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
+ <artifactId>maven-antrun-extended-plugin</artifactId>
+ <version>1.13</version>
+ <dependencies>
+ <dependency>
+ <groupId>cargo</groupId>
+ <artifactId>cargo-ant</artifactId>
+ <version>0.9-portal</version>
+ </dependency>
+ <dependency>
+ <groupId>cargo</groupId>
+ <artifactId>cargo-core-uberjar</artifactId>
+ <version>0.9-portal</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>test</id>
+ <phase>test</phase>
+ <configuration>
+ <tasks>
+
+ <property name="compile_classpath" refid="maven.compile.classpath"/>
+ <property name="runtime_classpath" refid="maven.runtime.classpath"/>
+ <property name="test_classpath" refid="maven.test.classpath"/>
+ <property name="plugin_classpath" refid="maven.plugin.classpath"/>
+
+ <ant antfile="${basedir}/build.xml">
+ <target name="test"/>
+ </ant>
+
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
@@ -302,21 +291,6 @@
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skip>false</skip>
- <excludes>
- <exclude>**/TestFileCreateFailed$1TestCommand.java</exclude>
- </excludes>
- <!--
- <includes>
- <include>**/TestSearch.java</include>
- </includes>
- -->
- </configuration>
- </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
@@ -326,5 +300,5 @@
</plugin>
</plugins>
</build>
-</project>
+ </project>
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/AbstractCMSTestCase.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/AbstractCMSTestCase.java 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/AbstractCMSTestCase.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -22,83 +22,72 @@
******************************************************************************/
package org.jboss.portal.cms.test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.jboss.portal.test.framework.embedded.DataSourceSupport;
+import org.jboss.beans.metadata.api.annotations.Inject;
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.jboss.portal.test.framework.mc.TestRuntimeContext;
+import org.jboss.unit.api.pojo.annotations.Parameter;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Collection;
-
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @version $Revision: 7954 $
*/
-public abstract class AbstractCMSTestCase extends TestCase
+public abstract class AbstractCMSTestCase
{
- /** . */
- protected DataSourceSupport.Config dataSourceConfigParameter;
+ private String dataSourceName;
- /** . */
- protected TestRuntimeContext runtimeContext;
+ private String hibernateConfig;
- /**
- *
- *
- */
- protected String configuration = "jboss-beans.xml";
+ private HibernateSupport hibernateSupport;
+ private String datasources;
+
public AbstractCMSTestCase()
{
}
- public DataSourceSupport.Config getDataSourceConfigParameter()
+ public String getDataSourceName()
{
- return dataSourceConfigParameter;
+ return dataSourceName;
}
- public void setDataSourceConfigParameter(DataSourceSupport.Config dataSourceConfigParameter)
+ @Parameter(name="dataSourceName")
+ public void setDataSourceName(String dataSourceName)
{
- this.dataSourceConfigParameter = dataSourceConfigParameter;
+ this.dataSourceName = dataSourceName;
}
- public void setUp() throws Exception
+ public String getHibernateConfig()
{
- URL configsURL = Thread.currentThread().getContextClassLoader().getResource("datasources.xml");
- Collection dataSourceConfigs = (Collection)DataSourceSupport.Config.fromXML2(configsURL).get();
- this.dataSourceConfigParameter = (DataSourceSupport.Config)dataSourceConfigs.iterator().next();
-
- //Bootstrapping low-level services needed by PortalCMS
- runtimeContext = new TestRuntimeContext(this.configuration);
- runtimeContext.addBean("DataSourceConfig", dataSourceConfigParameter);
- runtimeContext.addBean("HibernateConfig", HibernateSupport.getConfig(dataSourceConfigParameter.getName()));
-
- //Start the context
- runtimeContext.start();
+ return hibernateConfig;
}
- public void tearDown() throws Exception
+ @Parameter(name="hibernateConfig")
+ public void setHibernateConfig(String hibernateConfig)
{
- runtimeContext.stop();
+ this.hibernateConfig = hibernateConfig;
}
+
+ @Parameter(name="datasources")
+ public void setDatasources(String datasources)
+ {
+ this.datasources = datasources;
+ }
+
+ public String getDatasources()
+ {
+ return datasources;
+ }
+
+ @Inject(bean="HibernateSupport")
+ public void setHibernateSupport(HibernateSupport support)
+ {
+ hibernateSupport = support;
+ }
- public static TestSuite createTestSuite(Class clazz) throws Exception
+ public HibernateSupport getHibernateSupport()
{
- 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;
+ return hibernateSupport;
}
+
}
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/TestJackrabbit.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/TestJackrabbit.java 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/TestJackrabbit.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -32,6 +32,11 @@
import org.jboss.portal.cms.impl.jcr.jackrabbit.JackrabbitJCRService;
import org.jboss.portal.cms.util.RepositoryUtil;
+import org.jboss.unit.api.pojo.annotations.Create;
+import org.jboss.unit.api.pojo.annotations.Destroy;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+import static org.jboss.unit.api.Assert.*;
import javax.jcr.Node;
import javax.jcr.Repository;
@@ -39,10 +44,13 @@
import javax.jcr.Workspace;
import javax.jcr.nodetype.NodeTypeManager;
+
+
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 6653 $
*/
+@Bootstrap(beanName = "TestCase", resourceName = "/jboss-beans.xml")
public class TestJackrabbit extends AbstractCMSTestCase
{
@@ -52,10 +60,9 @@
private JackrabbitJCRService jcr;
+ @Create
public void setUp() throws Exception
{
- super.setUp();
-
// Load config
LoaderResource res = new CLResourceLoader().getResource("jcr/repository.xml");
String config = res.asString();
@@ -67,13 +74,14 @@
jcr.start();
}
+ @Destroy
public void tearDown() throws Exception
{
jcr.stop();
jcr = null;
- super.tearDown();
}
+ @Test
public void testRepository() throws Exception
{
Repository repo = jcr.getRepository();
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/TestRegEx.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/TestRegEx.java 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/TestRegEx.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -22,8 +22,9 @@
******************************************************************************/
package org.jboss.portal.cms.test;
-import junit.framework.TestCase;
import org.jboss.portal.cms.util.FileUtil;
+import org.jboss.unit.api.pojo.annotations.Test;
+import static org.jboss.unit.api.Assert.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;
@@ -35,7 +36,7 @@
*
* @author <a href="mailto:roy@jboss.org">Roy Russo</a>
*/
-public class TestRegEx extends TestCase
+public class TestRegEx
{
String HTMLHeaderFile = "jcr/headerpage.html";
@@ -69,16 +70,12 @@
private static final Pattern STRIP_TAGS_PATTERN = Pattern.compile(HTMLStripperRegex, Pattern.DOTALL | Pattern.CASE_INSENSITIVE);
- public void setUp() throws Exception
- {
- super.setUp();
- }
-
/**
* Tests HTML rewriting of header content and links in CMSPortlet.
*
* @throws Exception
*/
+ @Test
public void testHTMLPageHeaderRewrite() throws Exception
{
String fileHTML = "";
@@ -134,11 +131,6 @@
assertEquals("RegEx failed to match!", CleanHTML, goodHTML);
}
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
/** Faking it. */
private String buildURL(String path)
{
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/TestRepositoryUtil.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/TestRepositoryUtil.java 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/TestRepositoryUtil.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -23,7 +23,11 @@
package org.jboss.portal.cms.test;
import org.jboss.portal.cms.util.NodeUtil;
+import org.jboss.unit.api.pojo.annotations.Test;
+import static org.jboss.unit.api.Assert.*;
+
+
/**
* Tests RepositoryUtil
*
@@ -31,6 +35,7 @@
*/
public class TestRepositoryUtil extends AbstractCMSTestCase
{
+ @Test
public void testGetParentPath()
{
try
@@ -52,6 +57,7 @@
}
}
+ @Test
public void testGetNodeName()
{
try
@@ -76,14 +82,4 @@
{
}
- public void setUp() throws Exception
- {
- super.setUp();
- }
-
- public void tearDown() throws Exception
- {
- super.tearDown();
-
- }
}
\ No newline at end of file
Added: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/TestServiceLoader.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/TestServiceLoader.java (rev 0)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/TestServiceLoader.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -0,0 +1,214 @@
+/*
+* 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.cms.test;
+
+import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.portal.identity.DelegatingUserProfileModuleImpl;
+import org.jboss.portal.identity.IdentityContext;
+import org.jboss.portal.identity.IdentityContextImpl;
+import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.MembershipModule;
+import org.jboss.portal.identity.RoleModule;
+import org.jboss.portal.identity.UserModule;
+import org.jboss.portal.identity.UserProfileModule;
+import org.jboss.portal.identity.boot.IdentityServiceLoader;
+import org.jboss.portal.identity.event.IdentityEvent;
+import org.jboss.portal.identity.event.IdentityEventBroadcaster;
+import org.jboss.portal.identity.ldap.LDAPConnectionContext;
+import org.jboss.portal.identity.ldap.LDAPMembershipModule;
+import org.jboss.portal.identity.ldap.LDAPRoleModule;
+import org.jboss.portal.identity.ldap.LDAPUserModule;
+import org.jboss.portal.identity.ldap.LDAPUserProfileModuleImpl;
+import org.jboss.portal.identity.metadata.service.IdentityServicesMetaData;
+import org.jboss.portal.identity.service.IdentityConfigurationService;
+import org.jboss.portal.identity.service.MembershipModuleService;
+import org.jboss.portal.identity.service.RoleModuleService;
+import org.jboss.portal.identity.service.UserModuleService;
+import org.jboss.portal.test.framework.embedded.DSConfig;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 0.1 $
+ */
+public class TestServiceLoader
+{
+
+ 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, identityConfig);
+
+ IdentityContext identityContext = bootstrapIdentityContext(kernel);
+
+ // IdentityEventBroadcaster
+ IdentityEventBroadcaster broadcaster = new IdentityEventBroadcaster()
+ {
+ public void fireEvent(IdentityEvent event)
+ {
+ // Noop
+ }
+ };
+
+ //
+ try
+ {
+ identityContext.register(broadcaster, IdentityContext.TYPE_IDENTITY_EVENT_BROADCASTER);
+ }
+ catch (Throwable throwable)
+ {
+ throw new IdentityException("Unable to install IdentityEventBroadcaster", throwable);
+ }
+
+ //inject configuration service
+ IdentityConfigurationService configuration = servicesMetaData.getConfigurationService();
+ configuration.setIdentityContext(identityContext);
+ //TODO:set proper jndiName and serviceName and JNDI binder
+ configuration.start();
+
+ IdentityServiceLoader serviceLoader = new IdentityServiceLoader(identityContext, kernel, false);
+
+ // process datasources and modules
+ serviceLoader.bootstrapDatasource(servicesMetaData.getDatasourceServices().getDatasourcesList());
+
+ LDAPConnectionContext connectionContext = null;
+
+
+ try
+ {
+ connectionContext = (LDAPConnectionContext)identityContext.getObject(IdentityContext.TYPE_CONNECTION_CONTEXT);
+ }
+ catch (IdentityException e)
+ {
+ //
+ }
+
+ serviceLoader.bootstrapModules(servicesMetaData.getModuleServices().getModulesList());
+
+ UserModule userModule = (UserModuleService)identityContext.getObject(IdentityContext.TYPE_USER_MODULE);
+ RoleModule roleModule = (RoleModuleService)identityContext.getObject(IdentityContext.TYPE_ROLE_MODULE);
+ MembershipModule membershipModule = (MembershipModuleService)identityContext.getObject(IdentityContext.TYPE_MEMBERSHIP_MODULE);
+
+
+ if (userModule instanceof LDAPUserModule)
+ {
+ ((LDAPUserModule)userModule).setConnectionContext(connectionContext);
+ }
+ if (roleModule instanceof LDAPRoleModule)
+ {
+ ((LDAPRoleModule)roleModule).setConnectionContext(connectionContext);
+ }
+ if (membershipModule instanceof LDAPMembershipModule)
+ {
+ ((LDAPMembershipModule)membershipModule).setConnectionContext(connectionContext);
+ }
+
+ //inject delegating profile modules if present
+ UserProfileModule userProfileModule = (UserProfileModule)identityContext.getObject(IdentityContext.TYPE_USER_PROFILE_MODULE);
+
+ if (userProfileModule != null && userProfileModule instanceof DelegatingUserProfileModuleImpl)
+ {
+ DelegatingUserProfileModuleImpl delegatingModule = (DelegatingUserProfileModuleImpl)userProfileModule;
+
+
+ try {
+
+
+ UserProfileModule dbModule = (UserProfileModule)identityContext.getObject("DBDelegateUserProfile");
+ if (dbModule != null)
+ {
+ delegatingModule.setDbModule(dbModule);
+ }
+
+ }
+ catch(IdentityException e)
+ {
+ //nothirng
+ }
+
+ try
+ {
+ UserProfileModule ldapModule = (UserProfileModule)identityContext.getObject("LDAPDelegateUserProfile");
+ if (ldapModule != null)
+ {
+ delegatingModule.setLDAPModule(ldapModule);
+ ((LDAPUserProfileModuleImpl)ldapModule).setConnectionContext(connectionContext);
+ }
+ }
+ catch (IdentityException e)
+ {
+ //nothing
+ }
+ }
+ else if (userProfileModule != null && userProfileModule instanceof LDAPUserProfileModuleImpl)
+ {
+ ((LDAPUserProfileModuleImpl)userProfileModule).setConnectionContext(connectionContext);
+ }
+
+
+ return identityContext;
+ }
+ catch (Throwable e)
+ {
+ throw new IdentityException(e);
+ }
+ }
+
+ private IdentityContext bootstrapIdentityContext(Kernel kernel) throws Exception
+ {
+ KernelControllerContext identityKernelContext;
+ try
+ {
+ AbstractBeanMetaData contextBMD = new AbstractBeanMetaData(
+ "portal:identity=IdentityContext",
+ IdentityContextImpl.class.getName());
+ //beans.add(contextBMD);
+ identityKernelContext = kernel.getController().install(contextBMD);
+ return (IdentityContext)identityKernelContext.getTarget();
+
+ }
+ catch (Throwable throwable)
+ {
+ throw new IdentityException("Unable to install IdentityContext",throwable);
+ }
+
+ }
+
+}
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/AbstractCommandTestCase.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/AbstractCommandTestCase.java 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/AbstractCommandTestCase.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -28,6 +28,8 @@
import org.jboss.portal.common.xml.XMLTools;
import org.jboss.portal.cms.test.AbstractCMSTestCase;
+import org.jboss.unit.api.pojo.annotations.Create;
+import org.jboss.unit.api.pojo.annotations.Destroy;
import org.w3c.dom.Document;
@@ -52,9 +54,10 @@
/**
*
*/
+ @Create
public void setUp() throws Exception
{
- super.setUp();
+ // super.setUp();
LoaderResource res = new CLResourceLoader().getResource("jcr/repository.xml");
Document config = res.asDocument(XMLTools.getDocumentBuilderFactory().newDocumentBuilder());
@@ -66,7 +69,7 @@
service.setConfig(config.getDocumentElement());
service.setRepositoryName("repo");
- service.setHomeDir("repotest-" + dataSourceConfigParameter.getName());
+ service.setHomeDir("repotest-" + getDataSourceName());
service.setJNDIName("java:portal/CMS");
service.startService();
}
@@ -74,9 +77,10 @@
/**
*
*/
+ @Destroy
public void tearDown() throws Exception
{
service.stopService();
- super.tearDown();
+ // super.tearDown();
}
}
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileArchiveUpload.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileArchiveUpload.java 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileArchiveUpload.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -27,7 +27,11 @@
import org.jboss.portal.cms.model.Folder;
import org.jboss.portal.cms.model.File;
import org.jboss.portal.common.io.IOTools;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+import static org.jboss.unit.api.Assert.*;
+
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
@@ -39,6 +43,7 @@
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @author <a href="mailto:sohil.shah@jboss.com">Sohil Shah</a>
*/
+@Bootstrap(beanName = "TestCase", resourceName = "/jboss-beans.xml")
public class TestFileArchiveUpload extends AbstractCommandTestCase
{
/**
@@ -54,7 +59,7 @@
{
}
-
+ @Test
public void testArchiveUpload() throws CMSException, IOException
{
//create archive
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileCopy.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileCopy.java 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileCopy.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -28,7 +28,11 @@
import org.jboss.portal.cms.impl.FileImpl;
import org.jboss.portal.cms.model.Content;
import org.jboss.portal.cms.model.File;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+import static org.jboss.unit.api.Assert.*;
+
import java.util.Locale;
@@ -37,6 +41,7 @@
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @author <a href="mailto:sohil.shah@jboss.com">Sohil Shah</a>
*/
+@Bootstrap(beanName = "TestCase", resourceName = "/jboss-beans.xml")
public class TestFileCopy extends AbstractCommandTestCase
{
private String sFilePath = "/testdoc.gif";
@@ -55,6 +60,7 @@
*
*
*/
+ @Test
public void testFileCopy() throws CMSException
{
createFile();
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileCreate.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileCreate.java 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileCreate.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -30,7 +30,11 @@
import org.jboss.portal.cms.model.File;
import org.jboss.portal.cms.util.NodeUtil;
import org.jboss.portal.cms.util.RepositoryUtil;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+import static org.jboss.unit.api.Assert.*;
+
import javax.jcr.Node;
import javax.jcr.Session;
import java.util.Locale;
@@ -41,6 +45,7 @@
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @author <a href="mailto:sohil.shah@jboss.com">Sohil Shah</a>
*/
+@Bootstrap(beanName = "TestCase", resourceName = "/jboss-beans.xml")
public class TestFileCreate extends AbstractCommandTestCase
{
/**
@@ -62,6 +67,7 @@
*
*
*/
+ @Test
public void testFileCreate() throws Exception
{
// create file english
@@ -134,7 +140,7 @@
session.logout();
}
-
+ @Test
public void testRootFileCreate() throws Exception
{
try
@@ -148,6 +154,7 @@
}
}
+ @Test
public void testRecursiveFileCreate() throws Exception
{
//Create a legal file
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileCreateFailed.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileCreateFailed.java 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileCreateFailed.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -31,7 +31,11 @@
import org.jboss.portal.cms.model.File;
import org.jboss.portal.cms.util.RepositoryUtil;
import org.jboss.portal.cms.test.mock.RuntimeExceptionCommand;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+import static org.jboss.unit.api.Assert.*;
+
import javax.jcr.Item;
import javax.jcr.Node;
import javax.jcr.Session;
@@ -43,6 +47,7 @@
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @author <a href="mailto:sohil.shah@jboss.com">Sohil Shah</a>
*/
+@Bootstrap(beanName = "TestCase", resourceName = "/jboss-beans.xml")
public class TestFileCreateFailed extends AbstractCommandTestCase
{
/**
@@ -64,6 +69,7 @@
*
*
*/
+ @Test
public void testFileCreateFailed() throws Exception
{
Session session = null;
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileDelete.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileDelete.java 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileDelete.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -29,7 +29,12 @@
import org.jboss.portal.cms.model.Content;
import org.jboss.portal.cms.model.File;
import org.jboss.portal.cms.util.RepositoryUtil;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+import static org.jboss.unit.api.Assert.*;
+
+
import javax.jcr.Session;
import java.util.Locale;
@@ -39,6 +44,7 @@
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @author <a href="mailto:sohil.shah@jboss.com">Sohil Shah</a>
*/
+@Bootstrap(beanName = "TestCase", resourceName = "/jboss-beans.xml")
public class TestFileDelete extends AbstractCommandTestCase
{
@@ -68,6 +74,7 @@
*
*
*/
+ @Test
public void testFileDelete() throws Exception
{
createFile();
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileGet.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileGet.java 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileGet.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -28,7 +28,12 @@
import org.jboss.portal.cms.impl.FileImpl;
import org.jboss.portal.cms.model.Content;
import org.jboss.portal.cms.model.File;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+import static org.jboss.unit.api.Assert.*;
+
+
import java.util.Locale;
@@ -37,6 +42,7 @@
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @author <a href="mailto:sohil.shah@jboss.com">Sohil Shah</a>
*/
+@Bootstrap(beanName = "TestCase", resourceName = "/jboss-beans.xml")
public class TestFileGet extends AbstractCommandTestCase
{
/**
@@ -55,6 +61,7 @@
/** Tests retrieval of the version labeled LIVE. */
+ @Test
public void testFileGet() throws CMSException
{
createFile();
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileGetList.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileGetList.java 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileGetList.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -28,7 +28,12 @@
import org.jboss.portal.cms.impl.FileImpl;
import org.jboss.portal.cms.model.Content;
import org.jboss.portal.cms.model.File;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+import static org.jboss.unit.api.Assert.*;
+
+
import java.util.List;
import java.util.Locale;
@@ -38,6 +43,7 @@
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @author <a href="mailto:sohil.shah@jboss.com">Sohil Shah</a>
*/
+@Bootstrap(beanName = "TestCase", resourceName = "/jboss-beans.xml")
public class TestFileGetList extends AbstractCommandTestCase
{
/**
@@ -56,6 +62,7 @@
/** Tests retrieving a list of contents under a file and the versions for contents. */
+ @Test
public void testFileList() throws CMSException
{
createFile();
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileGetVersion.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileGetVersion.java 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileGetVersion.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -28,7 +28,12 @@
import org.jboss.portal.cms.impl.FileImpl;
import org.jboss.portal.cms.model.Content;
import org.jboss.portal.cms.model.File;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+import static org.jboss.unit.api.Assert.*;
+
+
import java.util.Locale;
@@ -37,6 +42,7 @@
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @author <a href="mailto:sohil.shah@jboss.com">Sohil Shah</a>
*/
+@Bootstrap(beanName = "TestCase", resourceName = "/jboss-beans.xml")
public class TestFileGetVersion extends AbstractCommandTestCase
{
/**
@@ -54,6 +60,7 @@
/** Tests retrieval of a specific version by version number. */
+ @Test
public void testFileGetVersion() throws CMSException
{
createFile();
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileSize.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileSize.java 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileSize.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -27,7 +27,12 @@
import org.jboss.portal.cms.impl.FileImpl;
import org.jboss.portal.cms.model.Content;
import org.jboss.portal.cms.model.File;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+import static org.jboss.unit.api.Assert.*;
+
+
import java.util.Locale;
@@ -36,6 +41,7 @@
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
*
*/
+@Bootstrap(beanName = "TestCase", resourceName = "/jboss-beans.xml")
public class TestFileSize extends AbstractCommandTestCase
{
/**
@@ -57,6 +63,7 @@
*
*
*/
+ @Test
public void testFileCreate() throws Exception
{
// create file english
@@ -86,7 +93,7 @@
Command fileGet = service.getCommandFactory().createFileGetCommand(sFilePath, Locale.ENGLISH);
File cour = (File)service.execute(fileGet);
- assertEquals("File Size Incorrect", cour.getSize(), "1234567890".length());
+ assertEquals("File Size Incorrect got '" + cour.getSize() + "' instead of '" + "1234567890".length() + "'", cour.getSize(), (long)"1234567890".length());
//create content spanish
@@ -109,13 +116,14 @@
fileGet = service.getCommandFactory().createFileGetCommand(sFilePath, new Locale("es"));
cour = (File)service.execute(fileGet);
- assertEquals("File Size Incorrect", cour.getSize(), "0987654321/es".length());
+ assertEquals("File Size Incorrect", cour.getSize(), (long)"0987654321/es".length());
}
/**
*
*
*/
+ @Test
public void testFileUpdate() throws Exception
{
// create file english
@@ -145,7 +153,7 @@
Command fileGet = service.getCommandFactory().createFileGetCommand(sFilePath, Locale.ENGLISH);
File cour = (File)service.execute(fileGet);
- assertEquals("File Size Incorrect", cour.getSize(), "1234567890".length());
+ assertEquals("File Size Incorrect", cour.getSize(), (long)"1234567890".length());
assertEquals("File Content Incorrect", new String(cour.getContent().getBytes()), "1234567890");
//Now Update this content and create a new version
@@ -155,7 +163,7 @@
fileGet = service.getCommandFactory().createFileGetCommand(sFilePath, Locale.ENGLISH);
cour = (File)service.execute(fileGet);
- assertEquals("File Size Incorrect", cour.getSize(), "1234567890/updated".length());
+ assertEquals("File Size Incorrect", cour.getSize(), (long)"1234567890/updated".length());
assertEquals("File Content Incorrect", new String(cour.getContent().getBytes()), "1234567890/updated");
}
}
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileUpdate.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileUpdate.java 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFileUpdate.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -30,7 +30,12 @@
import org.jboss.portal.cms.model.Content;
import org.jboss.portal.cms.model.File;
import org.jboss.portal.cms.util.RepositoryUtil;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+import static org.jboss.unit.api.Assert.*;
+
+
import javax.jcr.Node;
import javax.jcr.Property;
import javax.jcr.Session;
@@ -42,6 +47,7 @@
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @author <a href="mailto:sohil.shah@jboss.com">Sohil Shah</a>
*/
+@Bootstrap(beanName = "TestCase", resourceName = "/jboss-beans.xml")
public class TestFileUpdate extends AbstractCommandTestCase
{
/**
@@ -63,6 +69,7 @@
*
* @throws Exception
*/
+ @Test
public void testFileUpdate() throws Exception
{
createFile();
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFolderCopy.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFolderCopy.java 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFolderCopy.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -29,7 +29,12 @@
import org.jboss.portal.cms.model.Content;
import org.jboss.portal.cms.model.File;
import org.jboss.portal.cms.model.Folder;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+import static org.jboss.unit.api.Assert.*;
+
+
import java.util.Date;
import java.util.Locale;
@@ -39,6 +44,7 @@
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @author <a href="mailto:sohil.shah@jboss.com">Sohil Shah</a>
*/
+@Bootstrap(beanName = "TestCase", resourceName = "/jboss-beans.xml")
public class TestFolderCopy extends AbstractCommandTestCase
{
/**
@@ -50,6 +56,7 @@
}
/** Copy test data from repo */
+ @Test
public void testFolderCopy() throws Exception
{
// create folder object
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFolderCreate.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFolderCreate.java 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFolderCreate.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -26,7 +26,12 @@
import org.jboss.portal.cms.impl.FolderImpl;
import org.jboss.portal.cms.model.Folder;
import org.jboss.portal.cms.util.RepositoryUtil;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+import static org.jboss.unit.api.Assert.*;
+
+
import javax.jcr.Node;
import javax.jcr.Property;
import javax.jcr.Session;
@@ -38,6 +43,7 @@
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @author <a href="mailto:sohil.shah@jboss.com">Sohil Shah</a>
*/
+@Bootstrap(beanName = "TestCase", resourceName = "/jboss-beans.xml")
public class TestFolderCreate extends AbstractCommandTestCase
{
/** A test folder path * */
@@ -57,6 +63,7 @@
*
*
*/
+ @Test
public void testFolderCreate() throws Exception
{
// create folder object
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFolderDelete.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFolderDelete.java 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFolderDelete.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -24,7 +24,12 @@
import org.jboss.portal.cms.Command;
import org.jboss.portal.cms.util.RepositoryUtil;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+import static org.jboss.unit.api.Assert.*;
+
+
import javax.jcr.Session;
@@ -33,6 +38,7 @@
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @author <a href="mailto:sohil.shah@jboss.com">Sohil Shah</a>
*/
+@Bootstrap(beanName = "TestCase", resourceName = "/jboss-beans.xml")
public class TestFolderDelete extends AbstractCommandTestCase
{
/** A test folder path * */
@@ -55,6 +61,7 @@
*
* @throws Exception
*/
+ @Test
public void testFolderDelete() throws Exception
{
Session session = RepositoryUtil.login(service.getRepository(), "anonid", "");
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFolderGet.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFolderGet.java 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFolderGet.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -26,7 +26,12 @@
import org.jboss.portal.cms.Command;
import org.jboss.portal.cms.impl.FolderImpl;
import org.jboss.portal.cms.model.Folder;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+import static org.jboss.unit.api.Assert.*;
+
+
import java.util.Date;
/**
@@ -34,6 +39,7 @@
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @author <a href="mailto:sohil.shah@jboss.com">Sohil Shah</a>
*/
+@Bootstrap(beanName = "TestCase", resourceName = "/jboss-beans.xml")
public class TestFolderGet extends AbstractCommandTestCase
{
/** A test folder path * */
@@ -52,6 +58,7 @@
*
*
*/
+ @Test
public void testFolderGet() throws CMSException
{
createFolder();
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFolderUpdate.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFolderUpdate.java 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestFolderUpdate.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -27,7 +27,12 @@
import org.jboss.portal.cms.impl.FolderImpl;
import org.jboss.portal.cms.model.Folder;
import org.jboss.portal.cms.util.RepositoryUtil;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+import static org.jboss.unit.api.Assert.*;
+
+
import javax.jcr.Property;
import javax.jcr.Session;
import java.util.Date;
@@ -37,6 +42,7 @@
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @author <a href="mailto:sohil.shah@jboss.com">Sohil Shah</a>
*/
+@Bootstrap(beanName = "TestCase", resourceName = "/jboss-beans.xml")
public class TestFolderUpdate extends AbstractCommandTestCase
{
/** A test folder path * */
@@ -55,6 +61,7 @@
*
*
*/
+ @Test
public void testFolderUpdate() throws Exception
{
createFolder();
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestRepositoryBootStrap.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestRepositoryBootStrap.java 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestRepositoryBootStrap.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -25,7 +25,11 @@
import org.jboss.portal.cms.util.RepositoryUtil;
import org.jboss.portal.cms.test.commands.AbstractCommandTestCase;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+import static org.jboss.unit.api.Assert.*;
+
import javax.jcr.Session;
/**
@@ -33,6 +37,7 @@
*
* @author Roy Russo : roy at jboss dot org
*/
+@Bootstrap(beanName = "TestCase", resourceName = "/jboss-beans.xml")
public class TestRepositoryBootStrap extends AbstractCommandTestCase
{
@@ -40,6 +45,7 @@
{
}
+ @Test
public void testService() throws Exception
{
assertTrue(service.contentExists());
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestSearch.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestSearch.java 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/commands/TestSearch.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -30,11 +30,16 @@
import org.jboss.portal.search.impl.jcr.JCRQuery;
import org.jboss.portal.search.impl.jcr.JCRQueryConverter;
import org.jboss.portal.search.QueryConversionException;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+import static org.jboss.unit.api.Assert.*;
+
import java.util.List;
/** @author <a href="mailto:theute@jboss.org">Thomas Heute</a> */
+@Bootstrap(beanName = "TestCase", resourceName = "/jboss-beans.xml")
public class TestSearch extends AbstractCommandTestCase
{
/**
@@ -46,6 +51,7 @@
}
/** Tests retrieval of the version labeled LIVE. */
+ @Test
public void testFileGet() throws CMSException, QueryConversionException
{
FederatedQuery query = new FederatedQuery("risks");
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/security/SecureCommandTestCase.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/security/SecureCommandTestCase.java 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/security/SecureCommandTestCase.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -36,13 +36,21 @@
import org.jboss.portal.cms.security.AuthorizationProviderImpl;
import org.jboss.portal.cms.test.commands.AbstractCommandTestCase;
import org.jboss.portal.cms.test.commands.CMSInterceptorStackFactory;
+import org.jboss.unit.api.pojo.annotations.Create;
+import org.jboss.unit.api.pojo.annotations.Destroy;
+import org.jboss.unit.api.pojo.annotations.Parameter;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
-
import javax.naming.InitialContext;
/** @author Sohil Shah - sohil.shah(a)jboss.com - Nov 30, 2006 */
public abstract class SecureCommandTestCase extends AbstractCommandTestCase
{
+
+ private String standardIdentityConfig;
+
+ private String identityConfig;
+
/**
*
*/
@@ -59,10 +67,11 @@
/**
*
*/
+ @Create
public void setUp() throws Exception
{
//override the configration location to include workflow services
- this.configuration = "jboss-beans-security.xml";
+ //this.configuration = "jboss-beans-security.xml";
super.setUp();
ACLInterceptor aclInterceptor = this.getACLInterceptor();
@@ -87,6 +96,7 @@
/**
*
*/
+ @Destroy
public void tearDown() throws Exception
{
super.tearDown();
@@ -111,4 +121,26 @@
tx.commit();
session.close();
}
+
+ public String getStandardIdentityConfig()
+ {
+ return standardIdentityConfig;
+ }
+
+ @Parameter(name="standardIdentityConfig")
+ public void setStandardIdentityConfig(String standardIdentityConfig)
+ {
+ this.standardIdentityConfig = standardIdentityConfig;
+ }
+
+ public String getIdentityConfig()
+ {
+ return identityConfig;
+ }
+
+ @Parameter(name="identityConfig")
+ public void setIdentityConfig(String identityConfig)
+ {
+ this.identityConfig = identityConfig;
+ }
}
\ No newline at end of file
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/security/TestManageAccess.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/security/TestManageAccess.java 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/security/TestManageAccess.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -26,10 +26,14 @@
import org.jboss.portal.cms.Command;
import org.jboss.portal.cms.impl.FolderImpl;
import org.jboss.portal.cms.model.Folder;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+import static org.jboss.unit.api.Assert.*;
import java.util.Date;
/** @author Sohil Shah - sohil.shah(a)jboss.com - Nov 30, 2006 */
+@Bootstrap(beanName = "TestCase", resourceName="/jboss-beans-security.xml")
public class TestManageAccess extends SecureCommandTestCase
{
String rejectPath = "/default/private";
@@ -124,6 +128,7 @@
}
/** @throws Exception */
+ @Test
public void testAnonymous() throws Exception
{
// first run against non-access scenario
@@ -157,6 +162,7 @@
}
/** @throws Exception */
+ @Test
public void testUser() throws Exception
{
this.runAs("user");
@@ -190,6 +196,7 @@
}
/** @throws Exception */
+ @Test
public void testAdmin() throws Exception
{
this.runAs("admin");
@@ -221,6 +228,7 @@
}
/** @throws Exception */
+ @Test
public void testCopyToDeniedDestination() throws Exception
{
this.runAs("user");
@@ -253,6 +261,7 @@
}
/** @throws Exception */
+ @Test
public void testMoveToDeniedDestination() throws Exception
{
this.runAs("user");
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/security/TestReadAccess.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/security/TestReadAccess.java 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/security/TestReadAccess.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -26,11 +26,16 @@
import org.jboss.portal.cms.Command;
import org.jboss.portal.cms.model.File;
import org.jboss.portal.cms.model.Folder;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+import static org.jboss.unit.api.Assert.*;
+
import java.util.List;
import java.util.Locale;
/** @author Sohil Shah - sohil.shah(a)jboss.com - Nov 30, 2006 */
+@Bootstrap(beanName = "TestCase", resourceName="/jboss-beans-security.xml")
public class TestReadAccess extends SecureCommandTestCase
{
String rejectFolderPath = "/default/private";
@@ -88,6 +93,7 @@
/** @throws Exception */
+ @Test
public void testAnonymous() throws Exception
{
try
@@ -140,6 +146,7 @@
}
/** @throws Exception */
+ @Test
public void testUser() throws Exception
{
this.runAs("user");
@@ -194,6 +201,7 @@
}
/** @throws Exception */
+ @Test
public void testAdmin() throws Exception
{
this.runAs("admin");
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/security/TestWriteAccess.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/security/TestWriteAccess.java 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/security/TestWriteAccess.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -30,12 +30,17 @@
import org.jboss.portal.cms.model.Content;
import org.jboss.portal.cms.model.File;
import org.jboss.portal.cms.model.Folder;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+import static org.jboss.unit.api.Assert.*;
+
import java.util.Date;
import java.util.List;
import java.util.Locale;
/** @author Sohil Shah - sohil.shah(a)jboss.com - Nov 30, 2006 */
+@Bootstrap(beanName = "TestCase", resourceName="/jboss-beans-security.xml")
public class TestWriteAccess extends SecureCommandTestCase
{
String rejectPath = "/default/private";
@@ -186,6 +191,7 @@
/** @throws Exception */
+ @Test
public void testAnonymous() throws Exception
{
// first run against non-access scenario
@@ -219,6 +225,7 @@
}
/** @throws Exception */
+ @Test
public void testUser() throws Exception
{
this.runAs("user");
@@ -252,6 +259,7 @@
}
/** @throws Exception */
+ @Test
public void testAdmin() throws Exception
{
this.runAs("admin");
@@ -296,6 +304,7 @@
}
/** @throws Exception */
+ @Test
public void testSysAdmin() throws Exception
{
this.runAs("sysadmin");
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/workflow/AbstractWorkflowTestCase.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/workflow/AbstractWorkflowTestCase.java 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/workflow/AbstractWorkflowTestCase.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -42,11 +42,16 @@
import org.jboss.portal.identity.db.HibernateRoleImpl;
import org.jboss.portal.identity.db.HibernateUserImpl;
import org.jboss.portal.server.impl.invocation.JBossInterceptorStack;
+import org.jboss.unit.api.pojo.annotations.Parameter;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
-
/** @author Sohil Shah - sohil.shah(a)jboss.com - Nov 30, 2006 */
public abstract class AbstractWorkflowTestCase extends AbstractCommandTestCase
{
+ private String standardIdentityConfig;
+
+ private String identityConfig;
+
/**
*
*/
@@ -66,7 +71,7 @@
public void setUp() throws Exception
{
//override the configration location to include workflow services
- this.configuration = "jboss-beans-workflow.xml";
+ // this.configuration = "jboss-beans-workflow.xml";
super.setUp();
ApprovalWorkflowInterceptor workflowInterceptor = this.getApprovalWorkflowInterceptor();
@@ -184,4 +189,26 @@
User user = this.userModule.findUserByUserName(username);
JCRCMS.getUserInfo().set(user);
}
+
+ public String getStandardIdentityConfig()
+ {
+ return standardIdentityConfig;
+ }
+
+ @Parameter(name="standardIdentityConfig")
+ public void setStandardIdentityConfig(String standardIdentityConfig)
+ {
+ this.standardIdentityConfig = standardIdentityConfig;
+ }
+
+ public String getIdentityConfig()
+ {
+ return identityConfig;
+ }
+
+ @Parameter(name="identityConfig")
+ public void setIdentityConfig(String identityConfig)
+ {
+ this.identityConfig = identityConfig;
+ }
}
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/workflow/TestApprovedPublish.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/workflow/TestApprovedPublish.java 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/workflow/TestApprovedPublish.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -22,7 +22,6 @@
******************************************************************************/
package org.jboss.portal.cms.test.workflow;
-import junit.framework.TestSuite;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
@@ -33,13 +32,20 @@
import org.jboss.portal.cms.model.Content;
import org.jboss.portal.cms.model.File;
import org.jboss.portal.cms.workflow.ApprovePublish;
+import org.jboss.unit.api.pojo.annotations.Create;
+import org.jboss.unit.api.pojo.annotations.Destroy;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
+import static org.jboss.unit.api.Assert.*;
+
import javax.naming.InitialContext;
import java.util.Collection;
import java.util.Locale;
import java.util.Set;
/** @author Sohil Shah - sohil.shah(a)jboss.com - Nov 30, 2006 */
+@Bootstrap(beanName = "TestCase", resourceName="/jboss-beans-workflow.xml")
public class TestApprovedPublish extends AbstractWorkflowTestCase
{
private String file = "/default/workflow.html";
@@ -58,14 +64,17 @@
*
*
*/
+ /*
public static TestSuite suite() throws Exception
{
- return createTestSuite(TestApprovedPublish.class);
+ return createTestSuite(TestApprovedPublish.class);
}
+ */
/**
*
*/
+ @Create
public void setUp() throws Exception
{
super.setUp();
@@ -79,6 +88,7 @@
/**
*
*/
+ @Destroy
public void tearDown() throws Exception
{
this.tx.commit();
@@ -89,6 +99,7 @@
/** @throws Exception */
+ @Test
public void test() throws Exception
{
//Execute file creation as a regular user/non-manager
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/workflow/TestDeniedPublish.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/workflow/TestDeniedPublish.java 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/workflow/TestDeniedPublish.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -22,7 +22,8 @@
******************************************************************************/
package org.jboss.portal.cms.test.workflow;
-import junit.framework.TestSuite;
+import static org.jboss.unit.api.Assert.*;
+
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
@@ -33,6 +34,10 @@
import org.jboss.portal.cms.model.Content;
import org.jboss.portal.cms.model.File;
import org.jboss.portal.cms.workflow.ApprovePublish;
+import org.jboss.unit.api.pojo.annotations.Create;
+import org.jboss.unit.api.pojo.annotations.Destroy;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
import javax.naming.InitialContext;
import java.util.Collection;
@@ -41,6 +46,7 @@
import java.util.Set;
/** @author Sohil Shah - sohil.shah(a)jboss.com - Nov 30, 2006 */
+@Bootstrap(beanName = "TestCase", resourceName="/jboss-beans-workflow.xml")
public class TestDeniedPublish extends AbstractWorkflowTestCase
{
private String newFile = "/default/workflow.html";
@@ -60,14 +66,17 @@
*
*
*/
+ /*
public static TestSuite suite() throws Exception
{
return createTestSuite(TestDeniedPublish.class);
}
+ */
/**
*
*/
+ @Create
public void setUp() throws Exception
{
super.setUp();
@@ -81,6 +90,7 @@
/**
*
*/
+ @Destroy
public void tearDown() throws Exception
{
this.tx.commit();
@@ -91,6 +101,7 @@
/** @throws Exception */
+ @Test
public void testPublishExistingFile() throws Exception
{
ApprovePublish approvePublish = this.service.getApprovePublishWorkflow();
@@ -157,6 +168,7 @@
*
* @throws Exception
*/
+ @Test
public void testPublishNewFile() throws Exception
{
//Execute file creation as a regular user/non-manager
Modified: modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/workflow/TestWorkflowEnvironment.java
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/workflow/TestWorkflowEnvironment.java 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/java/org/jboss/portal/cms/test/workflow/TestWorkflowEnvironment.java 2008-09-02 15:04:18 UTC (rev 11786)
@@ -23,14 +23,16 @@
package org.jboss.portal.cms.test.workflow;
import junit.framework.Assert;
-import junit.framework.TestSuite;
import org.jboss.portal.cms.CMSException;
import org.jboss.portal.cms.workflow.ApprovePublish;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.mc.api.annotations.Bootstrap;
import java.util.Set;
/** @author Sohil Shah - sohil.shah(a)jboss.com - Nov 30, 2006 */
+@Bootstrap(beanName = "TestCase", resourceName="/jboss-beans-workflow.xml")
public class TestWorkflowEnvironment extends AbstractWorkflowTestCase
{
String rejectPath = "/default/private/license.html";
@@ -49,12 +51,15 @@
*
*
*/
+ /*
public static TestSuite suite() throws Exception
{
return createTestSuite(TestWorkflowEnvironment.class);
}
+ */
/** @throws CMSException */
+ @Test
public void test() throws Exception
{
//Get the ApprovePublish service
Modified: modules/cms/trunk/cms-jackrabbit/src/test/resources/jboss-beans-security.xml
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/resources/jboss-beans-security.xml 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/resources/jboss-beans-security.xml 2008-09-02 15:04:18 UTC (rev 11786)
@@ -23,22 +23,21 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
- xmlns="urn:jboss:bean-deployer">
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
<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>
+ <constructor factoryMethod="getConfig" factoryClass="org.jboss.portal.test.framework.embedded.HibernateSupport">
+ <parameter><inject bean="TestCase" property="dataSourceName" state="Instantiated"/></parameter>
+ <parameter><inject bean="TestCase" property="hibernateConfig" state="Instantiated"/></parameter>
+ </constructor>
</bean>
<bean name="JNDISupport" class="org.jboss.portal.test.framework.embedded.JNDISupport">
@@ -53,22 +52,63 @@
<bean name="DataSourceSupport" class="org.jboss.portal.test.framework.embedded.DataSourceSupport">
<property name="transactionManager"><inject bean="TransactionManagerSupport" property="transactionManager"/></property>
- <property name="connectionManagerReference"><inject bean="ConnectionManagerSupport"
- property="connectionManagerReference"/></property>
+ <property name="connectionManagerReference"><inject bean="ConnectionManagerSupport" property="connectionManagerReference"/></property>
<property name="config"><inject bean="DataSourceConfig"/></property>
</bean>
<bean name="HibernateSupport" class="org.jboss.portal.test.framework.embedded.HibernateSupport">
<property name="config"><inject bean="HibernateConfig"/></property>
- <property name="jNDIName">java:/SessionFactory</property>
+ <property name="JNDIName">java:/SessionFactory</property>
<property name="mappings">
<list elementClass="java.lang.String">
- <value>domain.hbm.xml</value>
- <value>domain-identity.hbm.xml</value>
+ <value>domain.hbm.xml</value>
+ <value>domain-identity.hbm.xml</value>
</list>
</property>
</bean>
-
+
+ <bean name="IdentityTestServiceLoader" class="org.jboss.portal.cms.test.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>
+ </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>
+
<bean name="IdentityServiceController" class="org.jboss.portal.core.identity.service.IdentityServiceControllerImpl">
<property name="configFile">db-config.xml</property>
<property name="defaultConfigFile">standardidentity-config.xml</property>
@@ -88,18 +128,18 @@
<bean name="AuthorizationManager" class="org.jboss.portal.cms.security.AuthorizationManagerImpl">
<property name="provider"><inject bean="AuthorizationProvider"/></property>
- <property name="jNDIName">java:portal/cms/AuthorizationManager</property>
+ <property name="JNDIName">java:portal/cms/AuthorizationManager</property>
</bean>
<bean name="ACLInterceptor" class="org.jboss.portal.cms.impl.interceptors.ACLInterceptor">
<property name="authorizationManager"><inject bean="AuthorizationManager"/></property>
- <property name="jNDIName">java:/portal/cms/ACLInterceptor</property>
+ <property name="JNDIName">java:/portal/cms/ACLInterceptor</property>
<property name="cmsSessionFactory">java:/SessionFactory</property>
<property name="identitySessionFactory">java:/SessionFactory</property>
<property name="defaultPolicy">
<![CDATA[
<policy>
- <!-- permissions on the root cms node -->
+ <!-- permissions on the root cms node -->
<criteria name="path" value="/">
<permission name="cms" action="read">
<role name="Anonymous"/>
@@ -111,7 +151,7 @@
<role name="Admin"/>
</permission>
</criteria>
- <!-- permissions on the default cms node -->
+ <!-- permissions on the default cms node -->
<criteria name="path" value="/default">
<permission name="cms" action="read">
<role name="Anonymous"/>
Modified: modules/cms/trunk/cms-jackrabbit/src/test/resources/jboss-beans-workflow.xml
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/resources/jboss-beans-workflow.xml 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/resources/jboss-beans-workflow.xml 2008-09-02 15:04:18 UTC (rev 11786)
@@ -23,22 +23,22 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
- xmlns="urn:jboss:bean-deployer">
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+
<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>
+ <constructor factoryMethod="getConfig" factoryClass="org.jboss.portal.test.framework.embedded.HibernateSupport">
+ <parameter><inject bean="TestCase" property="dataSourceName" state="Instantiated"/></parameter>
+ <parameter><inject bean="TestCase" property="hibernateConfig" state="Instantiated"/></parameter>
+ </constructor>
</bean>
<bean name="JNDISupport" class="org.jboss.portal.test.framework.embedded.JNDISupport">
@@ -53,17 +53,16 @@
<bean name="DataSourceSupport" class="org.jboss.portal.test.framework.embedded.DataSourceSupport">
<property name="transactionManager"><inject bean="TransactionManagerSupport" property="transactionManager"/></property>
- <property name="connectionManagerReference"><inject bean="ConnectionManagerSupport"
- property="connectionManagerReference"/></property>
+ <property name="connectionManagerReference"><inject bean="ConnectionManagerSupport" property="connectionManagerReference"/></property>
<property name="config"><inject bean="DataSourceConfig"/></property>
</bean>
<bean name="HibernateSupport" class="org.jboss.portal.test.framework.embedded.HibernateSupport">
<property name="config"><inject bean="HibernateConfig"/></property>
- <property name="jNDIName">java:/SessionFactory</property>
+ <property name="JNDIName">java:/SessionFactory</property>
<property name="mappings">
<list elementClass="java.lang.String">
- <value>domain.hbm.xml</value>
+ <value>domain.hbm.xml</value>
<value>domain-identity.hbm.xml</value>
<value>org/jbpm/graph/action/Script.hbm.xml</value>
<value>org/jbpm/identity/User.hbm.xml</value>
@@ -156,14 +155,60 @@
</list>
</property>
</bean>
-
+
+ <bean name="IdentityTestServiceLoader" class="org.jboss.portal.cms.test.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>
+ </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>
+
<bean name="IdentityServiceController" class="org.jboss.portal.core.identity.service.IdentityServiceControllerImpl">
<property name="configFile">db-config.xml</property>
<property name="defaultConfigFile">standardidentity-config.xml</property>
<property name="registerMBeans">false</property>
</bean>
-
-
+
+ <bean name="IdentityDataLoader" class="org.jboss.portal.cms.test.security.IdentityDataLoader">
+ <property name="identityServiceController"><inject bean="IdentityServiceController"/></property>
+ <property name="identitySessionFactory">java:/SessionFactory</property>
+ </bean>
+
<!-- setup for cms workflow testing -->
<bean name="WorkflowService" class="org.jboss.portal.workflow.service.WorkflowServiceImpl">
<property name="jbpmConfigurationXml">
@@ -190,7 +235,7 @@
<property name="identityServiceController"><inject bean="IdentityServiceController"/></property>
<property name="overwrite">false</property>
<property name="managerRoles">Admin</property>
- <property name="jNDIName">java:/portal/ApprovePublishWorkflow</property>
+ <property name="JNDIName">java:/portal/ApprovePublishWorkflow</property>
<property name="process">
<![CDATA[
<!-- cms approval workflow -->
@@ -218,6 +263,6 @@
</bean>
<bean class="org.jboss.portal.cms.impl.interceptors.ApprovalWorkflowInterceptor" name="ApprovalWorkflowInterceptor">
- <property name="jNDIName">java:/portal/cms/ApprovalWorkflowInterceptor</property>
+ <property name="JNDIName">java:/portal/cms/ApprovalWorkflowInterceptor</property>
</bean>
</deployment>
Modified: modules/cms/trunk/cms-jackrabbit/src/test/resources/jboss-beans.xml
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/resources/jboss-beans.xml 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/resources/jboss-beans.xml 2008-09-02 15:04:18 UTC (rev 11786)
@@ -23,22 +23,20 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
- xmlns="urn:jboss:bean-deployer">
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
<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>
+ <constructor factoryMethod="getConfig" factoryClass="org.jboss.portal.test.framework.embedded.HibernateSupport">
+ <parameter><inject bean="TestCase" property="dataSourceName" state="Instantiated"/></parameter>
+ <parameter><inject bean="TestCase" property="hibernateConfig" state="Instantiated"/></parameter>
+ </constructor>
</bean>
<bean name="JNDISupport" class="org.jboss.portal.test.framework.embedded.JNDISupport">
@@ -53,18 +51,17 @@
<bean name="DataSourceSupport" class="org.jboss.portal.test.framework.embedded.DataSourceSupport">
<property name="transactionManager"><inject bean="TransactionManagerSupport" property="transactionManager"/></property>
- <property name="connectionManagerReference"><inject bean="ConnectionManagerSupport"
- property="connectionManagerReference"/></property>
+ <property name="connectionManagerReference"><inject bean="ConnectionManagerSupport" property="connectionManagerReference"/></property>
<property name="config"><inject bean="DataSourceConfig"/></property>
</bean>
<bean name="HibernateSupport" class="org.jboss.portal.test.framework.embedded.HibernateSupport">
<property name="config"><inject bean="HibernateConfig"/></property>
- <property name="jNDIName">java:/SessionFactory</property>
+ <property name="JNDIName">java:/SessionFactory</property>
<property name="mappings">
<list elementClass="java.lang.String">
<value>domain.hbm.xml</value>
</list>
</property>
- </bean>
+ </bean>
</deployment>
Added: modules/cms/trunk/cms-jackrabbit/src/test/resources/jboss-unit.xml
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/resources/jboss-unit.xml (rev 0)
+++ modules/cms/trunk/cms-jackrabbit/src/test/resources/jboss-unit.xml 2008-09-02 15:04:18 UTC (rev 11786)
@@ -0,0 +1,105 @@
+<?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="hibernateConfig" value="hibernates.xml"/>
+ <test >
+ <class name="org.jboss.portal.cms.test.TestJackrabbit"/>
+ </test>
+ <test >
+ <class name="org.jboss.portal.cms.test.TestRegEx"/>
+ </test>
+ <test >
+ <class name="org.jboss.portal.cms.test.TestRepositoryUtil"/>
+ </test>
+ <test >
+ <class name="org.jboss.portal.cms.test.commands.TestFileArchiveUpload"/>
+ </test>
+ <test >
+ <class name="org.jboss.portal.cms.test.commands.TestFileCopy"/>
+ </test>
+ <test >
+ <class name="org.jboss.portal.cms.test.commands.TestFileCreate"/>
+ </test>
+ <test >
+ <class name="org.jboss.portal.cms.test.commands.TestFileCreateFailed"/>
+ </test>
+ <test >
+ <class name="org.jboss.portal.cms.test.commands.TestFileDelete"/>
+ </test>
+ <test >
+ <class name="org.jboss.portal.cms.test.commands.TestFileGet"/>
+ </test>
+ <test >
+ <class name="org.jboss.portal.cms.test.commands.TestFileGetList"/>
+ </test>
+ <test >
+ <class name="org.jboss.portal.cms.test.commands.TestFileGetVersion"/>
+ </test>
+ <test >
+ <class name="org.jboss.portal.cms.test.commands.TestFileSize"/>
+ </test>
+ <test >
+ <class name="org.jboss.portal.cms.test.commands.TestFileUpdate"/>
+ </test>
+ <test >
+ <class name="org.jboss.portal.cms.test.commands.TestFolderCopy"/>
+ </test>
+ <test >
+ <class name="org.jboss.portal.cms.test.commands.TestFolderCreate"/>
+ </test>
+ <test >
+ <class name="org.jboss.portal.cms.test.commands.TestFolderDelete"/>
+ </test>
+ <test >
+ <class name="org.jboss.portal.cms.test.commands.TestFolderGet"/>
+ </test>
+ <test >
+ <class name="org.jboss.portal.cms.test.commands.TestFolderUpdate"/>
+ </test>
+ <test >
+ <class name="org.jboss.portal.cms.test.commands.TestRepositoryBootStrap"/>
+ </test>
+ <test >
+ <class name="org.jboss.portal.cms.test.commands.TestSearch"/>
+ </test>
+ </pojo>
+
+ <pojo>
+ <parameter name="datasources" value="datasources.xml"/>
+ <parameter name="dataSourceName" value="hsqldb"/>
+ <parameter name="hibernateConfig" value="hibernates.xml"/>
+ <parameter name="standardIdentityConfig" value="standardidentity-config.xml"/>
+ <parameter name="identityConfig" value="db-config.xml"/>
+ <test >
+ <class name="org.jboss.portal.cms.test.security.TestManageAccess"/>
+ </test>
+ <test >
+ <class name="org.jboss.portal.cms.test.security.TestReadAccess"/>
+ </test>
+ <test >
+ <class name="org.jboss.portal.cms.test.security.TestWriteAccess"/>
+ </test>
+ </pojo>
+
+ <pojo>
+ <parameter name="datasources" value="datasources.xml"/>
+ <parameter name="dataSourceName" value="hsqldb"/>
+ <parameter name="hibernateConfig" value="hibernates.xml"/>
+ <parameter name="standardIdentityConfig" value="standardidentity-config.xml"/>
+ <parameter name="identityConfig" value="db-config.xml"/>
+ <test >
+ <class name="org.jboss.portal.cms.test.workflow.TestApprovedPublish"/>
+ </test>
+ <test >
+ <class name="org.jboss.portal.cms.test.workflow.TestDeniedPublish"/>
+ </test>
+ <test >
+ <class name="org.jboss.portal.cms.test.workflow.TestWorkflowEnvironment"/>
+ </test>
+ </pojo>
+</jboss-unit>
Modified: modules/cms/trunk/cms-jackrabbit/src/test/resources/standardidentity-config.xml
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/resources/standardidentity-config.xml 2008-09-02 14:13:15 UTC (rev 11785)
+++ modules/cms/trunk/cms-jackrabbit/src/test/resources/standardidentity-config.xml 2008-09-02 15:04:18 UTC (rev 11786)
@@ -56,7 +56,7 @@
<value>password</value>
</option>
<option>
- <name>jNDIName</name>
+ <name>JNDIName</name>
<value>java:/portal/LDAPConnectionContext</value>
</option>
<option>
@@ -91,7 +91,7 @@
<value>java:/SessionFactory</value>
</option>
<option>
- <name>jNDIName</name>
+ <name>JNDIName</name>
<value>java:/portal/UserModule</value>
</option>
</config>
@@ -113,7 +113,7 @@
<value>java:/SessionFactory</value>
</option>
<option>
- <name>jNDIName</name>
+ <name>JNDIName</name>
<value>java:/portal/RoleModule</value>
</option>
</config>
@@ -135,7 +135,7 @@
<value>java:/SessionFactory</value>
</option>
<option>
- <name>jNDIName</name>
+ <name>JNDIName</name>
<value>java:/portal/MembershipModule</value>
</option>
</config>
@@ -157,7 +157,7 @@
<value>java:/SessionFactory</value>
</option>
<option>
- <name>jNDIName</name>
+ <name>JNDIName</name>
<value>java:/portal/UserProfileModule</value>
</option>
</config>
17 years, 8 months