updated libraries
updated to JUNIT5
This commit is contained in:
@ -17,10 +17,10 @@
|
||||
<artifactId>freemarker</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-engine</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
|
||||
@ -2,12 +2,12 @@ package de.muehlencord.shared.pdf;
|
||||
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import java.lang.reflect.Type;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParseException;
|
||||
import com.google.gson.JsonSerializationContext;
|
||||
import com.google.gson.JsonSerializer;
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@ -7,7 +7,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentLinkedDeque;
|
||||
import org.apache.pdfbox.pdmodel.PDDocument;
|
||||
import org.apache.pdfbox.pdmodel.font.PDFont;
|
||||
import org.apache.pdfbox.pdmodel.font.PDType1Font;
|
||||
|
||||
@ -1,35 +1,35 @@
|
||||
package de.muehlencord.shared.pdf;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author joern.muehlencord
|
||||
*/
|
||||
public class DefaultTableRowTest {
|
||||
|
||||
|
||||
@Test
|
||||
public void testFromJson() {
|
||||
String jsonString = "{\n" +
|
||||
" \"type\": \"de.muehlencord.shared.pdf.DefaultTableRow\",\n" +
|
||||
" \"data\": {\n" +
|
||||
" \"row\": [\n" +
|
||||
" {\n" +
|
||||
" \"text\": \"Rechnungs-Nr.:\"\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"text\": \"${invoiceNumber}\"\n" +
|
||||
" }\n" +
|
||||
" ],\n" +
|
||||
" \"isList\": false\n" +
|
||||
" }\n" +
|
||||
" }";
|
||||
|
||||
|
||||
TableRow tableRow = GsonUtil.getInstance().fromJson(jsonString, TableRow.class);
|
||||
assertNotNull ("tableRowObject", tableRow);
|
||||
assertEquals ("column count", 2, tableRow.getColumnCount());
|
||||
assertFalse ("isList", tableRow.isList());
|
||||
String jsonString = "{\n"
|
||||
+ " \"type\": \"de.muehlencord.shared.pdf.DefaultTableRow\",\n"
|
||||
+ " \"data\": {\n"
|
||||
+ " \"row\": [\n"
|
||||
+ " {\n"
|
||||
+ " \"text\": \"Rechnungs-Nr.:\"\n"
|
||||
+ " },\n"
|
||||
+ " {\n"
|
||||
+ " \"text\": \"${invoiceNumber}\"\n"
|
||||
+ " }\n"
|
||||
+ " ],\n"
|
||||
+ " \"isList\": false\n"
|
||||
+ " }\n"
|
||||
+ " }";
|
||||
|
||||
TableRow tableRow = GsonUtil.getInstance().fromJson(jsonString, TableRow.class);
|
||||
assertFalse(tableRow == null, "tableRowObject");
|
||||
assertEquals(2, tableRow.getColumnCount(), "column count");
|
||||
assertFalse(tableRow.isList(), "isList");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package de.muehlencord.shared.pdf;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@ -4,7 +4,7 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@ -2,7 +2,7 @@ package de.muehlencord.shared.pdf;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
package de.muehlencord.shared.pdf;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -17,10 +18,10 @@ public class TextTest {
|
||||
String jsonString = "{\n"
|
||||
+ "\"text\": \"Rechnungs-Nr.:\"\n"
|
||||
+ "}";
|
||||
|
||||
|
||||
TextElement text = GsonUtil.getInstance().fromJson(jsonString, TextElement.class);
|
||||
assertNotNull ("text object", text);
|
||||
assertEquals ("text value", "Rechnungs-Nr.:", text.getText());
|
||||
assertFalse(text == null, "text object");
|
||||
assertEquals("Rechnungs-Nr.:", text.getText(), "text value");
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ import java.io.IOException;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@ -25,14 +25,15 @@ import java.net.URL;
|
||||
import java.util.Date;
|
||||
import javax.imageio.ImageIO;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestMethodOrder;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jomu
|
||||
*/
|
||||
@FixMethodOrder
|
||||
@TestMethodOrder(OrderAnnotation.class)
|
||||
public class PDFDocumentTest {
|
||||
|
||||
private String jsonString = null;
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
|
||||
package de.muehlencord.shared.pdf.util;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import javax.imageio.ImageIO;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -32,7 +33,7 @@ public class ImageUtilTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
@Disabled
|
||||
public void testFromFile() throws IOException {
|
||||
System.out.println ("testFromFile");
|
||||
BufferedImage img = ImageIO.read(new File ("c:/temp/dn_logo_smartteller_transparent.png"));
|
||||
|
||||
Reference in New Issue
Block a user