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
8fa7a386
Commit
8fa7a386
authored
11 years ago
by
anttil
Browse files
Options
Downloads
Patches
Plain Diff
BIS-518 / SP-827: Cleaning up.
SVN: 29683
parent
2df2236d
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/sourceTest/java/ch/systemsx/cisd/common/filesystem/control/ParameterMapTest.java
+7
-20
7 additions, 20 deletions
...emsx/cisd/common/filesystem/control/ParameterMapTest.java
with
7 additions
and
20 deletions
common/sourceTest/java/ch/systemsx/cisd/common/filesystem/control/ParameterMapTest.java
+
7
−
20
View file @
8fa7a386
...
...
@@ -21,7 +21,6 @@ import static org.hamcrest.MatcherAssert.assertThat;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.UUID
;
import
org.hamcrest.Description
;
...
...
@@ -56,7 +55,7 @@ public class ParameterMapTest
context
.
checking
(
new
Expectations
()
{
{
allowing
(
eventProvider
).
getNewEvents
(
with
(
eventFilterAccepting
(
"parameter"
)));
allowing
(
eventProvider
).
getNewEvents
(
with
(
eventFilterAccepting
ValueUpdatesOf
(
"parameter"
)));
will
(
returnValue
(
new
ArrayList
<
String
>()));
}
});
...
...
@@ -77,8 +76,8 @@ public class ParameterMapTest
context
.
checking
(
new
Expectations
()
{
{
allowing
(
eventProvider
).
getNewEvents
(
with
(
eventFilterAccepting
(
"parameter"
)));
will
(
returnValue
(
getUpdateOn
(
"parameter
"
)));
allowing
(
eventProvider
).
getNewEvents
(
with
(
eventFilterAccepting
ValueUpdatesOf
(
"parameter"
)));
will
(
returnValue
(
Arrays
.
asList
(
"parameter-updated value
"
)));
}
});
map
.
addParameter
(
"parameter"
,
"default value"
);
...
...
@@ -91,7 +90,7 @@ public class ParameterMapTest
context
.
checking
(
new
Expectations
()
{
{
allowing
(
eventProvider
).
getNewEvents
(
with
(
eventFilterAccepting
(
"parameter"
)));
allowing
(
eventProvider
).
getNewEvents
(
with
(
eventFilterAccepting
ValueUpdatesOf
(
"parameter"
)));
will
(
returnValue
(
Arrays
.
asList
(
"parameter-"
)));
}
});
...
...
@@ -105,35 +104,23 @@ public class ParameterMapTest
context
.
checking
(
new
Expectations
()
{
{
allowing
(
eventProvider
).
getNewEvents
(
with
(
eventFilterAccepting
(
"parameter"
)));
will
(
returnValue
(
getUpdateOn
(
"parameter
"
)));
allowing
(
eventProvider
).
getNewEvents
(
with
(
eventFilterAccepting
ValueUpdatesOf
(
"parameter"
)));
will
(
returnValue
(
Arrays
.
asList
(
"parameter-updated value
"
)));
}
});
map
.
addParameter
(
"parameter"
,
"default value"
,
acceptValuesStartingWith
(
"d"
));
assertThat
(
map
.
get
(
"parameter"
),
is
(
"default value"
));
}
private
List
<
String
>
getUpdateOn
(
String
...
keys
)
{
List
<
String
>
updates
=
new
ArrayList
<
String
>();
for
(
String
key
:
keys
)
{
updates
.
add
(
key
+
"-updated value"
);
}
return
updates
;
}
private
IValueFilter
passNothingFilter
()
{
return
new
IValueFilter
()
{
@Override
public
boolean
isValid
(
String
value
)
{
return
false
;
}
};
}
...
...
@@ -151,7 +138,7 @@ public class ParameterMapTest
};
}
static
TypeSafeMatcher
<
IEventFilter
>
eventFilterAccepting
(
final
String
value
)
static
TypeSafeMatcher
<
IEventFilter
>
eventFilterAccepting
ValueUpdatesOf
(
final
String
value
)
{
return
new
TypeSafeMatcher
<
IEventFilter
>()
{
...
...
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