Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GoikLectures
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Goik Martin
GoikLectures
Commits
0e983402
Commit
0e983402
authored
8 years ago
by
Goik Martin
Browse files
Options
Downloads
Patches
Plain Diff
Handling non-wellformed Xml files issuing warnings
parent
8fcc60bd
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ws/Unitmarking/.gitignore
+1
-0
1 addition, 0 deletions
ws/Unitmarking/.gitignore
ws/Unitmarking/src/main/java/de/hdm_stuttgart/mi/unitmarking/xsd/InstanceSetEvaluation.java
+6
-19
6 additions, 19 deletions
...m_stuttgart/mi/unitmarking/xsd/InstanceSetEvaluation.java
with
7 additions
and
19 deletions
ws/Unitmarking/.gitignore
+
1
−
0
View file @
0e983402
...
...
@@ -2,3 +2,4 @@
/.settings/
.classpath
.project
/A1.log
This diff is collapsed.
Click to expand it.
ws/Unitmarking/src/main/java/de/hdm_stuttgart/mi/unitmarking/xsd/InstanceSetEvaluation.java
+
6
−
19
View file @
0e983402
...
...
@@ -35,18 +35,10 @@ public class InstanceSetEvaluation {
private
static
Logger
log
=
LogManager
.
getLogger
(
InstanceSetEvaluation
.
class
);
final
static
List
<
InstanceTest
>
tests
=
new
Vector
<>();
final
static
StringBuffer
warnings
=
new
StringBuffer
();
final
StringBuffer
messages
=
new
StringBuffer
(),
errorMessages
=
new
StringBuffer
();
/**
* @param args unused
*/
public
static
void
main
(
String
[]
args
)
{
final
InstanceSetEvaluation
ise
=
new
InstanceSetEvaluation
(
"SchemaTest"
,
"Schema/dictionary.xsd"
);
System
.
out
.
println
(
ise
.
getMessages
());
System
.
out
.
println
(
"All tests succeeded:"
+
ise
.
allTestsSucceeded
);
}
/**
* @return Individual failed test(s) error message(s).
*/
...
...
@@ -58,7 +50,7 @@ public class InstanceSetEvaluation {
* @return Individual test's and aggregated results.
*/
public
String
getMessages
()
{
return
"\n"
+
messages
.
toString
();
return
"\n"
+
warnings
.
toString
()
+
"\n"
+
messages
.
toString
();
}
/**
...
...
@@ -126,20 +118,15 @@ public class InstanceSetEvaluation {
tests
.
add
(
new
InstanceTest
(
xmlTestList
.
get
(
0
),
xmlTestFileDir
,
xsdSchemaFilename
,
instanceFilename
));
break
;
default
:
log
.
error
(
"Fatal: Found "
+
xmlTestList
.
size
()
+
" <?xmltest ... ?> annotations in file '"
+
instanceFilename
+
"'"
);
System
.
exit
(
1
);
warnings
.
append
(
"Found "
+
xmlTestList
.
size
()
+
"' annotations in file '"
+
instanceFilename
.
getPath
()
+
"'\n"
);
}
}
catch
(
final
JDOMException
e
)
{
log
.
fatal
(
"Document '"
+
instanceFilename
.
getPath
()
+
log
.
error
(
"Document '"
+
instanceFilename
.
getPath
()
+
"' is invalid:"
,
e
);
System
.
exit
(
1
);
warnings
.
append
(
"Unable to parse document "
+
instanceFilename
.
getPath
()
+
": "
+
e
+
"\n"
);
}
catch
(
final
IOException
e
)
{
log
.
fatal
(
"Unable to open '"
+
instanceFilename
.
getPath
()
+
"' for reading:"
,
e
);
System
.
exit
(
1
);
warnings
.
append
(
"Unable to read document "
+
instanceFilename
.
getPath
()
+
": "
+
e
+
"\n"
);
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment