ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maart...@apache.org
Subject svn commit: r953111 - in /ant/ivy/core/trunk: ./ src/java/org/apache/ivy/core/cache/ src/java/org/apache/ivy/core/settings/ src/java/org/apache/ivy/plugins/parser/ src/java/org/apache/ivy/plugins/parser/m2/ src/java/org/apache/ivy/plugins/parser/xml/ s...
Date Wed, 09 Jun 2010 18:40:35 GMT
Author: maartenc
Date: Wed Jun  9 18:40:35 2010
New Revision: 953111

URL: http://svn.apache.org/viewvc?rev=953111&view=rev
Log:
FIX: Namespace rules not properly applied to parent projects (IVY-1186)

Added:
    ant/ivy/core/trunk/test/repositories/parentPom/ivysettings-namespace.xml   (with props)
Modified:
    ant/ivy/core/trunk/CHANGES.txt
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/ParserSettingsMonitor.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParser.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ParserSettings.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResolver.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/RepositoryResolver.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=953111&r1=953110&r2=953111&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Wed Jun  9 18:40:35 2010
@@ -126,6 +126,7 @@ for detailed view of each issue, please 
 - IMPROVEMENT: Trace a message when a property file referenced from the settings doesn't
exixts (IVY-1074)
 - IMPROVEMENT: use defaultconf in combination with defaultconfmapping (IVY-1135) (thanks
to Jon Schneider)
 
+- FIX: Namespace rules not properly applied to parent projects (IVY-1186)
 - FIX: LatestVersionMatcher.needModuleDescriptor() does not honor custom statuses (IVY-1170)
(thanks to Carl Quinn)
 - FIX: Proxy authentication could fail when using commons-httpclient 
 - FIX: Packager resolver always extracts all files from archives even when the packaging
instructions contains include tags (IVY-1179) (thanks to Stefan De Boey)

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java?rev=953111&r1=953110&r2=953111&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java
Wed Jun  9 18:40:35 2010
@@ -52,6 +52,7 @@ import org.apache.ivy.plugins.repository
 import org.apache.ivy.plugins.repository.Resource;
 import org.apache.ivy.plugins.repository.ResourceDownloader;
 import org.apache.ivy.plugins.repository.ResourceHelper;
+import org.apache.ivy.plugins.resolver.AbstractResolver;
 import org.apache.ivy.plugins.resolver.DependencyResolver;
 import org.apache.ivy.plugins.resolver.util.ResolvedResource;
 import org.apache.ivy.util.Checks;
@@ -646,14 +647,16 @@ public class DefaultRepositoryCacheManag
     private class MyModuleDescriptorProvider implements ModuleDescriptorProvider {
         
         private final ModuleDescriptorParser mdParser;
+        private final ParserSettings settings;
 
-        public MyModuleDescriptorProvider(ModuleDescriptorParser mdParser) {
-            this.mdParser = mdParser;            
+        public MyModuleDescriptorProvider(ModuleDescriptorParser mdParser, ParserSettings
settings) {
+            this.mdParser = mdParser;
+            this.settings = settings;
         }
         
         public ModuleDescriptor provideModule(ParserSettings ivySettings, 
                 File descriptorURL, boolean validate) throws ParseException, IOException
{
-            return mdParser.parseDescriptor(ivySettings, descriptorURL.toURI().toURL(), validate);
+            return mdParser.parseDescriptor(settings, descriptorURL.toURI().toURL(), validate);
         }
     }
     
@@ -661,15 +664,15 @@ public class DefaultRepositoryCacheManag
             CacheMetadataOptions options, File ivyFile) 
             throws ParseException, IOException {
         ModuleDescriptorMemoryCache cache = getMemoryCache();
-        ModuleDescriptorProvider mdProvider = new MyModuleDescriptorProvider(mdParser); 
+        ModuleDescriptorProvider mdProvider = new MyModuleDescriptorProvider(mdParser, settings);

         return cache.get(ivyFile, settings, options.isValidate(), mdProvider);
     }
 
     private ModuleDescriptor getStaledMd(ModuleDescriptorParser mdParser, 
-            CacheMetadataOptions options, File ivyFile) 
+            CacheMetadataOptions options, File ivyFile, ParserSettings parserSettings) 
             throws ParseException, IOException {
         ModuleDescriptorMemoryCache cache = getMemoryCache();
-        ModuleDescriptorProvider mdProvider = new MyModuleDescriptorProvider(mdParser); 
+        ModuleDescriptorProvider mdProvider = new MyModuleDescriptorProvider(mdParser, parserSettings);

         return cache.getStale(ivyFile, settings, options.isValidate(), mdProvider);
     }
 
@@ -983,7 +986,11 @@ public class DefaultRepositoryCacheManag
             try {
                 ModuleDescriptorParser parser = ModuleDescriptorParserRegistry
                         .getInstance().getParser(mdRef.getResource());
-                ModuleDescriptor md = getStaledMd(parser, options, report.getLocalFile());

+                ParserSettings parserSettings = settings;
+                if (resolver instanceof AbstractResolver) {
+                    parserSettings = ((AbstractResolver) resolver).getParserSettings();
+                }
+                ModuleDescriptor md = getStaledMd(parser, options, report.getLocalFile(),
parserSettings); 
                 if (md == null) {
                     throw new IllegalStateException(
                         "module descriptor parser returned a null module descriptor, " 

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/ParserSettingsMonitor.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/ParserSettingsMonitor.java?rev=953111&r1=953110&r2=953111&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/ParserSettingsMonitor.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/ParserSettingsMonitor.java Wed Jun
 9 18:40:35 2010
@@ -131,6 +131,10 @@ class ParserSettingsMonitor {
             return delegatedSettings.getDefaultBranch(moduleId);
         }
 
+        public Namespace getContextNamespace() {
+            return delegatedSettings.getContextNamespace();
+        }
+        
         public Map substitute(Map strings) {
             Map substituted = new LinkedHashMap();
             for (Iterator it = strings.entrySet().iterator(); it.hasNext();) {

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java?rev=953111&r1=953110&r2=953111&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java Wed Jun  9 18:40:35
2010
@@ -1460,5 +1460,8 @@ public class IvySettings implements Sort
         }
     }
 
-    
+    public Namespace getContextNamespace() {
+        return Namespace.SYSTEM_NAMESPACE;
+    }
+
 }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParser.java?rev=953111&r1=953110&r2=953111&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParser.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParser.java
Wed Jun  9 18:40:35 2010
@@ -34,7 +34,7 @@ public interface ModuleDescriptorParser 
 
     public ModuleDescriptor parseDescriptor(ParserSettings ivySettings, URL descriptorURL,
             Resource res, boolean validate) throws ParseException, IOException;
-
+    
     /**
      * Convert a module descriptor to an ivy file. This method MUST close the given input
stream
      * when job is finished

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ParserSettings.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ParserSettings.java?rev=953111&r1=953110&r2=953111&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ParserSettings.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ParserSettings.java Wed Jun
 9 18:40:35 2010
@@ -28,6 +28,7 @@ import org.apache.ivy.core.module.status
 import org.apache.ivy.plugins.conflict.ConflictManager;
 import org.apache.ivy.plugins.matcher.PatternMatcher;
 import org.apache.ivy.plugins.namespace.Namespace;
+import org.apache.ivy.plugins.namespace.NamespaceTransformer;
 import org.apache.ivy.plugins.resolver.DependencyResolver;
 
 public interface ParserSettings {
@@ -53,5 +54,10 @@ public interface ParserSettings {
     File resolveFile(String filename);
     
     String getDefaultBranch(ModuleId moduleId);
+    
+    /**
+     * Returns the namespace context in which the current descriptor is parsed.
+     */
+    Namespace getContextNamespace();
 
 }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java?rev=953111&r1=953110&r2=953111&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
Wed Jun  9 18:40:35 2010
@@ -41,6 +41,7 @@ import org.apache.ivy.core.resolve.Resol
 import org.apache.ivy.core.resolve.ResolveEngine;
 import org.apache.ivy.core.resolve.ResolveOptions;
 import org.apache.ivy.core.resolve.ResolvedModuleRevision;
+import org.apache.ivy.plugins.namespace.NameSpaceHelper;
 import org.apache.ivy.plugins.parser.ModuleDescriptorParser;
 import org.apache.ivy.plugins.parser.ParserSettings;
 import org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorWriter;
@@ -114,7 +115,7 @@ public final class PomModuleDescriptorPa
                                                                     this, res, ivySettings);
         
         try {           
-            PomReader domReader = new PomReader(res);            
+            PomReader domReader = new PomReader(descriptorURL, res);            
             domReader.setProperty("parent.version", domReader.getParentVersion());
             domReader.setProperty("parent.groupId", domReader.getParentGroupId());
             domReader.setProperty("project.parent.version", domReader.getParentVersion());
@@ -348,6 +349,7 @@ public final class PomModuleDescriptorPa
             // TODO: Throw exception here?
             return null;
         } else {
+            dd = NameSpaceHelper.toSystem(dd, ivySettings.getContextNamespace());
             ResolvedModuleRevision otherModule = resolver.getDependency(dd, data);
             return otherModule;
         }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java?rev=953111&r1=953110&r2=953111&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java Wed Jun  9
