continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dand...@apache.org
Subject svn commit: r210057 - in /maven/continuum/trunk/continuum-xfire: ./ src/main/java/org/apache/maven/continuum/xfire/ src/main/resources/org/apache/maven/continuum/xfire/ src/test/java/org/apache/maven/continuum/xfire/
Date Sun, 10 Jul 2005 23:56:53 GMT
Author: dandiep
Date: Sun Jul 10 16:56:51 2005
New Revision: 210057

URL: http://svn.apache.org/viewcvs?rev=210057&view=rev
Log:
o Switch to fixed XFire POMS
o Added addMavenOneProject/addMavenTwoProject operations
o More tests

Modified:
    maven/continuum/trunk/continuum-xfire/pom.xml
    maven/continuum/trunk/continuum-xfire/src/main/java/org/apache/maven/continuum/xfire/ContinuumWebService.java
    maven/continuum/trunk/continuum-xfire/src/main/java/org/apache/maven/continuum/xfire/DelegatingContinuumWebService.java
    maven/continuum/trunk/continuum-xfire/src/main/resources/org/apache/maven/continuum/xfire/ContinuumWebService.aegis.xml
    maven/continuum/trunk/continuum-xfire/src/test/java/org/apache/maven/continuum/xfire/ClientTest.java
    maven/continuum/trunk/continuum-xfire/src/test/java/org/apache/maven/continuum/xfire/ContinuumXFireTest.java

Modified: maven/continuum/trunk/continuum-xfire/pom.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-xfire/pom.xml?rev=210057&r1=210056&r2=210057&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-xfire/pom.xml (original)
+++ maven/continuum/trunk/continuum-xfire/pom.xml Sun Jul 10 16:56:51 2005
@@ -27,27 +27,27 @@
     <dependency>
       <groupId>org.codehaus.xfire</groupId>
       <artifactId>xfire-annotations</artifactId>
-      <version>1.0-20050708.185435-12</version>
+      <version>1.0-20050710.171837-13</version>
     </dependency>
     <dependency>
       <groupId>org.codehaus.xfire</groupId>
       <artifactId>xfire-core</artifactId>
-      <version>1.0-20050708.185435-12</version>
+      <version>1.0-20050710.171837-13</version>
     </dependency>
     <dependency>
       <groupId>org.codehaus.xfire</groupId>
       <artifactId>xfire-aegis</artifactId>
-      <version>1.0-20050708.185435-12</version>
+      <version>1.0-20050710.171837-13</version>
     </dependency>
     <dependency>
       <groupId>org.codehaus.xfire</groupId>
-      <artifactId>xfire-plexus</artifactId>
-      <version>1.0-20050708.185435-12</version>
-      <exclusions>
-        <exclusion>
-          <groupId>org.codehaus.xfire</groupId>
-          <artifactId>xfire-xmpp</artifactId>
-        </exclusion>
+      <artifactId>xfire-plexus</artifactId>
+      <version>1.0-20050710.171837-13</version>
+      <exclusions>
+        <exclusion>
+          <groupId>org.codehaus.xfire</groupId>
+          <artifactId>xfire-xmpp</artifactId>
+        </exclusion>
       </exclusions>
     </dependency>
   </dependencies>

