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


Java DefaultCondition类代码示例

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


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

示例1: updateKeyCustomProperty

import org.eclipse.swtbot.swt.finder.waits.DefaultCondition; //导入依赖的package包/类
public void updateKeyCustomProperty(SWTBotGefEditPart part, String key, String newkey) {
	GraphElement element = selectPart(part);
	selectTab(part, CUSTOM);
	SWTBotTable table = botView.bot().tableWithId(CustomProperties.PROJECT_PROPERTY_PAGE_WIDGET_ID, CustomProperties.CUSTOM_PROPERTY_LIST_WITH_BUTTON);
	 
	 
	bot.waitUntil(new DefaultCondition() {
		@Override
		public boolean test() throws Exception {
			int row = table.indexOf(key, "PROPERTY");
			if (row == -1) return true;
			table.click(row, 0);
		    bot.sleep(1000);
		    bot.text(key, 0).setText(newkey);
		    bot.text(KeyStroke.getInstance(SWT.TAB)+"" , 0);
		    return false;
		}
		@Override
		public String getFailureMessage() {
			return "key not set";
		}
	},2 * 60 * 1000);		
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:24,代码来源:GraphElementProperties.java

示例2: updateValueCustomProperty

import org.eclipse.swtbot.swt.finder.waits.DefaultCondition; //导入依赖的package包/类
public void updateValueCustomProperty(SWTBotGefEditPart part, String key, String oldvalue, String newValue) {
	GraphElement element = selectPart(part);
	selectTab(part, CUSTOM);
	SWTBotTable table = botView.bot().tableWithId(CustomProperties.PROJECT_PROPERTY_PAGE_WIDGET_ID, CustomProperties.CUSTOM_PROPERTY_LIST_WITH_BUTTON);
	 
	 
	bot.waitUntil(new DefaultCondition() {
		@Override
		public boolean test() throws Exception {
			int row = table.indexOf(oldvalue, "VALUE");
			if (row == -1) return true;
			table.click(row, 1);
		    bot.sleep(1000);
		    bot.text(oldvalue, 0).setText(newValue);
		    bot.text(KeyStroke.getInstance(SWT.TAB)+"" , 0);
		    return false;
		}
		@Override
		public String getFailureMessage() {
			return "value not set";
		}
	},2 * 60 * 1000);		
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:24,代码来源:GraphElementProperties.java

示例3: deleteCustomProperty

import org.eclipse.swtbot.swt.finder.waits.DefaultCondition; //导入依赖的package包/类
public void deleteCustomProperty(SWTBotGefEditPart part, String key) {
	GraphElement element = selectPart(part);
	selectTab(part, CUSTOM);
	SWTBotTable table = botView.bot().tableWithId(CustomProperties.PROJECT_PROPERTY_PAGE_WIDGET_ID, CustomProperties.CUSTOM_PROPERTY_LIST_WITH_BUTTON);
	 
	bot.waitUntil(new DefaultCondition() {
		@Override
		public boolean test() throws Exception {
			int row = table.indexOf(key, "PROPERTY");
			table.click(row, 0);
			table.contextMenu("Remove entry").click();
			return table.indexOf(key, 0) == -1;
		}
		@Override
		public String getFailureMessage() {
			return "row not deleted";
		}
	},2 * 60 * 1000);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:20,代码来源:GraphElementProperties.java

示例4: testOfflineAppendMode

import org.eclipse.swtbot.swt.finder.waits.DefaultCondition; //导入依赖的package包/类
@Test
public void testOfflineAppendMode() throws Exception {
	GW4EProject project = new GW4EProject(bot, gwproject);
	FileParameters fp = project.createSimpleProject ();
	fp.setTargetFilename("SimpleOffLineImpl");
	OfflineTestUIPageTest page = walkToToOfflinePage(gwproject,fp); 
	page.selectAppendMode("com.company.SimpleImpl.java - gwproject/src/main/java");
	page.selectGenerators(new String [] {"random(edge_coverage(100))"});
	page.finish();
														  
	ICondition condition = new DefaultCondition () {
		@Override
		public boolean test() throws Exception {
			IFile resource = (IFile) ResourceManager.getResource("gwproject/src/main/java/com/company/SimpleImpl.java");
			boolean methodAppended = IOHelper.findInFile(resource, "Generated with : random(edge_coverage(100))");
			return methodAppended;
		}

		@Override
		public String getFailureMessage() {
			return "method not generated ";
		}
	};
	bot.waitUntil(condition, 3 * 6 * SWTBotPreferences.TIMEOUT); //3mn
	closeWizard ();
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:27,代码来源:GW4EProjectTestCase.java

示例5: testOfflineStandAloneMode

import org.eclipse.swtbot.swt.finder.waits.DefaultCondition; //导入依赖的package包/类
@Test
public void testOfflineStandAloneMode() throws Exception {
	GW4EProject project = new GW4EProject(bot, gwproject);
	FileParameters fp = project.createSimpleProject ();
	fp.setTargetFilename("SimpleOffLineImpl");
	OfflineTestUIPageTest page = walkToToOfflinePage(gwproject,fp); 
	page.selectStandAloneMode("MyClazz");
	page.selectGenerators(new String [] {"random(edge_coverage(100))"});
	page.finish();
														  
	ICondition condition = new DefaultCondition () {
		@Override
		public boolean test() throws Exception {
			IFile resource = (IFile) ResourceManager.getResource("gwproject/src/main/java/com/company/MyClazz.java");
			boolean methodAppended = IOHelper.findInFile(resource, "Generated with : random(edge_coverage(100))");
			return methodAppended;
		}

		@Override
		public String getFailureMessage() {
			return "method not generated ";
		}
	};
	bot.waitUntil(condition, 3 * 6 * SWTBotPreferences.TIMEOUT); //3mn
	closeWizard ();
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:27,代码来源:GW4EProjectTestCase.java

示例6: walkToToOfflinePage

import org.eclipse.swtbot.swt.finder.waits.DefaultCondition; //导入依赖的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

示例7: createProjectWithoutError

import org.eclipse.swtbot.swt.finder.waits.DefaultCondition; //导入依赖的package包/类
public void createProjectWithoutError(String testResourceFolder, String pkgname, String graphMLFilename)
		throws CoreException, InterruptedException, IOException {
	createProject();
	IFile file = createGraphMLFile(testResourceFolder, pkgname, graphMLFilename);
	
	IFile buildPolicyFile = BuildPolicyManager.createBuildPoliciesFile(file, new NullProgressMonitor ());
	 
	setPathGenerator(buildPolicyFile, file.getFullPath().lastSegment(), NoBuildRequiredException.NO_CHECK);
 
	DefaultCondition condition = new DefaultCondition () {
		@Override
		public boolean test() throws Exception {
			ProblemView pv = ProblemView.open(GW4EProject.this.bot);
			cleanBuild();
			boolean b = pv.getDisplayedErrorCount() == 0;
			return b;
		}

		@Override
		public String getFailureMessage() {
			return "Failed to create a project withour error";
		}
	};
	
	bot.waitUntil(condition, 3 * 60 * 1000);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:27,代码来源:GW4EProject.java

示例8: removeNature

import org.eclipse.swtbot.swt.finder.waits.DefaultCondition; //导入依赖的package包/类
public void removeNature() {
	SWTBotTree tree = setupTreeForMenu(this.projectName);
	SWTBotMenu menu = new SWTBotMenu(
			ContextMenuHelper.contextMenu(tree, new String[] { "GW4E", "Remove GW4E Nature" }));
	menu.click();

	bot.waitUntil(new DefaultCondition() {
		@Override
		public boolean test() throws Exception {
			boolean b = ClasspathManager
					.hasGW4EClassPathContainer(ResourceManager.getProject(projectName));
			return !b;
		}

		@Override
		public String getFailureMessage() {
			return "GW4E ClassPath Container not removed";
		}
	});
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:21,代码来源:GW4EProject.java

示例9: convertExistingProject

import org.eclipse.swtbot.swt.finder.waits.DefaultCondition; //导入依赖的package包/类
public void convertExistingProject() throws CoreException {
	SWTBotTree tree = getProjectTree();
	SWTBotTreeItem item = tree.expandNode(this.projectName);
	item.setFocus();
	item.select();
	SWTBotMenu menu = item.contextMenu("Configure").contextMenu("Convert to GW4E");
	menu.click();
	bot.waitUntil(new DefaultCondition() {
		@Override
		public boolean test() throws Exception {
			boolean b = GW4ENature
					.hasGW4ENature(ResourceManager.getProject(projectName));
			return b;
		}

		@Override
		public String getFailureMessage() {
			return "GraphWalker has not GraphWalker Nature ";
		}
	});
	cleanBuild();
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:23,代码来源:GW4EProject.java

示例10: convertToExisting

import org.eclipse.swtbot.swt.finder.waits.DefaultCondition; //导入依赖的package包/类
public void convertToExisting(String project, String packageRootFragment, String pkg, String targetFilename,
		String targetFormat, String checkTestBox, String... nodes) {
	ICondition condition = new DefaultCondition() {
		@Override
		public boolean test() throws Exception {
			ConvertDialog cd = prepareConvertTo(project, packageRootFragment, pkg, targetFilename, targetFormat,
					nodes);
			boolean b = cd.createExisting(project, packageRootFragment, pkg, targetFilename, targetFormat,
					checkTestBox);
			return b;
		}

		@Override
		public String getFailureMessage() {
			return "Unable to complete the convert to wizard";
		}
	};
	bot.waitUntil(condition, 3 * SWTBotPreferences.TIMEOUT);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:20,代码来源:GW4EProject.java

示例11: init

import org.eclipse.swtbot.swt.finder.waits.DefaultCondition; //导入依赖的package包/类
private void init() {
	ICondition condition = new DefaultCondition () {
		@Override
		public boolean test() throws Exception {
			SWTBotMenu menu = bot.menu("Window");
			menu = menu.menu("Show View");
			menu = menu.menu("Console");
			menu.click();
			try {
				bot.waitUntil(new ViewOpened(ConsoleView.this.bot, "Console"), 3 * 1000);
			} catch (Exception e) {
				return false;
			}
			return true;
		}

		@Override
		public String getFailureMessage() {
			return "Cannot open Console view";
		}
	};
	bot.waitUntil(condition, TIMEOUT);
	botView = getBotView();
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:25,代码来源:ConsoleView.java

示例12: showPreferenceDialogWindowPreference

import org.eclipse.swtbot.swt.finder.waits.DefaultCondition; //导入依赖的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

示例13: setPathGenerator

import org.eclipse.swtbot.swt.finder.waits.DefaultCondition; //导入依赖的package包/类
private void setPathGenerator (String pathGenerator) {
	ICondition condition = new DefaultCondition () {

		@Override
		public boolean test() throws Exception {
			try {
				SWTBotCombo combo = bot.comboBoxWithId(GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_CONTROL_ID, GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_COMBO_PATH_GENERATOR);
				combo.setSelection(pathGenerator);
			} catch (Exception e) {
				return false;
			}
			return true;
		}

		@Override
		public String getFailureMessage() {
			return "Unable to set " + pathGenerator+ " in the combo";
		}
	};
	bot.waitUntil(condition);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:22,代码来源:GW4EManualRunner.java

示例14: selectComboPathGenerator

import org.eclipse.swtbot.swt.finder.waits.DefaultCondition; //导入依赖的package包/类
private void selectComboPathGenerator (SWTBotTableItem tableItem,String path) {
	DefaultCondition condition = new DefaultCondition() {
		@Override
		public boolean test() throws Exception {
			try {
				tableItem.click(1);
				SWTBotCCombo combo = bot.ccomboBoxWithId(ModelPathGenerator.GW4E_LAUNCH_CONFIGURATION_PATH_GENERATOR_ID,ModelPathGenerator.GW4E_LAUNCH_CONFIGURATION_PATH_GENERATOR_COMBO_EDITOR);
				combo.setSelection(path);
				return true;
			} catch (Exception e) {
				return false;
			}
		}

		@Override
		public String getFailureMessage() {
			return "Unable to open the path generator combo";
		}
	};
	bot.waitUntil(condition);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:22,代码来源:ModelPathGeneratorHelper.java

示例15: selectComboPathGenerator

import org.eclipse.swtbot.swt.finder.waits.DefaultCondition; //导入依赖的package包/类
private void selectComboPathGenerator (String path) {
	DefaultCondition condition = new DefaultCondition() {
		@Override
		public boolean test() throws Exception {
			try {

				SWTBotCombo combo = bot.comboBoxWithId(GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_CONTROL_ID,GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_COMBO_PATH_GENERATOR_ID_MODEL);
				combo.setSelection(path);
				return true;
			} catch (Exception e) {
				e.printStackTrace();
				return false;
			}
		}

		@Override
		public String getFailureMessage() {
			return "Unable to open the path generator combo";
		}
	};
	bot.waitUntil(condition);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:23,代码来源:GW4EOfflineRunner.java


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