Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Commits
76ba59f9
Commit
76ba59f9
authored
Dec 19, 2024
by
Riegel
Browse files
Test: Extended CLI zip-file validation testcase
parent
97f1a582
Pipeline
#10591
passed with stage
in 4 minutes and 56 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CityDoctorParent/CityDoctorValidation/src/test/java/de/hft/stuttgart/citydoctor2/check/CheckerTest.java
View file @
76ba59f9
...
@@ -29,6 +29,7 @@ import de.hft.stuttgart.citydoctor2.parser.InvalidGmlFileException;
...
@@ -29,6 +29,7 @@ import de.hft.stuttgart.citydoctor2.parser.InvalidGmlFileException;
import
de.hft.stuttgart.citydoctor2.parser.ParserConfiguration
;
import
de.hft.stuttgart.citydoctor2.parser.ParserConfiguration
;
import
de.hft.stuttgart.citydoctor2.zip.CityGmlZipArchive
;
import
de.hft.stuttgart.citydoctor2.zip.CityGmlZipArchive
;
import
de.hft.stuttgart.citydoctor2.zip.CityGmlZipEntry
;
import
de.hft.stuttgart.citydoctor2.zip.CityGmlZipEntry
;
import
org.apache.commons.io.FileUtils
;
import
org.junit.Rule
;
import
org.junit.Rule
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.junit.rules.TemporaryFolder
;
import
org.junit.rules.TemporaryFolder
;
...
@@ -122,18 +123,31 @@ public class CheckerTest {
...
@@ -122,18 +123,31 @@ public class CheckerTest {
@Test
@Test
public
void
testCliZipChecking
()
throws
IOException
,
CityDoctorWriteException
,
CityGmlParseException
,
InvalidGmlFileException
{
public
void
testCliZipChecking
()
throws
IOException
,
CityDoctorWriteException
,
CityGmlParseException
,
InvalidGmlFileException
{
String
output
=
folder
.
getRoot
().
toPath
()
+
File
.
separator
+
"test"
;
String
output
=
folder
.
getRoot
().
toPath
()
+
File
.
separator
+
"test"
;
String
pdfOutput
=
folder
.
getRoot
().
toPath
()
+
File
.
separator
+
"pdf"
+
File
.
separator
;
String
xmlOutput
=
folder
.
getRoot
().
toPath
()
+
File
.
separator
+
"xml"
+
File
.
separator
;
try
{
try
{
String
[]
args
=
new
String
[
6
];
String
[]
args
=
new
String
[
10
];
args
[
0
]
=
"-in"
;
args
[
0
]
=
"-in"
;
args
[
1
]
=
"src/test/resources/zipArchive.zip"
;
args
[
1
]
=
"src/test/resources/zipArchive.zip"
;
args
[
2
]
=
"-config"
;
args
[
2
]
=
"-config"
;
args
[
3
]
=
"src/test/resources/testConfigWithStreaming.yml"
;
args
[
3
]
=
"src/test/resources/testConfigWithStreaming.yml"
;
args
[
4
]
=
"-out"
;
args
[
4
]
=
"-pdfReport"
;
args
[
5
]
=
output
+
File
.
separator
;
args
[
5
]
=
pdfOutput
;
args
[
6
]
=
"-xmlReport"
;
args
[
7
]
=
xmlOutput
;
args
[
8
]
=
"-out"
;
args
[
9
]
=
output
+
File
.
separator
;
CityDoctorValidation
.
main
(
args
);
CityDoctorValidation
.
main
(
args
);
File
f
=
new
File
(
output
+
".zip"
);
File
zipFile
=
new
File
(
output
+
".zip"
);
assertTrue
(
f
.
exists
());
File
pdfDir
=
new
File
(
pdfOutput
);
File
xmlDir
=
new
File
(
xmlOutput
);
assertTrue
(
zipFile
.
exists
());
assertTrue
(
pdfDir
.
exists
());
assertTrue
(
xmlDir
.
exists
());
assertTrue
(
pdfDir
.
isDirectory
());
assertTrue
(
xmlDir
.
isDirectory
());
assertEquals
(
5
,
pdfDir
.
listFiles
().
length
);
assertEquals
(
5
,
xmlDir
.
listFiles
().
length
);
CityGmlZipArchive
cgmlArch
=
CityGmlZipArchive
.
register
(
output
+
".zip"
);
CityGmlZipArchive
cgmlArch
=
CityGmlZipArchive
.
register
(
output
+
".zip"
);
assertNotNull
(
cgmlArch
);
assertNotNull
(
cgmlArch
);
cgmlArch
.
mountArchive
(
new
ParserConfiguration
(
8
,
false
));
cgmlArch
.
mountArchive
(
new
ParserConfiguration
(
8
,
false
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment