06-10-2011 08:45 AM
@Test
@ContextConfiguration
public class DemoProcessTest extends AbstractTestNGSpringContextTests {
@Autowired
private RepositoryService repositoryService;
@Deployment(resources = {"workflow/demo.bpmn20.xml"})
public void simpleTest() {
ProcessDefinition financialReport = repositoryService.createProcessDefinitionQuery()
.processDefinitionKey("financialReport").latestVersion().singleResult();
Assert.assertNotNull(financialReport);
}
}
06-10-2011 08:50 AM
* <p>You can declare a deployment with the {@link Deployment} annotation.
* This base class will make sure that this deployment gets deployed before the
* setUp and {@link RepositoryService#deleteDeployment(String, boolean) cascade deleted}
* after the tearDown.
* </p>
06-10-2011 09:10 AM
06-10-2011 09:13 AM
deploymentId = TestHelper.annotationDeploymentSetUp(processEngine, method.getMethod().getDeclaringClass(), method.getName());
// … and later…
TestHelper.annotationDeploymentTearDown(processEngine, deploymentId, method.getMethod().getDeclaringClass(), method.getName());
06-10-2011 10:50 AM
@Test
@ContextConfiguration
public class DemoProcessTest extends AbstractTestNGSpringContextTests {
@Autowired
private ProcessEngine processEngine;
@Autowired
private RepositoryService repositoryService;
private ThreadLocal<String> deploymentId = new ThreadLocal<String>();
@BeforeMethod
public void setup(java.lang.reflect.Method method) {
String id = TestHelper.annotationDeploymentSetUp(processEngine, method.getDeclaringClass(), method.getName());
this.deploymentId.set(id);
}
@AfterMethod
public void tearDown(java.lang.reflect.Method method) {
TestHelper.annotationDeploymentTearDown(processEngine, this.deploymentId.get(), method
.getDeclaringClass(), method.getName());
this.deploymentId.remove();
}
@Deployment(resources = {"workflow/demo.bpmn20.xml"})
public void simpleTest() {
ProcessDefinition financialReport = repositoryService.createProcessDefinitionQuery()
.processDefinitionKey("financialReport").latestVersion().singleResult();
Assert.assertNotNull(financialReport);
}
}
06-12-2011 04:30 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.