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


Java DefaultMessageLogger类代码示例

本文整理汇总了Java中org.apache.ivy.util.DefaultMessageLogger的典型用法代码示例。如果您正苦于以下问题:Java DefaultMessageLogger类的具体用法?Java DefaultMessageLogger怎么用?Java DefaultMessageLogger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DefaultMessageLogger类属于org.apache.ivy.util包,在下文中一共展示了DefaultMessageLogger类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setUp

import org.apache.ivy.util.DefaultMessageLogger; //导入依赖的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: setUp

import org.apache.ivy.util.DefaultMessageLogger; //导入依赖的package包/类
@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();
    f.delete(); // we want to use the file as a directory, so we delete the file itself
    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);
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:24,代码来源:DefaultRepositoryCacheManagerTest.java

示例3: setUp

import org.apache.ivy.util.DefaultMessageLogger; //导入依赖的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

示例4: initMessage

import org.apache.ivy.util.DefaultMessageLogger; //导入依赖的package包/类
private static void initMessage(CommandLine line, Ivy ivy) {
    if (line.hasOption("debug")) {
        ivy.getLoggerEngine().pushLogger(new DefaultMessageLogger(Message.MSG_DEBUG));
    } else if (line.hasOption("verbose")) {
        ivy.getLoggerEngine().pushLogger(new DefaultMessageLogger(Message.MSG_VERBOSE));
    } else if (line.hasOption("warn")) {
        ivy.getLoggerEngine().pushLogger(new DefaultMessageLogger(Message.MSG_WARN));
    } else if (line.hasOption("error")) {
        ivy.getLoggerEngine().pushLogger(new DefaultMessageLogger(Message.MSG_ERR));
    } else {
        ivy.getLoggerEngine().pushLogger(new DefaultMessageLogger(Message.MSG_INFO));
    }
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:14,代码来源:Main.java

示例5: setUp

import org.apache.ivy.util.DefaultMessageLogger; //导入依赖的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

示例6: setUp

import org.apache.ivy.util.DefaultMessageLogger; //导入依赖的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

示例7: setUp

import org.apache.ivy.util.DefaultMessageLogger; //导入依赖的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

示例8: configure

import org.apache.ivy.util.DefaultMessageLogger; //导入依赖的package包/类
public Ivy configure() throws Exception {

        boolean verbose = System.getProperty("verbose") != null;
        boolean debug = System.getProperty("debug") != null;
        HumanReadyLogger humanReadyLogger = new HumanReadyLogger();

        IvySettings ivySettings = new IvySettings();
        new SettingsParser(humanReadyLogger).parse(ivySettings, new File(framework, "framework/dependencies.yml"));
        new SettingsParser(humanReadyLogger).parse(ivySettings, new File(application, "conf/dependencies.yml"));
        ivySettings.setDefaultResolver("mavenCentral");
        ivySettings.setDefaultUseOrigin(true);
        PlayConflictManager conflictManager = new PlayConflictManager();
        ivySettings.addConflictManager("playConflicts", conflictManager);
        ivySettings.addConflictManager("defaultConflicts", conflictManager.deleguate);
        ivySettings.setDefaultConflictManager(conflictManager);

        Ivy ivy = Ivy.newInstance(ivySettings);

        // Default ivy config see: http://play.lighthouseapp.com/projects/57987-play-framework/tickets/807
        File ivyDefaultSettings = new File(userHome, ".ivy2/ivysettings.xml");
        if(ivyDefaultSettings.exists()) {
            ivy.configure(ivyDefaultSettings);
        }

        if (debug) {
            ivy.getLoggerEngine().pushLogger(new DefaultMessageLogger(Message.MSG_DEBUG));
        } else if (verbose) {
            ivy.getLoggerEngine().pushLogger(new DefaultMessageLogger(Message.MSG_INFO));
        } else {
            logger = humanReadyLogger;
            ivy.getLoggerEngine().setDefaultLogger(logger);
        }

        ivy.pushContext();

        return ivy;
    }
 
开发者ID:eBay,项目名称:restcommander,代码行数:38,代码来源:DependenciesManager.java

示例9: Retrieve

import org.apache.ivy.util.DefaultMessageLogger; //导入依赖的package包/类
public Retrieve(URL ivySettings, String cacheDir) throws Exception {
	this.ivySettings = ivySettings;
	this.cacheDir = cacheDir;
	
	ivy = Ivy.newInstance();
	ivy.setVariable("cache", cacheDir);
	
	if (!log.isDebugEnabled()) {
		ivy.setVariable("log", "quiet");
		ivy.getLoggerEngine().setDefaultLogger(new DefaultMessageLogger(Message.MSG_ERR));
	} 
	
	ivy.configure(ivySettings);
	
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:16,代码来源:Retrieve.java

示例10: Discover

import org.apache.ivy.util.DefaultMessageLogger; //导入依赖的package包/类
public Discover(URL ivySettings, String cacheDir) throws Exception {
	this.ivySettings = ivySettings;
	this.cacheDir = cacheDir;

	ivy = Ivy.newInstance();
	ivy.setVariable("cache", cacheDir);

	if (!log.isDebugEnabled()) {
		ivy.setVariable("log", "quiet");
		ivy.getLoggerEngine().setDefaultLogger(new DefaultMessageLogger(Message.MSG_ERR));
	}
	
	ivy.configure(ivySettings);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:15,代码来源:Discover.java

示例11: testExtendsAll

import org.apache.ivy.util.DefaultMessageLogger; //导入依赖的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.DefaultMessageLogger类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。