Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add license text & update comments in SWTBot test #1877

Merged
merged 2 commits into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/*******************************************************************************
* Copyright (c) 2024 Patrick Ziegler and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* https://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Patrick Ziegler - initial API and implementation
*******************************************************************************/
package org.eclipse.m2e.pde.ui;

import static org.junit.Assert.assertEquals;
Expand Down Expand Up @@ -222,10 +234,10 @@ public void testAddMavenLocation() throws Exception {
assertEquals(table.cell(19, 3), "");
assertEquals(table.cell(19, 4), "jar");

assertFalse(robot.button("Update").isEnabled());
assertFalse(robot.button("Finish").isEnabled());
// There is no elegant way to select the cell editor,
// but we know that opening it focuses the text widget
assertFalse("Expected \"Update\" button to be disabled", robot.button("Update").isEnabled());
assertFalse("Expected \"Finish\" button to be disabled", robot.button("Finish").isEnabled());
// There is no elegant way to select the cell editor, but we
// know that it will be the first text widget in the dialog.
table.click(19, 0);
robot.text(0).setText("org.apache.commons");
table.click(19, 1);
Expand All @@ -234,14 +246,14 @@ public void testAddMavenLocation() throws Exception {
robot.text(0).setText("3.12.0");
table.click(19, 3); // Close cell editor

assertTrue(robot.button("Update").isEnabled());
assertTrue(robot.button("Finish").isEnabled());

assertEquals(table.cell(19, 0), "org.apache.commons");
assertEquals(table.cell(19, 1), "commons-lang3");
assertEquals(table.cell(19, 2), "3.12.0");
assertEquals(table.cell(19, 3), "");
assertEquals(table.cell(19, 4), "jar");

assertTrue("Expected \"Update\" button to be enabled", robot.button("Update").isEnabled());
assertTrue("Expected \"Finished\" button to be enabled", robot.button("Finish").isEnabled());
}

/**
Expand Down Expand Up @@ -400,7 +412,7 @@ public void testColumnSorting() throws Exception {
table.header("Artifact Id").click();
assertEquals(table.cell(0, 1), "caffeine");

// Sort by Artifact Id
// Sort by Group Id
table.header("Group Id").click();
assertEquals(table.cell(0, 1), "jackson-annotations");

Expand Down
Loading