FIX: bad tests for conflict managers use the ivy default cache instead of a fresh one

FIX: set last modified from artifact resource when generating default ivy file (related to IVY-407)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ivy/core/trunk@515980 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Xavier Hanin 2007-03-08 09:17:54 +00:00
parent 893234abb5
commit 86826f5e59
10 changed files with 41 additions and 5 deletions

View File

@ -20,6 +20,7 @@ package org.apache.ivy.core.resolve;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;

View File

@ -221,6 +221,10 @@ public abstract class BasicResolver extends AbstractResolver {
}
return null;
} else {
long lastModified = artifactRef.getLastModified();
if (lastModified != 0 && md instanceof DefaultModuleDescriptor) {
((DefaultModuleDescriptor) md).setLastModified(lastModified);
}
Message.verbose("\t"+getName()+": no ivy file found for "+mrid+": using default data");
logIvyNotFound(mrid);
if (isDynamic) {

View File

@ -30,15 +30,23 @@ import org.apache.ivy.core.report.ConfigurationResolveReport;
import org.apache.ivy.core.report.ResolveReport;
import org.apache.ivy.core.resolve.IvyNode;
import org.apache.ivy.core.resolve.ResolveOptions;
import org.apache.ivy.util.FileUtil;
public class LatestConflictManagerTest extends TestCase {
private Ivy ivy;
private File _cache;
protected void setUp() throws Exception {
ivy = new Ivy();
ivy.configure(LatestConflictManagerTest.class
.getResource("ivyconf-latest.xml"));
_cache = new File("build/cache");
_cache.mkdirs();
}
protected void tearDown() throws Exception {
FileUtil.forceDelete(_cache);
}
// Test case for issue IVY-388

View File

@ -21,23 +21,33 @@ package org.apache.ivy.plugins.conflict;
* @author Anders janmyr
*/
import java.io.File;
import junit.framework.TestCase;
import org.apache.ivy.Ivy;
import org.apache.ivy.core.cache.CacheManager;
import org.apache.ivy.core.resolve.ResolveOptions;
import org.apache.ivy.util.FileUtil;
public class RegexpConflictManagerTest extends TestCase
{
private Ivy ivy;
private File _cache;
protected void setUp() throws Exception
{
ivy = new Ivy();
ivy.configure( RegexpConflictManagerTest.class
.getResource( "ivyconf-regexp-test.xml" ) );
_cache = new File("build/cache");
_cache.mkdirs();
}
protected void tearDown() throws Exception {
FileUtil.forceDelete(_cache);
}
public void testNoApiConflictResolve() throws Exception
{

View File

@ -17,18 +17,29 @@
*/
package org.apache.ivy.plugins.conflict;
import java.io.File;
import junit.framework.TestCase;
import org.apache.ivy.Ivy;
import org.apache.ivy.core.cache.CacheManager;
import org.apache.ivy.core.resolve.ResolveOptions;
import org.apache.ivy.util.FileUtil;
public class StrictConflictManagerTest extends TestCase {
private Ivy ivy;
private File _cache;
protected void setUp() throws Exception {
ivy = new Ivy();
ivy.configure(StrictConflictManagerTest.class.getResource("ivyconf-strict-test.xml"));
_cache = new File("build/cache");
_cache.mkdirs();
}
protected void tearDown() throws Exception {
FileUtil.forceDelete(_cache);
}
public void testInitFromConf() throws Exception {
ConflictManager cm = ivy.getSettings().getDefaultConflictManager();

View File

@ -1,6 +1,6 @@
<ivyconf>
<conf defaultResolver="test" defaultConflictManager="latest-time" />
<conf defaultCache="build/cache" defaultResolver="test" defaultConflictManager="latest-time" />
<resolvers>
<filesystem name="test" latest="latest-time" checkmodified="true">

View File

@ -1,6 +1,6 @@
<ivyconf>
<conf defaultResolver="test" defaultConflictManager="latest-time" />
<conf defaultCache="build/cache" defaultResolver="test" defaultConflictManager="latest-time" />
<resolvers>
<filesystem name="test">

View File

@ -1,6 +1,6 @@
<ivyconf>
<conf defaultResolver="test"/>
<conf defaultCache="build/cache" defaultResolver="test"/>
<resolvers>
<filesystem name="test">

View File

@ -1,6 +1,7 @@
<ivyconf>
<conf defaultResolver="test"
<conf defaultCache="build/cache"
defaultResolver="test"
defaultConflictManager="regexp"
/>

View File

@ -1,6 +1,7 @@
<ivyconf>
<conf defaultResolver="test"
<conf defaultCache="build/cache"
defaultResolver="test"
defaultConflictManager="strict"
/>