[jbpm-commits] JBoss JBPM SVN: r3952 - in jbpm4/trunk/modules: jpdl and 5 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Feb 19 12:09:21 EST 2009


Author: tom.baeyens at jboss.com
Date: 2009-02-19 12:09:20 -0500 (Thu, 19 Feb 2009)
New Revision: 3952

Removed:
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/env/EnvironmentHelper.java
   jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/controlflow/
Modified:
   jbpm4/trunk/modules/jpdl/pom.xml
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExclusiveExpressionActivity.java
   jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/JpdlSchemaTest.java
   jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ProcessParsingTest.java
   jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/TransitionParsingTest.java
   jbpm4/trunk/modules/pvm/pom.xml
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/EnvironmentDefaults.java
Log:
JBPM-1759 cleanup excluded tests

Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/env/EnvironmentHelper.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/env/EnvironmentHelper.java	2009-02-19 15:35:57 UTC (rev 3951)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/env/EnvironmentHelper.java	2009-02-19 17:09:20 UTC (rev 3952)
@@ -1,60 +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.env;
-
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jbpm.JbpmException;
-
-/**
- * @author Tom Baeyens
- */
-public abstract class EnvironmentHelper {
-  
-  static Map<Class<?>, Object> defaultObjectCache = new HashMap<Class<?>, Object>();
-
-  public static <T> T get(Class<T> type) {
-    if (type==null) {
-      return null;
-    }
-    Environment environment = Environment.getCurrent();
-    if (environment!=null) {
-      return environment.get(type);  
-    }
-    if (defaultObjectCache.containsKey(type)) {
-      return (T) defaultObjectCache.get(type);
-    }
-    try {
-      Method defaultFactoryMethod = type.getMethod("createDefault");
-      if (defaultFactoryMethod!=null) {
-        Object defaultObject = defaultFactoryMethod.invoke(null);
-        defaultObjectCache.put(type, defaultObject);
-        return (T) defaultObject;
-      }
-    } catch (Exception e) {
-      throw new JbpmException("couldn't create default "+type.getName(), e);
-    }
-    return null;
-  }
-}

Modified: jbpm4/trunk/modules/jpdl/pom.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/pom.xml	2009-02-19 15:35:57 UTC (rev 3951)
+++ jbpm4/trunk/modules/jpdl/pom.xml	2009-02-19 17:09:20 UTC (rev 3952)
@@ -104,12 +104,6 @@
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
           <excludes>
-            <!-- https://jira.jboss.org/jira/browse/JBPM-1759 -->
-            <exclude>org/jbpm/jpdl/controlflow/DecisionExpressionTest.java</exclude>
-            <exclude>org/jbpm/jpdl/controlflow/DecisionHandlerTest.java</exclude>
-            <exclude>org/jbpm/jpdl/parsing/JpdlSchemaTest.java</exclude>
-            <exclude>org/jbpm/jpdl/parsing/ProcessParsingTest.java</exclude>
-            <exclude>org/jbpm/jpdl/parsing/TransitionParsingTest.java</exclude>
           </excludes>
         </configuration>
       </plugin>

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExclusiveExpressionActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExclusiveExpressionActivity.java	2009-02-19 15:35:57 UTC (rev 3951)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExclusiveExpressionActivity.java	2009-02-19 17:09:20 UTC (rev 3952)
@@ -23,9 +23,9 @@
 
 import org.jbpm.JbpmException;
 import org.jbpm.activity.ActivityExecution;
-import org.jbpm.env.EnvironmentHelper;
 import org.jbpm.model.Activity;
 import org.jbpm.model.Transition;
+import org.jbpm.pvm.internal.env.EnvironmentDefaults;
 import org.jbpm.pvm.internal.script.ScriptManager;
 
 /**
@@ -42,7 +42,7 @@
     Activity activity = execution.getActivity();
     String transitionName = null;
 
-    ScriptManager scriptManager = EnvironmentHelper.get(ScriptManager.class);
+    ScriptManager scriptManager = EnvironmentDefaults.getScriptManager();
     Object result = scriptManager.evaluateExpression(expr, execution, lang);
     if ( (result!=null)
          && (! (result instanceof String))

Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/JpdlSchemaTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/JpdlSchemaTest.java	2009-02-19 15:35:57 UTC (rev 3951)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/JpdlSchemaTest.java	2009-02-19 17:09:20 UTC (rev 3952)
@@ -32,12 +32,16 @@
 public class JpdlSchemaTest extends JpdlParseTestCase {
 
   public void testSimplestValidProcess() {
-    List<Problem> problems = parseProblems(
-      "<jpdl:process xmlns:jpdl='http://jbpm.org/4/jpdl' " +
-      "              name='p' >" +
-      "  <jpdl:start name='n' />" +
-      "</jpdl:process>"
-    );
-    assertEquals("", problems.toString());
+    List<Problem> problems = jpdlParser.createParse()
+      .setString(
+          "<jpdl:process xmlns:jpdl='http://jbpm.org/4/jpdl' " +
+          "              name='p' >" +
+          "  <jpdl:start name='n' />" +
+          "</jpdl:process>"
+      )
+      .execute()
+      .getProblems();
+
+    assertEquals(0, problems.size());
   }
 }

Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ProcessParsingTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ProcessParsingTest.java	2009-02-19 15:35:57 UTC (rev 3951)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ProcessParsingTest.java	2009-02-19 17:09:20 UTC (rev 3952)
@@ -33,13 +33,13 @@
 
   public void testSimplestValidProcess() {
     ClientProcessDefinition processDefinition = parse(
-      "<process name='p' initial='n'>" +
-      "  <state name='n' />" +
+      "<process name='p'>" +
+      "  <start name='s' />" +
       "</process>"
     );
     assertEquals("p", processDefinition.getName());
-    assertNotNull(processDefinition.getActivity("n"));
-    assertSame(processDefinition.getActivity("n"), processDefinition.getInitial());
+    assertNotNull(processDefinition.getActivity("s"));
+    assertSame(processDefinition.getActivity("s"), processDefinition.getInitial());
     assertEquals(1, processDefinition.getActivities().size());
   }
 
@@ -48,32 +48,15 @@
       "<process />"
     );
     assertTextPresent("attribute <process name=\"...\" is required", problems.get(0).getMsg());
-    assertTextPresent("attribute <process initial=\"...\" is required", problems.get(1).getMsg());
   }
 
 
-  public void testProcessWithNameOnly() {
-    List<Problem> problems = parseProblems(
-      "<process name='test' />"
-    );
-    assertTextPresent("attribute <process initial=\"...\" is required", problems.get(0).getMsg());
-  }
-
-  public void testProcessWithInitialOnly() {
-    List<Problem> problems = parseProblems(
-      "<process initial='a'>" +
-      "  <state name='a' />" +
-      "</process>"
-    );
-    assertTextPresent("attribute <process name=\"...\" is required", problems.get(0).getMsg());
-  }
-
-
   public void testEmptyProcessName() {
     List<Problem> problems = parseProblems(
       "<process name='' />"
     );
     assertTextPresent("attribute <process name=\"\" is empty", problems.get(0).getMsg());
+    assertTextPresent("no start activity in process", problems.get(1).getMsg());
   }
 
   public void testProcessWithUnexistingInitial() {
@@ -81,12 +64,6 @@
       "<process name='p' initial='ufo' />"
     );
     assertTextPresent("initial activity 'ufo' was not found", problems.get(0).getMsg());
+    assertTextPresent("no start activity in process", problems.get(1).getMsg());
   }
-
-  public void testProcessWithEmptyInitial() {
-    List<Problem> problems = parseProblems(
-      "<process name='p' initial='' />"
-    );
-    assertTextPresent("attribute <process initial=\"\" is empty", problems.get(0).getMsg());
-  }
 }

Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/TransitionParsingTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/TransitionParsingTest.java	2009-02-19 15:35:57 UTC (rev 3951)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/TransitionParsingTest.java	2009-02-19 17:09:20 UTC (rev 3952)
@@ -36,10 +36,10 @@
 
   public void testTransition() {
     ClientProcessDefinition processDefinition = parse(
-      "<process name='p' initial='a'>" +
-      "  <state name='a'>" +
+      "<process name='p'>" +
+      "  <start name='a'>" +
       "    <transition to='b' />" +
-      "  </state>" +
+      "  </start>" +
       "  <state name='b' />" +
       "</process>"
     );
@@ -54,10 +54,10 @@
 
   public void testSelfTransition() {
     ClientProcessDefinition processDefinition = parse(
-      "<process name='p' initial='a'>" +
-      "  <state name='a'>" +
+      "<process name='p'>" +
+      "  <start name='a'>" +
       "    <transition to='a' />" +
-      "  </state>" +
+      "  </start>" +
       "</process>"
     );
     Activity a = processDefinition.getActivity("a");
@@ -69,10 +69,10 @@
 
   public void testMissingTransitionDestination() {
     List<Problem> problems = parseProblems(
-      "<process name='p' initial='a'>" +
-      "  <state name='a'>" +
+      "<process name='p'>" +
+      "  <start name='a'>" +
       "    <transition />" +
-      "  </state>" +
+      "  </start>" +
       "</process>"
     );
     assertTextPresent("attribute <transition to=\"...\" is required", problems.get(0).getMsg());
@@ -80,10 +80,10 @@
 
   public void testEmptyTransitionDestination() {
     List<Problem> problems = parseProblems(
-      "<process name='p' initial='a'>" +
-      "  <state name='a'>" +
+      "<process name='p'>" +
+      "  <start name='a'>" +
       "    <transition to='' />" +
-      "  </state>" +
+      "  </start>" +
       "</process>"
     );
     assertTextPresent("attribute <transition to=\"\" is empty", problems.get(0).getMsg());
@@ -91,10 +91,10 @@
 
   public void testInvalidTransitionDestination() {
     List<Problem> problems = parseProblems(
-      "<process name='p' initial='a'>" +
-      "  <state name='a'>" +
+      "<process name='p'>" +
+      "  <start name='a'>" +
       "    <transition to='unexisting' />" +
-      "  </state>" +
+      "  </start>" +
       "</process>"
     );
     assertTextPresent("attribute <transition to=\"unexisting\" doesn't reference an existing activity name", problems.get(0).getMsg());
@@ -102,12 +102,12 @@
 
   public void testMultipleOutgoingTransitions() {
     ClientProcessDefinition processDefinition = parse(
-      "<process name='p' initial='a'>" +
-      "  <state name='a'>" +
+      "<process name='p'>" +
+      "  <start name='a'>" +
       "    <transition to='b' />" +
       "    <transition to='b' />" +
       "    <transition to='c' />" +
-      "  </state>" +
+      "  </start>" +
       "  <state name='b' />" +
       "  <state name='c' />" +
       "</process>"
@@ -123,11 +123,11 @@
 
   public void testMultipleIncomingTransitions() {
     ClientProcessDefinition processDefinition = parse(
-      "<process name='p' initial='a'>" +
-      "  <state name='a'>" +
+      "<process name='p'>" +
+      "  <start name='a'>" +
       "    <transition to='c' />" +
       "    <transition to='c' />" +
-      "  </state>" +
+      "  </start>" +
       "  <state name='b'>" +
       "    <transition to='c' />" +
       "  </state>" +

Modified: jbpm4/trunk/modules/pvm/pom.xml
===================================================================
--- jbpm4/trunk/modules/pvm/pom.xml	2009-02-19 15:35:57 UTC (rev 3951)
+++ jbpm4/trunk/modules/pvm/pom.xml	2009-02-19 17:09:20 UTC (rev 3952)
@@ -118,9 +118,6 @@
         <configuration>
           <excludes>
             <exclude>**/*TestCase.java</exclude>
-
-            <!-- https://jira.jboss.org/jira/browse/JBPM-1965 -->
-            <exclude>**/NormalMessageTest.java</exclude>            
           </excludes>
         </configuration>
       </plugin>

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/EnvironmentDefaults.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/EnvironmentDefaults.java	2009-02-19 15:35:57 UTC (rev 3951)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/EnvironmentDefaults.java	2009-02-19 17:09:20 UTC (rev 3952)
@@ -23,8 +23,6 @@
 
 import org.jbpm.env.Environment;
 import org.jbpm.pvm.internal.script.ScriptManager;
-import org.jbpm.pvm.internal.type.DefaultTypeSet;
-import org.jbpm.pvm.internal.type.TypeSet;
 
 
 /** central location for configuration objects that also 
@@ -40,7 +38,7 @@
 public abstract class EnvironmentDefaults {
 
   public static ScriptManager getScriptManager() {
-    ScriptManager scriptManager = Environment.getFromCurrent(ScriptManager.class);
+    ScriptManager scriptManager = Environment.getFromCurrent(ScriptManager.class, false);
     if (scriptManager!=null) {
       return scriptManager;
     }




More information about the jbpm-commits mailing list