You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by ad...@apache.org on 2014/10/05 01:14:11 UTC
[1/2] Remove jenkins, which hasn't been published in over a year.
Repository: jclouds-labs
Updated Branches:
refs/heads/master 3020b95ee -> ac22366f9
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/test/java/org/jclouds/jenkins/v1/features/ComputerApiLiveTest.java
----------------------------------------------------------------------
diff --git a/jenkins/src/test/java/org/jclouds/jenkins/v1/features/ComputerApiLiveTest.java b/jenkins/src/test/java/org/jclouds/jenkins/v1/features/ComputerApiLiveTest.java
deleted file mode 100644
index 76ac00f..0000000
--- a/jenkins/src/test/java/org/jclouds/jenkins/v1/features/ComputerApiLiveTest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-
-import org.jclouds.jenkins.v1.domain.Computer;
-import org.jclouds.jenkins.v1.domain.ComputerView;
-import org.jclouds.jenkins.v1.internal.BaseJenkinsApiLiveTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "live", testName = "ComputerApiLiveTest")
-public class ComputerApiLiveTest extends BaseJenkinsApiLiveTest {
-
- public void testGetComputerView(){
- ComputerView view = getApi().getView();
- assertNotNull(view);
- assertNotNull(view.getDisplayName());
- for (Computer computerFromView : view.getComputers()) {
- assertNotNull(computerFromView.getDisplayName());
- if (!"master".equals(computerFromView.getDisplayName())) {
- Computer computerFromGetRequest = getApi().get(computerFromView.getDisplayName());
- assertEquals(computerFromGetRequest, computerFromView);
- }
- }
- }
-
- private ComputerApi getApi() {
- return context.getApi().getComputerApi();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/test/java/org/jclouds/jenkins/v1/features/JobApiExpectTest.java
----------------------------------------------------------------------
diff --git a/jenkins/src/test/java/org/jclouds/jenkins/v1/features/JobApiExpectTest.java b/jenkins/src/test/java/org/jclouds/jenkins/v1/features/JobApiExpectTest.java
deleted file mode 100644
index 2614e4d..0000000
--- a/jenkins/src/test/java/org/jclouds/jenkins/v1/features/JobApiExpectTest.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNull;
-
-import java.io.IOException;
-
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.jenkins.v1.JenkinsApi;
-import org.jclouds.jenkins.v1.internal.BaseJenkinsApiExpectTest;
-import org.jclouds.jenkins.v1.parse.LastBuildTest;
-import org.jclouds.jenkins.v1.parse.ParseJobDetailsTest;
-import org.jclouds.util.Strings2;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "JobApiExpectTest")
-public class JobApiExpectTest extends BaseJenkinsApiExpectTest {
-
- public void testCreateJobStringWhenResponseIs2xx() throws IOException {
- HttpRequest createJob = HttpRequest.builder()
- .method("POST")
- .endpoint("http://localhost:8080/createItem?name=blagoo")
- .addHeader("Authorization", "Basic aWRlbnRpdHk6Y3JlZGVudGlhbA==")
- .payload(payloadFromResourceWithContentType("/sample_job.xml", "text/xml"))
- .build();
-
- HttpResponse createJobResponse = HttpResponse.builder().statusCode(200).build();
-
- JenkinsApi createJobWhenCreated = requestSendsResponse(createJob, createJobResponse);
-
- createJobWhenCreated.getJobApi().createFromXML("blagoo", Strings2.toStringAndClose(getClass().getResourceAsStream("/sample_job.xml")));
- }
-
- public void testDeleteJobWhenResponseIs2xx() {
- HttpRequest deleteJob = HttpRequest.builder()
- .method("POST")
- .endpoint("http://localhost:8080/job/blagoo/doDelete")
- .addHeader("Authorization", "Basic aWRlbnRpdHk6Y3JlZGVudGlhbA==")
- .build();
-
- HttpResponse deleteJobResponse = HttpResponse.builder().statusCode(200).build();
-
- JenkinsApi deleteJobWhenDeleted = requestSendsResponse(deleteJob, deleteJobResponse);
-
- deleteJobWhenDeleted.getJobApi().delete("blagoo");
- }
-
- public void testDeleteJobWhenResponseIs404() {
- HttpRequest deleteJob = HttpRequest.builder()
- .method("POST")
- .endpoint("http://localhost:8080/job/blagoo/doDelete")
- .addHeader("Authorization", "Basic aWRlbnRpdHk6Y3JlZGVudGlhbA==")
- .build();
-
- HttpResponse deleteJobResponse = HttpResponse.builder().statusCode(404).build();
-
- JenkinsApi deleteJobWhenDeleted = requestSendsResponse(deleteJob, deleteJobResponse);
-
- deleteJobWhenDeleted.getJobApi().delete("blagoo");
- }
-
- HttpRequest getJob = HttpRequest.builder()
- .method("GET")
- .endpoint("http://localhost:8080/job/ddd/api/json")
- .addHeader("Accept", "application/json")
- .addHeader("Authorization", "Basic aWRlbnRpdHk6Y3JlZGVudGlhbA==")
- .build();
-
- public void testGetJobWhenResponseIs2xx() {
- HttpResponse getJobResponse = HttpResponse.builder().statusCode(200)
- .payload(payloadFromResource("/job.json")).build();
- JenkinsApi apiWhenJobExists = requestSendsResponse(getJob, getJobResponse);
- assertEquals(apiWhenJobExists.getJobApi().get("ddd").toString(),
- new ParseJobDetailsTest().expected().toString());
- }
-
- public void testGetJobWhenResponseIs404() {
- HttpResponse getJobResponse = HttpResponse.builder().statusCode(404).build();
- JenkinsApi getJobWhenGetd = requestSendsResponse(getJob, getJobResponse);
- assertNull(getJobWhenGetd.getJobApi().get("ddd"));
- }
-
- HttpRequest buildJob = HttpRequest.builder()
- .method("POST")
- .endpoint("http://localhost:8080/job/ddd/build")
- .addHeader("Authorization", "Basic aWRlbnRpdHk6Y3JlZGVudGlhbA==")
- .build();
-
- public void testBuildJobWhenResponseIs2xx() {
- HttpResponse buildJobResponse = HttpResponse.builder().statusCode(200).build();
- JenkinsApi apiWhenJobExists = requestSendsResponse(buildJob, buildJobResponse);
- apiWhenJobExists.getJobApi().build("ddd");
- }
-
- public void testBuildJobWhenResponseIs404() {
- HttpResponse getJobResponse = HttpResponse.builder().statusCode(404).build();
- JenkinsApi getJobWhenGetd = requestSendsResponse(buildJob, getJobResponse);
- getJobWhenGetd.getJobApi().build("ddd");
- }
-
- HttpRequest fetchConfig = HttpRequest.builder()
- .method("GET")
- .endpoint("http://localhost:8080/job/ddd/config.xml")
- .addHeader("Authorization", "Basic aWRlbnRpdHk6Y3JlZGVudGlhbA==")
- .build();
-
- public void testFetchConfigXMLWhenResponseIs2xx() {
- HttpResponse fetchConfigResponse = HttpResponse.builder().statusCode(200)
- .payload(payloadFromResourceWithContentType("/sample_job.xml", "text/xml")).build();
- JenkinsApi apiWhenJobExists = requestSendsResponse(fetchConfig, fetchConfigResponse);
- String configXML = apiWhenJobExists.getJobApi().fetchConfigXML("ddd");
- //TODO enable this assertion
- //assertEquals(configXML, Strings2.toStringAndClose(getClass().getResourceAsStream("/sample_job.xml")));
- }
-
- public void testFetchConfigXMLWhenResponseIs404() {
- HttpResponse fetchConfigResponse = HttpResponse.builder().statusCode(404).build();
- JenkinsApi getJobWhenGetd = requestSendsResponse(fetchConfig, fetchConfigResponse);
- getJobWhenGetd.getJobApi().fetchConfigXML("ddd");
- }
-
-
- HttpRequest lastBuild = HttpRequest.builder()
- .method("GET")
- .endpoint("http://localhost:8080/job/ddd/lastBuild/api/json")
- .addHeader("Accept", "application/json")
- .addHeader("Authorization", "Basic aWRlbnRpdHk6Y3JlZGVudGlhbA==")
- .build();
-
- public void testLastBuildWhenResponseIs2xx() {
- HttpResponse lastBuildResponse = HttpResponse.builder().statusCode(200)
- .payload(payloadFromResource("/lastBuild.json")).build();
- JenkinsApi apiWhenJobExists = requestSendsResponse(lastBuild, lastBuildResponse);
- assertEquals(apiWhenJobExists.getJobApi().lastBuild("ddd").toString(),
- new LastBuildTest().expected().toString());
- }
-
- public void testLastBuildWhenResponseIs404() {
- HttpResponse lastBuildResponse = HttpResponse.builder().statusCode(404).build();
- JenkinsApi getJobWhenGetd = requestSendsResponse(lastBuild, lastBuildResponse);
- assertNull(getJobWhenGetd.getJobApi().lastBuild("ddd"));
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/test/java/org/jclouds/jenkins/v1/features/JobApiLiveTest.java
----------------------------------------------------------------------
diff --git a/jenkins/src/test/java/org/jclouds/jenkins/v1/features/JobApiLiveTest.java b/jenkins/src/test/java/org/jclouds/jenkins/v1/features/JobApiLiveTest.java
deleted file mode 100644
index 8a8a776..0000000
--- a/jenkins/src/test/java/org/jclouds/jenkins/v1/features/JobApiLiveTest.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-
-import java.io.IOException;
-import java.util.Map;
-
-import org.jclouds.jenkins.v1.domain.JobDetails;
-import org.jclouds.jenkins.v1.domain.LastBuild;
-import org.jclouds.jenkins.v1.internal.BaseJenkinsApiLiveTest;
-import org.jclouds.util.Strings2;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableMap;
-
-@Test(groups = "live", testName = "JobApiLiveTest")
-public class JobApiLiveTest extends BaseJenkinsApiLiveTest {
-
- public void testCreateJob() throws IOException {
- getApi().delete("blagoo");
- getApi().createFromXML("blagoo", Strings2.toStringAndClose(getClass().getResourceAsStream("/sample_job.xml")));
- }
-
- @Test(dependsOnMethods = "testCreateJob")
- public void testFetchConfigXML() throws IOException {
- String configXML = getApi().fetchConfigXML("blagoo");
- assertNotNull(configXML);
- //TODO enable this assertion
- //assertEquals(configXML, Strings2.toStringAndClose(getClass().getResourceAsStream("/sample_job.xml")));
- }
-
- @Test(dependsOnMethods = "testFetchConfigXML")
- public void testGetJob() throws IOException {
- JobDetails job = getApi().get("blagoo");
- assertNotNull(job);
- assertEquals(job.getName(), "blagoo");
- }
-
- @Test(dependsOnMethods = "testGetJob")
- public void testBuildJob() throws IOException {
- getApi().build("blagoo");
- }
-
- @Test(dependsOnMethods = "testBuildJob")
- public void testDeleteJob() {
- getApi().delete("blagoo");
- }
-
- @Test(dependsOnMethods = "testDeleteJob")
- public void testCreateJobWithParameters() throws IOException {
- getApi().delete("jobWithParameters");
- getApi().createFromXML("jobWithParameters", Strings2.toStringAndClose(getClass().getResourceAsStream("/sample_job_with_parameters.xml")));
- }
-
- @Test(dependsOnMethods = "testCreateJobWithParameters")
- public void testBuildJobWithParameters() throws IOException {
- Map<String, String> parameters = ImmutableMap.of("name", "test1", "password", "secret");
- getApi().buildWithParameters("jobWithParameters", parameters);
- }
-
- @Test(dependsOnMethods = "testBuildJobWithParameters")
- public void testLastBuild() throws IOException {
- LastBuild lastBuild = getApi().lastBuild("jobWithParameters");
- while(lastBuild == null || lastBuild.getResult() == null) {
- lastBuild = getApi().lastBuild("jobWithParameters");
- }
- assertEquals(lastBuild.getResult(), "SUCCESS");
- }
-
- @Test(dependsOnMethods = "testLastBuild")
- public void testDeleteJobWithParameters() {
- getApi().delete("jobWithParameters");
- }
-
- @AfterClass(groups = { "integration", "live" })
- @Override
- protected void tearDownContext() {
- getApi().delete("blagoo");
- getApi().delete("jobWithParameters");
- super.tearDownContext();
- }
-
- private JobApi getApi() {
- return context.getApi().getJobApi();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/test/java/org/jclouds/jenkins/v1/filters/BasicAuthenticationUnlessAnonymousExpectTest.java
----------------------------------------------------------------------
diff --git a/jenkins/src/test/java/org/jclouds/jenkins/v1/filters/BasicAuthenticationUnlessAnonymousExpectTest.java b/jenkins/src/test/java/org/jclouds/jenkins/v1/filters/BasicAuthenticationUnlessAnonymousExpectTest.java
deleted file mode 100644
index 4b6c6b0..0000000
--- a/jenkins/src/test/java/org/jclouds/jenkins/v1/filters/BasicAuthenticationUnlessAnonymousExpectTest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1.filters;
-
-import static org.testng.Assert.assertEquals;
-
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.jenkins.v1.JenkinsApiMetadata;
-import org.jclouds.jenkins.v1.JenkinsApi;
-import org.jclouds.jenkins.v1.internal.BaseJenkinsApiExpectTest;
-import org.jclouds.jenkins.v1.parse.ParseComputerViewTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "BasicAuthenticationUnlessAnonymousExpectTest")
-public class BasicAuthenticationUnlessAnonymousExpectTest extends BaseJenkinsApiExpectTest {
-
- public BasicAuthenticationUnlessAnonymousExpectTest(){
- identity = JenkinsApiMetadata.ANONYMOUS_IDENTITY;
- }
-
- public void testWhenIdentityIsAnonymousNoAuthorizationHeader() {
- HttpRequest getComputerView = HttpRequest
- .builder()
- .method("GET")
- .endpoint("http://localhost:8080/computer/api/json")
- .addHeader("Accept", "application/json").build();
-
- HttpResponse getComputerViewResponse = HttpResponse.builder().statusCode(200)
- .payload(payloadFromResource("/computerview.json")).build();
-
- JenkinsApi apiWhenServersExist = requestSendsResponse(getComputerView, getComputerViewResponse);
-
- assertEquals(apiWhenServersExist.getComputerApi().getView().toString(),
- new ParseComputerViewTest().expected().toString());
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/test/java/org/jclouds/jenkins/v1/internal/BaseJenkinsApiExpectTest.java
----------------------------------------------------------------------
diff --git a/jenkins/src/test/java/org/jclouds/jenkins/v1/internal/BaseJenkinsApiExpectTest.java b/jenkins/src/test/java/org/jclouds/jenkins/v1/internal/BaseJenkinsApiExpectTest.java
deleted file mode 100644
index 6e01017..0000000
--- a/jenkins/src/test/java/org/jclouds/jenkins/v1/internal/BaseJenkinsApiExpectTest.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1.internal;
-
-import org.jclouds.jenkins.v1.JenkinsApi;
-
-/**
- * Base class for writing Jenkins Expect tests
- */
-public class BaseJenkinsApiExpectTest extends BaseJenkinsExpectTest<JenkinsApi> {
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/test/java/org/jclouds/jenkins/v1/internal/BaseJenkinsApiLiveTest.java
----------------------------------------------------------------------
diff --git a/jenkins/src/test/java/org/jclouds/jenkins/v1/internal/BaseJenkinsApiLiveTest.java b/jenkins/src/test/java/org/jclouds/jenkins/v1/internal/BaseJenkinsApiLiveTest.java
deleted file mode 100644
index 4028376..0000000
--- a/jenkins/src/test/java/org/jclouds/jenkins/v1/internal/BaseJenkinsApiLiveTest.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1.internal;
-
-import org.jclouds.apis.BaseContextLiveTest;
-import org.jclouds.jenkins.v1.JenkinsApiMetadata;
-import org.jclouds.jenkins.v1.JenkinsAsyncApi;
-import org.jclouds.jenkins.v1.JenkinsApi;
-import org.jclouds.rest.RestContext;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import com.google.common.reflect.TypeToken;
-
-/**
- * Tests behavior of {@code JenkinsApi}
- */
-@Test(groups = "live")
-public class BaseJenkinsApiLiveTest extends BaseContextLiveTest<RestContext<JenkinsApi, JenkinsAsyncApi>> {
-
- public BaseJenkinsApiLiveTest() {
- provider = "jenkins";
- }
-
- protected RestContext<JenkinsApi, JenkinsAsyncApi> jenkinsContext;
-
- @BeforeClass(groups = { "integration", "live" })
- @Override
- public void setupContext() {
- super.setupContext();
- jenkinsContext = context;
- }
-
- @Override
- protected TypeToken<RestContext<JenkinsApi, JenkinsAsyncApi>> contextType() {
- return JenkinsApiMetadata.CONTEXT_TOKEN;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/test/java/org/jclouds/jenkins/v1/internal/BaseJenkinsAsyncApiExpectTest.java
----------------------------------------------------------------------
diff --git a/jenkins/src/test/java/org/jclouds/jenkins/v1/internal/BaseJenkinsAsyncApiExpectTest.java b/jenkins/src/test/java/org/jclouds/jenkins/v1/internal/BaseJenkinsAsyncApiExpectTest.java
deleted file mode 100644
index 5426c79..0000000
--- a/jenkins/src/test/java/org/jclouds/jenkins/v1/internal/BaseJenkinsAsyncApiExpectTest.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1.internal;
-
-import java.util.Properties;
-
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.jenkins.v1.JenkinsAsyncApi;
-
-import com.google.common.base.Function;
-import com.google.inject.Module;
-
-/**
- * Base class for writing KeyStone Rest Api Expect tests
- */
-public class BaseJenkinsAsyncApiExpectTest extends BaseJenkinsExpectTest<JenkinsAsyncApi> {
- public JenkinsAsyncApi createClient(Function<HttpRequest, HttpResponse> fn, Module module, Properties props) {
- return createInjector(fn, module, props).getInstance(JenkinsAsyncApi.class);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/test/java/org/jclouds/jenkins/v1/internal/BaseJenkinsExpectTest.java
----------------------------------------------------------------------
diff --git a/jenkins/src/test/java/org/jclouds/jenkins/v1/internal/BaseJenkinsExpectTest.java b/jenkins/src/test/java/org/jclouds/jenkins/v1/internal/BaseJenkinsExpectTest.java
deleted file mode 100644
index 2d24b42..0000000
--- a/jenkins/src/test/java/org/jclouds/jenkins/v1/internal/BaseJenkinsExpectTest.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1.internal;
-
-import org.jclouds.rest.internal.BaseRestApiExpectTest;
-
-/**
- * Base class for writing Jenkins Expect tests
- */
-public class BaseJenkinsExpectTest<T> extends BaseRestApiExpectTest<T> {
- public BaseJenkinsExpectTest() {
- provider = "jenkins";
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/test/java/org/jclouds/jenkins/v1/parse/LastBuildTest.java
----------------------------------------------------------------------
diff --git a/jenkins/src/test/java/org/jclouds/jenkins/v1/parse/LastBuildTest.java b/jenkins/src/test/java/org/jclouds/jenkins/v1/parse/LastBuildTest.java
deleted file mode 100644
index 8b4835a..0000000
--- a/jenkins/src/test/java/org/jclouds/jenkins/v1/parse/LastBuildTest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1.parse;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.jenkins.v1.domain.LastBuild;
-import org.jclouds.json.BaseItemParserTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "LastBuildTest")
-public class LastBuildTest extends BaseItemParserTest<LastBuild> {
-
- @Override
- public String resource() {
- return "/lastBuild.json";
- }
-
- @Override
- @Consumes(MediaType.APPLICATION_JSON)
- public LastBuild expected() {
- return LastBuild.builder()
- .id("2012-07-11_04-02-37")
- .url(URI.create("http://dal36.poweredman.com:8080/job/poweredman-web-build/139/"))
- .description("test")
- .duration("505777")
- .building("false")
- .estimatedDuration("942619")
- .fullDisplayName("poweredman-web-build #139")
- .timestamp("1341997357461")
- .result("SUCCESS")
- .build();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/test/java/org/jclouds/jenkins/v1/parse/ParseComputerTest.java
----------------------------------------------------------------------
diff --git a/jenkins/src/test/java/org/jclouds/jenkins/v1/parse/ParseComputerTest.java b/jenkins/src/test/java/org/jclouds/jenkins/v1/parse/ParseComputerTest.java
deleted file mode 100644
index 7d78577..0000000
--- a/jenkins/src/test/java/org/jclouds/jenkins/v1/parse/ParseComputerTest.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1.parse;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.jenkins.v1.domain.Computer;
-import org.jclouds.json.BaseItemParserTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "ParseComputerTest")
-public class ParseComputerTest extends BaseItemParserTest<Computer> {
-
- @Override
- public String resource() {
- return "/computer.json";
- }
-
- @Override
- @Consumes(MediaType.APPLICATION_JSON)
- public Computer expected() {
- return Computer.builder()
- .displayName("Ruboto")
- .idle(true)
- .offline(false)
- .build();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/test/java/org/jclouds/jenkins/v1/parse/ParseComputerViewTest.java
----------------------------------------------------------------------
diff --git a/jenkins/src/test/java/org/jclouds/jenkins/v1/parse/ParseComputerViewTest.java b/jenkins/src/test/java/org/jclouds/jenkins/v1/parse/ParseComputerViewTest.java
deleted file mode 100644
index f4b9404..0000000
--- a/jenkins/src/test/java/org/jclouds/jenkins/v1/parse/ParseComputerViewTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1.parse;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.jenkins.v1.domain.Computer;
-import org.jclouds.jenkins.v1.domain.ComputerView;
-import org.jclouds.json.BaseItemParserTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableSet;
-
-@Test(groups = "unit", testName = "ParseComputerViewTest")
-public class ParseComputerViewTest extends BaseItemParserTest<ComputerView> {
-
- @Override
- public String resource() {
- return "/computerview.json";
- }
-
- @Override
- @Consumes(MediaType.APPLICATION_JSON)
- public ComputerView expected() {
- return ComputerView.builder()
- .displayName("nodes")
- .totalExecutors(4)
- .busyExecutors(0)
- .computers(ImmutableSet.<Computer>builder()
- .add(Computer.builder()
- .displayName("master")
- .idle(true)
- .offline(false).build())
- .add(Computer.builder()
- .displayName("Ruboto")
- .idle(true)
- .offline(false).build())
- .add(Computer.builder()
- .displayName("winserver2008-x86")
- .idle(true)
- .offline(false).build()).build()).build();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/test/java/org/jclouds/jenkins/v1/parse/ParseJobDetailsTest.java
----------------------------------------------------------------------
diff --git a/jenkins/src/test/java/org/jclouds/jenkins/v1/parse/ParseJobDetailsTest.java b/jenkins/src/test/java/org/jclouds/jenkins/v1/parse/ParseJobDetailsTest.java
deleted file mode 100644
index 45af013..0000000
--- a/jenkins/src/test/java/org/jclouds/jenkins/v1/parse/ParseJobDetailsTest.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1.parse;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.jenkins.v1.domain.JobDetails;
-import org.jclouds.json.BaseItemParserTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "ParseJobDetailsTest")
-public class ParseJobDetailsTest extends BaseItemParserTest<JobDetails> {
-
- @Override
- public String resource() {
- return "/job.json";
- }
-
- @Override
- @Consumes(MediaType.APPLICATION_JSON)
- public JobDetails expected() {
- return JobDetails.builder()
- .name("ddd")
- .url(URI.create("http://localhost:8080/job/ddd/"))
- .color("grey").build();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/test/java/org/jclouds/jenkins/v1/parse/ParseNodeTest.java
----------------------------------------------------------------------
diff --git a/jenkins/src/test/java/org/jclouds/jenkins/v1/parse/ParseNodeTest.java b/jenkins/src/test/java/org/jclouds/jenkins/v1/parse/ParseNodeTest.java
deleted file mode 100644
index d2c8c1a..0000000
--- a/jenkins/src/test/java/org/jclouds/jenkins/v1/parse/ParseNodeTest.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1.parse;
-
-import java.net.URI;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.jenkins.v1.domain.Job;
-import org.jclouds.jenkins.v1.domain.Node;
-import org.jclouds.json.BaseItemParserTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "ParseNodeTest")
-public class ParseNodeTest extends BaseItemParserTest<Node> {
-
- @Override
- public String resource() {
- return "/master.json";
- }
-
- @Override
- @Consumes(MediaType.APPLICATION_JSON)
- public Node expected() {
- return Node.builder()
- .name("")
- .description("the master Jenkins node")
- .jobs(Job.builder()
- .name("ddd")
- .url(URI.create("http://localhost:8080/job/ddd/"))
- .color("grey").build())
- .build();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/test/resources/computer.json
----------------------------------------------------------------------
diff --git a/jenkins/src/test/resources/computer.json b/jenkins/src/test/resources/computer.json
deleted file mode 100644
index 610126b..0000000
--- a/jenkins/src/test/resources/computer.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
- "actions": [],
- "displayName": "Ruboto",
- "executors": [{}],
- "icon": "computer.png",
- "idle": true,
- "jnlpAgent": true,
- "launchSupported": false,
- "loadStatistics": {},
- "manualLaunchAllowed": true,
- "monitorData": {
- "hudson.node_monitors.SwapSpaceMonitor": {
- "availablePhysicalMemory": 1697591296,
- "availableSwapSpace": 5626036224,
- "totalPhysicalMemory": 4157317120,
- "totalSwapSpace": 6568271872
- },
- "hudson.node_monitors.ArchitectureMonitor": "Linux (amd64)",
- "hudson.node_monitors.ResponseTimeMonitor": {
- "average": 955
- },
- "hudson.node_monitors.TemporarySpaceMonitor": {
- "size": 53646782464
- },
- "hudson.node_monitors.DiskSpaceMonitor": {
- "size": 53646782464
- },
- "hudson.node_monitors.ClockMonitor": {
- "diff": -309
- }
- },
- "numExecutors": 1,
- "offline": false,
- "offlineCause": null,
- "oneOffExecutors": [],
- "temporarilyOffline": false
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/test/resources/computerview.json
----------------------------------------------------------------------
diff --git a/jenkins/src/test/resources/computerview.json b/jenkins/src/test/resources/computerview.json
deleted file mode 100644
index e9b0704..0000000
--- a/jenkins/src/test/resources/computerview.json
+++ /dev/null
@@ -1,114 +0,0 @@
-{
- "busyExecutors": 0,
- "computer": [{
- "actions": [],
- "displayName": "master",
- "executors": [{}, {}],
- "icon": "computer.png",
- "idle": true,
- "jnlpAgent": false,
- "launchSupported": true,
- "loadStatistics": {},
- "manualLaunchAllowed": true,
- "monitorData": {
- "hudson.node_monitors.SwapSpaceMonitor": {
- "availablePhysicalMemory": 1385115648,
- "availableSwapSpace": 32208396288,
- "totalPhysicalMemory": 8053207040,
- "totalSwapSpace": 32218378240
- },
- "hudson.node_monitors.ArchitectureMonitor": "Linux (amd64)",
- "hudson.node_monitors.ResponseTimeMonitor": {
- "average": 1
- },
- "hudson.node_monitors.TemporarySpaceMonitor": {
- "size": 6235500544
- },
- "hudson.node_monitors.DiskSpaceMonitor": {
- "size": 79292284928
- },
- "hudson.node_monitors.ClockMonitor": {
- "diff": 0
- }
- },
- "numExecutors": 2,
- "offline": false,
- "offlineCause": null,
- "oneOffExecutors": [],
- "temporarilyOffline": false
- }, {
- "actions": [],
- "displayName": "Ruboto",
- "executors": [{}],
- "icon": "computer.png",
- "idle": true,
- "jnlpAgent": true,
- "launchSupported": false,
- "loadStatistics": {},
- "manualLaunchAllowed": true,
- "monitorData": {
- "hudson.node_monitors.SwapSpaceMonitor": {
- "availablePhysicalMemory": 1684832256,
- "availableSwapSpace": 5625421824,
- "totalPhysicalMemory": 4157317120,
- "totalSwapSpace": 6568271872
- },
- "hudson.node_monitors.ArchitectureMonitor": "Linux (amd64)",
- "hudson.node_monitors.ResponseTimeMonitor": {
- "average": 856
- },
- "hudson.node_monitors.TemporarySpaceMonitor": {
- "size": 53648973824
- },
- "hudson.node_monitors.DiskSpaceMonitor": {
- "size": 53648969728
- },
- "hudson.node_monitors.ClockMonitor": {
- "diff": -462
- }
- },
- "numExecutors": 1,
- "offline": false,
- "offlineCause": null,
- "oneOffExecutors": [],
- "temporarilyOffline": false
- }, {
- "actions": [],
- "displayName": "winserver2008-x86",
- "executors": [{}],
- "icon": "computer.png",
- "idle": true,
- "jnlpAgent": true,
- "launchSupported": false,
- "loadStatistics": {},
- "manualLaunchAllowed": true,
- "monitorData": {
- "hudson.node_monitors.SwapSpaceMonitor": {
- "availablePhysicalMemory": 1117851648,
- "availableSwapSpace": 1429299200,
- "totalPhysicalMemory": 1781420032,
- "totalSwapSpace": 1994350592
- },
- "hudson.node_monitors.ArchitectureMonitor": "Windows Server 2008 (x86)",
- "hudson.node_monitors.ResponseTimeMonitor": {
- "average": 1
- },
- "hudson.node_monitors.TemporarySpaceMonitor": {
- "size": 19072663552
- },
- "hudson.node_monitors.DiskSpaceMonitor": {
- "size": 19072663552
- },
- "hudson.node_monitors.ClockMonitor": {
- "diff": 71
- }
- },
- "numExecutors": 1,
- "offline": false,
- "offlineCause": null,
- "oneOffExecutors": [],
- "temporarilyOffline": false
- }],
- "displayName": "nodes",
- "totalExecutors": 4
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/test/resources/job.json
----------------------------------------------------------------------
diff --git a/jenkins/src/test/resources/job.json b/jenkins/src/test/resources/job.json
deleted file mode 100644
index ebf43f3..0000000
--- a/jenkins/src/test/resources/job.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "actions": [],
- "description": "",
- "displayName": "ddd",
- "displayNameOrNull": null,
- "name": "ddd",
- "url": "http://localhost:8080/job/ddd/",
- "buildable": true,
- "builds": [],
- "color": "grey",
- "firstBuild": null,
- "healthReport": [],
- "inQueue": false,
- "keepDependencies": false,
- "lastBuild": null,
- "lastCompletedBuild": null,
- "lastFailedBuild": null,
- "lastStableBuild": null,
- "lastSuccessfulBuild": null,
- "lastUnstableBuild": null,
- "lastUnsuccessfulBuild": null,
- "nextBuildNumber": 1,
- "property": [],
- "queueItem": null,
- "concurrentBuild": false,
- "downstreamProjects": [],
- "scm": {},
- "upstreamProjects": []
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/test/resources/lastBuild.json
----------------------------------------------------------------------
diff --git a/jenkins/src/test/resources/lastBuild.json b/jenkins/src/test/resources/lastBuild.json
deleted file mode 100644
index 3843687..0000000
--- a/jenkins/src/test/resources/lastBuild.json
+++ /dev/null
@@ -1,127 +0,0 @@
-{
- "actions": [
- {
- "causes": [
- {
- "shortDescription": "Started by GitHub push by "
- }
- ]
- },
- {
- },
- {
- "buildsByBranchName": {
- "origin/master": {
- "buildNumber": 139,
- "buildResult": null,
- "revision": {
- "SHA1": "aabf3da75ef2f4169de1136a93d5eec609314436",
- "branch": [
- {
- "SHA1": "aabf3da75ef2f4169de1136a93d5eec609314436",
- "name": "origin/HEAD"
- },
- {
- "SHA1": "aabf3da75ef2f4169de1136a93d5eec609314436",
- "name": "origin/master"
- }
- ]
- }
- },
- "origin/HEAD": {
- "buildNumber": 139,
- "buildResult": null,
- "revision": {
- "SHA1": "aabf3da75ef2f4169de1136a93d5eec609314436",
- "branch": [
- {
- "SHA1": "aabf3da75ef2f4169de1136a93d5eec609314436",
- "name": "origin/HEAD"
- },
- {
- "SHA1": "aabf3da75ef2f4169de1136a93d5eec609314436",
- "name": "origin/master"
- }
- ]
- }
- }
- },
- "lastBuiltRevision": {
- "SHA1": "aabf3da75ef2f4169de1136a93d5eec609314436",
- "branch": [
- {
- "SHA1": "aabf3da75ef2f4169de1136a93d5eec609314436",
- "name": "origin/HEAD"
- },
- {
- "SHA1": "aabf3da75ef2f4169de1136a93d5eec609314436",
- "name": "origin/master"
- }
- ]
- },
- "scmName": ""
- },
- {
- },
- {
- },
- {
- }
- ],
- "artifacts": [
- {
- "displayPath": "poweredman-webapp-0.0.1-SNAPSHOT.zip",
- "fileName": "poweredman-webapp-0.0.1-SNAPSHOT.zip",
- "relativePath": "webapp/dist/poweredman-webapp-0.0.1-SNAPSHOT.zip"
- }
- ],
- "building": false,
- "description": "test",
- "duration": 505777,
- "estimatedDuration": 942619,
- "fullDisplayName": "poweredman-web-build #139",
- "id": "2012-07-11_04-02-37",
- "keepLog": false,
- "number": 139,
- "result": "SUCCESS",
- "timestamp": 1341997357461,
- "url": "http://dal36.poweredman.com:8080/job/poweredman-web-build/139/",
- "builtOn": "",
- "changeSet": {
- "items": [
- {
- "affectedPaths": [
- "webapp/app/controllers/Application.java"
- ],
- "author": {
- "absoluteUrl": "http://dal36.poweredman.com:8080/user/andrea.turli",
- "fullName": "andrea.turli"
- },
- "commitId": "aabf3da75ef2f4169de1136a93d5eec609314436",
- "msg": "fixed signup process removing refuse Ebean.saveManyToManyAssociations(currentUser, \"companies\")",
- "timestamp": 1341997059000,
- "author (new)": {
- "absoluteUrl": "http://dal36.poweredman.com:8080/user/andrea.turli",
- "fullName": "andrea.turli"
- },
- "comment": "fixed signup process removing refuse Ebean.saveManyToManyAssociations(currentUser, \"companies\")\n",
- "date": "2012-07-11 03:57:39 +0200",
- "id": "aabf3da75ef2f4169de1136a93d5eec609314436",
- "msg (new)": "fixed signup process removing refuse Ebean.saveManyToManyAssociations(currentUser, \"companies\")",
- "paths": [
- {
- "editType": "edit",
- "file": "webapp/app/controllers/Application.java"
- }
- ]
- }
- ],
- "kind": null
- },
- "culprits": [
- {
- "absoluteUrl": "http://dal36.poweredman.com:8080/user/andrea.turli",
- "fullName": "andrea.turli"
- }
- ]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/test/resources/logback.xml
----------------------------------------------------------------------
diff --git a/jenkins/src/test/resources/logback.xml b/jenkins/src/test/resources/logback.xml
deleted file mode 100644
index 9679b2e..0000000
--- a/jenkins/src/test/resources/logback.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0"?>
-<configuration scan="false">
- <appender name="FILE" class="ch.qos.logback.core.FileAppender">
- <file>target/test-data/jclouds.log</file>
-
- <encoder>
- <Pattern>%d %-5p [%c] [%thread] %m%n</Pattern>
- </encoder>
- </appender>
-
- <appender name="WIREFILE" class="ch.qos.logback.core.FileAppender">
- <file>target/test-data/jclouds-wire.log</file>
-
- <encoder>
- <Pattern>%d %-5p [%c] [%thread] %m%n</Pattern>
- </encoder>
- </appender>
-
- <root>
- <level value="warn" />
- </root>
-
- <logger name="org.jclouds">
- <level value="DEBUG" />
- <appender-ref ref="FILE" />
- </logger>
-
- <logger name="jclouds.wire">
- <level value="DEBUG" />
- <appender-ref ref="WIREFILE" />
- </logger>
-
- <logger name="jclouds.headers">
- <level value="DEBUG" />
- <appender-ref ref="WIREFILE" />
- </logger>
-
-</configuration>
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/test/resources/master.json
----------------------------------------------------------------------
diff --git a/jenkins/src/test/resources/master.json b/jenkins/src/test/resources/master.json
deleted file mode 100644
index 8e5c622..0000000
--- a/jenkins/src/test/resources/master.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "assignedLabels": [{}],
- "mode": "NORMAL",
- "nodeDescription": "the master Jenkins node",
- "nodeName": "",
- "numExecutors": 2,
- "description": null,
- "jobs": [{
- "name": "ddd",
- "url": "http://localhost:8080/job/ddd/",
- "color": "grey"
- }],
- "overallLoad": {},
- "primaryView": {
- "name": "All",
- "url": "http://localhost:8080/"
- },
- "quietingDown": false,
- "slaveAgentPort": 0,
- "useCrumbs": false,
- "useSecurity": false,
- "views": [{
- "name": "All",
- "url": "http://localhost:8080/"
- }]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/test/resources/sample_job.xml
----------------------------------------------------------------------
diff --git a/jenkins/src/test/resources/sample_job.xml b/jenkins/src/test/resources/sample_job.xml
deleted file mode 100644
index 9b74eb3..0000000
--- a/jenkins/src/test/resources/sample_job.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<project>
- <actions/>
- <description></description>
- <keepDependencies>false</keepDependencies>
- <properties/>
- <scm class="hudson.scm.NullSCM"/>
- <canRoam>true</canRoam>
- <disabled>false</disabled>
- <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <triggers class="vector"/>
- <concurrentBuild>false</concurrentBuild>
- <builders>
- <hudson.tasks.Shell>
- <command>echo hello</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers/>
- <buildWrappers/>
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/test/resources/sample_job_with_parameters.xml
----------------------------------------------------------------------
diff --git a/jenkins/src/test/resources/sample_job_with_parameters.xml b/jenkins/src/test/resources/sample_job_with_parameters.xml
deleted file mode 100644
index 3c65002..0000000
--- a/jenkins/src/test/resources/sample_job_with_parameters.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<project>
- <actions />
- <description />
- <keepDependencies>false</keepDependencies>
- <properties>
- <hudson.model.ParametersDefinitionProperty>
- <parameterDefinitions>
- <hudson.model.StringParameterDefinition>
- <name>name</name>
- <description />
- <defaultValue />
- </hudson.model.StringParameterDefinition>
- <hudson.model.StringParameterDefinition>
- <name>password</name>
- <description />
- <defaultValue />
- </hudson.model.StringParameterDefinition>
- </parameterDefinitions>
- </hudson.model.ParametersDefinitionProperty>
- </properties>
- <scm class="hudson.scm.NullSCM" />
- <canRoam>true</canRoam>
- <disabled>false</disabled>
- <blockBuildWhenDownstreamBuilding>false
- </blockBuildWhenDownstreamBuilding>
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
- <triggers class="vector" />
- <concurrentBuild>false</concurrentBuild>
- <builders>
- <hudson.tasks.Shell>
- <command>echo hello</command>
- </hudson.tasks.Shell>
- </builders>
- <publishers />
- <buildWrappers />
-</project>
\ No newline at end of file
[2/2] git commit: Remove jenkins,
which hasn't been published in over a year.
Posted by ad...@apache.org.
Remove jenkins, which hasn't been published in over a year.
Project: http://git-wip-us.apache.org/repos/asf/jclouds-labs/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds-labs/commit/ac22366f
Tree: http://git-wip-us.apache.org/repos/asf/jclouds-labs/tree/ac22366f
Diff: http://git-wip-us.apache.org/repos/asf/jclouds-labs/diff/ac22366f
Branch: refs/heads/master
Commit: ac22366f929834adea83dfca445aa77cf5f77c05
Parents: 3020b95
Author: Adrian Cole <ac...@twitter.com>
Authored: Sat Oct 4 12:24:47 2014 -0700
Committer: Adrian Cole <ad...@apache.org>
Committed: Sat Oct 4 16:14:01 2014 -0700
----------------------------------------------------------------------
jenkins/pom.xml | 108 -------
.../java/org/jclouds/jenkins/v1/JenkinsApi.java | 48 ----
.../jclouds/jenkins/v1/JenkinsApiMetadata.java | 87 ------
.../org/jclouds/jenkins/v1/JenkinsAsyncApi.java | 67 -----
.../jclouds/jenkins/v1/JenkinsFallbacks.java | 50 ----
.../v1/binders/BindMapToOptionalParams.java | 42 ---
.../jenkins/v1/config/JenkinsProperties.java | 24 --
.../v1/config/JenkinsRestClientModule.java | 58 ----
.../org/jclouds/jenkins/v1/domain/Computer.java | 150 ----------
.../jclouds/jenkins/v1/domain/ComputerView.java | 184 ------------
.../java/org/jclouds/jenkins/v1/domain/Job.java | 154 ----------
.../jclouds/jenkins/v1/domain/JobDetails.java | 56 ----
.../jclouds/jenkins/v1/domain/LastBuild.java | 286 -------------------
.../org/jclouds/jenkins/v1/domain/Node.java | 163 -----------
.../jenkins/v1/features/ComputerApi.java | 42 ---
.../jenkins/v1/features/ComputerAsyncApi.java | 65 -----
.../org/jclouds/jenkins/v1/features/JobApi.java | 58 ----
.../jenkins/v1/features/JobAsyncApi.java | 118 --------
.../BasicAuthenticationUnlessAnonymous.java | 52 ----
.../v1/handlers/JenkinsErrorHandler.java | 61 ----
.../services/org.jclouds.apis.ApiMetadata | 1 -
.../jenkins/v1/JenkinsApiExpectTest.java | 46 ---
.../jclouds/jenkins/v1/JenkinsApiLiveTest.java | 35 ---
.../jenkins/v1/JenkinsApiMetadataTest.java | 31 --
.../jenkins/v1/JenkinsErrorHandlerTest.java | 89 ------
.../v1/features/ComputerApiExpectTest.java | 65 -----
.../v1/features/ComputerApiLiveTest.java | 46 ---
.../jenkins/v1/features/JobApiExpectTest.java | 160 -----------
.../jenkins/v1/features/JobApiLiveTest.java | 104 -------
...AuthenticationUnlessAnonymousExpectTest.java | 51 ----
.../v1/internal/BaseJenkinsApiExpectTest.java | 26 --
.../v1/internal/BaseJenkinsApiLiveTest.java | 53 ----
.../internal/BaseJenkinsAsyncApiExpectTest.java | 35 ---
.../v1/internal/BaseJenkinsExpectTest.java | 28 --
.../jclouds/jenkins/v1/parse/LastBuildTest.java | 51 ----
.../jenkins/v1/parse/ParseComputerTest.java | 43 ---
.../jenkins/v1/parse/ParseComputerViewTest.java | 58 ----
.../jenkins/v1/parse/ParseJobDetailsTest.java | 44 ---
.../jclouds/jenkins/v1/parse/ParseNodeTest.java | 49 ----
jenkins/src/test/resources/computer.json | 37 ---
jenkins/src/test/resources/computerview.json | 114 --------
jenkins/src/test/resources/job.json | 29 --
jenkins/src/test/resources/lastBuild.json | 127 --------
jenkins/src/test/resources/logback.xml | 38 ---
jenkins/src/test/resources/master.json | 26 --
jenkins/src/test/resources/sample_job.xml | 21 --
.../resources/sample_job_with_parameters.xml | 37 ---
47 files changed, 3317 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/pom.xml
----------------------------------------------------------------------
diff --git a/jenkins/pom.xml b/jenkins/pom.xml
deleted file mode 100644
index feca0b8..0000000
--- a/jenkins/pom.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.jclouds.labs</groupId>
- <artifactId>jclouds-labs</artifactId>
- <version>2.0.0-SNAPSHOT</version>
- </parent>
-
- <!-- TODO: when out of labs, switch to org.jclouds.api -->
- <groupId>org.apache.jclouds.labs</groupId>
- <artifactId>jenkins</artifactId>
- <name>jclouds jenkins api</name>
- <description>jclouds components to access an implementation of Jenkins</description>
- <packaging>bundle</packaging>
-
- <properties>
- <test.jenkins.endpoint>http://localhost:8080</test.jenkins.endpoint>
- <test.jenkins.api-version>1.0</test.jenkins.api-version>
- <test.jenkins.build-version>1.460</test.jenkins.build-version>
- <test.jenkins.identity>ANONYMOUS</test.jenkins.identity>
- <test.jenkins.credential>ANONYMOUS</test.jenkins.credential>
-
- <jclouds.osgi.export>org.jclouds.jenkins.v1*;version="${project.version}"</jclouds.osgi.export>
- <jclouds.osgi.import>
- org.jclouds.rest.internal;version="${project.version}",
- org.jclouds*;version="${project.version}",
- *
- </jclouds.osgi.import>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-core</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-core</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.driver</groupId>
- <artifactId>jclouds-slf4j</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <profiles>
- <profile>
- <id>live</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <executions>
- <execution>
- <id>integration</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <systemPropertyVariables>
- <test.jenkins.endpoint>${test.jenkins.endpoint}</test.jenkins.endpoint>
- <test.jenkins.api-version>${test.jenkins.api-version}</test.jenkins.api-version>
- <test.jenkins.build-version>${test.jenkins.build-version}</test.jenkins.build-version>
- <test.jenkins.identity>${test.jenkins.identity}</test.jenkins.identity>
- <test.jenkins.credential>${test.jenkins.credential}</test.jenkins.credential>
- </systemPropertyVariables>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/main/java/org/jclouds/jenkins/v1/JenkinsApi.java
----------------------------------------------------------------------
diff --git a/jenkins/src/main/java/org/jclouds/jenkins/v1/JenkinsApi.java b/jenkins/src/main/java/org/jclouds/jenkins/v1/JenkinsApi.java
deleted file mode 100644
index 7106129..0000000
--- a/jenkins/src/main/java/org/jclouds/jenkins/v1/JenkinsApi.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1;
-
-import org.jclouds.jenkins.v1.domain.Node;
-import org.jclouds.jenkins.v1.features.ComputerApi;
-import org.jclouds.jenkins.v1.features.JobApi;
-import org.jclouds.rest.annotations.Delegate;
-
-/**
- * Provides synchronous access to Jenkins.
- * <p/>
- *
- * @see JenkinsAsyncApi
- * @see <a href="https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API">api doc</a>
- */
-public interface JenkinsApi {
- /**
- * @return the master computer
- */
- Node getMaster();
-
- /**
- * Provides synchronous access to Computer features.
- */
- @Delegate
- ComputerApi getComputerApi();
-
- /**
- * Provides synchronous access to Job features.
- */
- @Delegate
- JobApi getJobApi();
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/main/java/org/jclouds/jenkins/v1/JenkinsApiMetadata.java
----------------------------------------------------------------------
diff --git a/jenkins/src/main/java/org/jclouds/jenkins/v1/JenkinsApiMetadata.java b/jenkins/src/main/java/org/jclouds/jenkins/v1/JenkinsApiMetadata.java
deleted file mode 100644
index 1b8159f..0000000
--- a/jenkins/src/main/java/org/jclouds/jenkins/v1/JenkinsApiMetadata.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1;
-
-import java.net.URI;
-import java.util.Properties;
-
-import org.jclouds.apis.ApiMetadata;
-import org.jclouds.jenkins.v1.config.JenkinsRestClientModule;
-import org.jclouds.rest.RestContext;
-import org.jclouds.rest.internal.BaseRestApiMetadata;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.common.reflect.TypeToken;
-import com.google.inject.Module;
-
-/**
- * Implementation of {@link ApiMetadata} for Jenkins 1.0 API
- */
-public class JenkinsApiMetadata extends BaseRestApiMetadata {
-
- public static final String ANONYMOUS_IDENTITY = "ANONYMOUS";
-
- public static final TypeToken<RestContext<JenkinsApi, JenkinsAsyncApi>> CONTEXT_TOKEN = new TypeToken<RestContext<JenkinsApi, JenkinsAsyncApi>>() {
- private static final long serialVersionUID = 1L;
- };
-
- @Override
- public Builder toBuilder() {
- return new Builder().fromApiMetadata(this);
- }
-
- public JenkinsApiMetadata() {
- this(new Builder());
- }
-
- protected JenkinsApiMetadata(Builder builder) {
- super(builder);
- }
-
- public static Properties defaultProperties() {
- Properties properties = BaseRestApiMetadata.defaultProperties();
- return properties;
- }
-
- public static class Builder extends BaseRestApiMetadata.Builder<Builder> {
-
- protected Builder() {
- super(JenkinsApi.class, JenkinsAsyncApi.class);
- id("jenkins")
- .name("Jenkins API")
- .identityName("Username (or " + ANONYMOUS_IDENTITY + " if anonymous)")
- .defaultIdentity(ANONYMOUS_IDENTITY)
- .credentialName("Password")
- .defaultCredential(ANONYMOUS_IDENTITY)
- .documentation(URI.create("https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API"))
- .version("1.0")
- .defaultEndpoint("http://localhost:8080")
- .defaultProperties(JenkinsApiMetadata.defaultProperties())
- .defaultModules(ImmutableSet.<Class<? extends Module>>of(JenkinsRestClientModule.class));
- }
-
- @Override
- public JenkinsApiMetadata build() {
- return new JenkinsApiMetadata(this);
- }
-
- @Override
- protected Builder self() {
- return this;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/main/java/org/jclouds/jenkins/v1/JenkinsAsyncApi.java
----------------------------------------------------------------------
diff --git a/jenkins/src/main/java/org/jclouds/jenkins/v1/JenkinsAsyncApi.java b/jenkins/src/main/java/org/jclouds/jenkins/v1/JenkinsAsyncApi.java
deleted file mode 100644
index 3cada12..0000000
--- a/jenkins/src/main/java/org/jclouds/jenkins/v1/JenkinsAsyncApi.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.jenkins.v1.domain.Node;
-import org.jclouds.jenkins.v1.features.ComputerAsyncApi;
-import org.jclouds.jenkins.v1.features.JobAsyncApi;
-import org.jclouds.jenkins.v1.filters.BasicAuthenticationUnlessAnonymous;
-import org.jclouds.rest.annotations.Delegate;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.RequestFilters;
-
-import com.google.common.util.concurrent.ListenableFuture;
-
-/**
- * Provides asynchronous access to Jenkins via their REST API.
- * <p/>
- *
- * @see JenkinsApi
- * @see <a href="https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API">api doc</a>
- */
-@RequestFilters(BasicAuthenticationUnlessAnonymous.class)
-public interface JenkinsAsyncApi {
-
- /**
- * @see JenkinsApi#getMaster
- */
- @Named("GetMaster")
- @GET
- @Path("/api/json")
- @Consumes(MediaType.APPLICATION_JSON)
- @Fallback(NullOnNotFoundOr404.class)
- ListenableFuture<Node> getMaster();
-
- /**
- * Provides asynchronous access to Computer features.
- */
- @Delegate
- ComputerAsyncApi getComputerApi();
-
- /**
- * Provides asynchronous access to Job features.
- */
- @Delegate
- JobAsyncApi getJobApi();
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/main/java/org/jclouds/jenkins/v1/JenkinsFallbacks.java
----------------------------------------------------------------------
diff --git a/jenkins/src/main/java/org/jclouds/jenkins/v1/JenkinsFallbacks.java b/jenkins/src/main/java/org/jclouds/jenkins/v1/JenkinsFallbacks.java
deleted file mode 100644
index f6f8e60..0000000
--- a/jenkins/src/main/java/org/jclouds/jenkins/v1/JenkinsFallbacks.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Predicates.equalTo;
-import static com.google.common.base.Throwables.propagate;
-import static com.google.common.util.concurrent.Futures.immediateFuture;
-import static org.jclouds.http.HttpUtils.returnValueOnCodeOrNull;
-
-import org.jclouds.Fallback;
-
-import com.google.common.base.Predicates;
-import com.google.common.util.concurrent.ListenableFuture;
-
-public final class JenkinsFallbacks {
- private JenkinsFallbacks() {
- }
-
- public static final class VoidOn302Or404 implements Fallback<Void> {
- @Override
- public ListenableFuture<Void> create(Throwable t) throws Exception {
- return immediateFuture(createOrPropagate(t));
- }
-
- @Override
- public Void createOrPropagate(Throwable t) throws Exception {
- Boolean returnVal = returnValueOnCodeOrNull(checkNotNull(t, "throwable"), true,
- Predicates.<Integer> or(equalTo(302), equalTo(404)));
- if (returnVal != null && returnVal)
- return null;
- throw propagate(t);
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/main/java/org/jclouds/jenkins/v1/binders/BindMapToOptionalParams.java
----------------------------------------------------------------------
diff --git a/jenkins/src/main/java/org/jclouds/jenkins/v1/binders/BindMapToOptionalParams.java b/jenkins/src/main/java/org/jclouds/jenkins/v1/binders/BindMapToOptionalParams.java
deleted file mode 100644
index 51e631f..0000000
--- a/jenkins/src/main/java/org/jclouds/jenkins/v1/binders/BindMapToOptionalParams.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1.binders;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Map;
-
-import org.jclouds.http.HttpRequest;
-import org.jclouds.rest.Binder;
-
-import com.google.common.collect.Multimaps;
-
-/**
- * Binds the map to parameters.
- */
-public class BindMapToOptionalParams implements Binder {
-
- @SuppressWarnings("unchecked")
- @Override
- public <R extends HttpRequest> R bindToRequest(R request, Object input) {
- checkArgument(checkNotNull(input, "input") instanceof Map, "this binder is only valid for Maps!");
- Map<String, String> map = (Map<String, String>) input;
- return (R) request.toBuilder().replaceQueryParams(Multimaps.forMap(map)).build();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/main/java/org/jclouds/jenkins/v1/config/JenkinsProperties.java
----------------------------------------------------------------------
diff --git a/jenkins/src/main/java/org/jclouds/jenkins/v1/config/JenkinsProperties.java b/jenkins/src/main/java/org/jclouds/jenkins/v1/config/JenkinsProperties.java
deleted file mode 100644
index 99fb02f..0000000
--- a/jenkins/src/main/java/org/jclouds/jenkins/v1/config/JenkinsProperties.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1.config;
-
-/**
- * Configuration properties and constants used in Jenkins connections.
- */
-public class JenkinsProperties {
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/main/java/org/jclouds/jenkins/v1/config/JenkinsRestClientModule.java
----------------------------------------------------------------------
diff --git a/jenkins/src/main/java/org/jclouds/jenkins/v1/config/JenkinsRestClientModule.java b/jenkins/src/main/java/org/jclouds/jenkins/v1/config/JenkinsRestClientModule.java
deleted file mode 100644
index e1f76c4..0000000
--- a/jenkins/src/main/java/org/jclouds/jenkins/v1/config/JenkinsRestClientModule.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1.config;
-
-import java.util.Map;
-
-import org.jclouds.http.HttpErrorHandler;
-import org.jclouds.http.annotation.ClientError;
-import org.jclouds.http.annotation.Redirection;
-import org.jclouds.http.annotation.ServerError;
-import org.jclouds.jenkins.v1.JenkinsAsyncApi;
-import org.jclouds.jenkins.v1.JenkinsApi;
-import org.jclouds.jenkins.v1.features.ComputerAsyncApi;
-import org.jclouds.jenkins.v1.features.ComputerApi;
-import org.jclouds.jenkins.v1.features.JobAsyncApi;
-import org.jclouds.jenkins.v1.features.JobApi;
-import org.jclouds.jenkins.v1.handlers.JenkinsErrorHandler;
-import org.jclouds.rest.ConfiguresRestClient;
-import org.jclouds.rest.config.RestClientModule;
-
-import com.google.common.collect.ImmutableMap;
-
-/**
- * Configures the Jenkins connection.
- */
-@ConfiguresRestClient
-public class JenkinsRestClientModule extends RestClientModule<JenkinsApi, JenkinsAsyncApi> {
-
- public static final Map<Class<?>, Class<?>> DELEGATE_MAP = ImmutableMap.<Class<?>, Class<?>> builder()
- .put(ComputerApi.class, ComputerAsyncApi.class)
- .put(JobApi.class, JobAsyncApi.class)
- .build();
-
- public JenkinsRestClientModule() {
- super(DELEGATE_MAP);
- }
-
- @Override
- protected void bindErrorHandlers() {
- bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(JenkinsErrorHandler.class);
- bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(JenkinsErrorHandler.class);
- bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(JenkinsErrorHandler.class);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/main/java/org/jclouds/jenkins/v1/domain/Computer.java
----------------------------------------------------------------------
diff --git a/jenkins/src/main/java/org/jclouds/jenkins/v1/domain/Computer.java b/jenkins/src/main/java/org/jclouds/jenkins/v1/domain/Computer.java
deleted file mode 100644
index 66dd922..0000000
--- a/jenkins/src/main/java/org/jclouds/jenkins/v1/domain/Computer.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1.domain;
-
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Objects.toStringHelper;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.MoreObjects.ToStringHelper;
-import com.google.common.base.Objects;
-
-/**
- * @see <a
- * href="http://ci.jruby.org/computer/api/">api
- * doc</a>
- */
-public class Computer implements Comparable<Computer> {
-
- public static Builder builder() {
- return new Builder();
- }
-
- public Builder toBuilder() {
- return builder().fromComputerMetadata(this);
- }
-
- public static class Builder {
- protected String displayName;
- protected boolean idle;
- protected boolean offline;
-
- /**
- * @see Computer#getDisplayName()
- */
- public Builder displayName(String displayName) {
- this.displayName = checkNotNull(displayName, "displayName");
- return this;
- }
-
- /**
- * @see Computer#isIdle()
- */
- public Builder idle(boolean idle) {
- this.idle = idle;
- return this;
- }
-
- /**
- * @see Computer#isOffline()
- */
- public Builder offline(boolean offline) {
- this.offline = offline;
- return this;
- }
-
- public Computer build() {
- return new Computer(displayName, idle, offline);
- }
-
- public Builder fromComputerMetadata(Computer from) {
- return displayName(from.getDisplayName()).idle(from.isIdle()).offline(from.isOffline());
- }
- }
-
- protected final String displayName;
- protected final boolean idle;
- protected final boolean offline;
-
- public Computer(String displayName, boolean idle, boolean offline) {
- this.displayName = checkNotNull(displayName, "displayName");
- this.idle = idle;
- this.offline = offline;
- }
-
- /**
- *
- * @return the displayName of the computer
- */
- public String getDisplayName() {
- return displayName;
- }
-
- /**
- *
- * @return the number of objects in the computer
- */
- public boolean isIdle() {
- return idle;
- }
-
- /**
- * @return the total offline stored in this computer
- */
- public boolean isOffline() {
- return offline;
- }
-
- @Override
- public boolean equals(Object object) {
- if (this == object) {
- return true;
- }
- if (object instanceof Computer) {
- final Computer other = Computer.class.cast(object);
- return equal(getDisplayName(), other.getDisplayName()) && equal(isIdle(), other.isIdle())
- && equal(isOffline(), other.isOffline());
- } else {
- return false;
- }
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(getDisplayName(), isIdle(), isOffline());
- }
-
- @Override
- public String toString() {
- return string().toString();
- }
-
- protected ToStringHelper string() {
- return toStringHelper("").add("displayName", getDisplayName()).add("idle", isIdle()).add("offline", isOffline());
- }
-
- @Override
- public int compareTo(Computer that) {
- if (that == null)
- return 1;
- if (this == that)
- return 0;
- return this.getDisplayName().compareTo(that.getDisplayName());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/main/java/org/jclouds/jenkins/v1/domain/ComputerView.java
----------------------------------------------------------------------
diff --git a/jenkins/src/main/java/org/jclouds/jenkins/v1/domain/ComputerView.java b/jenkins/src/main/java/org/jclouds/jenkins/v1/domain/ComputerView.java
deleted file mode 100644
index 81ff411..0000000
--- a/jenkins/src/main/java/org/jclouds/jenkins/v1/domain/ComputerView.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1.domain;
-
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Objects.toStringHelper;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Set;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.MoreObjects.ToStringHelper;
-import com.google.common.base.Objects;
-import com.google.common.collect.ImmutableSet;
-import com.google.gson.annotations.SerializedName;
-
-/**
- * @see <a
- * href="http://ci.jruby.org/computer/api/">api
- * doc</a>
- */
-public class ComputerView implements Comparable<ComputerView> {
-
- public static Builder builder() {
- return new Builder();
- }
-
- public Builder toBuilder() {
- return builder().fromComputerMetadata(this);
- }
-
- public static class Builder {
- protected String displayName;
- protected int busyExecutors;
- protected int totalExecutors;
- protected Set<Computer> computers = ImmutableSet.of();
-
- /**
- * @see ComputerView#getDisplayName()
- */
- public Builder displayName(String displayName) {
- this.displayName = checkNotNull(displayName, "displayName");
- return this;
- }
-
- /**
- * @see ComputerView#getBusyExecutors()
- */
- public Builder busyExecutors(int busyExecutors) {
- this.busyExecutors = busyExecutors;
- return this;
- }
-
- /**
- * @see ComputerView#getTotalExecutors()
- */
- public Builder totalExecutors(int totalExecutors) {
- this.totalExecutors = totalExecutors;
- return this;
- }
-
- /**
- * @see ComputerView#getLinks()
- */
- public Builder computers(Computer... computers) {
- return computers(ImmutableSet.copyOf(checkNotNull(computers, "computers")));
- }
-
- /**
- * @see ComputerView#getLinks()
- */
- public Builder computers(Set<Computer> computers) {
- this.computers = ImmutableSet.copyOf(checkNotNull(computers, "computers"));
- return this;
- }
-
- public ComputerView build() {
- return new ComputerView(displayName, busyExecutors, totalExecutors, computers);
- }
-
- public Builder fromComputerMetadata(ComputerView from) {
- return displayName(from.getDisplayName()).busyExecutors(from.getBusyExecutors()).totalExecutors(from.getTotalExecutors()).computers(from.getComputers());
- }
- }
-
- protected final String displayName;
- protected final int busyExecutors;
- protected final int totalExecutors;
- @SerializedName("computer")
- protected final Set<Computer> computers;
-
- public ComputerView(String displayName, int busyExecutors, int totalExecutors, Set<Computer> computers) {
- this.displayName = checkNotNull(displayName, "displayName");
- this.busyExecutors = busyExecutors;
- this.totalExecutors = totalExecutors;
- this.computers = ImmutableSet.copyOf(checkNotNull(computers, "computers"));
- }
-
- /**
- *
- * @return the displayName of the computer
- */
- public String getDisplayName() {
- return displayName;
- }
-
- /**
- *
- * @return the number of objects in the computer
- */
- public int getBusyExecutors() {
- return busyExecutors;
- }
-
- /**
- * @return the total totalExecutors stored in this computer
- */
- public int getTotalExecutors() {
- return totalExecutors;
- }
-
- /**
- * @return the computers in this set
- */
- //TODO: create type adapter for gson that understands ForwardingSet so that we can implement the Set interface
- public Set<Computer> getComputers() {
- return computers;
- }
-
- @Override
- public boolean equals(Object object) {
- if (this == object) {
- return true;
- }
- if (object instanceof ComputerView) {
- final ComputerView other = ComputerView.class.cast(object);
- return equal(getDisplayName(), other.getDisplayName()) && equal(getBusyExecutors(), other.getBusyExecutors())
- && equal(getTotalExecutors(), other.getTotalExecutors()) && equal(getComputers(), other.getComputers());
- } else {
- return false;
- }
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(getDisplayName(), getBusyExecutors(), getTotalExecutors(), getComputers());
- }
-
- @Override
- public String toString() {
- return string().toString();
- }
-
- protected ToStringHelper string() {
- return toStringHelper("").add("displayName", getDisplayName()).add("busyExecutors", getBusyExecutors()).add(
- "totalExecutors", getTotalExecutors()).add("computers", getComputers());
- }
-
- @Override
- public int compareTo(ComputerView that) {
- if (that == null)
- return 1;
- if (this == that)
- return 0;
- return this.getDisplayName().compareTo(that.getDisplayName());
- }
-
-
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/main/java/org/jclouds/jenkins/v1/domain/Job.java
----------------------------------------------------------------------
diff --git a/jenkins/src/main/java/org/jclouds/jenkins/v1/domain/Job.java b/jenkins/src/main/java/org/jclouds/jenkins/v1/domain/Job.java
deleted file mode 100644
index d7ef342..0000000
--- a/jenkins/src/main/java/org/jclouds/jenkins/v1/domain/Job.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1.domain;
-
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.net.URI;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.MoreObjects.ToStringHelper;
-import com.google.common.base.Objects;
-
-/**
- * Minimal info about a Job
- */
-public class Job {
-
- public static Builder<?> builder() {
- return new ConcreteBuilder();
- }
-
- public Builder<?> toBuilder() {
- return builder().fromJob(this);
- }
-
- private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
- }
-
- public abstract static class Builder<B extends Builder<B>> {
- private String name;
- private URI url;
- private String color;
-
- @SuppressWarnings("unchecked")
- protected B self() {
- return (B) this;
- }
-
- /**
- * @see Job#getName()
- */
- public B name(String name) {
- this.name = name;
- return self();
- }
-
- /**
- * @see Job#getUrl()
- */
- public B url(URI url) {
- this.url = url;
- return self();
- }
-
- /**
- * @see Job#getColor()
- */
- public B color(String color) {
- this.color = color;
- return self();
- }
-
- public Job build() {
- return new Job(this);
- }
-
- protected B fromJob(Job in) {
- return name(in.getName()).color(in.getColor()).url(in.getUrl());
- }
- }
-
- private final String name;
- private final String color;
- private final URI url;
-
- protected Job(Builder<?> builder) {
- this.name = checkNotNull(builder.name, "name");
- this.color = checkNotNull(builder.color, "color");
- this.url = checkNotNull(builder.url, "url");
- }
-
- /**
- * name of the job
- */
- public String getName() {
- return name;
- }
-
- /**
- *
- * color of the job
- */
- public String getColor() {
- return color;
- }
-
- /**
- *
- * url of the job
- */
- public URI getUrl() {
- return url;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o)
- return true;
- if (o == null || getClass() != o.getClass())
- return false;
- Job that = Job.class.cast(o);
- return equal(this.name, that.name) && equal(this.url, that.url)
- && equal(this.color, that.color);
- }
-
- public boolean clone(Object o) {
- if (this == o)
- return false;
- if (o == null || getClass() != o.getClass())
- return false;
- Job that = Job.class.cast(o);
- return equal(this.color, that.color);
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(name, url, color);
- }
-
- @Override
- public String toString() {
- return string().toString();
- }
-
- protected ToStringHelper string() {
- return MoreObjects.toStringHelper("").add("name", name).add("url", url).add("color",
- color);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/main/java/org/jclouds/jenkins/v1/domain/JobDetails.java
----------------------------------------------------------------------
diff --git a/jenkins/src/main/java/org/jclouds/jenkins/v1/domain/JobDetails.java b/jenkins/src/main/java/org/jclouds/jenkins/v1/domain/JobDetails.java
deleted file mode 100644
index 54a1bf4..0000000
--- a/jenkins/src/main/java/org/jclouds/jenkins/v1/domain/JobDetails.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1.domain;
-
-import com.google.common.base.MoreObjects.ToStringHelper;
-
-public class JobDetails extends Job {
-
- public static Builder<?> builder() {
- return new ConcreteBuilder();
- }
-
- @Override
- public Builder<?> toBuilder() {
- return builder().fromJobDetails(this);
- }
-
- public static class Builder<B extends Builder<B>> extends Job.Builder<B> {
-
- @Override
- public JobDetails build() {
- return new JobDetails(this);
- }
-
- public B fromJobDetails(JobDetails in) {
- return fromJob(in);
- }
- }
-
- private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
- }
-
- protected JobDetails(Builder<?> builder) {
- super(builder);
- }
-
- @Override
- public ToStringHelper string() {
- return super.string(); // .add("field", field);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/main/java/org/jclouds/jenkins/v1/domain/LastBuild.java
----------------------------------------------------------------------
diff --git a/jenkins/src/main/java/org/jclouds/jenkins/v1/domain/LastBuild.java b/jenkins/src/main/java/org/jclouds/jenkins/v1/domain/LastBuild.java
deleted file mode 100644
index f97af6c..0000000
--- a/jenkins/src/main/java/org/jclouds/jenkins/v1/domain/LastBuild.java
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1.domain;
-
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.net.URI;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.MoreObjects.ToStringHelper;
-import com.google.common.base.Objects;
-
-/**
- * Minimal info about a LastBuild
- *
- * GET http://host/job/project/lastBuild/api/json
- */
-public class LastBuild {
-
- public static Builder<?> builder() {
- return new ConcreteBuilder();
- }
-
- public Builder<?> toBuilder() {
- return builder().fromJob(this);
- }
-
- private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
- }
-
- public abstract static class Builder<B extends Builder<B>> {
- private String id;
- private URI url;
- private String description;
- private String building;
- private String duration;
- private String estimatedDuration;
- private String fullDisplayName;
- private String result;
- private String timestamp;
-
- @SuppressWarnings("unchecked")
- protected B self() {
- return (B) this;
- }
-
- /**
- * @see LastBuild#getId()
- */
- public B id(String id) {
- this.id = id;
- return self();
- }
-
- /**
- * @see LastBuild#getUrl()
- */
- public B url(URI url) {
- this.url = url;
- return self();
- }
-
- /**
- * @see LastBuild#getDescription()
- */
- public B description(String description) {
- this.description = description;
- return self();
- }
-
- /**
- * @see LastBuild#getBuilding()
- */
- public B building(String building) {
- this.building = building;
- return self();
- }
-
- /**
- * @see LastBuild#getDuration()
- */
- public B duration(String duration) {
- this.duration = duration;
- return self();
- }
-
- /**
- * @see LastBuild#getEstimatedDuration()
- */
- public B estimatedDuration(String estimatedDuration) {
- this.estimatedDuration = estimatedDuration;
- return self();
- }
-
- /**
- * @see LastBuild#getFullDisplayName()
- */
- public B fullDisplayName(String fullDisplayName) {
- this.fullDisplayName = fullDisplayName;
- return self();
- }
-
- /**
- * @see LastBuild#getResult()
- */
- public B result(String result) {
- this.result = result;
- return self();
- }
-
- /**
- * @see LastBuild#getTimestamp()
- */
- public B timestamp(String timestamp) {
- this.timestamp = timestamp;
- return self();
- }
-
- public LastBuild build() {
- return new LastBuild(this);
- }
-
- protected B fromJob(LastBuild in) {
- return id(in.getId()).url(in.getUrl()).description(in.getDescription()).building(in.getBuilding())
- .duration(in.getDuration()).estimatedDuration(in.getEstimatedDuration())
- .fullDisplayName(in.getFullDisplayName()).result(in.getResult()).timestamp(in.getTimestamp());
- }
- }
-
- private final String id;
- private final URI url;
- private final String description;
- private final String building;
- private final String duration;
- private final String estimatedDuration;
- private final String fullDisplayName;
- private final String result;
- private final String timestamp;
-
- protected LastBuild(Builder<?> builder) {
- this.id = checkNotNull(builder.id, "id");
- this.url = checkNotNull(builder.url, "url");
- this.description = checkNotNull(builder.description, "description");
- this.building = checkNotNull(builder.building, "building");
- this.duration = checkNotNull(builder.duration, "duration");
- this.estimatedDuration = checkNotNull(builder.estimatedDuration, "estimatedDuration");
- this.fullDisplayName = checkNotNull(builder.fullDisplayName, "fullDisplayName");
- this.result = checkNotNull(builder.result, "result");
- this.timestamp = checkNotNull(builder.timestamp, "timestamp");
- }
-
- /**
- * id of the lastBuild
- */
- public String getId() {
- return id;
- }
-
- /**
- *
- * url of the lastBuild
- */
- public URI getUrl() {
- return url;
- }
-
- /**
- *
- * building of the lastBuild
- */
- public String getBuilding() {
- return building;
- }
-
- /**
- *
- * description of the lastBuild
- */
- public String getDescription() {
- return description;
- }
-
- /**
- *
- * duration of the lastBuild
- */
- public String getDuration() {
- return duration;
- }
-
- /**
- *
- * estimated duration of the lastBuild
- */
- public String getEstimatedDuration() {
- return estimatedDuration;
- }
-
- /**
- *
- * full Display Name of the lastBuild
- */
- public String getFullDisplayName() {
- return fullDisplayName;
- }
-
- /**
- *
- * result of the lastBuild
- */
- public String getResult() {
- return result;
- }
-
- /**
- *
- * timestamp of the lastBuild
- */
- public String getTimestamp() {
- return timestamp;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o)
- return true;
- if (o == null || getClass() != o.getClass())
- return false;
- LastBuild that = LastBuild.class.cast(o);
- return equal(this.id, that.id)
- && equal(this.url, that.url)
- && equal(this.building, that.building)
- && equal(this.description, that.description)
- && equal(this.duration, that.duration)
- && equal(this.estimatedDuration, that.estimatedDuration)
- && equal(this.fullDisplayName, that.fullDisplayName)
- && equal(this.result, that.result)
- && equal(this.timestamp, that.timestamp);
- }
-
- public boolean clone(Object o) {
- if (this == o)
- return false;
- if (o == null || getClass() != o.getClass())
- return false;
- LastBuild that = LastBuild.class.cast(o);
- return equal(this.description, that.description);
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(id, url, description, duration, estimatedDuration, fullDisplayName, result, timestamp);
- }
-
- @Override
- public String toString() {
- return string().toString();
- }
-
- protected ToStringHelper string() {
- return MoreObjects.toStringHelper("")
- .add("id", id)
- .add("url", url)
- .add("description", description)
- .add("duration", duration)
- .add("estimatedDuration", estimatedDuration)
- .add("fullDisplayName", fullDisplayName)
- .add("result", result)
- .add("timestamp", timestamp);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/main/java/org/jclouds/jenkins/v1/domain/Node.java
----------------------------------------------------------------------
diff --git a/jenkins/src/main/java/org/jclouds/jenkins/v1/domain/Node.java b/jenkins/src/main/java/org/jclouds/jenkins/v1/domain/Node.java
deleted file mode 100644
index dbb0504..0000000
--- a/jenkins/src/main/java/org/jclouds/jenkins/v1/domain/Node.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1.domain;
-
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Objects.toStringHelper;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Set;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.MoreObjects.ToStringHelper;
-import com.google.common.base.Objects;
-import com.google.common.collect.ImmutableSet;
-import com.google.gson.annotations.SerializedName;
-
-/**
- * @see <a
- * href="http://ci.jruby.org/api/">api
- * doc</a>
- */
-public class Node implements Comparable<Node> {
-
- public static Builder builder() {
- return new Builder();
- }
-
- public Builder toBuilder() {
- return builder().fromNodeMetadata(this);
- }
-
- public static class Builder {
- protected String name;
- protected String description;
- protected Set<Job> jobs = ImmutableSet.of();
-
- /**
- * @see Node#getName()
- */
- public Builder name(String name) {
- this.name = checkNotNull(name, "name");
- return this;
- }
-
- /**
- * @see Node#getDescription()
- */
- public Builder description(String description) {
- this.description = description;
- return this;
- }
-
- /**
- * @see Node#getJobs()
- */
- public Builder jobs(Job... jobs) {
- return jobs(ImmutableSet.copyOf(checkNotNull(jobs, "jobs")));
- }
-
- /**
- * @see Node#getJobs()
- */
- public Builder jobs(Set<Job> jobs) {
- this.jobs = ImmutableSet.copyOf(checkNotNull(jobs, "jobs"));
- return this;
- }
-
- public Node build() {
- return new Node(name, description, jobs);
- }
-
- public Builder fromNodeMetadata(Node from) {
- return name(from.getName()).description(from.getDescription()).jobs(from.getJobs());
- }
- }
-
- @SerializedName("nodeName")
- protected final String name;
- @SerializedName("nodeDescription")
- protected final String description;
- protected final Set<Job> jobs;
-
- public Node(String name, String description, Set<Job> jobs) {
- this.name = checkNotNull(name, "name");
- this.description = description;
- this.jobs = ImmutableSet.copyOf(checkNotNull(jobs, "jobs"));
- }
-
- /**
- *
- * @return the name of the node
- */
- public String getName() {
- return name;
- }
-
- /**
- *
- * @return the description of the node
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * @return the jobs on this node
- */
- public Set<Job> getJobs() {
- return jobs;
- }
-
- @Override
- public boolean equals(Object object) {
- if (this == object) {
- return true;
- }
- if (object instanceof Node) {
- final Node other = Node.class.cast(object);
- return equal(getName(), other.getName()) && equal(getDescription(), other.getDescription())
- && equal(getJobs(), other.getJobs());
- } else {
- return false;
- }
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(getName(), getDescription(), getJobs());
- }
-
- @Override
- public String toString() {
- return string().toString();
- }
-
- protected ToStringHelper string() {
- return toStringHelper("").add("name", getName()).add("description", getDescription()).add("jobs", getJobs());
- }
-
- @Override
- public int compareTo(Node that) {
- if (that == null)
- return 1;
- if (this == that)
- return 0;
- return this.getName().compareTo(that.getName());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/main/java/org/jclouds/jenkins/v1/features/ComputerApi.java
----------------------------------------------------------------------
diff --git a/jenkins/src/main/java/org/jclouds/jenkins/v1/features/ComputerApi.java b/jenkins/src/main/java/org/jclouds/jenkins/v1/features/ComputerApi.java
deleted file mode 100644
index 2eb6ccc..0000000
--- a/jenkins/src/main/java/org/jclouds/jenkins/v1/features/ComputerApi.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1.features;
-
-import org.jclouds.jenkins.v1.domain.Computer;
-import org.jclouds.jenkins.v1.domain.ComputerView;
-
-/**
- * Computer Services
- *
- * @see ComputerAsyncApi
- * @see <a href= "http://ci.jruby.org/computer/api/" >api doc</a>
- */
-public interface ComputerApi {
-
- /**
- * @return overview of all configured computers
- */
- ComputerView getView();
-
- /**
- *
- * @param displayName display name of the computer
- * @return computer or null if not found
- */
- Computer get(String displayName);
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/main/java/org/jclouds/jenkins/v1/features/ComputerAsyncApi.java
----------------------------------------------------------------------
diff --git a/jenkins/src/main/java/org/jclouds/jenkins/v1/features/ComputerAsyncApi.java b/jenkins/src/main/java/org/jclouds/jenkins/v1/features/ComputerAsyncApi.java
deleted file mode 100644
index 75cb243..0000000
--- a/jenkins/src/main/java/org/jclouds/jenkins/v1/features/ComputerAsyncApi.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1.features;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.jenkins.v1.domain.Computer;
-import org.jclouds.jenkins.v1.domain.ComputerView;
-import org.jclouds.jenkins.v1.filters.BasicAuthenticationUnlessAnonymous;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.RequestFilters;
-
-import com.google.common.util.concurrent.ListenableFuture;
-
-/**
- * Computer Services
- *
- * @see ComputerApi
- * @see <a href=
- * "http://ci.jruby.org/computer/api/"
- * >api doc</a>
- */
-@RequestFilters(BasicAuthenticationUnlessAnonymous.class)
-public interface ComputerAsyncApi {
-
- /**
- * @see ComputerApi#getView
- */
- @Named("ListComputers")
- @GET
- @Path("/computer/api/json")
- @Consumes(MediaType.APPLICATION_JSON)
- ListenableFuture<ComputerView> getView();
-
- /**
- * @see ComputerApi#get
- */
- @Named("GetComputer")
- @GET
- @Path("/computer/{displayName}/api/json")
- @Consumes(MediaType.APPLICATION_JSON)
- @Fallback(NullOnNotFoundOr404.class)
- ListenableFuture<Computer> get(@PathParam("displayName") String displayName);
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/main/java/org/jclouds/jenkins/v1/features/JobApi.java
----------------------------------------------------------------------
diff --git a/jenkins/src/main/java/org/jclouds/jenkins/v1/features/JobApi.java b/jenkins/src/main/java/org/jclouds/jenkins/v1/features/JobApi.java
deleted file mode 100644
index 28a537b..0000000
--- a/jenkins/src/main/java/org/jclouds/jenkins/v1/features/JobApi.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1.features;
-
-import java.util.Map;
-import org.jclouds.jenkins.v1.domain.JobDetails;
-import org.jclouds.jenkins.v1.domain.LastBuild;
-
-/**
- * Job Services
- *
- * @see JobAsyncApi
- * @see <a href= "http://ci.jruby.org/computer/api/" >api doc</a>
- */
-public interface JobApi {
-
- /**
- * creates a job, given the payload
- *
- * @param displayName
- * @param xml
- */
- void createFromXML(String displayName, String xml);
-
- JobDetails get(String displayName);
-
- void delete(String displayName);
-
- /**
- * Build a job via API
- *
- * If security is enabled, provide username/password of an account with build permission in the request.
- * Another alternative (but deprecated) is to configure the 'Trigger builds remotely' section in the job configuration.
- *
- * @param displayName
- */
- void build(String displayName);
-
- void buildWithParameters(String displayName, Map<String, String> parameters);
-
- String fetchConfigXML(String displayName);
-
- LastBuild lastBuild(String displayName);
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/main/java/org/jclouds/jenkins/v1/features/JobAsyncApi.java
----------------------------------------------------------------------
diff --git a/jenkins/src/main/java/org/jclouds/jenkins/v1/features/JobAsyncApi.java b/jenkins/src/main/java/org/jclouds/jenkins/v1/features/JobAsyncApi.java
deleted file mode 100644
index 91e4519..0000000
--- a/jenkins/src/main/java/org/jclouds/jenkins/v1/features/JobAsyncApi.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1.features;
-
-import java.util.Map;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.jenkins.v1.JenkinsFallbacks.VoidOn302Or404;
-import org.jclouds.jenkins.v1.binders.BindMapToOptionalParams;
-import org.jclouds.jenkins.v1.domain.JobDetails;
-import org.jclouds.jenkins.v1.domain.LastBuild;
-import org.jclouds.jenkins.v1.filters.BasicAuthenticationUnlessAnonymous;
-import org.jclouds.rest.annotations.BinderParam;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.binders.BindToStringPayload;
-
-import com.google.common.util.concurrent.ListenableFuture;
-
-/**
- * Job Services
- *
- * @see JobApi
- * @see <a href="http://ci.jruby.org/computer/api/">api doc</a>
- */
-@RequestFilters(BasicAuthenticationUnlessAnonymous.class)
-public interface JobAsyncApi {
-
- /**
- * @see JobApi#createFromXML
- */
- @Named("CreateItem")
- @POST
- @Path("/createItem")
- @Produces(MediaType.TEXT_XML)
- ListenableFuture<Void> createFromXML(@QueryParam("name") String displayName, @BinderParam(BindToStringPayload.class) String xml);
-
- /**
- * @see JobApi#get
- */
- @Named("GetJob")
- @GET
- @Path("/job/{displayName}/api/json")
- @Consumes(MediaType.APPLICATION_JSON)
- @Fallback(NullOnNotFoundOr404.class)
- ListenableFuture<JobDetails> get(@PathParam("displayName") String displayName);
-
- /**
- * @see JobApi#delete
- */
- @Named("DeleteJob")
- @POST
- @Path("/job/{displayName}/doDelete")
- @Fallback(VoidOn302Or404.class)
- ListenableFuture<Void> delete(@PathParam("displayName") String displayName);
-
- /**
- * @see JobApi#buildJob
- */
- @Named("Build")
- @POST
- @Path("/job/{displayName}/build")
- @Fallback(NullOnNotFoundOr404.class)
- ListenableFuture<Void> build(@PathParam("displayName") String displayName);
-
- /**
- * @see JobApi#buildJobWithParameters
- */
- @Named("BuildWithParameters")
- @POST
- @Path("/job/{displayName}/buildWithParameters")
- @Fallback(NullOnNotFoundOr404.class)
- ListenableFuture<Void> buildWithParameters(@PathParam("displayName") String displayName,
- @BinderParam(BindMapToOptionalParams.class) Map<String, String> parameters);
-
- /**
- * @see JobApi#fetchConfigXML
- */
- @Named("GetConfigXML")
- @GET
- @Path("/job/{displayName}/config.xml")
- @Fallback(NullOnNotFoundOr404.class)
- ListenableFuture<String> fetchConfigXML(@PathParam("displayName") String displayName);
-
- /**
- * @see JobApi#lastBuild
- */
- @Named("GetLastBuild")
- @GET
- @Path("/job/{displayName}/lastBuild/api/json")
- @Consumes(MediaType.APPLICATION_JSON)
- @Fallback(NullOnNotFoundOr404.class)
- ListenableFuture<LastBuild> lastBuild(@PathParam("displayName") String displayName);
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/main/java/org/jclouds/jenkins/v1/filters/BasicAuthenticationUnlessAnonymous.java
----------------------------------------------------------------------
diff --git a/jenkins/src/main/java/org/jclouds/jenkins/v1/filters/BasicAuthenticationUnlessAnonymous.java b/jenkins/src/main/java/org/jclouds/jenkins/v1/filters/BasicAuthenticationUnlessAnonymous.java
deleted file mode 100644
index d767b97..0000000
--- a/jenkins/src/main/java/org/jclouds/jenkins/v1/filters/BasicAuthenticationUnlessAnonymous.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1.filters;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static org.jclouds.jenkins.v1.JenkinsApiMetadata.ANONYMOUS_IDENTITY;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.domain.Credentials;
-import org.jclouds.http.HttpException;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpRequestFilter;
-import org.jclouds.http.filters.BasicAuthentication;
-import org.jclouds.location.Provider;
-
-import com.google.common.base.Supplier;
-
-@Singleton
-public class BasicAuthenticationUnlessAnonymous implements HttpRequestFilter {
-
- private final Supplier<Credentials> creds;
- private final BasicAuthentication auth;
-
- @Inject
- public BasicAuthenticationUnlessAnonymous(@Provider Supplier<Credentials> creds, BasicAuthentication auth) {
- this.creds = checkNotNull(creds, "creds");
- this.auth = checkNotNull(auth, "auth");
- }
-
- @Override
- public HttpRequest filter(HttpRequest request) throws HttpException {
- if (ANONYMOUS_IDENTITY.equals(checkNotNull(creds.get().identity, "user")))
- return request;
- return auth.filter(request);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/main/java/org/jclouds/jenkins/v1/handlers/JenkinsErrorHandler.java
----------------------------------------------------------------------
diff --git a/jenkins/src/main/java/org/jclouds/jenkins/v1/handlers/JenkinsErrorHandler.java b/jenkins/src/main/java/org/jclouds/jenkins/v1/handlers/JenkinsErrorHandler.java
deleted file mode 100644
index 27e2a23..0000000
--- a/jenkins/src/main/java/org/jclouds/jenkins/v1/handlers/JenkinsErrorHandler.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1.handlers;
-
-import static org.jclouds.http.HttpUtils.closeClientButKeepContentStream;
-
-import javax.inject.Singleton;
-
-import org.jclouds.http.HttpCommand;
-import org.jclouds.http.HttpErrorHandler;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.HttpResponseException;
-import org.jclouds.rest.AuthorizationException;
-import org.jclouds.rest.ResourceNotFoundException;
-
-/**
- * This will parse and set an appropriate exception on the command object.
- */
-// TODO: is there error spec someplace? let's type errors, etc.
-@Singleton
-public class JenkinsErrorHandler implements HttpErrorHandler {
-
- public void handleError(HttpCommand command, HttpResponse response) {
- // it is important to always read fully and close streams
- byte[] data = closeClientButKeepContentStream(response);
- String message = data != null ? new String(data) : null;
-
- Exception exception = message != null ? new HttpResponseException(command, response, message)
- : new HttpResponseException(command, response);
- message = message != null ? message : String.format("%s -> %s", command.getCurrentRequest().getRequestLine(),
- response.getStatusLine());
- switch (response.getStatusCode()) {
- case 400:
- break;
- case 401:
- case 403:
- exception = new AuthorizationException(message, exception);
- break;
- case 404:
- if (!command.getCurrentRequest().getMethod().equals("DELETE")) {
- exception = new ResourceNotFoundException(message, exception);
- }
- break;
- }
- command.setException(exception);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata
----------------------------------------------------------------------
diff --git a/jenkins/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata b/jenkins/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata
deleted file mode 100644
index c80a7f3..0000000
--- a/jenkins/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata
+++ /dev/null
@@ -1 +0,0 @@
-org.jclouds.jenkins.v1.JenkinsApiMetadata
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/test/java/org/jclouds/jenkins/v1/JenkinsApiExpectTest.java
----------------------------------------------------------------------
diff --git a/jenkins/src/test/java/org/jclouds/jenkins/v1/JenkinsApiExpectTest.java b/jenkins/src/test/java/org/jclouds/jenkins/v1/JenkinsApiExpectTest.java
deleted file mode 100644
index bc95e9d..0000000
--- a/jenkins/src/test/java/org/jclouds/jenkins/v1/JenkinsApiExpectTest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1;
-
-import static org.testng.Assert.assertEquals;
-
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.jenkins.v1.internal.BaseJenkinsApiExpectTest;
-import org.jclouds.jenkins.v1.parse.ParseNodeTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "JenkinsApiExpectTest")
-public class JenkinsApiExpectTest extends BaseJenkinsApiExpectTest {
-
- public void testGetMasterWhenResponseIs2xx() {
- HttpRequest getMaster = HttpRequest
- .builder()
- .method("GET")
- .endpoint("http://localhost:8080/api/json")
- .addHeader("Accept", "application/json")
- .addHeader("Authorization", "Basic aWRlbnRpdHk6Y3JlZGVudGlhbA==").build();
-
- HttpResponse getMasterResponse = HttpResponse.builder().statusCode(200)
- .payload(payloadFromResource("/master.json")).build();
-
- JenkinsApi apiWhenMasterExists = requestSendsResponse(getMaster, getMasterResponse);
-
- assertEquals(apiWhenMasterExists.getMaster().toString(),
- new ParseNodeTest().expected().toString());
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/test/java/org/jclouds/jenkins/v1/JenkinsApiLiveTest.java
----------------------------------------------------------------------
diff --git a/jenkins/src/test/java/org/jclouds/jenkins/v1/JenkinsApiLiveTest.java b/jenkins/src/test/java/org/jclouds/jenkins/v1/JenkinsApiLiveTest.java
deleted file mode 100644
index 2906475..0000000
--- a/jenkins/src/test/java/org/jclouds/jenkins/v1/JenkinsApiLiveTest.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1;
-
-import static org.testng.Assert.assertNotNull;
-
-import org.jclouds.jenkins.v1.domain.Node;
-import org.jclouds.jenkins.v1.internal.BaseJenkinsApiLiveTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "live", testName = "JenkinsApiLiveTest")
-public class JenkinsApiLiveTest extends BaseJenkinsApiLiveTest {
-
- public void testGetMaster(){
- Node master = context.getApi().getMaster();
- assertNotNull(master);
- assertNotNull(master.getName());
- assertNotNull(master.getJobs());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/test/java/org/jclouds/jenkins/v1/JenkinsApiMetadataTest.java
----------------------------------------------------------------------
diff --git a/jenkins/src/test/java/org/jclouds/jenkins/v1/JenkinsApiMetadataTest.java b/jenkins/src/test/java/org/jclouds/jenkins/v1/JenkinsApiMetadataTest.java
deleted file mode 100644
index f13c839..0000000
--- a/jenkins/src/test/java/org/jclouds/jenkins/v1/JenkinsApiMetadataTest.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1;
-
-import org.jclouds.View;
-import org.jclouds.apis.internal.BaseApiMetadataTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.common.reflect.TypeToken;
-
-@Test(groups = "unit", testName = "JenkinsApiMetadataTest")
-public class JenkinsApiMetadataTest extends BaseApiMetadataTest {
- public JenkinsApiMetadataTest() {
- super(new JenkinsApiMetadata(), ImmutableSet.<TypeToken<? extends View>> of());
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/test/java/org/jclouds/jenkins/v1/JenkinsErrorHandlerTest.java
----------------------------------------------------------------------
diff --git a/jenkins/src/test/java/org/jclouds/jenkins/v1/JenkinsErrorHandlerTest.java b/jenkins/src/test/java/org/jclouds/jenkins/v1/JenkinsErrorHandlerTest.java
deleted file mode 100644
index 0a7f70f..0000000
--- a/jenkins/src/test/java/org/jclouds/jenkins/v1/JenkinsErrorHandlerTest.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1;
-
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.reportMatcher;
-import static org.easymock.EasyMock.verify;
-
-import java.net.URI;
-
-import org.easymock.IArgumentMatcher;
-import org.jclouds.http.HttpCommand;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.jenkins.v1.handlers.JenkinsErrorHandler;
-import org.jclouds.rest.ResourceNotFoundException;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "JenkinsErrorHandlerTest")
-public class JenkinsErrorHandlerTest {
-
- @Test
- public void test404WithHTMLDoesntBustParserAndMakesResourceNotFoundException() {
- assertCodeMakes("GET", URI
- .create("http://ci.jruby.org/computer/master/api/json"),
- 404, "Not Found", "<html></html>", ResourceNotFoundException.class);
- }
-
- private void assertCodeMakes(String method, URI uri, int statusCode, String message, String content,
- Class<? extends Exception> expected) {
- assertCodeMakes(method, uri, statusCode, message, "text/plain", content, expected);
- }
-
- private void assertCodeMakes(String method, URI uri, int statusCode, String message, String contentType,
- String content, Class<? extends Exception> expected) {
-
- JenkinsErrorHandler function = new JenkinsErrorHandler();
-
- HttpCommand command = createMock(HttpCommand.class);
- HttpRequest request = HttpRequest.builder().method(method).endpoint(uri).build();
- HttpResponse response = HttpResponse.builder().statusCode(statusCode).message(message).payload(content).build();
- response.getPayload().getContentMetadata().setContentType(contentType);
-
- expect(command.getCurrentRequest()).andReturn(request).atLeastOnce();
- command.setException(classEq(expected));
-
- replay(command);
-
- function.handleError(command, response);
-
- verify(command);
- }
-
- public static Exception classEq(final Class<? extends Exception> in) {
- reportMatcher(new IArgumentMatcher() {
-
- @Override
- public void appendTo(StringBuffer buffer) {
- buffer.append("classEq(");
- buffer.append(in);
- buffer.append(")");
- }
-
- @Override
- public boolean matches(Object arg) {
- return arg.getClass() == in;
- }
-
- });
- return null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac22366f/jenkins/src/test/java/org/jclouds/jenkins/v1/features/ComputerApiExpectTest.java
----------------------------------------------------------------------
diff --git a/jenkins/src/test/java/org/jclouds/jenkins/v1/features/ComputerApiExpectTest.java b/jenkins/src/test/java/org/jclouds/jenkins/v1/features/ComputerApiExpectTest.java
deleted file mode 100644
index d581d4a..0000000
--- a/jenkins/src/test/java/org/jclouds/jenkins/v1/features/ComputerApiExpectTest.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.jenkins.v1.features;
-
-import static org.testng.Assert.assertEquals;
-
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.jenkins.v1.JenkinsApi;
-import org.jclouds.jenkins.v1.internal.BaseJenkinsApiExpectTest;
-import org.jclouds.jenkins.v1.parse.ParseComputerTest;
-import org.jclouds.jenkins.v1.parse.ParseComputerViewTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "ComputerApiExpectTest")
-public class ComputerApiExpectTest extends BaseJenkinsApiExpectTest {
-
- public void testGetComputerViewWhenResponseIs2xx() {
- HttpRequest getComputerView = HttpRequest
- .builder()
- .method("GET")
- .endpoint("http://localhost:8080/computer/api/json")
- .addHeader("Accept", "application/json")
- .addHeader("Authorization", "Basic aWRlbnRpdHk6Y3JlZGVudGlhbA==").build();
-
- HttpResponse getComputerViewResponse = HttpResponse.builder().statusCode(200)
- .payload(payloadFromResource("/computerview.json")).build();
-
- JenkinsApi apiWhenServersExist = requestSendsResponse(getComputerView, getComputerViewResponse);
-
- assertEquals(apiWhenServersExist.getComputerApi().getView().toString(),
- new ParseComputerViewTest().expected().toString());
- }
-
- public void testGetComputerWhenResponseIs2xx() {
- HttpRequest getComputer = HttpRequest
- .builder()
- .method("GET")
- .endpoint("http://localhost:8080/computer/Ruboto/api/json")
- .addHeader("Accept", "application/json")
- .addHeader("Authorization", "Basic aWRlbnRpdHk6Y3JlZGVudGlhbA==").build();
-
- HttpResponse getComputerResponse = HttpResponse.builder().statusCode(200)
- .payload(payloadFromResource("/computer.json")).build();
-
- JenkinsApi apiWhenServersExist = requestSendsResponse(getComputer, getComputerResponse);
-
- assertEquals(apiWhenServersExist.getComputerApi().get("Ruboto").toString(),
- new ParseComputerTest().expected().toString());
- }
-}