JBoss Tools SVN: r27569 - trunk/build/target-platform.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-12-16 18:42:30 -0500 (Thu, 16 Dec 2010)
New Revision: 27569
Modified:
trunk/build/target-platform/multiple.target
trunk/build/target-platform/multiple.target.p2mirror.xml
trunk/build/target-platform/unified.target
Log:
https://issues.jboss.org/browse/JBIDE-7921 add tm.terminal features
Modified: trunk/build/target-platform/multiple.target
===================================================================
--- trunk/build/target-platform/multiple.target 2010-12-16 20:33:10 UTC (rev 27568)
+++ trunk/build/target-platform/multiple.target 2010-12-16 23:42:30 UTC (rev 27569)
@@ -143,7 +143,14 @@
<unit id="org.eclipse.gef.feature.group" version="3.6.1.v20100908-1100-777B181A3Bz-6B663E7974242"/>
<unit id="org.eclipse.zest.feature.group" version="1.2.0.v20100519-2050-67808yE5F-8HAH4HECF4242"/>
<unit id="org.eclipse.uml2.feature.group" version="3.1.1.v201008191505"/>
- <unit id="org.eclipse.rse.feature.group" version="3.2.1.v201008191400-7L78FA-8wqbPcNj4qa8R0eViy7vZ"/>
+
+ <unit id="org.eclipse.rse.feature.group" version="3.2.1.v201008191400-7L78FA-8wqbPcNj4qa8R0eViy7vZ"/>
+ <unit id="org.eclipse.rse.useractions.feature.group" version="1.1.200.v201005221100-31A78s733L3D7H7933"/>
+ <unit id="org.eclipse.tm.terminal.feature.group" version="3.0.201.v201008191400-4-8_7w3121192A2511"/>
+ <unit id="org.eclipse.tm.terminal.view.feature.group" version="2.1.0.v201006030830-30-7w312117152351"/>
+ <unit id="org.eclipse.tm.terminal.telnet.feature.group" version="2.0.200.v201005032000-3-8_7w311A1A271116"/>
+ <unit id="org.eclipse.tm.terminal.ssh.feature.group" version="2.0.200.v201005271030-3-A77w312116382141"/>
+
<!-- SAVARA dependencies -->
<!-- <unit version="1.2.0.201006151053" id="org.eclipse.stp.bpmn.feature.feature.group"/>
<unit version="1.4.1.v20100909-1000-37708s73533F5C1479I" id="org.eclipse.gmf.runtime.notation.feature.group"/>
Modified: trunk/build/target-platform/multiple.target.p2mirror.xml
===================================================================
--- trunk/build/target-platform/multiple.target.p2mirror.xml 2010-12-16 20:33:10 UTC (rev 27568)
+++ trunk/build/target-platform/multiple.target.p2mirror.xml 2010-12-16 23:42:30 UTC (rev 27569)
@@ -44,7 +44,7 @@
<repository location="http://download.eclipse.org/eclipse/updates/3.6/"/>
<repository location="http://download.eclipse.org/releases/helios/"/>
<repository location="http://download.eclipse.org/webtools/repository/helios/"/>
-<repository location="http://download.jboss.org/jbosstools/builds/staging/jbosstools-drools/all..."/>
+<repository location="http://download.jboss.org/jbosstools/builds/staging/_composite_/trunk/"/>
<repository location="http://dl.google.com/eclipse/plugin/3.6/"/>
<repository location="http://download.jboss.org/jbosstools/updates/requirements/swtbot-helios/"/>
<repository location="http://download.jboss.org/jbosstools/updates/requirements/webtools-3.2/"/>
@@ -133,6 +133,11 @@
<iu id="org.eclipse.zest.feature.group" version=""/>
<iu id="org.eclipse.uml2.feature.group" version=""/>
<iu id="org.eclipse.rse.feature.group" version=""/>
+<iu id="org.eclipse.rse.useractions.feature.group" version=""/>
+<iu id="org.eclipse.tm.terminal.feature.group" version=""/>
+<iu id="org.eclipse.tm.terminal.view.feature.group" version=""/>
+<iu id="org.eclipse.tm.terminal.telnet.feature.group" version=""/>
+<iu id="org.eclipse.tm.terminal.ssh.feature.group" version=""/>
<iu id="org.eclipse.jst.jee" version=""/>
<iu id="org.eclipse.wst.common.frameworks" version=""/>
<iu id="org.eclipse.wst.common.project.facet.ui" version=""/>
Modified: trunk/build/target-platform/unified.target
===================================================================
--- trunk/build/target-platform/unified.target 2010-12-16 20:33:10 UTC (rev 27568)
+++ trunk/build/target-platform/unified.target 2010-12-16 23:42:30 UTC (rev 27569)
@@ -143,7 +143,14 @@
<unit id="org.eclipse.gef.feature.group" version="3.6.1.v20100908-1100-777B181A3Bz-6B663E7974242"/>
<unit id="org.eclipse.zest.feature.group" version="1.2.0.v20100519-2050-67808yE5F-8HAH4HECF4242"/>
<unit id="org.eclipse.uml2.feature.group" version="3.1.1.v201008191505"/>
- <unit id="org.eclipse.rse.feature.group" version="3.2.1.v201008191400-7L78FA-8wqbPcNj4qa8R0eViy7vZ"/>
+
+ <unit id="org.eclipse.rse.feature.group" version="3.2.1.v201008191400-7L78FA-8wqbPcNj4qa8R0eViy7vZ"/>
+ <unit id="org.eclipse.rse.useractions.feature.group" version="1.1.200.v201005221100-31A78s733L3D7H7933"/>
+ <unit id="org.eclipse.tm.terminal.feature.group" version="3.0.201.v201008191400-4-8_7w3121192A2511"/>
+ <unit id="org.eclipse.tm.terminal.view.feature.group" version="2.1.0.v201006030830-30-7w312117152351"/>
+ <unit id="org.eclipse.tm.terminal.telnet.feature.group" version="2.0.200.v201005032000-3-8_7w311A1A271116"/>
+ <unit id="org.eclipse.tm.terminal.ssh.feature.group" version="2.0.200.v201005271030-3-A77w312116382141"/>
+
<!-- SAVARA dependencies -->
<!-- <unit version="1.2.0.201006151053" id="org.eclipse.stp.bpmn.feature.feature.group"/>
<unit version="1.4.1.v20100909-1000-37708s73533F5C1479I" id="org.eclipse.gmf.runtime.notation.feature.group"/>
14 years
JBoss Tools SVN: r27567 - workspace/snjeza.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2010-12-16 14:47:45 -0500 (Thu, 16 Dec 2010)
New Revision: 27567
Added:
workspace/snjeza/photoalbum-3.3.x/
Log:
Initial import.
14 years
JBoss Tools SVN: r27566 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-16 13:47:39 -0500 (Thu, 16 Dec 2010)
New Revision: 27566
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
Log:
[JBIDE-7371] implementing listing keys with deltacloud client
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-12-16 18:32:41 UTC (rev 27565)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-12-16 18:47:39 UTC (rev 27566)
@@ -1,5 +1,8 @@
2010-12-16 André Dietisheim <adietish(a)redhat.com>
+ * src/org/jboss/tools/deltacloud/core/client/request/ListKeysRequest.java:
+ * src/org/jboss/tools/deltacloud/core/client/request/CreateKeyRequest.java:
+ [JBIDE-7371] implementing listing keys with deltacloud client
* src/org/jboss/tools/deltacloud/core/DeltaCloud.java (testCredentials):
[JBIDE-7911] corrected: throws exceptions on error (internal server error, connection error etc)
14 years
JBoss Tools SVN: r27565 - in trunk/deltacloud: plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/request and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-16 13:32:41 -0500 (Thu, 16 Dec 2010)
New Revision: 27565
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Key.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/request/CreateKeyRequest.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/request/ListKeysRequest.java
Removed:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/request/ListKeyRequest.java
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/client/KeyMockIntegrationTest.java
Log:
[JBIDE-7371] implementing listing keys with deltacloud client
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.java 2010-12-16 18:30:07 UTC (rev 27564)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.java 2010-12-16 18:32:41 UTC (rev 27565)
@@ -124,7 +124,29 @@
public Instance createInstance(String imageId, String profileId, String realmId, String name, String keyname,
String memory, String storage) throws DeltaCloudClientException;
+ /**
+ * Creates a key for a given name on the deltacloud server and stores it
+ * in the file at the given path. The file gets created if the file path
+ * does not exist yet.
+ *
+ * @param keyname
+ * the name of the key to retrieve from the server
+ * @param keyStoreLocation
+ * the path to the file to store the key in
+ * @throws DeltaCloudClientException
+ * the delta cloud client exception
+ */
public void createKey(String keyname, String keystoreLocation) throws DeltaCloudClientException;
+ public String createKey(String keyname) throws DeltaCloudClientException;
+
+ /**
+ * Deletes the key with the given name on the deltacloud server
+ *
+ * @param keyname
+ * @throws DeltaCloudClientException
+ */
public void deleteKey(String keyname) throws DeltaCloudClientException;
+
+ public List<Key> listKeys() throws DeltaCloudClientException;
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java 2010-12-16 18:30:07 UTC (rev 27564)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java 2010-12-16 18:32:41 UTC (rev 27565)
@@ -51,6 +51,7 @@
import org.eclipse.core.runtime.Path;
import org.jboss.tools.deltacloud.core.client.request.AbstractListObjectsRequest;
import org.jboss.tools.deltacloud.core.client.request.CreateInstanceRequest;
+import org.jboss.tools.deltacloud.core.client.request.CreateKeyRequest;
import org.jboss.tools.deltacloud.core.client.request.DeleteKeyRequest;
import org.jboss.tools.deltacloud.core.client.request.DeltaCloudRequest;
import org.jboss.tools.deltacloud.core.client.request.DeltaCloudRequest.HttpMethod;
@@ -60,7 +61,7 @@
import org.jboss.tools.deltacloud.core.client.request.ListImagesRequest;
import org.jboss.tools.deltacloud.core.client.request.ListInstanceRequest;
import org.jboss.tools.deltacloud.core.client.request.ListInstancesRequest;
-import org.jboss.tools.deltacloud.core.client.request.ListKeyRequest;
+import org.jboss.tools.deltacloud.core.client.request.ListKeysRequest;
import org.jboss.tools.deltacloud.core.client.request.ListRealmRequest;
import org.jboss.tools.deltacloud.core.client.request.ListRealmsRequest;
import org.jboss.tools.deltacloud.core.client.request.PerformInstanceActionRequest;
@@ -82,7 +83,7 @@
private static final String DOCUMENT_ELEMENT_API = "api";
private static final Pattern ELEMENT_TEXTVALUE_REGEX = Pattern.compile("[^\n\t ]+[^\n]+");
-
+
public static Logger logger = Logger.getLogger(DeltaCloudClientImpl.class);
public static enum DeltaCloudServerType {
@@ -152,7 +153,7 @@
return null;
}
String xml = readInputStreamToString(entity.getContent());
- logger.debug("Response\n" + xml);
+ logger.debug("Response:\n" + xml);
return xml;
}
@@ -164,7 +165,7 @@
* @param requestUrl
* the requested url
* @return the request instance
- * @throws MalformedURLException
+ * @throws MalformedURLException
*/
protected HttpUriRequest createRequest(DeltaCloudRequest deltaCloudRequest) throws MalformedURLException {
HttpUriRequest request = null;
@@ -191,9 +192,10 @@
* @param httpClient
* the http client
* @return the default http client
- * @throws UnknownHostException
+ * @throws UnknownHostException
*/
- private DefaultHttpClient addCredentials(URL url, DefaultHttpClient httpClient, String username, String password) throws UnknownHostException {
+ private DefaultHttpClient addCredentials(URL url, DefaultHttpClient httpClient, String username, String password)
+ throws UnknownHostException {
if (username != null && password != null) {
httpClient.getCredentialsProvider().setCredentials(
new AuthScope(url.getHost(), url.getPort()),
@@ -262,19 +264,22 @@
return createInstance(imageId, profileId, realmId, name, null, memory, storage);
}
- public Instance createInstance(String imageId, String profileId, String realmId, String name, String keyname, String memory, String storage) throws DeltaCloudClientException {
- return buildInstance(sendRequest(new CreateInstanceRequest(baseUrl, imageId, profileId, realmId, name, keyname, memory, storage)));
+ public Instance createInstance(String imageId, String profileId, String realmId, String name, String keyname,
+ String memory, String storage) throws DeltaCloudClientException {
+ return buildInstance(sendRequest(new CreateInstanceRequest(baseUrl, imageId, profileId, realmId, name, keyname,
+ memory, storage)));
}
@Override
public HardwareProfile listProfile(String profileId) throws DeltaCloudClientException {
- return buildDeltaCloudObject(HardwareProfile.class, sendRequest(new ListHardwareProfileRequest(baseUrl, profileId)));
+ return buildDeltaCloudObject(HardwareProfile.class, sendRequest(new ListHardwareProfileRequest(baseUrl,
+ profileId)));
}
@Override
public List<HardwareProfile> listProfiles() throws DeltaCloudClientException {
- return listDeltaCloudObjects(HardwareProfile.class,
- new ListHardwareProfilesRequest(baseUrl),"hardware_profile");
+ return listDeltaCloudObjects(HardwareProfile.class,
+ new ListHardwareProfilesRequest(baseUrl), "hardware_profile");
}
@Override
@@ -294,7 +299,8 @@
@Override
public Instance listInstances(String instanceId) throws DeltaCloudClientException {
-// return JAXB.unmarshal(new StringReader(sendRequest(new ListInstanceRequest(baseUrl, instanceId))), Instance.class);
+ // return JAXB.unmarshal(new StringReader(sendRequest(new
+ // ListInstanceRequest(baseUrl, instanceId))), Instance.class);
return buildInstance(sendRequest(new ListInstanceRequest(baseUrl, instanceId)));
}
@@ -308,20 +314,12 @@
return JAXB.unmarshal(new StringReader(sendRequest(new ListRealmRequest(baseUrl, realmId))), Realm.class);
}
- /**
- * Retrieves a key for a given name on the deltacloud server and stores it
- * in the file at the given path. The file gets created if the file path
- * does not exist yet.
- *
- * @param keyname
- * the name of the key to retrieve from the server
- * @param keyStoreLocation
- * the path to the file to store the key in
- * @throws DeltaCloudClientException
- * the delta cloud client exception
- */
+ public String createKey(String keyname) throws DeltaCloudClientException {
+ return sendRequest(new CreateKeyRequest(baseUrl, keyname));
+ }
+
public void createKey(String keyname, String keyStoreLocation) throws DeltaCloudClientException {
- String xml = sendRequest(new ListKeyRequest(baseUrl, keyname));
+ String xml = createKey(keyname);
try {
String key = trimKey(getKey(xml));
File keyFile = createKeyFile(keyname, keyStoreLocation);
@@ -361,7 +359,10 @@
}
private File createKeyFile(String keyname, String keyStoreLocation) throws IOException {
- File keyFile = Path.fromOSString(keyStoreLocation).append(keyname + "." + PEM_FILE_SUFFIX).toFile(); //$NON-NLS-1$
+ File keyFile =
+ Path.fromOSString(keyStoreLocation)
+ .append(keyname).append(".").append(PEM_FILE_SUFFIX)
+ .toFile(); //$NON-NLS-1$
if (!keyFile.exists()) {
keyFile.createNewFile();
}
@@ -374,6 +375,12 @@
public void deleteKey(String keyname) throws DeltaCloudClientException {
sendRequest(new DeleteKeyRequest(baseUrl, keyname));
}
+
+ public List<Key> listKeys() throws DeltaCloudClientException {
+ String xml = sendRequest(new ListKeysRequest(baseUrl));
+ Key instance = JAXB.unmarshal(new StringReader(xml), Key.class);
+ throw new UnsupportedOperationException();
+ }
private Instance updateInstance(String xml, Instance instance) throws DeltaCloudClientException {
try {
@@ -631,12 +638,14 @@
try {
String response = sendRequest(
new PerformInstanceActionRequest(new URL(action.getUrl()),
- action.getMethod()));
+ action.getMethod()));
if (!InstanceAction.DESTROY.equals(action.getName())) {
updateInstance(response, action.getInstance());
}
} catch (MalformedURLException e) {
- throw new DeltaCloudClientException(MessageFormat.format("Could not perform action {0} on instance {1}", action.getName(), action.getInstance().getName()), e);
+ throw new DeltaCloudClientException(MessageFormat.format(
+ "Could not perform action {0} on instance {1}", action.getName(), action.getInstance()
+ .getName()), e);
}
return true;
}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Key.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Key.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Key.java 2010-12-16 18:32:41 UTC (rev 27565)
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are 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 Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.jboss.tools.deltacloud.core.client;
+
+import javax.xml.bind.annotation.XmlElement;
+
+/**
+ * @author Andre Dietisheim
+ */
+public class Key extends DeltaCloudObject {
+
+ private static final long serialVersionUID = 1L;
+
+ public static enum InstanceState {
+ RUNNING, STOPPED, PENDING, TERMINATED, BOGUS
+ };
+
+ @XmlElement
+ private String name;
+
+ public String getName() {
+ return name;
+ }
+
+ @SuppressWarnings("unused")
+ private void setName(String name) {
+ this.name = name;
+ }
+
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Key.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/request/CreateKeyRequest.java (from rev 27554, trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/request/ListKeyRequest.java)
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/request/CreateKeyRequest.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/request/CreateKeyRequest.java 2010-12-16 18:32:41 UTC (rev 27565)
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * 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.deltacloud.core.client.request;
+
+import java.net.URL;
+
+import org.jboss.tools.deltacloud.core.client.utils.UrlBuilder;
+
+
+/**
+ * Creates a key on the deltacloud server
+ *
+ * @author André Dietisheim
+ */
+public class CreateKeyRequest extends AbstractDeltaCloudRequest {
+
+ private String keyName;
+
+ public CreateKeyRequest(URL baseUrl, String keyName) {
+ super(baseUrl, HttpMethod.POST);
+ this.keyName = keyName;
+ }
+
+ @Override
+ protected String doCreateUrl(UrlBuilder urlBuilder) {
+ return urlBuilder.path("keys").parameter("name", keyName).toString();
+ }
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/request/CreateKeyRequest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/request/ListKeyRequest.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/request/ListKeyRequest.java 2010-12-16 18:30:07 UTC (rev 27564)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/request/ListKeyRequest.java 2010-12-16 18:32:41 UTC (rev 27565)
@@ -1,36 +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.deltacloud.core.client.request;
-
-import java.net.URL;
-
-import org.jboss.tools.deltacloud.core.client.utils.UrlBuilder;
-
-
-/**
- * Lists a key on the deltacloud server
- *
- * @author André Dietisheim
- */
-public class ListKeyRequest extends AbstractDeltaCloudRequest {
-
- private String keyName;
-
- public ListKeyRequest(URL baseUrl, String keyName) {
- super(baseUrl, HttpMethod.POST);
- this.keyName = keyName;
- }
-
- @Override
- protected String doCreateUrl(UrlBuilder urlBuilder) {
- return urlBuilder.path("keys").parameter("name", keyName).toString();
- }
-}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/request/ListKeysRequest.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/request/ListKeysRequest.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/request/ListKeysRequest.java 2010-12-16 18:32:41 UTC (rev 27565)
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * 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.deltacloud.core.client.request;
+
+import java.net.URL;
+
+import org.jboss.tools.deltacloud.core.client.utils.UrlBuilder;
+
+
+/**
+ * Lists keys available on the deltacloud server
+ *
+ * @author André Dietisheim
+ */
+public class ListKeysRequest extends AbstractDeltaCloudRequest {
+
+ public ListKeysRequest(URL baseUrl) {
+ super(baseUrl, HttpMethod.GET);
+ }
+
+ @Override
+ protected String doCreateUrl(UrlBuilder urlBuilder) {
+ return urlBuilder.path("keys").toString();
+ }
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/request/ListKeysRequest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/client/KeyMockIntegrationTest.java
===================================================================
--- trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/client/KeyMockIntegrationTest.java 2010-12-16 18:30:07 UTC (rev 27564)
+++ trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/client/KeyMockIntegrationTest.java 2010-12-16 18:32:41 UTC (rev 27565)
@@ -10,13 +10,16 @@
******************************************************************************/
package org.jboss.tools.internal.deltacloud.test.core.client;
+import static org.junit.Assert.assertNotNull;
+
import java.io.IOException;
+import org.jboss.tools.deltacloud.core.client.DeltaCloudClientException;
import org.jboss.tools.deltacloud.core.client.DeltaCloudClientImpl;
-import org.jboss.tools.deltacloud.core.client.DeltaCloudClientException;
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.
@@ -40,4 +43,16 @@
public void tearDown() {
testSetup.tearDown();
}
+
+ @Test
+ public void canCreateKey() throws DeltaCloudClientException {
+ String key = testSetup.getClient().createKey("test");
+ assertNotNull(key);
+
+ }
+
+ @Test
+ public void canListKeys() {
+
+ }
}
14 years
JBoss Tools SVN: r27564 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-16 13:30:07 -0500 (Thu, 16 Dec 2010)
New Revision: 27564
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
Log:
[JBIDE-7911] corrected: throws exceptions on error (internal server error, connection error etc)
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-12-16 18:28:43 UTC (rev 27563)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-12-16 18:30:07 UTC (rev 27564)
@@ -513,29 +513,6 @@
}
- /**
- * Tests the credentials defined in this DeltaCloud instance by connecting
- * to the server defined by the url in this instance. Returns
- * <code>true</code> if the credentials are valid, <code>false</code>
- * otherwise.
- *
- * @return <code>true</code>, if successful
- * @throws DeltaCloudClientException
- * if any other error occurs while trying to connect to the
- * server
- */
- public boolean testCredentials() throws DeltaCloudClientException {
- String instanceId = "nonexistingInstance"; //$NON-NLS-1$
- try {
- client.listInstances(instanceId);
- return true;
- } catch (DeltaCloudNotFoundClientException e) {
- return true;
- } catch (DeltaCloudAuthException e) {
- return false;
- }
- }
-
public DeltaCloudRealm[] getRealms() throws DeltaCloudException {
ArrayList<DeltaCloudRealm> realms = new ArrayList<DeltaCloudRealm>();
try {
@@ -593,4 +570,30 @@
throw new DeltaCloudException("Could not determine the driver of the server on url " + url, e);
}
}
+
+ /**
+ * Tests the credentials defined in this DeltaCloud instance by connecting
+ * to the server defined by the url in this instance. Returns
+ * <code>true</code> if the credentials are valid, <code>false</code>
+ * otherwise.
+ *
+ * @return <code>true</code>, if successful
+ * @throws DeltaCloudClientException
+ * if any other error occurs while trying to connect to the
+ * server
+ */
+ public boolean testCredentials() throws DeltaCloudException {
+ String instanceId = "nonexistingInstance"; //$NON-NLS-1$
+ try {
+ client.listInstances(instanceId);
+ return true;
+ } catch (DeltaCloudNotFoundClientException e) {
+ return true;
+ } catch (DeltaCloudAuthException e) {
+ return false;
+ } catch(DeltaCloudClientException e){
+ throw new DeltaCloudException("Could not connection to ", e);
+ }
+
+ }
}
14 years
JBoss Tools SVN: r27563 - trunk/deltacloud/tests/org.jboss.tools.deltacloud.test.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-16 13:28:43 -0500 (Thu, 16 Dec 2010)
New Revision: 27563
Modified:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/KeyMockIntegrationTest.launch
Log:
[JBIDE-7911]
Modified: trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/KeyMockIntegrationTest.launch
===================================================================
--- trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/KeyMockIntegrationTest.launch 2010-12-16 18:28:26 UTC (rev 27562)
+++ trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/KeyMockIntegrationTest.launch 2010-12-16 18:28:43 UTC (rev 27563)
@@ -10,9 +10,9 @@
<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"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/KeyMockIntegrationTest"/>
<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.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">
@@ -29,7 +29,8 @@
<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.core.observable.test.core.client.KeyMockIntegrationTest"/>
+<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.client.KeyMockIntegrationTest"/>
<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"/>
@@ -37,12 +38,12 @@
<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="org.eclipse.swt.gtk.linux.x86_64@default:false,org.eclipse.ant.core@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.equinox.security.ui@default:default,org.eclipse.compare@default:default,org.eclipse.core.commands@default:default,org.eclipse.wst.common.environment@default:default,org.eclipse.ui.editors@default:default,org.eclipse.jem.util@default:default,org.eclipse.ui.console@default:default,org.apache.commons.codec*1.3.0.v20100518-1140@default:default,org.eclipse.wst.common.project.facet.core@default:default,org.eclipse.debug.ui@default:default,org.eclipse.equinox.security@default:default,org.eclipse.ui.ide@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.core.variables@default:default,org.eclipse.equinox.concurrent@default:default,org.apache.xml.serializer@default:default,org.eclipse.core.databinding.property@defaul!
t:default,org.eclipse.jdt.debug@default:default,org.eclipse.wst.common.uriresolver@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.wst.sse.core@default:default,org.eclipse.jdt.core.manipulation@default:default,org.eclipse.core.jobs@default:default,org.eclipse.wst.validation@default:default,org.eclipse.team.core@default:default,org.eclipse.wst.common.frameworks@default:default,org.eclipse.ecf@default:default,org.eclipse.core.resources@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.jdt.compiler.apt@default:false,org.eclipse.jdt.ui@default:default,org.eclipse.equinox.common@default:default,org.eclipse.core.net@default:default,org.apache.xerces@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.search@default:default,javax.servlet@default:default,org.eclipse.osgi.util@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.debug.core@default:default,org.eclipse.core.databinding@defa!
ult:default,org.eclipse.osgi,org.eclipse.core.filesystem.linux!
.x86_64@
default:false,org.eclipse.ui.navigator.resources@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.equinox.p2.core@default:default,org.apache.commons.httpclient*3.1.0.v201005080502@default:default,org.eclipse.ui.views@default:default,org.eclipse.wst.common.core@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.jdt.compiler.tool@default:false,org.junit*4.8.1.v4_8_1_v20100427-1100@default:default,org.eclipse.jdt.core@default:default,org.eclipse.osgi.services@default:default,org.eclipse.wst.xml.core@default:default,org.eclipse.core.databinding.observable@default:default,org.jboss.tools.xulrunner.initializer@default:false,org.eclipse.jface@default:default,org.eclipse.emf.edit@default:default,org.eclipse.wst.common.emf@default:default,org.eclipse.ltk.ui.refactoring@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.core.runtime@default:true,org.ecl!
ipse.emf.ecore.change@default:default,javax.xml@default:default,org.eclipse.ui@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.swt@default:default,org.eclipse.help@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.jdt.launching@default:default,org.apache.commons.logging*1.0.4.v201005080501@default:default,org.apache.xml.resolver@default:default,org.eclipse.emf.ecore.xmi@default:default,com.ibm.icu@default:default,org.eclipse.equinox.app@default:default,org.eclipse.jface.text@default:default,org.eclipse.team.ui@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.ltk.core.refactoring@default:default,org.hamcrest.core@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.ui.forms@default:default,org.eclipse.wst.common.emfworkbench.integration@default:default,org.eclipse.ecf.ssl@defa!
ult:false,com.instantiations.designer.jdt.fragment@default:fal!
se,org.e
clipse.core.net.linux.x86_64@default:false,org.eclipse.compare.core@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.text@default:default,org.eclipse.core.expressions@default:default,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.ui.workbench.texteditor@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"/>
<booleanAttribute key="tracing" value="false"/>
<booleanAttribute key="useCustomFeatures" value="false"/>
<booleanAttribute key="useDefaultConfig" value="true"/>
-<booleanAttribute key="useDefaultConfigArea" value="false"/>
+<booleanAttribute key="useDefaultConfigArea" value="true"/>
<booleanAttribute key="useProduct" value="false"/>
</launchConfiguration>
14 years
JBoss Tools SVN: r27562 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-16 13:28:26 -0500 (Thu, 16 Dec 2010)
New Revision: 27562
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java
Log:
[JBIDE-7911] corrected: throws exceptions on error (internal server error, connection error etc)
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java 2010-12-16 18:28:02 UTC (rev 27561)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java 2010-12-16 18:28:26 UTC (rev 27562)
@@ -89,7 +89,7 @@
String password = mainPage.getModel().getPassword();
try {
DeltaCloud newCloud = new DeltaCloud(name, url, username, password);
- return newCloud.testConnection();
+ return newCloud.testCredentials();
} catch (DeltaCloudException e) {
ErrorUtils.handleError(WizardMessages.getString("CloudConnectionAuthError.title"),
WizardMessages.getFormattedString("CloudConnectionAuthError.message", url), e, getShell());
14 years
JBoss Tools SVN: r27561 - trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-16 13:28:02 -0500 (Thu, 16 Dec 2010)
New Revision: 27561
Modified:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/DeltaCloudMockIntegrationTest.java
Log:
[JBIDE-7911] corrected: throws exceptions on error (internal server error, connection error etc)
Modified: trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/DeltaCloudMockIntegrationTest.java
===================================================================
--- trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/DeltaCloudMockIntegrationTest.java 2010-12-16 18:20:00 UTC (rev 27560)
+++ trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/DeltaCloudMockIntegrationTest.java 2010-12-16 18:28:02 UTC (rev 27561)
@@ -63,7 +63,7 @@
}
}
- @Test(expected = DeltaCloudClientException.class)
+ @Test(expected = DeltaCloudException.class)
public void testConnectionThrowsOnGeneralFailure() throws MalformedURLException, DeltaCloudClientException, DeltaCloudException {
ServerFake serverFake = setupServerFake("HTTP/1.1 501 Some Error\ndummy dummy dummy\n\n");
try {
14 years
JBoss Tools SVN: r27560 - trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/job.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-16 13:20:00 -0500 (Thu, 16 Dec 2010)
New Revision: 27560
Modified:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/job/CloudSchedulingRulesTest.java
Log:
[JBIDE-7911]
Modified: trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/job/CloudSchedulingRulesTest.java
===================================================================
--- trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/job/CloudSchedulingRulesTest.java 2010-12-16 18:19:21 UTC (rev 27559)
+++ trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/job/CloudSchedulingRulesTest.java 2010-12-16 18:20:00 UTC (rev 27560)
@@ -13,16 +13,15 @@
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.jboss.tools.internal.deltacloud.test.fakes.DeltaCloudFake;
import org.junit.Before;
import org.junit.Test;
@@ -109,46 +108,4 @@
new CloudElementSchedulingRule(cloudFake, CLOUDELEMENT.IMAGES);
assertTrue(cloudImagesRule.isConflicting(cloudImagesRule));
}
-
- 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 {
- }
-
- }
}
14 years
JBoss Tools SVN: r27559 - trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/client.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-16 13:19:21 -0500 (Thu, 16 Dec 2010)
New Revision: 27559
Modified:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/client/InstanceMockIntegrationTest.java
Log:
[JBIDE-7911]
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-12-16 18:18:39 UTC (rev 27558)
+++ trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/client/InstanceMockIntegrationTest.java 2010-12-16 18:19:21 UTC (rev 27559)
@@ -159,7 +159,7 @@
}
@Test(expected = DeltaCloudClientException.class)
- public void destroyThrowExceptionOnUnknowInstanceId() throws DeltaCloudClientException, IllegalArgumentException,
+ public void destroyThrowsExceptionOnUnknowInstanceId() throws DeltaCloudClientException, IllegalArgumentException,
InstantiationException, IllegalAccessException, InvocationTargetException, SecurityException,
NoSuchMethodException {
InternalDeltaCloudClient client = (InternalDeltaCloudClient) testSetup.getClient();
@@ -168,17 +168,9 @@
InstanceAction.DESTROY,
MockIntegrationTestContext.DELTACLOUD_URL,
HttpMethod.POST,
- createInstance()));
+ new Instance()));
}
- private Instance createInstance() throws IllegalArgumentException, InstantiationException, IllegalAccessException,
- InvocationTargetException, SecurityException, NoSuchMethodException {
- Constructor<Instance> constructor =
- (Constructor<Instance>) Instance.class.getDeclaredConstructor((Class<?>) null);
- constructor.setAccessible(true);
- return constructor.newInstance();
- }
-
private InstanceAction createInstanceAction(String name, String url, HttpMethod method, Instance instance)
throws IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException,
SecurityException, NoSuchMethodException {
14 years