Commit 5c256f2b authored by Romain Bioteau's avatar Romain Bioteau
Browse files

Fix invalid thread access

parent bfdceb4c
......@@ -71,18 +71,16 @@ public class RunProcessOperation implements IRunnableWithProgress, Runnable {
@Override
public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
monitor.beginTask(Messages.running, IProgressMonitor.UNKNOWN);
final DeployProcessOperation operation = createDeployProcessOperation();
operation.setConfigurationId(executionContext.getConfigurationId());
operation.setObjectToExclude(executionContext.getExcludedObject());
for (final AbstractProcess process : processSelector.getExecutableProcesses()) {
operation.addProcessToDeploy(process);
}
status = operation.run(monitor);
if (status == null) {
return;
final DeployProcessOperation deployOperation = createDeployProcessOperation();
deployOperation.setConfigurationId(executionContext.getConfigurationId());
deployOperation.setObjectToExclude(executionContext.getExcludedObject());
for (final AbstractProcess process : processSelector.getExecutableProcesses()) {
deployOperation.addProcessToDeploy(process);
}
if (status.getSeverity() == IStatus.CANCEL) {
status = deployOperation.run(monitor);
if (status == null
|| status.getSeverity() == IStatus.CANCEL) {
return;
}
if (!status.isOK()) {
......@@ -102,7 +100,7 @@ public class RunProcessOperation implements IRunnableWithProgress, Runnable {
if (processToRun != null) {
final boolean hasInitiator = hasInitiator(processToRun);
try {
url = operation.getUrlFor(processToRun, monitor);
url = deployOperation.getUrlFor(processToRun, monitor);
if (!executionContext.synchronousExecution()) {
BOSWebServerManager.getInstance().startServer(monitor);
if (hasInitiator) {
......
......@@ -17,6 +17,7 @@
*/
package org.bonitasoft.studio.tests.processzoo;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNotSame;
......@@ -107,7 +108,6 @@ public class TestProcessZoo {
.getActivePage().getEditorReferences().length);
}
final AbstractProcess diagram = (AbstractProcess) processEditor.getDiagramEditPart().resolveSemanticElement();
if (file.getAbsolutePath().endsWith(".bos")) {// Check unresolved dependencies for BAR Files
final DependencyRepositoryStore store = RepositoryManager.getInstance().getRepositoryStore(
DependencyRepositoryStore.class);
......@@ -127,16 +127,17 @@ public class TestProcessZoo {
}
}
final RunProcessCommand command = new RunProcessCommand(true);
command.execute(ProcessSelector.createExecutionEvent(diagram));
assertNotNull("There should be an application deployed and running for " + url, command.getUrl().getContent());
final RunProcessCommand runProcessCommand = new RunProcessCommand(true);
runProcessCommand.execute(ProcessSelector.createExecutionEvent((AbstractProcess) diagram.getElements().get(0)));
assertThat(runProcessCommand.getUrl()).isNotNull();
assertNotNull("There should be an application deployed and running for " + url, runProcessCommand.getUrl().getContent());
}
/* attempt to be able to run the test locally */
protected List<URL> getEntries() {
final List<URL> res = new ArrayList<URL>();
final String[] nameForEntry = new String[] {
"toqa/Buy a NEW mini-1.0.bos",
"toqa/Buy a NEW mini-6.4.bos",
"BPMN-ShowcaseToTestDynamicLabels-1.0.bos",
"testonsLesValidateurs-1.0.bos"
// Deactivate previous processes import
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment