use of com.vladsch.flexmark.spec.SpecExample in project flexmark-java by vsch.
the class ComboDocxUserSpecDisabled method testCase.
@Override
protected void testCase(final Node node, final DataHolder options) {
if (!DUMP_TEST_CASE_FILES)
return;
final SpecExample specExample = example();
if (!specExample.isFullSpecExample() && !specExample.getSection().isEmpty()) {
// write it out to file, hard-coded for now IGNORE
File file = new File(String.format("%s/%s%s_%d.docx", PROJECT_ROOT_DIRECTORY, FILE_TEST_CASE_DUMP_LOCATION, specExample.getSection(), specExample.getExampleNumber()));
File file2 = new File(String.format("%s/%s%s_%d.xml", PROJECT_ROOT_DIRECTORY, FILE_TEST_CASE_DUMP_LOCATION, specExample.getSection(), specExample.getExampleNumber()));
WordprocessingMLPackage mlPackage = DocxRenderer.getDefaultTemplate();
if (mlPackage != null) {
RENDERER.withOptions(options).render(node, mlPackage);
try {
mlPackage.save(file, Docx4J.FLAG_SAVE_ZIP_FILE);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
try {
mlPackage.save(outputStream, Docx4J.FLAG_SAVE_FLAT_XML);
final String xml = outputStream.toString("UTF-8");
final String s = XmlDocxSorter.sortDocumentParts(xml);
FileWriter fileWriter = new FileWriter(file2);
fileWriter.append(s);
fileWriter.append('\n');
fileWriter.close();
} catch (Docx4JException e) {
e.printStackTrace();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
} catch (Docx4JException e) {
e.printStackTrace();
}
}
}
}
use of com.vladsch.flexmark.spec.SpecExample in project flexmark-java by vsch.
the class ComboAbbreviationFormatterSpecTest method data.
@Parameterized.Parameters(name = "{0}")
public static List<Object[]> data() {
List<SpecExample> examples = SpecReader.readExamples(SPEC_RESOURCE);
List<Object[]> data = new ArrayList<Object[]>();
// NULL example runs full spec test
data.add(new Object[] { SpecExample.NULL });
for (SpecExample example : examples) {
data.add(new Object[] { example });
}
return data;
}
use of com.vladsch.flexmark.spec.SpecExample in project flexmark-java by vsch.
the class ComboAbbreviationSpecTest method data.
@Parameterized.Parameters(name = "{0}")
public static List<Object[]> data() {
List<SpecExample> examples = SpecReader.readExamples(SPEC_RESOURCE);
List<Object[]> data = new ArrayList<Object[]>();
// NULL example runs full spec test
data.add(new Object[] { SpecExample.NULL });
for (SpecExample example : examples) {
data.add(new Object[] { example });
}
return data;
}
use of com.vladsch.flexmark.spec.SpecExample in project flexmark-java by vsch.
the class ComboAdmonitionFormatterSpecTest method data.
@Parameterized.Parameters(name = "{0}")
public static List<Object[]> data() {
List<SpecExample> examples = SpecReader.readExamples(SPEC_RESOURCE);
List<Object[]> data = new ArrayList<Object[]>();
// NULL example runs full spec test
data.add(new Object[] { SpecExample.NULL });
for (SpecExample example : examples) {
data.add(new Object[] { example });
}
return data;
}
use of com.vladsch.flexmark.spec.SpecExample in project flexmark-java by vsch.
the class ComboAsideSpecTest method data.
@Parameterized.Parameters(name = "{0}")
public static List<Object[]> data() {
List<SpecExample> examples = SpecReader.readExamples(SPEC_RESOURCE);
List<Object[]> data = new ArrayList<Object[]>();
// NULL example runs full spec test
data.add(new Object[] { SpecExample.NULL });
for (SpecExample example : examples) {
data.add(new Object[] { example });
}
return data;
}
Aggregations