Java Code Examples for org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences#KEYBOARD_LAYOUT

The following examples show how to use org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences#KEYBOARD_LAYOUT . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProjectExplorerRefreshTest.java    From tracecompass with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * Test Class setup
 *
 * @throws Exception
 *             on error
 */
@BeforeClass
public static void init() throws Exception {
    TestDirectoryStructureUtil.generateTraceStructure(TEST_TRACES_PATH);

    SWTBotUtils.initialize();

    /* Set up for SWTBot */
    SWTBotPreferences.TIMEOUT = 20000; /* 20 second timeout */
    SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
    fLogger.removeAllAppenders();
    fLogger.addAppender(new ConsoleAppender(new SimpleLayout(), ConsoleAppender.SYSTEM_OUT));
    fBot = new SWTWorkbenchBot();

    /* Finish waiting for eclipse to load */
    WaitUtils.waitForJobs();

    SWTBotUtils.createProject(TRACE_PROJECT_NAME);
    IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(TRACE_PROJECT_NAME);
    fTracesFolder = new File(Objects.requireNonNull(TmfProjectRegistry.getProject(project, true).getTracesFolder()).getResource().getLocation().toOSString());

    createCProject(C_PROJECT_NAME);
    setTracingNature(C_PROJECT_NAME);
    IProject cProject = ResourcesPlugin.getWorkspace().getRoot().getProject(C_PROJECT_NAME);
    fCProjectFolder = cProject.getLocation().toFile();
}
 
Example 2
Source File: KernelTestBase.java    From tracecompass with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * Before Class
 */
@BeforeClass
public static void beforeClass() {
    SWTBotUtils.initialize();

    /* set up for swtbot */
    SWTBotPreferences.TIMEOUT = 20000; /* 20 second timeout */
    SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
    fLogger.removeAllAppenders();
    fLogger.addAppender(new ConsoleAppender(new SimpleLayout(), ConsoleAppender.SYSTEM_OUT));
    fBot = new SWTWorkbenchBot();
    SWTBotUtils.closeView("welcome", fBot);
    /* Switch perspectives */
    SWTBotUtils.switchToPerspective(KERNEL_PERSPECTIVE_ID);
    /* Create the trace project */
    SWTBotUtils.createProject(TRACE_PROJECT_NAME);
    /* Finish waiting for eclipse to load */
    WaitUtils.waitForJobs();
}
 
Example 3
Source File: CreateDeployExportBusinessObjectIT.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Before
public void setUp() throws Exception {
    BOSEngineManager.getInstance().loginDefaultTenant(Repository.NULL_PROGRESS_MONITOR);
    String layout = "EN_US";
    if (Platform.getOS().equals(Platform.OS_MACOSX)) {
        layout = "MAC_" + layout;
    }
    SWTBotPreferences.KEYBOARD_LAYOUT = layout;
    tmpFile = temporaryFolder.newFile("bdm.zip");

    bdmStore = RepositoryManager.getInstance().getRepositoryStore(BusinessObjectModelRepositoryStore.class);
    final BusinessObjectModelFileStore businessObjectModelFileStore = bdmStore
            .getChild(BusinessObjectModelFileStore.BOM_FILENAME, true);
    if (businessObjectModelFileStore != null) {
        businessObjectModelFileStore.delete();
    }
}
 
Example 4
Source File: TestImportExportPackageWizard.java    From tracecompass with Eclipse Public License 2.0 6 votes vote down vote up
/** Test Class setup */
@BeforeClass
public static void init() {
    SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
    SWTBotUtils.initialize();
    Thread.currentThread().setName(SWT_BOT_THREAD_NAME); // for the debugger
    /* set up for swtbot */
    SWTBotPreferences.TIMEOUT = 20000; /* 20 second timeout */
    fLogger.removeAllAppenders();
    fLogger.addAppender(new ConsoleAppender(new SimpleLayout()));
    fBot = new SWTWorkbenchBot();

    /* finish waiting for eclipse to load */
    WaitUtils.waitForJobs();

}
 
