Testing junit springway tests. Failure.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2015 03:06 AM
If i do just like in the tutorial example with @Deployment annotation it produce this output:
<c>
INFO: Refreshing org.springframework.context.support.GenericApplicationContext@4ae69619: startup date [Thu Jun 11 10:07:04 AST 2015]; root of context hierarchy
июн 11, 2015 10:07:07 AM org.activiti.engine.impl.ProcessEngineImpl <init>
INFO: ProcessEngine default created
июн 11, 2015 10:07:07 AM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource D:\Java\workspace\HelloWorld\target\classes\diagrams\autodeploy.HelloProcess.HelloProcessId.png
июн 11, 2015 10:07:07 AM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource D:\Java\workspace\HelloWorld\target\classes\diagrams\autodeploy.HelloProcess.bpmn
Hello world
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 4.714 sec <<< FAILURE!
Results :
Tests in error:
simpleProcessTest(HelloTest)
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
[INFO] ————————————————————————
[INFO] BUILD FAILURE
[INFO] ————————————————————————
</c>
And when i comment @deployment annotation everything runs fine.
My code:
import static org.junit.Assert.*;import org.junit.runner.RunWith;import org.junit.Test;import org.activiti.engine.RuntimeService;import org.activiti.engine.test.ActivitiRule;import org.activiti.engine.test.Deployment;import org.junit.Rule;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;import org.springframework.test.context.ContextConfiguration;@RunWith(SpringJUnit4ClassRunner.class)@ContextConfiguration("classpath:activiti-context.xml")public class HelloTest { @Autowired private RuntimeService runtimeService; @Autowired @Rule public ActivitiRule activitiRule; @Test @Deployment public void simpleProcessTest() { runtimeService.startProcessInstanceByKey("HelloProcessId"); assertEquals(0,0); }}
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2015 03:10 AM
pom, context.xml in attach
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2015 03:12 PM
I would guess that process is deployed twice.
delete
<property name="deploymentResources"
value="classpath*:diagrams/autodeploy.*.bpmn" />
from activiti context and uncomment deploy annotation.
Regards
Martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2015 02:27 AM
Still the same.
Maven still tells me:
<c>
июн 15, 2015 9:12:35 AM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource D:\Java\workspace\HelloWorld\target\classes\diagrams\autodeploy.HelloProcess.HelloProcessId.png
июн 15, 2015 9:12:35 AM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource D:\Java\workspace\HelloWorld\target\classes\diagrams\autodeploy.HelloProcess.bpmn
</c>
Even after i deleted that string, and made clean and then install. Even after i renamed autodeploy.HelloProcess.bpmn to autodeplo.HelloProcess.bpmn the output was the same. I used total commander to search "autodeploy." references in my project but found it only in context.xml and it's that string.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2015 03:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2015 03:59 AM
@Deployment(resources = {"diagrams/autodeploy.HelloProcess.bpmn"})
Now it works.
Now i don't understand how it works without that argument, and why i found nothing about this in tutorial.
Anyway, thanks for your help. It was useful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2015 05:13 AM
Do you have a reproducible unit test I can try out?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2015 08:03 AM
When i execute test by eclipse everything is fine.
I am new to java, so i am learning all this stuff.
Anyway, here is my "project".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2015 02:55 AM
your test uses oracleDB.
[ERROR] Failed to execute goal on project hello-world-test: Could not resolve dependencies for project org.fbconsult:hello-world-test:jar:1.0: Could not find artifact com.oracle
jdbc6:jar:11.2.0 at specified path D:\Java\ojdbc6.jar
Could you create H2 jUnit test please?
Regards
Martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2015 08:31 AM
