Author: xavier
Date: Thu Mar 8 06:19:45 2007
New Revision: 516047
URL: http://svn.apache.org/viewvc?view=rev&rev=516047
Log:
assumePublished is no more necessary on artifact (IVY-419)
better distinction between incude and artifact element in dependency
Modified:
incubator/ivy/core/trunk/doc/doc/ivyfile/dependency-artifact.html
incubator/ivy/core/trunk/doc/doc/ivyfile/dependency-include.html
incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriter.java
incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/ivy.xsd
incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParserTester.java
incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParserTest.java
incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-write-full.xml
Modified: incubator/ivy/core/trunk/doc/doc/ivyfile/dependency-artifact.html
URL:
http://svn.apache.org/viewvc/incubator/ivy/core/trunk/doc/doc/ivyfile/dependency-artifact.html?view=diff&rev=516047&r1=516046&r2=516047
==============================================================================
--- incubator/ivy/core/trunk/doc/doc/ivyfile/dependency-artifact.html (original)
+++ incubator/ivy/core/trunk/doc/doc/ivyfile/dependency-artifact.html Thu Mar
8 06:19:45 2007
@@ -27,7 +27,7 @@
<span class="since">since 1.4</span> It's possible to indicate the url at
which the artifact can be found. This is not mandatory, and even not
recommended with an enterprise repository. Note that Ivy will always look at
the location where the artifact should be and only use the url if it cannot be
found at the standard location in the repository.
-<span class="since">since 1.5</span> This feature can also be used for modules
having their own module descriptor, but which doesn't declare an artifact you
know that is published. To use this behavior, set the <i>assumePublished</i>
attribute to true. Note that in this case artifacts declared to be published by
the dependency will be ignored, so do not forget to include all artifacts you
want.
+<span class="since">since 1.5</span> This feature can also be used for modules
having their own module descriptor, but which doesn't declare an artifact you
know that is published. Note that in this case artifacts declared to be
published by the dependency will be ignored, so do not forget to include all
artifacts you want.
<h1>Attributes</h1>
<table class="ivy-attributes">
@@ -44,8 +44,6 @@
<tr><td>conf</td><td>comma separated list of the master configurations in
which this artifact should be included.
'*' wildcard can be used to designate all configurations of this
module</td>
<td>No, defaults to '*', unless nested conf are specified</td></tr>
- <tr><td>assumePublished</td><td>true if this artifact should be assumed to
be published by the dependency even if it has its own module descriptor <span
class="since">since 1.5</span></td>
- <td>No, defaults to false</td></tr>
<tr><td>url</td><td>an url where this artifact can be found if it isn't
present at the standard location in the repository <span class="since">since
1.4</span></td>
<td>No, defaults to no url</td></tr>
</tbody>
@@ -80,7 +78,7 @@
<code type="xml">
<dependency org="foo" name="bar" rev="1.0">
<include name="*"/>
- <artifact name="baz" type="source" ext="jar" assumePublished="true"/>
+ <artifact name="baz" type="source" ext="jar"/>
</dependency>
</code>
Declares a dependency on module bar for which all artifacts declared will be
used (thanks to the include tag) plus an artifact baz of type source and ext
jar (which is not declared in module bar module descriptor).
Modified: incubator/ivy/core/trunk/doc/doc/ivyfile/dependency-include.html
URL:
http://svn.apache.org/viewvc/incubator/ivy/core/trunk/doc/doc/ivyfile/dependency-include.html?view=diff&rev=516047&r1=516046&r2=516047
==============================================================================
--- incubator/ivy/core/trunk/doc/doc/ivyfile/dependency-include.html (original)
+++ incubator/ivy/core/trunk/doc/doc/ivyfile/dependency-include.html Thu Mar 8
06:19:45 2007
@@ -5,52 +5,54 @@
<script type="text/javascript" src="../../xooki/xooki.js"></script>
</head>
<body>
- <textarea id="xooki-source">
-<b>Tag:</b> include <b>Parent:</b> <a
href="../../doc/ivyfile/dependency.html">dependency</a>
-
-This feature gives you more control on a dependency for which you do not
control its ivy file.
-It enables to restrict the artifacts required by including only the artifacts
given here, even if configuration does not a good separation of published
artifacts.
-
-Each artifact restriction can be given in the context of particular master
configurations. By default, if no configuration is specified, artifacts
restriction apply to all master configurations. But you can specify that a
restriction applies only to one or several master configurations, using either
inline or nested conf specification. In this case, do not forget that if you do
not specify any restriction for a particular configuration, then no restriction
will apply for this configuration and it will be resolved not taking into
account any restriction.
-
-For instance, imagine you have A, B & C master configurations. If you restrict
to art1 in A & B and art2 in A, then C will not be restricted at all, and will
thus get all artifacts of all dependency configurations if you do not specify a
configuration mapping. To prevent this, you have to specify a configuration
mapping for the dependency, mapping only A & B to some or all dependency
configurations.
-
-Example:
-<code type="xml">
-<dependency org="yourorg" name="yourmodule9" rev="9.1" conf="A,B->default">
- <include name="art1" type="jar" conf="A,B"/>
- <include name="art2" type="jar" conf="A"/>
-</dependency>
-</code>
-
-<h1>Attributes</h1>
-<table class="ivy-attributes">
-<thead>
- <tr><th class="ivy-att">Attribute</th><th
class="ivy-att-desc">Description</th><th class="ivy-att-req">Required</th></tr>
-</thead>
-<tbody>
- <tr><td>name</td><td>the name of an artifact of the dependency module to
add to the include list, or a regexp matching this name</td>
- <td>No, defaults to .*</td></tr>
- <tr><td>type</td><td>the type of the artifact of the dependency module to
add to the include list, or a regexp matching this name</td>
- <td>No, defaults to .*</td></tr>
- <tr><td>ext</td><td>the extension of the artifact of the dependency module
to add to the include list, or a regexp matching this name</td>
- <td>No, defaults to type</td></tr>
- <tr><td>conf</td><td>comma separated list of the master configurations in
which this artifact should be included.
- '*' wildcard can be used to designate all configurations of this
module</td>
- <td>No, defaults to '*', unless nested conf are specified</td></tr>
-</tbody>
-</table>
-<h1>Child elements</h1>
-<table class="ivy-children">
-<thead>
- <tr><th class="ivy-chld">Element</th><th
class="ivy-chld-desc">Description</th><th
class="ivy-chld-card">Cardinality</th></tr>
-</thead>
-<tbody>
- <tr><td><a
href="../../doc/ivyfile/dependency-include-conf.html">conf</a></td><td>configuration
in which the artifact should be included</td>
- <td>0..n</td></tr>
-</tbody>
-</table>
-
+ <textarea id="xooki-source">
+<b>Tag:</b> include <b>Parent:</b> <a
href="../../doc/ivyfile/dependency.html">dependency</a>
+
+This feature gives you more control on a dependency for which you do not
control its ivy file.
+It enables to restrict the artifacts required by including only the artifacts
given here, even if configuration does not a good separation of published
artifacts.
+
+Each artifact restriction can be given in the context of particular master
configurations. By default, if no configuration is specified, artifacts
restriction apply to all master configurations. But you can specify that a
restriction applies only to one or several master configurations, using either
inline or nested conf specification. In this case, do not forget that if you do
not specify any restriction for a particular configuration, then no restriction
will apply for this configuration and it will be resolved not taking into
account any restriction.
+
+For instance, imagine you have A, B & C master configurations. If you restrict
to art1 in A & B and art2 in A, then C will not be restricted at all, and will
thus get all artifacts of all dependency configurations if you do not specify a
configuration mapping. To prevent this, you have to specify a configuration
mapping for the dependency, mapping only A & B to some or all dependency
configurations.
+
+Example:
+<code type="xml">
+<dependency org="yourorg" name="yourmodule9" rev="9.1" conf="A,B->default">
+ <include name="art1" type="jar" conf="A,B"/>
+ <include name="art2" type="jar" conf="A"/>
+</dependency>
+</code>
+
+<h1>Attributes</h1>
+<table class="ivy-attributes">
+<thead>
+ <tr><th class="ivy-att">Attribute</th><th
class="ivy-att-desc">Description</th><th class="ivy-att-req">Required</th></tr>
+</thead>
+<tbody>
+ <tr><td>name</td><td>the name of an artifact of the dependency module to
add to the include list, or a regexp matching this name</td>
+ <td>No, defaults to .*</td></tr>
+ <tr><td>type</td><td>the type of the artifact of the dependency module to
add to the include list, or a regexp matching this name</td>
+ <td>No, defaults to .*</td></tr>
+ <tr><td>ext</td><td>the extension of the artifact of the dependency module
to add to the include list, or a regexp matching this name</td>
+ <td>No, defaults to type</td></tr>
+ <tr><td>matcher</td><td>the matcher to use to match the modules to include
<span class="since">since 1.5</span></td>
+ <td>No, defaults to exactOrRegexp in pre 1.3 ivy files, and exact in
1.3 and superior</td></tr>
+ <tr><td>conf</td><td>comma separated list of the master configurations in
which this artifact should be included.
+ '*' wildcard can be used to designate all configurations of this
module</td>
+ <td>No, defaults to '*', unless nested conf are specified</td></tr>
+</tbody>
+</table>
+<h1>Child elements</h1>
+<table class="ivy-children">
+<thead>
+ <tr><th class="ivy-chld">Element</th><th
class="ivy-chld-desc">Description</th><th
class="ivy-chld-card">Cardinality</th></tr>
+</thead>
+<tbody>
+ <tr><td><a
href="../../doc/ivyfile/dependency-include-conf.html">conf</a></td><td>configuration
in which the artifact should be included</td>
+ <td>0..n</td></tr>
+</tbody>
+</table>
+
</textarea>
<script type="text/javascript">xooki.postProcess();</script>
</body>
Modified:
incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
URL:
http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java?view=diff&rev=516047&r1=516046&r2=516047
==============================================================================
---
incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
(original)
+++
incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
Thu Mar 8 06:19:45 2007
@@ -44,6 +44,7 @@
import org.apache.ivy.core.settings.IvySettings;
import org.apache.ivy.plugins.conflict.ConflictManager;
import org.apache.ivy.plugins.conflict.FixedConflictManager;
+import org.apache.ivy.plugins.matcher.ExactPatternMatcher;
import org.apache.ivy.plugins.matcher.PatternMatcher;
import org.apache.ivy.plugins.namespace.Namespace;
import org.apache.ivy.plugins.parser.AbstractModuleDescriptorParser;
@@ -146,8 +147,9 @@
private static final int CONF = 2;
private static final int PUB = 3;
private static final int DEP = 4;
- private static final int ARTIFACT_INCLUDE = 5;
- private static final int ARTIFACT_EXCLUDE = 6;
+ private static final int DEP_ARTIFACT = 5;
+ private static final int ARTIFACT_INCLUDE = 6;
+ private static final int ARTIFACT_EXCLUDE = 7;
private static final int CONFLICT = 7;
private int _state = NONE;
@@ -363,6 +365,7 @@
}
}
break;
+ case DEP_ARTIFACT:
case ARTIFACT_INCLUDE:
case ARTIFACT_EXCLUDE:
_dad.addConfiguration(conf);
@@ -447,21 +450,21 @@
}
private void addDependencyArtifacts(String tag, Attributes attributes)
throws MalformedURLException {
- _state = ARTIFACT_INCLUDE;
- addDependencyArtifact(tag, attributes, true);
+ _state = DEP_ARTIFACT;
+ addDependencyArtifact(tag, attributes);
}
private void addDependencyArtifactsIncludes(String tag, Attributes
attributes) throws MalformedURLException {
_state = ARTIFACT_INCLUDE;
- addDependencyArtifact(tag, attributes, true);
+ addDependencyArtifact(tag, attributes);
}
private void addDependencyArtifactsExcludes(String tag, Attributes
attributes) throws MalformedURLException {
_state = ARTIFACT_EXCLUDE;
- addDependencyArtifact(tag, attributes, false);
+ addDependencyArtifact(tag, attributes);
}
- private void addDependencyArtifact(String tag, Attributes attributes,
boolean includes) throws MalformedURLException {
+ private void addDependencyArtifact(String tag, Attributes attributes)
throws MalformedURLException {
String name = _ivy.substitute(attributes.getValue("name"));
if (name == null) {
name = "artifact".equals(tag)?_dd.getDependencyId().getName() :
PatternMatcher.ANY_EXPRESSION;
@@ -472,26 +475,28 @@
}
String ext = _ivy.substitute(attributes.getValue("ext"));
ext = ext != null?ext:type;
- String matcherName = _ivy.substitute(attributes.getValue("matcher"));
- PatternMatcher matcher = matcherName == null ? _defaultMatcher :
_ivy.getMatcher(matcherName);
- if (matcher == null) {
- addError("unknown matcher "+matcherName);
- return;
- }
- if (includes) {
+ if (_state == DEP_ARTIFACT) {
String url = _ivy.substitute(attributes.getValue("url"));
- Map extraAtt = ExtendableItemHelper.getExtraAttributes(attributes,
new String[] {"name", "type", "ext", "matcher", "assumePublished", "url"});
- String assumePublishedStr =
_ivy.substitute(attributes.getValue("assumePublished"));
- boolean assumePublished = assumePublishedStr != null &&
Boolean.valueOf(assumePublishedStr).booleanValue();
- _dad = new DefaultDependencyArtifactDescriptor(_dd, name, type,
ext, url==null?null:new URL(url), includes, assumePublished, matcher, extraAtt);
+ Map extraAtt = ExtendableItemHelper.getExtraAttributes(attributes,
new String[] {"name", "type", "ext", "url", "conf"});
+ _dad = new DefaultDependencyArtifactDescriptor(_dd, name, type,
ext, url==null?null:new URL(url), true, true, ExactPatternMatcher.INSTANCE,
extraAtt);
+ } else if (_state == ARTIFACT_INCLUDE) {
+ PatternMatcher matcher =
getDependencyArtifactMatcher(attributes.getValue("matcher"));
+ String org = _ivy.substitute(attributes.getValue("org"));
+ org = org == null ? PatternMatcher.ANY_EXPRESSION : org;
+ String module = _ivy.substitute(attributes.getValue("module"));
+ module = module == null ? PatternMatcher.ANY_EXPRESSION : module;
+ ArtifactId aid = new ArtifactId(new ModuleId(org, module), name,
type, ext);
+ Map extraAtt = ExtendableItemHelper.getExtraAttributes(attributes,
new String[] {"org", "module", "name", "type", "ext", "matcher", "conf"});
+ _dad = new DefaultDependencyArtifactDescriptor(_dd, aid, true,
false, matcher, extraAtt);
} else {
+ PatternMatcher matcher =
getDependencyArtifactMatcher(attributes.getValue("matcher"));
String org = _ivy.substitute(attributes.getValue("org"));
org = org == null ? PatternMatcher.ANY_EXPRESSION : org;
String module = _ivy.substitute(attributes.getValue("module"));
module = module == null ? PatternMatcher.ANY_EXPRESSION : module;
ArtifactId aid = new ArtifactId(new ModuleId(org, module), name,
type, ext);
- Map extraAtt = ExtendableItemHelper.getExtraAttributes(attributes,
new String[] {"org", "module", "name", "type", "ext", "matcher",
"assumePublished"});
- _dad = new DefaultDependencyArtifactDescriptor(_dd, aid, includes,
false, matcher, extraAtt);
+ Map extraAtt = ExtendableItemHelper.getExtraAttributes(attributes,
new String[] {"org", "module", "name", "type", "ext", "matcher", "conf"});
+ _dad = new DefaultDependencyArtifactDescriptor(_dd, aid, false,
false, matcher, extraAtt);
}
String confs = _ivy.substitute(attributes.getValue("conf"));
// only add confs if they are specified. if they aren't, endElement
will handle this
@@ -507,7 +512,16 @@
_dad.addConfiguration(conf[i].trim());
}
}
- }
+ }
+
+ private PatternMatcher getDependencyArtifactMatcher(String m) {
+ String matcherName = _ivy.substitute(m);
+ PatternMatcher matcher = matcherName == null ? _defaultMatcher :
_ivy.getMatcher(matcherName);
+ if (matcher == null) {
+ throw new IllegalArgumentException("unknown matcher "+matcherName);
+ }
+ return matcher;
+ }
public void endElement(String uri, String localName, String qName) throws
SAXException {
if (_state == PUB && "artifact".equals(qName) &&
_artifact.getConfigurations().length == 0) {
@@ -518,8 +532,9 @@
}
} else if ("configurations".equals(qName)) {
checkConfigurations();
- } else if ((_state == ARTIFACT_INCLUDE && ("artifact".equals(qName) ||
"include".equals(qName)))
- || (_state == ARTIFACT_EXCLUDE && "exclude".equals(qName))){
+ } else if ((_state == DEP_ARTIFACT && "artifact".equals(qName))
+ || (_state == ARTIFACT_INCLUDE &&
"include".equals(qName))
+ || (_state == ARTIFACT_EXCLUDE &&
"exclude".equals(qName))){
_state = DEP;
if (_dad.getConfigurations().length == 0) {
String[] confs = _md.getConfigurationsNames();
Modified:
incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriter.java
URL:
http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriter.java?view=diff&rev=516047&r1=516046&r2=516047
==============================================================================
---
incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriter.java
(original)
+++
incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriter.java
Thu Mar 8 06:19:45 2007
@@ -23,6 +23,8 @@
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
+import java.util.Iterator;
+import java.util.Map;
import org.apache.ivy.Ivy;
import org.apache.ivy.core.module.descriptor.Artifact;
@@ -142,7 +144,11 @@
if (includes.length > 0) {
out.println(">");
for (int j = 0; j < includes.length; j++) {
- out.print("\t\t\t<include");
+ if (includes[j].isAssumePublished()) {
+ out.print("\t\t\t<artifact");
+ } else {
+ out.print("\t\t\t<include");
+ }
out.print(" name=\""+includes[j].getName()+"\"");
out.print(" type=\""+includes[j].getType()+"\"");
out.print(" ext=\""+includes[j].getExt()+"\"");
@@ -157,6 +163,11 @@
}
out.print("\"");
}
+ Map extra = includes[j].getExtraAttributes();
+ for (Iterator iter = extra.entrySet().iterator();
iter.hasNext();) {
+ Map.Entry entry
= (Map.Entry) iter.next();
+ out.print("
"+entry.getKey()+"=\""+entry.getValue()+"\"");
+ }
out.println("/>");
}
}
Modified:
incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/ivy.xsd
URL:
http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/ivy.xsd?view=diff&rev=516047&r1=516046&r2=516047
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/ivy.xsd
(original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/ivy.xsd
Thu Mar 8 06:19:45 2007
@@ -135,7 +135,6 @@
<xs:attribute name="type" type="xs:string"/>
<xs:attribute name="ext" type="xs:string"/>
<xs:attribute name="conf" type="xs:string"/>
-
<xs:attribute name="matcher" type="xs:string"/>
<xs:attribute name="url" type="xs:string"/>
</xs:complexType>
</xs:element>
Modified:
incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParserTester.java
URL:
http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParserTester.java?view=diff&rev=516047&r1=516046&r2=516047
==============================================================================
---
incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParserTester.java
(original)
+++
incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParserTester.java
Thu Mar 8 06:19:45 2007
@@ -57,6 +57,9 @@
}
protected void assertDependencyArtifactsIncludes(DependencyDescriptor dd,
String[] confs, String[] artifactsNames) {
+ assertDependencyArtifactsIncludes(dd, confs, artifactsNames, false);
+ }
+ protected void assertDependencyArtifactsIncludes(DependencyDescriptor dd,
String[] confs, String[] artifactsNames, boolean assumePublished) {
DependencyArtifactDescriptor[] dads =
dd.getDependencyArtifactsIncludes(confs);
assertNotNull(dads);
assertEquals(artifactsNames.length, dads.length);
@@ -65,6 +68,7 @@
for (int j = 0; j < dads.length; j++) {
assertNotNull(dads[j]);
if (dads[j].getName().equals(artifactsNames[i])) {
+ assertEquals("unexpected value for assumePublished on
"+artifactsNames[i], assumePublished, dads[j].isAssumePublished());
found = true;
break;
}
Modified:
incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParserTest.java
URL:
http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParserTest.java?view=diff&rev=516047&r1=516046&r2=516047
==============================================================================
---
incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParserTest.java
(original)
+++
incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParserTest.java
Thu Mar 8 06:19:45 2007
@@ -102,7 +102,9 @@
public void testBadOrg() throws IOException {
try {
XmlModuleDescriptorParser.getInstance().parseDescriptor(_settings,
getClass().getResource("test-bad-org.xml"), true);
- fail("bad ivy file raised no error");
+ if (XMLHelper.canUseSchemaValidation()) {
+ fail("bad ivy file raised no error");
+ }
} catch (ParseException ex) {
if (XMLHelper.canUseSchemaValidation()) {
assertTrue("invalid exception: "+ex.getMessage(),
ex.getMessage().indexOf("organization") != -1);
@@ -267,27 +269,27 @@
assertEquals(Arrays.asList(new String[] {"yourconf1"}),
Arrays.asList(dd.getDependencyConfigurations("myconf1")));
assertEquals(Arrays.asList(new String[] {"yourconf1", "yourconf2"}),
Arrays.asList(dd.getDependencyConfigurations("myconf2")));
assertEquals(Arrays.asList(new String[] {}),
Arrays.asList(dd.getDependencyConfigurations(new String[] {"myconf3",
"myconf4"})));
- assertDependencyArtifactsIncludes(dd, new String[] {"myconf1",
"myconf2", "myconf3", "myconf4"}, new String[0]);
+ assertDependencyArtifactsIncludes(dd, new String[] {"myconf1",
"myconf2", "myconf3", "myconf4"}, new String[0], false);
dd = getDependency(dependencies, "yourmodule8");
assertNotNull(dd);
assertEquals("yourorg", dd.getDependencyId().getOrganisation());
assertEquals("8.1", dd.getDependencyRevisionId().getRevision());
assertEquals(new HashSet(Arrays.asList(new String[] {"*"})), new
HashSet(Arrays.asList(dd.getModuleConfigurations())));
- assertDependencyArtifactsIncludes(dd, new String[] {"myconf1"}, new
String[] {"yourartifact8-1", "yourartifact8-2"});
- assertDependencyArtifactsIncludes(dd, new String[] {"myconf2"}, new
String[] {"yourartifact8-1", "yourartifact8-2"});
- assertDependencyArtifactsIncludes(dd, new String[] {"myconf3"}, new
String[] {"yourartifact8-1", "yourartifact8-2"});
- assertDependencyArtifactsIncludes(dd, new String[] {"myconf4"}, new
String[] {"yourartifact8-1", "yourartifact8-2"});
+ assertDependencyArtifactsIncludes(dd, new String[] {"myconf1"}, new
String[] {"yourartifact8-1", "yourartifact8-2"}, true);
+ assertDependencyArtifactsIncludes(dd, new String[] {"myconf2"}, new
String[] {"yourartifact8-1", "yourartifact8-2"}, true);
+ assertDependencyArtifactsIncludes(dd, new String[] {"myconf3"}, new
String[] {"yourartifact8-1", "yourartifact8-2"}, true);
+ assertDependencyArtifactsIncludes(dd, new String[] {"myconf4"}, new
String[] {"yourartifact8-1", "yourartifact8-2"}, true);
dd = getDependency(dependencies, "yourmodule9");
assertNotNull(dd);
assertEquals("yourorg", dd.getDependencyId().getOrganisation());
assertEquals("9.1", dd.getDependencyRevisionId().getRevision());
assertEquals(new HashSet(Arrays.asList(new String[] {"myconf1",
"myconf2", "myconf3"})), new
HashSet(Arrays.asList(dd.getModuleConfigurations())));
- assertDependencyArtifactsIncludes(dd, new String[] {"myconf1"}, new
String[] {"yourartifact9-1"});
- assertDependencyArtifactsIncludes(dd, new String[] {"myconf2"}, new
String[] {"yourartifact9-1", "yourartifact9-2"});
- assertDependencyArtifactsIncludes(dd, new String[] {"myconf3"}, new
String[] {"yourartifact9-2"});
- assertDependencyArtifactsIncludes(dd, new String[] {"myconf4"}, new
String[] {});
+ assertDependencyArtifactsIncludes(dd, new String[] {"myconf1"}, new
String[] {"yourartifact9-1"}, true);
+ assertDependencyArtifactsIncludes(dd, new String[] {"myconf2"}, new
String[] {"yourartifact9-1", "yourartifact9-2"}, true);
+ assertDependencyArtifactsIncludes(dd, new String[] {"myconf3"}, new
String[] {"yourartifact9-2"}, true);
+ assertDependencyArtifactsIncludes(dd, new String[] {"myconf4"}, new
String[] {}, true);
assertDependencyArtifactsExcludes(dd, new String[] {"myconf1"}, new
String[] {});
assertDependencyArtifactsExcludes(dd, new String[] {"myconf2"}, new
String[] {});
assertDependencyArtifactsExcludes(dd, new String[] {"myconf3"}, new
String[] {});
@@ -298,10 +300,10 @@
assertEquals("yourorg", dd.getDependencyId().getOrganisation());
assertEquals("10.1", dd.getDependencyRevisionId().getRevision());
assertEquals(new HashSet(Arrays.asList(new String[] {"*"})), new
HashSet(Arrays.asList(dd.getModuleConfigurations())));
- assertDependencyArtifactsIncludes(dd, new String[] {"myconf1"}, new
String[] {"your.*", PatternMatcher.ANY_EXPRESSION});
- assertDependencyArtifactsIncludes(dd, new String[] {"myconf2"}, new
String[] {"your.*", PatternMatcher.ANY_EXPRESSION});
- assertDependencyArtifactsIncludes(dd, new String[] {"myconf3"}, new
String[] {"your.*", PatternMatcher.ANY_EXPRESSION});
- assertDependencyArtifactsIncludes(dd, new String[] {"myconf4"}, new
String[] {"your.*", PatternMatcher.ANY_EXPRESSION});
+ assertDependencyArtifactsIncludes(dd, new String[] {"myconf1"}, new
String[] {"your.*", PatternMatcher.ANY_EXPRESSION}, false);
+ assertDependencyArtifactsIncludes(dd, new String[] {"myconf2"}, new
String[] {"your.*", PatternMatcher.ANY_EXPRESSION}, false);
+ assertDependencyArtifactsIncludes(dd, new String[] {"myconf3"}, new
String[] {"your.*", PatternMatcher.ANY_EXPRESSION}, false);
+ assertDependencyArtifactsIncludes(dd, new String[] {"myconf4"}, new
String[] {"your.*", PatternMatcher.ANY_EXPRESSION}, false);
assertDependencyArtifactsExcludes(dd, new String[] {"myconf1"}, new
String[] {"toexclude"});
assertDependencyArtifactsExcludes(dd, new String[] {"myconf2"}, new
String[] {"toexclude"});
assertDependencyArtifactsExcludes(dd, new String[] {"myconf3"}, new
String[] {"toexclude"});
Modified:
incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-write-full.xml
URL:
http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-write-full.xml?view=diff&rev=516047&r1=516046&r2=516047
==============================================================================
---
incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-write-full.xml
(original)
+++
incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-write-full.xml
Thu Mar 8 06:19:45 2007
@@ -30,12 +30,12 @@
<dependency org="yourorg" name="yourmodule6"
rev="latest.integration"
conf="myconf2->yourconf1,yourconf2;myconf1->yourconf1"/>
<dependency org="yourorg" name="yourmodule7" rev="7.1"
conf="myconf2->yourconf1,yourconf2;myconf1->yourconf1"/>
<dependency org="yourorg" name="yourmodule8" rev="8.1"
conf="*->*">
- <include name="yourartifact8-2" type="jar" ext="jar"/>
- <include name="yourartifact8-1" type="jar" ext="jar"/>
+ <artifact name="yourartifact8-2" type="jar" ext="jar"/>
+ <artifact name="yourartifact8-1" type="jar" ext="jar"/>
</dependency>
<dependency org="yourorg" name="yourmodule9" rev="9.1"
conf="myconf2->default;myconf3->default;myconf1->default">
- <include name="yourartifact9-1" type="jar" ext="jar"
conf="myconf1,myconf2"/>
- <include name="yourartifact9-2" type="jar" ext="jar"
conf="myconf2,myconf3"/>
+ <artifact name="yourartifact9-1" type="jar" ext="jar"
conf="myconf1,myconf2"/>
+ <artifact name="yourartifact9-2" type="jar" ext="jar"
conf="myconf2,myconf3"/>
</dependency>
<dependency org="yourorg" name="yourmodule10" rev="10.1"
conf="*->*">
<include name="*" type="*" ext="xml"/>