Commit d105530b authored by Romain Bioteau's avatar Romain Bioteau

fix deadlock during test

parent 69a0eb23
......@@ -33,11 +33,13 @@ import org.bonitasoft.studio.connector.model.definition.ConnectorDefinition;
import org.bonitasoft.studio.connector.model.definition.ConnectorDefinitionFactory;
import org.bonitasoft.studio.connector.model.i18n.Messages;
import org.bonitasoft.studio.connector.model.implementation.ConnectorImplementation;
import org.bonitasoft.studio.swtbot.framework.conditions.AssertionCondition;
import org.bonitasoft.studio.swtbot.framework.rule.SWTGefBotRule;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.custom.StyleRange;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
import org.eclipse.swtbot.eclipse.gef.finder.SWTGefBot;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
......@@ -134,13 +136,19 @@ public class ActorFilterImplementationTest implements SWTBotConstants {
return "Editor for implementation has not been opened.";
}
}, 30000);
Job.getJobManager().join(ResourcesPlugin.FAMILY_MANUAL_BUILD, Repository.NULL_PROGRESS_MONITOR);
Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, Repository.NULL_PROGRESS_MONITOR);
bot.sleep(1000);
int length = bot.activeEditor().toTextEditor().getText().length();
assertTrue("Invalid file length", length > 0);
StyleRange[] styles = bot.activeEditor().toTextEditor().getStyles(0, 0, length);
containsError(styles);
bot.waitUntil(new AssertionCondition() {
@Override
protected void makeAssert() throws Exception {
SWTBotEclipseEditor editor = ActorFilterImplementationTest.this.bot.activeEditor().toTextEditor();
int length = editor.getText().length();
assertTrue("Invalid file length", editor.getText().length() > 0);
containsError(editor.getStyles(0, 0, length));
}
},10000);
removeImplementation(id);
}
......
Markdown is supported
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