update all dependencies (maven artifacts)
- PDF dependency was missing in the pom file the JDK8
* We should think about creating a parent pom - in that case all plantuml dependencies could be in the parent pom and we would only the mantain one pom file.
(It is also possible to drop the Java 8 support.)
* Why do we not have any PDF tests?
- add rule to ignore version update hint with `-dev` followed by a dot and date (e.g. `0.37.0-dev.20230308`)
- migration from JUnit4 to JUnit5
This commit is contained in:
@@ -4,6 +4,9 @@ import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import net.sourceforge.plantuml.servlet.utils.TestUtils;
|
||||
import net.sourceforge.plantuml.servlet.utils.WebappTestCase;
|
||||
|
||||
@@ -14,36 +17,38 @@ public class TestCheck extends WebappTestCase {
|
||||
* Verifies the generation of a syntax check for the following sample:
|
||||
* Bob -> Alice : hello
|
||||
*/
|
||||
@Test
|
||||
public void testCorrectSequenceDiagram() throws IOException {
|
||||
final URL url = new URL(getServerUrl() + "/check/" + TestUtils.SEQBOB);
|
||||
final URLConnection conn = url.openConnection();
|
||||
// Analyze response
|
||||
// Verifies the Content-Type header
|
||||
assertEquals(
|
||||
"Response content type is not TEXT PLAIN or UTF-8",
|
||||
Assertions.assertEquals(
|
||||
"text/plain;charset=utf-8",
|
||||
conn.getContentType().toLowerCase()
|
||||
conn.getContentType().toLowerCase(),
|
||||
"Response content type is not TEXT PLAIN or UTF-8"
|
||||
);
|
||||
// Get the content, check its first characters and verify its size
|
||||
String checkResult = getContentText(conn);
|
||||
assertTrue(
|
||||
"Response content is not starting with (2 participants)",
|
||||
checkResult.startsWith("(2 participants)")
|
||||
Assertions.assertTrue(
|
||||
checkResult.startsWith("(2 participants)"),
|
||||
"Response content is not starting with (2 participants)"
|
||||
);
|
||||
int checkLen = checkResult.length();
|
||||
assertTrue(checkLen > 1);
|
||||
assertTrue(checkLen < 100);
|
||||
Assertions.assertTrue(checkLen > 1);
|
||||
Assertions.assertTrue(checkLen < 100);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the syntax of an invalid sequence diagram :
|
||||
* Bob -
|
||||
*/
|
||||
@Test
|
||||
public void testWrongDiagramSyntax() throws IOException {
|
||||
final URL url = new URL(getServerUrl() + "/check/SyfFKj050000");
|
||||
// Analyze response
|
||||
String checkResult = getContentText(url);
|
||||
assertTrue("Response is not an error", checkResult.startsWith("(Error)"));
|
||||
Assertions.assertTrue(checkResult.startsWith("(Error)"), "Response is not an error");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user