Example 5
Source File: TraceTypePreferencePageTest.java    From tracecompass with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * Before Class
 */
@BeforeClass
public static void beforeClass() {
    SWTBotUtils.initialize();

    /* set up for swtbot */
    SWTBotPreferences.TIMEOUT = 20000; /* 20 second timeout */
    SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
    fLogger.removeAllAppenders();
    fLogger.addAppender(new ConsoleAppender(new SimpleLayout(), ConsoleAppender.SYSTEM_OUT));
    fBot = new SWTWorkbenchBot();
    /* Create the trace project */
    SWTBotUtils.createProject(TRACE_PROJECT_NAME);
    /* Finish waiting for eclipse to load */
    WaitUtils.waitForJobs();

    /* set up test trace */
    setUpTrace();

}
 
Example 6
Source File: MergeSegmentsTest.java    From translationstudio8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 每个测试开始之前执行
 */
@Before
public void setUp() {
	if (SLOW_PLAYBACK) {
		SWTBotPreferences.PLAYBACK_DELAY = 500;
	}
	SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
	INVISIBLE_CHAR = XlfEditor.INVISIBLE_CHAR;
	reTag = "(" + INVISIBLE_CHAR + "\\d+)?" + INVISIBLE_CHAR + "(x|bx|ex|g|bpt|ept|mrk|sub|ph|it)" + INVISIBLE_CHAR + "(\\d+" + INVISIBLE_CHAR + ")?";
	bot = HSBot.bot();
	bot.closeAllEditors();
	ts = TS.getInstance();
	prjName = "swtBot-Project-001";
	fileName = "HSCAT8-3.xlf";
	ProjectTreeView.doubleClickXlfFile(prjName, fileName);
	xe = new XlfEditor(bot.editorByTitle(fileName));
}
 
Example 7
Source File: ViewsResponseTest.java    From tracecompass with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * Things to setup
 */
@Before
public void beforeClass() {

    SWTBotUtils.initialize();
    Thread.currentThread().setName("SWTBotTest");
    /* set up for swtbot */
    SWTBotPreferences.TIMEOUT = 60000; /* 60 second timeout */
    SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
    SWTWorkbenchBot bot = new SWTWorkbenchBot();
    SWTBotUtils.closeView("welcome", bot);
    /* Prepare the workspace */
    prepareWorkspace();
    /* Finish waiting for eclipse to load */
    WaitUtils.waitForJobs();

    /* Create project */
    SWTBotUtils.createProject(PROJECT_NAME);
}
 
Example 8
Source File: MarkerSetSwtBotTest.java    From tracecompass with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * Set up the test context and environment
 */
@BeforeClass
public static void setUp() {
    SWTBotUtils.initialize();

    /* set up for swtbot */
    SWTBotPreferences.TIMEOUT = 10000; /* 10 second timeout */
    SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
    fBot = new SWTWorkbenchBot();

    SWTBotUtils.createProject(TRACE_PROJECT_NAME);
    WaitUtils.waitForJobs();

    final CtfTestTrace cygProfile = CtfTestTrace.CYG_PROFILE;
    LttngUstTrace trace = LttngUstTestTraceUtils.getTrace(cygProfile);
    fStart = ((CtfTmfTrace) trace).getStartTime().toNanos();
    fFullRange = new TmfTimeRange(TmfTimestamp.fromNanos(fStart), TmfTimestamp.fromNanos(fStart + 100l));
    final File file = new File(trace.getPath());
    LttngUstTestTraceUtils.dispose(cygProfile);
    SWTBotUtils.openTrace(TRACE_PROJECT_NAME, file.getAbsolutePath(), UST_ID);
    SWTBotUtils.openView(FlameChartView.ID);
    fViewBot = fBot.viewByTitle("Flame Chart");
    WaitUtils.waitForJobs();
}
 
Example 9
Source File: XMLAnalysesManagerPreferencePageTest.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Before Class for launch and setup
 */
