Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2012-01-14 08:56:59 -0500
committerSteffen Pingel2012-01-14 08:57:16 -0500
commit0a004cade8a736465d0db3c73408b5cb91ef5edc (patch)
tree41c1e3b85a1b719efbbf7190bc11b3c3c1456acf
parent39797a8cd7110594fe6d6cd1c51c7f4b77909c89 (diff)
downloadorg.eclipse.mylyn.incubator-0a004cade8a736465d0db3c73408b5cb91ef5edc.tar.gz
org.eclipse.mylyn.incubator-0a004cade8a736465d0db3c73408b5cb91ef5edc.tar.xz
org.eclipse.mylyn.incubator-0a004cade8a736465d0db3c73408b5cb91ef5edc.zip
update Hudson example
-rw-r--r--org.eclipse.mylyn.examples.hudson.standalone/pom.xml6
-rw-r--r--org.eclipse.mylyn.examples.hudson.standalone/src/main/java/org/eclipse/mylyn/internal/examples/hudson/standalone/HudsonExample.java31
2 files changed, 9 insertions, 28 deletions
diff --git a/org.eclipse.mylyn.examples.hudson.standalone/pom.xml b/org.eclipse.mylyn.examples.hudson.standalone/pom.xml
index 25a94569..68dfd71c 100644
--- a/org.eclipse.mylyn.examples.hudson.standalone/pom.xml
+++ b/org.eclipse.mylyn.examples.hudson.standalone/pom.xml
@@ -84,12 +84,12 @@
</dependency>
<dependency>
<groupId>org.eclipse.mylyn.commons</groupId>
- <artifactId>org.eclipse.mylyn.commons.net</artifactId>
- <version>3.7.0-SNAPSHOT</version>
+ <artifactId>org.eclipse.mylyn.commons.repositories.core</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.eclipse.mylyn.commons</groupId>
- <artifactId>org.eclipse.mylyn.commons.repositories</artifactId>
+ <artifactId>org.eclipse.mylyn.commons.repositories.http.core</artifactId>
<version>0.9.0-SNAPSHOT</version>
</dependency>
</dependencies>
diff --git a/org.eclipse.mylyn.examples.hudson.standalone/src/main/java/org/eclipse/mylyn/internal/examples/hudson/standalone/HudsonExample.java b/org.eclipse.mylyn.examples.hudson.standalone/src/main/java/org/eclipse/mylyn/internal/examples/hudson/standalone/HudsonExample.java
index efb48e4d..f157942b 100644
--- a/org.eclipse.mylyn.examples.hudson.standalone/src/main/java/org/eclipse/mylyn/internal/examples/hudson/standalone/HudsonExample.java
+++ b/org.eclipse.mylyn.examples.hudson.standalone/src/main/java/org/eclipse/mylyn/internal/examples/hudson/standalone/HudsonExample.java
@@ -11,22 +11,6 @@
package org.eclipse.mylyn.internal.examples.hudson.standalone;
import java.util.List;
-import java.util.UUID;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.mylyn.builds.core.IBuildPlan;
-import org.eclipse.mylyn.builds.core.spi.BuildServerBehaviour;
-import org.eclipse.mylyn.builds.core.spi.BuildServerConfiguration;
-import org.eclipse.mylyn.commons.net.WebLocation;
-import org.eclipse.mylyn.commons.repositories.RepositoryLocation;
-import org.eclipse.mylyn.internal.commons.net.CommonsNetPlugin;
-import org.eclipse.mylyn.internal.commons.repositories.InMemoryCredentialsStore;
-import org.eclipse.mylyn.internal.hudson.core.HudsonConnector;
-import org.eclipse.mylyn.internal.hudson.core.client.HudsonConfigurationCache;
-import org.eclipse.mylyn.internal.hudson.core.client.HudsonException;
-import org.eclipse.mylyn.internal.hudson.core.client.RestfulHudsonClient;
-import org.eclipse.mylyn.internal.hudson.model.HudsonModelJob;
-import org.eclipse.osgi.util.NLS;
/**
* @author Steffen Pingel
@@ -48,14 +32,10 @@ public class HudsonExample {
private static void framworkApiExample() throws CoreException {
RepositoryLocation location = new RepositoryLocation();
- location.setProperty(RepositoryLocation.PROPERTY_ID, UUID.randomUUID().toString());
- location.setCredentialsStore(new InMemoryCredentialsStore(null));
-
- location.setProperty(RepositoryLocation.PROPERTY_URL, "http://ci.mylyn.org/");
-// AuthenticationCredentials credentials = new UsernamePasswordCredentials("username", "password");
-// location.setCredentials(org.eclipse.mylyn.commons.repositories.auth.AuthenticationType.REPOSITORY, credentials);
+ location.setUrl("http://ci.mylyn.org/");
+ //location.setCredentials(AuthenticationType.REPOSITORY, new UserCredentials("username", "password"));
- HudsonConnector connector = new HudsonConnector();
+ BuildConnector connector = HudsonCore.createConnector(null);
BuildServerBehaviour behavior = connector.getBehaviour(location);
System.out.println(NLS.bind("= Listing all jobs on {0} =", location.getUrl()));
@@ -66,8 +46,9 @@ public class HudsonExample {
}
private static void hudsonApiExample() throws HudsonException {
- WebLocation location = new WebLocation("http://ci.mylyn.org/");
-// location.setCredentials(AuthenticationType.HTTP, "username", "password");
+ RepositoryLocation location = new RepositoryLocation();
+ location.setUrl("http://mylyn.org/jenkins-latest");
+ //location.setCredentials(AuthenticationType.REPOSITORY, new UserCredentials("username", "password"));
RestfulHudsonClient client = new RestfulHudsonClient(location, new HudsonConfigurationCache());

Back to the top