List of usage examples for org.eclipse.jface.dialogs IDialogConstants FINISH_LABEL
String FINISH_LABEL
To view the source code for org.eclipse.jface.dialogs IDialogConstants FINISH_LABEL.
Click Source Link
From source file:org.bonitasoft.studio.tests.timer.TestTimer.java
License:Open Source License
public void testEditTimerCondition() throws IOException { /*Import process*/ SWTBotTestUtil.importProcessWIthPathFromClass(bot, "TestTimer_1_0.bos", "Bonita 6.x", "TestTimer", this.getClass(), false); SWTBotGefEditor gefEditor = bot.gefEditor(bot.activeEditor().getTitle()); /*Select step on which there is the connector to test*/ gefEditor.select(gefEditor.getEditPart("StartTimer").parent()); bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_PROCESS_GENERAL).setFocus(); SWTBotTestUtil.selectTabbedPropertyView(bot, "General"); bot.button(Messages.editCondition).click(); bot.waitUntil(Conditions.shellIsActive(Messages.timerConditionWizardTitle)); /*In the wizard add the data*/ String testValue = "0 0 12 1/1 * ? *"; bot.textWithId(SWTBOT_ID_EXPRESSIONVIEWER_TEXT).setText(testValue); bot.sleep(500); // Due to delayed observable on databinding bot.button(IDialogConstants.FINISH_LABEL).click(); bot.activeEditor().save();//from w w w .ja va2 s . c om /*Ensure that the field is correctly fill*/ assertEquals(testValue, bot.textWithLabel(Messages.timerCondition).getText()); bot.saveAllEditors(); bot.closeAllEditors(); }
From source file:org.bonitasoft.studio.tests.timer.TestTimer.java
License:Open Source License
/** Set properties on a "Every Minute" Timer in a new Diagram. * //w w w.j a v a 2s. co m * @throws IOException * @throws InterruptedException * @throws ExecutionException */ public void testEditTimerConditionEveryMinute() throws Exception { // create new Diagram SWTBotGefEditor gmfEditor = createNewEmptyDiagram(); createStartTimerDiagram(gmfEditor); // "Timer1", "Every minute" setCycleType(gmfEditor, TestTimer.DEFAULT_TIMER_NAME, Messages.minutes); // in the shell editor for 'Every minute' bot.textWithLabel(Messages.every).setText("5"); bot.button(Messages.generateCronButtonLabel).click(); bot.button(IDialogConstants.FINISH_LABEL).click(); Assert.assertEquals("Error: Wrong Timer Condition", "0 0/5 * 1/1 * ? *", bot.textWithLabel(Messages.timerCondition).getText()); bot.menu("Diagram").menu("Save").click(); IStatus status = SWTBotTestUtil.selectAndRunFirstPoolFound(bot); assertTrue(status.getMessage(), status.isOK()); }
From source file:org.bonitasoft.studio.tests.timer.TestTimer.java
License:Open Source License
/** Set properties on a "Every Year" Timer in a new Diagram. * //from w w w.j a v a2 s.c om * @throws IOException * @throws InterruptedException * @throws ExecutionException */ public void testEditTimerConditionEveryYear() throws Exception { // create new Diagram SWTBotGefEditor gmfEditor = createNewEmptyDiagram(); createStartTimerDiagram(gmfEditor); // Every year setCycleType(gmfEditor, TestTimer.DEFAULT_TIMER_NAME, Messages.yearly); bot.radio(Messages.the).click(); bot.comboBox(1).setSelection(Messages.second); bot.comboBox(3).setSelection(Messages.april); bot.comboBox(4).setSelection("08"); bot.comboBox(5).setSelection("30"); bot.button(Messages.generateCronButtonLabel).click(); bot.button(IDialogConstants.FINISH_LABEL).click(); Assert.assertEquals("Error: Wrong Timer Condition", "0 30 8 ? 4 MON#2 *", bot.textWithLabel(Messages.timerCondition).getText()); bot.menu("Diagram").menu("Save").click(); IStatus status = SWTBotTestUtil.selectAndRunFirstPoolFound(bot); assertTrue(status.getMessage(), status.isOK()); }
From source file:org.bonitasoft.studio.tests.timer.TestTimer.java
License:Open Source License
/** Set properties on a "Every Month" Timer in a new Diagram. * //www . ja va 2 s . c o m * @throws IOException * @throws InterruptedException */ public void testEditTimerConditionEveryMonth() throws Exception { // create new Diagram SWTBotGefEditor gmfEditor = createNewEmptyDiagram(); createStartTimerDiagram(gmfEditor); // "Timer1", "Every month" setCycleType(gmfEditor, TestTimer.DEFAULT_TIMER_NAME, Messages.monthly); bot.radio(Messages.the).click(); bot.comboBox(0).setSelection(Messages.second); bot.comboBox(1).setSelection(Messages.tuesday); bot.button(Messages.generateCronButtonLabel).click(); bot.button(IDialogConstants.FINISH_LABEL).click(); Assert.assertEquals("Error: Wrong Timer Condition", "0 0 12 ? 1/1 TUE#2 *", bot.textWithLabel(Messages.timerCondition).getText()); bot.menu("Diagram").menu("Save").click(); IStatus status = SWTBotTestUtil.selectAndRunFirstPoolFound(bot); assertTrue(status.getMessage(), status.isOK()); }
From source file:org.bonitasoft.studio.tests.timer.TestTimer.java
License:Open Source License
/** Set properties on a "Every Week" Timer in a new Diagram. * //from w w w . ja v a2 s.c o m * @throws IOException * @throws InterruptedException */ public void testEditTimerConditionEveryWeek() throws Exception { // create new Diagram SWTBotGefEditor gmfEditor = createNewEmptyDiagram(); createStartTimerDiagram(gmfEditor); // Timer 1, Every week setCycleType(gmfEditor, TestTimer.DEFAULT_TIMER_NAME, Messages.weekly); bot.checkBox(Messages.wednesday).select(); // "at" bot.comboBox(0).setSelection("09"); bot.comboBox(1).setSelection("15"); bot.button(Messages.generateCronButtonLabel).click(); bot.button(IDialogConstants.FINISH_LABEL).click(); Assert.assertEquals("Error: Wrong Timer Condition", "0 15 9 ? * WED *", bot.textWithLabel(Messages.timerCondition).getText()); bot.menu("Diagram").menu("Save").click(); IStatus status = SWTBotTestUtil.selectAndRunFirstPoolFound(bot); assertTrue(status.getMessage(), status.isOK()); }
From source file:org.bonitasoft.studio.tests.timer.TestTimer.java
License:Open Source License
/** Set properties on a "Every Day" Timer in a new Diagram. * //www .j ava2s. com * @throws IOException * @throws InterruptedException */ public void testEditTimerConditionEveryDay() throws Exception { // create new Diagram SWTBotGefEditor gmfEditor = createNewEmptyDiagram(); createStartTimerDiagram(gmfEditor); setCycleType(gmfEditor, TestTimer.DEFAULT_TIMER_NAME, Messages.daily); // "Every day at" bot.comboBox(0).setSelection("14"); bot.comboBox(1).setSelection("00"); bot.button(Messages.generateCronButtonLabel).click(); bot.button(IDialogConstants.FINISH_LABEL).click(); // "Every day at xx:yy:zz" Assert.assertEquals("Error: Wrong Timer Condition", "0 0 14 1/1 * ? *", bot.textWithLabel(Messages.timerCondition).getText()); bot.menu("Diagram").menu("Save").click(); IStatus status = SWTBotTestUtil.selectAndRunFirstPoolFound(bot); assertTrue(status.getMessage(), status.isOK()); }
From source file:org.bonitasoft.studio.tests.timer.TestTimer.java
License:Open Source License
/** Set properties on a "Every Hour" Timer in a new Diagram. * /*from w w w. ja v a 2 s .c o m*/ * @throws IOException * @throws InterruptedException */ public void testEditTimerConditionEveryHour() throws Exception { // create new Diagram SWTBotGefEditor gmfEditor = createNewEmptyDiagram(); createStartTimerDiagram(gmfEditor); // "Timer1", "Every hour" setCycleType(gmfEditor, TestTimer.DEFAULT_TIMER_NAME, Messages.hourly); // text with label "Every" bot.textWithLabel(Messages.hourLabel).setText("4"); bot.button(Messages.generateCronButtonLabel).click(); bot.button(IDialogConstants.FINISH_LABEL).click(); // "Every 4 hours" Assert.assertEquals("Error: Wrong Timer Condition", "0 0 0/1 1/1 * ? *", bot.textWithLabel(Messages.timerCondition).getText()); bot.menu("Diagram").menu("Save").click(); IStatus status = SWTBotTestUtil.selectAndRunFirstPoolFound(bot); assertTrue(status.getMessage(), status.isOK()); }
From source file:org.bonitasoft.studio.tests.timer.TestTimer.java
License:Open Source License
/** Set properties on a Duration Timer . * // ww w .j a v a 2 s . com * @throws IOException * @throws InterruptedException */ public void testEditDurationTimerCondition() throws Exception { // Create a new Diagram and add a timer and a Service Task linked SWTBotGefEditor gmfEditor = addTimerAndTaskToDiagram(); // Set Timer1 editTimerCondition(gmfEditor, DEFAULT_TIMER_NAME); // Select the Duration bot.radio(Messages.durationLabel).click(); // Add a Duration of 2 days, 2 hours and 2 minutes. bot.spinnerWithLabel(org.bonitasoft.studio.common.Messages.daysLabel).setSelection(2); bot.spinnerWithLabel(org.bonitasoft.studio.common.Messages.hoursLabel).setSelection(2); bot.spinnerWithLabel(org.bonitasoft.studio.common.Messages.minutesLabel).setSelection(2); bot.button(Messages.generateDurationLabel).click(); bot.button(IDialogConstants.FINISH_LABEL).click(); String conditionRes = 2 + " " + daysLabel + " " + "02:02:00"; Assert.assertEquals("Error: Wrong Timer Condition", conditionRes, bot.textWithLabel(Messages.timerCondition).getText()); bot.menu("Diagram").menu("Save").click(); IStatus status = SWTBotTestUtil.selectAndRunFirstPoolFound(bot); assertTrue(status.getMessage(), status.isOK()); }
From source file:org.bonitasoft.studio.tests.timer.TestTimer.java
License:Open Source License
/**Set properties on a Fixed Date Timer . * //from ww w. ja v a 2 s . co m * @throws InterruptedException * @throws ParseException */ public void testEditFixedDateTimerCondition() throws Exception { SWTBotGefEditor gmfEditor = addTimerAndTaskToDiagram(); // Set Timer1 editTimerCondition(gmfEditor, DEFAULT_TIMER_NAME); // Select the date bot.radio(Messages.fixedDate).click(); Date d = new Date(); bot.dateTime(0).setDate(d); bot.dateTime(1).setDate(d); bot.button(Messages.generateFixedDateLabel).click(); bot.button(IDialogConstants.FINISH_LABEL).click(); Assert.assertFalse("Error: Wrong Timer Condition", bot.textWithLabel(Messages.timerCondition).getText().isEmpty()); bot.menu("Diagram").menu("Save").click(); IStatus status = SWTBotTestUtil.selectAndRunFirstPoolFound(bot); assertTrue(status.getMessage(), status.isOK()); }
From source file:org.bonitasoft.studio.tests.timer.TestTimer.java
License:Open Source License
/**Set properties on a Fixed Date Timer . * //from w ww . jav a2 s .c om * @throws InterruptedException * @throws ParseException */ public void testEditVariableScriptTimerCondition() throws Exception { SWTBotGefEditor gmfEditor = addTimerAndTaskToDiagram(); // Set Timer1 editTimerCondition(gmfEditor, DEFAULT_TIMER_NAME); bot.toolbarButtonWithId(ExpressionViewer.SWTBOT_ID_EDITBUTTON, 0).click(); // wait for "Edit Expression" shell bot.waitUntil(Conditions.shellIsActive(editExpressionShellLabel)); bot.table().select("Script"); bot.waitUntil(Conditions.widgetIsEnabled(bot.textWithLabel("Name *"))); bot.textWithLabel("Name *").setText("myScript"); bot.styledText().setText("120000"); Assert.assertEquals("Error: Wrong Timer Condition setted", "120000", bot.styledText().getText()); // "Return type" , "java.lang.Long" bot.comboBoxWithLabel(org.bonitasoft.studio.groovy.ui.Messages.returnType) .setSelection(TestTimer.JAVA_LANG_LONG); Assert.assertEquals("Error: Wrong Timer Condition return type setted", TestTimer.JAVA_LANG_LONG, bot.comboBoxWithLabel(org.bonitasoft.studio.groovy.ui.Messages.returnType).getText()); // in the shell editor for 'Every hour' bot.button(IDialogConstants.OK_LABEL).click(); assertEquals("xpression not created correctly", "myScript", bot.text().getText()); bot.button(IDialogConstants.FINISH_LABEL).click(); Assert.assertEquals("Error: Wrong Timer Condition", "00:02:00", bot.textWithLabel(Messages.timerCondition).getText()); bot.menu("Diagram").menu("Save").click(); IStatus status = SWTBotTestUtil.selectAndRunFirstPoolFound(bot); assertTrue(status.getMessage(), status.isOK()); }