Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Commits
6a1fed35
Commit
6a1fed35
authored
3 months ago
by
Riegel
Browse files
Options
Download
Email Patches
Plain Diff
Test: Add testcase for CityDoctor validation of zip-files
parent
16c892e1
master
dev
dev_gui_features_zip_loading
3.17.0
archive/dev_gui_features_zip_loading
2 merge requests
!28
Version 3.17.0 Release
,
!26
Add ZIP-archive support
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/zip/CityGmlZipArchive.java
+4
-0
...a/de/hft/stuttgart/citydoctor2/zip/CityGmlZipArchive.java
CityDoctorParent/CityDoctorModel/src/test/java/de/hft/stuttgart/citydoctor2/zip/ZipTest.java
+16
-3
...c/test/java/de/hft/stuttgart/citydoctor2/zip/ZipTest.java
with
20 additions
and
3 deletions
+20
-3
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/zip/CityGmlZipArchive.java
+
4
-
0
View file @
6a1fed35
...
...
@@ -97,4 +97,8 @@ public class CityGmlZipArchive implements Serializable {
public
List
<
CityGmlZipEntry
>
getEntries
()
{
return
entries
;
}
public
void
streamValidateCityGml
()
{
return
;
}
}
This diff is collapsed.
Click to expand it.
CityDoctorParent/CityDoctorModel/src/test/java/de/hft/stuttgart/citydoctor2/zip/ZipTest.java
+
16
-
3
View file @
6a1fed35
...
...
@@ -10,8 +10,6 @@ import org.junit.rules.ExpectedException;
import
java.io.IOException
;
import
java.nio.file.Files
;
import
java.nio.file.Path
;
import
java.util.ArrayList
;
import
java.util.List
;
import
static
org
.
junit
.
Assert
.*;
...
...
@@ -85,7 +83,7 @@ public class ZipTest {
}
@Test
public
void
testValidation
(){
public
void
test
XML
Validation
(){
ParserConfiguration
valConfig
=
new
ParserConfiguration
(
8
,
true
);
CityGmlZipArchive
cgmlArch
=
CityGmlZipArchive
.
register
(
"src/test/resources/zip/validate.zip"
);
assertNotNull
(
cgmlArch
);
...
...
@@ -95,6 +93,21 @@ public class ZipTest {
assertEquals
(
ZipEntryErrorType
.
INVALID_CITY_GML_FILE
,
cgmlArch
.
getEntry
(
"valFaulty.gml"
).
getErrorType
());
}
@Test
public
void
testCityDoctorValidation
(){
CityGmlZipArchive
cgmlArch
=
CityGmlZipArchive
.
register
(
"src/test/resources/zip/mock_archive.zip"
);
assertNotNull
(
cgmlArch
);
cgmlArch
.
mountArchive
(
config
);
cgmlArch
.
streamValidateCityGml
();
for
(
CityGmlZipEntry
entry:
cgmlArch
.
getEntries
())
{
assertNotNull
(
entry
);
assertNotNull
(
entry
.
getModel
());
assertTrue
(
entry
.
getModel
().
isValidated
());
assertFalse
(
entry
.
getModel
().
getBuildings
().
get
(
0
).
containsAnyError
());
}
}
@Test
public
void
testImplicitParsing
(){
CityGmlZipArchive
cgmlArch
=
CityGmlZipArchive
.
register
(
"src/test/resources/zip/implicit.zip"
);
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets