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
50730605
Commit
50730605
authored
15 years ago
by
buczekp
Browse files
Options
Downloads
Patches
Plain Diff
[LMS-1163] extended validator tests
SVN: 12747
parent
150d84ff
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
openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/authorization/validator/FilterValidatorTest.java
+16
-3
16 additions, 3 deletions
...c/shared/authorization/validator/FilterValidatorTest.java
with
16 additions
and
3 deletions
openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/authorization/validator/FilterValidatorTest.java
+
16
−
3
View file @
50730605
...
...
@@ -46,10 +46,9 @@ public final class FilterValidatorTest extends AuthorizationTestCase
}
@Test
public
final
void
testWithRegistrator
()
public
final
void
testWith
TheRight
Registrator
()
{
// TODO 2009-09-22, Piotr Buczek: test failure when validation is improved;
// (registrators are equal when they have the same userId AND db instance)
// registrators are equal when they have the same userId AND db instance
final
DatabaseInstancePE
instance
=
createDatabaseInstance
();
final
PersonPE
person
=
createPerson
(
"A"
,
instance
);
final
PersonPE
registrator
=
person
;
...
...
@@ -59,6 +58,20 @@ public final class FilterValidatorTest extends AuthorizationTestCase
assertEquals
(
true
,
validator
.
isValid
(
person
,
FilterTranslator
.
translate
(
filter
)));
}
@Test
public
final
void
testWithTheWrongRegistrator
()
{
// registrators that have the same userId BUT different db instance are not the same
final
DatabaseInstancePE
instance
=
createDatabaseInstance
();
final
DatabaseInstancePE
anotherInstance
=
createAnotherDatabaseInstance
();
final
PersonPE
person
=
createPerson
(
"A"
,
anotherInstance
);
final
PersonPE
registrator
=
createPerson
(
"A"
,
instance
);
final
boolean
isPublic
=
false
;
final
FilterPE
filter
=
createFilter
(
instance
,
registrator
,
isPublic
);
final
FilterValidator
validator
=
new
FilterValidator
();
assertEquals
(
false
,
validator
.
isValid
(
person
,
FilterTranslator
.
translate
(
filter
)));
}
@Test
public
final
void
testWithTheRightInstanceAdmin
()
{
...
...
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