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

CDK itests refactoring #1651

Merged
merged 1 commit into from
Jan 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
echo "minishift v1.3.1+a2d3799"
echo "CDK v3.1.1-1"
echo minishift v1.3.1+a2d3799
echo CDK v3.1.1-1
exit 0

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
echo "minishift v1.7.0+204ce19"
echo "CDK v3.2.0-1"
echo minishift v1.7.0+204ce19
echo CDK v3.2.0-1
exit 0

Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
package org.jboss.tools.cdk.ui.bot.test;

import org.eclipse.reddeer.junit.runner.RedDeerSuite;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.CDK32ServerAdapterConnectionTest;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.CDK32ServerAdapterRestartTest;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.CDK32ServerAdapterStartTest;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.CDK32IntegrationTest;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.openshift.CDKImageRegistryUrlDiscoveryFailureTest;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.openshift.CDKImageRegistryUrlDiscoveryTest;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.openshift.CDKImageRegistryUrlValidatorTest;
import org.jboss.tools.cdk.ui.bot.test.server.editor.CDK32ServerEditorTest;
import org.jboss.tools.cdk.ui.bot.test.server.editor.launch.CDKLaunchConfigurationTest;
import org.jboss.tools.cdk.ui.bot.test.server.wizard.CDK32ServerWizardTest;
Expand All @@ -26,10 +26,10 @@
CDK32ServerWizardTest.class,
CDK32ServerEditorTest.class,
CDKLaunchConfigurationTest.class,
CDKImageRegistryUrlValidatorTest.class,
CDKImageRegistryUrlDiscoveryFailureTest.class,
CDKImageRegistryUrlDiscoveryTest.class,
CDK32ServerAdapterStartTest.class,
CDK32ServerAdapterRestartTest.class,
CDK32ServerAdapterConnectionTest.class
CDK32IntegrationTest.class
})
/**
* @author ondrej dockal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ public abstract class CDKAbstractTest {

public static final String PASSWORD;

public static final String VAGRANTFILE;

public static final String MINISHIFT_HYPERVISOR;

public static final String MINISHIFT;
Expand All @@ -62,7 +60,6 @@ public abstract class CDKAbstractTest {
static {
USERNAME = CDKTestUtils.getSystemProperty("developers.username"); //$NON-NLS-1$
PASSWORD = CDKTestUtils.getSystemProperty("developers.password"); //$NON-NLS-1$
VAGRANTFILE = CDKTestUtils.getSystemProperty("vagrantfile"); //$NON-NLS-1$
MINISHIFT = CDKTestUtils.getSystemProperty("minishift"); //$NON-NLS-1$
MINISHIFT_PROFILE = CDKTestUtils.getSystemProperty("minishift.profile"); //$NON-NLS-1$
MINISHIFT_HYPERVISOR = CDKTestUtils.getSystemProperty("minishift.hypervisor"); //$NON-NLS-1$
Expand All @@ -72,13 +69,19 @@ public abstract class CDKAbstractTest {
public static void checkMinishiftParameters() {
Map<String, String> dict = new HashMap<>();
dict.put("Minishift path", MINISHIFT);
dict.put("Minishift hypervisor", MINISHIFT_HYPERVISOR == null ? "" : MINISHIFT_HYPERVISOR);
CDKTestUtils.checkParameterNotNull(dict);
checkMinishiftHypervisorParameters();
}

public static void checkMinishiftProfileParameters() {
Map<String, String> dict = new HashMap<>();
dict.put("Minishift profile path", MINISHIFT_PROFILE);
CDKTestUtils.checkParameterNotNull(dict);
checkMinishiftHypervisorParameters();
}

public static void checkMinishiftHypervisorParameters() {
Map<String, String> dict = new HashMap<>();
dict.put("Minishift hypervisor", MINISHIFT_HYPERVISOR == null ? "" : MINISHIFT_HYPERVISOR);
CDKTestUtils.checkParameterNotNull(dict);
}
Expand All @@ -90,12 +93,6 @@ public static void checkDevelopersParameters() {
CDKTestUtils.checkParameterNotNull(dict);
}

public static void checkVagrantfileParameters() {
Map<String, String> dict = new HashMap<>();
dict.put("Vagrantfile path", VAGRANTFILE);
CDKTestUtils.checkParameterNotNull(dict);
}

/**
* Provide resource absolute path in project directory
* @param path - resource relative path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,29 @@
package org.jboss.tools.cdk.ui.bot.test;

import org.eclipse.reddeer.junit.runner.RedDeerSuite;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.CDK32ServerAdapterConnectionTest;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.CDK32ServerAdapterRestartTest;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.CDK32ServerAdapterStartTest;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.CDK32IntegrationTest;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.openshift.CDKImageRegistryUrlDiscoveryFailureTest;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.openshift.CDKImageRegistryUrlDiscoveryTest;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.openshift.CDKImageRegistryUrlValidatorTest;
import org.jboss.tools.cdk.ui.bot.test.server.editor.CDK32ServerEditorTest;
import org.jboss.tools.cdk.ui.bot.test.server.editor.CDK3ServerEditorTest;
import org.jboss.tools.cdk.ui.bot.test.server.editor.CDKServerEditorTest;
import org.jboss.tools.cdk.ui.bot.test.server.editor.launch.CDKLaunchConfigurationTest;
import org.jboss.tools.cdk.ui.bot.test.server.wizard.CDK32ServerWizardTest;
import org.jboss.tools.cdk.ui.bot.test.server.wizard.CDK3ServerWizardTest;
import org.jboss.tools.cdk.ui.bot.test.server.wizard.CDKServerWizardTest;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;

@RunWith(RedDeerSuite.class)
@Suite.SuiteClasses({
CDKServerWizardTest.class,
CDK3ServerWizardTest.class,
CDK32ServerWizardTest.class,
CDKServerEditorTest.class,
CDK3ServerEditorTest.class,
CDK32ServerEditorTest.class,
CDKLaunchConfigurationTest.class,
CDKImageRegistryUrlDiscoveryTest.class,
CDKImageRegistryUrlDiscoveryFailureTest.class,
CDKImageRegistryUrlValidatorTest.class,
CDK32ServerAdapterStartTest.class,
CDK32ServerAdapterRestartTest.class,
CDK32ServerAdapterConnectionTest.class
CDK32IntegrationTest.class
})
/**
* @author ondrej dockal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,22 @@
import org.eclipse.reddeer.junit.runner.RedDeerSuite;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.CDK32IntegrationTest;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.openshift.CDKImageRegistryUrlDiscoveryTest;
import org.jboss.tools.cdk.ui.bot.test.server.adapter.openshift.CDKImageRegistryUrlValidatorTest;
import org.jboss.tools.cdk.ui.bot.test.server.editor.CDK32ServerEditorTest;
import org.jboss.tools.cdk.ui.bot.test.server.editor.CDK3ServerEditorTest;
import org.jboss.tools.cdk.ui.bot.test.server.editor.CDKServerEditorTest;
import org.jboss.tools.cdk.ui.bot.test.server.editor.launch.CDKLaunchConfigurationTest;
import org.jboss.tools.cdk.ui.bot.test.server.wizard.CDK32ServerWizardTest;
import org.jboss.tools.cdk.ui.bot.test.server.wizard.CDK3ServerWizardTest;
import org.jboss.tools.cdk.ui.bot.test.server.wizard.CDKServerWizardTest;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;

@RunWith(RedDeerSuite.class)
@Suite.SuiteClasses({
CDKServerWizardTest.class,
CDK3ServerWizardTest.class,
CDK32ServerWizardTest.class,
CDKServerEditorTest.class,
CDK3ServerEditorTest.class,
CDK32ServerEditorTest.class,
CDKLaunchConfigurationTest.class,
CDKImageRegistryUrlValidatorTest.class,
CDKImageRegistryUrlDiscoveryTest.class,
//CDK3IntegrationTest.class,
CDK32IntegrationTest.class
})
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,50 +10,53 @@
******************************************************************************/
package org.jboss.tools.cdk.ui.bot.test.server.adapter;

