本文整理汇总了Java中org.eclipse.swtbot.swt.finder.waits.ICondition类的典型用法代码示例。如果您正苦于以下问题:Java ICondition类的具体用法?Java ICondition怎么用?Java ICondition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ICondition类属于org.eclipse.swtbot.swt.finder.waits包,在下文中一共展示了ICondition类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createTreeRowCountCondition
import org.eclipse.swtbot.swt.finder.waits.ICondition; //导入依赖的package包/类
public ICondition createTreeRowCountCondition (final int count) {
return new ICondition () {
@Override
public boolean test() throws Exception {
return geVisibleRowCount () == count;
}
@Override
public void init(SWTBot bot) {
}
@Override
public String getFailureMessage() {
return "Expected row coutn not found ";
}
};
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:19,代码来源:OutLineView.java
示例2: copy
import org.eclipse.swtbot.swt.finder.waits.ICondition; //导入依赖的package包/类
public void copy(ICondition condition) {
CopyAction button = new CopyAction();
button.click();
editor.click(50, 50);
if (condition == null) {
condition = new org.eclipse.swtbot.swt.finder.waits.ICondition() {
@Override
public boolean test() throws Exception {
PasteAction button = new PasteAction();
return button.isEnabled();
}
@Override
public void init(SWTBot bot) {
}
@Override
public String getFailureMessage() {
return "Paste button not enabled";
}
};
}
bot.waitUntil(condition);
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:26,代码来源:ToolBarEditor.java
示例3: testOfflineAppendMode
import org.eclipse.swtbot.swt.finder.waits.ICondition; //导入依赖的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
示例4: testOfflineStandAloneMode
import org.eclipse.swtbot.swt.finder.waits.ICondition; //导入依赖的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
示例5: walkToToOfflinePage
import org.eclipse.swtbot.swt.finder.waits.ICondition; //导入依赖的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
示例6: testFixUnExistingEntry
import org.eclipse.swtbot.swt.finder.waits.ICondition; //导入依赖的package包/类
@Test
public void testFixUnExistingEntry () throws CoreException, IOException, InterruptedException {
System.out.println("XXXXXXXXXXXXXXXXXXXX testFixUnExistingEntry");
GW4EProject project = new GW4EProject(bot, gwproject);
project.resetToJavPerspective();
project.createProjectWithoutError(TEST_RESOURCE_FOLDER, PACKAGE_NAME, graphMLFilename);
addUnExistingEntry (project);
project.cleanBuild();
ProblemView pv = ProblemView.open(bot);
pv.executeQuickFixForErrorMessage(
"Unexisting Graph Model : dummy.graphml",
MessageUtil.getString("removethisentryfromthebuildpoliciesfile"),
new ICondition [] {new NoErrorInProblemView(pv)}
);
pv.close();//Mandatory
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:22,代码来源:GW4EFixesTestCase.java
示例7: convertToExisting
import org.eclipse.swtbot.swt.finder.waits.ICondition; //导入依赖的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
示例8: init
import org.eclipse.swtbot.swt.finder.waits.ICondition; //导入依赖的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
示例9: showPreferenceDialogWindowPreference
import org.eclipse.swtbot.swt.finder.waits.ICondition; //导入依赖的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
示例10: setPathGenerator
import org.eclipse.swtbot.swt.finder.waits.ICondition; //导入依赖的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
示例11: canLoginAdmin
import org.eclipse.swtbot.swt.finder.waits.ICondition; //导入依赖的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
示例12: delete
import org.eclipse.swtbot.swt.finder.waits.ICondition; //导入依赖的package包/类
@Override
public void delete(ICondition condition) {
List<SWTBotToolbarButton> swtBotToolbarButtons = view.getToolbarButtons();
for (SWTBotToolbarButton swtBotToolbarButton : swtBotToolbarButtons) {
if ("Delete".equals(swtBotToolbarButton.getToolTipText())) {
swtBotToolbarButton.click();
}
}
if (condition!=null)
view.bot().waitUntil(condition);
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:12,代码来源:ToolBarView.java
示例13: undoDelete
import org.eclipse.swtbot.swt.finder.waits.ICondition; //导入依赖的package包/类
@Override
public void undoDelete(ICondition condition) {
List<SWTBotToolbarButton> swtBotToolbarButtons = view.getToolbarButtons();
for (SWTBotToolbarButton swtBotToolbarButton : swtBotToolbarButtons) {
if ("Undo Delete".equals(swtBotToolbarButton.getToolTipText())) {
swtBotToolbarButton.click();
}
}
if (condition!=null)
view.bot().waitUntil(condition);
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:12,代码来源:ToolBarView.java
示例14: redoDelete
import org.eclipse.swtbot.swt.finder.waits.ICondition; //导入依赖的package包/类
@Override
public void redoDelete(ICondition condition) {
List<SWTBotToolbarButton> swtBotToolbarButtons = view.getToolbarButtons();
for (SWTBotToolbarButton swtBotToolbarButton : swtBotToolbarButtons) {
if ("Redo Delete".equals(swtBotToolbarButton.getToolTipText())) {
swtBotToolbarButton.click();
}
}
if (condition!=null)
view.bot().waitUntil(condition);
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:12,代码来源:ToolBarView.java
示例15: paste
import org.eclipse.swtbot.swt.finder.waits.ICondition; //导入依赖的package包/类
public void paste(ICondition condition) {
PasteAction action = new PasteAction();
action.click();
editor.click(10, 10) ; // Give the editor the focus
if (condition!=null)
bot.waitUntil(condition);
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:8,代码来源:ToolBarEditor.java
示例16: testOfflineExpandedMode
import org.eclipse.swtbot.swt.finder.waits.ICondition; //导入依赖的package包/类
@Test
public void testOfflineExpandedMode() throws CoreException, BuildPolicyConfigurationException, IOException, InterruptedException {
GW4EProject project = new GW4EProject(bot, gwproject);
FileParameters fp = project.createSimpleProject ();
fp.setTargetFilename("SimpleOffLineImpl");
OfflineTestUIPageTest page = walkToToOfflinePage(gwproject,fp);
page.selectExtendedMode("com.company.SimpleImpl.java - gwproject/src/main/java","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,代码行数:29,代码来源:GW4EProjectTestCase.java
示例17: testConvertTo
import org.eclipse.swtbot.swt.finder.waits.ICondition; //导入依赖的package包/类
private void testConvertTo(String targetFormat,String checkTestBox) throws CoreException, FileNotFoundException, BuildPolicyConfigurationException {
GW4EProject project = new GW4EProject(bot, gwproject);
project.createInitialProjectWithoutError(TEST_RESOURCE_FOLDER, PACKAGE_NAME, graphMLFilename);
FileParameters fp = FileParameters.create(targetFormat);
IFolder folder = ResourceManager.createFolder(fp.getMainSourceFolder(), PACKAGE_NAME);
ICondition folderExistsCondition = new FolderExists (folder);
bot.waitUntil(folderExistsCondition, SWTBotPreferences.TIMEOUT);
ICondition convertPageCompletedCondition = new DefaultCondition () {
@Override
public boolean test() throws Exception {
boolean b = project.convertTo(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(convertPageCompletedCondition, 3 * SWTBotPreferences.TIMEOUT);
IProject pj = ResourceManager.getProject(fp.getProject());
bot.waitUntil(new PathFoundCondition(pj,fp.getPath()),30 * 1000);
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:29,代码来源:GW4EProjectTestCase.java
示例18: testQuickFixesSetNoCheckMode
import org.eclipse.swtbot.swt.finder.waits.ICondition; //导入依赖的package包/类
@Test
public void testQuickFixesSetNoCheckMode()
throws CoreException, BuildPolicyConfigurationException, IOException {
System.out.println("XXXXXXXXXXXXXXXXXXXX testQuickFixesSetNoCheckMode");
GW4EProject project = new GW4EProject(bot, gwproject);
project.createInitialProject(gwproject,TEST_RESOURCE_FOLDER,PACKAGE_NAME,graphMLFilename);
ProblemView pv = ProblemView.open(bot);
ICondition [] conditions = new ICondition [] {
new ErrorIsInProblemView(pv, GW4EProject.NO_POLICIES_FOUND_IN_BUILD_POLICIES_FILE_ERROR_MSG),
new EditorOpenedCondition(bot,PreferenceManager.getBuildPoliciesFileName(gwproject)),
};
pv.executeQuickFixForErrorMessage(
project.getMissingErroMessage (gwproject,TEST_RESOURCE_FOLDER,PACKAGE_NAME,graphMLFilename),
GW4EProject.QUICK_FIX_MSG_MISSING_BULD_POLICIES_FILE,
conditions);
pv.close(); // Mandatory
pv = ProblemView.open(bot);
pv.executeQuickFixForErrorMessage(
GW4EProject.NO_POLICIES_FOUND_IN_BUILD_POLICIES_FILE_ERROR_MSG,
GW4EProject.ADD_NOCHECK_POLICIES,
new ICondition [] {new NoErrorInProblemView(pv)}
);
String buildPoliciPath = gwproject + "/" + TEST_RESOURCE_FOLDER + "/"+ PACKAGE_NAME + "/" + PreferenceManager.getBuildPoliciesFileName(gwproject) ;
IFile buildPolicyModel = (IFile) ResourceManager.getResource(buildPoliciPath);
IPath pathModel = buildPolicyModel.getFullPath().removeLastSegments(1).append(graphMLFilename);
IFile iFileModel = (IFile) ResourceManager.getResource(pathModel.toString());
String policies = project.getPathGenerator (buildPolicyModel , graphMLFilename);
String expectedPolicies = NoBuildRequiredException.NO_CHECK ;
assertEquals("Wrong policies found in the build policies file", expectedPolicies, policies);
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:39,代码来源:GW4EFixesTestCase.java
示例19: testInvalidGenerator
import org.eclipse.swtbot.swt.finder.waits.ICondition; //导入依赖的package包/类
@Test
public void testInvalidGenerator () throws CoreException, IOException, InterruptedException {
System.out.println("XXXXXXXXXXXXXXXXXXXX testInvalidGenerator");
String wrongPathGenerator = "xxx";
GW4EProject project = new GW4EProject(bot, gwproject);
project.createProjectWithoutError( TEST_RESOURCE_FOLDER, PACKAGE_NAME, graphMLFilename);
String policiesFileName = PreferenceManager.getBuildPoliciesFileName(gwproject);
IPath path = new Path (gwproject).append(TEST_RESOURCE_FOLDER).append(PACKAGE_NAME).append(policiesFileName);
IFile buildPolicyFile = (IFile) ResourceManager.getResource(path.toString());
project.setPathGenerator (buildPolicyFile , graphMLFilename, wrongPathGenerator);
project.cleanBuild();
String expectedErrorMessageInProblemView = "Missing severity flag for '" + wrongPathGenerator + "'";
ProblemView pv = ProblemView.open(bot);
IMarkerResolution [] markers = InvalidSeverityMarkerResolution.getResolvers();
String error1 = MessageUtil.getString("invalidpathgeneratoroudinbuildpolicies") + wrongPathGenerator;
pv.executeQuickFixForErrorMessage(
expectedErrorMessageInProblemView,
markers[0].getLabel(),
new ICondition [] {new ErrorIsInProblemView(pv,error1)}
);
pv.close();//Mandatory
pv.open(bot);
ResolutionMarkerDescription description = PathGeneratorDescription.getDescriptions().get(9);
pv.executeQuickFixForErrorMessage(
error1,
description.toString(),
new ICondition [] {new NoErrorInProblemView(pv)}
);
String updatedValue = project.getPathGenerator (buildPolicyFile , graphMLFilename);
String expectedValue = description.getGenerator() + ";" + PreferenceManager.getDefaultSeverity(gwproject);
assertEquals("Wrong policies found in the build policies file", expectedValue, updatedValue);
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:41,代码来源:GW4EFixesTestCase.java
示例20: testInvalidSeverity
import org.eclipse.swtbot.swt.finder.waits.ICondition; //导入依赖的package包/类
@Test
public void testInvalidSeverity () throws CoreException, IOException, InterruptedException {
System.out.println("XXXXXXXXXXXXXXXXXXXX testInvalidSeverity");
String wrongSeverity = "Z";
String pathGeneratorPrefix = "random(vertex_coverage(100));E;random(edge_coverage(100));";
GW4EProject project = new GW4EProject(bot, gwproject);
project.createProjectWithoutError( TEST_RESOURCE_FOLDER, PACKAGE_NAME, graphMLFilename);
String policiesFileName = PreferenceManager.getBuildPoliciesFileName(gwproject);
IPath path = new Path (gwproject).append(TEST_RESOURCE_FOLDER).append(PACKAGE_NAME).append(policiesFileName);
IFile buildPolicyFile = (IFile) ResourceManager.getResource(path.toString());
project.setPathGenerator (buildPolicyFile , graphMLFilename, pathGeneratorPrefix + wrongSeverity);
project.cleanBuild();
String expectedErrorMessageInProblemView = "Invalid severity flag found '" + wrongSeverity + "' (Choose one of E,W,I)" ;
ProblemView pv = ProblemView.open(bot);
IMarkerResolution [] resolutions = InvalidSeverityMarkerResolution.getResolvers();
pv.executeQuickFixForErrorMessage(
expectedErrorMessageInProblemView,
resolutions [0].getLabel(),
new ICondition [] {new NoErrorInProblemView(pv)}
);
pv.close();//Mandatory
String updatedValue = project.getPathGenerator (buildPolicyFile , graphMLFilename);
String expectedValue = pathGeneratorPrefix + ((InvalidSeverityMarkerResolution)resolutions [0]).getSeverity();
assertEquals("Wrong severity found in the build policies file", expectedValue, updatedValue);
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:33,代码来源:GW4EFixesTestCase.java
注:本文中的org.eclipse.swtbot.swt.finder.waits.ICondition类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论