Author: xavier Date: Wed Jul 9 08:44:31 2008 New Revision: 675235 URL: http://svn.apache.org/viewvc?rev=675235&view=rev Log: IMPROVEMENT: Check branch consistency during resolve (IVY-858)
Added: ant/ivy/core/trunk/test/repositories/badfile/ivys/ivy-badbranch.xml (with props) ant/ivy/core/trunk/test/repositories/badfile/myorg/mymodule/ivy-badbranch.xml (with props) Modified: ant/ivy/core/trunk/CHANGES.txt ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/BasicResolver.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=675235&r1=675234&r2=675235&view=diff ============================================================================== --- ant/ivy/core/trunk/CHANGES.txt (original) +++ ant/ivy/core/trunk/CHANGES.txt Wed Jul 9 08:44:31 2008 @@ -94,6 +94,7 @@ - IMPROVEMENT: Parse description and home page from poms (IVY-767) - IMPROVEMENT: Change allownomd and skipbuildwithoutivy into a more semantically correct name (IVY-297) - IMPROVEMENT: Smarter determination if an expression is exact or not for RegexpPatternMatcher and GlobPatternMatcher +- IMPROVEMENT: Check branch consistency during resolve (IVY-858) - FIX: Reports showing double dependencies in certain cases (IVY-578) - FIX: Dynamic revision resolve does not throw error when configuration is missing (IVY-861) Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java?rev=675235&r1=675234&r2=675235&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java Wed Jul 9 08:44:31 2008 @@ -569,6 +569,15 @@ + md.getModuleRevisionId().getName() + "'; "); ok = false; } + if (mrid.getBranch() != null + && !mrid.getBranch().equals(md.getModuleRevisionId().getBranch())) { + Message.error("\t" + getName() + ": bad branch name found in " + ivyRef.getResource() + + ": expected='" + mrid.getBranch() + " found='" + + md.getModuleRevisionId().getBranch() + "'"); + errors.append("bad module name: expected='" + mrid.getBranch() + "' found='" + + md.getModuleRevisionId().getBranch() + "'; "); + ok = false; + } if (ivyRef.getRevision() != null && !ivyRef.getRevision().startsWith("working@")) { ModuleRevisionId expectedMrid = ModuleRevisionId .newInstance(mrid, ivyRef.getRevision()); 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=675235&r1=675234&r2=675235&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 Jul 9 08:44:31 2008 @@ -3089,6 +3089,11 @@ assertTrue("bad module should have raised an error in report", report.hasError()); assertTrue(StringUtils.join(report.getAllProblemMessages().toArray(), "\n").indexOf("'badmodule'") != -1); + report = ivy.resolve(new File("test/repositories/badfile/ivys/ivy-badbranch.xml").toURL(), + getResolveOptions(new String[] {"*"})); + assertTrue("bad branch should have raised an error in report", report.hasError()); + assertTrue(StringUtils.join(report.getAllProblemMessages().toArray(), "\n").indexOf("'badbranch'") != -1); + report = ivy.resolve(new File("test/repositories/badfile/ivys/ivy-badrevision.xml").toURL(), getResolveOptions(new String[] {"*"})); assertTrue("bad revision should have raised an error in report", report.hasError()); Added: ant/ivy/core/trunk/test/repositories/badfile/ivys/ivy-badbranch.xml URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/badfile/ivys/ivy-badbranch.xml?rev=675235&view=auto ============================================================================== --- ant/ivy/core/trunk/test/repositories/badfile/ivys/ivy-badbranch.xml (added) +++ ant/ivy/core/trunk/test/repositories/badfile/ivys/ivy-badbranch.xml Wed Jul 9 08:44:31 2008 @@ -0,0 +1,24 @@ +<!-- + 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. +--> +<ivy-module version="1.0"> + <info organisation="apache" module="test-badbranch"/> + <dependencies> + <dependency org="myorg" name="mymodule" branch="branch1" rev="badbranch"/> + </dependencies> +</ivy-module> Propchange: ant/ivy/core/trunk/test/repositories/badfile/ivys/ivy-badbranch.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ant/ivy/core/trunk/test/repositories/badfile/ivys/ivy-badbranch.xml ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ant/ivy/core/trunk/test/repositories/badfile/myorg/mymodule/ivy-badbranch.xml URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/badfile/myorg/mymodule/ivy-badbranch.xml?rev=675235&view=auto ============================================================================== --- ant/ivy/core/trunk/test/repositories/badfile/myorg/mymodule/ivy-badbranch.xml (added) +++ ant/ivy/core/trunk/test/repositories/badfile/myorg/mymodule/ivy-badbranch.xml Wed Jul 9 08:44:31 2008 @@ -0,0 +1,21 @@ +<!-- + 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. +--> +<ivy-module version="1.1"> + <info organisation="myorg" module="mymodule" branch="badbranch" revision="badbranch"/> +</ivy-module> Propchange: ant/ivy/core/trunk/test/repositories/badfile/myorg/mymodule/ivy-badbranch.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ant/ivy/core/trunk/test/repositories/badfile/myorg/mymodule/ivy-badbranch.xml ------------------------------------------------------------------------------ svn:mime-type = text/plain