本文整理汇总了Java中org.apache.ivy.util.Message.setDefaultLogger方法的典型用法代码示例。如果您正苦于以下问题:Java Message.setDefaultLogger方法的具体用法?Java Message.setDefaultLogger怎么用?Java Message.setDefaultLogger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ivy.util.Message
的用法示例。
在下文中一共展示了Message.setDefaultLogger方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import org.apache.ivy.util.Message; //导入方法依赖的package包/类
@Before
public void setUp() {
cleanTestDir();
cleanRep();
createCache();
project = TestHelper.newProject();
project.init();
project.setProperty("ivy.settings.file", "test/repositories/ivysettings.xml");
project.setProperty("build", "build/test/publish");
publish = new IvyPublish();
publish.setProject(project);
System.setProperty("ivy.cache.dir", cache.getAbsolutePath());
Message.setDefaultLogger(new DefaultMessageLogger(10));
}
示例2: testRetrieveSameFileConflict
import org.apache.ivy.util.Message; //导入方法依赖的package包/类
@Test
public void testRetrieveSameFileConflict() throws Exception {
// mod1.1 depends on mod1.2
ResolveReport report = ivy.resolve(new File(
"test/repositories/1/org1/mod1.4/ivys/ivy-1.0.1.xml").toURI().toURL(),
getResolveOptions(new String[] {"*"}));
assertNotNull(report);
ModuleDescriptor md = report.getModuleDescriptor();
assertNotNull(md);
String pattern = "build/test/retrieve/[module]/[artifact]-[revision].[ext]";
MockMessageLogger mockLogger = new MockMessageLogger();
Message.setDefaultLogger(mockLogger);
ivy.retrieve(md.getModuleRevisionId(),
getRetrieveOptions().setDestArtifactPattern(pattern));
assertTrue(new File(IvyPatternHelper.substitute(pattern, "org1", "mod1.2", "2.2", "mod1.2",
"jar", "jar", "default")).exists());
mockLogger.assertLogDoesntContain("conflict on");
}
示例3: testRetrieveDifferentArtifactsOfSameModuleToSameFile
import org.apache.ivy.util.Message; //导入方法依赖的package包/类
@Test(expected = RuntimeException.class)
public void testRetrieveDifferentArtifactsOfSameModuleToSameFile() throws Exception {
ResolveReport report = ivy.resolve(new File(
"test/repositories/1/org2/mod2.2/ivys/ivy-0.5.xml").toURI().toURL(),
getResolveOptions(new String[] {"*"}));
assertNotNull(report);
ModuleDescriptor md = report.getModuleDescriptor();
assertNotNull(md);
String pattern = "build/test/retrieve/[module]/[module].[ext]";
MockMessageLogger mockLogger = new MockMessageLogger();
Message.setDefaultLogger(mockLogger);
try {
ivy.retrieve(md.getModuleRevisionId(),
getRetrieveOptions().setDestArtifactPattern(pattern));
} finally {
mockLogger.assertLogDoesntContain("multiple artifacts");
}
}
示例4: setUp
import org.apache.ivy.util.Message; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
Message.setDefaultLogger(new DefaultMessageLogger(99));
settings = new IvySettings();
ResolveEngine engine = new ResolveEngine(settings, new EventManager(), new SortEngine(
settings));
cache = new File("build/cache");
data = new ResolveData(engine, new ResolveOptions());
cache.mkdirs();
settings.setDefaultCache(cache);
// Create work space with build and resource cache directories
workdir = new File("build/test/PackagerResolverTest");
builddir = new File(workdir, "build");
cachedir = new File(workdir, "resources");
cleanupTempDirs();
if (!builddir.mkdirs() || !cachedir.mkdirs()) {
throw new Exception("can't create directories under " + workdir);
}
}
示例5: getIvy
import org.apache.ivy.util.Message; //导入方法依赖的package包/类
private Ivy getIvy() {
lock.lock();
try {
if (!cached.isEmpty()) {
return cached.removeFirst();
}
if (!messageAdapterAttached) {
Message.setDefaultLogger(new IvyLoggingAdaper());
messageAdapterAttached = true;
}
} finally {
lock.unlock();
}
return Ivy.newInstance(new IvySettings());
}
示例6: setUp
import org.apache.ivy.util.Message; //导入方法依赖的package包/类
@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"));
}
示例7: setUp
import org.apache.ivy.util.Message; //导入方法依赖的package包/类
@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));
}
示例8: setUp
import org.apache.ivy.util.Message; //导入方法依赖的package包/类
@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"));
}
示例9: testMessage
import org.apache.ivy.util.Message; //导入方法依赖的package包/类
@Test
public void testMessage() {
trigger.setMessage("msg: ${organisation} ${module} ${revision}");
MockMessageLogger mockLogger = new MockMessageLogger();
Message.setDefaultLogger(mockLogger);
trigger.progress(ev);
mockLogger.assertLogInfoContains("msg: o A 1");
}
示例10: IvyConsole
import org.apache.ivy.util.Message; //导入方法依赖的package包/类
public IvyConsole(String name, ImageDescriptor imageDescriptor) {
super(name, imageDescriptor);
consoleManager = ConsolePlugin.getDefault().getConsoleManager();
document = new ConsoleDocument();
Message.setDefaultLogger(this);
logLevel = IvyPlugin.getPreferenceStoreHelper().getIvyConsoleLogLevel();
ivyDEMessageLogger = new IvyDEMessageLogger(this);
}
示例11: testExtendsAll
import org.apache.ivy.util.Message; //导入方法依赖的package包/类
@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());
}