continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r537842 - in /maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client: pom.xml src/main/java/org/apache/maven/continuum/xmlrpc/continuum/SampleClient.java
Date Mon, 14 May 2007 13:50:33 GMT
Author: evenisse
Date: Mon May 14 06:50:32 2007
New Revision: 537842

URL: http://svn.apache.org/viewvc?view=rev&rev=537842
Log:
o Add exec plugin
o Build the project added by the sample client

Modified:
    maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/pom.xml
    maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/continuum/SampleClient.java

Modified: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/pom.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/pom.xml?view=diff&rev=537842&r1=537841&r2=537842
==============================================================================
--- maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/pom.xml (original)
+++ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/pom.xml Mon May 14 06:50:32
2007
@@ -39,4 +39,27 @@
       <version>3.0</version>
     </dependency>
   </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>exec-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <goals>
+              <goal>java</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <mainClass>org.apache.maven.continuum.xmlrpc.continuum.SampleClient</mainClass>
+          <arguments>
+            <argument>http://localhost:9090/xmlrpc</argument>
+            <argument>${continuum.username}</argument>
+            <argument>${continuum.password}</argument>
+          </arguments>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
 </project>

Modified: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/continuum/SampleClient.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/continuum/SampleClient.java?view=diff&rev=537842&r1=537841&r2=537842
==============================================================================
--- maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/continuum/SampleClient.java
(original)
+++ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/continuum/SampleClient.java
Mon May 14 06:50:32 2007
@@ -17,8 +17,7 @@
     public static void main( String[] args )
         throws Exception
     {
-        ContinuumXmlRpcClient client =
-            new ContinuumXmlRpcClient( new URL( "http://localhost:9090/xmlrpc" ), "admin",
"admin1" );
+        ContinuumXmlRpcClient client = new ContinuumXmlRpcClient( new URL( args[0] ), args[1],
args[2] );
 
         System.out.println( "Adding project..." );
         AddingResult result = client.addMavenTwoProject( "http://svn.codehaus.org/plexus/plexus-utils/trunk/pom.xml"
);
@@ -48,39 +47,63 @@
             printProjectSummary( client.getProjectSummary( p.getId() ) );
         }
 
+        System.out.println();
+
+        System.out.println( "Waiting the end of the check out..." );
+
         ProjectSummary ps = (ProjectSummary) result.getProjects().get( 0 );
 
-        for ( int i = 0; i < 30; i++ )
+        while ( !"New".equals( client.getProjectStatusAsString( ps.getState() ) ) )
         {
-            ProjectSummary p = client.refreshProjectSummary( ps );
-            System.out.println(
-                "State of " + p.getName() + "(" + p.getId() + "): " + client.getProjectStatusAsString(
p.getState() ) );
+            ps = client.refreshProjectSummary( ps );
+            System.out.println( "State of " + ps.getName() + "(" + ps.getId() + "): " +
+                client.getProjectStatusAsString( ps.getState() ) );
             Thread.sleep( 1000 );
         }
 
         System.out.println();
 
+        System.out.println( "Add the project to the build queue." );
+        client.buildProject( ps.getId() );
+        while ( !"Building".equals( client.getProjectStatusAsString( ps.getState() ) ) )
+        {
+            ps = client.refreshProjectSummary( ps );
+            Thread.sleep( 1000 );
+        }
+
+        System.out.println( "Building..." );
+        String state = "unknown";
+        while ( "Building".equals( client.getProjectStatusAsString( ps.getState() ) ) )
+        {
+            ps = client.refreshProjectSummary( ps );
+            state = client.getProjectStatusAsString( ps.getState() );
+            System.out.println( "State of " + ps.getName() + "(" + ps.getId() + "): " + state
);
+            Thread.sleep( 1000 );
+        }
+        System.out.println( "Build done with state=" + state + "." );
+
+        System.out.println();
+
         System.out.println( "Projects list." );
         System.out.println( "=====================" );
         List projects = client.getProjects();
         for ( Iterator i = projects.iterator(); i.hasNext(); )
         {
-            ProjectSummary p = (ProjectSummary) i.next();
-            printProjectSummary( p );
+            ps = (ProjectSummary) i.next();
+            printProjectSummary( ps );
             System.out.println();
         }
 
-        Thread.sleep( 60000 );
-
         System.out.println();
 
         System.out.println( "Remove all projects." );
         System.out.println( "=====================" );
         for ( Iterator i = projects.iterator(); i.hasNext(); )
         {
-            ProjectSummary p = (ProjectSummary) i.next();
-            System.out.println( "Remove '" + p.getName() + "' - " + p.getVersion() + " ("
+ p.getId() + ")" );
-            client.removeProject( p.getId() );
+            ps = (ProjectSummary) i.next();
+            System.out.println( "Removing '" + ps.getName() + "' - " + ps.getVersion() +
" (" + ps.getId() + ")..." );
+            client.removeProject( ps.getId() );
+            System.out.println( "Done." );
         }
     }
 



Mime
View raw message