本文整理汇总了Java中org.apache.maven.plugin.logging.SystemStreamLog类的典型用法代码示例。如果您正苦于以下问题:Java SystemStreamLog类的具体用法?Java SystemStreamLog怎么用?Java SystemStreamLog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SystemStreamLog类属于org.apache.maven.plugin.logging包,在下文中一共展示了SystemStreamLog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testFindArtifactInRepository
import org.apache.maven.plugin.logging.SystemStreamLog; //导入依赖的package包/类
@Test
public void testFindArtifactInRepository() throws MojoExecutionException {
GenerateMojo mojo = new GenerateMojo();
mojo.setLog(new SystemStreamLog());
Dependency dependency = mojo.findArtifactInRepository(
new DefaultArtifact("org.spigotmc", "spigot-api", "1.8-R0.1-SNAPSHOT",
"compile", "jar", "jar", new DefaultArtifactHandler()),
new MavenArtifactRepository("yawkat",
"http://mvn.yawk.at",
new DefaultRepositoryLayout(),
new ArtifactRepositoryPolicy(),
new ArtifactRepositoryPolicy())
);
Assert.assertNotNull(dependency);
}
示例2: setUp
import org.apache.maven.plugin.logging.SystemStreamLog; //导入依赖的package包/类
@Before
public void setUp() throws RendererException, IOException {
reportFile = new File(tmpFolder.getRoot(), REPORT_FILE);
final Sink sink = new SiteRendererSink(new RenderingContext(tmpFolder.getRoot(), REPORT_FILE));
plugin = new ReportMojo() {
@Override
public Sink getSink() {
return sink;
};
};
// Use XHTML5 as it is much faster
plugin.setXhtmlSchema(HtmlValidator.XHTML5);
plugin.setLog(new SystemStreamLog());
}
示例3: setUp
import org.apache.maven.plugin.logging.SystemStreamLog; //导入依赖的package包/类
/**
* Initializes some pre-defined {@link Properties}.
*/
public void setUp() {
log = spy(new SystemStreamLog());
logger = new L10nValidatorLogger(log);
items = new ArrayList<L10nReportItem>();
Collection<PropertiesFile> propertiesFiles = new ArrayList<PropertiesFile>();
root = new Properties();
bundleA = new Properties();
bundleB = new Properties();
bundleC = new Properties();
bundleD = new Properties();
bundleE = new Properties();
propertiesFiles.add(new BundlePropertiesFile("Bundle", root));
propertiesFiles.add(new BundlePropertiesFile("Bundle_A", bundleA));
propertiesFiles.add(new BundlePropertiesFile("Bundle_B", bundleB));
propertiesFiles.add(new BundlePropertiesFile("Bundle_C", bundleC));
propertiesFiles.add(new BundlePropertiesFile("Bundle_D", bundleD));
propertiesFiles.add(new BundlePropertiesFile("Bundle_E", bundleE));
propertiesFamily = new BundlePropertiesFamily(propertiesFiles);
}
示例4: getsFileURIFromJarFileURICorrectly
import org.apache.maven.plugin.logging.SystemStreamLog; //导入依赖的package包/类
@Test
public void getsFileURIFromJarFileURICorrectly() throws URISyntaxException,
MalformedURLException, IOException {
final URI jarURI = Object.class.getResource("Object.class").toURI();
final String jarURIString = jarURI.toString();
final String partJarURIString = jarURIString.substring(0,
jarURIString.indexOf(JarURILastModifiedResolver.SEPARATOR));
final URI partJarURI = new URI(partJarURIString);
final URILastModifiedResolver resolver = new CompositeURILastModifiedResolver(
new SystemStreamLog());
final URI fileURI = getClass().getResource(
getClass().getSimpleName() + ".class").toURI();
Assert.assertNotNull(resolver.getLastModified(jarURI));
Assert.assertNotNull(resolver.getLastModified(partJarURI));
Assert.assertNotNull(resolver.getLastModified(fileURI));
// Switch to true to tests HTTP/HTTPs
boolean online = false;
if (online) {
final URI httpsURI = new URI("https://ya.ru/");
final URI httpURI = new URI("http://schemas.opengis.net/ogc_schema_updates.rss");
Assert.assertNotNull(resolver.getLastModified(httpsURI));
Assert.assertNotNull(resolver.getLastModified(httpURI));
}
}
示例5: setUp
import org.apache.maven.plugin.logging.SystemStreamLog; //导入依赖的package包/类
@Before
public void setUp() throws IOException {
nodeDirectory = new File("target/test/node");
nodeDirectory.mkdirs();
Log log = new SystemStreamLog();
NodeManager manager = new NodeManager(log, nodeDirectory, mojo);
manager.installIfNotInstalled();
mojo = new TypeScriptMojo();
mojo.basedir = new File(FAKE_PROJECT);
mojo.buildDirectory = new File(FAKE_PROJECT_TARGET);
mojo.buildDirectory.mkdirs();
mojo.version = "1.4.1";
mojo.removeComments = false;
mojo.declaration = true;
mojo.module = "commonjs";
mojo.sourcemap = true;
mojo.noImplicitAny = false;
}
示例6: testCreate
import org.apache.maven.plugin.logging.SystemStreamLog; //导入依赖的package包/类
public void testCreate() throws Exception {
Log log = new SystemStreamLog();
Workspace workspace = printInfo("Building using BND Build..", log, getWorkspace(new File("/Users/tonit/devel/rebaze/workspaceBNDBridge")));
Project workspaceProject = workspace.getProject("test-impl");
log.info("Project nobundle : " + workspaceProject.isNoBundles());
File[] files = workspaceProject.build();
if (files != null) {
for (File f : files) {
log.info("OUT " + f.getAbsolutePath());
}
}else{
for (String err : workspaceProject.getErrors()) {
log.error(err);
}
throw new RuntimeException("No output from build!");
}
Utils.printInfo("Build done: " + workspaceProject.getName(), log, workspace);
workspace.close();
}
示例7: setUp
import org.apache.maven.plugin.logging.SystemStreamLog; //导入依赖的package包/类
@Before
public void setUp() throws IOException {
nodeDirectory = new File("target/test/node");
nodeDirectory.mkdirs();
Log log = new SystemStreamLog();
AbstractWisdomMojo mojo = new AbstractWisdomMojo() {
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
// Do nothing.
}
};
mojo.basedir = this.baseDir;
manager = new NodeManager(log, nodeDirectory, mojo);
File assets = new File(baseDir, "src/main/resources/assets");
assets.mkdirs();
FileUtils.copyDirectory(new File("src/test/resources"), assets);
}
示例8: testGetValidClasses
import org.apache.maven.plugin.logging.SystemStreamLog; //导入依赖的package包/类
@Test
public void testGetValidClasses() throws Exception
{
Log log = new SystemStreamLog();
ApiSource apiSource = new ApiSource();
apiSource.setLocations(Collections.singletonList(this.getClass().getPackage().getName()));
apiSource.setSwaggerDirectory("./");
SpringMavenDocumentSource springMavenDocumentSource = new SpringMavenDocumentSource(apiSource, log, "UTF-8");
Set<Class<?>> validClasses = springMavenDocumentSource.getValidClasses();
Assert.assertEquals(validClasses.size(), 2);
Assert.assertTrue(validClasses.contains(ExampleController1.class));
Assert.assertTrue(validClasses.contains(ExampleController2.class));
}
示例9: getDefaultDistro_singledistro_singleinheritance
import org.apache.maven.plugin.logging.SystemStreamLog; //导入依赖的package包/类
/**
* Tests that requesting the default distro which is not available in a
* given @{TargetConfiguration} instance but in its parent.
*
* @throws Exception
*/
@Test
public void getDefaultDistro_singledistro_singleinheritance()
throws Exception {
String distro = "bla";
TargetConfiguration t1 = new TargetConfiguration("t1");
t1.setDistro(distro);
TargetConfiguration t2 = new TargetConfiguration("t2");
t2.parent = "t1";
List<TargetConfiguration> tcs = new ArrayList<TargetConfiguration>();
tcs.add(t1);
tcs.add(t2);
Utils.mergeAllConfigurations(tcs);
Assert.assertEquals(distro,
Utils.getDefaultDistro("t2", tcs, new SystemStreamLog()));
}
示例10: testXML
import org.apache.maven.plugin.logging.SystemStreamLog; //导入依赖的package包/类
@Test
public void testXML() throws URISyntaxException, MojoExecutionException, IOException {
processor = new ScriptProcessorXML();
processor.setInitializeNamePrefix("sampleproject-update-");
processor.setLog(new SystemStreamLog());
File input = new File(getClass().getResource("/src/scripts").toURI());
File xml_output = new File(new File(getClass().getResource("/").toURI()), "xml_output");
File resource = new File(getClass()
.getResource("/src/resources/hippoecm-extension.xml").toURI());
File targetResource = new File(xml_output, "hippoecm-extension.xml");
if(xml_output.exists()){
FileUtils.deleteDirectory(xml_output);
assertFalse(xml_output.exists());
}
//Preparation: existing ecm-extension.xml in target
targetResource.mkdirs();
Files.copy(resource.toPath(), targetResource.toPath(), StandardCopyOption.REPLACE_EXISTING);
processor.setSourceDir(input);
processor.setTargetDir(xml_output);
processor.processUpdateScripts(getScriptClasses(input));
File xml_expected = new File(getClass().getResource("/target_xml").toURI());
compareFolders(xml_expected, xml_output);
}
示例11: testYaml
import org.apache.maven.plugin.logging.SystemStreamLog; //导入依赖的package包/类
@Test
public void testYaml() throws URISyntaxException, MojoExecutionException, IOException {
processor = new ScriptProcessorYAML();
processor.setInitializeNamePrefix("my-hippo-updater-");
processor.setLog(new SystemStreamLog());
File input = new File(getClass().getResource("/src/scripts").toURI());
File yaml_output = new File(new File(getClass().getResource("/").toURI()), "yaml_output");
File resource = new File(getClass()
.getResource("/src/resources/hcm-actions.yaml").toURI());
File targetResource = new File(yaml_output, "hcm-actions.yaml");
if(yaml_output.exists()){
FileUtils.deleteDirectory(yaml_output);
assertFalse(yaml_output.exists());
}
processor.setSourceDir(input);
processor.setTargetDir(yaml_output);
((ScriptProcessorYAML)processor).setYamlPath("hcm-content/configuration/update");
if(yaml_output.exists()){
FileUtils.deleteDirectory(yaml_output);
assertFalse(yaml_output.exists());
}
targetResource.mkdirs();
Files.copy(resource.toPath(), targetResource.toPath(), StandardCopyOption.REPLACE_EXISTING);
processor.processUpdateScripts(getScriptClasses(input));
File yaml_expected = new File(getClass().getResource("/target_yaml").toURI());
compareFolders(yaml_expected, yaml_output);
}
示例12: testAvrohuggerGenerator
import org.apache.maven.plugin.logging.SystemStreamLog; //导入依赖的package包/类
public void testAvrohuggerGenerator() throws IOException {
Path inputDirectory = Paths.get(getBasedir()).resolve("src/test/resources/unit/avrohugger-maven-plugin");
Path schemaDirectory = inputDirectory.resolve("schema");
Path expectedRecord = inputDirectory.resolve("expected/Record.scala");
Path actualRecord = outputDirectory.resolve("at/makubi/maven/plugin/model/Record.scala");
avrohuggerGenerator.generateScalaFiles(schemaDirectory.toFile(), outputDirectory.toString(), new SystemStreamLog(), false, false, SourceGenerationFormat.SPECIFIC_RECORD, Collections.<Mapping>emptyList(), Collections.singletonList(new FileInclude("**", MatchSyntax.GLOB)));
failTestIfFilesDiffer(expectedRecord, actualRecord);
}
示例13: testAvrohuggerGeneratorRecursive
import org.apache.maven.plugin.logging.SystemStreamLog; //导入依赖的package包/类
public void testAvrohuggerGeneratorRecursive() throws IOException {
Path inputDirectory = Paths.get(getBasedir()).resolve("src/test/resources/unit/avrohugger-maven-plugin");
Path schemaDirectory = inputDirectory.resolve("schema");
Path expectedRecord = inputDirectory.resolve("expected/Record.scala");
Path actualRecord = outputDirectory.resolve("at/makubi/maven/plugin/model/Record.scala");
Path expectedSubRecord = inputDirectory.resolve("expected/SubRecord.scala");
Path actualSubRecord = outputDirectory.resolve("at/makubi/maven/plugin/model/submodel/SubRecord.scala");
avrohuggerGenerator.generateScalaFiles(schemaDirectory.toFile(), outputDirectory.toString(), new SystemStreamLog(), true, false, SourceGenerationFormat.SPECIFIC_RECORD, Collections.<Mapping>emptyList(), Collections.singletonList(new FileInclude("**", MatchSyntax.GLOB)));
failTestIfFilesDiffer(expectedRecord, actualRecord);
failTestIfFilesDiffer(expectedSubRecord, actualSubRecord);
}
示例14: createMojo
import org.apache.maven.plugin.logging.SystemStreamLog; //导入依赖的package包/类
protected CamelSalesforceMojo createMojo() throws IOException {
CamelSalesforceMojo mojo = new CamelSalesforceMojo();
mojo.setLog(new SystemStreamLog());
// set login properties
setLoginProperties(mojo);
// set defaults
mojo.version = System.getProperty("apiVersion", SalesforceEndpointConfig.DEFAULT_VERSION);
mojo.loginUrl = System.getProperty("loginUrl", SalesforceLoginConfig.DEFAULT_LOGIN_URL);
mojo.outputDirectory = new File("target/generated-sources/camel-salesforce");
mojo.packageName = "org.apache.camel.salesforce.dto";
// set code generation properties
mojo.includePattern = "(.*__c)|(PushTopic)|(Document)|(Account)";
// remove generated code directory
if (mojo.outputDirectory.exists()) {
// remove old files
for (File file : mojo.outputDirectory.listFiles()) {
file.delete();
}
mojo.outputDirectory.delete();
}
return mojo;
}
示例15: setUpProject
import org.apache.maven.plugin.logging.SystemStreamLog; //导入依赖的package包/类
private void setUpProject( File pomFile, ExecMojo mojo )
throws Exception
{
MavenProjectBuilder builder = (MavenProjectBuilder) lookup( MavenProjectBuilder.ROLE );
ArtifactRepositoryLayout localRepositoryLayout =
(ArtifactRepositoryLayout) lookup( ArtifactRepositoryLayout.ROLE, "default" );
String path = "src/test/repository";
ArtifactRepository localRepository =
new DefaultArtifactRepository( "local", "file://" + new File( path ).getAbsolutePath(),
localRepositoryLayout );
mojo.setBasedir( File.createTempFile( "mvn-temp", "txt" ).getParentFile() );
MavenProject project = builder.buildWithDependencies( pomFile, localRepository, null );
// this gets the classes for these tests of this mojo (exec plugin) onto the project classpath for the test
project.getBuild().setOutputDirectory( new File( "target/test-classes" ).getAbsolutePath() );
mojo.setProject( project );
mojo.setLog( new SystemStreamLog()
{
public boolean isDebugEnabled()
{
return true;
}
} );
}