@BeforeClass
public static void beforeClass() {
    SWTBotUtils.initialize();
    /* set up for swtbot */
    SWTBotPreferences.TIMEOUT = 20000; /* 20 second timeout */
    SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
    fLogger.removeAllAppenders();
    fLogger.addAppender(new ConsoleAppender(new SimpleLayout(), ConsoleAppender.SYSTEM_OUT));
    fBot = new SWTWorkbenchBot();
}
 
Example 10
Source File: TimeGraphViewTest.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Set up for test
 */
@BeforeClass
public static void beforeClass() {
    SWTBotUtils.initialize();
    SWTBotPreferences.TIMEOUT = 20000; /* 20 second timeout */
    SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
    fLogger.removeAllAppenders();
    fLogger.addAppender(new ConsoleAppender(new SimpleLayout(), ConsoleAppender.SYSTEM_OUT));
    fHair = ImageHelper.adjustExpectedColor(new RGB(0, 64, 128));
    fHat = ImageHelper.adjustExpectedColor(new RGB(0, 255, 0));
    fLaser = ImageHelper.adjustExpectedColor(new RGB(255, 0, 0));
}
 
Example 11
Source File: SplitSegmentTest.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
/**
	 * 每个测试开始之前执行
	 */
	@Before
	public void setUp() {
//		SWTBotPreferences.PLAYBACK_DELAY = 500;
		SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
		INVISIBLE_CHAR = XlfEditor.INVISIBLE_CHAR;
		reTag = "(" + INVISIBLE_CHAR + "\\d+)?" + INVISIBLE_CHAR + "(x|bx|ex|g|bpt|ept|mrk|sub|ph|it)" + INVISIBLE_CHAR + "(\\d+" + INVISIBLE_CHAR + ")?";
		bot = HSBot.bot();
		bot.closeAllEditors();
		ts = TS.getInstance();
		prjName = "prjBot-001";
		fileName = "HSCAT8-2T.xlf";
		ProjectTreeView.doubleClickXlfFile(prjName, fileName);
		xe = new XlfEditor(bot.editorByTitle(fileName));
	}
 
Example 12
Source File: SystemCallLatencyStatisticsTableAnalysisTest.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Things to setup
 */
@BeforeClass
public static void beforeClass() {
    SWTBotUtils.initialize();
    Thread.currentThread().setName("SWTBotTest");
    /* set up for swtbot */
    SWTBotPreferences.TIMEOUT = 20000; /* 20 second timeout */
    SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
    fLogger.removeAllAppenders();
    fLogger.addAppender(new ConsoleAppender(new SimpleLayout(), ConsoleAppender.SYSTEM_OUT));
    fBot = new SWTWorkbenchBot();
    /* Finish waiting for eclipse to load */
    WaitUtils.waitForJobs();

}
 
Example 13
Source File: ConnectorDefinitionWizardPageTest.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
private void openConnectorDefinitionWizardPage(String id) {
    final String packageLang = "java.lang.";
    final String packageUtil = "java.util.";
    SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
    Keyboard key = KeyboardFactory.getSWTKeyboard();
    SWTBotConnectorTestUtil.activateConnectorDefinitionShell(bot);
    SWTBotConnectorTestUtil.createConnectorDefinition(bot, id, "1.0.0");
    bot.button(IDialogConstants.NEXT_LABEL).click();
    SWTBotTable table = bot.table();
    bot.button("Add...").click();
    bot.button("Add...").click();
    bot.button("Add...").click();
    bot.button("Add...").click();
    table.click(1, 2);
    bot.ccomboBox().setSelection(packageLang + "Boolean");
    key.pressShortcut(Keystrokes.CR);
    bot.button("Add...").click();
    table.click(2, 2);
    bot.ccomboBox().setSelection(packageLang + "Double");
    key.pressShortcut(Keystrokes.CR);
    bot.button("Add...").click();
    table.click(3, 2);
    bot.ccomboBox().setSelection(packageLang + "Float");
    key.pressShortcut(Keystrokes.CR);
    bot.button("Add...").click();
    table.click(4, 2);
    bot.ccomboBox().setSelection(packageLang + "Integer");
    key.pressShortcut(Keystrokes.CR);
    bot.button("Add...").click();
    table.click(5, 2);
    bot.ccomboBox().setSelection(packageUtil + "List");
    key.pressShortcut(Keystrokes.CR);
    bot.button("Add...").click();
    table.click(6, 2);
    bot.ccomboBox().setSelection(packageUtil + "Map");
    key.pressShortcut(Keystrokes.CR);
    bot.button(IDialogConstants.NEXT_LABEL).click();

}
 
