Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
4de71b9f
Commit
4de71b9f
authored
14 years ago
by
buczekp
Browse files
Options
Downloads
Patches
Plain Diff
minor: extended RecordingMatcher with convenience method to deal with one recorded object
SVN: 19186
parent
484d70ea
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
common/source/java/ch/systemsx/cisd/common/test/RecordingMatcher.java
+12
-3
12 additions, 3 deletions
...e/java/ch/systemsx/cisd/common/test/RecordingMatcher.java
with
12 additions
and
3 deletions
common/source/java/ch/systemsx/cisd/common/test/RecordingMatcher.java
+
12
−
3
View file @
4de71b9f
...
@@ -25,14 +25,14 @@ import org.hamcrest.Matcher;
...
@@ -25,14 +25,14 @@ import org.hamcrest.Matcher;
/**
/**
* A {@link Matcher} which always matches the objects to be matched and make them available.
* A {@link Matcher} which always matches the objects to be matched and make them available.
*
*
* @author Franz-Josef Elmer
* @author Franz-Josef Elmer
*/
*/
public
class
RecordingMatcher
<
T
>
extends
BaseMatcher
<
T
>
public
class
RecordingMatcher
<
T
>
extends
BaseMatcher
<
T
>
{
{
private
List
<
T
>
objects
=
new
ArrayList
<
T
>();
private
List
<
T
>
objects
=
new
ArrayList
<
T
>();
/**
/**
* Removes all recored objects.
* Removes all recored objects.
*/
*/
...
@@ -40,7 +40,16 @@ public class RecordingMatcher<T> extends BaseMatcher<T>
...
@@ -40,7 +40,16 @@ public class RecordingMatcher<T> extends BaseMatcher<T>
{
{
objects
.
clear
();
objects
.
clear
();
}
}
/**
* Returns the one recorded object. Fails if not exactly one object was recorded.
*/
public
T
recordedObject
()
{
assert
objects
.
size
()
==
1
:
"expected one recorded object, found "
+
objects
.
size
();
return
objects
.
get
(
0
);
}
/**
/**
* Returns the objects in the order they have been recorded.
* Returns the objects in the order they have been recorded.
*/
*/
...
...
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