[jbpm-commits] JBoss JBPM SVN: r2700 - in jbpm4/trunk: modules/test/src/main/java/org/jbpm/test and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Oct 31 06:23:58 EDT 2008


Author: tom.baeyens at jboss.com
Date: 2008-10-31 06:23:57 -0400 (Fri, 31 Oct 2008)
New Revision: 2700

Removed:
   jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/Db.java
   jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/DbTestCase.java
   jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentDbTestCase.java
   jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentFactoryTestCase.java
   jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentFactoryTestSetup.java
   jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentTestCase.java
   jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/JbpmTestCase.java
Modified:
   jbpm4/trunk/pom.xml
Log:
unification api proposals

Deleted: jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/Db.java
===================================================================
--- jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/Db.java	2008-10-31 10:21:24 UTC (rev 2699)
+++ jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/Db.java	2008-10-31 10:23:57 UTC (rev 2700)
@@ -1,120 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.test.base;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.hibernate.cfg.Configuration;
-import org.hibernate.dialect.Dialect;
-import org.hibernate.dialect.MySQLDialect;
-import org.hibernate.engine.SessionFactoryImplementor;
-import org.hibernate.mapping.ForeignKey;
-import org.hibernate.mapping.Table;
-import org.jbpm.pvm.env.EnvironmentFactory;
-
-
-/**
- * @author Tom Baeyens
- */
-public class Db {
-
-  private static final String CLEAN_SQL_KEY = "cleanSql";
-
-  public static void clean(EnvironmentFactory environmentFactory) {
-    SessionFactory sessionFactory = environmentFactory.get(SessionFactory.class);
-    String[] cleanSql = (String[]) environmentFactory.get(CLEAN_SQL_KEY);
-
-    if (cleanSql == null) {
-      Configuration configuration = environmentFactory.get(Configuration.class);
-      
-      SessionFactoryImplementor sessionFactoryImplementor = (SessionFactoryImplementor) sessionFactory;
-      Dialect dialect = sessionFactoryImplementor.getDialect();
-
-      // loop over all foreign key constraints
-      List<String> dropForeignKeysSql = new ArrayList<String>();
-      List<String> createForeignKeysSql = new ArrayList<String>();
-      Iterator<Table> iter = configuration.getTableMappings();
-      while (iter.hasNext()) {
-        Table table = (Table) iter.next();
-        if (table.isPhysicalTable()) {
-          String catalog = table.getCatalog();
-          String schema = table.getSchema();
-          Iterator<ForeignKey> subIter = table.getForeignKeyIterator();
-          while (subIter.hasNext()) {
-            ForeignKey fk = (ForeignKey) subIter.next();
-            if (fk.isPhysicalConstraint()) {
-              // collect the drop foreign key constraint sql
-              dropForeignKeysSql.add(fk.sqlDropString(dialect, catalog, schema));
-              // MySQLDialect creates an index for each foreign key.
-              // see
-              // http://opensource.atlassian.com/projects/hibernate/browse/HHH-2155
-              // This index should be dropped or an error will be thrown during
-              // the creation phase
-              if (dialect instanceof MySQLDialect) {
-                dropForeignKeysSql.add("alter table " + table.getName() + " drop key " + fk.getName());
-              }
-              // and collect the create foreign key constraint sql
-              createForeignKeysSql.add(fk.sqlCreateString(dialect, sessionFactoryImplementor, catalog, schema));
-            }
-          }
-        }
-      }
-
-      List<String> deleteSql = new ArrayList<String>();
-      iter = configuration.getTableMappings();
-      while (iter.hasNext()) {
-        Table table = (Table) iter.next();
-        if (table.isPhysicalTable()) {
-          deleteSql.add("delete from " + table.getName());
-        }
-      }
-
-      // glue
-      // - drop foreign key constraints
-      // - delete contents of all tables
-      // - create foreign key constraints
-      // together to form the clean script
-      List<String> cleanSqlList = new ArrayList<String>();
-      cleanSqlList.addAll(dropForeignKeysSql);
-      cleanSqlList.addAll(deleteSql);
-      cleanSqlList.addAll(createForeignKeysSql);
-
-      cleanSql = (String[]) cleanSqlList.toArray(new String[cleanSqlList.size()]);
-      
-      environmentFactory.set(CLEAN_SQL_KEY, cleanSql);
-    }
-
-    Session session = sessionFactory.openSession();
-    try {
-      for (String query : cleanSql) {
-        session.createSQLQuery(query).executeUpdate();
-      }
-    } finally {
-      session.close();
-    }
-  }
-
-}