Example 14
Source File: ActorFilterDefinitionTest.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Test
public void testAddInputs() throws Exception {
    final String id = "test5";
    final String textLabel = "Definition id *";
    final String version = "1.0.0";
    final String inputName = "testInput";
    final String mandatory = "Mandatory";
    final String value = "hello";
    SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
    bot.textWithLabel(textLabel).setText(id);
    bot.button(IDialogConstants.NEXT_LABEL).click();
    bot.button("Add...").click();
    bot.button("Add...").click();
    bot.button("Add...").click();
    bot.waitUntil(Conditions.widgetIsEnabled(bot.button("Remove")), 5000);
    bot.button("Remove").click();
    SWTBotTable table = bot.table();
    table.click(0, 0);
    bot.sleep(500);
    bot.text(0).setText(inputName);
    table.click(0, 1);
    bot.ccomboBox().setSelection(mandatory);
    Keyboard key = KeyboardFactory.getSWTKeyboard();
    key.pressShortcut(Keystrokes.CR);
    bot.waitUntil(Conditions.widgetIsEnabled(table));
    table.click(0, 3);
    bot.text().setText("hello");
    bot.button(IDialogConstants.FINISH_LABEL).click();
    ActorFilterDefRepositoryStore store = (ActorFilterDefRepositoryStore) RepositoryManager
            .getInstance().getRepositoryStore(ActorFilterDefRepositoryStore.class);
    ConnectorDefinition actorDefinition = store.getDefinition(id, version);
    assertEquals("wrong number of inputs", actorDefinition.getInput()
            .size(), 2);
    Input input = actorDefinition.getInput().get(0);
    assertEquals("wrong input name", input.getName(), inputName);
    assertEquals("wrong input value", input.getDefaultValue(), value);
    assertTrue("input should be mandatory", input.isMandatory());
}
 
Example 15
Source File: TestDemos.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
@BeforeClass
public static void startTest() {
	if (DEBUG_MODE == 2) {
		SWTBotPreferences.PLAYBACK_DELAY = 500;
	}
	SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
	bot = HSBot.bot();
}
 
Example 16
Source File: FlameGraphTest.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Initialization
 */
@BeforeClass
public static void beforeClass() {

    SWTBotUtils.initialize();
    Thread.currentThread().setName("SWTBotTest");
    /* set up for swtbot */
    SWTBotPreferences.TIMEOUT = 20000; /* 20 second timeout */
    SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
    fLogger.removeAllAppenders();
    fLogger.addAppender(new ConsoleAppender(new SimpleLayout(), ConsoleAppender.SYSTEM_OUT));
    /* Finish waiting for eclipse to load */
    WaitUtils.waitForJobs();
}
 
Example 17
Source File: TestRefreshTextTrace.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
/** Test Class setup */
@BeforeClass
public static void init() {
    SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
    SWTBotUtils.initialize();
    SWTBotPreferences.TIMEOUT = 20000; /* 20 second timeout */
    fLogger.removeAllAppenders();
    fLogger.addAppender(new NullAppender());
    fBot = new SWTWorkbenchBot();

    /* finish waiting for eclipse to load */
    WaitUtils.waitForJobs();
}
 
