mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-31 21:01:24 +08:00
Merge remote-tracking branch 'origin/GP-4151_ghidragon_fixing_wizard--SQUASHED'
This commit is contained in:
+83
-93
@@ -4,9 +4,9 @@
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package help.screenshot;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.awt.*;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -31,14 +33,14 @@ import docking.DockingDialog;
|
||||
import docking.widgets.*;
|
||||
import docking.widgets.filechooser.GhidraFileChooser;
|
||||
import docking.widgets.table.GTable;
|
||||
import docking.wizard.WizardManager;
|
||||
import docking.wizard.WizardPanel;
|
||||
import docking.wizard.WizardDialog;
|
||||
import generic.theme.GThemeDefaults.Colors;
|
||||
import ghidra.app.plugin.core.archive.RestoreDialog;
|
||||
import ghidra.framework.Application;
|
||||
import ghidra.framework.data.DefaultProjectData;
|
||||
import ghidra.framework.data.GhidraFileData;
|
||||
import ghidra.framework.main.*;
|
||||
import ghidra.framework.main.wizard.project.*;
|
||||
import ghidra.framework.model.*;
|
||||
import ghidra.framework.preferences.Preferences;
|
||||
import ghidra.framework.project.extensions.ExtensionTablePanel;
|
||||
@@ -57,7 +59,7 @@ import resources.MultiIcon;
|
||||
|
||||
public class FrontEndPluginScreenShots extends GhidraScreenShotGenerator {
|
||||
private static final String OTHER_PROJECT = "Other_Project";
|
||||
Icon icon = (Icon) getInstanceField("CONVERT_ICON", ProjectInfoDialog.class);
|
||||
Icon icon = (Icon) getInstanceField("CONVERT_ICON", ProjectChooseRepositoryWizardModel.class);
|
||||
|
||||
public FrontEndPluginScreenShots() {
|
||||
super();
|
||||
@@ -98,18 +100,20 @@ public class FrontEndPluginScreenShots extends GhidraScreenShotGenerator {
|
||||
|
||||
@Test
|
||||
public void testChangeAccessList() {
|
||||
|
||||
String[] knownUsers = { "user1", "user2", "user3", "user4", "user5", "user6" };
|
||||
ArrayList<User> userList = new ArrayList<>();
|
||||
userList.add(new User("user4", 2));
|
||||
|
||||
runSwing(() -> {
|
||||
WizardPanel panel =
|
||||
new ProjectAccessPanel(knownUsers, "Bob", userList, "Demo", false, false, tool);
|
||||
TestDummyPanelManager panelMgr =
|
||||
new TestDummyPanelManager(panel, true, false, true, 650, 250);
|
||||
WizardManager wizard =
|
||||
new WizardManager("Change Shared Project Information", false, panelMgr, icon);
|
||||
wizard.showWizard();
|
||||
|
||||
ProjectAccessPanel panel =
|
||||
new ProjectAccessPanel(knownUsers, "user4", userList, "Demo", false, false, tool);
|
||||
TestDummyWizardModel<ProjectWizardData> panelMgr =
|
||||
new TestDummyWizardModel<>(panel, true, false, true,
|
||||
"Change Shared Project Information", 650, 250, new ProjectWizardData(), icon);
|
||||
WizardDialog wizard = new WizardDialog(panelMgr, false);
|
||||
wizard.show();
|
||||
});
|
||||
|
||||
waitForSwing();
|
||||
@@ -131,13 +135,15 @@ public class FrontEndPluginScreenShots extends GhidraScreenShotGenerator {
|
||||
@Test
|
||||
public void testChangeRepositoryPanel() {
|
||||
RepositoryPanel panel =
|
||||
new RepositoryPanel(null, "MyServer", new String[] { "Demo", "Test", "Sample" }, false);
|
||||
new RepositoryPanel(null, new String[] { "Demo", "Test", "Sample" }, false);
|
||||
|
||||
TestDummyPanelManager panelMgr =
|
||||
new TestDummyPanelManager(panel, false, true, false, 600, 375);
|
||||
WizardManager wizard =
|
||||
new WizardManager("Change Shared Project Information", false, panelMgr, icon);
|
||||
wizard.showWizard();
|
||||
TestDummyWizardModel<ProjectWizardData> panelMgr =
|
||||
new TestDummyWizardModel<ProjectWizardData>(panel, false, true, false,
|
||||
"Change Shared Project Information", 600, 375,
|
||||
new ProjectWizardData(), icon);
|
||||
|
||||
WizardDialog wizard = new WizardDialog(panelMgr, false);
|
||||
wizard.show();
|
||||
|
||||
waitForSwing();
|
||||
|
||||
@@ -146,17 +152,16 @@ public class FrontEndPluginScreenShots extends GhidraScreenShotGenerator {
|
||||
|
||||
@Test
|
||||
public void testChangeServerInfoPanel() {
|
||||
TestDummyPanelManager panelMgr =
|
||||
new TestDummyPanelManager(null, false, true, false, 600, 180);
|
||||
ServerInfoPanel panel = new ServerInfoPanel(panelMgr);
|
||||
panelMgr.setPanel(panel);
|
||||
ServerInfoPanel panel = new ServerInfoPanel(null);
|
||||
|
||||
WizardManager wizard =
|
||||
new WizardManager("Change Shared Project Information", false, panelMgr, icon);
|
||||
ProjectWizardData data = new ProjectWizardData();
|
||||
data.setServerInfo(new ServerInfo("server1", 13100));
|
||||
TestDummyWizardModel<ProjectWizardData> panelMgr =
|
||||
new TestDummyWizardModel<>(panel, false, true, false,
|
||||
"Change Shared Project Information", 600, 180, data, icon);
|
||||
|
||||
panel.setServerInfo(new ServerInfo("server1", 13100));
|
||||
|
||||
wizard.showWizard();
|
||||
WizardDialog wizard = new WizardDialog(panelMgr, false);
|
||||
wizard.show();
|
||||
|
||||
waitForSwing();
|
||||
|
||||
@@ -254,7 +259,7 @@ public class FrontEndPluginScreenShots extends GhidraScreenShotGenerator {
|
||||
@Test
|
||||
public void testDeleteProject() {
|
||||
performAction("Delete Project", "FrontEndPlugin", false);
|
||||
captureDialog();
|
||||
captureDialog(600, 350);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -280,7 +285,7 @@ public class FrontEndPluginScreenShots extends GhidraScreenShotGenerator {
|
||||
|
||||
runSwing(() -> {
|
||||
JPanel panel =
|
||||
new ProjectAccessPanel(knownUsers, "Bob", userList, "What", false, false, tool);
|
||||
new ProjectAccessPanel(knownUsers, "user2", userList, "What", false, false, tool);
|
||||
|
||||
DummyDialogComponentProvider dialog =
|
||||
new DummyDialogComponentProvider("Edit Project Access List for Demo", panel);
|
||||
@@ -311,7 +316,7 @@ public class FrontEndPluginScreenShots extends GhidraScreenShotGenerator {
|
||||
@Test
|
||||
public void testOpenProject() {
|
||||
performAction("Open Project", "FrontEndPlugin", false);
|
||||
captureDialog();
|
||||
captureDialog(600, 350);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -397,17 +402,17 @@ public class FrontEndPluginScreenShots extends GhidraScreenShotGenerator {
|
||||
|
||||
@Test
|
||||
public void testRepositoryNamePanel() {
|
||||
TestDummyPanelManager panelMgr =
|
||||
new TestDummyPanelManager(null, false, true, true, 600, 375);
|
||||
RepositoryPanel panel =
|
||||
new RepositoryPanel(null, new String[] { "Demo", "Test", "Sample" }, false);
|
||||
|
||||
final RepositoryPanel panel = new RepositoryPanel(panelMgr, "Server1",
|
||||
new String[] { "Demo", "Test", "Sample" }, false);
|
||||
panelMgr.setPanel(panel);
|
||||
TestDummyWizardModel<ProjectWizardData> panelMgr =
|
||||
new TestDummyWizardModel<ProjectWizardData>(panel, false, true, false,
|
||||
"Specify Repository Name on Server1", 600, 375,
|
||||
new ProjectWizardData(), icon);
|
||||
|
||||
WizardManager wizard =
|
||||
new WizardManager("Specify Repository Name on Server1", false, panelMgr, icon);
|
||||
WizardDialog wizard = new WizardDialog(panelMgr, false);
|
||||
|
||||
wizard.showWizard();
|
||||
wizard.show();
|
||||
|
||||
runSwing(() -> {
|
||||
JList<?> jlist = (JList<?>) getInstanceField("nameList", panel);
|
||||
@@ -482,12 +487,14 @@ public class FrontEndPluginScreenShots extends GhidraScreenShotGenerator {
|
||||
public void testSelectProjectLocation() {
|
||||
performAction("New Project", "FrontEndPlugin", false);
|
||||
DialogComponentProvider dialog = getDialog();
|
||||
final WizardManager wm = (WizardManager) dialog;
|
||||
WizardDialog wm = (WizardDialog) dialog;
|
||||
JButton nextButton = findButtonByText(wm, "Next >>");
|
||||
pressButton(nextButton, true);
|
||||
|
||||
SelectProjectPanel projPanel = findComponent(wm, SelectProjectPanel.class);
|
||||
JTextField dirField = (JTextField) findComponentByName(projPanel, "Project Directory");
|
||||
runSwing(() -> {
|
||||
wm.next();
|
||||
WizardPanel panel = wm.getCurrentWizardPanel();
|
||||
JTextField textField = (JTextField) getInstanceField("directoryField", panel);
|
||||
textField.setText("/Projects");
|
||||
dirField.setText("/Projects");
|
||||
wm.setStatusText("");
|
||||
});
|
||||
|
||||
@@ -504,14 +511,17 @@ public class FrontEndPluginScreenShots extends GhidraScreenShotGenerator {
|
||||
public void testSelectSharedProjectLocation() {
|
||||
performAction("New Project", "FrontEndPlugin", false);
|
||||
DialogComponentProvider dialog = getDialog();
|
||||
final WizardManager wm = (WizardManager) dialog;
|
||||
WizardDialog wm = (WizardDialog) dialog;
|
||||
JButton nextButton = findButtonByText(wm, "Next >>");
|
||||
pressButton(nextButton, true);
|
||||
SelectProjectPanel projPanel = findComponent(wm, SelectProjectPanel.class);
|
||||
JTextField nameField = (JTextField) findComponentByName(projPanel, "Project Name");
|
||||
JTextField dirField = (JTextField) findComponentByName(projPanel, "Project Directory");
|
||||
|
||||
runSwing(() -> {
|
||||
wm.next();
|
||||
WizardPanel panel = wm.getCurrentWizardPanel();
|
||||
JTextField textField = (JTextField) getInstanceField("directoryField", panel);
|
||||
textField.setText("/Projects");
|
||||
textField = (JTextField) getInstanceField("projectNameField", panel);
|
||||
textField.setText("Demo");
|
||||
|
||||
dirField.setText("/Projects");
|
||||
nameField.setText("Demo");
|
||||
wm.setStatusText("");
|
||||
JLabel label = (JLabel) getInstanceField("titleLabel", wm);
|
||||
label.setText("Select Local Project Location for Repository Demo");
|
||||
@@ -523,32 +533,41 @@ public class FrontEndPluginScreenShots extends GhidraScreenShotGenerator {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSelectSharedProjectType() {
|
||||
public void testSelectSharedProjectType() throws Exception {
|
||||
performAction("New Project", "FrontEndPlugin", false);
|
||||
DialogComponentProvider dialog = getDialog();
|
||||
final WizardManager wm = (WizardManager) dialog;
|
||||
WizardDialog wm = (WizardDialog) dialog;
|
||||
final JRadioButton rb =
|
||||
(JRadioButton) findAbstractButtonByText(dialog.getComponent(), "Shared Project");
|
||||
assertNotNull(rb);
|
||||
assertTrue(!rb.isSelected());
|
||||
|
||||
SwingUtilities.invokeAndWait(() -> rb.setSelected(true));
|
||||
|
||||
runSwing(() -> {
|
||||
WizardPanel panel = wm.getCurrentWizardPanel();
|
||||
JRadioButton sharedRB = (JRadioButton) getInstanceField("sharedRB", panel);
|
||||
sharedRB.setSelected(true);
|
||||
wm.setStatusText("");
|
||||
});
|
||||
captureDialog(700, 350);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testServerInfo() {
|
||||
public void testServerInfo() throws Exception {
|
||||
performAction("New Project", "FrontEndPlugin", false);
|
||||
DialogComponentProvider dialog = getDialog();
|
||||
final WizardManager wm = (WizardManager) dialog;
|
||||
runSwing(() -> {
|
||||
WizardPanel panel = wm.getCurrentWizardPanel();
|
||||
JRadioButton sharedRB = (JRadioButton) getInstanceField("sharedRB", panel);
|
||||
sharedRB.setSelected(true);
|
||||
wm.next();
|
||||
panel = wm.getCurrentWizardPanel();
|
||||
Component comp = (Component) getInstanceField("serverInfoComponent", panel);
|
||||
WizardDialog wm = (WizardDialog) dialog;
|
||||
|
||||
final JRadioButton rb =
|
||||
(JRadioButton) findAbstractButtonByText(dialog.getComponent(), "Shared Project");
|
||||
assertNotNull(rb);
|
||||
assertTrue(!rb.isSelected());
|
||||
|
||||
SwingUtilities.invokeAndWait(() -> rb.setSelected(true));
|
||||
JButton nextButton = findButtonByText(wm, "Next >>");
|
||||
pressButton(nextButton, true);
|
||||
ServerInfoPanel serverPanel = findComponent(wm, ServerInfoPanel.class);
|
||||
Component comp = (Component) getInstanceField("serverInfoComponent", serverPanel);
|
||||
|
||||
runSwing(() -> {
|
||||
JTextField textField = (JTextField) getInstanceField("nameField", comp);
|
||||
textField.setText("Server1");
|
||||
});
|
||||
@@ -579,28 +598,6 @@ public class FrontEndPluginScreenShots extends GhidraScreenShotGenerator {
|
||||
captureDialog(400, 500);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEditProjectAccessPanel() {
|
||||
String[] knownUsers = { "user1", "user2", "user3", "user4", "user5", "user6" };
|
||||
ArrayList<User> userList = new ArrayList<>();
|
||||
userList.add(new User("user2", 2));
|
||||
userList.add(new User("user4", 0));
|
||||
userList.add(new User("user5", 1));
|
||||
|
||||
runSwing(() -> {
|
||||
WizardPanel panel =
|
||||
new ProjectAccessPanel(knownUsers, "user2", userList, "Demo", false, false, tool);
|
||||
|
||||
TestDummyPanelManager panelMgr =
|
||||
new TestDummyPanelManager(panel, true, false, true, 650, 250);
|
||||
WizardManager wizard = new WizardManager("New Project", false, panelMgr, icon);
|
||||
wizard.showWizard();
|
||||
});
|
||||
|
||||
waitForSwing();
|
||||
captureDialog();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testViewProjectAccessPanel() {
|
||||
String[] knownUsers = { "user1", "user2", "user3", "user4", "user5", "user6" };
|
||||
@@ -649,13 +646,6 @@ public class FrontEndPluginScreenShots extends GhidraScreenShotGenerator {
|
||||
captureIconAndText(multiIcon, "Example (1)");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMemoryUsage() {
|
||||
performFrontEndAction("Show VM memory", "MemoryUsagePlugin", false);
|
||||
waitForVMMemoryInitialilzed();// this is asynchronous and takes a while
|
||||
captureDialog();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testViewOtherProjects()
|
||||
throws IOException, LockException, InvalidNameException, CancelledException {
|
||||
|
||||
-108
@@ -1,108 +0,0 @@
|
||||
/* ###
|
||||
* IP: GHIDRA
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package help.screenshot;
|
||||
|
||||
import java.awt.Dimension;
|
||||
|
||||
import docking.wizard.*;
|
||||
|
||||
class TestDummyPanelManager implements PanelManager {
|
||||
private WizardPanel panel;
|
||||
private boolean canFinish;
|
||||
private boolean hasNextPanel;
|
||||
private boolean hasPreviousPanel;
|
||||
private Dimension dimension;
|
||||
private WizardManager wizard;
|
||||
|
||||
TestDummyPanelManager(WizardPanel panel, boolean canFinish, boolean hasNextPanel,
|
||||
boolean hasPreviousPanel, int width, int height) {
|
||||
this.panel = panel;
|
||||
this.canFinish = canFinish;
|
||||
this.hasNextPanel = hasNextPanel;
|
||||
this.hasPreviousPanel = hasPreviousPanel;
|
||||
this.dimension = new Dimension(width, height);
|
||||
}
|
||||
|
||||
public void setPanel(WizardPanel panel) {
|
||||
this.panel = panel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFinish() {
|
||||
return canFinish;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasNextPanel() {
|
||||
return hasNextPanel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPreviousPanel() {
|
||||
return hasPreviousPanel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WizardPanel getNextPanel() {
|
||||
return panel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WizardPanel getInitialPanel() {
|
||||
return panel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WizardPanel getPreviousPanel() {
|
||||
return panel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStatusMessage() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finish() {
|
||||
// stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel() {
|
||||
// stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
// stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getPanelSize() {
|
||||
return dimension;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWizardManager(WizardManager wm) {
|
||||
this.wizard = wm;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WizardManager getWizardManager() {
|
||||
return wizard;
|
||||
}
|
||||
|
||||
}
|
||||
+131
@@ -0,0 +1,131 @@
|
||||
/* ###
|
||||
* IP: GHIDRA
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package help.screenshot;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.util.List;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
import docking.wizard.WizardModel;
|
||||
import docking.wizard.WizardStep;
|
||||
|
||||
/**
|
||||
* Wizard model for testing
|
||||
*
|
||||
* @param <T> the test data
|
||||
*/
|
||||
class TestDummyWizardModel<T> extends WizardModel<T> {
|
||||
private JPanel panel;
|
||||
private boolean canFinish;
|
||||
private boolean hasNextPanel;
|
||||
private boolean hasPreviousPanel;
|
||||
private Dimension dimension;
|
||||
private String title;
|
||||
|
||||
TestDummyWizardModel(JPanel panel, boolean canFinish, boolean hasNextPanel,
|
||||
boolean hasPreviousPanel, String title, int width, int height, T data, Icon icon) {
|
||||
super("Test Wizard", data, icon);
|
||||
this.panel = panel;
|
||||
this.canFinish = canFinish;
|
||||
this.hasNextPanel = hasNextPanel;
|
||||
this.hasPreviousPanel = hasPreviousPanel;
|
||||
this.title = title;
|
||||
this.dimension = new Dimension(width, height);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addWizardSteps(List<WizardStep<T>> steps) {
|
||||
TestDummyWizardStep<T> step = new TestDummyWizardStep<>(this, panel, title);
|
||||
steps.add(step);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFinish() {
|
||||
return canFinish;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getPreferredSize() {
|
||||
return dimension;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canGoNext() {
|
||||
return hasNextPanel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canGoBack() {
|
||||
return hasPreviousPanel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStatusMessage() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doFinish() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel() {
|
||||
// stub
|
||||
}
|
||||
|
||||
private static class TestDummyWizardStep<T> extends WizardStep<T> {
|
||||
private JPanel panel;
|
||||
|
||||
TestDummyWizardStep(WizardModel<T> model, JPanel panel, String title) {
|
||||
super(model, title, null);
|
||||
this.panel = panel;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize(T data) {
|
||||
// stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFinish(T data) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void populateData(T data) {
|
||||
// stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(T data) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent getComponent() {
|
||||
return panel;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+8
-11
@@ -4,9 +4,9 @@
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@@ -27,11 +27,12 @@ import org.junit.*;
|
||||
import org.junit.experimental.categories.Category;
|
||||
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.wizard.WizardManager;
|
||||
import docking.wizard.WizardDialog;
|
||||
import generic.test.AbstractGenericTest;
|
||||
import generic.test.category.PortSensitiveCategory;
|
||||
import ghidra.framework.GenericRunInfo;
|
||||
import ghidra.framework.client.*;
|
||||
import ghidra.framework.main.wizard.project.*;
|
||||
import ghidra.framework.model.Project;
|
||||
import ghidra.framework.model.ProjectLocator;
|
||||
import ghidra.framework.preferences.Preferences;
|
||||
@@ -130,8 +131,7 @@ public class NewProjectWizardTest extends AbstractGhidraHeadedIntegrationTest {
|
||||
performAction(action, false);
|
||||
waitForSwing();
|
||||
|
||||
WizardManager wm =
|
||||
waitForDialogComponent(frontEndTool.getToolFrame(), WizardManager.class, 2000);
|
||||
WizardDialog wm = waitForDialogComponent(WizardDialog.class);
|
||||
assertNotNull(wm);
|
||||
|
||||
ProjectTypePanel typePanel = findComponent(wm, ProjectTypePanel.class);
|
||||
@@ -193,8 +193,7 @@ public class NewProjectWizardTest extends AbstractGhidraHeadedIntegrationTest {
|
||||
performAction(action, false);
|
||||
waitForSwing();
|
||||
|
||||
WizardManager wm =
|
||||
waitForDialogComponent(frontEndTool.getToolFrame(), WizardManager.class, 2000);
|
||||
WizardDialog wm = waitForDialogComponent(WizardDialog.class);
|
||||
assertNotNull(wm);
|
||||
|
||||
ProjectTypePanel typePanel = findComponent(wm, ProjectTypePanel.class);
|
||||
@@ -253,8 +252,7 @@ public class NewProjectWizardTest extends AbstractGhidraHeadedIntegrationTest {
|
||||
performAction(action, false);
|
||||
waitForSwing();
|
||||
|
||||
WizardManager wm =
|
||||
waitForDialogComponent(frontEndTool.getToolFrame(), WizardManager.class, 2000);
|
||||
WizardDialog wm = waitForDialogComponent(WizardDialog.class);
|
||||
assertNotNull(wm);
|
||||
|
||||
ProjectTypePanel typePanel = findComponent(wm, ProjectTypePanel.class);
|
||||
@@ -393,8 +391,7 @@ public class NewProjectWizardTest extends AbstractGhidraHeadedIntegrationTest {
|
||||
performAction(action, false);
|
||||
waitForSwing();
|
||||
|
||||
WizardManager wm =
|
||||
waitForDialogComponent(frontEndTool.getToolFrame(), WizardManager.class, 2000);
|
||||
WizardDialog wm = waitForDialogComponent(WizardDialog.class);
|
||||
assertNotNull(wm);
|
||||
|
||||
ProjectTypePanel typePanel = findComponent(wm, ProjectTypePanel.class);
|
||||
|
||||
+6
-4
@@ -4,9 +4,9 @@
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@@ -27,9 +27,11 @@ import org.junit.experimental.categories.Category;
|
||||
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.widgets.OptionDialog;
|
||||
import docking.wizard.WizardManager;
|
||||
import docking.wizard.WizardDialog;
|
||||
import generic.test.category.PortSensitiveCategory;
|
||||
import ghidra.framework.client.RepositoryAdapter;
|
||||
import ghidra.framework.main.wizard.project.RepositoryPanel;
|
||||
import ghidra.framework.main.wizard.project.ServerInfoPanel;
|
||||
import ghidra.framework.model.*;
|
||||
import ghidra.framework.preferences.Preferences;
|
||||
import ghidra.program.database.ProgramBuilder;
|
||||
@@ -377,7 +379,7 @@ public class ProjectInfoDialogTest extends AbstractGhidraHeadedIntegrationTest {
|
||||
private void stepThroughWizard(boolean doFinish, final String repositoryName) throws Exception {
|
||||
System.err.println(getClass().getName() + ".stepThroughWizard()...");
|
||||
windowForComponent(dialog.getComponent());
|
||||
WizardManager wm = waitForDialogComponent(WizardManager.class);
|
||||
WizardDialog wm = waitForDialogComponent(WizardDialog.class);
|
||||
assertNotNull(wm);
|
||||
|
||||
JButton nextButton = findButtonByText(wm, "Next >>");
|
||||
|
||||
+6
-10
@@ -4,9 +4,9 @@
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@@ -29,10 +29,11 @@ import javax.swing.*;
|
||||
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.test.AbstractDockingTest;
|
||||
import docking.wizard.WizardManager;
|
||||
import docking.wizard.WizardDialog;
|
||||
import generic.test.AbstractGTest;
|
||||
import generic.test.AbstractGuiTest;
|
||||
import ghidra.framework.client.*;
|
||||
import ghidra.framework.main.wizard.project.*;
|
||||
import ghidra.framework.model.*;
|
||||
import ghidra.server.remote.ServerTestUtil;
|
||||
import ghidra.test.AbstractGhidraHeadlessIntegrationTest;
|
||||
@@ -73,7 +74,7 @@ public class SharedProjectUtil {
|
||||
AbstractDockingTest.performAction(action, false);
|
||||
AbstractGuiTest.waitForSwing();
|
||||
|
||||
WizardManager wm = AbstractDockingTest.waitForDialogComponent(WizardManager.class);
|
||||
WizardDialog wm = AbstractDockingTest.waitForDialogComponent(WizardDialog.class);
|
||||
|
||||
ProjectTypePanel typePanel = AbstractDockingTest.findComponent(wm, ProjectTypePanel.class);
|
||||
final JRadioButton rb =
|
||||
@@ -126,12 +127,7 @@ public class SharedProjectUtil {
|
||||
projNameField.setText(projectName);
|
||||
});
|
||||
|
||||
if (!finishButton.isEnabled()) {
|
||||
String statusMessage = projPanel.getStatusMessage();
|
||||
System.err.println(
|
||||
"Finish button is unexectedly disabled!!\n\t" + "Status message: " + statusMessage);
|
||||
return false;
|
||||
}
|
||||
assertTrue("Finish button is unexpectedly disabled", finishButton.isEnabled());
|
||||
|
||||
AbstractGuiTest.pressButton(finishButton, true);
|
||||
AbstractGuiTest.waitForSwing();
|
||||
|
||||
+5
-5
@@ -4,9 +4,9 @@
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@@ -35,7 +35,7 @@ import docking.widgets.OptionDialog;
|
||||
import docking.widgets.filechooser.GhidraFileChooser;
|
||||
import docking.widgets.table.GTable;
|
||||
import docking.widgets.tree.GTreeNode;
|
||||
import docking.wizard.WizardManager;
|
||||
import docking.wizard.WizardDialog;
|
||||
import ghidra.app.plugin.core.codebrowser.CodeBrowserPlugin;
|
||||
import ghidra.framework.GenericRunInfo;
|
||||
import ghidra.framework.ToolUtils;
|
||||
@@ -176,7 +176,7 @@ public class ToolActionManagerTest extends AbstractGhidraHeadedIntegrationTest {
|
||||
|
||||
String toolNamePrefix = "TestCodeBrowser";
|
||||
final File cbFile = ResourceManager
|
||||
.getResourceFile("defaultTools/" + toolNamePrefix + ToolUtils.TOOL_EXTENSION);
|
||||
.getResourceFile("defaultTools/" + toolNamePrefix + ToolUtils.TOOL_EXTENSION);
|
||||
assertNotNull(cbFile);
|
||||
|
||||
DockingActionIf importAction = getAction("Import Tool");
|
||||
@@ -334,7 +334,7 @@ public class ToolActionManagerTest extends AbstractGhidraHeadedIntegrationTest {
|
||||
|
||||
// close the VT tool
|
||||
// we first have to close the wizard...
|
||||
final WizardManager wizard = waitForDialogComponent(WizardManager.class);
|
||||
WizardDialog wizard = waitForDialogComponent(WizardDialog.class);
|
||||
runSwing(() -> wizard.close());
|
||||
|
||||
// ...then the tool
|
||||
|
||||
Reference in New Issue
Block a user