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


Java SWTBotPreferences.TIMEOUT属性代码示例

本文整理汇总了Java中org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences.TIMEOUT属性的典型用法代码示例。如果您正苦于以下问题:Java SWTBotPreferences.TIMEOUT属性的具体用法?Java SWTBotPreferences.TIMEOUT怎么用?Java SWTBotPreferences.TIMEOUT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences的用法示例。


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

示例1: initializePreferences

/**
 * Sets common SWTBot preferences.
 */
public static void initializePreferences() {
  // -Dorg.eclipse.swtbot.playback.delay=2
  SWTBotPreferences.PLAYBACK_DELAY = BOT_PLAYBACK_DELAY;

  // System.setProperty("org.eclipse.swtbot.keyboardLayout", "EN_US");
  SWTBotPreferences.KEYBOARD_LAYOUT = "org.eclipse.swtbot.swt.finder.keyboard.EN_US";

  // SWTBot Keyboard strategies
  SWTBotPreferences.KEYBOARD_STRATEGY = "org.eclipse.swtbot.swt.finder.keyboard.SWTKeyboardStrategy";

  // keyboard type interval
  SWTBotPreferences.TYPE_INTERVAL = KEYBOARD_TYPE_INTERVAL;

  // Waiting for Widgets
  SWTBotPreferences.TIMEOUT = BOT_WIDGET_TIMEOUT;

  // screenshot directory
  SWTBotPreferences.SCREENSHOTS_DIR = System.getProperty(SWTBotPreferenceConstants.KEY_SCREENSHOTS_DIR, "target/screenshots");

  // test window focus policy
  workbenchFocusPolicy = WorkbenchFocusPolicy.valueOf(System.getProperty(PROPERTY_COM_AVALOQ_TEST_WORKBENCHFOCUSPOLICY, WorkbenchFocusPolicy.REFOCUS.toString()));

  preferencesInitialized = true;
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:27,代码来源:CoreSwtbotTools.java

示例2: closeWelcomePage

@BeforeClass
public static void closeWelcomePage() {
	try {
		SWTBotPreferences.TIMEOUT = 6000;
		new SWTGefBot().viewByTitle("Welcome").close();
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:9,代码来源:OutLineTest.java

示例3: closeWelcomePage

@BeforeClass
public static void closeWelcomePage() {
	try {
		SWTBotPreferences.TIMEOUT = 6000;
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:8,代码来源:ToolbarViewTest.java

示例4: beforeClass

@BeforeClass
public static void beforeClass() throws Exception {
	SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
	SWTBotPreferences.TIMEOUT = 10000;
	bot = new SWTWorkbenchBot();
	try {
		bot.viewByTitle("Welcome").close();
	} catch (Exception e) {
		e.printStackTrace();
	}

}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:12,代码来源:GW4EPerspectiveTestCase.java

示例5: setUp

@Before
public void setUp() throws CoreException {
	long timeout = SWTBotPreferences.TIMEOUT;
	try {
		SWTBotPreferences.TIMEOUT = 3 * 60 * 1000;
		bot.resetWorkbench();
		GW4EProject.cleanWorkspace();
		GW4EPerspective.openGWPerspective(bot);
	} finally {
		SWTBotPreferences.TIMEOUT = timeout;
	}
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:12,代码来源:GW4ERunnerTestCase.java

示例6: clickContextMenu

/**
 * Clicks the context menu matching the given labels.
 * When a context menu 'Compile' exists with the sub context menu 'All Invalids',
 * then the context menu 'All Invalids' can be clicked by giving the labels 'Compile' and 'All Invalids'.
 *
 * @param bot
 *          the {@link AbstractSWTBot} on which to infer the context menu
 * @param labels
 *          the labels on the context menus
 * @throw {@link WidgetNotFoundException} if the context menu could not be found
 */
public static void clickContextMenu(final AbstractSWTBot<? extends Control> bot, final String... labels) {
  MenuItem menuItem = getContextMenuItem(bot, labels);
  if (menuItem == null) {
    long endTime = System.currentTimeMillis() + SWTBotPreferences.TIMEOUT;
    while (menuItem == null && System.currentTimeMillis() < endTime) {
      SWTUtils.sleep(SWTBotPreferences.DEFAULT_POLL_DELAY);
      menuItem = getContextMenuItem(bot, labels);
    }
    if (menuItem == null) {
      throw new WidgetNotFoundException("Could not find menu: " + Arrays.asList(labels));
    }
  }
  click(menuItem);
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:25,代码来源:ContextActionUiTestUtil.java

示例7: show

/**
 * Shows the provided {@link Menu} and returns the {@link MenuItem} matching the given {@link Matcher} criteria.
 *
 * @param menu
 *          the {@link Menu} to show
 * @param matcher
 *          the {@link Matcher} to use to find the {@link MenuItem}
 * @return
 *         the {@link MenuItem} matching the given {@link Matcher} criteria
 */
private static MenuItem show(final Menu menu, final Matcher<?> matcher) {
  if (menu != null) {
    menu.notifyListeners(SWT.Show, new Event());

    MenuItem item = null;
    final long start = System.currentTimeMillis();
    while ((item = getMenuItem(menu, matcher)) != null) {
      if (ICE_CTX_LABEL_LOADING.equals(item.getText())) {
        try {
          while (Display.getDefault().readAndDispatch()) {
            // Allow Lazy Loading items to modify the menu
          }
          Thread.sleep(SWTBotPreferences.PLAYBACK_DELAY);
        } catch (InterruptedException exception) {
          Thread.currentThread().interrupt();
        }
      } else {
        return item;
      }
      if (System.currentTimeMillis() - start > SWTBotPreferences.TIMEOUT) {
        return null;
      }
    }
    menu.notifyListeners(SWT.Hide, new Event());
    return item;
  }
  return null;
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:38,代码来源:ContextActionUiTestUtil.java

示例8: initializeBotPreferences

/**
 * Initialize the bot's preferences.
 */
public static void initializeBotPreferences() {
  // NOTE: the keyboard layout must match the keyboard used for the OS.
  // The default keyboard layouts are: EN_US, MAC_EN_US, EN_GB, MAC_EN_GB, FR_FR, DE_DE.
  // TF-69: "com.avaloq.test.swtbot.DE_CH" is a custom keyboard layout, saved in the package "com.avaloq.test.swtbot"
  SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
  SWTBotPreferences.KEYBOARD_STRATEGY = System.getProperty("org.eclipse.swtbot.keyboard.strategy", "org.eclipse.swtbot.swt.finder.keyboard.SWTKeyboardStrategy");
  SWTBotPreferences.PLAYBACK_DELAY = PLAYBACK_DELAY;
  SWTBotPreferences.TIMEOUT = TIMEOUT;
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:12,代码来源:SwtBotUtil.java

示例9: parseSpecInNonUIThread

/**
 * Adds a new spec to the toolbox, opens it and tests if parsing is done on
 * a non-UI thread
 * 
 * @see Bug #103 in general/bugzilla/index.html
 */
@Test
public void parseSpecInNonUIThread() {

	// Open specA
	SWTBotMenu fileMenu = bot.menu("File");
	SWTBotMenu openSpecMenu = fileMenu.menu("Open Spec");
	SWTBotMenu addNewSpecMenu = openSpecMenu.menu("Add New Spec...");
	addNewSpecMenu.click();

	bot.textWithLabel("Root-module file:").setText(specB);
	bot.button("Finish").click();

	assertNoBackendCodeInUIThread();

	// Open specB
	addNewSpecMenu.click();

	bot.textWithLabel("Root-module file:").setText(specA);
	bot.button("Finish").click();

	assertNoBackendCodeInUIThread();

	final String specName = getSpecName(new File(specB));

	// increase timeout since farsite spec takes a long time to parse
	final long timeout = SWTBotPreferences.TIMEOUT * 4;

	// specs are created in non-UI thread asynchronously which causes a
	// delay before the menu entry becomes available
	bot.waitUntil(Conditions.waitForMenu(waitForToolboxShell(), WithText.<MenuItem> withText(specName)), timeout);

	// Go back to previous spec
	openSpecMenu.menu(specName);

	assertNoBackendCodeInUIThread();
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:42,代码来源:HandlerThreadingTest.java

示例10: setSWTBotPreferences

/**
 * Use the Properties file to set Preferences: KEYBOARD_STRATEGY,
 * KEYBOARD_LAYOUT, TIMEOUT
 * 
 * @return isSWTBotPreferencesSet
 */
public static boolean setSWTBotPreferences() {
	SWTBotPreferences.KEYBOARD_STRATEGY = Properties.KEYBOARD_STRATEGY_ORG_ECLIPSE_SWTBOT_SWT_FINDER_KEYBOARD_SWT_KEYBOARD_STRATEGY;
	SWTBotPreferences.KEYBOARD_LAYOUT = Properties.KEYBOARD_LAYOUT_EN_US;
	SWTBotPreferences.TIMEOUT = Properties.TIME_OUT;
	return true;
}
 
开发者ID:Tharshayene,项目名称:DevStudioUITestAutomation,代码行数:12,代码来源:SetUp.java

示例11: getSwtBotPrefsTimeoutFieldValue

private static long getSwtBotPrefsTimeoutFieldValue() {
  return SWTBotPreferences.TIMEOUT;
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:3,代码来源:SwtBotTimeoutManager.java

示例12: setSwtBotPrefsTimeoutFieldValue

private static void setSwtBotPrefsTimeoutFieldValue(long timeout) {
  if (timeout == UNSET_TIMEOUT_VALUE) {
    return;
  }
  SWTBotPreferences.TIMEOUT = timeout;
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:6,代码来源:SwtBotTimeoutManager.java

示例13: beforeClass

@BeforeClass
public static void beforeClass() throws Exception {
	bot = new SWTWorkbenchBot();
	realFactory = VizServiceFactoryHolder.getFactory();
	factoryHolder = new VizServiceFactoryHolder();

	// Set the bot's timeout and playback rate
	SWTBotPreferences.TIMEOUT = 3000;
	SWTBotPreferences.PLAYBACK_DELAY = 250;

	// Set up the workspace
	IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();

	// The OS's file path separator
	String separator = System.getProperty("file.separator");
	String projectName = "CSVVizService";
	java.net.URI defaultProjectLocation = null;

	// Setup the project
	try {
		// Get the project handle
		IProject project = workspaceRoot.getProject(projectName);
		// If the project does not exist, create it
		if (!project.exists()) {
			// Set the location as
			// ${workspace_loc}/CAEBATModelTesterWorkspace
			defaultProjectLocation = (new File(
					System.getProperty("user.home") + separator + "ICETests"
							+ separator + projectName)).toURI();
			// Create the project description
			IProjectDescription desc = ResourcesPlugin.getWorkspace()
					.newProjectDescription(projectName);
			// Set the location of the project
			desc.setLocationURI(defaultProjectLocation);
			// Create the project
			project.create(desc, null);
		}
		// Open the project if it is not already open
		if (project.exists() && !project.isOpen()) {
			project.open(null);
		}
		// Refresh the workspace
		project.refreshLocal(IResource.DEPTH_INFINITE, null);
	} catch (CoreException e) {
		// Catch exception for creating the project
		e.printStackTrace();
		fail();
	}

}
 
开发者ID:eclipse,项目名称:eavp,代码行数:50,代码来源:PlotEditorTester.java


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