Deleted: jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/DbTestCase.java
===================================================================
--- jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/DbTestCase.java	2008-10-31 10:21:24 UTC (rev 2699)
+++ jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/DbTestCase.java	2008-10-31 10:23:57 UTC (rev 2700)
@@ -1,71 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.test.base;
-
-import org.jbpm.ExecutionService;
-import org.jbpm.ManagementService;
-import org.jbpm.ProcessService;
-import org.jbpm.pvm.internal.cmd.CommandService;
-
-
-/** for tests that use persistence through a command service.
- * 
- * The DB is cleaned inbetween tests.  No environment is created.
- * 
- * @author Tom Baeyens
- */
-public abstract class DbTestCase extends EnvironmentFactoryTestCase {
-  
-  protected CommandService commandService;
-  protected ProcessService processService;
-  protected ExecutionService executionService;
-  protected ManagementService managementService;
-
-  public DbTestCase() {
-    super();
-  }
-  
-  public DbTestCase(String configResource) {
-    super(configResource);
-  }
-  
-  public void setUp() throws Exception {
-    super.setUp();
-
-    if (isEnvironmentFactoryCached()) {
-      Db.clean(getEnvironmentFactory());
-    }
-
-    commandService = getEnvironmentFactory().get(CommandService.class);
-    processService = getEnvironmentFactory().get(ProcessService.class);
-    executionService = getEnvironmentFactory().get(ExecutionService.class);
-    managementService = getEnvironmentFactory().get(ManagementService.class);
-  }
-  
-  public void tearDown() throws Exception {
-    commandService = null;
-    processService = null;
-    executionService = null;
-    managementService = null;
-    super.tearDown();
-  }
-}

Deleted: jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentDbTestCase.java
===================================================================
--- jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentDbTestCase.java	2008-10-31 10:21:24 UTC (rev 2699)
+++ jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentDbTestCase.java	2008-10-31 10:23:57 UTC (rev 2700)
@@ -1,154 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.test.base;
-
-import java.lang.reflect.Field;
-
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.hibernate.Transaction;
-import org.jbpm.Execution;
-import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
-import org.jbpm.pvm.internal.util.ReflectUtil;
-import org.jbpm.pvm.model.OpenProcessDefinition;
-import org.jbpm.pvm.session.DbSession;
-import org.jbpm.pvm.session.PvmDbSession;
-
-
-/** for tests that use persistence inside environment blocks.
- * 
- * An environment is opened in the setUp and closed in the tearDown.
- * DB is cleaned inbetween tests. Extra convenience methods for usage 
- * inside an environment block are provided. 
- * 
- * @author Tom Baeyens
- */
-public class EnvironmentDbTestCase extends EnvironmentTestCase {
-  
-  Transaction transaction = null;
-  
-  public EnvironmentDbTestCase() {
-  }
-
-  public EnvironmentDbTestCase(String configResource) {
-    super(configResource);
-  }
-
-  public void setUp() throws Exception {
-    if (isEnvironmentFactoryCached()) {
-      Db.clean(getEnvironmentFactory());
-    }
-    super.setUp();
-    beginTransaction();
-  }
-  
-  public void tearDown() throws Exception {
-    commitTransaction();
-    super.tearDown();
-  }
-
-  void beginTransaction() {
-    Session session = environment.get(Session.class);
-    transaction = session.beginTransaction();
-  }
-
-  void commitTransaction() {
-    transaction.commit();
-    transaction = null;
-  }
-  
-  void rollbackTransaction() {
-    transaction.rollback();
-    transaction = null;
-  }
-  
-  public DbSession getDbSession() {
-    return environment.get(DbSession.class);
-  }
-  
-  public void rollbackAndBeginNewTransaction() {
-    rollbackTransaction();
-    closeEnvironment();
-    openEnvironment();
-    beginTransaction();
-  }
-  
-  public void newTransaction() {
-    try {
-      commitTransaction();
-      closeEnvironment();
-    } finally {
-      openEnvironment();
-      beginTransaction();
-    }
-  }
-
-  public void beginCacheTest() {
-    SessionFactory sessionFactory = environment.get(SessionFactory.class);
-    if (sessionFactory != null) {
-      log.debug("=================================================================");
-      log.debug("Beginning of the cache test, no more sql query should be performed before the end of the test");
-      log.debug("=================================================================");
-
-      sessionFactory.getStatistics().clear();
-      sessionFactory.getStatistics().setStatisticsEnabled(true);
-    }
-  }
-  
-  public void endCacheTest() {
-    SessionFactory sessionFactory = environment.get(SessionFactory.class);
-    if (sessionFactory != null) {
-      assertEquals(0, sessionFactory.getStatistics().getEntityLoadCount());
-      assertEquals(0, sessionFactory.getStatistics().getCollectionLoadCount());
-    }
-  }
-  
-  public ProcessDefinitionImpl reload(OpenProcessDefinition processDefinition) {
-    environment.get(PvmDbSession.class).save(processDefinition);
-    newTransaction();
-    return environment.get(PvmDbSession.class).get(ProcessDefinitionImpl.class, processDefinition.getDbid());
-  }
-
-  public <T> T reload(T object, Class<T> persistentClass) {
-    environment.get(DbSession.class).save(object);
-    newTransaction();
-    
-    Long dbid = null;
-    try {
-      Field dbidField = ReflectUtil.getField(persistentClass, "dbid");
-      dbidField.setAccessible(true);
-      dbid = (Long) dbidField.get(object);
-    } catch (Exception e) {
-      e.printStackTrace();
-    }
-    
-    return environment.get(DbSession.class).get(persistentClass, dbid);
-  }
-
-  public ExecutionImpl reload(Execution execution) {
-    environment.get(PvmDbSession.class).save(execution);
-    newTransaction();
-    return environment.get(PvmDbSession.class).get(ExecutionImpl.class, execution.getDbid());
-  }
-
-}

