From f214912215027ffcb21653d4f6529f45c4f01bd6 Mon Sep 17 00:00:00 2001 From: Vincent Behar Date: Mon, 1 Aug 2011 19:56:32 +0200 Subject: [PATCH 01/13] prepare release 2.0 --- src/changes/changes.xml | 2 +- src/site/confluence/groovy.confluence | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 1336d15..f70e1aa 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -22,7 +22,7 @@ Vincent Behar - + Token-based authentication diff --git a/src/site/confluence/groovy.confluence b/src/site/confluence/groovy.confluence index 7cda443..e9b81a6 100644 --- a/src/site/confluence/groovy.confluence +++ b/src/site/confluence/groovy.confluence @@ -11,7 +11,7 @@ Save the following script in a file named "{{rundeck.groovy}}", and execute it w {code} // we use Grape (Ivy) to download the lib (and its dependencies) from Maven Central Repository -@Grab(group='org.rundeck', module='rundeck-api-java-client', version='1.2') +@Grab(group='org.rundeck', module='rundeck-api-java-client', version='2.0') import org.rundeck.api.RundeckClient rundeck = new RundeckClient("http://localhost:4440", "admin", "admin") From db23cfa6da279007228738370899113eb86f3ceb Mon Sep 17 00:00:00 2001 From: Vincent Behar Date: Mon, 1 Aug 2011 20:01:49 +0200 Subject: [PATCH 02/13] [maven-release-plugin] prepare release rundeck-api-java-client-2.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index aadc26a..03e30c3 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ org.rundeck rundeck-api-java-client - 2.0-SNAPSHOT + 2.0 jar RunDeck API - Java Client Java client for the RunDeck REST API From c9607a0a19cba11964c57752bc83f266df3eb536 Mon Sep 17 00:00:00 2001 From: Vincent Behar Date: Mon, 1 Aug 2011 20:01:57 +0200 Subject: [PATCH 03/13] [maven-release-plugin] prepare for next development iteration --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 03e30c3..78d6d1e 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ org.rundeck rundeck-api-java-client - 2.0 + 2.1-SNAPSHOT jar RunDeck API - Java Client Java client for the RunDeck REST API From 088bf1329b41c232651bab335226c8f716bf9092 Mon Sep 17 00:00:00 2001 From: Vincent Behar Date: Tue, 2 Aug 2011 23:46:28 +0200 Subject: [PATCH 04/13] upgrade version of the release plugin --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 78d6d1e..2d8cb6c 100644 --- a/pom.xml +++ b/pom.xml @@ -100,7 +100,7 @@ 2.3 2.5 2.4 - 2.2 + 2.2.1 2.5 2.3 From 60a7bf58b330c8cf693e18badd97ccc4fe9926aa Mon Sep 17 00:00:00 2001 From: Vincent Behar Date: Wed, 3 Aug 2011 21:55:40 +0200 Subject: [PATCH 05/13] use google's doclava for generating javadoc (better looking look and feel, with search capabilities) --- pom.xml | 23 ++++++++++++++++--- .../java/org/rundeck/api/RundeckClient.java | 2 +- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 2d8cb6c..c7b6191 100644 --- a/pom.xml +++ b/pom.xml @@ -308,9 +308,26 @@ maven-javadoc-plugin ${plugin.javadoc.version} - - http://download.oracle.com/javase/6/docs/api/ - + + com.google.doclava + doclava + 1.0.3 + + com.google.doclava.Doclava + + ${sun.boot.class.path} + + -quiet + -federate JDK http://download.oracle.com/javase/6/docs/api/index.html? + -federationxml JDK http://doclava.googlecode.com/svn/static/api/openjdk-6.xml + -hdf project.name "${project.name}" + -d . + -hide 101 + -proofread ./proof-read.txt + + false + + -J-Xmx1024m diff --git a/src/main/java/org/rundeck/api/RundeckClient.java b/src/main/java/org/rundeck/api/RundeckClient.java index ec919de..35041f0 100644 --- a/src/main/java/org/rundeck/api/RundeckClient.java +++ b/src/main/java/org/rundeck/api/RundeckClient.java @@ -61,7 +61,7 @@ import org.rundeck.api.util.ParametersUtil; *
* Usage :
* - *
+ * 
  * // using login-based authentication :
  * RundeckClient rundeck = new RundeckClient("http://localhost:4440", "admin", "admin");
  * // or for a token-based authentication :

From ef9c03d4b8061eab86512cada8833e06950bbfa8 Mon Sep 17 00:00:00 2001
From: Vincent Behar 
Date: Wed, 3 Aug 2011 22:10:23 +0200
Subject: [PATCH 06/13] fix links to the RundeckClient javadoc (changed after
 the migration to doclava)

---
 src/site/confluence/groovy.confluence | 2 +-
 src/site/confluence/index.confluence  | 2 +-
 src/site/confluence/jruby.confluence  | 2 +-
 src/site/confluence/jython.confluence | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/site/confluence/groovy.confluence b/src/site/confluence/groovy.confluence
index e9b81a6..6dc06e5 100644
--- a/src/site/confluence/groovy.confluence
+++ b/src/site/confluence/groovy.confluence
@@ -124,5 +124,5 @@ println "${result.succeededJobs.size} jobs successfully imported, ${result.skipp
 
 h2. And more...
 
-See the API documentation of the [RundeckClient|./apidocs/org/rundeck/api/RundeckClient.html] class for more interactions with your RunDeck instance...
+See the API documentation of the [RundeckClient|./apidocs/reference/org/rundeck/api/RundeckClient.html] class for more interactions with your RunDeck instance...
 
diff --git a/src/site/confluence/index.confluence b/src/site/confluence/index.confluence
index 702dc90..5e3eda1 100644
--- a/src/site/confluence/index.confluence
+++ b/src/site/confluence/index.confluence
@@ -16,7 +16,7 @@ h2. What can I do with it ?
 
 h2. Where can I get more information ?
 
-* You can read the [API documentation|./apidocs/index.html], starting with the [RundeckClient|./apidocs/org/rundeck/api/RundeckClient.html] class.
+* You can read the [API documentation|./apidocs/index.html], starting with the [RundeckClient|./apidocs/reference/org/rundeck/api/RundeckClient.html] class.
 * Or you can "Use the [Source|./source-repository.html], Luke !"
 * Read more on the Maven auto-generated pages : [project information|./project-info.html] and [project reports|./project-reports.html].
 
diff --git a/src/site/confluence/jruby.confluence b/src/site/confluence/jruby.confluence
index 99f1cf4..cedb4ae 100644
--- a/src/site/confluence/jruby.confluence
+++ b/src/site/confluence/jruby.confluence
@@ -132,5 +132,5 @@ puts "#{result.succeededJobs.size} jobs successfully imported, #{result.skippedJ
 
 h2. And more...
 
-See the API documentation of the [RundeckClient|./apidocs/org/rundeck/api/RundeckClient.html] class for more interactions with your RunDeck instance...
+See the API documentation of the [RundeckClient|./apidocs/reference/org/rundeck/api/RundeckClient.html] class for more interactions with your RunDeck instance...
 
diff --git a/src/site/confluence/jython.confluence b/src/site/confluence/jython.confluence
index ebafcce..b2dbc94 100644
--- a/src/site/confluence/jython.confluence
+++ b/src/site/confluence/jython.confluence
@@ -116,5 +116,5 @@ print("%s jobs successfully imported, %s jobs skipped, and %s jobs failed" % (re
 
 h2. And more...
 
-See the API documentation of the [RundeckClient|./apidocs/org/rundeck/api/RundeckClient.html] class for more interactions with your RunDeck instance...
+See the API documentation of the [RundeckClient|./apidocs/reference/org/rundeck/api/RundeckClient.html] class for more interactions with your RunDeck instance...
 

From d7e415d08fc4711a739bd620899a69f1257d54af Mon Sep 17 00:00:00 2001
From: Vincent Behar 
Date: Wed, 3 Aug 2011 22:41:16 +0200
Subject: [PATCH 07/13] upgrade version of the site plugin

---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index c7b6191..7cc80db 100644
--- a/pom.xml
+++ b/pom.xml
@@ -465,7 +465,7 @@
         
       
       
-        3.0-beta-3
+        3.0
       
       
         

From 15683eda2a3185b9c7ad357f468755b0c4d11a86 Mon Sep 17 00:00:00 2001
From: Vincent Behar 
Date: Sun, 18 Sep 2011 18:14:08 +0200
Subject: [PATCH 08/13] use betamax to unit-test HTTP requests without a live
 RunDeck instance

---
 pom.xml                                       | 16 +++++-
 .../org/rundeck/api/RundeckClientTest.java    | 55 +++++++++++++++++++
 src/test/resources/betamax.properties         |  4 ++
 .../resources/betamax/tapes/get_projects.yaml | 20 +++++++
 4 files changed, 93 insertions(+), 2 deletions(-)
 create mode 100644 src/test/java/org/rundeck/api/RundeckClientTest.java
 create mode 100644 src/test/resources/betamax.properties
 create mode 100644 src/test/resources/betamax/tapes/get_projects.yaml

diff --git a/pom.xml b/pom.xml
index 7cc80db..ee14ddf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -416,12 +416,12 @@
     
       org.apache.httpcomponents
       httpclient
-      4.1.1
+      4.1.2
     
     
       org.apache.httpcomponents
       httpmime
-      4.1.1
+      4.1.2
     
     
     
@@ -452,6 +452,18 @@
       4.8.2
       test
     
+    
+      com.github.robfletcher
+      betamax
+      1.0
+      test
+    
+    
+      org.codehaus.groovy
+      groovy-all
+      1.7.10
+      test
+    
   
 
   
diff --git a/src/test/java/org/rundeck/api/RundeckClientTest.java b/src/test/java/org/rundeck/api/RundeckClientTest.java
new file mode 100644
index 0000000..19081ba
--- /dev/null
+++ b/src/test/java/org/rundeck/api/RundeckClientTest.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2011 Vincent Behar
+ *
+ * Licensed 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.rundeck.api;
+
+import java.util.List;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.rundeck.api.domain.RundeckProject;
+import betamax.Betamax;
+import betamax.Recorder;
+
+/**
+ * Test the {@link RundeckClient}. Uses betamax to unit-test HTTP requests without a live RunDeck instance.
+ * 
+ * @author Vincent Behar
+ */
+public class RundeckClientTest {
+
+    @Rule
+    public Recorder recorder = new Recorder();
+
+    private RundeckClient client;
+
+    @Test
+    @Betamax(tape = "get_projects")
+    public void getProjects() throws Exception {
+        List projects = client.getProjects();
+        Assert.assertEquals(1, projects.size());
+        Assert.assertEquals("test", projects.get(0).getName());
+        Assert.assertNull(projects.get(0).getDescription());
+    }
+
+    @Before
+    public void setUp() throws Exception {
+        // not that you can put whatever here, because we don't actually connect to the RunDeck instance
+        // but instead use betamax as a proxy to serve the previously recorded tapes (in src/test/resources)
+        client = new RundeckClient("http://rundeck.local:4440", "PVnN5K3OPc5vduS3uVuVnEsD57pDC5pd");
+    }
+
+}
diff --git a/src/test/resources/betamax.properties b/src/test/resources/betamax.properties
new file mode 100644
index 0000000..e212574
--- /dev/null
+++ b/src/test/resources/betamax.properties
@@ -0,0 +1,4 @@
+betamax.tapeRoot=src/test/resources/betamax/tapes
+betamax.proxyPort=1337
+betamax.proxyTimeout=5000
+betamax.defaultMode=READ_ONLY
\ No newline at end of file
diff --git a/src/test/resources/betamax/tapes/get_projects.yaml b/src/test/resources/betamax/tapes/get_projects.yaml
new file mode 100644
index 0000000..e07efd6
--- /dev/null
+++ b/src/test/resources/betamax/tapes/get_projects.yaml
@@ -0,0 +1,20 @@
+!tape
+name: get_projects
+interactions:
+- recorded: 2011-09-18T16:04:45.973Z
+  request:
+    method: GET
+    uri: http://rundeck.local:4440/api/2/projects
+    headers:
+      Host: rundeck.local:4440
+      Proxy-Connection: Keep-Alive
+      User-Agent: RunDeck API Java Client 2
+      X-RunDeck-Auth-Token: PVnN5K3OPc5vduS3uVuVnEsD57pDC5pd
+  response:
+    status: 200
+    headers:
+      Content-Type: text/xml; charset=utf-8
+      Expires: Thu, 01 Jan 1970 00:00:00 GMT
+      Server: Jetty(6.1.21)
+      Set-Cookie: JSESSIONID=mxrbh6byhvxt;Path=/
+    body: test

From 8f35f8ef5eefa500bbbe05adb741eef7f8c10393 Mon Sep 17 00:00:00 2001
From: Vincent Behar 
Date: Sat, 15 Oct 2011 17:54:49 +0200
Subject: [PATCH 09/13] test maven-fluido-skin

---
 pom.xml           | 15 +++++++++++++++
 src/site/site.xml |  5 +++++
 2 files changed, 20 insertions(+)

diff --git a/pom.xml b/pom.xml
index 7cc80db..d642288 100644
--- a/pom.xml
+++ b/pom.xml
@@ -486,5 +486,20 @@
     
   
 
+  
+  
+    
+      apache.snapshots
+      Apache Snapshots
+      https://repository.apache.org/content/repositories/snapshots/
+      
+        false
+      
+      
+        true
+      
+    
+  
+
 
 
diff --git a/src/site/site.xml b/src/site/site.xml
index 1526382..7453336 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -21,6 +21,11 @@
   UA-23435653-1
   
   
+  
+    org.apache.maven.skins
+    maven-fluido-skin
+    1.0-SNAPSHOT
+  
   
     
       

From 12f9be31f83c344a08f9a6cb3abececcb36d7ac0 Mon Sep 17 00:00:00 2001
From: Vincent Behar 
Date: Sat, 3 Dec 2011 15:39:02 +0100
Subject: [PATCH 10/13] upgrade maven fluido skin -> 1.0

---
 pom.xml           | 15 ---------------
 src/site/site.xml |  2 +-
 2 files changed, 1 insertion(+), 16 deletions(-)

diff --git a/pom.xml b/pom.xml
index d642288..7cc80db 100644
--- a/pom.xml
+++ b/pom.xml
@@ -486,20 +486,5 @@
     
   
 
-  
-  
-    
-      apache.snapshots
-      Apache Snapshots
-      https://repository.apache.org/content/repositories/snapshots/
-      
-        false
-      
-      
-        true
-      
-    
-  
-
 
 
diff --git a/src/site/site.xml b/src/site/site.xml
index 7453336..83bea9e 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -24,7 +24,7 @@
   
     org.apache.maven.skins
     maven-fluido-skin
-    1.0-SNAPSHOT
+    1.0
   
   
     

From 36348e3c5f6a10751b38239bb6e61e2a240984bf Mon Sep 17 00:00:00 2001
From: Vincent Behar 
Date: Sat, 3 Dec 2011 16:20:27 +0100
Subject: [PATCH 11/13] update a few maven plugins

---
 pom.xml | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/pom.xml b/pom.xml
index 7cc80db..145f50c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -81,31 +81,31 @@
     UTF-8
 
     
-    1.6
-    2.2.1
+    1.7
+    2.2.2
     2.6
-    2.6
+    2.8
     2.4.1
     2.3.2
     2.3
-    2.6
+    2.7
     2.8
     1.0.1
     2.3.2
-    1.3
+    1.4
     2.1.1
     2.3.1
-    2.3.1
+    2.3.2
     2.8
     2.3
-    2.5
+    2.6
     2.4
     2.2.1
     2.5
     
     2.3
     2.1.2
-    2.9
+    2.10
     2.4
     1.2
   

From 6695c10ee760baa600c2f5c9af68d47c7d917499 Mon Sep 17 00:00:00 2001
From: Vincent Behar 
Date: Sat, 3 Dec 2011 16:33:47 +0100
Subject: [PATCH 12/13] update maven site plugin -> 3.0

---
 pom.xml | 35 +----------------------------------
 1 file changed, 1 insertion(+), 34 deletions(-)

diff --git a/pom.xml b/pom.xml
index 145f50c..7240946 100644
--- a/pom.xml
+++ b/pom.xml
@@ -102,8 +102,7 @@
     2.4
     2.2.1
     2.5
-    
-    2.3
+    3.0
     2.1.2
     2.10
     2.4
@@ -454,37 +453,5 @@
     
   
 
-  
-    
-      
-      maven-3
-      
-        
-          
-          ${basedir}
-        
-      
-      
-        3.0
-      
-      
-        
-          
-            org.apache.maven.plugins
-            maven-site-plugin
-            
-              
-                attach-descriptor
-                
-                  attach-descriptor
-                
-              
-            
-          
-        
-      
-    
-  
-
 
 

From 2206d677247431280a262ccbdfc9d3f4b2e4065a Mon Sep 17 00:00:00 2001
From: Vincent Behar 
Date: Sat, 3 Dec 2011 17:13:30 +0100
Subject: [PATCH 13/13] update a few dependencies

---
 pom.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index d37fd73..decf4cf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -431,7 +431,7 @@
     
       commons-io
       commons-io
-      2.0.1
+      2.1
     
     
     
@@ -448,7 +448,7 @@
     
       junit
       junit
-      4.8.2
+      4.10
       test
     
     
@@ -460,7 +460,7 @@
     
       org.codehaus.groovy
       groovy-all
-      1.7.10
+      1.8.4
       test