当前位置: 首页>>代码示例>>Java>>正文


Java SWTBotShell类代码示例

本文整理汇总了Java中org.eclipse.swtbot.swt.finder.widgets.SWTBotShell的典型用法代码示例。如果您正苦于以下问题:Java SWTBotShell类的具体用法?Java SWTBotShell怎么用?Java SWTBotShell使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SWTBotShell类属于org.eclipse.swtbot.swt.finder.widgets包,在下文中一共展示了SWTBotShell类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: walkToToOfflinePage

import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; //导入依赖的package包/类
private OfflineTestUIPageTest walkToToOfflinePage(String gwproject,FileParameters fp) throws CoreException, FileNotFoundException, BuildPolicyConfigurationException {
	String targetFormat="offline";
	String checkTestBox="Java Offline Test Based";
	GW4EProject project = new GW4EProject(bot, gwproject);
	 
	
	ICondition convertPageReachedCondition = new DefaultCondition () {
		@Override
		public boolean test() throws Exception {
			boolean b  = project.walkToToOfflinePage(fp.getProject(),fp.getPackageFragmentRoot(),fp.getPackage(), fp.getTargetFilename(), targetFormat,checkTestBox,fp.getGraphmlFilePath());
			return b;
		}

		@Override
		public String getFailureMessage() {
			return "Unable to complete the wizard page.";
		}
	};
	
	bot.waitUntil(convertPageReachedCondition, 3 * SWTBotPreferences.TIMEOUT);
	
	SWTBotShell shell = bot.shell("GW4E Conversion File");
	return new  OfflineTestUIPageTest(shell);
	 
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:26,代码来源:GW4EProjectTestCase.java

示例2: prepareConvertTo

import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; //导入依赖的package包/类
private ConvertDialog prepareConvertTo(String project, String packageRootFragment, String pkg,
		String targetFilename, String targetFormat, String... nodes) {
	SWTBotTree tree = getProjectTree();
	SWTBotTreeItem item = tree.expandNode(nodes);
	item.select();
	item.setFocus();

	SWTBotMenu menu = item.contextMenu("GW4E").contextMenu("Convert to...");
	menu.click();

	bot.waitUntil(Conditions.shellIsActive("GW4E Conversion File"));
	SWTBotShell shell = bot.shell("GW4E Conversion File");

	ConvertDialog cd = new ConvertDialog(shell);
	return cd;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:17,代码来源:GW4EProject.java

示例3: openNewGraphWalkerModel

import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; //导入依赖的package包/类
public static void openNewGraphWalkerModel(SWTWorkbenchBot bot) {
	
	SWTBotMenu all = bot.menu("File").menu("New");
	
	/*
	Function<String, String>   f =  new Function<String, String> () {

		@Override
		public String apply(String t) {
			return t;
		}
		
	};
	all.menuItems().stream().map(f);
	*/
	
	bot.menu("File").menu("New").menu("GW4E Model").click();
	bot.waitUntil(new ShellActiveCondition("GW4E"));
	SWTBotShell shell = bot.shell("GW4E");
	assertTrue(shell.isOpen());
	shell.bot().button("Cancel").click();
	bot.waitUntil(Conditions.shellCloses(shell));
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:24,代码来源:GW4EPerspective.java

示例4: showPreferenceDialogWindowPreference

import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; //导入依赖的package包/类
private SWTBotShell showPreferenceDialogWindowPreference() {
	ICondition condition = new DefaultCondition () {
		@Override
		public boolean test() throws Exception {
			try {
				bot.menu("Window").menu("Preferences").click();
				bot.waitUntil(new ShellActiveCondition("Preferences"), 5 * 1000);
				return true;
			} catch (Throwable e) {
			} 
			return false;
		}

		@Override
		public String getFailureMessage() {
			return "Cannot open the Preference page";
		}
	};
	bot.waitUntil(condition, 30 * 1000);
	SWTBotShell shell = bot.shell("Preferences");
	shell.activate();
	return shell;	
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:24,代码来源:GW4EPreferencePage.java

示例5: showPreferenceDialogMAC

import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; //导入依赖的package包/类
private SWTBotShell showPreferenceDialogMAC() {
	final IWorkbench workbench = PlatformUI.getWorkbench();
	workbench.getDisplay().asyncExec(new Runnable() {
		public void run() {
			IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
			if (window != null) {
				Menu appMenu = workbench.getDisplay().getSystemMenu();
				for (MenuItem item : appMenu.getItems()) {
					if (item.getText().startsWith("Preferences")) {
						Event event = new Event();
						event.time = (int) System.currentTimeMillis();
						event.widget = item;
						event.display = workbench.getDisplay();
						item.setSelection(true);
						item.notifyListeners(SWT.Selection, event);
						break;
					}
				}
			}
		}
	});
	return  getPreferenceDialog() ;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:24,代码来源:GW4EPreferencePage.java

示例6: validateRun

import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; //导入依赖的package包/类
public void validateRun (String configurationName,String projectName,String filepath,boolean printUnvisited,boolean verbose,String startElement,String generator) {
	SWTBotShell shell = openExistingRun (configurationName);
	
	SWTBotText projectText = shell.bot().textWithId(GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_CONTROL_ID,GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_TEXT_ID_PROJECT);
	assertEquals("Wrong project name",projectName,projectText.getText());
	
	SWTBotText modelText = shell.bot().textWithId(GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_CONTROL_ID,GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_TEXT_ID_MODEL);
	assertEquals("Wrong model name",filepath,modelText.getText());
	
	SWTBotCheckBox verboseButton  = shell.bot().checkBoxWithId(GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_CONTROL_ID,GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_BUTTON_ID_VERBOSE);
	assertEquals("Wrong verbose value",verbose,verboseButton.isChecked());
	
	SWTBotCheckBox unvisitedButton  = shell.bot().checkBoxWithId(GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_CONTROL_ID,GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_BUTTON_ID_PRINT_UNVISITED);
	assertEquals("Wrong verbose value",verbose,unvisitedButton.isChecked());
	
	SWTBotText startElementText = shell.bot().textWithId(GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_CONTROL_ID,GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_TEXT_ID_START_ELEMENT);
	assertEquals("Wrong start element",startElement,startElementText.getText());
	
	SWTBotCombo generatorCombo = shell.bot().comboBoxWithId(GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_CONTROL_ID,GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_COMBO_PATH_GENERATOR_ID_MODEL);
	assertEquals("Wrong generator value",generator,generatorCombo.getText());
	
	SWTBotButton closeButton = bot.button("Close");
	closeButton.click();
	
	bot.waitUntil(Conditions.shellCloses(shell));
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:27,代码来源:GW4EOfflineRunner.java

示例7: openImportProjectsWizard

import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; //导入依赖的package包/类
private static void openImportProjectsWizard(SWTWorkbenchBot bot,
    String wizardCategory, String importWizardName) {
  for (int tries = 1; true; tries++) {
    SWTBotShell shell = null;
    try {
      bot.menu("File").menu("Import...").click();
      shell = bot.shell("Import");
      shell.activate();

      SwtBotTreeUtilities.waitUntilTreeHasItems(bot, bot.tree());
      SWTBotTreeItem treeItem = bot.tree().expandNode(wizardCategory);
      SwtBotTreeUtilities.waitUntilTreeItemHasChild(bot, treeItem, importWizardName);
      treeItem.select(importWizardName);
      break;
    } catch (TimeoutException e) {
      if (tries == 2) {
        throw e;
      } else if (shell != null) {
        shell.close();
      }
    }
  }
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:24,代码来源:SwtBotAppEngineActions.java

示例8: openPerspective

import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; //导入依赖的package包/类
public static void openPerspective(SWTWorkbenchBot bot, String perspectiveLabel) {
  SwtBotUtils.print("Opening Perspective: " + perspectiveLabel);

  SWTBotShell shell = null;
  try {
    menu(bot, "Window").menu("Open Perspective").menu("Other...").click();

    shell = bot.shell("Open Perspective");

    bot.waitUntil(ActiveWidgetCondition.widgetMakeActive(shell));
    shell.bot().table().select(perspectiveLabel);

    shell.bot().button("OK").click();
    bot.waitUntil(Conditions.shellCloses(shell));
  } catch (Exception e) {
    if (shell != null && shell.isOpen()) shell.close();
    SwtBotUtils.printError("Couldn't open perspective '" + perspectiveLabel + "'\n"
        + "trying to activate already open perspective instead");
    // maybe somehow the perspective is already opened (by another test before us)
    SWTBotPerspective perspective = bot.perspectiveByLabel(perspectiveLabel);
    perspective.activate();
  }

  SwtBotUtils.print("Opened Perspective: " + perspectiveLabel);
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:26,代码来源:SwtBotMenuActions.java

示例9: createProject

import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; //导入依赖的package包/类
@Test
public void createProject() throws Exception {
	String projectName = "prjBot-001";
	
	bot.menu("File").menu("New").click();
	SWTBotShell shell = bot.shell("New");
	shell.activate();
	// From menu open File > New dialog, verify whether the dialog has been opened.
	
	bot.tree().select("Project");
	SWTBotAssert.assertEnabled(bot.button("Next >"));
	// After selecting Project, the Next button should be enabled.
	
	bot.button("Next >").click();
	bot.textWithLabel("Project name:").setText(projectName);
	SWTBotAssert.assertEnabled(bot.button("Finish"));
	// Enter the Project Name, then Finish button should be enabled.
	
	bot.button("Finish").click();
	SWTBotAssert.assertVisible(bot.tree().select(projectName));
	// Click Finish button and verify whether the project's been successfully created.
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:23,代码来源:CreateProjectDemo.java

示例10: handleCreationWizard

import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; //导入依赖的package包/类
/**
 * @param bot
 */
public static void handleCreationWizard(SWTWorkbenchBot bot) {

	bot.activeShell().bot().button(Properties.BUTTON_NEXT).click();

	bot.textWithLabel(TEXT_WITH_LABEL_ENDPOINT_NAME).setText(ENDPOINT_NAME);
	bot.activeShell().bot().link()
			.click(IMAGE_HYPER_LINK_CREATE_NEW_PROJECT);

	SWTBotShell shell = bot.shell(Properties.SHELL_EMPTY_STRING);
	shell.activate();
	bot.button(Properties.BUTTON_NEXT).click();
	bot.textWithLabel(Properties.TEXT_WITH_LABEL_PROJECT_NAME).setText(
			PropertiesESB.ARTIFACT_MY_ESB_CONFIG_PROJECT_FOR_ENDPOINT_TEST);
	bot.button(Properties.BUTTON_FINISH).click();
	bot.textWithLabel(Properties.TEXT_WITH_LABEL_Address).setText(
			PropertiesESB.ARTIFACT_ENDPOINT_URL);
	bot.button(Properties.BUTTON_FINISH).click();

}
 
开发者ID:Tharshayene,项目名称:DevStudioUITestAutomation,代码行数:23,代码来源:EndPointCreation.java

示例11: testESBConfigProjectCreation

import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; //导入依赖的package包/类
@Test
public void testESBConfigProjectCreation() throws Exception {

	assertTrue(Properties.ERROR_OPEN_DASHBOARD,
			DashBoardCreation.openDashBoard(bot));

	@SuppressWarnings({ "rawtypes", "unchecked" })
	Matcher matcherImageHyperLink = allOf(
			widgetOfType(ImageHyperlink.class),
			withText(EndPointCreation.IMAGE_HYPER_LINK));

	assertTrue(Properties.ERROR_OPEN_CREATION_WIZARD,
			DashBoardCreation.openWizard(matcherImageHyperLink, bot));

	SWTBotShell shell = bot
			.shell(EndPointCreation.SHELL_CREATE_NEW_ENDPOINT);
	shell.activate();

	EndPointCreation.handleCreationWizard(bot);

	assertTrue(EndPointCreation.checkCreatedProject(bot));

}
 
开发者ID:Tharshayene,项目名称:DevStudioUITestAutomation,代码行数:24,代码来源:EndPointTestCase.java

示例12: canLoginAdmin

import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; //导入依赖的package包/类
@Test
public void canLoginAdmin() throws Exception {
    SWTBotShell loginShell = BOT.activeShell();
    loginShell.activate();
    BOT.textWithLabel("Deployment Url").setText(ADDRESS);
    BOT.textWithLabel("Username").setText(ADMIN_UNAME);
    BOT.textWithLabel("Password").setText(ADMIN_PWD);
    BOT.button("Login").click();
    BOT.waitWhile(new ICondition() {

        @Override
        public boolean test() throws Exception {
            String title = BOT.activeShell().getText();
            return title.equals("Loading Templates");
        }

        @Override
        public void init(final SWTBot bot) {
        }

        @Override
        public String getFailureMessage() {
            return "Unable to Login";
        }
    });
}
 
开发者ID:apache,项目名称:syncope,代码行数:27,代码来源:SyncopeViewTest.java

示例13: createNewOrmModelFileWizard

import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; //导入依赖的package包/类
protected SWTBotShell createNewOrmModelFileWizard(String category, String parentProjectName,
    String fileType, String fileName) {
  bot.menu("File").menu("New").menu("Other...").click();

  SWTBotShell shell = bot.shell("New");
  shell.activate();

  bot.text().setText(fileType);
  bot.waitUntil(new NodeAvailableAndSelect(bot.tree(), category, fileType));

  bot.tree().expandNode(category).select(fileType);
  bot.button("Next >").click();

  bot.textWithLabel("Enter or select the parent folder:").setText(parentProjectName);
  bot.textWithLabel("File name:").setText(fileName);
  bot.button("Next >").click();

  bot.comboBox(0).setSelection("Compartment Diagram");
  // bot.comboBox("Model Object").setSelection("Compartment Diagram");
  bot.button("Finish").click();
  return shell;
}
 
开发者ID:leondart,项目名称:FRaMED,代码行数:23,代码来源:FramedComponentsAbstractTests.java

示例14: createProjectAndAssertNoErrorMarker

import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; //导入依赖的package包/类
protected void createProjectAndAssertNoErrorMarker(String projectType) throws CoreException {
	SWTBotMenu fileMenu = bot.menu("File");
	SWTBotMenu newMenu = fileMenu.menu("New");
	SWTBotMenu projectMenu = newMenu.menu("Project...");
	projectMenu.click();

	SWTBotShell shell = bot.shell("New Project");
	shell.activate();
	SWTBotTreeItem xsemanticsNode = bot.tree().expandNode("Xsemantics");
	waitForTreeItems(xsemanticsNode);
	xsemanticsNode.expandNode(projectType).select();
	bot.button("Next >").click();

	bot.textWithLabel("Project name:").setText(TEST_PROJECT);

	bot.button("Finish").click();

	// creation of a project might require some time
	bot.waitUntil(shellCloses(shell), SHELL_TIMEOUT);
	assertTrue("Project doesn't exist", isProjectCreated(TEST_PROJECT));

	waitForBuild();
	assertNoErrorsInProject();
}
 
开发者ID:eclipse,项目名称:xsemantics,代码行数:25,代码来源:XsemanticsSwtbotTestBase.java

示例15: createExampleProjects

import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; //导入依赖的package包/类
protected void createExampleProjects(String projectType,
		String mainProjectId) {
	SWTBotMenu fileMenu = bot.menu("File");
	SWTBotMenu newMenu = fileMenu.menu("New");
	SWTBotMenu otherMenu = newMenu.menu("Other...");
	otherMenu.click();

	SWTBotShell shell = bot.shell("New");
	shell.activate();
	SWTBotTreeItem xsemanticsNode = bot.tree().expandNode("Xsemantics");
	waitForTreeItems(xsemanticsNode);
	SWTBotTreeItem examplesNode = xsemanticsNode.expandNode("Examples");
	waitForTreeItems(examplesNode);
	examplesNode.expandNode(projectType).select();
	bot.button("Next >").click();

	bot.button("Finish").click();

	// creation of a project might require some time
	bot.waitUntil(shellCloses(shell), SHELL_TIMEOUT);
	assertTrue("Project doesn't exist", isProjectCreated(mainProjectId));
	assertTrue("Project doesn't exist", isProjectCreated(mainProjectId
			+ ".tests"));
	assertTrue("Project doesn't exist", isProjectCreated(mainProjectId
			+ ".ui"));
}
 
开发者ID:eclipse,项目名称:xsemantics,代码行数:27,代码来源:XsemanticsImportExamplesProjectWizardTests.java


注:本文中的org.eclipse.swtbot.swt.finder.widgets.SWTBotShell类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。