Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tool-up-backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
elis
tool-up-backend
Commits
f12340e7
Commit
f12340e7
authored
9 years ago
by
Thiemo Belmega
Browse files
Options
Downloads
Patches
Plain Diff
Improved assertion message
parent
7de3fcb6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/unipotsdam/cs/toolup/util/AssertionUtil.java
+8
-8
8 additions, 8 deletions
...main/java/de/unipotsdam/cs/toolup/util/AssertionUtil.java
with
8 additions
and
8 deletions
src/main/java/de/unipotsdam/cs/toolup/util/AssertionUtil.java
+
8
−
8
View file @
f12340e7
...
@@ -6,19 +6,19 @@ import java.util.Collection;
...
@@ -6,19 +6,19 @@ import java.util.Collection;
public
class
AssertionUtil
{
public
class
AssertionUtil
{
public
static
<
T
>
void
assertContainsAll
(
Collection
<
T
>
expected
Collection
,
Collection
<?
extends
T
>
actual
Collection
)
{
public
static
<
T
>
void
assertContainsAll
(
Collection
<
T
>
containing
Collection
,
Collection
<?
extends
T
>
contained
Collection
)
{
if
(
expected
Collection
==
null
&&
actual
Collection
==
null
)
{
if
(
containing
Collection
==
null
&&
contained
Collection
==
null
)
{
return
;
return
;
}
}
if
(
expected
Collection
==
null
^
actual
Collection
==
null
)
{
if
(
containing
Collection
==
null
^
contained
Collection
==
null
)
{
throw
new
AssertionError
(
"Expected: "
+
expected
Collection
+
"\n but was: "
+
actual
Collection
);
throw
new
AssertionError
(
"Expected: "
+
containing
Collection
+
"\n but was: "
+
contained
Collection
);
}
}
if
(!
expected
Collection
.
containsAll
(
actual
Collection
))
{
if
(!
containing
Collection
.
containsAll
(
contained
Collection
))
{
String
expected
=
ToStringBuilder
.
reflectionToString
(
expected
Collection
);
String
containing
=
ToStringBuilder
.
reflectionToString
(
containing
Collection
);
String
actual
=
ToStringBuilder
.
reflectionToString
(
actual
Collection
);
String
contained
=
ToStringBuilder
.
reflectionToString
(
contained
Collection
);
throw
new
AssertionError
(
"Expected
: "
+
expected
+
"\n but was: "
+
actual
);
throw
new
AssertionError
(
"Expected
that "
+
containing
+
"\n would contain all elements of : "
+
contained
);
}
}
}
}
...
...
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