Deleted: jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentFactoryTestCase.java
===================================================================
--- jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentFactoryTestCase.java	2008-10-31 10:21:24 UTC (rev 2699)
+++ jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentFactoryTestCase.java	2008-10-31 10:23:57 UTC (rev 2700)
@@ -1,82 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.test.base;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jbpm.PvmException;
-import org.jbpm.pvm.env.EnvironmentFactory;
-import org.jbpm.pvm.env.PvmEnvironmentFactory;
-
-
-/**
- * @author Tom Baeyens
- */
-public abstract class EnvironmentFactoryTestCase extends JbpmTestCase {
-  
-  String configResource;
-
-  static Map<String, EnvironmentFactory> environmentFactories = new HashMap<String, EnvironmentFactory>();
-  
-  public EnvironmentFactoryTestCase() {
-    this("environment.cfg.xml");
-  }
-  
-  public EnvironmentFactoryTestCase(String configResource) {
-    this.configResource = configResource;
-  }
-
-  public EnvironmentFactory getEnvironmentFactory() {
-    if (isEnvironmentFactoryCached()) {
-      return environmentFactories.get(configResource);
-    }
-    return createEnvironmentFactory();
-  }
-
-  boolean isEnvironmentFactoryCached() {
-    return environmentFactories.containsKey(configResource);
-  }
-
-  EnvironmentFactory createEnvironmentFactory() {
-    return createEnvironmentFactory(configResource);
-  }
-
-  static EnvironmentFactory createEnvironmentFactory(String configResource) {
-    try {
-      log.debug("creating environment factory for ["+configResource+"]");
-      EnvironmentFactory newEnvironmentFactory = new PvmEnvironmentFactory(configResource);
-      environmentFactories.put(configResource, newEnvironmentFactory);
-      return newEnvironmentFactory;
-    } catch (Exception e) {
-      throw new PvmException("Exception during creation of environment factory for "+configResource, e);
-    }
-  }
-
-  static void closeEnvironmentFactory(String configResource) {
-    EnvironmentFactory environmentFactory = environmentFactories.remove(configResource);
-    if (environmentFactory!=null) {
-      log.debug("closing environment factory for ["+configResource+"]");
-      environmentFactory.close();
-    }
-  }
-}

Deleted: jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentFactoryTestSetup.java
===================================================================
--- jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentFactoryTestSetup.java	2008-10-31 10:21:24 UTC (rev 2699)
+++ jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentFactoryTestSetup.java	2008-10-31 10:23:57 UTC (rev 2700)
@@ -1,63 +0,0 @@
-/**
- * Copyright (C) 2007  Bull S. A. S.
- * Bull, Rue Jean Jaures, B.P.68, 78340, Les Clayes-sous-Bois
- * This library 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
- * version 2.1 of the License.
- * This library 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
- * program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
- * Floor, Boston, MA  02110-1301, USA.
- **/
-package org.jbpm.pvm.test.base;
-
-import junit.extensions.TestSetup;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * @author Guillaume Porcher
- * 
- */
-public class EnvironmentFactoryTestSetup extends TestSetup
-{
-  private String configResource;
-
-  public EnvironmentFactoryTestSetup(Test test)
-  {
-    this(test, "environment.cfg.xml");
-  }
-
-  public EnvironmentFactoryTestSetup(Class<?> testClass)
-  {
-    this(new TestSuite(testClass), "environment.cfg.xml");
-  }
-
-  public EnvironmentFactoryTestSetup(Test test, String configResource)
-  {
-    super(test);
-    this.configResource = configResource;
-  }
-
-  public EnvironmentFactoryTestSetup(Class<?> testClass, String configResource)
-  {
-    super(new TestSuite(testClass));
-    this.configResource = configResource;
-  }
-
-  @Override
-  protected void setUp() throws Exception
-  {
-    super.setUp();
-    EnvironmentFactoryTestCase.createEnvironmentFactory(configResource);
-  }
-
-  @Override
-  protected void tearDown() throws Exception
-  {
-    EnvironmentFactoryTestCase.closeEnvironmentFactory(configResource);
-    super.tearDown();
-  }
-}