Modified: maven/continuum/trunk/continuum-xfire/src/main/java/org/apache/maven/continuum/xfire/ContinuumWebService.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-xfire/src/main/java/org/apache/maven/continuum/xfire/ContinuumWebService.java?rev=210057&r1=210056&r2=210057&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-xfire/src/main/java/org/apache/maven/continuum/xfire/ContinuumWebService.java
(original)
+++ maven/continuum/trunk/continuum-xfire/src/main/java/org/apache/maven/continuum/xfire/ContinuumWebService.java
Sun Jul 10 16:56:51 2005
@@ -22,7 +22,7 @@
 import org.codehaus.xfire.annotations.commons.*;
 
 /**
- * @@WebService(name = "Continuum", targetNamespace = "http://continuum.maven.apache.org")
+ * @@WebService(name = "Continuum", targetNamespace = "http://continuum.maven.apache.org/")
  */
 public interface ContinuumWebService
 {
@@ -41,6 +41,20 @@
      */ 
     void updateProject(Project projectInfo) throws XFireFault;
     
+    /**
+     * @@WebMethod()
+     * @@.project WebParam("MetadataUrl")
+     * @@.return WebResult("Projects")
+     */ 
+    Collection addMavenTwoProject(String scmUrl) throws XFireFault;
+    
+    /**
+     * @@WebMethod()
+     * @@.project WebParam("MetadataUrl")
+     * @@.return WebResult("Projects")
+     */ 
+    Collection addMavenOneProject(String scmUrl) throws XFireFault;
+
     /**
      * @@WebMethod()
      * @@.project WebParam("Project")

Modified: maven/continuum/trunk/continuum-xfire/src/main/java/org/apache/maven/continuum/xfire/DelegatingContinuumWebService.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-xfire/src/main/java/org/apache/maven/continuum/xfire/DelegatingContinuumWebService.java?rev=210057&r1=210056&r2=210057&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-xfire/src/main/java/org/apache/maven/continuum/xfire/DelegatingContinuumWebService.java
(original)
+++ maven/continuum/trunk/continuum-xfire/src/main/java/org/apache/maven/continuum/xfire/DelegatingContinuumWebService.java
Sun Jul 10 16:56:51 2005
@@ -29,6 +29,7 @@
 import org.apache.maven.continuum.project.MavenOneProject;
 import org.apache.maven.continuum.project.MavenTwoProject;
 import org.apache.maven.continuum.project.ShellProject;
+import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
 import org.apache.maven.continuum.scm.ScmFile;
 import org.codehaus.xfire.fault.XFireFault;
 
@@ -57,21 +58,13 @@
         {
             if (projectInfo.getType().equals("maven-one"))
             {
-                MavenOneProject project = new MavenOneProject();
-                project.setGoals(projectInfo.getGoals());
-                
-                convertToLocal(projectInfo, project);
-
-                return continuum.addMavenOneProject(project);
+                throw new XFireFault("Use the 'addMavenOneProject' operation to add maven
one projects.",
+                                     XFireFault.SENDER);
             }
             else if (projectInfo.getType().equals("maven-two"))
             {
-                MavenTwoProject project = new MavenTwoProject();
-                project.setGoals(projectInfo.getGoals());
-                
-                convertToLocal(projectInfo, project);
-                
-                return continuum.addMavenTwoProject(project);
+                throw new XFireFault("Use the 'addMavenTwoProject' operation to add maven
one projects.",
+                                     XFireFault.SENDER);
             }
             else if (projectInfo.getType().equals("shell"))
             {
@@ -101,7 +94,9 @@
         }
         catch (Throwable e)
         {
-            e.printStackTrace();
+            if (e instanceof XFireFault)
+                throw (XFireFault) e;
+            
             throw new XFireFault(e);
         }
     }
@@ -253,15 +248,12 @@
     private Project createProjectInfo(ContinuumProject project)
         throws XFireFault
     {
-        Project projectInfo = new Project();
-        projectInfo.setId(project.getId());
-        
-        convertToProjectInfo(project, projectInfo);
+        Project projectInfo = convertToRemote(project);
         
         return projectInfo;
     }
     
-    private void convertToProjectInfo(ContinuumProject project, Project projectInfo)
+    private void convertToRemote(ContinuumProject project, Project projectInfo)
         throws XFireFault
     {
         if (project instanceof MavenOneProject)
@@ -361,5 +353,71 @@
         {
             throw new XFireFault(e);
         }
+    }
+
+    public Collection addMavenTwoProject(String url)
+        throws XFireFault
+    {
+        try
+        {
+            ContinuumProjectBuildingResult result = continuum.addMavenTwoProject(url);
+            
+            if (result.getWarnings().size() > 0)
+            {
+                throw new XFireFault(result.getWarnings().toString(), XFireFault.SENDER);
+            }
+            
+            List projects = new ArrayList();
+            
+            for (Iterator itr = result.getProjects().iterator(); itr.hasNext();)
+            {
+                ContinuumProject project = (ContinuumProject) itr.next();
+
+                projects.add(convertToRemote(project));
+            }
+            return projects;
+        }
+        catch (ContinuumException e)
+        {
+            throw new XFireFault(e);
+        }
+    }
+
+    public Collection addMavenOneProject(String url)
+        throws XFireFault
+    {
+        try
+        {
+            ContinuumProjectBuildingResult result = continuum.addMavenOneProject(url);
+            
+            if (result.getWarnings().size() > 0)
+            {
+                throw new XFireFault(result.getWarnings().toString(), XFireFault.SENDER);
+            }
+            
+            List projects = new ArrayList();
+            
+            for (Iterator itr = result.getProjects().iterator(); itr.hasNext();)
+            {
+                ContinuumProject project = (ContinuumProject) itr.next();
+
+                projects.add(convertToRemote(project));
+            }
+            return projects;
+        }
+        catch (ContinuumException e)
+        {
+            throw new XFireFault(e);
+        }
+    }
+
+    private Project convertToRemote(ContinuumProject project)
+        throws XFireFault
+    {
+        Project remote = new Project();
+        remote.setId(project.getId());
+        
+        convertToRemote(project, remote);
+        return remote;
     }
 }

Modified: maven/continuum/trunk/continuum-xfire/src/main/resources/org/apache/maven/continuum/xfire/ContinuumWebService.aegis.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-xfire/src/main/resources/org/apache/maven/continuum/xfire/ContinuumWebService.aegis.xml?rev=210057&r1=210056&r2=210057&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-xfire/src/main/resources/org/apache/maven/continuum/xfire/ContinuumWebService.aegis.xml
(original)
+++ maven/continuum/trunk/continuum-xfire/src/main/resources/org/apache/maven/continuum/xfire/ContinuumWebService.aegis.xml
Sun Jul 10 16:56:51 2005
@@ -1,10 +1,16 @@
-<mappings xmlns:c="http://continuum.maven.apache.org">
+<mappings xmlns:c="http://continuum.maven.apache.org/">
   <mapping>
     <method name="getBuilds">
       <return-type componentType="org.apache.maven.continuum.xfire.Build"/>
     </method>
     <method name="getProjects">
       <return-type componentType="org.apache.maven.continuum.xfire.Project"/>
+    </method>
+    <method name="addMavenOneProject">
+      <return-type componentType="org.apache.maven.continuum.xfire.Project"/>
+    </method>
+    <method name="addMavenTwoProject">
+      <return-type componentType="org.apache.maven.continuum.xfire.Project"/>
     </method>
   </mapping>
 </mappings>

Modified: maven/continuum/trunk/continuum-xfire/src/test/java/org/apache/maven/continuum/xfire/ClientTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-xfire/src/test/java/org/apache/maven/continuum/xfire/ClientTest.java?rev=210057&r1=210056&r2=210057&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-xfire/src/test/java/org/apache/maven/continuum/xfire/ClientTest.java
(original)
+++ maven/continuum/trunk/continuum-xfire/src/test/java/org/apache/maven/continuum/xfire/ClientTest.java
Sun Jul 10 16:56:51 2005
@@ -16,18 +16,7 @@
  * limitations under the License.
  */
 
-import org.apache.maven.continuum.project.ContinuumProject;
-import org.codehaus.xfire.client.XFireProxyFactory;
-import org.codehaus.xfire.fault.XFireFault;
 import org.codehaus.xfire.plexus.PlexusXFireTest;
-import org.codehaus.xfire.plexus.config.ConfigurationService;
-import org.codehaus.xfire.service.Service;
-import org.codehaus.xfire.service.ServiceRegistry;
-import org.codehaus.xfire.soap.SoapConstants;
-import org.codehaus.xfire.transport.Channel;
-import org.codehaus.xfire.transport.local.LocalTransport;
-import org.codehaus.xfire.wsdl.WSDLWriter;
-import org.codehaus.yom.Document;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@@ -39,6 +28,8 @@
     public void testService() throws Exception
     {
         ContinuumWebService service = 
-            ContinuumClientFactory.createClient("http://localhost/continuum/service/Continuum");
+            ContinuumClientFactory.createClient("http://localhost:8080/continuum/services/Continuum");
+        
+        // service.getProjects();
     }
 }

Modified: maven/continuum/trunk/continuum-xfire/src/test/java/org/apache/maven/continuum/xfire/ContinuumXFireTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-xfire/src/test/java/org/apache/maven/continuum/xfire/ContinuumXFireTest.java?rev=210057&r1=210056&r2=210057&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-xfire/src/test/java/org/apache/maven/continuum/xfire/ContinuumXFireTest.java
(original)
+++ maven/continuum/trunk/continuum-xfire/src/test/java/org/apache/maven/continuum/xfire/ContinuumXFireTest.java
Sun Jul 10 16:56:51 2005
@@ -83,6 +83,12 @@
         catch (XFireFault fault)
         {
         }
+        
+        String url = getTestFile( "../continuum-test-projects/m2/pom.xml" ).toURL().toExternalForm();
+        Collection projects = ws.addMavenTwoProject(url);
+        assertEquals(1, projects.size());
+        Project m2 = (Project) projects.iterator().next();
+        assertNotNull(m2.getId());
     }
     
     public void testWSDL()



Mime
View raw message