本文整理汇总了Java中org.eclipse.swtbot.swt.finder.waits.ICondition类的典型用法代码示例。如果您正苦于以下问题:Java ICondition类的具体用法?Java ICondition怎么用?Java ICondition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ICondition类属于org.eclipse.swtbot.swt.finder.waits包,在下文中一共展示了ICondition类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 ";
}
};
}
示例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);
}
示例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 ();
}
示例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 ();
}
示例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);
}
示例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
}
示例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);
}
示例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();
}
示例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;
}
示例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);
}
示例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";
}
});
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}