Example 18
Source File: ConnectorDefinitionTranslationsTest.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
private void openConnectorDefinitionWizardPage(String id, String categoryId) throws Exception {
    SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
    SWTBotConnectorTestUtil.activateConnectorDefinitionShell(bot);
    SWTBotConnectorTestUtil.createConnectorDefinition(bot, id, "1.0.0");
    SWTBotConnectorTestUtil.createNewCategory(bot, categoryId);
    bot.button(IDialogConstants.NEXT_LABEL).click();
    SWTBotTable table = bot.table();
    bot.button("Add...").click();
    bot.button("Add...").click();
    bot.button("Add...").click();
    bot.button("Add...").click();
    table.click(1, 2);
    bot.ccomboBox().setSelection(Boolean.class.getName());
    bot.button("Add...").click();
    table.click(2, 2);
    bot.ccomboBox().setSelection(Double.class.getName());
    bot.button("Add...").click();
    table.click(3, 2);
    bot.ccomboBox().setSelection(Float.class.getName());
    bot.button("Add...").click();
    table.click(4, 2);
    bot.ccomboBox().setSelection(Integer.class.getName());
    bot.button("Add...").click();
    table.click(5, 2);
    bot.ccomboBox().setSelection(List.class.getName());
    bot.button("Add...").click();
    table.click(6, 2);
    bot.ccomboBox().setSelection(Map.class.getName());
    bot.button(IDialogConstants.NEXT_LABEL).click();
}
 
Example 19
Source File: PinAndCloneTest.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Before Class
 */
@BeforeClass
public static void beforeClass() {
    SWTBotUtils.initialize();

    /* set up for swtbot */
    SWTBotPreferences.TIMEOUT = 20000; /* 20 second timeout */
    SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
    fBot = new SWTWorkbenchBot();
    SWTBotUtils.closeView("welcome", fBot);
    /* Create the trace project */
    SWTBotUtils.createProject(TRACE_PROJECT_NAME);
    /* Finish waiting for eclipse to load */
    WaitUtils.waitForJobs();
}
 
Example 20
Source File: AddProjectNatureTest.java    From tracecompass with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * Test Class setup
 *
 * @throws Exception
 *             on error
 */
@BeforeClass
public static void init() throws Exception {
    IProgressMonitor progressMonitor = new NullProgressMonitor();
    IWorkspace workspace = ResourcesPlugin.getWorkspace();

    SWTBotUtils.initialize();

    /* Set up for SWTBot */
    SWTBotPreferences.TIMEOUT = 20000; /* 20 second timeout */
    SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
    fLogger.removeAllAppenders();
    fLogger.addAppender(new ConsoleAppender(new SimpleLayout(), ConsoleAppender.SYSTEM_OUT));
    fBot = new SWTWorkbenchBot();

    /* Finish waiting for eclipse to load */
    WaitUtils.waitForJobs();

    // Manually create C project
    fWorkspaceRoot = workspace.getRoot();
    fSomeProject = fWorkspaceRoot.getProject(SOME_PROJECT_NAME);
    fSomeProject.create(progressMonitor);
    fSomeProject.open(progressMonitor);
    IProjectDescription description = fSomeProject.getDescription();
    description.setNatureIds(new String[] { "org.eclipse.cdt.core.cnature" });
    fSomeProject.setDescription(description, null);
    fSomeProject.open(progressMonitor);

    /* set up test trace */
    URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(TRACE_PATH), null);
    URI uri;
    try {
        uri = FileLocator.toFileURL(location).toURI();
        fTestFile = new File(uri);
    } catch (URISyntaxException | IOException e) {
        fail(e.getMessage());
    }
    assumeTrue(fTestFile.exists());

    /* setup timestamp preference */
    IEclipsePreferences defaultPreferences = InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID);
    defaultPreferences.put(ITmfTimePreferencesConstants.DATIME, "MMM d HH:mm:ss");
    defaultPreferences.put(ITmfTimePreferencesConstants.SUBSEC, ITmfTimePreferencesConstants.SUBSEC_NO_FMT);
    TmfTimestampFormat.updateDefaultFormats();
}