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


Java ICondition类代码示例

本文整理汇总了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 ";
		}
		
	};
}
 
开发者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


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