use of org.wildfly.build.util.ModuleParseResult in project wildfly-gradle-tools by wildfly.
the class ModuleTemplate method parse.
public static ModuleTemplate parse(Path template, TemplatePatterns templateValues) throws IOException, ParsingException {
final String fileContent = Files.lines(template, CustomCharset.utf8).collect(Collectors.joining("\n"));
final String replacedContent = templateValues.replaceAllVariables(fileContent);
final ModuleParseResult parseResult;
try (InputStream stream = new ByteArrayInputStream(replacedContent.getBytes(CustomCharset.utf8))) {
parseResult = ModuleParser.parse(stream);
}
return new ModuleTemplate(replacedContent, parseResult);
}
use of org.wildfly.build.util.ModuleParseResult in project wildfly-gradle-tools by wildfly.
the class FeaturePackFunctionalTest method testFeaturePackTask.
@Test
public void testFeaturePackTask() throws Exception {
BuildResult result = testProject.runTask("featurepack");
assertEquals(result.task(":featurepack").getOutcome(), TaskOutcome.SUCCESS);
File expectedModuleFile = new File(testProject.getWorkDirectory() + File.separator + "featurepack" + File.separator + "modules" + File.separator + "system" + File.separator + "layers" + File.separator + "base" + File.separator + "org" + File.separator + "hibernate" + File.separator + "orm53" + File.separator + "module.xml");
assertTrue("The module.xml has not been created " + expectedModuleFile.getPath(), expectedModuleFile.exists());
ModuleParseResult parseResult = ModuleParser.parse(expectedModuleFile.toPath());
assertThat(parseResult.getIdentifier().getSlot(), is("orm53"));
}
Aggregations