use of org.apache.ivy.util.DefaultMessageLogger in project ant-ivy by apache.
the class XmlModuleDescriptorParserTest method testExtendsAll.
@Test
public void testExtendsAll() throws Exception {
Message.setDefaultLogger(new DefaultMessageLogger(99));
// default extends type is 'all' when no extendsType attribute is specified.
ModuleDescriptor md = XmlModuleDescriptorParser.getInstance().parseDescriptor(settings, getClass().getResource("test-extends-all.xml"), true);
assertNotNull(md);
assertEquals("myorg", md.getModuleRevisionId().getOrganisation());
assertEquals("mymodule", md.getModuleRevisionId().getName());
assertEquals("myrev", md.getModuleRevisionId().getRevision());
assertEquals("integration", md.getStatus());
// verify that the parent description was merged.
assertEquals("Parent module description.", md.getDescription());
// verify that the parent and child configurations were merged together.
final Configuration[] expectedConfs = { new Configuration("default"), new Configuration("conf1"), new Configuration("conf2") };
assertNotNull(md.getConfigurations());
assertEquals(Arrays.asList(expectedConfs), Arrays.asList(md.getConfigurations()));
// verify parent and child dependencies were merged together.
DependencyDescriptor[] deps = md.getDependencies();
assertNotNull(deps);
assertEquals(2, deps.length);
assertEquals(Collections.singletonList("default"), Arrays.asList(deps[0].getModuleConfigurations()));
ModuleRevisionId dep = deps[0].getDependencyRevisionId();
assertEquals("myorg", dep.getModuleId().getOrganisation());
assertEquals("mymodule1", dep.getModuleId().getName());
assertEquals("1.0", dep.getRevision());
assertEquals(Arrays.asList("conf1", "conf2"), Arrays.asList(deps[1].getModuleConfigurations()));
dep = deps[1].getDependencyRevisionId();
assertEquals("myorg", dep.getModuleId().getOrganisation());
assertEquals("mymodule2", dep.getModuleId().getName());
assertEquals("2.0", dep.getRevision());
// verify only child publications are present
Artifact[] artifacts = md.getAllArtifacts();
assertNotNull(artifacts);
assertEquals(1, artifacts.length);
assertEquals("mymodule", artifacts[0].getName());
assertEquals("jar", artifacts[0].getType());
}
use of org.apache.ivy.util.DefaultMessageLogger in project ant-ivy by apache.
the class XmlModuleDescriptorParserTest method setUp.
@Before
public void setUp() {
Message.setDefaultLogger(new DefaultMessageLogger(Message.MSG_WARN));
this.settings = new IvySettings();
// prevent test from polluting local cache
settings.setDefaultCache(new File("build/cache"));
}
use of org.apache.ivy.util.DefaultMessageLogger in project ant-ivy by apache.
the class DefaultRepositoryCacheManagerTest method setUp.
@Before
public void setUp() throws Exception {
File f = File.createTempFile("ivycache", ".dir");
ivy = new Ivy();
ivy.configureDefault();
ivy.getLoggerEngine().setDefaultLogger(new DefaultMessageLogger(Message.MSG_DEBUG));
IvyContext.pushNewContext().setIvy(ivy);
IvySettings settings = ivy.getSettings();
// we want to use the file as a directory, so we delete the file itself
f.delete();
cacheManager = new DefaultRepositoryCacheManager();
cacheManager.setSettings(settings);
cacheManager.setBasedir(f);
artifact = createArtifact("org", "module", "rev", "name", "type", "ext");
Artifact originArtifact = createArtifact("org", "module", "rev", "name", "pom.original", "pom");
origin = new ArtifactOrigin(originArtifact, true, "file:/some/where.pom");
cacheManager.saveArtifactOrigin(originArtifact, origin);
cacheManager.saveArtifactOrigin(artifact, origin);
}
use of org.apache.ivy.util.DefaultMessageLogger in project ant-ivy by apache.
the class RetrieveTest method setUp.
@Before
public void setUp() throws Exception {
ivy = Ivy.newInstance();
ivy.configure(new File("test/repositories/ivysettings.xml"));
TestHelper.createCache();
Message.setDefaultLogger(new DefaultMessageLogger(Message.MSG_INFO));
}
use of org.apache.ivy.util.DefaultMessageLogger in project ant-ivy by apache.
the class OSGiManifestParserTest method setUp.
@Before
public void setUp() {
Message.setDefaultLogger(new DefaultMessageLogger(Message.MSG_WARN));
settings = new IvySettings();
// prevent test from polluting local cache
settings.setDefaultCache(new File("build/cache"));
}
Aggregations