-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JBIDE-23823 Move forge.reddeer plugin to jbosstools-forge (#176)
Signed-off-by: Josef Kopriva <jkopriva@redhat.com>
- Loading branch information
Showing
15 changed files
with
703 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
screenshots/ | ||
target/ | ||
bin/ | ||
/.classpath | ||
/.project | ||
.settings/ |
16 changes: 16 additions & 0 deletions
16
test-framework/org.jboss.tools.forge.reddeer/META-INF/MANIFEST.MF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Name: Forge RedDeer | ||
Bundle-SymbolicName: org.jboss.tools.forge.reddeer | ||
Bundle-Version: 2.0.201.qualifier | ||
Bundle-Activator: org.jboss.tools.forge.reddeer.Activator | ||
Require-Bundle: org.eclipse.core.runtime, | ||
org.eclipse.reddeer.go;bundle-version="2.0.0", | ||
org.eclipse.ui, | ||
org.junit;bundle-version="4.11.0" | ||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7 | ||
Bundle-ActivationPolicy: lazy | ||
Export-Package: org.jboss.tools.forge.reddeer, | ||
org.jboss.tools.forge.reddeer.condition, | ||
org.jboss.tools.forge.reddeer.view, | ||
org.jboss.tools.forge.reddeer.ui.wizard |
4 changes: 4 additions & 0 deletions
4
test-framework/org.jboss.tools.forge.reddeer/build.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
source.. = src/ | ||
output.. = bin/ | ||
bin.includes = META-INF/,\ | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.jboss.tools.forge</groupId> | ||
<artifactId>test-framework</artifactId> | ||
<version>2.0.201-SNAPSHOT</version> | ||
</parent> | ||
<groupId>org.jboss.tools.forge</groupId> | ||
<artifactId>org.jboss.tools.forge.reddeer</artifactId> | ||
<packaging>eclipse-plugin</packaging> | ||
|
||
</project> |
60 changes: 60 additions & 0 deletions
60
...-framework/org.jboss.tools.forge.reddeer/src/org/jboss/tools/forge/reddeer/Activator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2017 Red Hat, Inc. | ||
* Distributed under license by Red Hat, Inc. All rights reserved. | ||
* This program is made available under the terms of the | ||
* Eclipse Public License v1.0 which accompanies this distribution, | ||
* and is available at http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
******************************************************************************/ | ||
package org.jboss.tools.forge.reddeer; | ||
|
||
import org.eclipse.ui.plugin.AbstractUIPlugin; | ||
import org.osgi.framework.BundleContext; | ||
|
||
/** | ||
* The activator class controls the plug-in life cycle | ||
*/ | ||
public class Activator extends AbstractUIPlugin { | ||
|
||
// The plug-in ID | ||
public static final String PLUGIN_ID = "org.jboss.tools.forge.reddeer"; //$NON-NLS-1$ | ||
|
||
// The shared instance | ||
private static Activator plugin; | ||
|
||
/** | ||
* The constructor | ||
*/ | ||
public Activator() { | ||
} | ||
|
||
/* | ||
* (non-Javadoc) | ||
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) | ||
*/ | ||
public void start(BundleContext context) throws Exception { | ||
super.start(context); | ||
plugin = this; | ||
} | ||
|
||
/* | ||
* (non-Javadoc) | ||
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) | ||
*/ | ||
public void stop(BundleContext context) throws Exception { | ||
plugin = null; | ||
super.stop(context); | ||
} | ||
|
||
/** | ||
* Returns the shared instance | ||
* | ||
* @return the shared instance | ||
*/ | ||
public static Activator getDefault() { | ||
return plugin; | ||
} | ||
|
||
} |
72 changes: 72 additions & 0 deletions
72
...ls.forge.reddeer/src/org/jboss/tools/forge/reddeer/condition/ForgeConsoleHasNoChange.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2017 Red Hat, Inc. | ||
* Distributed under license by Red Hat, Inc. All rights reserved. | ||
* This program is made available under the terms of the | ||
* Eclipse Public License v1.0 which accompanies this distribution, | ||
* and is available at http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
******************************************************************************/ | ||
package org.jboss.tools.forge.reddeer.condition; | ||
|
||
import org.eclipse.reddeer.common.condition.AbstractWaitCondition; | ||
import org.jboss.tools.forge.reddeer.view.ForgeConsoleView; | ||
|
||
/** | ||
* Returns true if a console has no change for the specified time period. | ||
* | ||
* @author jkopriva@redhat.com | ||
* | ||
*/ | ||
public class ForgeConsoleHasNoChange extends AbstractWaitCondition { | ||
|
||
private String consoleText; | ||
|
||
/** | ||
* Constructs the condition. | ||
* | ||
*/ | ||
public ForgeConsoleHasNoChange() { | ||
this.consoleText = getConsoleText(); | ||
} | ||
|
||
/* | ||
* (non-Javadoc) | ||
* | ||
* @see org.eclipse.reddeer.common.condition.WaitCondition#test() | ||
*/ | ||
@Override | ||
public boolean test() { | ||
String currentConsoleText = getConsoleText(); | ||
|
||
if (!currentConsoleText.equals(consoleText)) { | ||
consoleText = currentConsoleText; | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
/* | ||
* (non-Javadoc) | ||
* | ||
* @see | ||
* org.eclipse.reddeer.common.condition.AbstractWaitCondition#description() | ||
*/ | ||
@Override | ||
public String description() { | ||
return "Forge console is still changing"; | ||
} | ||
|
||
/** | ||
* Returns Forge Console text. | ||
* | ||
* @return String | ||
* Console Text | ||
*/ | ||
private static String getConsoleText() { | ||
ForgeConsoleView forgeConsoleView = new ForgeConsoleView(); | ||
forgeConsoleView.open(); | ||
return forgeConsoleView.getConsoleText(); | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
....tools.forge.reddeer/src/org/jboss/tools/forge/reddeer/condition/ForgeConsoleHasText.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2017 Red Hat, Inc. | ||
* Distributed under license by Red Hat, Inc. All rights reserved. | ||
* This program is made available under the terms of the | ||
* Eclipse Public License v1.0 which accompanies this distribution, | ||
* and is available at http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
******************************************************************************/ | ||
package org.jboss.tools.forge.reddeer.condition; | ||
|
||
import org.eclipse.reddeer.common.condition.AbstractWaitCondition; | ||
import org.jboss.tools.forge.reddeer.view.ForgeConsoleView; | ||
|
||
/** | ||
* Returns true if the console contains a given text | ||
* | ||
* @author psrna | ||
* | ||
*/ | ||
public class ForgeConsoleHasText extends AbstractWaitCondition { | ||
|
||
private String text; | ||
|
||
/** | ||
* Construct the condition with a given text. | ||
* | ||
* @param text Text | ||
*/ | ||
public ForgeConsoleHasText(String text) { | ||
this.text = text; | ||
} | ||
|
||
@Override | ||
public boolean test() { | ||
String consoleText = getConsoleText(); | ||
return consoleText.contains(text); | ||
} | ||
|
||
@Override | ||
public String description() { | ||
String consoleText = getConsoleText(); | ||
return "console contains '" + text + "'\n" + consoleText; | ||
} | ||
|
||
private static String getConsoleText() { | ||
ForgeConsoleView forgeConsoleView = new ForgeConsoleView(); | ||
forgeConsoleView.open(); | ||
return forgeConsoleView.getConsoleText(); | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
...ss.tools.forge.reddeer/src/org/jboss/tools/forge/reddeer/condition/ProjectIsSelected.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2017 Red Hat, Inc. | ||
* Distributed under license by Red Hat, Inc. All rights reserved. | ||
* This program is made available under the terms of the | ||
* Eclipse Public License v1.0 which accompanies this distribution, | ||
* and is available at http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
******************************************************************************/ | ||
package org.jboss.tools.forge.reddeer.condition; | ||
|
||
import org.eclipse.reddeer.common.condition.AbstractWaitCondition; | ||
import org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer; | ||
|
||
/** | ||
* Returns true if a project is selected in Project Explorer. | ||
* | ||
* @author jkopriva@redhat.com | ||
* | ||
*/ | ||
public class ProjectIsSelected extends AbstractWaitCondition { | ||
|
||
private String projectName; | ||
private ProjectExplorer pe; | ||
|
||
/** | ||
* Construct the condition. | ||
* | ||
* @param projectName Name of project, which should be selected in Project Explorer. | ||
*/ | ||
public ProjectIsSelected(String projectName) { | ||
this.projectName = projectName; | ||
this.pe = new ProjectExplorer(); | ||
pe.open(); | ||
} | ||
|
||
|
||
/* | ||
* (non-Javadoc) | ||
* | ||
* @see org.eclipse.reddeer.common.condition.WaitCondition#test() | ||
*/ | ||
@Override | ||
public boolean test() { | ||
if (!pe.getProject(this.projectName).isSelected()) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
/* | ||
* (non-Javadoc) | ||
* | ||
* @see | ||
* org.eclipse.reddeer.common.condition.AbstractWaitCondition#description() | ||
*/ | ||
@Override | ||
public String description() { | ||
return "Project has not been selected in Project Explorer!"; | ||
} | ||
|
||
} |
Oops, something went wrong.