Author: adietish
Date: 2010-12-15 05:16:53 -0500 (Wed, 15 Dec 2010)
New Revision: 27497
Added:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/CloudSchedulingRulesTest.launch
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/job/CloudSchedulingRulesTest.java
Removed:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/SchedulingRulesTest.launch
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/job/SchedulingRulesTest.java
Modified:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/DeltaCloudTestSuite.java
Log:
renamed SchedulingRulesTest to CloudSchedulingRulesTest
Added:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/CloudSchedulingRulesTest.launch
===================================================================
---
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/CloudSchedulingRulesTest.launch
(rev 0)
+++
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/CloudSchedulingRulesTest.launch 2010-12-15
10:16:53 UTC (rev 27497)
@@ -0,0 +1,50 @@
+<?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/SchedulingRulesTest"/>
+<booleanAttribute key="default" value="false"/>
+<stringAttribute key="deselected_workspace_plugins"
value="org.jboss.tools.gwt.ui,org.eclipse.epp.usagedata.recording,org.jboss.tools.deltacloud.integration,org.eclipse.epp.usagedata.gathering,org.jboss.tools.deltacloud.docs,org.jboss.tools.usage,org.jboss.tools.usage.test,com.jboss.jbds.usage.branding,org.jboss.tools.gwt.core,org.eclipse.epp.usagedata.ui,org.jboss.tools.deltacloud.ui,org.jboss.tools.tests"/>
+<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/job/CloudSchedulingRulesTest.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.JRE_CONTAINER"
value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE"
value="org.jboss.tools.internal.deltacloud.test.core.job.CloudSchedulingRulesTest"/>
+<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.compare@default:default,org.eclipse.equinox.app@default:default,org.eclipse.ui.workbench@default:default,org.apache.commons.httpclient*3.1.0.v201005080502@default:default,org.eclipse.core.resources@default:default,org.eclipse.emf.common@default:default,org.eclipse.wst.common.uriresolver@default:default,javax.servlet@default:default,org.eclipse.core.commands@default:default,org.eclipse.jdt.core.manipulation@default:default,org.eclipse.wst.common.emf@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.osgi.services@default:default,org.eclipse.text@default:default,org.jboss.tools.xulrunner.initializer@default:false,org.eclipse.ecf.ssl@default:false,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.jface@default:default,org.eclipse.jface.text@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.wst.common.project.facet.core@default:default,org.e!
clipse.core.runtime.compatibility.auth@default:default,org.eclipse.core.databinding@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.ui.console@default:default,org.eclipse.debug.ui@default:default,org.apache.commons.logging*1.0.4.v201005080501@default:default,org.eclipse.swt.gtk.linux.x86_64@default:false,org.eclipse.ecf@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.swt@default:default,org.eclipse.core.filesystem.linux.x86_64@default:false,org.eclipse.core.databinding.property@default:default,org.eclipse.ui.views@default:default,org.eclipse.wst.common.frameworks@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.net.linux.x86_64@default:false,org.eclipse.wst.common.environment@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.team.core@default:default,org.eclipse.wst.common.core@default:default,org.eclipse.osgi@-1:tru!
e,org.eclipse.core.filebuffers@default:default,org.eclipse.ltk!
.core.re
factoring@default:default,org.eclipse.core.jobs@default:default,com.ibm.icu@default:default,org.eclipse.ltk.ui.refactoring@default:default,org.eclipse.equinox.common@2:true,org.eclipse.ui.navigator.resources@default:default,org.eclipse.wst.validation@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.wst.common.emfworkbench.integration@default:default,org.eclipse.core.net@default:default,org.eclipse.wst.sse.core@default:default,org.eclipse.wst.xml.core@default:default,org.apache.xml.resolver@default:default,org.eclipse.search@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.equinox.preferences@default:default,org.apache.commons.codec*1.3.0.v20100518-1140@default:default,org.eclipse.jem.util@default:default,org.eclipse.jdt.compiler.tool@default:false,org.eclipse.ui.workbench.texteditor@defa!
ult:default,org.eclipse.ui.navigator@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.ui.editors@default:default,org.junit*4.8.1.v4_8_1_v20100427-1100@default:default,org.eclipse.ui.forms@default:default,org.hamcrest.core@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.equinox.security@default:default,javax.xml@default:default,org.eclipse.help@default:default,org.apache.xml.serializer@default:default,org.apache.xerces@default:default,org.eclipse.jdt.debug@default:default,org.eclipse.emf.edit@default:default,org.eclipse.core.variables@default:default,com.instantiations.designer.jdt.fragment@default:false,org.eclipse.jdt.compiler.apt@default:false,org.eclipse.ant.core@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.core.runtime@default:true,org.eclipse.jdt.launching@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.osgi.util@default:default,org.eclipse.core.runtime.compatibility.re!
gistry@default:false,org.eclipse.core.databinding.observable@d!
efault:d
efault,org.eclipse.team.ui@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.ui.ide@default:default,org.eclipse.jdt.ui@default:default,org.eclipse.jdt.core@default:default,org.eclipse.debug.core@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.ui@default:default,org.eclipse.compare.core@default:default"/>
+<stringAttribute key="selected_workspace_plugins"
value="org.jboss.tools.deltacloud.test@default:default,org.jboss.tools.common@default:default,org.jboss.tools.deltacloud.core@default:default"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<stringAttribute key="templateConfig"
value="${target_home}/configuration/config.ini"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="true"/>
+<booleanAttribute key="useProduct" value="false"/>
+</launchConfiguration>
Property changes on:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/CloudSchedulingRulesTest.launch
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/SchedulingRulesTest.launch
===================================================================
---
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/SchedulingRulesTest.launch 2010-12-15
10:13:35 UTC (rev 27496)
+++
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/SchedulingRulesTest.launch 2010-12-15
10:16:53 UTC (rev 27497)
@@ -1,50 +0,0 @@
-<?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/SchedulingRulesTest"/>
-<booleanAttribute key="default" value="false"/>
-<stringAttribute key="deselected_workspace_plugins"
value="org.jboss.tools.gwt.ui,org.eclipse.epp.usagedata.recording,org.jboss.tools.deltacloud.integration,org.eclipse.epp.usagedata.gathering,org.jboss.tools.deltacloud.docs,org.jboss.tools.usage,org.jboss.tools.usage.test,com.jboss.jbds.usage.branding,org.jboss.tools.gwt.core,org.eclipse.epp.usagedata.ui,org.jboss.tools.deltacloud.ui,org.jboss.tools.tests"/>
-<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/job/SchedulingRulesTest.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.JRE_CONTAINER"
value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE"
value="org.jboss.tools.internal.deltacloud.test.core.job.SchedulingRulesTest"/>
-<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.compare@default:default,org.eclipse.equinox.app@default:default,org.eclipse.ui.workbench@default:default,org.apache.commons.httpclient*3.1.0.v201005080502@default:default,org.eclipse.core.resources@default:default,org.eclipse.emf.common@default:default,org.eclipse.wst.common.uriresolver@default:default,javax.servlet@default:default,org.eclipse.core.commands@default:default,org.eclipse.jdt.core.manipulation@default:default,org.eclipse.wst.common.emf@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.osgi.services@default:default,org.eclipse.text@default:default,org.jboss.tools.xulrunner.initializer@default:false,org.eclipse.ecf.ssl@default:false,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.jface@default:default,org.eclipse.jface.text@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.wst.common.project.facet.core@default:default,org.e!
clipse.core.runtime.compatibility.auth@default:default,org.eclipse.core.databinding@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.ui.console@default:default,org.eclipse.debug.ui@default:default,org.apache.commons.logging*1.0.4.v201005080501@default:default,org.eclipse.swt.gtk.linux.x86_64@default:false,org.eclipse.ecf@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.swt@default:default,org.eclipse.core.filesystem.linux.x86_64@default:false,org.eclipse.core.databinding.property@default:default,org.eclipse.ui.views@default:default,org.eclipse.wst.common.frameworks@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.net.linux.x86_64@default:false,org.eclipse.wst.common.environment@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.team.core@default:default,org.eclipse.wst.common.core@default:default,org.eclipse.osgi@-1:tru!
e,org.eclipse.core.filebuffers@default:default,org.eclipse.ltk!
.core.re
factoring@default:default,org.eclipse.core.jobs@default:default,com.ibm.icu@default:default,org.eclipse.ltk.ui.refactoring@default:default,org.eclipse.equinox.common@2:true,org.eclipse.ui.navigator.resources@default:default,org.eclipse.wst.validation@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.wst.common.emfworkbench.integration@default:default,org.eclipse.core.net@default:default,org.eclipse.wst.sse.core@default:default,org.eclipse.wst.xml.core@default:default,org.apache.xml.resolver@default:default,org.eclipse.search@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.equinox.preferences@default:default,org.apache.commons.codec*1.3.0.v20100518-1140@default:default,org.eclipse.jem.util@default:default,org.eclipse.jdt.compiler.tool@default:false,org.eclipse.ui.workbench.texteditor@defa!
ult:default,org.eclipse.ui.navigator@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.ui.editors@default:default,org.junit*4.8.1.v4_8_1_v20100427-1100@default:default,org.eclipse.ui.forms@default:default,org.hamcrest.core@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.equinox.security@default:default,javax.xml@default:default,org.eclipse.help@default:default,org.apache.xml.serializer@default:default,org.apache.xerces@default:default,org.eclipse.jdt.debug@default:default,org.eclipse.emf.edit@default:default,org.eclipse.core.variables@default:default,com.instantiations.designer.jdt.fragment@default:false,org.eclipse.jdt.compiler.apt@default:false,org.eclipse.ant.core@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.core.runtime@default:true,org.eclipse.jdt.launching@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.osgi.util@default:default,org.eclipse.core.runtime.compatibility.re!
gistry@default:false,org.eclipse.core.databinding.observable@d!
efault:d
efault,org.eclipse.team.ui@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.ui.ide@default:default,org.eclipse.jdt.ui@default:default,org.eclipse.jdt.core@default:default,org.eclipse.debug.core@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.ui@default:default,org.eclipse.compare.core@default:default"/>
-<stringAttribute key="selected_workspace_plugins"
value="org.jboss.tools.deltacloud.test@default:default,org.jboss.tools.common@default:default,org.jboss.tools.deltacloud.core@default:default"/>
-<booleanAttribute key="show_selected_only" value="false"/>
-<stringAttribute key="templateConfig"
value="${target_home}/configuration/config.ini"/>
-<booleanAttribute key="tracing" value="false"/>
-<booleanAttribute key="useCustomFeatures" value="false"/>
-<booleanAttribute key="useDefaultConfig" value="true"/>
-<booleanAttribute key="useDefaultConfigArea" value="true"/>
-<booleanAttribute key="useProduct" value="false"/>
-</launchConfiguration>
Modified:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/DeltaCloudTestSuite.java
===================================================================
---
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/DeltaCloudTestSuite.java 2010-12-15
10:13:35 UTC (rev 27496)
+++
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/DeltaCloudTestSuite.java 2010-12-15
10:16:53 UTC (rev 27497)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.internal.deltacloud.test;
-import org.jboss.tools.internal.deltacloud.test.core.job.SchedulingRulesTest;
+import org.jboss.tools.internal.deltacloud.test.core.job.CloudSchedulingRulesTest;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
@@ -19,7 +19,7 @@
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({
- SchedulingRulesTest.class
+ CloudSchedulingRulesTest.class
})
public class DeltaCloudTestSuite {
Copied:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/job/CloudSchedulingRulesTest.java
(from rev 27492,
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/job/SchedulingRulesTest.java)
===================================================================
---
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/job/CloudSchedulingRulesTest.java
(rev 0)
+++
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/job/CloudSchedulingRulesTest.java 2010-12-15
10:16:53 UTC (rev 27497)
@@ -0,0 +1,142 @@
+/*******************************************************************************
+ * 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.job;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.jboss.tools.deltacloud.core.DeltaCloud;
+import org.jboss.tools.deltacloud.core.DeltaCloudException;
+import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
+import org.jboss.tools.deltacloud.core.SecurePasswordStore;
+import org.jboss.tools.deltacloud.core.client.Instance;
+import org.jboss.tools.deltacloud.core.job.AbstractCloudElementJob;
+import org.jboss.tools.deltacloud.core.job.AbstractCloudElementJob.CLOUDELEMENT;
+import org.jboss.tools.deltacloud.core.job.CloudElementSchedulingRule;
+import org.jboss.tools.deltacloud.core.job.CloudSchedulingRule;
+import org.jboss.tools.deltacloud.core.job.InstanceSchedulingRule;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * @author André Dietisheim
+ */
+public class CloudSchedulingRulesTest {
+
+ private DeltaCloudFake cloudFake;
+ private Instance instanceFake;
+ private DeltaCloudInstance deltaCloudInstanceFake;
+
+ @Before
+ public void setUp() throws DeltaCloudException {
+ this.cloudFake = new DeltaCloudFake();
+ this.instanceFake = new Instance();
+ this.deltaCloudInstanceFake = new DeltaCloudInstance(cloudFake, instanceFake);
+ }
+
+ @Test
+ public void instanceRule2InstanceRule() throws DeltaCloudException {
+ InstanceSchedulingRule instanceRule =
+ new InstanceSchedulingRule(cloudFake, CLOUDELEMENT.INSTANCES,
deltaCloudInstanceFake);
+ assertTrue(instanceRule.isConflicting(instanceRule));
+ }
+
+ @Test
+ public void instanceRule2CloudElementInstanceRule() throws DeltaCloudException {
+ InstanceSchedulingRule instanceRule = new InstanceSchedulingRule(
+ cloudFake, AbstractCloudElementJob.CLOUDELEMENT.INSTANCES, deltaCloudInstanceFake);
+ CloudElementSchedulingRule cloudRule =
+ new CloudElementSchedulingRule(cloudFake, CLOUDELEMENT.INSTANCES);
+ assertTrue(instanceRule.isConflicting(cloudRule));
+ }
+
+ @Test
+ public void instanceRule2CloudElementImageRule() throws DeltaCloudException {
+ InstanceSchedulingRule instanceRule =
+ new InstanceSchedulingRule(cloudFake, CLOUDELEMENT.INSTANCES,
deltaCloudInstanceFake);
+ CloudElementSchedulingRule cloudRule = new CloudElementSchedulingRule(cloudFake,
CLOUDELEMENT.IMAGES);
+ assertFalse(instanceRule.isConflicting(cloudRule));
+ }
+
+ @Test
+ public void instanceRule2CloudRule() throws DeltaCloudException {
+ InstanceSchedulingRule instanceRule =
+ new InstanceSchedulingRule(cloudFake, CLOUDELEMENT.INSTANCES,
deltaCloudInstanceFake);
+ CloudSchedulingRule cloudRule = new CloudSchedulingRule(cloudFake);
+ assertTrue(instanceRule.isConflicting(cloudRule));
+ }
+
+ @Test
+ public void cloudInstancesRule2CloudInstancesRule() throws DeltaCloudException {
+ CloudElementSchedulingRule cloudInstancesRule =
+ new CloudElementSchedulingRule(cloudFake, CLOUDELEMENT.INSTANCES);
+ assertTrue(cloudInstancesRule.isConflicting(cloudInstancesRule));
+ }
+
+ @Test
+ public void cloudInstancesRule2CloudImageRule() throws DeltaCloudException {
+ CloudElementSchedulingRule cloudInstancesRule =
+ new CloudElementSchedulingRule(cloudFake, CLOUDELEMENT.INSTANCES);
+ CloudElementSchedulingRule cloudImagesRule =
+ new CloudElementSchedulingRule(cloudFake, CLOUDELEMENT.IMAGES);
+ assertFalse(cloudInstancesRule.isConflicting(cloudImagesRule));
+ }
+
+ @Test
+ public void cloudInstancesRule2CloudRule() throws DeltaCloudException {
+ CloudElementSchedulingRule cloudInstancesRule =
+ new CloudElementSchedulingRule(cloudFake, CLOUDELEMENT.INSTANCES);
+ CloudSchedulingRule cloudRule = new CloudSchedulingRule(cloudFake);
+ assertTrue(cloudInstancesRule.isConflicting(cloudRule));
+ }
+
+ private static class DeltaCloudFake extends DeltaCloud {
+
+ public DeltaCloudFake() throws DeltaCloudException {
+ super("mock", "http://dummy.org", "dummyUser",
"dummyPassword");
+ }
+
+ @Override
+ protected SecurePasswordStore createSecurePasswordStore(String name, String username,
String password) {
+ return new SecurePasswordStoreFake("dummyPassword");
+ }
+ }
+
+ private static class SecurePasswordStoreFake extends SecurePasswordStore {
+
+ private String password;
+
+ public SecurePasswordStoreFake(String password) {
+ super(null, password);
+ this.password = password;
+ }
+
+ @Override
+ public String getPassword() throws DeltaCloudException {
+ return password;
+ }
+
+ @Override
+ public void setPassword(String password) throws DeltaCloudException {
+ this.password = password;
+ }
+
+ @Override
+ public void update(IStorageKey key, String password) throws DeltaCloudException {
+ setPassword(password);
+ }
+
+ @Override
+ public void remove() throws DeltaCloudException {
+ }
+
+ }
+}
Property changes on:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/job/CloudSchedulingRulesTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/job/SchedulingRulesTest.java
===================================================================
---
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/job/SchedulingRulesTest.java 2010-12-15
10:13:35 UTC (rev 27496)
+++
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/job/SchedulingRulesTest.java 2010-12-15
10:16:53 UTC (rev 27497)
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * 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.job;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import org.jboss.tools.deltacloud.core.DeltaCloud;
-import org.jboss.tools.deltacloud.core.DeltaCloudException;
-import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
-import org.jboss.tools.deltacloud.core.SecurePasswordStore;
-import org.jboss.tools.deltacloud.core.client.Instance;
-import org.jboss.tools.deltacloud.core.job.AbstractCloudElementJob;
-import org.jboss.tools.deltacloud.core.job.AbstractCloudElementJob.CLOUDELEMENT;
-import org.jboss.tools.deltacloud.core.job.CloudElementSchedulingRule;
-import org.jboss.tools.deltacloud.core.job.CloudSchedulingRule;
-import org.jboss.tools.deltacloud.core.job.InstanceSchedulingRule;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * @author André Dietisheim
- */
-public class SchedulingRulesTest {
-
- private DeltaCloudFake cloudFake;
- private Instance instanceFake;
- private DeltaCloudInstance deltaCloudInstanceFake;
-
- @Before
- public void setUp() throws DeltaCloudException {
- this.cloudFake = new DeltaCloudFake();
- this.instanceFake = new Instance();
- this.deltaCloudInstanceFake = new DeltaCloudInstance(cloudFake, instanceFake);
- }
-
- @Test
- public void instanceRule2InstanceRule() throws DeltaCloudException {
- InstanceSchedulingRule instanceRule =
- new InstanceSchedulingRule(cloudFake, CLOUDELEMENT.INSTANCES,
deltaCloudInstanceFake);
- assertTrue(instanceRule.isConflicting(instanceRule));
- }
-
- @Test
- public void instanceRule2CloudElementInstanceRule() throws DeltaCloudException {
- InstanceSchedulingRule instanceRule = new InstanceSchedulingRule(
- cloudFake, AbstractCloudElementJob.CLOUDELEMENT.INSTANCES, deltaCloudInstanceFake);
- CloudElementSchedulingRule cloudRule =
- new CloudElementSchedulingRule(cloudFake, CLOUDELEMENT.INSTANCES);
- assertTrue(instanceRule.isConflicting(cloudRule));
- }
-
- @Test
- public void instanceRule2CloudElementImageRule() throws DeltaCloudException {
- InstanceSchedulingRule instanceRule =
- new InstanceSchedulingRule(cloudFake, CLOUDELEMENT.INSTANCES,
deltaCloudInstanceFake);
- CloudElementSchedulingRule cloudRule = new CloudElementSchedulingRule(cloudFake,
CLOUDELEMENT.IMAGES);
- assertFalse(instanceRule.isConflicting(cloudRule));
- }
-
- @Test
- public void instanceRule2CloudRule() throws DeltaCloudException {
- InstanceSchedulingRule instanceRule =
- new InstanceSchedulingRule(cloudFake, CLOUDELEMENT.INSTANCES,
deltaCloudInstanceFake);
- CloudSchedulingRule cloudRule = new CloudSchedulingRule(cloudFake);
- assertTrue(instanceRule.isConflicting(cloudRule));
- }
-
- @Test
- public void cloudInstancesRule2CloudInstancesRule() throws DeltaCloudException {
- CloudElementSchedulingRule cloudInstancesRule =
- new CloudElementSchedulingRule(cloudFake, CLOUDELEMENT.INSTANCES);
- assertTrue(cloudInstancesRule.isConflicting(cloudInstancesRule));
- }
-
- @Test
- public void cloudInstancesRule2CloudImageRule() throws DeltaCloudException {
- CloudElementSchedulingRule cloudInstancesRule =
- new CloudElementSchedulingRule(cloudFake, CLOUDELEMENT.INSTANCES);
- CloudElementSchedulingRule cloudImagesRule =
- new CloudElementSchedulingRule(cloudFake, CLOUDELEMENT.IMAGES);
- assertFalse(cloudInstancesRule.isConflicting(cloudImagesRule));
- }
-
- @Test
- public void cloudInstancesRule2CloudRule() throws DeltaCloudException {
- CloudElementSchedulingRule cloudInstancesRule =
- new CloudElementSchedulingRule(cloudFake, CLOUDELEMENT.INSTANCES);
- CloudSchedulingRule cloudRule = new CloudSchedulingRule(cloudFake);
- assertTrue(cloudInstancesRule.isConflicting(cloudRule));
- }
-
- private static class DeltaCloudFake extends DeltaCloud {
-
- public DeltaCloudFake() throws DeltaCloudException {
- super("mock", "http://dummy.org", "dummyUser",
"dummyPassword");
- }
-
- @Override
- protected SecurePasswordStore createSecurePasswordStore(String name, String username,
String password) {
- return new SecurePasswordStoreFake("dummyPassword");
- }
- }
-
- private static class SecurePasswordStoreFake extends SecurePasswordStore {
-
- private String password;
-
- public SecurePasswordStoreFake(String password) {
- super(null, password);
- this.password = password;
- }
-
- @Override
- public String getPassword() throws DeltaCloudException {
- return password;
- }
-
- @Override
- public void setPassword(String password) throws DeltaCloudException {
- this.password = password;
- }
-
- @Override
- public void update(IStorageKey key, String password) throws DeltaCloudException {
- setPassword(password);
- }
-
- @Override
- public void remove() throws DeltaCloudException {
- }
-
- }
-}