<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
<table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
<tbody>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
<tbody>
<tr>
<td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
<h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
<!-- To have a header image/logo replace the name below with your img tag -->
<!-- Email clients will render the images when the message is read so any image -->
<!-- must be made available on a public server, so that all recipients can load the image. -->
<a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
</td>
</tr>
<tr>
<td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
jBPM junit test error
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/ssampath">ssampath</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/624000#624000">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hi,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span>I am getting started with jBPM and am following the link </span><a class="jive-link-external-small" href="http://docs.jboss.org/tools/2.0.0.GA/jbpm/en/html/Test_Drive_Proc_Development.html" target="_blank">http://docs.jboss.org/tools/2.0.0.GA/jbpm/en/html/Test_Drive_Proc_Development.html</a><span>.</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I created the junit test file and am trying to test the process.  I am however getting the following error:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>[code]</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>org.jbpm.jpdl.JpdlException: [[ERROR] couldn't parse process definition]</p><p>    at org.jbpm.jpdl.xml.JpdlXmlReader.readProcessDefinition(JpdlXmlReader.java:172)</p><p>    at org.jbpm.graph.def.ProcessDefinition.parseXmlInputStream(ProcessDefinition.java:180)</p><p>    at org.jbpm.graph.def.ProcessDefinition.parseXmlResource(ProcessDefinition.java:161)</p><p>    at com.jbay.HiTest.testProcess(HiTest.java:14)</p><p>    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</p><p>    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)</p><p>    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)</p><p>    at java.lang.reflect.Method.invoke(Unknown Source)</p><p>    at junit.framework.TestCase.runTest(TestCase.java:154)</p><p>    at junit.framework.TestCase.runBare(TestCase.java:127)</p><p>    at junit.framework.TestResult$1.protect(TestResult.java:106)</p><p>    at junit.framework.TestResult.runProtected(TestResult.java:124)</p><p>    at junit.framework.TestResult.run(TestResult.java:109)</p><p>    at junit.framework.TestCase.run(TestCase.java:118)</p><p>    at junit.framework.TestSuite.runTest(TestSuite.java:208)</p><p>    at junit.framework.TestSuite.run(TestSuite.java:203)</p><p>    at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)</p><p>    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)</p><p>    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)</p><p>    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)</p><p>    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)</p><p>    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>[/code]</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Here is my test case code:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>[code]</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>package com.jbay;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>import junit.framework.TestCase;</p><p>import org.jbpm.graph.def.ProcessDefinition;</p><p>import org.jbpm.graph.exe.ProcessInstance;</p><p>import org.jbpm.jpdl.xml.JpdlXmlReader;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>import junit.framework.TestCase;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>public class HiTest extends TestCase {</p><p>    </p><p>    public void testProcess() throws Exception{</p><p>        </p><p>        ProcessDefinition definition = ProcessDefinition.parseXmlResource("hi/processdefinition.xml");</p><p>        assertNotNull("Definition should not be null", definition);</p><p>        </p><p>        ProcessInstance instance = new ProcessInstance(definition);</p><p>        assertEquals(</p><p>                "Instance is in start state", instance.getRootToken().getNode().getName(), "start");</p><p>        </p><p>        instance.signal();</p><p>        assertEquals(</p><p>                "Instance is in start1 state", instance.getRootToken().getNode().getName(), "start1");</p><p>        </p><p>        instance.signal();</p><p>        assertEquals(</p><p>                "Instance is in end state", instance.getRootToken().getNode().getName(), "end1");</p><p>        </p><p>        assertTrue("Instance has ended", instance.hasEnded());</p><p>        </p><p>        </p><p>    }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>[/code]</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>And my process definition that I created:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>[code]</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><?xml version="1.0" encoding="UTF-8"?></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><process-definition</p><p>  xmlns="urn:jbpm.org:jpdl-3.2"  name="jBay"></p><p>   <start-state name="start"></p><p>      <transition name="toauction" to="state1"></transition></p><p>   </start-state></p><p>   <state name="state1"></p><p>      <transition name="tr1" to="end1"></transition></p><p>   </state></p><p>   <end-state name="end1"></end-state></p><p></process-definition></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>[/code]</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I am not sure what the error means.  I checked the exception code:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>[code]</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>if (Problem.containsProblemsOfLevel(problems, Problem.LEVEL_ERROR)) {</p><p>      throw new JpdlException(problems);</p><p>    }</p><p>    </p><p>    if (problems!=null) {</p><p>      Iterator iter = problems.iterator();</p><p>      while (iter.hasNext()) {</p><p>        Problem problem = (Problem) iter.next();</p><p>        log.warn("process parse warning: "+problem.getDescription());</p><p>      }</p><p>    }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>[/code]</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I am not sure this is helping me. I renamed the states and transitions to include only letters in order to correct the parsing, but it still gave out the same error.  ANy help would be  nice.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Thanks!</p><p>ssampath</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/624000#624000">going to Community</a></p>
<p style="margin: 0;">Start a new discussion in jBPM at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>