tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From meer...@apache.org
Subject svn commit: r451644 - in /incubator/tuscany/java/sca/services/maven/src: main/java/org/apache/tuscany/services/maven/ test/java/org/apache/tuscany/services/maven/
Date Sat, 30 Sep 2006 19:27:27 GMT
Author: meerajk
Date: Sat Sep 30 12:27:27 2006
New Revision: 451644

URL: http://svn.apache.org/viewvc?view=rev&rev=451644
Log:
Removed redundant code.

Modified:
    incubator/tuscany/java/sca/services/maven/src/main/java/org/apache/tuscany/services/maven/MavenArtifactRepository.java
    incubator/tuscany/java/sca/services/maven/src/main/java/org/apache/tuscany/services/maven/MavenHelper.java
    incubator/tuscany/java/sca/services/maven/src/test/java/org/apache/tuscany/services/maven/MavenArtifactRepositoryTest.java

Modified: incubator/tuscany/java/sca/services/maven/src/main/java/org/apache/tuscany/services/maven/MavenArtifactRepository.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/maven/src/main/java/org/apache/tuscany/services/maven/MavenArtifactRepository.java?view=diff&rev=451644&r1=451643&r2=451644
==============================================================================
--- incubator/tuscany/java/sca/services/maven/src/main/java/org/apache/tuscany/services/maven/MavenArtifactRepository.java
(original)
+++ incubator/tuscany/java/sca/services/maven/src/main/java/org/apache/tuscany/services/maven/MavenArtifactRepository.java
Sat Sep 30 12:27:27 2006
@@ -6,15 +6,15 @@
  * 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.    
+ * under the License.
  */
 package org.apache.tuscany.services.maven;
 
@@ -23,17 +23,17 @@
 import org.apache.tuscany.spi.annotation.Autowire;
 import org.apache.tuscany.spi.services.artifact.Artifact;
 import org.apache.tuscany.spi.services.artifact.ArtifactRepository;
-import org.apache.tuscany.spi.services.info.RuntimeInfo;
+import org.apache.tuscany.host.RuntimeInfo;
 import org.osoa.sca.annotations.Destroy;
 import org.osoa.sca.annotations.Property;
 
 /**
  * Artifact repository used for resolving artifacts.
- * 
+ *
  * This is used by the composite loader for resolving artifacts transitively. The repository
uses the Maven API for resolving dependencies and hence
  * expects the artifacts to be stored in a structure similar to the Maven repository layout.
The repository first looks within the deployed unit (WAR
  * for example), before resorting to a local and set of remote Maven repositories.
- * 
+ *
  * @version $Rev$ $Date$
  */
 public class MavenArtifactRepository implements ArtifactRepository {
@@ -54,7 +54,7 @@
     /**
      * Resolve an artifact. This ensures that the information associated with an artifact
is fully populated; Specifically, after this operation the
      * URL should contain a location where the artifact can be obtained.
-     * 
+     *
      * @param artifact
      *            the artifact to be resolved
      */
@@ -64,7 +64,7 @@
 
     /**
      * Resolve a collection of Artifacts.
-     * 
+     *
      * @param artifacts
      *            a collection of artifacts to be resolved
      * @see #resolve(Artifact)
@@ -77,7 +77,7 @@
 
     /**
      * Destroy method.
-     * 
+     *
      */
     @Destroy
     public void destroy() {

Modified: incubator/tuscany/java/sca/services/maven/src/main/java/org/apache/tuscany/services/maven/MavenHelper.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/maven/src/main/java/org/apache/tuscany/services/maven/MavenHelper.java?view=diff&rev=451644&r1=451643&r2=451644
==============================================================================
--- incubator/tuscany/java/sca/services/maven/src/main/java/org/apache/tuscany/services/maven/MavenHelper.java
(original)
+++ incubator/tuscany/java/sca/services/maven/src/main/java/org/apache/tuscany/services/maven/MavenHelper.java
Sat Sep 30 12:27:27 2006
@@ -114,7 +114,7 @@
             metadataSource = (ArtifactMetadataSource) embedder.lookup(ArtifactMetadataSource.ROLE);
             artifactFactory = (ArtifactFactory) embedder.lookup(ArtifactFactory.ROLE);
             artifactResolver = (ArtifactResolver) embedder.lookup(ArtifactResolver.ROLE);
-
+            
             setUpRepositories(embedder);
 
             embedder.stop();
@@ -152,6 +152,7 @@
                 rootArtifact.getVersion(), org.apache.maven.artifact.Artifact.SCOPE_RUNTIME,
rootArtifact.getType());
 
         try {
+            
             if (resolve(mavenRootArtifact, Collections.EMPTY_LIST, deployedRepository)) {
                 rootArtifact.setUrl(mavenRootArtifact.getFile().toURL());
                 resolveDependencies(rootArtifact, mavenRootArtifact, true);
@@ -233,7 +234,7 @@
 
             if (resolvedFromDeployment) {
                 resolutionGroup = metadataSource.retrieve(mavenRootArtifact, deployedRepository,
Collections.EMPTY_LIST);
-                result = artifactResolver.resolveTransitively(resolutionGroup.getArtifacts(),
mavenRootArtifact, remoteRepositories, localRepository,
+                result = artifactResolver.resolveTransitively(resolutionGroup.getArtifacts(),
mavenRootArtifact, Collections.EMPTY_LIST, deployedRepository,
                         metadataSource);
             } else {
                 resolutionGroup = metadataSource.retrieve(mavenRootArtifact, localRepository,
remoteRepositories);

Modified: incubator/tuscany/java/sca/services/maven/src/test/java/org/apache/tuscany/services/maven/MavenArtifactRepositoryTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/maven/src/test/java/org/apache/tuscany/services/maven/MavenArtifactRepositoryTest.java?view=diff&rev=451644&r1=451643&r2=451644
==============================================================================
--- incubator/tuscany/java/sca/services/maven/src/test/java/org/apache/tuscany/services/maven/MavenArtifactRepositoryTest.java
(original)
+++ incubator/tuscany/java/sca/services/maven/src/test/java/org/apache/tuscany/services/maven/MavenArtifactRepositoryTest.java
Sat Sep 30 12:27:27 2006
@@ -6,15 +6,15 @@
  * 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.    
+ * under the License.
  */
 package org.apache.tuscany.services.maven;
 
@@ -23,13 +23,13 @@
 import java.util.Set;
 
 import org.apache.tuscany.spi.services.artifact.Artifact;
-import org.apache.tuscany.spi.services.info.RuntimeInfo;
+import org.apache.tuscany.host.RuntimeInfo;
 
 import junit.framework.TestCase;
 
 /**
  * @version $Rev$ $Date$
- * 
+ *
  */
 public class MavenArtifactRepositoryTest extends TestCase {
 
@@ -50,8 +50,6 @@
      */
     public void testResolveArtifact() throws Exception {
 
-        // Test uses the local maven repo as the deployed repo
-        // TODO Need a more realistic test
         final URL BASE_URL = new File(System.getProperty("user.home") + File.separator +
".m2").toURL();
         String[] remoteRepoUrls = { "http://repo1.maven.org/maven2/" };
         MavenArtifactRepository repository = new MavenArtifactRepository(remoteRepoUrls,
new RuntimeInfo() {
@@ -68,7 +66,7 @@
         repository.resolve(artifact);
 
         Set<URL> urls = artifact.getUrls();
-        
+
         assertEquals(2, urls.size());
 
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message