Java 类org.apache.maven.plugin.testing.SilentLog 实例源码

项目:Pogamut3    文件:DependencyTestUtils.java   
/**
 * Deletes a directory and its contents.
 * 
 * @param dir
 *            The base directory of the included and excluded files.
 * @throws IOException
 * @throws MojoExecutionException
 *             When a directory failed to get deleted.
 */
public static void removeDirectory( File dir )
    throws IOException
{
    if ( dir != null )
    {
        Log log = new SilentLog();
        FileSetManager fileSetManager = new FileSetManager( log, false );

        FileSet fs = new FileSet();
        fs.setDirectory( dir.getPath() );
        fs.addInclude( "**/**" );
        fileSetManager.delete( fs );

    }
}
项目:android-ndk-maven-plugin    文件:NativeHelperTest.java   
@Before
public void setupNativeHelper() {
    MavenProject project = new MavenProject();
    project.setDependencyArtifacts(Collections.<Artifact>emptySet());

    ArtifactStub apklib = new ArtifactStub() {
        @Override
        public String getId() {
            return getArtifactId();
        }
    };
    apklib.setArtifactId("some-apklib");
    apklib.setGroupId("group");
    apklib.setType(AndroidExtension.APKLIB);
    project.addAttachedArtifact(apklib);

    final DependencyGraphBuilder dependencyGraphBuilder = new DefaultDependencyGraphBuilder();
    nativeHelper = new NativeHelper(project, dependencyGraphBuilder, new SilentLog());
}
项目:byte-buddy    文件:ByteBuddyMojoTest.java   
private void execute(String goal, String target) throws Exception {
    Mojo mojo = mojoRule.lookupMojo(goal, new File("src/test/resources/net/bytebuddy/test/" + target + ".pom.xml"));
    if (goal.equals("transform")) {
        mojoRule.setVariableValueToObject(mojo, "outputDirectory", project.getAbsolutePath());
        mojoRule.setVariableValueToObject(mojo, "compileClasspathElements", Collections.emptyList());
    } else if (goal.equals("transform-test")) {
        mojoRule.setVariableValueToObject(mojo, "testOutputDirectory", project.getAbsolutePath());
        mojoRule.setVariableValueToObject(mojo, "testClasspathElements", Collections.emptyList());
    } else {
        throw new AssertionError("Unknown goal: " + goal);
    }
    mojoRule.setVariableValueToObject(mojo, "repositorySystem", repositorySystem);
    mojoRule.setVariableValueToObject(mojo, "groupId", FOO);
    mojoRule.setVariableValueToObject(mojo, "artifactId", BAR);
    mojoRule.setVariableValueToObject(mojo, "version", QUX);
    mojo.setLog(new SilentLog());
    mojo.execute();
}
项目:maven-confluence-plugin    文件:GitLogJiraIssuesRendererTest.java   
public static GitLogJiraIssuesRenderer createRendererWithParams(String currentVersion,
                                                                CalculateRuleForSinceTagName rule) {

    return new GitLogJiraIssuesRenderer(
            null,
            null,
            null,
            null,
            currentVersion,
            rule,
            null,
            null,
            new SilentLog());

}
项目:xml-maven-plugin    文件:AbstractXmlMojoTestCase.java   
protected AbstractXmlMojo newMojo( String pDir )
        throws Exception
    {
        File testPom = new File( new File( getBasedir(), pDir ), "pom.xml" );

        MavenExecutionRequest executionRequest = new DefaultMavenExecutionRequest();
        ProjectBuildingRequest buildingRequest = executionRequest.getProjectBuildingRequest();
        ProjectBuilder projectBuilder = this.lookup(ProjectBuilder.class);
        MavenProject project = projectBuilder.build(testPom, buildingRequest).getProject();
//        final Build build = new Build();
//        build.setDirectory( "target" );
//        project.setBuild(build);
        project.getBuild().setDirectory("target");
        AbstractXmlMojo vm = (AbstractXmlMojo) lookupConfiguredMojo(project, getGoal());
        setVariableValueToObject( vm, "basedir", new File( getBasedir(), pDir ) );
        final Log log = new SilentLog();
        DefaultResourceManager rm = new DefaultResourceManager();
        setVariableValueToObject( rm, "logger", log );
        setVariableValueToObject( vm, "locator", rm );
        final Map<String, ResourceLoader> resourceLoaders = new HashMap<String, ResourceLoader>();
        resourceLoaders.put( "file", new FileResourceLoader() );
        resourceLoaders.put( "jar", new JarResourceLoader() );
        resourceLoaders.put( "classloader", new ThreadContextClasspathResourceLoader() );
        URLResourceLoader url = new URLResourceLoader();
        setVariableValueToObject( url, "logger", log );
        resourceLoaders.put( "url", url );
        setVariableValueToObject( rm, "resourceLoaders", resourceLoaders );

//        MavenProjectStub project = new MavenProjectStub()
//        {
//            public Build getBuild()
//            {
//                return build;
//            }
//        };
//        setVariableValueToObject( vm, "project", project );
        return vm;
    }
项目:incubator-taverna-osgi    文件:TestUtils.java   
@Test
public void getJavaPackages() throws Exception {
    Log log = new SilentLog();
    Set<String> packages = Utils.getJavaPackages(log);
    assertTrue(packages.contains("java.util"));
    assertTrue(packages.contains("org.xml.sax.helpers"));
    for (String pkg: packages) { 
        assertFalse(pkg.isEmpty());
        assertFalse(pkg.contains(" "));
        assertFalse(pkg.contains("#"));
        assertTrue(pkg.contains("."));
    }
}