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.expressions.test.TestPatternExpressionViewer.java
License:Open Source License
private void fillPatternExpression() { bot.styledText().setText(QUERY);//from w ww. j ava2s. c o m bot.sleep(1000); bot.button(IDialogConstants.NEXT_LABEL).click(); if (bot.button(IDialogConstants.NEXT_LABEL).isEnabled()) { bot.button(IDialogConstants.NEXT_LABEL).click(); } bot.waitUntil(Conditions.widgetIsEnabled(bot.button(IDialogConstants.FINISH_LABEL)), 5000); bot.button(IDialogConstants.FINISH_LABEL).click(); bot.sleep(1000); bot.activeEditor().save(); }
From source file:org.bonitasoft.expressions.test.TestPatternExpressionViewer.java
License:Open Source License
private void fillGroovyExpression() { bot.link(Messages.switchEditor).click("Switch editor"); bot.button(IDialogConstants.YES_LABEL).click(); editGroovyEditor(0, "Request", String.class.getName(), "sqlQuery", GROOVY_SQL_QUERY); bot.sleep(1000);//from www. jav a2s. co m bot.button(IDialogConstants.NEXT_LABEL).click(); if (bot.button(IDialogConstants.NEXT_LABEL).isEnabled()) { bot.button(IDialogConstants.NEXT_LABEL).click(); } bot.waitUntil(Conditions.widgetIsEnabled(bot.button(IDialogConstants.FINISH_LABEL)), 5000); bot.button(IDialogConstants.FINISH_LABEL).click(); bot.sleep(1000); bot.activeEditor().save(); }
From source file:org.bonitasoft.expressions.test.TestPatternExpressionViewer.java
License:Open Source License
private void createData(String dataName) { SWTBotTestUtil.selectTabbedPropertyView(bot, "Data"); bot.button("Add...").click(); assertFalse(IDialogConstants.FINISH_LABEL + " should be disabled", bot.button(IDialogConstants.FINISH_LABEL).isEnabled()); bot.textWithLabel("Name *").setText(dataName); assertTrue(IDialogConstants.FINISH_LABEL + " should be disabled", bot.button(IDialogConstants.FINISH_LABEL).isEnabled()); bot.button(IDialogConstants.FINISH_LABEL).click(); }
From source file:org.bonitasoft.studio.actors.tests.exporter.SWTBotActorFilterExportTests.java
License:Open Source License
private void exportActorFilter(String connector, String fileName, boolean hasDependencies, boolean hasSources) throws Exception { File f = new File(ProjectUtil.getBonitaStudioWorkFolder().getAbsolutePath()); final String exportPath = f.getAbsolutePath(); SWTBotActorFilterUtil.activateExportActorFilterShell(bot); bot.table().select(connector);/* w ww .j av a 2s . c o m*/ assertFalse("Finish button should be disabled", bot.button(IDialogConstants.FINISH_LABEL).isEnabled()); if (hasSources) { bot.checkBoxWithLabel("Include sources").select(); } else { bot.checkBoxWithLabel("Include sources").deselect(); } if (hasDependencies) { bot.checkBoxWithLabel("Add dependencies").select(); } else { bot.checkBoxWithLabel("Add dependencies").deselect(); } bot.textWithLabel("Destination *").setText(exportPath); bot.waitUntil(Conditions.widgetIsEnabled(bot.button(IDialogConstants.FINISH_LABEL)), 5000); bot.button(IDialogConstants.FINISH_LABEL).click(); bot.waitUntil(Conditions.shellIsActive("Export result")); bot.button(IDialogConstants.OK_LABEL).click(); checkExportedFile(exportPath, fileName, hasDependencies, hasSources); }
From source file:org.bonitasoft.studio.actors.tests.organization.OrganizationCreationTest.java
License:Open Source License
@Test public void testAddOrganization() { final String firstName1 = "Coralie"; final String lastName1 = "Auclair"; final String firstName2 = "Vincent"; final String lastName2 = "Gilbert"; final String firstName3 = "Martin"; final String lastName3 = "Dupuis"; final String organizationName = "Organization1"; final String[] membership1 = { "/Group1", "Role1" }; final ArrayList<String[]> membershipList1 = new ArrayList<String[]>(); membershipList1.add(membership1);/*from ww w. ja va 2 s. c om*/ final ArrayList<String[]> membershipList2 = new ArrayList<String[]>(); final String[] membership2 = { "/Group1/Group3", "Role2" }; membershipList2.add(membership2); final String[] membership3 = { "/Group1/Group2/Group4", "Role3" }; membershipList2.add(membership3); SWTBotActorFilterUtil.activateNewOrganizationWizard(bot); final SWTBotShell shell = bot.shell(Messages.manageOrganizationTitle); bot.button(Messages.add).click(); bot.table(0).select(organizationName); bot.button(IDialogConstants.NEXT_LABEL).click(); bot.button(Messages.addParentGroup).click(); bot.tree().select("Group1"); bot.button(Messages.addSubGroup).click(); bot.tree().select("Group1"); bot.button(Messages.addSubGroup).click(); bot.tree().getTreeItem("Group1").getNode("Group2").select(); bot.button(Messages.addSubGroup).click(); bot.button(Messages.addParentGroup).click(); bot.button(IDialogConstants.NEXT_LABEL).click(); bot.button(Messages.add).click(); bot.button(Messages.add).click(); bot.button(Messages.add).click(); bot.button(IDialogConstants.NEXT_LABEL).click(); String user1 = Messages.defaultUserName + 1; String user2 = Messages.defaultUserName + 2; String user3 = Messages.defaultUserName + 3; addNewUSer(user1, firstName1, lastName1, "", membershipList1); SWTBotTable table = bot.table(); assertEquals("First Name " + firstName1 + " in table should be edited", firstName1, table.cell(0, Messages.firstName)); assertEquals("Last Name " + lastName1 + " in table should be edited", lastName1, table.cell(0, Messages.lastName)); addNewUSer(user2, firstName2, lastName2, user1, membershipList2); assertEquals("First Name " + firstName2 + " in table should be edited", firstName2, table.cell(1, Messages.firstName)); assertEquals("Last Name " + lastName2 + " in table should be edited", lastName2, table.cell(1, Messages.lastName)); addNewUSer(user3, firstName3, lastName3, user2, membershipList2); assertEquals("First Name " + firstName3 + " in table should be edited", firstName3, table.cell(2, Messages.firstName)); assertEquals("Last Name " + lastName3 + " in table should be edited", lastName3, table.cell(2, Messages.lastName)); bot.table().select(0); bot.comboBoxWithLabel(Messages.manager).setSelection(user3); bot.waitUntil(Conditions.widgetIsEnabled(bot.button(IDialogConstants.FINISH_LABEL)), 10000); bot.button(IDialogConstants.FINISH_LABEL).click(); bot.waitUntil(Conditions.shellIsActive(Messages.organizationValidationFailed), 10000); bot.button(IDialogConstants.OK_LABEL).click(); bot.table().select(0); bot.comboBoxWithLabel(Messages.manager).setSelection(""); bot.waitUntil(Conditions.widgetIsEnabled(bot.button(IDialogConstants.FINISH_LABEL)), 10000); bot.button(IDialogConstants.FINISH_LABEL).click(); bot.waitUntil(Conditions.shellCloses(shell)); OrganizationRepositoryStore store = (OrganizationRepositoryStore) RepositoryManager.getInstance() .getRepositoryStore(OrganizationRepositoryStore.class); OrganizationFileStore fileStore = store .getChild(organizationName + "." + OrganizationRepositoryStore.ORGANIZATION_EXT); Organization orga = fileStore.getContent(); assertNotNull(orga); int nbRootGroup = 0; for (Group g : orga.getGroups().getGroup()) { if (g.getParentPath() == null) { nbRootGroup++; } } assertEquals("There should be two root groups", 2, nbRootGroup); for (User u : orga.getUsers().getUser()) { assertNotNull(u.getMetaDatas()); } synchronizeOrganization(organizationName, user1); synchronizeOrganization("ACME", "walter.bates"); }
From source file:org.bonitasoft.studio.actors.tests.organization.OrganizationCreationTest.java
License:Open Source License
/** * @author Florine Boudin/*from ww w . j ava 2 s .c om*/ * @throws InterruptedException */ @Test public void addNewUsersInACMETest() throws InterruptedException { //SWTBotTestUtil.createNewDiagram(bot); // open shell "Manage organization" bot.menu("Organization").menu("Manage...").click(); bot.waitUntil(Conditions.shellIsActive(Messages.manageOrganizationTitle)); SWTBotTable table = bot.table(); Assert.assertNotNull(table); System.out.println("Table size = " + table.columnCount() + " x " + table.rowCount()); // Set Description of the new Organisation int idxBonita = table.indexOf("ACME (active)", 0); Assert.assertTrue("Error: No ACME found in the table", idxBonita != -1); // go to the next shell table.click(idxBonita, 0); for (int i = 0; i < 3; i++) { Thread.sleep(1000); Assert.assertTrue("Error: The NEXT label button is unavailable", bot.button(IDialogConstants.NEXT_LABEL).isEnabled()); bot.button(IDialogConstants.NEXT_LABEL).click(); } // in the user shell, get table of user list table = bot.table(); Assert.assertNotNull("Error: No user table found", table); int nbUsers = table.rowCount(); //add new user Elton John SWTBotButton addButton = bot.button("Add"); addButton.click(); Assert.assertEquals("Error : wrong number of added users", nbUsers + 1, table.rowCount()); bot.textWithLabel(Messages.userName).setText("elton.john"); bot.textWithLabel(Messages.password).setText("bpm"); bot.comboBoxWithLabel(Messages.manager).setSelection("william.jobs"); Assert.assertEquals("Error: Manager is not selected", "william.jobs", bot.comboBoxWithLabel(Messages.manager).getText()); bot.tabItem("General").activate(); bot.textWithLabel(Messages.firstName).setText("Elton"); bot.textWithLabel(Messages.lastName).setText("John"); Assert.assertEquals("Error: First name user is not setted", "Elton", bot.textWithLabel(Messages.firstName).getText()); Assert.assertEquals("Error: Last name user is not setted", "John", bot.textWithLabel(Messages.lastName).getText()); bot.tabItem(Messages.membership).activate(); bot.button(Messages.addMembership).click(); bot.comboBoxWithLabel("Group").setSelection("/acme"); bot.comboBoxWithLabel("Role").setSelection("member"); // Finish the user add bot.waitUntil(Conditions.widgetIsEnabled(bot.button(IDialogConstants.FINISH_LABEL))); bot.button(IDialogConstants.FINISH_LABEL).click(); bot.button(IDialogConstants.NO_LABEL).click(); }
From source file:org.bonitasoft.studio.actors.tests.SWTbot.ActorDefinitionTranslationsTest.java
License:Open Source License
@Test public void testActorFilterDefinitionTranslation() throws Exception { final String language = "en"; bot.button(IDialogConstants.NEXT_LABEL).click(); int line = bot.table().indexOf(language, "Locale"); bot.table().getTableItem(line).check(); bot.button(IDialogConstants.FINISH_LABEL).click(); ActorFilterDefRepositoryStore store = (ActorFilterDefRepositoryStore) RepositoryManager.getInstance() .getRepositoryStore(ActorFilterDefRepositoryStore.class); DefinitionResourceProvider resourceProvider = DefinitionResourceProvider.getInstance(store, ActorsPlugin.getDefault().getBundle()); List<File> resources = resourceProvider .getExistingLocalesResource(store.getDefinition("testTranslationWizardPage", "1.0.0")); assertEquals("resources list should contain 2 resources", resources.size(), 2); for (File file : resources) { if (file.getName().contains("_en")) { Properties properties = new Properties(); InputStream stream = new FileInputStream(file); properties.load(stream);/*w w w . ja v a 2s. c o m*/ assertTrue("properties file doesn't contain key widgetTest4.description", properties.containsKey("widgetTest4.description")); assertTrue("properties file doesn't contain key widgetTest2.description", properties.containsKey("widgetTest2.description")); assertTrue("properties file doesn't contain key widgetTest0.description", properties.containsKey("widgetTest0.description")); assertTrue("properties file doesn't contain key widgetTest5.description", properties.containsKey("widgetTest5.description")); assertTrue("properties file doesn't contain key widgetTest3.description", properties.containsKey("widgetTest3.description")); assertTrue("properties file doesn't contain key widgetTest1.description", properties.containsKey("widgetTest1.description")); assertTrue("properties file doesn't contain key widgetTest4.label", properties.containsKey("widgetTest4.label")); assertTrue("properties file doesn't contain key widgetTest2.label", properties.containsKey("widgetTest2.label")); assertTrue("properties file doesn't contain key widgetTest0.label", properties.containsKey("widgetTest0.label")); assertTrue("properties file doesn't contain key widgetTest5.label", properties.containsKey("widgetTest5.label")); assertTrue("properties file doesn't contain key widgetTest3.label", properties.containsKey("widgetTest3.label")); assertTrue("properties file doesn't contain key widgetTest1.label", properties.containsKey("widgetTest1.label")); assertTrue("properties file doesn't contain key category1.category", properties.containsKey("categoryAFDWP1.category")); assertTrue("properties file doesn't contain key pageTest.pageDescription", properties.containsKey("pageTest.pageDescription")); assertTrue("properties file doesn't contain key pageTest.pageTitle", properties.containsKey("pageTest.pageTitle")); stream.close(); } } }
From source file:org.bonitasoft.studio.actors.tests.SWTbot.ActorFilterDefinitionTest.java
License:Open Source License
@Test public void testCreateActorFilterDefinition() { final String id = "test0"; final String version = "1.0.0"; bot.textWithLabel("Definition id *").setText(id); assertTrue(IDialogConstants.NEXT_LABEL + " should be enabled", bot.button(IDialogConstants.NEXT_LABEL).isEnabled()); assertTrue(IDialogConstants.FINISH_LABEL + " should be enabled", bot.button(IDialogConstants.FINISH_LABEL).isEnabled()); bot.button(IDialogConstants.FINISH_LABEL).click(); ActorFilterDefRepositoryStore store = (ActorFilterDefRepositoryStore) RepositoryManager.getInstance() .getRepositoryStore(ActorFilterDefRepositoryStore.class); ConnectorDefinition actorDefinition = store.getDefinition(id, version); assertNotNull("the actorDef file was not created", actorDefinition); }
From source file:org.bonitasoft.studio.actors.tests.SWTbot.ActorFilterDefinitionTest.java
License:Open Source License
private void testButtonDisabled(String id, String label) throws Exception { bot.textWithLabel(label).setText(id); assertFalse("finish button should be disabled", bot.button(IDialogConstants.FINISH_LABEL).isEnabled()); }
From source file:org.bonitasoft.studio.actors.tests.SWTbot.ActorFilterDefinitionTest.java
License:Open Source License
@Test public void testExistingActorFilterDefinition() throws Exception { final String id = "test1"; final String textLabel = "Definition id *"; final String textLabelVersion = "Version *"; final String version = "1.1.0"; bot.textWithLabel(textLabel).setText(id); bot.button(IDialogConstants.FINISH_LABEL).click(); activateActorFilterDefinitonShell(); testButtonDisabled(id, textLabel);/*from ww w . j av a 2 s.c om*/ bot.textWithLabel(textLabelVersion).setText(version); bot.waitUntil(new ICondition() { @Override public boolean test() throws Exception { return bot.button(IDialogConstants.FINISH_LABEL).isEnabled(); } @Override public void init(SWTBot bot) { } @Override public String getFailureMessage() { return "changing version should enable finish button"; } }, 5000); bot.button(IDialogConstants.CANCEL_LABEL).click(); }