Skip to content

Commit 4847a53

Browse files
committed
Add tests with relative units in attributes of svg elements
DEVSIX-4834
1 parent 0784a4e commit 4847a53

14 files changed

+111
-0
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
package com.itextpdf.svg.css;
2+
3+
import com.itextpdf.styledxmlparser.LogMessageConstant;
4+
import com.itextpdf.svg.renderers.SvgIntegrationTest;
5+
import com.itextpdf.test.ITextTest;
6+
import com.itextpdf.test.annotations.LogMessage;
7+
import com.itextpdf.test.annotations.LogMessages;
8+
9+
import java.io.IOException;
10+
import org.junit.BeforeClass;
11+
import org.junit.Test;
12+
13+
public class AttributesRelativeUnitTest extends SvgIntegrationTest {
14+
public static final String SOURCE_FOLDER = "./src/test/resources/com/itextpdf/svg/css/AttributesRelativeUnitTest/";
15+
public static final String DESTINATION_FOLDER = "./target/test/com/itextpdf/svg/css/AttributesRelativeUnitTest/";
16+
17+
@BeforeClass
18+
public static void beforeClass() {
19+
ITextTest.createDestinationFolder(DESTINATION_FOLDER);
20+
}
21+
22+
@Test
23+
@LogMessages(messages = {
24+
@LogMessage(messageTemplate = LogMessageConstant.UNKNOWN_ABSOLUTE_METRIC_LENGTH_PARSED, count = 4)})
25+
// TODO DEVSIX-4834 support relative units in attributes of svg elements. Remove log message at this test
26+
public void rectangleAttributesEmUnitsTest() throws IOException, InterruptedException {
27+
convertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "rectangleAttributesEmUnits");
28+
}
29+
30+
@Test
31+
@LogMessages(messages = {
32+
@LogMessage(messageTemplate = LogMessageConstant.UNKNOWN_ABSOLUTE_METRIC_LENGTH_PARSED, count = 4)})
33+
// TODO DEVSIX-4834 support relative units in attributes of svg elements. Remove log message at this test
34+
public void rectangleAttributesExUnitsTest() throws IOException, InterruptedException {
35+
convertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "rectangleAttributesExUnits");
36+
}
37+
38+
@Test
39+
@LogMessages(messages = {
40+
@LogMessage(messageTemplate = LogMessageConstant.UNKNOWN_ABSOLUTE_METRIC_LENGTH_PARSED, count = 4)})
41+
// TODO DEVSIX-4834 support relative units in attributes of svg elements. Remove log message at this test
42+
public void rectangleAttributesPercentUnitsTest() throws IOException, InterruptedException {
43+
convertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "rectangleAttributesPercentUnits");
44+
}
45+
46+
@Test
47+
@LogMessages(messages = {
48+
@LogMessage(messageTemplate = LogMessageConstant.UNKNOWN_ABSOLUTE_METRIC_LENGTH_PARSED, count = 4)})
49+
// TODO DEVSIX-4834 support relative units in attributes of svg elements. Remove log message at this test
50+
public void imageAttributesEmUnitsTest() throws IOException, InterruptedException {
51+
convertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "imageAttributesEmUnits");
52+
}
53+
54+
@Test
55+
@LogMessages(messages = {
56+
@LogMessage(messageTemplate = LogMessageConstant.UNKNOWN_ABSOLUTE_METRIC_LENGTH_PARSED, count = 4)})
57+
// TODO DEVSIX-4834 support relative units in attributes of svg elements. Remove log message at this test
58+
public void imageAttributesExUnitsTest() throws IOException, InterruptedException {
59+
convertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "imageAttributesExUnits");
60+
}
61+
62+
@Test
63+
@LogMessages(messages = {
64+
@LogMessage(messageTemplate = LogMessageConstant.UNKNOWN_ABSOLUTE_METRIC_LENGTH_PARSED, count = 4)})
65+
// TODO DEVSIX-4834 support relative units in attributes of svg elements. Remove log message at this test
66+
public void imageAttributesPercentUnitsTest() throws IOException, InterruptedException {
67+
convertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "imageAttributesPercentUnits");
68+
}
69+
}
3.75 KB
Loading
Lines changed: 7 additions & 0 deletions
Loading
Lines changed: 7 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)