@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); }
@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()); }
/** * 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); }
@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)); } }
@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; }
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(); }
@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); }
@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)); }
/** * 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())); }
@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); }
@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); }
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); }
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); }
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; }
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; } } ); }
@Before public void setUp() throws Exception { Log log = new SystemStreamLog() { @Override public boolean isDebugEnabled() { return true; } }; this.scanner = new ClassDefScanner(log); }
public static void main(String[] args) throws IOException { Log log = new SystemStreamLog(); if (args.length != 3 && args.length != 5) { log.info(String.format("" + "Usage: %1$s <directory> <repo URL> <group ID>\n" + " %1$s <directory> <repo URL> <group ID> <artifact ID> <version>\n", JavadocPublisher.class.getName())); System.exit(1); return; } File directory = new File(args[0]); String repoUrl = args[1]; String groupId = args[2]; JavadocPublisher javadocPublisher = new JavadocPublisher( new MavenCentral(), new Cli(), log, directory); int artifactsPublished; if (args.length == 3) { artifactsPublished = javadocPublisher.publishLatest(repoUrl, groupId); } else { String artifactId = args[3]; String version = args[4]; artifactsPublished = javadocPublisher.publish(repoUrl, groupId, artifactId, version); } log.info("Published Javadoc for " + artifactsPublished + " artifacts of " + groupId + " to " + repoUrl); }
protected Analyzer getAnalyzer( JavaProjectBuilder builder ) { ServicesDescriptor descriptor = new ServicesDescriptor(); ErrorDescriptor errorDescriptor = new ErrorDescriptor(); errorDescriptor.setErrorName( "IllegalStateException" ); errorDescriptor.setJsonExample( JSON_ERROR_EXAMPLE ); errorDescriptor.setStatusCode( ERROR_STATUS_CODE ); descriptor.getErrors().add( errorDescriptor ); Analyzer analyzer = new Analyzer( new SystemStreamLog(), null, Thread.currentThread().getContextClassLoader(), builder, descriptor, false ); return analyzer; }
@Before public void setup() throws Exception { File pactFile = temporaryFolder.newFile("some_pact.json"); try (PrintWriter out = new PrintWriter(pactFile, StandardCharsets.UTF_8.displayName())) { out.write(pactJson); } pact = PactFile.readPactFile(pactFile); brokerRepositoryProvider = new BrokerRepositoryProvider("http://localhost:" + port, CONSUMER_VERSION, new SystemStreamLog(), empty(), empty()); }
@Test @Ignore public void testPortlet() throws Exception { CreateWarMojo uw = new CreateWarMojo(); uw.setLog(new SystemStreamLog()); uw.basedir = new File("../bitpoc-portlet"); uw.finalName = "bitpoc"; uw.project = new MavenProject(); uw.project.setVersion("1.0.1"); uw.tools = new LiferayToolsImpl(); uw.execute(); }
public static void main(String[] args) throws Exception { // only for local development (in Project root of gen) CodeGeneratorMojo mojo = new CodeGeneratorMojo(); mojo.processJavaFiles(new File("../../VaadinatorExample/AddressbookExample/src/main/java"), new File("../../VaadinatorExample/AddressbookExample/target/generated-sources"), new SourceDao(new SystemStreamLog()), "AddressbookExample", "AddressbookExample", "0.10-SNAPSHOT", true, VaadinatorConfig.ArtifactType.ALL, VaadinatorConfig.GenType.ALL); }
/** * Gets the logger used to output diagnostic messages. * * @return The logger used to output diagnostic messages, never * <code>null</code>. */ protected Log getLog () { if (this.m_aLog == null) { this.m_aLog = new SystemStreamLog (); } return this.m_aLog; }
@Before public void setUp() throws IOException { nodeDirectory = new File("target/test/node"); nodeDirectory.mkdirs(); Log log = new SystemStreamLog(); NodeManager manager = new NodeManager(log, nodeDirectory); manager.installIfNotInstalled(); mojo = new MythMojo(); mojo.basedir = new File(FAKE_PROJECT); mojo.buildDirectory = new File(FAKE_PROJECT_TARGET); mojo.buildDirectory.mkdirs(); mojo.version = "0.3.4"; }
@Before public void setUp() { nodeDirectory = new File("target/test/node"); nodeDirectory.mkdirs(); log = new SystemStreamLog(); AbstractWisdomMojo mojo = new AbstractWisdomMojo() { @Override public void execute() throws MojoExecutionException, MojoFailureException { // Do nothing. } }; mojo.basedir = new File("target/test"); manager = new NodeManager(log, nodeDirectory, mojo); }
@Before public void setUp() throws IOException { nodeDirectory = new File("target/test/node"); nodeDirectory.mkdirs(); Log log = new SystemStreamLog(); mojo = new CoffeeScriptCompilerMojo(); NodeManager manager = new NodeManager(log, nodeDirectory, mojo); manager.installIfNotInstalled(); mojo.basedir = new File(FAKE_PROJECT); mojo.buildDirectory = new File(FAKE_PROJECT_TARGET); mojo.buildDirectory.mkdirs(); mojo.coffeeScriptVersion = CoffeeScriptCompilerMojo.COFFEESCRIPT_VERSION; cleanup(); }
@Before public void setUp() throws IOException { MavenProject project = new MavenProject(); project.setArtifactId("test-artifact"); nodeDirectory = new File("target/test/node"); nodeDirectory.mkdirs(); Log log = new SystemStreamLog(); mojo = new CSSMinifierMojo(); mojo.project = project; NodeManager manager = new NodeManager(log, nodeDirectory, mojo); manager.installIfNotInstalled(); mojo.basedir = new File(FAKE_PROJECT); mojo.buildDirectory = new File(FAKE_PROJECT_TARGET); mojo.buildDirectory.mkdirs(); mojo.cleanCssVersion = CSSMinifierMojo.CLEANCSS_NPM_VERSION; mojo.cssMinifierSuffix = "-min"; // Less stuff less = new LessCompilerMojo(); NodeManager manager2 = new NodeManager(log, nodeDirectory, less); manager2.installIfNotInstalled(); less.project = project; less.basedir = new File(FAKE_PROJECT); less.buildDirectory = new File(FAKE_PROJECT_TARGET); less.lessVersion = LessCompilerMojo.LESS_VERSION; cleanup(); }
@Before public void setUp() throws IOException { nodeDirectory = new File("target/test/node"); nodeDirectory.mkdirs(); Log log = new SystemStreamLog(); mojo = new TypeScriptCompilerMojo(); mojo.basedir = new File(FAKE_PROJECT); mojo.buildDirectory = new File(FAKE_PROJECT_TARGET); mojo.buildDirectory.mkdirs(); mojo.typescript = new TypeScript(); NodeManager manager = new NodeManager(log, nodeDirectory, mojo); manager.installIfNotInstalled(); }
@Before public void setUp() throws IOException { nodeDirectory = new File("target/test/node"); nodeDirectory.mkdirs(); Log log = new SystemStreamLog(); mojo = new LessCompilerMojo(); NodeManager manager = new NodeManager(log, nodeDirectory, mojo); manager.installIfNotInstalled(); mojo.basedir = new File(FAKE_PROJECT); mojo.buildDirectory = new File(FAKE_PROJECT_TARGET); mojo.buildDirectory.mkdirs(); mojo.lessVersion = LessCompilerMojo.LESS_VERSION; cleanup(); }
@Override @Before(order = 2) public void setUp() throws Exception { super.setUp(); SecDispatcher securityDispatcher = (SecDispatcher) lookup( "org.sonatype.plexus.components.sec.dispatcher.SecDispatcher", "default"); setVariableValueToObject(mojo, "securityDispatcher", securityDispatcher); securityDispatcher.decrypt(""); properties = new Properties(); project = new MavenProjectStub() { @Override public Properties getProperties() { return properties; } }; setVariableValueToObject(mojo, "project", project); settings = new Settings(); setVariableValueToObject(mojo, "settings", settings); systemProperties = new ArrayList<String>(); mojo.setLog(new SystemStreamLog() { @Override public boolean isDebugEnabled() { return true; } }); }
@Test public void getDefaultDistro_singledistro() throws Exception { String distro = "bla"; TargetConfiguration tc = new TargetConfiguration("test"); tc.setDistro(distro); tc.fixate(); List<TargetConfiguration> tcs = new ArrayList<TargetConfiguration>(); tcs.add(tc); Assert.assertEquals(distro, Utils.getDefaultDistro("test", tcs, new SystemStreamLog())); }
@Test public void getDefaultDistro_manydistros_withdefault() throws Exception { String distro = "bla"; TargetConfiguration tc = new TargetConfiguration("test"); tc.setDistros(new HashSet<String>(Arrays.asList(new String[] { "bar", "baz", distro, "foo" }))); tc.setDefaultDistro(distro); tc.fixate(); List<TargetConfiguration> tcs = new ArrayList<TargetConfiguration>(); tcs.add(tc); Assert.assertEquals(distro, Utils.getDefaultDistro("test", tcs, new SystemStreamLog())); }
@Test(expected = MojoExecutionException.class) public void getDefaultDistro_nodistro() throws Exception { TargetConfiguration tc = new TargetConfiguration("test"); tc.fixate(); List<TargetConfiguration> tcs = new ArrayList<TargetConfiguration>(); tcs.add(tc); Utils.getDefaultDistro("test", tcs, new SystemStreamLog()); }
@Test(expected = MojoExecutionException.class) public void getDefaultDistro_manydistros_nodefault() throws Exception { String distro = "bla"; TargetConfiguration tc = new TargetConfiguration("test"); tc.setDistros(new HashSet<String>(Arrays.asList(new String[] { "bar", "baz", distro, "foo" }))); tc.fixate(); List<TargetConfiguration> tcs = new ArrayList<TargetConfiguration>(); tcs.add(tc); Utils.getDefaultDistro("test", tcs, new SystemStreamLog()); }
@Before public void loadCompiler() { solidityCompiler = SolidityCompiler.getInstance(new SystemStreamLog()); }
public static Log getLog() { log = null == log ? new SystemStreamLog():log ; return log; }
public L10nValidatorLogger() { this.logger = new SystemStreamLog(); }
public void testGetDependenciesText() throws Exception { MavenProject mavenProject = new MavenProject(); File resourceLoaderPath = new File( System.getProperty( "java.io.tmpdir" ) ); File outputFile = File.createTempFile( "bogus", "jnlp" ); outputFile.deleteOnExit(); File templateFile = File.createTempFile( "bogusTemplate", ".vm" ); templateFile.deleteOnExit(); List<ResolvedJarResource> jarResources = new ArrayList<>(); String mainClass = "fully.qualified.ClassName"; GeneratorTechnicalConfig generatorTechnicalConfig = new GeneratorTechnicalConfig( mavenProject, resourceLoaderPath, "default-jnlp-template.vm", outputFile, templateFile.getName(), mainClass, "jar:file:/tmp/path/to/webstart-plugin.jar", "utf-8" ); JarResourceGeneratorConfig jarResourceGeneratorConfig = new JarResourceGeneratorConfig( jarResources, null, null, null, null ); JarResourcesGenerator generator = new JarResourcesGenerator( new SystemStreamLog(), generatorTechnicalConfig, jarResourceGeneratorConfig ); // JarResourcesGenerator generator = // new JarResourcesGenerator( new SystemStreamLog(), mavenProject, resourceLoaderPath, // "default-jnlp-template.vm", outputFile, templateFile.getName(), jarResources, // mainClass, "jar:file:/tmp/path/to/webstart-plugin.jar", null, "utf-8" ); //The list of jarResources is empty so the output text should be an empty string assertEquals( "", generator.getDependenciesText() ); //Add some JarResources and confirm the correct output ResolvedJarResource jarResource1 = buildJarResource( "href1", "1.1", "bogus.Class", true, true ); ResolvedJarResource jarResource2 = buildJarResource( "href2", "1.2", null, true, true ); ResolvedJarResource jarResource3 = buildJarResource( "href3", "1.3", null, false, true ); ResolvedJarResource jarResource4 = buildJarResource( "href4", "1.4", null, false, false ); jarResources.add( jarResource1 ); jarResources.add( jarResource2 ); jarResources.add( jarResource3 ); jarResources.add( jarResource4 ); String expectedText =EOL + "<jar href=\"href1\" version=\"1.1\" main=\"true\"/>" + EOL + "<jar href=\"href2\" version=\"1.2\"/>" + EOL + "<jar href=\"href3\"/>" + EOL; String actualText = generator.getDependenciesText(); Assert.assertEquals( expectedText, actualText ); JarResourceGeneratorConfig jarResourceGeneratorConfig2 = new JarResourceGeneratorConfig( jarResources, "myLib", null, null, null ); JarResourcesGenerator generator2 = new JarResourcesGenerator( new SystemStreamLog(), generatorTechnicalConfig, jarResourceGeneratorConfig2 ); // JarResourcesGenerator generator2 = // new JarResourcesGenerator( new SystemStreamLog(), mavenProject, resourceLoaderPath, // "default-jnlp-template.vm", outputFile, templateFile.getName(), jarResources, // mainClass, "jar:file:/tmp/path/to/webstart-plugin.jar", "myLib", "utf-8" ); String expectedText2 = EOL + "<jar href=\"myLib/href1\" version=\"1.1\" main=\"true\"/>" + EOL + "<jar href=\"myLib/href2\" version=\"1.2\"/>" + EOL + "<jar href=\"myLib/href3\"/>" + EOL; String actualText2 = generator2.getDependenciesText(); Assert.assertEquals( expectedText2, actualText2 ); }
@Before public void setUp() { daoUnderTest = new SourceDao(new SystemStreamLog()); }
public InterceptingResolver() { this(new SystemStreamLog(), null, new String[0]); }