本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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 ();
}
示例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 ();
}
示例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);
}
示例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);
}
示例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";
}
});
}
示例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();
}
示例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);
}
示例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();
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}