18:40:35 2010
@@ -23,6 +23,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.LineNumberReader;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -37,6 +38,7 @@ import org.apache.ivy.core.module.id.Mod
 import org.apache.ivy.core.module.id.ModuleRevisionId;
 import org.apache.ivy.plugins.repository.Resource;
 import org.apache.ivy.util.XMLHelper;
+import org.apache.ivy.util.url.URLHandlerRegistry;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
@@ -87,8 +89,8 @@ public class PomReader {
     private final Element projectElement;
     private final Element parentElement;
     
-    public PomReader(Resource res) throws IOException, SAXException {
-        InputStream stream = new AddDTDFilterInputStream(res.openStream());
+    public PomReader(URL descriptorURL, Resource res) throws IOException, SAXException {
+        InputStream stream = new AddDTDFilterInputStream(URLHandlerRegistry.getDefault().openStream(descriptorURL));
         try {
             Document pomDomDoc = XMLHelper.parseToDom(stream, res, new EntityResolver() {
                 public InputSource resolveEntity(String publicId, String systemId) 

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java?rev=953111&r1=953110&r2=953111&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
Wed Jun  9 18:40:35 2010
@@ -44,6 +44,7 @@ import org.apache.ivy.core.resolve.Resol
 import org.apache.ivy.plugins.conflict.ConflictManager;
 import org.apache.ivy.plugins.conflict.FixedConflictManager;
 import org.apache.ivy.plugins.matcher.PatternMatcher;
+import org.apache.ivy.plugins.namespace.NameSpaceHelper;
 import org.apache.ivy.plugins.namespace.Namespace;
 import org.apache.ivy.plugins.parser.AbstractModuleDescriptorParser;
 import org.apache.ivy.plugins.parser.ModuleDescriptorParser;
@@ -572,6 +573,7 @@ public class XmlModuleDescriptorParser e
                 // TODO: Throw exception here?
                 return null;
             } else {
+                dd = NameSpaceHelper.toSystem(dd, getSettings().getContextNamespace());
                 ResolvedModuleRevision otherModule = resolver.getDependency(dd, data);
                 if (otherModule == null) {
                     throw new ParseException("Unable to find " + parentMrid.toString(), 0);

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResolver.java?rev=953111&r1=953110&r2=953111&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResolver.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResolver.java Wed
Jun  9 18:40:35 2010
@@ -25,11 +25,13 @@ import java.util.Map;
 
 import org.apache.ivy.core.IvyContext;
 import org.apache.ivy.core.LogOptions;
+import org.apache.ivy.core.RelativeUrlResolver;
 import org.apache.ivy.core.cache.ArtifactOrigin;
 import org.apache.ivy.core.cache.CacheDownloadOptions;
 import org.apache.ivy.core.cache.CacheMetadataOptions;
 import org.apache.ivy.core.cache.DownloadListener;
 import org.apache.ivy.core.cache.RepositoryCacheManager;
+import org.apache.ivy.core.cache.ResolutionCacheManager;
 import org.apache.ivy.core.event.EventManager;
 import org.apache.ivy.core.event.download.EndArtifactDownloadEvent;
 import org.apache.ivy.core.event.download.NeedArtifactEvent;
@@ -37,7 +39,9 @@ import org.apache.ivy.core.event.downloa
 import org.apache.ivy.core.module.descriptor.Artifact;
 import org.apache.ivy.core.module.descriptor.DependencyDescriptor;
 import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
+import org.apache.ivy.core.module.id.ModuleId;
 import org.apache.ivy.core.module.id.ModuleRevisionId;
+import org.apache.ivy.core.module.status.StatusManager;
 import org.apache.ivy.core.report.ArtifactDownloadReport;
 import org.apache.ivy.core.report.DownloadReport;
 import org.apache.ivy.core.report.DownloadStatus;
@@ -51,10 +55,13 @@ import org.apache.ivy.core.search.Module
 import org.apache.ivy.core.search.OrganisationEntry;
 import org.apache.ivy.core.search.RevisionEntry;
 import org.apache.ivy.core.settings.Validatable;
+import org.apache.ivy.plugins.conflict.ConflictManager;
 import org.apache.ivy.plugins.latest.ArtifactInfo;
 import org.apache.ivy.plugins.latest.LatestStrategy;
+import org.apache.ivy.plugins.matcher.PatternMatcher;
 import org.apache.ivy.plugins.namespace.NameSpaceHelper;
 import org.apache.ivy.plugins.namespace.Namespace;
+import org.apache.ivy.plugins.parser.ParserSettings;
 import org.apache.ivy.plugins.resolver.ChainResolver.ResolvedModuleRevisionArtifactInfo;
 import org.apache.ivy.plugins.resolver.util.HasLatestStrategy;
 import org.apache.ivy.plugins.resolver.util.ResolvedResource;
@@ -107,6 +114,10 @@ public abstract class AbstractResolver 
     public ResolverSettings getSettings() {
         return settings;
     }
+    
+    public ParserSettings getParserSettings() {
+        return new ResolverParserSettings();
+    }
 
     public void setSettings(ResolverSettings ivy) {
         settings = ivy;
@@ -551,4 +562,55 @@ public abstract class AbstractResolver 
             + rmr.getResolver().getName();
     }
 
+    private class ResolverParserSettings implements ParserSettings {
+
+        public ConflictManager getConflictManager(String name) {
+            return AbstractResolver.this.getSettings().getConflictManager(name);
+        }
+
+        public Namespace getContextNamespace() {
+            return AbstractResolver.this.getNamespace();
+        }
+
+        public String getDefaultBranch(ModuleId moduleId) {
+            return AbstractResolver.this.getSettings().getDefaultBranch(moduleId);
+        }
+
+        public PatternMatcher getMatcher(String matcherName) {
+            return AbstractResolver.this.getSettings().getMatcher(matcherName);
+        }
+
+        public Namespace getNamespace(String namespace) {
+            return AbstractResolver.this.getSettings().getNamespace(namespace);
+        }
+
+        public RelativeUrlResolver getRelativeUrlResolver() {
+            return AbstractResolver.this.getSettings().getRelativeUrlResolver();
+        }
+
+        public ResolutionCacheManager getResolutionCacheManager() {
+            return AbstractResolver.this.getSettings().getResolutionCacheManager();
+        }
+
+        public DependencyResolver getResolver(ModuleRevisionId mRevId) {
+            return AbstractResolver.this.getSettings().getResolver(mRevId);
+        }
+
+        public StatusManager getStatusManager() {
+            return AbstractResolver.this.getSettings().getStatusManager();
+        }
+
+        public File resolveFile(String filename) {
+            return AbstractResolver.this.getSettings().resolveFile(filename);
+        }
+
+        public Map substitute(Map strings) {
+            return AbstractResolver.this.getSettings().substitute(strings);
+        }
+
+        public String substitute(String value) {
+            return AbstractResolver.this.getSettings().substitute(value);
+        }
+        
+    }
 }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/RepositoryResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/RepositoryResolver.java?rev=953111&r1=953110&r2=953111&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/RepositoryResolver.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/RepositoryResolver.java Wed
Jun  9 18:40:35 2010
@@ -101,7 +101,7 @@ public class RepositoryResolver extends 
                                 ModuleDescriptorParserRegistry.getInstance().getParser(res);
                             ModuleDescriptor md = 
                                 parser.parseDescriptor(
-                                    getSettings(), temp.toURI().toURL(), res, false);
+                                    getParserSettings(), temp.toURI().toURL(), res, false);
                             revision = md.getRevision();
                             if ((revision == null) || (revision.length() == 0)) {
                                 revision = "working@" + name;

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java?rev=953111&r1=953110&r2=953111&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java Wed Jun  9 18:40:35
2010
@@ -4305,6 +4305,54 @@ public class ResolveTest extends TestCas
             "test3", "jar", "jar").exists());
     }
     
+    public void testResolveMaven2ParentPomWithNamespace() throws Exception {
+        // Cfr IVY-1186
+        Ivy ivy = new Ivy();
+        ivy.configure(new File("test/repositories/parentPom/ivysettings-namespace.xml"));
+        
+        ResolveReport report = ivy.resolve(ModuleRevisionId.newInstance("org.apache.systemDm",
"test", "1.0"),
+            getResolveOptions(new String[] {"*(public)"}), true);
+        assertNotNull(report);
+        ModuleDescriptor md = report.getModuleDescriptor();
+        assertNotNull(md);
+//        assertEquals(mrid, md.getModuleRevisionId());
+//        assertTrue(getResolvedIvyFileInCache(mrid).exists());
+
+        //test the report to make sure the right dependencies are listed
+        List dependencies = report.getDependencies();
+        assertEquals(3, dependencies.size()); // the test module + it's 2 dependencies
+
+        IvyNode ivyNode = (IvyNode) dependencies.get(0);
+        assertNotNull(ivyNode);
+        ModuleRevisionId mrid = ModuleRevisionId.newInstance("org.apache.systemDm", "test",
"1.0");
+        assertEquals(mrid, ivyNode.getId());
+        // dependencies
+        assertTrue(getIvyFileInCache(
+            ModuleRevisionId.newInstance("org.apache.systemDm", "test", "1.0")).exists());
+        assertTrue(getArchiveFileInCache(ivy, "org.apache.systemDm", "test", "1.0",
+            "test", "jar", "jar").exists());
+
+        ivyNode = (IvyNode) dependencies.get(1);
+        assertNotNull(ivyNode);
+        mrid = ModuleRevisionId.newInstance("org.apache.systemDm", "test2", "2.0");
+        assertEquals(mrid, ivyNode.getId());
+        // dependencies
+        assertTrue(getIvyFileInCache(
+            ModuleRevisionId.newInstance("org.apache.systemDm", "test2", "2.0")).exists());
+        assertTrue(getArchiveFileInCache(ivy, "org.apache.systemDm", "test2", "2.0",
+            "test2", "jar", "jar").exists());
+        
+        ivyNode = (IvyNode) dependencies.get(2);
+        assertNotNull(ivyNode);
+        mrid = ModuleRevisionId.newInstance("org.apache.systemDm", "test3", "1.0");
+        assertEquals(mrid, ivyNode.getId());
+        // dependencies
+        assertTrue(getIvyFileInCache(
+            ModuleRevisionId.newInstance("org.apache.systemDm", "test3", "1.0")).exists());
+        assertTrue(getArchiveFileInCache(ivy, "org.apache.systemDm", "test3", "1.0",
+            "test3", "jar", "jar").exists());
+    }
+
     public void testResolveMaven2ParentPomDualResolver() throws Exception {
         // test has a dependency on test2 but there is no version listed. test has a parent
of parent(2.0) 
         // then parent2. Both parents have a dependencyManagement element for test2, and
each list the version as

Added: ant/ivy/core/trunk/test/repositories/parentPom/ivysettings-namespace.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/parentPom/ivysettings-namespace.xml?rev=953111&view=auto
==============================================================================
--- ant/ivy/core/trunk/test/repositories/parentPom/ivysettings-namespace.xml (added)
+++ ant/ivy/core/trunk/test/repositories/parentPom/ivysettings-namespace.xml Wed Jun  9 18:40:35
2010
@@ -0,0 +1,43 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   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.    
+-->
+<ivysettings>
+	<settings defaultCache="${ivy.basedir}/build/cache" defaultResolver="default" />
+	<resolvers>
+        <chain name="default">
+            <filesystem name="m2" m2compatible="true" namespace="test">
+                <ivy pattern="${ivy.settings.dir}/[organisation]/[module]/[revision]/[module]-[revision].pom"/>
+                <artifact pattern="${ivy.settings.dir}/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"/>
+            </filesystem>
+        </chain>
+	</resolvers>
+    <namespaces>
+       <namespace name="test">
+            <rule>
+                <fromsystem>
+                    <src org="(org\.apache).systemDm" module=".*" />
+                    <dest org="$o1.dm" module="$m0" />
+                </fromsystem>
+                <tosystem>
+                    <src org="(org\.apache)\.dm" module=".*" />
+                    <dest org="$o1.systemDm" module="$m0" />
+                </tosystem>
+            </rule>t
+        </namespace>
+    </namespaces>
+</ivysettings>

Propchange: ant/ivy/core/trunk/test/repositories/parentPom/ivysettings-namespace.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message