-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JBIDE-27821: Created test for Environment variables in Quarkus Launch (…
…#145) * JBIDE-27821: Created test for Environment variables in Quarkus Launch Configuration Signed-off-by: Oleksii Korniienko <[email protected]> * JBIDE-27821: fixed Copyright year Signed-off-by: Oleksii Korniienko <[email protected]> * JBIDE-27821: reworked "addEnvironment" due to eclipse-archived/reddeer#2120 Signed-off-by: Oleksii Korniienko <[email protected]> * JBIDE-27821: renamed class Signed-off-by: Oleksii Korniienko <[email protected]>
- Loading branch information
Showing
4 changed files
with
103 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
60 changes: 60 additions & 0 deletions
60
...g/jboss/tools/quarkus/integration/tests/environment/AbstractEnvironmentVariablesTest.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) 2021 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.quarkus.integration.tests.environment; | ||
|
||
import org.eclipse.reddeer.common.wait.TimePeriod; | ||
import org.eclipse.reddeer.common.wait.WaitUntil; | ||
import org.eclipse.reddeer.eclipse.condition.ConsoleHasText; | ||
import org.eclipse.reddeer.eclipse.debug.ui.launchConfigurations.EnvironmentTab; | ||
import org.eclipse.reddeer.eclipse.debug.ui.launchConfigurations.RunConfigurationsDialog; | ||
import org.eclipse.reddeer.eclipse.ui.console.ConsoleView; | ||
import org.eclipse.reddeer.swt.impl.shell.DefaultShell; | ||
import org.jboss.tools.quarkus.integration.tests.launch.configuration.AbstractLaunchConfigurationTest; | ||
import org.jboss.tools.quarkus.reddeer.common.QuarkusLabels.Shell; | ||
import org.jboss.tools.quarkus.reddeer.ui.launch.QuarkusLaunchConfigurationTabGroup; | ||
|
||
/** | ||
* | ||
* @author [email protected] Oleksii Korniienko | ||
* | ||
*/ | ||
public abstract class AbstractEnvironmentVariablesTest extends AbstractLaunchConfigurationTest { | ||
|
||
private static String ENVIRONMENT_NAME = "MVNW_VERBOSE"; | ||
|
||
public void testEnvironmentWorks(String projectName) { | ||
RunConfigurationsDialog runDialog = new RunConfigurationsDialog(); | ||
QuarkusLaunchConfigurationTabGroup launchConfiguration = createNewQuarkusConfiguration(projectName, runDialog); | ||
checkNewQuarkusConfiguration(projectName, runDialog, launchConfiguration); | ||
addEnvironment(projectName, runDialog, launchConfiguration); | ||
runNewQuarkusConfiguration(projectName, runDialog, launchConfiguration, "8080"); | ||
checkEnvironmentWorks(projectName, runDialog, launchConfiguration); | ||
new ConsoleView().terminateConsole(); | ||
deleteNewQuarkusConfiguration(projectName, runDialog, launchConfiguration); | ||
} | ||
|
||
public void addEnvironment(String projectName, RunConfigurationsDialog runDialog, | ||
QuarkusLaunchConfigurationTabGroup launchConfiguration) { | ||
runDialog.open(); | ||
runDialog.select(launchConfiguration, projectName); | ||
EnvironmentTab envTab = new EnvironmentTab(); | ||
envTab.activate(); | ||
envTab.add(ENVIRONMENT_NAME, "true"); | ||
new DefaultShell(Shell.RUN_CONFIGURATION).setFocus(); | ||
runDialog.close(true); | ||
} | ||
|
||
public void checkEnvironmentWorks(String projectName, RunConfigurationsDialog runDialog, | ||
QuarkusLaunchConfigurationTabGroup launchConfiguration) { | ||
ConsoleView consoleView = new ConsoleView(); | ||
new WaitUntil(new ConsoleHasText(consoleView, "Takari Maven Wrapper"), TimePeriod.DEFAULT); | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
...s/src/org/jboss/tools/quarkus/integration/tests/environment/EnvironmentVariablesTest.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,40 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2021 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.quarkus.integration.tests.environment; | ||
|
||
import org.eclipse.reddeer.junit.runner.RedDeerSuite; | ||
import org.eclipse.reddeer.requirements.openperspective.OpenPerspectiveRequirement.OpenPerspective; | ||
import org.jboss.tools.quarkus.reddeer.perspective.QuarkusPerspective; | ||
import org.jboss.tools.quarkus.reddeer.common.QuarkusLabels.TextLabels; | ||
import org.junit.BeforeClass; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
/** | ||
* | ||
* @author [email protected] Oleksii Korniienko | ||
*/ | ||
@OpenPerspective(QuarkusPerspective.class) | ||
@RunWith(RedDeerSuite.class) | ||
public class EnvironmentVariablesTest extends AbstractEnvironmentVariablesTest { | ||
|
||
private static String PROJECT_NAME = "environment_test"; | ||
|
||
@BeforeClass | ||
public static void createQuarkusProject() { | ||
createNewQuarkusProject(PROJECT_NAME, TextLabels.MAVEN_TYPE); | ||
} | ||
|
||
@Test | ||
public void testEnvironment() { | ||
testEnvironmentWorks(PROJECT_NAME); | ||
} | ||
} |
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