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
d0709969
Commit
d0709969
authored
14 years ago
by
buczekp
Browse files
Options
Downloads
Patches
Plain Diff
[LMS-1676] tests for listing parents
SVN: 17357
parent
f5fbc290
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/server/business/bo/samplelister/SampleListingWorkerTest.java
+24
-0
24 additions, 0 deletions
...ver/business/bo/samplelister/SampleListingWorkerTest.java
with
24 additions
and
0 deletions
openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/samplelister/SampleListingWorkerTest.java
+
24
−
0
View file @
d0709969
...
@@ -59,6 +59,12 @@ public class SampleListingWorkerTest extends AbstractDAOTest
...
@@ -59,6 +59,12 @@ public class SampleListingWorkerTest extends AbstractDAOTest
private
final
Long
[]
CHILDREN_IDS
=
private
final
Long
[]
CHILDREN_IDS
=
{
CHILD_WITH_2_PARENTS_ID
,
985L
,
986L
,
987L
,
988L
,
989L
};
{
CHILD_WITH_2_PARENTS_ID
,
985L
,
986L
,
987L
,
988L
,
989L
};
private
final
Long
[]
PARENT_IDS
=
{
PARENT1_ID
,
PARENT2_ID
};
private
final
Long
[]
GRANDPARENT_IDS
=
{
325L
,
4L
};
private
SampleListerDAO
sampleListerDAO
;
private
SampleListerDAO
sampleListerDAO
;
private
SecondaryEntityDAO
secondaryDAO
;
private
SecondaryEntityDAO
secondaryDAO
;
...
@@ -145,6 +151,24 @@ public class SampleListingWorkerTest extends AbstractDAOTest
...
@@ -145,6 +151,24 @@ public class SampleListingWorkerTest extends AbstractDAOTest
}
}
}
}
@Test
public
void
testListSamplesForChild
()
{
final
ListSampleCriteria
baseCriteria
=
ListSampleCriteria
.
createForChild
(
new
TechId
(
CHILD_WITH_2_PARENTS_ID
));
final
ListOrSearchSampleCriteria
criteria
=
new
ListOrSearchSampleCriteria
(
baseCriteria
);
final
SampleListingWorker
worker
=
SampleListingWorker
.
create
(
criteria
,
BASE_INDEX_URL
,
sampleListerDAO
,
secondaryDAO
);
final
List
<
Sample
>
list
=
worker
.
load
();
assertEquals
(
2
,
list
.
size
());
for
(
Sample
s
:
list
)
{
assertTrue
(
Arrays
.
binarySearch
(
PARENT_IDS
,
s
.
getId
())
>=
0
);
assertTrue
(
Arrays
.
binarySearch
(
GRANDPARENT_IDS
,
s
.
getGeneratedFrom
().
getId
())
>=
0
);
checkSpace
(
s
);
}
}
@Test
@Test
public
void
testListSamplesForExperiment
()
public
void
testListSamplesForExperiment
()
{
{
...
...
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