当前位置: 首页>>代码示例>>Java>>正文


Java Message.setDefaultLogger方法代码示例

本文整理汇总了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));
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:17,代码来源:IvyPublishTest.java

示例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");
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:20,代码来源:RetrieveTest.java

示例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");
    }
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:20,代码来源:RetrieveTest.java

示例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);
    }
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:22,代码来源:PackagerResolverTest.java

示例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());
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:16,代码来源:DefaultIvyContextManager.java

示例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"));
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:9,代码来源:OSGiManifestParserTest.java

示例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));
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:8,代码来源:RetrieveTest.java

示例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"));
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:9,代码来源:XmlModuleDescriptorParserTest.java

示例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");
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:11,代码来源:LogTriggerTest.java

示例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);
}
 
开发者ID:apache,项目名称:ant-ivyde,代码行数:9,代码来源:IvyConsole.java

示例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());
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:50,代码来源:XmlModuleDescriptorParserTest.java


注:本文中的org.apache.ivy.util.Message.setDefaultLogger方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。