Deleted: jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentTestCase.java
===================================================================
--- jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentTestCase.java	2008-10-31 10:21:24 UTC (rev 2699)
+++ jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/EnvironmentTestCase.java	2008-10-31 10:23:57 UTC (rev 2700)
@@ -1,58 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.test.base;
-
-import org.jbpm.pvm.env.Environment;
-
-/**
- * @author Tom Baeyens
- */
-public abstract class EnvironmentTestCase extends EnvironmentFactoryTestCase {
-
-  protected Environment environment;
-  
-  public EnvironmentTestCase() {
-  }
-
-  public EnvironmentTestCase(String configResource) {
-    super(configResource);
-  }
-
-  public void setUp() throws Exception {
-    super.setUp();
-    openEnvironment();
-  }
-
-  public void tearDown() throws Exception {
-    closeEnvironment();
-    super.tearDown();
-  }
-  
-  void closeEnvironment() {
-    environment.close();
-    environment = null;
-  }
-
-  void openEnvironment() {
-    environment = getEnvironmentFactory().openEnvironment();
-  }
-}

Deleted: jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/JbpmTestCase.java
===================================================================
--- jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/JbpmTestCase.java	2008-10-31 10:21:24 UTC (rev 2699)
+++ jbpm4/trunk/modules/test/src/main/java/org/jbpm/test/JbpmTestCase.java	2008-10-31 10:23:57 UTC (rev 2700)
@@ -1,79 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.test.base;
-
-import junit.framework.AssertionFailedError;
-import junit.framework.TestCase;
-
-import org.jbpm.pvm.env.Environment;
-import org.jbpm.pvm.env.EnvironmentFactory;
-import org.jbpm.pvm.env.PvmEnvironmentFactory;
-import org.jbpm.pvm.internal.log.Jdk14LogFactory;
-import org.jbpm.pvm.internal.log.Log;
-import org.jbpm.pvm.internal.log.LogFormatter;
-
-public abstract class JbpmTestCase extends TestCase {
-
-  static {
-    Jdk14LogFactory.initializeJdk14Logging(); 
-  }
-
-  public void setUp() throws Exception {
-    assertNull(Environment.getCurrent());
-    LogFormatter.resetIndentation();
-    log.info("=== starting "+getName()+" =============================");
-  }
-
-  public void tearDown() throws Exception {
-    log.info("=== ending "+getName()+" =============================\n");
-    assertNull(Environment.getCurrent());
-  }
-
-  public void assertTextPresent(String expected, String value) {
-    if ( (value==null)
-         || (value.indexOf(expected)==-1)
-       ) {
-      throw new AssertionFailedError("expected presence of '"+expected+"' but was '"+value+"'");
-    }
-  }
-  
-  public static Environment openEnvironment(String xmlString) {
-    EnvironmentFactory environmentFactory = PvmEnvironmentFactory.parseXmlString(xmlString);
-    return environmentFactory.openEnvironment();
-  }
-
-  protected void runTest() throws Throwable {
-    try {
-      super.runTest();
-    } catch (AssertionFailedError e) {
-      log.error("");
-      log.error("ASSERTION FAILURE: "+e.getMessage());
-      log.error("");
-      throw e;
-    } catch (Throwable t) {
-      t.printStackTrace();
-      throw t;
-    }
-  }
-
-  static protected Log log = Log.getLog(JbpmTestCase.class.getName());
-}

Modified: jbpm4/trunk/pom.xml
===================================================================
--- jbpm4/trunk/pom.xml	2008-10-31 10:21:24 UTC (rev 2699)
+++ jbpm4/trunk/pom.xml	2008-10-31 10:23:57 UTC (rev 2700)
@@ -34,10 +34,11 @@
   <!-- Modules -->
   <modules>
     <module>modules/api</module>
-    <module>modules/pvm</module>
     <module>modules/cts</module>
     <module>modules/jpdl</module>
+    <module>modules/log</module>
     <module>modules/manual</module>
+    <module>modules/pvm</module>
     <module>modules/test</module>
   </modules>
   




More information about the jbpm-commits mailing list