Author: adietish
Date: 2010-10-22 10:42:25 -0400 (Fri, 22 Oct 2010)
New Revision: 25998
Added:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/ImageMockIntegrationTest.launch
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/InstanceMockIntegrationTest.launch
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/ServerTypeMockIntegrationTest.launch
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/ImageMockIntegrationTest.java
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/InstanceMockIntegrationTest.java
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/KeyMockIntegrationTest.java
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/MockIntegrationTestSetup.java
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/ServerTypeMockIntegrationTest.java
Removed:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/DeltaCloudMockClientIntegrationTest.java
Modified:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/bootstrap-deltacloud.rb
Log:
[JBIDE-7371] added instance tests, split tests into separate classes (was getting too
large to run as one test case)
Added:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/ImageMockIntegrationTest.launch
===================================================================
---
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/ImageMockIntegrationTest.launch
(rev 0)
+++
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/ImageMockIntegrationTest.launch 2010-10-22
14:42:25 UTC (rev 25998)
@@ -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.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"/>
+<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/ImageMockIntegrationTest.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.ImageMockIntegrationTest"/>
+<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="org.eclipse.equinox.preferences@default:default,org.apache.commons.httpclient*3.1.0.v201005080502@default:default,org.apache.commons.logging*1.0.4.v201005080501@default:default,org.eclipse.core.runtime@default:true,org.eclipse.debug.core@default:default,org.eclipse.ecf.identity@default:default,org.apache.xml.resolver@default:default,org.eclipse.compare@default:default,javax.servlet@default:default,org.eclipse.ui@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.emf.common@default:default,org.eclipse.jdt.compiler.tool@default:false,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.emf.ecore.xmi@default:default,com.ibm.icu@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.osgi.util@default:default,org.eclipse.wst.validation@default:default,org.eclipse.equinox.p2.repository@default:default,org.ecli!
pse.search@default:default,org.eclipse.ui.views@default:default,org.eclipse.core.filesystem.linux.x86_64@default:false,org.eclipse.ui.console@default:default,org.eclipse.ltk.ui.refactoring@default:default,org.eclipse.equinox.app@default:default,org.eclipse.core.net@default:default,org.eclipse.ecf@default:default,org.eclipse.jface@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.jem.util@default:default,org.eclipse.core.databinding@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.core.net.linux.x86_64@default:false,org.eclipse.core.databinding.observable@default:default,org.eclipse.equinox.common@2:true,org.apache.xml.serializer@default:default,org.apache.xerces@default:default,org.eclipse.equinox.security@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.wst.common.project.facet.core@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.ec!
f.filetransfer@default:default,org.eclipse.jdt.compiler.apt@de!
fault:fa
lse,org.eclipse.compare.core@default:default,org.eclipse.wst.common.emf@default:default,org.eclipse.swt@default:default,org.eclipse.osgi.services@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.core.variables@default:default,org.eclipse.ltk.core.refactoring@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.wst.common.environment@default:default,org.eclipse.wst.common.core@default:default,org.eclipse.wst.xml.core@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.text@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.help@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.wst.common.emfworkbench.integration@default:default,org.jboss.tools.xulrunner.initializer@default:false,org.eclipse.jdt.core.manipulation@default:default,org.eclipse.ui.ide@default!
:default,org.eclipse.jdt.launching@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.ui.editors@default:default,org.eclipse.team.ui@default:default,org.eclipse.debug.ui@default:default,org.eclipse.team.core@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.jdt.ui@default:default,org.eclipse.ant.core@default:default,org.eclipse.jdt.debug@default:default,javax.xml@default:default,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.ui.forms@default:default,org.hamcrest.core@default:default,org.junit*4.8.1.v4_8_1_v20100427-1100@default:default,org.apache.commons.codec*1.3.0.v20100518-1140@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.wst.common.frameworks@default:default,org.eclipse.core.expressions@default:default,org.eclipse.ui.navigator.resources@default:default,com.instantiations.designer.jdt.fragment@default:false,org.eclipse.core.jobs@de!
fault:default,org.eclipse.core.commands@default:default,org.ec!
lipse.os
gi@-1:true,org.eclipse.wst.sse.core@default:default,org.eclipse.core.resources@default:default,org.eclipse.wst.common.uriresolver@default:default,org.eclipse.jdt.core@default:default,org.eclipse.swt.gtk.linux.x86_64@default:false,org.eclipse.jface.text@default:default,org.eclipse.emf.edit@default:default,org.eclipse.core.filesystem@default:default"/>
+<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/ImageMockIntegrationTest.launch
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/InstanceMockIntegrationTest.launch
===================================================================
---
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/InstanceMockIntegrationTest.launch
(rev 0)
+++
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/InstanceMockIntegrationTest.launch 2010-10-22
14:42:25 UTC (rev 25998)
@@ -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.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"/>
+<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/InstanceMockIntegrationTest.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.InstanceMockIntegrationTest"/>
+<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="org.eclipse.equinox.preferences@default:default,org.apache.commons.httpclient*3.1.0.v201005080502@default:default,org.apache.commons.logging*1.0.4.v201005080501@default:default,javax.servlet.jsp@default:default,org.eclipse.help.base@default:default,org.eclipse.core.runtime@default:true,org.eclipse.debug.core@default:default,org.eclipse.ecf.identity@default:default,org.apache.xml.resolver@default:default,org.eclipse.compare@default:default,javax.servlet@default:default,org.eclipse.ui@default:default,org.eclipse.help.ui@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.emf.common@default:default,org.eclipse.jdt.compiler.tool@default:false,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.emf.ecore.xmi@default:default,com.ibm.icu@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.osgi.util@default:d!
efault,org.apache.lucene.analysis@default:default,org.mortbay.jetty.server@default:default,org.eclipse.ui.ide.application@default:default,org.eclipse.wst.validation@default:default,org.eclipse.update.configurator@3:true,org.eclipse.equinox.p2.repository@default:default,org.eclipse.search@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.ui.views@default:default,org.eclipse.core.filesystem.linux.x86_64@default:false,org.eclipse.ui.console@default:default,org.eclipse.ltk.ui.refactoring@default:default,org.eclipse.equinox.app@default:default,org.eclipse.core.net@default:default,org.eclipse.ecf@default:default,org.eclipse.jface@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.jem.util@default:default,org.eclipse.core.databinding@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.core.net.linux.x86_64@default:false,org.eclipse.core.databinding.observable@default:default,org.eclipse.equinox.common@2:true,org.apache.xml.seria!
lizer@default:default,org.apache.xerces@default:default,org.ec!
lipse.eq
uinox.security@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.wst.common.project.facet.core@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.ecf.filetransfer@default:default,org.apache.ant@default:default,org.eclipse.jdt.compiler.apt@default:false,org.eclipse.compare.core@default:default,org.eclipse.wst.common.emf@default:default,org.eclipse.swt@default:default,org.eclipse.osgi.services@default:default,org.eclipse.swtbot.ant.optional.junit4@default:false,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.core.variables@default:default,org.eclipse.ltk.core.refactoring@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.wst.common.environment@default:default,org.eclipse.wst.common.core@default:default,org.eclipse.wst.xml.core@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.swtbot.ant.optional.junit3@!
default:false,org.eclipse.equinox.p2.metadata@default:default,org.apache.lucene@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.text@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.help@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.wst.common.emfworkbench.integration@default:default,org.jboss.tools.xulrunner.initializer@default:false,org.eclipse.jdt.core.manipulation@default:default,org.eclipse.ui.ide@default:default,org.junit4@default:default,org.apache.commons.el@default:default,org.eclipse.jdt.launching@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.core.runtime.compatibility@default:default,org.eclipse.ui.editors@default:default,org.eclipse.team.ui@default:default,org.eclipse.debug.ui@default:default,org.eclipse.team.core@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.jdt.ui@default:default,org.ecl!
ipse.ant.core@default:default,org.eclipse.jdt.debug@default:de!
fault,or
g.mortbay.jetty.util@default:default,javax.xml@default:default,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.ui.forms@default:default,org.hamcrest.core@default:default,org.junit*4.8.1.v4_8_1_v20100427-1100@default:default,org.apache.commons.codec*1.3.0.v20100518-1140@default:default,org.eclipse.sdk@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.wst.common.frameworks@default:default,org.eclipse.core.expressions@default:default,org.eclipse.ui.navigator.resources@default:default,com.instantiations.designer.jdt.fragment@default:false,org.apache.jasper@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.commands@default:default,org.eclipse.osgi@-1:true,org.eclipse.wst.sse.core@default:default,org.eclipse.core.resources@default:default,org.eclipse.equinox.http.jetty@default:default,org.eclipse.wst.common.uriresolver@default:default,org.eclipse.jdt.core@default:d!
efault,org.eclipse.swt.gtk.linux.x86_64@default:false,org.eclipse.jface.text@default:default,org.eclipse.emf.edit@default:default,org.eclipse.core.filesystem@default:default"/>
+<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/InstanceMockIntegrationTest.launch
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/ServerTypeMockIntegrationTest.launch
===================================================================
---
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/ServerTypeMockIntegrationTest.launch
(rev 0)
+++
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/ServerTypeMockIntegrationTest.launch 2010-10-22
14:42:25 UTC (rev 25998)
@@ -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.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"/>
+<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/ServerTypeMockIntegrationTest.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.ServerTypeMockIntegrationTest"/>
+<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="org.eclipse.equinox.preferences@default:default,org.apache.commons.httpclient*3.1.0.v201005080502@default:default,org.apache.commons.logging*1.0.4.v201005080501@default:default,org.eclipse.core.runtime@default:true,org.eclipse.debug.core@default:default,org.eclipse.ecf.identity@default:default,org.apache.xml.resolver@default:default,org.eclipse.compare@default:default,javax.servlet@default:default,org.eclipse.ui@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.emf.common@default:default,org.eclipse.jdt.compiler.tool@default:false,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.emf.ecore.xmi@default:default,com.ibm.icu@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.osgi.util@default:default,org.eclipse.wst.validation@default:default,org.eclipse.equinox.p2.repository@default:default,org.ecli!
pse.search@default:default,org.eclipse.ui.views@default:default,org.eclipse.core.filesystem.linux.x86_64@default:false,org.eclipse.ui.console@default:default,org.eclipse.ltk.ui.refactoring@default:default,org.eclipse.equinox.app@default:default,org.eclipse.core.net@default:default,org.eclipse.ecf@default:default,org.eclipse.jface@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.jem.util@default:default,org.eclipse.core.databinding@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.core.net.linux.x86_64@default:false,org.eclipse.core.databinding.observable@default:default,org.eclipse.equinox.common@2:true,org.apache.xml.serializer@default:default,org.apache.xerces@default:default,org.eclipse.equinox.security@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.wst.common.project.facet.core@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.ec!
f.filetransfer@default:default,org.eclipse.jdt.compiler.apt@de!
fault:fa
lse,org.eclipse.compare.core@default:default,org.eclipse.wst.common.emf@default:default,org.eclipse.swt@default:default,org.eclipse.osgi.services@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.core.variables@default:default,org.eclipse.ltk.core.refactoring@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.wst.common.environment@default:default,org.eclipse.wst.common.core@default:default,org.eclipse.wst.xml.core@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.text@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.help@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.wst.common.emfworkbench.integration@default:default,org.jboss.tools.xulrunner.initializer@default:false,org.eclipse.jdt.core.manipulation@default:default,org.eclipse.ui.ide@default!
:default,org.eclipse.jdt.launching@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.ui.editors@default:default,org.eclipse.team.ui@default:default,org.eclipse.debug.ui@default:default,org.eclipse.team.core@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.jdt.ui@default:default,org.eclipse.ant.core@default:default,org.eclipse.jdt.debug@default:default,javax.xml@default:default,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.ui.forms@default:default,org.hamcrest.core@default:default,org.junit*4.8.1.v4_8_1_v20100427-1100@default:default,org.apache.commons.codec*1.3.0.v20100518-1140@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.wst.common.frameworks@default:default,org.eclipse.core.expressions@default:default,org.eclipse.ui.navigator.resources@default:default,com.instantiations.designer.jdt.fragment@default:false,org.eclipse.core.jobs@de!
fault:default,org.eclipse.core.commands@default:default,org.ec!
lipse.os
gi@-1:true,org.eclipse.wst.sse.core@default:default,org.eclipse.core.resources@default:default,org.eclipse.wst.common.uriresolver@default:default,org.eclipse.jdt.core@default:default,org.eclipse.swt.gtk.linux.x86_64@default:false,org.eclipse.jface.text@default:default,org.eclipse.emf.edit@default:default,org.eclipse.core.filesystem@default:default"/>
+<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/ServerTypeMockIntegrationTest.launch
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/bootstrap-deltacloud.rb
===================================================================
---
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/bootstrap-deltacloud.rb 2010-10-22
14:39:43 UTC (rev 25997)
+++
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/bootstrap-deltacloud.rb 2010-10-22
14:42:25 UTC (rev 25998)
@@ -1,5 +1,4 @@
require 'rubygems'
-#require 'deltacloud-dependencies.jar'
require 'deltacloud-dependencies.jar'
#require 'steamcannon-deltacloud-core'
Deleted:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/DeltaCloudMockClientIntegrationTest.java
===================================================================
---
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/DeltaCloudMockClientIntegrationTest.java 2010-10-22
14:39:43 UTC (rev 25997)
+++
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/DeltaCloudMockClientIntegrationTest.java 2010-10-22
14:42:25 UTC (rev 25998)
@@ -1,116 +0,0 @@
-package org.jboss.tools.internal.deltacloud.test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.List;
-
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpUriRequest;
-import org.jboss.tools.deltacloud.core.client.DeltaCloudClient;
-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.internal.deltacloud.test.fakes.ServerFake;
-import org.junit.Before;
-import org.junit.Test;
-
-public class DeltaCloudMockClientIntegrationTest {
-
- private static final String DELTACLOUD_URL = "http://localhost:3001";
- private static final String SERVERFAKE_URL = "http://localhost:3002";
- private static final String DELTACLOUD_USER = "mockuser";
- private static final String DELTACLOUD_PASSWORD = "mockpassword";
-
- private DeltaCloudClient client;
-
- @Before
- public void createClient() throws IOException {
- assertTrue(isDeltaCloudRunning());
- client = new DeltaCloudClient(DELTACLOUD_URL, DELTACLOUD_USER, DELTACLOUD_PASSWORD);
- }
-
- public boolean isDeltaCloudRunning() throws IOException {
- URLConnection connection = new URL(DELTACLOUD_URL).openConnection();
- connection.connect();
- return true;
- }
-
- @Test
- public void canRecognizeMockDeltaCloud() throws IOException {
- assertEquals(DeltaCloudClient.DeltaCloudType.MOCK, client.getServerType());
- }
-
- @Test
- public void reportsUnknownUrl() throws IOException {
- ServerFake serverFake = new ServerFake(new URL(SERVERFAKE_URL).getPort(),
"<dummy></dummy>");
- serverFake.start();
- try {
- assertEquals(DeltaCloudClient.DeltaCloudType.UNKNOWN, new
DeltaCloudClient(SERVERFAKE_URL, DELTACLOUD_USER,
- DELTACLOUD_PASSWORD).getServerType());
- } finally {
- serverFake.stop();
- }
- }
-
- @Test(expected = DeltaCloudClientException.class)
- public void notAuthenticatedCannotListImages() throws MalformedURLException,
DeltaCloudClientException {
- DeltaCloudClient client = new DeltaCloudClient(DELTACLOUD_URL, "badUser",
"badPassword");
- client.listImages();
- }
-
- @Test
- public void reports404OnUnknownResource() {
- try {
- DeltaCloudClient errorClient = new DeltaCloudClient(DELTACLOUD_URL) {
- @Override
- protected HttpUriRequest getRequest(RequestType requestType, String requestUrl) {
- return new HttpGet(DELTACLOUD_URL + "/DUMMY");
- }
- };
- errorClient.listImages();
- fail("no exception catched");
- } catch (Exception e) {
- assertEquals(DeltaCloudClientException.class, e.getClass());
- }
- }
-
- @Test
- public void canListMockImages() throws DeltaCloudClientException {
- List<Image> images = client.listImages();
- assertEquals(3, images.size());
- assertImage("img2", "Fedora 10", "fedoraproject",
"Fedora 10", "i386", images.get(0));
- assertImage("img1", "Fedora 10", "fedoraproject",
"Fedora 10", "x86_64", images.get(1));
- assertImage("img3", "JBoss", "mockuser",
"JBoss", "i386", images.get(2));
- }
-
- private void assertImage(String id, String name, String owner, String description,
String architecture, Image image) {
- assertEquals(id, image.getId());
- assertEquals(name, image.getName());
- assertEquals(owner, image.getOwnerId());
- assertEquals(architecture, image.getArchitecture());
- assertEquals(description, image.getDescription());
- }
-
- @Test
- public void canListMockInstances() throws DeltaCloudClientException {
- List<Instance> instances = client.listInstances();
- assertEquals(1, instances.size());
- assertInstance("inst0", "Mock Instance With Profile Change",
"mockuser", "img1", "us", "m1-large", "12288
MB", instances.get(0));
- }
-
- private void assertInstance(String id, String name, String owner, String ImageId, String
realmId, String profile, String memory, Instance instance) {
- assertEquals(id, instance.getId());
- assertEquals(name, instance.getName());
- assertEquals(owner, instance.getOwnerId());
- assertEquals(realmId, instance.getRealmId());
- assertEquals(profile, instance.getProfileId());
- assertEquals(memory, instance.getMemory());
- }
-
-}
Copied:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/ImageMockIntegrationTest.java
(from rev 25975,
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/DeltaCloudMockClientIntegrationTest.java)
===================================================================
---
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/ImageMockIntegrationTest.java
(rev 0)
+++
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/ImageMockIntegrationTest.java 2010-10-22
14:42:25 UTC (rev 25998)
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * 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;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.util.List;
+
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpUriRequest;
+import org.jboss.tools.deltacloud.core.client.DeltaCloudClient;
+import org.jboss.tools.deltacloud.core.client.DeltaCloudClientException;
+import org.jboss.tools.deltacloud.core.client.Image;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ImageMockIntegrationTest {
+
+ private MockIntegrationTestSetup testSetup;
+
+ @Before
+ public void setUp() throws IOException, DeltaCloudClientException {
+ this.testSetup = new MockIntegrationTestSetup();
+ testSetup.setUp();
+ }
+
+ @After
+ public void tearDown() {
+ testSetup.tearDown();
+ }
+
+ @Test(expected = DeltaCloudClientException.class)
+ public void cannotListIfNotAuthenticated() throws MalformedURLException,
DeltaCloudClientException {
+ DeltaCloudClient client = new DeltaCloudClient(MockIntegrationTestSetup.DELTACLOUD_URL,
"badUser", "badPassword");
+ client.listImages();
+ }
+
+ @Test
+ public void throwsDeltaCloudClientExceptionOnUnknownResource() {
+ try {
+ DeltaCloudClient errorClient = new
DeltaCloudClient(MockIntegrationTestSetup.DELTACLOUD_URL) {
+ @Override
+ protected HttpUriRequest getRequest(RequestType requestType, String requestUrl) {
+ return new HttpGet(MockIntegrationTestSetup.DELTACLOUD_URL + "/DUMMY");
+ }
+ };
+ errorClient.listImages();
+ fail("no exception catched");
+ } catch (Exception e) {
+ assertEquals(DeltaCloudClientException.class, e.getClass());
+ }
+ }
+
+ @Test
+ public void assertImagesFromWebUI() throws DeltaCloudClientException {
+ List<Image> images = testSetup.getClient().listImages();
+ assertEquals(3, images.size());
+ assertImage("img2", "Fedora 10", "fedoraproject",
"Fedora 10", "i386", images.get(0));
+ assertImage("img1", "Fedora 10", "fedoraproject",
"Fedora 10", "x86_64", images.get(1));
+ assertImage("img3", "JBoss", "mockuser",
"JBoss", "i386", images.get(2));
+ }
+
+ private void assertImage(String id, String name, String owner, String description,
String architecture, Image image) {
+ assertEquals(id, image.getId());
+ assertEquals(name, image.getName());
+ assertEquals(owner, image.getOwnerId());
+ assertEquals(architecture, image.getArchitecture());
+ assertEquals(description, image.getDescription());
+ }
+}
Property changes on:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/ImageMockIntegrationTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/InstanceMockIntegrationTest.java
===================================================================
---
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/InstanceMockIntegrationTest.java
(rev 0)
+++
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/InstanceMockIntegrationTest.java 2010-10-22
14:42:25 UTC (rev 25998)
@@ -0,0 +1,140 @@
+/*******************************************************************************
+ * 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;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+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.Image;
+import org.jboss.tools.deltacloud.core.client.Instance;
+import org.jboss.tools.deltacloud.core.client.Instance.State;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Integration tests for instances.
+ */
+public class InstanceMockIntegrationTest {
+
+ private MockIntegrationTestSetup testSetup;
+
+ @Before
+ public void setUp() throws IOException, DeltaCloudClientException {
+ this.testSetup = new MockIntegrationTestSetup();
+ testSetup.setUp();
+ }
+
+ @After
+ public void tearDown() {
+ testSetup.tearDown();
+ }
+
+ /**
+ * #listInstance contains the test instance created in {@link #setUp()}
+ *
+ * @throws DeltaCloudClientException
+ * the delta cloud client exception
+ */
+ @Test
+ public void listContainsTestInstance() throws DeltaCloudClientException {
+ List<Instance> instances = testSetup.getClient().listInstances();
+ assertTrue(instances.size() > 0);
+ assertNotNull(testSetup.getInstanceById(testSetup.getTestInstance().getId(),
testSetup.getClient()));
+ }
+
+ @Test
+ public void listTestInstance() throws DeltaCloudClientException {
+ Instance instance =
testSetup.getClient().listInstances(testSetup.getTestInstance().getId());
+ assertNotNull(instance);
+ Instance testInstance = testSetup.getTestInstance();
+ assertEquals(testInstance.getId(), instance.getId());
+ assertInstance(
+ testInstance.getName()
+ , testInstance.getOwnerId()
+ , testInstance.getImageId()
+ , testInstance.getRealmId()
+ , testInstance.getProfileId()
+ , testInstance.getMemory()
+ , instance);
+ }
+
+ @Test
+ public void listInstanceFromWebUI() throws DeltaCloudClientException {
+ Instance testInstance = testSetup.getClient().listInstances("inst0");
+ assertInstance("Mock Instance With Profile Change", "mockuser",
"img1", "us", "m1-large", "12288 MB",
+ testInstance);
+ }
+
+ @Test(expected = DeltaCloudClientException.class)
+ public void listDestroyedInstanceThrowsException() throws DeltaCloudClientException {
+ Instance testInstance = testSetup.getTestInstance();
+ testSetup.quietlyDestroyInstance(testInstance);
+ testSetup.getClient().listInstances(testInstance.getId());
+ }
+
+ private void assertInstance(String name, String owner, String ImageId, String realmId,
String profile,
+ String memory, Instance instance) {
+ assertNotNull(instance);
+ assertEquals(name, instance.getName());
+ assertEquals(owner, instance.getOwnerId());
+ assertEquals(realmId, instance.getRealmId());
+ assertEquals(profile, instance.getProfileId());
+ assertEquals(memory, instance.getMemory());
+ }
+
+ @Test(expected = DeltaCloudClientException.class)
+ public void cannotDestroyIfNotAuthenticated() throws MalformedURLException,
DeltaCloudClientException {
+ DeltaCloudClient unauthenticatedClient = new
DeltaCloudClient(MockIntegrationTestSetup.DELTACLOUD_URL, "badUser",
"badPassword");
+ Image image = testSetup.getFirstImage(unauthenticatedClient);
+ unauthenticatedClient.createInstance(image.getId());
+ }
+
+ @Test
+ public void canCreateInstance() throws DeltaCloudClientException {
+ Instance instance = null;
+ try {
+ Image image = testSetup.getFirstImage(testSetup.getClient());
+ instance = testSetup.getClient().createInstance(image.getId());
+ assertTrue(instance != null);
+ assertEquals(image.getId(), instance.getImageId());
+ assertEquals(State.RUNNING, instance.getState());
+ } finally {
+ testSetup.quietlyDestroyInstance(instance);
+ }
+ }
+
+ @Test(expected = DeltaCloudClientException.class)
+ public void createInstance_DeltaCloudExceptionOnUnknowsImageId() throws
DeltaCloudClientException {
+ testSetup.getClient().createInstance("dummy");
+ }
+
+ @Test
+ public void canDestroy() throws DeltaCloudClientException {
+ Image image = testSetup.getFirstImage(testSetup.getClient());
+ Instance instance = testSetup.getClient().createInstance(image.getId());
+ testSetup.getClient().destroyInstance(instance.getId());
+ assertNull(testSetup.getInstanceById(instance.getId(), testSetup.getClient()));
+ }
+
+ @Test(expected=DeltaCloudClientException.class)
+ public void destroyThrowExceptionOnUnknowInstanceId() throws DeltaCloudClientException
{
+ testSetup.getClient().destroyInstance("dummy");
+ }
+}
Property changes on:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/InstanceMockIntegrationTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/KeyMockIntegrationTest.java
===================================================================
---
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/KeyMockIntegrationTest.java
(rev 0)
+++
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/KeyMockIntegrationTest.java 2010-10-22
14:42:25 UTC (rev 25998)
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * 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;
+
+import java.io.IOException;
+
+import org.jboss.tools.deltacloud.core.client.DeltaCloudClient;
+import org.jboss.tools.deltacloud.core.client.DeltaCloudClientException;
+import org.junit.After;
+import org.junit.Before;
+
+/**
+ * Integration tests for key related operations in delta cloud client.
+ *
+ * @see DeltaCloudClient#createKey(String, String)
+ * @see DeltaCloudClient#deleteKey(String)
+ */
+public class KeyMockIntegrationTest {
+
+ private MockIntegrationTestSetup testSetup;
+
+ @Before
+ public void setUp() throws IOException, DeltaCloudClientException {
+ this.testSetup = new MockIntegrationTestSetup();
+ testSetup.setUp();
+ }
+
+ @After
+ public void tearDown() {
+ testSetup.tearDown();
+ }
+}
Property changes on:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/KeyMockIntegrationTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/MockIntegrationTestSetup.java
===================================================================
---
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/MockIntegrationTestSetup.java
(rev 0)
+++
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/MockIntegrationTestSetup.java 2010-10-22
14:42:25 UTC (rev 25998)
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * 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;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+import java.net.ConnectException;
+import java.net.URL;
+import java.net.URLConnection;
+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.Image;
+import org.jboss.tools.deltacloud.core.client.Instance;
+
+public class MockIntegrationTestSetup {
+
+ public static final String DELTACLOUD_URL = "http://localhost:3001";
+ public static final String SERVERFAKE_URL = "http://localhost:3002";
+ public static final String DELTACLOUD_USER = "mockuser";
+ public static final String DELTACLOUD_PASSWORD = "mockpassword";
+
+ private DeltaCloudClient client;
+ private Instance testInstance;
+
+ public void setUp() throws IOException, DeltaCloudClientException {
+ ensureDeltaCloudIsRunning();
+ this.client = new DeltaCloudClient(DELTACLOUD_URL, DELTACLOUD_USER,
DELTACLOUD_PASSWORD);
+ Image image = getFirstImage(client);
+ assertNotNull(image);
+ this.testInstance = client.createInstance(image.getId());
+ }
+
+ public void ensureDeltaCloudIsRunning() throws IOException {
+ try {
+ URLConnection connection = new URL(DELTACLOUD_URL).openConnection();
+ connection.connect();
+ } catch (ConnectException e) {
+ fail("Local DeltaCloud instance is not running. Please start a DeltaCloud
instance before running these tests.");
+ }
+ }
+
+ public DeltaCloudClient getClient() {
+ return client;
+ }
+
+ public Instance getTestInstance() {
+ return testInstance;
+ }
+
+ public Image getFirstImage(DeltaCloudClient client) throws DeltaCloudClientException {
+ List<Image> images = client.listImages();
+ assertTrue(images.size() >= 1);
+ Image image = images.get(0);
+ return image;
+ }
+
+
+ public Instance getInstanceById(String id, DeltaCloudClient client) throws
DeltaCloudClientException {
+ for (Instance availableInstance : client.listInstances()) {
+ if (id.equals(availableInstance.getId())) {
+ return availableInstance;
+ }
+ }
+ return null;
+ }
+
+ public void tearDown() {
+ quietlyDestroyInstance(testInstance);
+ }
+
+ public void quietlyDestroyInstance(Instance instance) {
+ if (instance != null) {
+ try {
+ client.destroyInstance(instance.getId());
+ } catch (Exception e) {
+ // ignore
+ }
+ }
+ }
+}
Property changes on:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/MockIntegrationTestSetup.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/ServerTypeMockIntegrationTest.java
===================================================================
---
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/ServerTypeMockIntegrationTest.java
(rev 0)
+++
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/ServerTypeMockIntegrationTest.java 2010-10-22
14:42:25 UTC (rev 25998)
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * 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;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpUriRequest;
+import org.jboss.tools.deltacloud.core.client.DeltaCloudClient;
+import org.jboss.tools.deltacloud.core.client.DeltaCloudClientException;
+import org.jboss.tools.internal.deltacloud.test.fakes.ServerFake;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Integration tests for {@link DeltaCloudClient#getServerType()}.
+ */
+public class ServerTypeMockIntegrationTest {
+
+ private MockIntegrationTestSetup testSetup;
+
+ @Before
+ public void setUp() throws IOException, DeltaCloudClientException {
+ this.testSetup = new MockIntegrationTestSetup();
+ testSetup.setUp();
+ }
+
+ @After
+ public void tearDown() {
+ testSetup.tearDown();
+ }
+
+ @Test
+ public void recognizesDeltaCloud() throws IOException {
+ assertEquals(DeltaCloudClient.DeltaCloudType.MOCK,testSetup.getClient().getServerType());
+ }
+
+ /**
+ *
+ * #getServerType reports {@link DeltaCloudClient.DeltaCloudType#UNKNOWN) if it queries
a fake server that responds with a unknown answer.
+ *
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
+ @Test
+ public void reportsUnknownUrl() throws IOException {
+ ServerFake serverFake = new ServerFake(new
URL(MockIntegrationTestSetup.SERVERFAKE_URL).getPort(),
"<dummy></dummy>");
+ serverFake.start();
+ try {
+ assertEquals(DeltaCloudClient.DeltaCloudType.UNKNOWN, new
DeltaCloudClient(MockIntegrationTestSetup.SERVERFAKE_URL,
MockIntegrationTestSetup.DELTACLOUD_USER,
+ MockIntegrationTestSetup.DELTACLOUD_PASSWORD).getServerType());
+ } finally {
+ serverFake.stop();
+ }
+ }
+
+ @Test(expected = DeltaCloudClientException.class)
+ public void listImages_cannotListIfNotAuthenticated() throws MalformedURLException,
DeltaCloudClientException {
+ DeltaCloudClient client = new DeltaCloudClient(MockIntegrationTestSetup.DELTACLOUD_URL,
"badUser", "badPassword");
+ client.listImages();
+ }
+
+ @Test
+ public void throwsDeltaCloudClientExceptionOnUnknownResource() {
+ try {
+ DeltaCloudClient errorClient = new
DeltaCloudClient(MockIntegrationTestSetup.DELTACLOUD_URL) {
+ @Override
+ protected HttpUriRequest getRequest(RequestType requestType, String requestUrl) {
+ return new HttpGet(MockIntegrationTestSetup.DELTACLOUD_URL + "/DUMMY");
+ }
+ };
+ errorClient.listImages();
+ fail("no exception catched");
+ } catch (Exception e) {
+ assertEquals(DeltaCloudClientException.class, e.getClass());
+ }
+ }
+}
Property changes on:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/ServerTypeMockIntegrationTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain