deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "" <>
Subject Re: jboss tools deltacloud java client contributions
Date Tue, 24 May 2011 16:04:34 GMT
On 23/05/11 16:13, André Dietisheim wrote:
> Hi guys
> I just finished cleaning my Deltacloud java client code and pushed
> things to my DC fork on github.
> I added 2 java projects ( &
> to the java folder in clients/.
> I'd greatly appreciate if anybody could have a look at it and verify
> that I added things in the way you'd have expected it (since I'm not
> much git experienced so far).
> As soon as the code is moved over to your repo, we'll remove the client
> from our repo and include a jar'ed version of it in our tooling.
> Cheers
> André

ACK from me - some notes (some of this might be of use to anyone else 
who'd like to test):

*** slight issue with (I am guessing) the unmarshalling of the instance 
actions. From some_instance.toString() I get something like:

Instance:	i-4bf52625
Owner:		297467797945
Image:		ami-f51aff9c
Realm:		us-east-1d
Profile:		m1.small

*** junit test suites are green:

   ==> running ec2 driver:
     --> java org.junit.runner.JUnitCore
JUnit version 4.6
Time: 0.504

OK (22 tests)

   ==> running mock driver:
     -->  java org.junit.runner.JUnitCore
Time: 200.531

OK (31 tests)

*** needs documentation! (i guess this is something we can add later). 
It wasn't clear how to use the client - in particular I wasn't sure how 
to invoke actions (like Instance.start/stop etc)

*** A simple test class (pretty small so I copy/paste) - forgive the 
noobiness of my java - its been a while!:

import* ;
import java.util.* ;
public class TestClient
   public static void main(String [] args)
       String user = args[0];
       String pass = args[1];
       DeltaCloudClient the_client = new 
DeltaCloudClientImpl("http://localhost:3001", user, pass) ;
       List images = the_client.listImages();
       System.out.println("A total of " + images.size() + " images was 
       ListIterator litr = images.listIterator() ;
       while (litr.hasNext())
           System.out.println( ;
       API.Driver the_driver = the_client.getServerType();
       System.out.println("Current server driver is " + 
       List instances = the_client.listInstances();
       System.out.println(instances.size() + " instances returned");
       ListIterator inst_litr = instances.listIterator();
       Instance current;
         current = (Instance);
//      current.stop(the_client)
//      current.destroy(the_client);
       //create instance
       //Instance my_server = the_client.createInstance("ami-f51aff9c");

     catch (Exception dcce)
       dcce.printStackTrace() ;

*** we need to wait for michal since he is admin of the github repo 
before we push. For the record and as David said, the github repo is 
just a mirror of the (git) svn repo @ apache. An alternative way of 
contributing (but I stress, github is perfectly acceptable):

<initialise the local repo>:
  mkdir deltacloud; cd deltacloud; git svn init -s;  git svn fetch 
--log-window-size 10000

<make a branch for your changes>:
git branch -b my_branch

<make lots of changes, add files, etc. Now commit the changes>
git commit -a

<see what changes you've made>
git status

<check which branch you're on>
git branch

<fetch any new items from master and rebase your code before sending a 
git checkout master; git svn rebase; git rebase master my_branch

<make a patch>
git format-patch -o /some/directory/for/your/patches

<send the patch>
git send-email --compose --subject 'subject' --thread 
/some/directory/for/your/patches/* --to


View raw message