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
4a3982b8
Commit
4a3982b8
authored
14 years ago
by
buczekp
Browse files
Options
Downloads
Patches
Plain Diff
[LMS-1507] fixed EDTTest
SVN: 15662
parent
6081cb6d
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/ExternalDataTableTest.java
+22
-29
22 additions, 29 deletions
...bis/generic/server/business/bo/ExternalDataTableTest.java
with
22 additions
and
29 deletions
openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ExternalDataTableTest.java
+
22
−
29
View file @
4a3982b8
...
...
@@ -206,8 +206,10 @@ public final class ExternalDataTableTest extends AbstractBOTest
{
final
ExternalDataPE
d1
=
createDataSet
(
"d1"
,
dss1
);
final
ExternalDataPE
d2
=
createDataSet
(
"d2"
,
dss2
);
prepareFindFullDataset
(
d1
,
true
);
prepareFindFullDataset
(
d2
,
false
);
prepareFindFullDatasets
(
new
ExternalDataPE
[]
{
d1
,
d2
},
new
ExternalDataPE
[]
{
d1
},
false
,
false
);
ExternalDataTable
externalDataTable
=
createExternalDataTable
();
externalDataTable
.
loadByDataSetCodes
(
Arrays
.
asList
(
d1
.
getCode
(),
d2
.
getCode
()),
false
,
...
...
@@ -219,20 +221,23 @@ public final class ExternalDataTableTest extends AbstractBOTest
context
.
assertIsSatisfied
();
}
private
void
prepareFindFullDataset
(
final
ExternalDataPE
result
,
final
boolean
found
)
private
void
prepareFindFullDatasets
(
final
ExternalDataPE
[]
search
,
final
boolean
withProperties
,
final
boolean
lockForUpdate
)
{
prepareFindFullDataset
(
result
,
found
,
fals
e
);
prepareFindFullDataset
s
(
search
,
search
,
withProperties
,
lockForUpdat
e
);
}
private
void
prepareFindFullDataset
(
final
ExternalDataPE
result
,
final
boolean
found
,
private
void
prepareFindFullDatasets
(
final
ExternalDataPE
[]
searched
,
final
ExternalDataPE
[]
results
,
final
boolean
withProperties
,
final
boolean
lockForUpdate
)
{
context
.
checking
(
new
Expectations
()
{
{
one
(
externalDataDAO
).
tryToFindFullDataSetByCode
(
result
.
getCode
(),
false
,
one
(
externalDataDAO
).
tryToFindFullDataSetByCodes
(
Code
.
extractCodes
(
Arrays
.
asList
(
searched
)),
withProperties
,
lockForUpdate
);
will
(
returnValue
(
found
?
result
:
null
));
will
(
returnValue
(
Arrays
.
asList
(
results
)
));
}
});
}
...
...
@@ -245,8 +250,8 @@ public final class ExternalDataTableTest extends AbstractBOTest
context
.
checking
(
new
Expectations
()
{
{
prepareFindFullDataset
(
d1
,
true
);
prepareFindFullDataset
(
d2
,
tru
e
);
prepareFindFullDataset
s
(
new
ExternalDataPE
[]
{
d1
,
d2
},
false
,
fals
e
);
one
(
dataStoreService2
).
getKnownDataSets
(
dss2
.
getSessionToken
(),
Arrays
.
asList
(
d2
.
getLocation
()));
...
...
@@ -285,10 +290,7 @@ public final class ExternalDataTableTest extends AbstractBOTest
context
.
checking
(
new
Expectations
()
{
{
for
(
ExternalDataPE
dataset
:
allDataSets
)
{
prepareFindFullDataset
(
dataset
,
true
);
}
prepareFindFullDatasets
(
allDataSets
,
false
,
false
);
}
});
...
...
@@ -319,8 +321,8 @@ public final class ExternalDataTableTest extends AbstractBOTest
context
.
checking
(
new
Expectations
()
{
{
prepareFindFullDataset
(
d1
,
true
);
prepareFindFullDataset
(
d2
,
tru
e
);
prepareFindFullDataset
s
(
new
ExternalDataPE
[]
{
d1
,
d2
},
false
,
fals
e
);
List
<
String
>
d2Locations
=
Arrays
.
asList
(
d2
.
getLocation
());
one
(
dataStoreService2
).
getKnownDataSets
(
dss2
.
getSessionToken
(),
d2Locations
);
...
...
@@ -364,8 +366,8 @@ public final class ExternalDataTableTest extends AbstractBOTest
context
.
checking
(
new
Expectations
()
{
{
prepareFindFullDataset
(
d1PE
,
true
);
prepareFindFullDataset
(
d2PE
,
true
);
prepareFindFullDataset
s
(
new
ExternalDataPE
[]
{
d1PE
,
d2PE
}
,
true
,
false
);
List
<
String
>
d2Locations
=
Arrays
.
asList
(
d2PE
.
getLocation
());
one
(
dataStoreService2
).
getKnownDataSets
(
dss2
.
getSessionToken
(),
d2Locations
);
...
...
@@ -425,10 +427,7 @@ public final class ExternalDataTableTest extends AbstractBOTest
context
.
checking
(
new
Expectations
()
{
{
for
(
ExternalDataPE
dataset
:
allDataSets
)
{
prepareFindFullDataset
(
dataset
,
true
);
}
prepareFindFullDatasets
(
allDataSets
,
true
,
false
);
}
});
...
...
@@ -561,10 +560,7 @@ public final class ExternalDataTableTest extends AbstractBOTest
context
.
checking
(
new
Expectations
()
{
{
for
(
ExternalDataPE
dataSet
:
allDataSets
)
{
prepareFindFullDataset
(
dataSet
,
true
,
true
);
}
prepareFindFullDatasets
(
allDataSets
,
false
,
true
);
prepareUpdateDatasetStatus
(
d2Available1
,
ARCHIVE_PENDING
);
prepareUpdateDatasetStatus
(
d2Available2
,
ARCHIVE_PENDING
);
...
...
@@ -603,10 +599,7 @@ public final class ExternalDataTableTest extends AbstractBOTest
context
.
checking
(
new
Expectations
()
{
{
for
(
ExternalDataPE
dataSet
:
allDataSets
)
{
prepareFindFullDataset
(
dataSet
,
true
,
true
);
}
prepareFindFullDatasets
(
allDataSets
,
false
,
true
);
prepareUpdateDatasetStatus
(
d2Archived1
,
UNARCHIVE_PENDING
);
prepareUpdateDatasetStatus
(
d2Archived2
,
UNARCHIVE_PENDING
);
...
...
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