Additional cleanup
This commit is contained in:
@@ -22,6 +22,7 @@ import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
@@ -65,7 +66,7 @@ public class BackwardCompatibilityTest extends TestCase implements IExportableTr
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
ze.export(baos);
|
||||
ze.close();
|
||||
String pdfContent = baos.toString("UTF-8");
|
||||
String pdfContent = baos.toString(StandardCharsets.UTF_8);
|
||||
assertFalse(pdfContent.indexOf("(via mustangproject.org") == -1);
|
||||
// check for pdf-a schema extension
|
||||
// assertFalse(pdfContent.indexOf("<zf:ConformanceLevel>EN 16931</zf:ConformanceLevel>") == -1);
|
||||
@@ -105,7 +106,7 @@ public class BackwardCompatibilityTest extends TestCase implements IExportableTr
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
ze.export(baos);
|
||||
ze.close();
|
||||
String pdfContent = baos.toString("UTF-8");
|
||||
String pdfContent = baos.toString(StandardCharsets.UTF_8);
|
||||
assertFalse(pdfContent.indexOf("(via mustangproject.org") == -1);
|
||||
// check for pdf-a schema extension
|
||||
// assertFalse(pdfContent.indexOf("<zf:ConformanceLevel>EN 16931</zf:ConformanceLevel>") == -1);
|
||||
@@ -143,7 +144,7 @@ public class BackwardCompatibilityTest extends TestCase implements IExportableTr
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
ze.export(baos);
|
||||
ze.close();
|
||||
String pdfContent = baos.toString("UTF-8");
|
||||
String pdfContent = baos.toString(StandardCharsets.UTF_8);
|
||||
assertFalse(pdfContent.indexOf("(via mustangproject.org") == -1);
|
||||
// check for pdf-a schema extension
|
||||
// assertFalse(pdfContent.indexOf("<zf:ConformanceLevel>EN 16931</zf:ConformanceLevel>") == -1);
|
||||
|
||||
@@ -26,8 +26,6 @@ import org.junit.FixMethodOrder;
|
||||
import org.junit.runners.MethodSorters;
|
||||
import org.mustangproject.*;
|
||||
|
||||
import com.helger.commons.io.file.SimpleFileIO;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -256,13 +256,13 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
|
||||
"</ram:ApplicableHeaderTradeSettlement>\n" +
|
||||
"</rsm:SupplyChainTradeTransaction>\n" +
|
||||
"</rsm:CrossIndustryInvoice>";
|
||||
zea1.setXML(ownZUGFeRDXML.getBytes("UTF-8"));
|
||||
zea1.setXML(ownZUGFeRDXML.getBytes(StandardCharsets.UTF_8));
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
zea1.disableAutoClose(true);
|
||||
zea1.export(TARGET_PDF);
|
||||
zea1.export(baos);
|
||||
zea1.close();
|
||||
String pdfContent = baos.toString("UTF-8");
|
||||
String pdfContent = baos.toString(StandardCharsets.UTF_8);
|
||||
assertFalse(pdfContent.indexOf("(via mustangproject.org") == -1);
|
||||
assertFalse(pdfContent.indexOf("<fx:ConformanceLevel>EN 16931</fx:ConformanceLevel>") == -1);
|
||||
|
||||
@@ -437,14 +437,14 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
|
||||
+ "<ram:Name>Heiße Luft pro Liter</ram:Name>\n" + "<ram:Description/>\n"
|
||||
+ "</ram:SpecifiedTradeProduct>\n" + "</ram:IncludedSupplyChainTradeLineItem>\n"
|
||||
+ "</rsm:SpecifiedSupplyChainTradeTransaction>\n" + "</rsm:CrossIndustryDocument>";
|
||||
zea1.setXML(ownZUGFeRDXML.getBytes("UTF-8"));
|
||||
zea1.setXML(ownZUGFeRDXML.getBytes(StandardCharsets.UTF_8));
|
||||
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
zea1.disableAutoClose(true);
|
||||
zea1.export(TARGET_PDF);
|
||||
zea1.export(baos);
|
||||
zea1.close();
|
||||
String pdfContent = baos.toString("UTF-8");
|
||||
String pdfContent = baos.toString(StandardCharsets.UTF_8);
|
||||
assertFalse(pdfContent.indexOf("(via mustangproject.org") == -1);
|
||||
assertFalse(pdfContent.indexOf("<zf:ConformanceLevel>BASIC</zf:ConformanceLevel>") == -1);
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
@@ -368,7 +369,7 @@ public class MustangReaderWriterTest extends MustangReaderTestCase {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
ze.export(baos);
|
||||
ze.close();
|
||||
String pdfContent = baos.toString("UTF-8");
|
||||
String pdfContent = baos.toString(StandardCharsets.UTF_8);
|
||||
assertFalse(pdfContent.indexOf("(via mustangproject.org") == -1);
|
||||
// check for pdf-a schema extension
|
||||
// assertFalse(pdfContent.indexOf("<zf:ConformanceLevel>EN 16931</zf:ConformanceLevel>") == -1);
|
||||
@@ -412,7 +413,7 @@ public class MustangReaderWriterTest extends MustangReaderTestCase {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
ze.export(baos);
|
||||
ze.close();
|
||||
String pdfContent = baos.toString("UTF-8");
|
||||
String pdfContent = baos.toString(StandardCharsets.UTF_8);
|
||||
assertFalse(pdfContent.indexOf(DocumentContextParameterTypeConstants.BASIC) >= 0);
|
||||
assertFalse(pdfContent.indexOf(DocumentContextParameterTypeConstants.EXTENDED) >= 0);
|
||||
assertTrue(pdfContent.indexOf(DocumentContextParameterTypeConstants.COMFORT) >= 0);
|
||||
@@ -448,7 +449,7 @@ public class MustangReaderWriterTest extends MustangReaderTestCase {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
ze.export(baos);
|
||||
ze.close();
|
||||
String pdfContent = baos.toString("UTF-8");
|
||||
String pdfContent = baos.toString(StandardCharsets.UTF_8);
|
||||
assertFalse(pdfContent.indexOf("(via mustangproject.org") == -1);
|
||||
// check for pdf-a schema extension
|
||||
assertFalse(pdfContent.indexOf("<fx:ConformanceLevel>EN 16931</fx:ConformanceLevel>") == -1);
|
||||
|
||||
@@ -90,7 +90,7 @@ public class UBLTest extends ResourceCase {
|
||||
final ByteArrayOutputStream baos=new ByteArrayOutputStream();
|
||||
oe.export(baos);
|
||||
|
||||
final String theXML = baos.toString("UTF-8");
|
||||
final String theXML = baos.toString(StandardCharsets.UTF_8);
|
||||
assertTrue(theXML.contains("<DespatchAdvice"));
|
||||
Files.write(Paths.get(TARGET_XML), theXML.getBytes(StandardCharsets.UTF_8));
|
||||
} catch (final IOException e) {
|
||||
|
||||
@@ -21,7 +21,6 @@ package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.runners.MethodSorters;
|
||||
import org.mustangproject.CII.CIIToUBL;
|
||||
|
||||
import javax.xml.transform.*;
|
||||
import java.io.*;
|
||||
|
||||
Reference in New Issue
Block a user