import static org.junit.Assert.assertEquals;

import org.eclipse.reddeer.eclipse.wst.server.ui.cnf.ServersViewEnums.ServerState;
import org.eclipse.reddeer.junit.runner.RedDeerSuite;
import org.jboss.tools.openshift.reddeer.requirement.CleanOpenShiftExplorerRequirement.CleanOpenShiftExplorer;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;

/**
* Testing of CDK 3.2+ server adapter
* @author odockal
*
*/
@CleanOpenShiftExplorer
@RunWith(RedDeerSuite.class)
public class CDK32IntegrationTest extends CDKServerAdapterAbstractTest {

private static final String DOCKER_DAEMON_CONNECTION = "Container Development Environment 3.2";
private static final String DOCKER_DAEMON_CONNECTION = SERVER_ADAPTER_32;

@Override
protected String getServerAdapter() {
// return SERVER_ADAPTER_32;
//workaround for https://github.com/eclipse/reddeer/issues/1841
return "Container Development Environment 3.2";
return SERVER_ADAPTER_32;
}

@BeforeClass
public static void setup() {
checkMinishiftProfileParameters();
addNewCDK32Server(CDK32_SERVER_NAME, "Container Development Environment 3.2", MINISHIFT_HYPERVISOR, MINISHIFT_PROFILE, "");
addNewCDK32Server(CDK32_SERVER_NAME, SERVER_ADAPTER_32, MINISHIFT_HYPERVISOR, MINISHIFT_PROFILE, "");
}

@Test
public void testCDK3ServerAdapter() {
public void testCDK32ServerAdapter() {
// cdk start verification
startServerAdapter();
startServerAdapter(() -> {});
// cdk inner rhel image was registered during starting of server adapter
verifyConsoleContainsRegEx("\\bRegistering.*subscription-manager\\b");
verifyConsoleContainsRegEx("\\bRegistration in progress.*OK\\b");
// OS3 and docker connection created verification
testOpenshiftConncetion(findOpenShiftConnection(null, OPENSHIFT_USERNAME));
testDockerConnection(DOCKER_DAEMON_CONNECTION);
// cdk restart check
getCDEServer().restart();
assertEquals(ServerState.STARTED, getCDEServer().getLabel().getState());
restartServerAdapter();
// OS and docker connection should be operational after restart
testOpenshiftConncetion(findOpenShiftConnection(null, OPENSHIFT_USERNAME));
testDockerConnection(DOCKER_DAEMON_CONNECTION);
// cdk stop verification
getCDEServer().stop();
assertEquals(ServerState.STOPPED, getCDEServer().getLabel().getState());
stopServerAdapter();
// verify unregistering of machine
verifyConsoleContainsRegEx("\\bUnregistering machine\\b");
}

}

This file was deleted.

This file was deleted.

This file was deleted.