Author: adietish
Date: 2010-10-29 06:27:06 -0400 (Fri, 29 Oct 2010)
New Revision: 26129
Added:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/RealmMockIntegrationTest.launch
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/client/RealmMockIntegrationTest.java
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudRealm.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Instance.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Realm.java
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/ProfileMockIntegrationTest.launch
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/client/InstanceMockIntegrationTest.java
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/client/ProfileMockIntegrationTest.java
Log:
[JBIDE-7321] changed Realm#state to enum, added test for DeltaCloudClient#listRealms &
DeltaCloudClient#listRealm(Strign id)
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java 2010-10-29
09:52:02 UTC (rev 26128)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java 2010-10-29
10:27:06 UTC (rev 26129)
@@ -17,11 +17,11 @@
public class DeltaCloudInstance {
- public final static String PENDING = Instance.State.PENDING.toString();
- public final static String RUNNING = Instance.State.RUNNING.toString();
- public final static String STOPPED = Instance.State.STOPPED.toString();
- public final static String TERMINATED = Instance.State.TERMINATED.toString();
- public final static String BOGUS = Instance.State.BOGUS.toString();
+ public final static String PENDING = Instance.InstanceState.PENDING.toString();
+ public final static String RUNNING = Instance.InstanceState.RUNNING.toString();
+ public final static String STOPPED = Instance.InstanceState.STOPPED.toString();
+ public final static String TERMINATED = Instance.InstanceState.TERMINATED.toString();
+ public final static String BOGUS = Instance.InstanceState.BOGUS.toString();
public final static String START = Instance.Action.START.toString();
public final static String STOP = Instance.Action.STOP.toString();
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudRealm.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudRealm.java 2010-10-29
09:52:02 UTC (rev 26128)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudRealm.java 2010-10-29
10:27:06 UTC (rev 26129)
@@ -12,27 +12,39 @@
import org.jboss.tools.deltacloud.core.client.Realm;
+/**
+ *
+ * @author Jeff Johnston
+ *
+ * TODO: there are 2 realm classes:
+ * <ul>
+ * <li>org.jboss.tools.deltacloud.core.client.Realm</li>
+ * <li>org.jboss.tools.deltacloud.core.DeltaCloudRealm</li>
+ * </ul>
+ * remove the DeltaCloudRealm class
+ *
+ */
public class DeltaCloudRealm {
-
+
public final static String AVAILABLE = "AVAILABLE"; //$NON-NLS-1$
public final static String UNAVAILABLE = "UNAVAILABLE"; //$NON-NLS-1$
-
+
private Realm realm;
-
+
public DeltaCloudRealm(Realm realm) {
this.realm = realm;
}
-
+
public String getId() {
return realm.getId();
}
-
+
public String getName() {
return realm.getName();
}
-
+
public String getState() {
- return realm.getState();
+ return realm.getState().toString();
}
}
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Instance.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Instance.java 2010-10-29
09:52:02 UTC (rev 26128)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Instance.java 2010-10-29
10:27:06 UTC (rev 26129)
@@ -19,7 +19,7 @@
{
private static final long serialVersionUID = 1L;
- public static enum State { RUNNING, STOPPED, PENDING, TERMINATED, BOGUS };
+ public static enum InstanceState { RUNNING, STOPPED, PENDING, TERMINATED, BOGUS };
public static enum Action { START, STOP, REBOOT, DESTROY };
@@ -44,7 +44,7 @@
private String keyname;
@XmlElement
- private State state;
+ private InstanceState state;
private List<Action> actions;
@@ -105,9 +105,9 @@
protected void setState(String state)
{
try {
- this.state = State.valueOf(state);
+ this.state = InstanceState.valueOf(state);
} catch (Exception e) {
- this.state = State.BOGUS;
+ this.state = InstanceState.BOGUS;
}
}
@@ -168,7 +168,7 @@
return realmId;
}
- public State getState()
+ public InstanceState getState()
{
return state;
}
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Realm.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Realm.java 2010-10-29
09:52:02 UTC (rev 26128)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Realm.java 2010-10-29
10:27:06 UTC (rev 26129)
@@ -16,11 +16,15 @@
{
private static final long serialVersionUID = 1L;
+ public static enum RealmState {
+ AVAILABLE, UNAVAILABLE, UNKNOWN
+ }
+
@XmlElement
private String name;
@XmlElement
- private String state;
+ private RealmState state;
@XmlElement
private int limit;
@@ -38,7 +42,11 @@
@SuppressWarnings("unused")
private void setState(String state)
{
- this.state = state;
+ try {
+ this.state = RealmState.valueOf(state);
+ } catch (Exception e) {
+ this.state = RealmState.UNKNOWN;
+ }
}
@SuppressWarnings("unused")
@@ -57,11 +65,11 @@
return name;
}
- public String getState()
+ public RealmState getState()
{
return state;
}
-
+
public int getLimit()
{
return limit;
Modified:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/ProfileMockIntegrationTest.launch
===================================================================
---
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/ProfileMockIntegrationTest.launch 2010-10-29
09:52:02 UTC (rev 26128)
+++
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/ProfileMockIntegrationTest.launch 2010-10-29
10:27:06 UTC (rev 26129)
@@ -12,7 +12,7 @@
<booleanAttribute key="clearwslog" value="false"/>
<stringAttribute key="configLocation"
value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
<booleanAttribute key="default" value="false"/>
-<stringAttribute key="deselected_workspace_plugins"
value="org.eclipse.epp.usagedata.recording,org.eclipse.epp.usagedata.gathering,org.mozilla.xulrunner.cocoa.macosx,org.jboss.tools.common,org.jboss.tools.deltacloud.docs,org.mozilla.xulrunner.gtk.linux.x86_64,org.jboss.tools.usage,org.mozilla.xulrunner.win32.win32.x86,com.jboss.jbds.usage.branding,org.jboss.tools.usage.test,org.mozilla.xulrunner.gtk.linux.x86,org.eclipse.epp.usagedata.ui,org.mozilla.xulrunner.carbon.macosx,org.mozilla.xpcom,org.jboss.tools.tests,org.jboss.tools.deltacloud.ui,org.jruby.jruby"/>
+<stringAttribute key="deselected_workspace_plugins"
value="org.eclipse.epp.usagedata.recording,org.eclipse.epp.usagedata.gathering,org.mozilla.xulrunner.cocoa.macosx,org.jboss.tools.common,org.jboss.tools.deltacloud.docs,org.mozilla.xulrunner.gtk.linux.x86_64,org.jboss.tools.usage,org.jboss.tools.usage.test,org.mozilla.xulrunner.win32.win32.x86,com.jboss.jbds.usage.branding,org.mozilla.xulrunner.gtk.linux.x86,org.eclipse.epp.usagedata.ui,org.mozilla.xulrunner.carbon.macosx,org.mozilla.xpcom,org.jboss.tools.deltacloud.ui,org.jboss.tools.tests,org.jruby.jruby"/>
<booleanAttribute key="includeOptional" value="true"/>
<stringAttribute key="location"
value="${workspace_loc}/../junit-workspace"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
@@ -37,8 +37,8 @@
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.sdk.ide"/>
<booleanAttribute key="run_in_ui_thread" value="true"/>
-<stringAttribute key="selected_target_plugins"
value="org.eclipse.equinox.concurrent@default:default,org.eclipse.core.net.linux.x86_64@default:false,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.ecf.filetransfer@default:default,org.apache.xml.resolver@default:default,org.eclipse.core.commands@default:default,org.eclipse.ltk.ui.refactoring@default:default,org.eclipse.equinox.security@default:default,org.eclipse.wst.common.frameworks@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.emf.common@default:default,org.eclipse.jdt.compiler.tool@default:false,org.eclipse.core.expressions@default:default,org.eclipse.wst.common.emf@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.ecf@default:default,org.eclipse.wst.common.emfworkbench.integration@default:default,org.eclips!
e.ui.ide@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.core.databinding.observable@default:default,org.eclipse.text@default:default,org.apache.commons.logging*1.0.4.v201005080501@default:default,org.eclipse.jface.text@default:default,org.eclipse.core.variables@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.wst.xml.core@default:default,org.apache.commons.httpclient*3.1.0.v201005080502@default:default,org.eclipse.wst.validation@default:default,org.eclipse.jdt.debug@default:default,org.eclipse.team.core@default:default,org.eclipse.wst.common.project.facet.core@default:default,org.junit*4.8.1.v4_8_1_v20100427-1100@default:default,org.eclipse.wst.common.environment@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.jdt.core.manipulation@default:default,org.eclipse.swt@default:default,org.apache.xml.serializer@default:default,org.eclipse.compare@default:default,org.eclipse.search@default:default,org.eclipse.core!
.contenttype@default:default,org.eclipse.equinox.p2.engine@def!
ault:def
ault,org.eclipse.jdt.launching@default:default,org.eclipse.help@default:default,javax.servlet@default:default,com.instantiations.designer.jdt.fragment@default:false,org.eclipse.core.runtime@default:true,org.eclipse.ui@default:default,org.eclipse.wst.common.uriresolver@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.osgi.services@default:default,org.eclipse.jem.util@default:default,org.eclipse.jdt.compiler.apt@default:false,org.eclipse.osgi.util@default:default,org.eclipse.osgi@-1:true,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.ui.forms@default:default,org.eclipse.ui.editors@default:default,org.eclipse.equinox.app@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.swt.gtk.linux.x86_64@default:false,org.eclipse.wst.common.core@default:default,com.ibm.icu@default:default,javax.xml@default:default,org.eclipse.core.filesystem.linux.x86_64@default:false,org.eclipse.ui.navigator@default:default,org.jboss.!
tools.xulrunner.initializer@default:false,org.eclipse.ecf.provider.filetransfer@default:default,org.apache.commons.codec*1.3.0.v20100518-1140@default:default,org.eclipse.jdt.core@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.jface@default:default,org.eclipse.wst.sse.core@default:default,org.eclipse.ui.views@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.compare.core@default:default,org.eclipse.jdt.ui@default:default,org.eclipse.debug.core@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.emf.edit@default:default,org.eclipse.ui.navigator.resources@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.team.ui@default:default,org.eclipse.core.jobs@default:default,org.eclipse.ui.console@default:default,org.eclipse.core.net@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.core.resources@default:default,org.eclipse.ui.workbench.texteditor@def!
ault:default,org.hamcrest.core@default:default,org.eclipse.cor!
e.databi
nding@default:default,org.eclipse.ant.core@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.ltk.core.refactoring@default:default,org.eclipse.debug.ui@default:default,org.eclipse.equinox.common@2:true,org.apache.xerces@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.equinox.registry@default:default"/>
-<stringAttribute key="selected_workspace_plugins"
value="org.jboss.tools.deltacloud.core@default:default,org.jboss.tools.deltacloud.test@default:default"/>
+<stringAttribute key="selected_target_plugins"
value="com.ibm.icu@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.jdt.core.manipulation@default:default,org.eclipse.debug.ui@default:default,org.eclipse.team.ui@default:default,org.eclipse.ui.ide@default:default,org.eclipse.core.expressions@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.core.commands@default:default,org.eclipse.emf.common@default:default,org.eclipse.jface.text@default:default,org.eclipse.swt.gtk.linux.x86_64@default:false,org.eclipse.core.databinding@default:default,org.hamcrest.core@default:default,org.eclipse.osgi@-1:true,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.jdt.debug@default:default,org.eclipse.ltk.ui.refactoring@default:default,org.eclipse.ui.editors@default:default,org.eclipse.search@default:default,org.eclipse.core.variables@default:default,org.eclipse.core.data!
binding.observable@default:default,org.eclipse.emf.edit@default:default,org.eclipse.ui.forms@default:default,org.eclipse.wst.validation@default:default,org.eclipse.wst.common.project.facet.core@default:default,org.eclipse.equinox.security@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.core.runtime@default:true,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.wst.common.core@default:default,org.eclipse.compare@default:default,org.eclipse.osgi.util@default:default,org.eclipse.ui.workbench@default:default,org.jboss.tools.xulrunner.initializer@default:false,org.apache.xml.serializer@default:default,org.eclipse.core.databinding.property@default:default,javax.servlet@default:default,org.eclipse.wst.common.uriresolver@default:default,org.eclipse.jface@default:default,org.eclipse.ecf@default:default,org.eclipse.ui.navigator.resources@default:defau!
lt,com.instantiations.designer.jdt.fragment@default:false,org.!
eclipse.
compare.core@default:default,org.eclipse.ltk.core.refactoring@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.core.filesystem.linux.x86_64@default:false,org.apache.xml.resolver@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.core.net.linux.x86_64@default:false,org.eclipse.team.core@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.ant.core@default:default,org.eclipse.jdt.compiler.apt@default:false,org.eclipse.emf.ecore.change@default:default,org.apache.commons.logging*1.0.4.v201005080501@default:default,org.eclipse.equinox.p2.core@default:default,org.apache.commons.httpclient*3.1.0.v201005080502@default:default,org.eclipse.core.resources@default:default,javax.xml@default:default,org.eclipse.jdt.launching@default:default,org.eclipse.wst.xml.core@default:def!
ault,org.eclipse.wst.common.emf@default:default,org.eclipse.jdt.compiler.tool@default:false,org.eclipse.wst.common.frameworks@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.core.jobs@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.wst.common.environment@default:default,org.eclipse.debug.core@default:default,org.eclipse.text@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.core.net@default:default,org.eclipse.osgi.services@default:default,org.eclipse.ui.views@default:default,org.eclipse.swt@default:default,org.eclipse.jdt.ui@default:default,org.eclipse.jdt.core@default:default,org.eclipse.equinox.common@2:true,org.eclipse.ecf.identity@default:default,org.eclipse.jem.util@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.ui@default:default,org.junit*4.8.1.v4_8_1_v20100427-1100@default:default,org.eclipse.equinox.app@default:default,org.eclipse.wst.common.emfworkbench.integ!
ration@default:default,org.apache.xerces@default:default,org.e!
clipse.w
st.sse.core@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.help@default:default,org.eclipse.ui.console@default:default,org.apache.commons.codec*1.3.0.v20100518-1140@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.core.runtime.compatibility.registry@default:false"/>
+<stringAttribute key="selected_workspace_plugins"
value="org.jboss.tools.deltacloud.test@default:default,org.jboss.tools.deltacloud.core@default:default"/>
<booleanAttribute key="show_selected_only" value="false"/>
<booleanAttribute key="tracing" value="false"/>
<booleanAttribute key="useCustomFeatures" value="false"/>
Added:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/RealmMockIntegrationTest.launch
===================================================================
---
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/RealmMockIntegrationTest.launch
(rev 0)
+++
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/RealmMockIntegrationTest.launch 2010-10-29
10:27:06 UTC (rev 26129)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="no"?>
+<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
+<booleanAttribute key="append.args" value="true"/>
+<stringAttribute key="application"
value="org.eclipse.pde.junit.runtime.coretestapplication"/>
+<booleanAttribute key="askclear" value="false"/>
+<booleanAttribute key="automaticAdd" value="true"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="true"/>
+<booleanAttribute key="clearws" value="true"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation"
value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
+<booleanAttribute key="default" value="false"/>
+<stringAttribute key="deselected_workspace_plugins"
value="org.eclipse.epp.usagedata.recording,org.eclipse.epp.usagedata.gathering,org.mozilla.xulrunner.cocoa.macosx,org.jboss.tools.common,org.jboss.tools.deltacloud.docs,org.mozilla.xulrunner.gtk.linux.x86_64,org.jboss.tools.usage,org.jboss.tools.usage.test,org.mozilla.xulrunner.win32.win32.x86,com.jboss.jbds.usage.branding,org.mozilla.xulrunner.gtk.linux.x86,org.eclipse.epp.usagedata.ui,org.mozilla.xulrunner.carbon.macosx,org.mozilla.xpcom,org.jboss.tools.deltacloud.ui,org.jboss.tools.tests,org.jruby.jruby"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="location"
value="${workspace_loc}/../junit-workspace"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry
value="/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/client/RealmMockIntegrationTest.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
+<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER"
value=""/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR"
value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME"
value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND"
value="org.eclipse.jdt.junit.loader.junit4"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE"
value="org.jboss.tools.internal.deltacloud.test.core.client.RealmMockIntegrationTest"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS"
value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl}
-consoleLog"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR"
value="org.jboss.tools.deltacloud.test"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER"
value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS"
value="-Dosgi.requiredJavaVersion=1.5 -XX:MaxPermSize=256m -Xms40m
-Xmx1024m"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.sdk.ide"/>
+<booleanAttribute key="run_in_ui_thread" value="true"/>
+<stringAttribute key="selected_target_plugins"
value="com.ibm.icu@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.jdt.core.manipulation@default:default,org.eclipse.debug.ui@default:default,org.eclipse.team.ui@default:default,org.eclipse.ui.ide@default:default,org.eclipse.core.expressions@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.core.commands@default:default,org.eclipse.emf.common@default:default,org.eclipse.jface.text@default:default,org.eclipse.swt.gtk.linux.x86_64@default:false,org.eclipse.core.databinding@default:default,org.hamcrest.core@default:default,org.eclipse.osgi@-1:true,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.jdt.debug@default:default,org.eclipse.ltk.ui.refactoring@default:default,org.eclipse.ui.editors@default:default,org.eclipse.search@default:default,org.eclipse.core.variables@default:default,org.eclipse.core.data!
binding.observable@default:default,org.eclipse.emf.edit@default:default,org.eclipse.ui.forms@default:default,org.eclipse.wst.validation@default:default,org.eclipse.wst.common.project.facet.core@default:default,org.eclipse.equinox.security@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.core.runtime@default:true,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.wst.common.core@default:default,org.eclipse.compare@default:default,org.eclipse.osgi.util@default:default,org.eclipse.ui.workbench@default:default,org.jboss.tools.xulrunner.initializer@default:false,org.apache.xml.serializer@default:default,org.eclipse.core.databinding.property@default:default,javax.servlet@default:default,org.eclipse.wst.common.uriresolver@default:default,org.eclipse.jface@default:default,org.eclipse.ecf@default:default,org.eclipse.ui.navigator.resources@default:defau!
lt,com.instantiations.designer.jdt.fragment@default:false,org.!
eclipse.
compare.core@default:default,org.eclipse.ltk.core.refactoring@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.core.filesystem.linux.x86_64@default:false,org.apache.xml.resolver@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.core.net.linux.x86_64@default:false,org.eclipse.team.core@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.ant.core@default:default,org.eclipse.jdt.compiler.apt@default:false,org.eclipse.emf.ecore.change@default:default,org.apache.commons.logging*1.0.4.v201005080501@default:default,org.eclipse.equinox.p2.core@default:default,org.apache.commons.httpclient*3.1.0.v201005080502@default:default,org.eclipse.core.resources@default:default,javax.xml@default:default,org.eclipse.jdt.launching@default:default,org.eclipse.wst.xml.core@default:def!
ault,org.eclipse.wst.common.emf@default:default,org.eclipse.jdt.compiler.tool@default:false,org.eclipse.wst.common.frameworks@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.core.jobs@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.wst.common.environment@default:default,org.eclipse.debug.core@default:default,org.eclipse.text@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.core.net@default:default,org.eclipse.osgi.services@default:default,org.eclipse.ui.views@default:default,org.eclipse.swt@default:default,org.eclipse.jdt.ui@default:default,org.eclipse.jdt.core@default:default,org.eclipse.equinox.common@2:true,org.eclipse.ecf.identity@default:default,org.eclipse.jem.util@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.ui@default:default,org.junit*4.8.1.v4_8_1_v20100427-1100@default:default,org.eclipse.equinox.app@default:default,org.eclipse.wst.common.emfworkbench.integ!
ration@default:default,org.apache.xerces@default:default,org.e!
clipse.w
st.sse.core@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.help@default:default,org.eclipse.ui.console@default:default,org.apache.commons.codec*1.3.0.v20100518-1140@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.core.runtime.compatibility.registry@default:false"/>
+<stringAttribute key="selected_workspace_plugins"
value="org.jboss.tools.deltacloud.test@default:default,org.jboss.tools.deltacloud.core@default:default"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="false"/>
+<booleanAttribute key="useProduct" value="false"/>
+</launchConfiguration>
Property changes on:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/RealmMockIntegrationTest.launch
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/client/InstanceMockIntegrationTest.java
===================================================================
---
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/client/InstanceMockIntegrationTest.java 2010-10-29
09:52:02 UTC (rev 26128)
+++
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/client/InstanceMockIntegrationTest.java 2010-10-29
10:27:06 UTC (rev 26129)
@@ -23,7 +23,7 @@
import org.jboss.tools.deltacloud.core.client.DeltaCloudClientException;
import org.jboss.tools.deltacloud.core.client.Image;
import org.jboss.tools.deltacloud.core.client.Instance;
-import org.jboss.tools.deltacloud.core.client.Instance.State;
+import org.jboss.tools.deltacloud.core.client.Instance.InstanceState;
import org.jboss.tools.internal.deltacloud.test.context.MockIntegrationTestContext;
import org.junit.After;
import org.junit.Before;
@@ -123,7 +123,7 @@
instance = testSetup.getClient().createInstance(image.getId());
assertTrue(instance != null);
assertEquals(image.getId(), instance.getImageId());
- assertEquals(State.RUNNING, instance.getState());
+ assertEquals(InstanceState.RUNNING, instance.getState());
} finally {
testSetup.quietlyDestroyInstance(instance);
}
@@ -153,18 +153,18 @@
DeltaCloudClient client = testSetup.getClient();
client.shutdownInstance(testInstance.getId());
testInstance = client.listInstances(testInstance.getId()); // reload!
- assertEquals(State.STOPPED, testInstance.getState());
+ assertEquals(InstanceState.STOPPED, testInstance.getState());
}
@Test
public void canStartInstance() throws DeltaCloudClientException {
Instance testInstance = testSetup.getTestInstance();
DeltaCloudClient client = testSetup.getClient();
- if (testInstance.getState() == State.RUNNING) {
+ if (testInstance.getState() == InstanceState.RUNNING) {
client.shutdownInstance(testInstance.getId());
}
client.startInstance(testInstance.getId());
testInstance = client.listInstances(testInstance.getId()); // reload!
- assertEquals(State.RUNNING, testInstance.getState());
+ assertEquals(InstanceState.RUNNING, testInstance.getState());
}
}
Modified:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/client/ProfileMockIntegrationTest.java
===================================================================
---
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/client/ProfileMockIntegrationTest.java 2010-10-29
09:52:02 UTC (rev 26128)
+++
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/client/ProfileMockIntegrationTest.java 2010-10-29
10:27:06 UTC (rev 26129)
@@ -10,8 +10,9 @@
******************************************************************************/
package org.jboss.tools.internal.deltacloud.test.core.client;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.util.List;
@@ -51,6 +52,7 @@
public void canListProfiles() throws DeltaCloudClientException {
List<HardwareProfile> hardwareProfiles = testSetup.getClient().listProfiles();
assertNotNull(hardwareProfiles);
+ assertTrue(hardwareProfiles.size() > 0);
}
@Test
Added:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/client/RealmMockIntegrationTest.java
===================================================================
---
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/client/RealmMockIntegrationTest.java
(rev 0)
+++
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/client/RealmMockIntegrationTest.java 2010-10-29
10:27:06 UTC (rev 26129)
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.internal.deltacloud.test.core.client;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.jboss.tools.deltacloud.core.client.DeltaCloudClient;
+import org.jboss.tools.deltacloud.core.client.DeltaCloudClientException;
+import org.jboss.tools.deltacloud.core.client.Realm;
+import org.jboss.tools.internal.deltacloud.test.context.MockIntegrationTestContext;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Integration tests for key related operations in delta cloud client.
+ *
+ * @author Andre Dietisheim
+ *
+ * @see DeltaCloudClient#listRealms()
+ * @see DeltaCloudClient#listRealm(String)
+ */
+public class RealmMockIntegrationTest {
+
+ private MockIntegrationTestContext testSetup;
+
+ @Before
+ public void setUp() throws IOException, DeltaCloudClientException {
+ this.testSetup = new MockIntegrationTestContext();
+ testSetup.setUp();
+ }
+
+ @After
+ public void tearDown() {
+ testSetup.tearDown();
+ }
+
+ @Test
+ public void canListRealms() throws DeltaCloudClientException {
+ List<Realm> realms = testSetup.getClient().listRealms();
+ assertNotNull(realms);
+ assertTrue(realms.size() > 0);
+ }
+
+ @Test
+ public void canGetProfile() throws DeltaCloudClientException {
+ // get a profile seen in the web UI
+ Realm realm = testSetup.getClient().listRealms("eu");
+ assertNotNull(realm);
+ assertRealm("Europe", Realm.RealmState.AVAILABLE, 0, realm);
+ }
+
+ public void assertRealm(String name, Realm.RealmState state, int limit, Realm realm) {
+ assertEquals(name, realm.getName());
+ assertEquals(state, realm.getState());
+ assertEquals(limit, realm.getLimit());
+ }
+}
Property changes on:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/client/RealmMockIntegrationTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain