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
93932d90
Commit
93932d90
authored
13 years ago
by
felmer
Browse files
Options
Downloads
Patches
Plain Diff
test fixed
SVN: 20874
parent
b100a63e
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
datastore_server/sourceTest/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/RsyncArchiverTest.java
+22
-45
22 additions, 45 deletions
...ss/generic/server/plugins/standard/RsyncArchiverTest.java
with
22 additions
and
45 deletions
datastore_server/sourceTest/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/RsyncArchiverTest.java
+
22
−
45
View file @
93932d90
...
...
@@ -270,36 +270,6 @@ public class RsyncArchiverTest extends AbstractFileSystemTestCase
assertEquals
(
"[]"
,
status
.
getErrorStatuses
().
toString
());
}
@Test
public
void
testSuccessfulUnarchivingWithMockUnarchivingPreparation
()
{
archiverTaskContext
.
setUnarchivingPreparation
(
unarchivingPreparation
);
final
DatasetDescription
ds1
=
new
DatasetDescriptionBuilder
(
"ds1"
).
getDatasetDescription
();
context
.
checking
(
new
Expectations
()
{
{
one
(
unarchivingPreparation
).
prepareForUnarchiving
(
ds1
);
one
(
dataSetDirectoryProvider
).
getDataSetDirectory
(
ds1
);
File
file
=
new
File
(
store
,
LOCATION
);
will
(
returnValue
(
file
));
one
(
fileOperationsManager
).
retrieveFromDestination
(
file
,
ds1
);
will
(
returnValue
(
Status
.
OK
));
one
(
statusUpdater
).
update
(
Arrays
.
asList
(
"ds1"
),
DataSetArchivingStatus
.
AVAILABLE
,
true
);
one
(
statusUpdater
).
update
(
Arrays
.<
String
>
asList
(),
DataSetArchivingStatus
.
ARCHIVED
,
true
);
}
});
ProcessingStatus
status
=
archiver
.
unarchive
(
Arrays
.
asList
(
ds1
),
archiverTaskContext
);
assertEquals
(
"INFO OPERATION.AbstractDatastorePlugin - "
+
"Unarchiving of the following datasets has been requested: [Dataset 'ds1']"
,
logRecorder
.
getLogContent
());
assertEquals
(
"[]"
,
status
.
getErrorStatuses
().
toString
());
}
@Test
public
void
testSuccessfulUnarchivingWithRealUnarchivingPreparation
()
{
...
...
@@ -369,36 +339,43 @@ public class RsyncArchiverTest extends AbstractFileSystemTestCase
}
@Test
public
void
testUnarchivingWith
MixedSuccess
()
public
void
testUnarchivingWith
DefaultShareFinder
()
{
final
DatasetDescription
ds1
=
new
DatasetDescriptionBuilder
(
"ds1"
).
getDatasetDescription
();
final
DatasetDescription
ds2
=
new
DatasetDescriptionBuilder
(
"ds2"
).
getDatasetDescription
();
context
.
checking
(
new
Expectations
()
{
{
one
(
dataSetDirectoryProvider
).
getDataSetDirectory
(
ds1
);
File
file1
=
new
File
(
store
,
LOCATION
);
will
(
returnValue
(
file1
));
one
(
dataSetDirectoryProvider
).
getDataSetDirectory
(
ds2
);
File
file2
=
new
File
(
store
,
LOCATION
);
will
(
returnValue
(
file2
));
one
(
configProvider
).
getDataStoreCode
();
will
(
returnValue
(
DATA_STORE_CODE
));
one
(
fileOperationsManager
).
retrieveFromDestination
(
file1
,
ds1
);
will
(
returnValue
(
Status
.
OK
));
one
(
service
).
listDataSets
();
SimpleDataSetInformationDTO
dataSet1
=
new
SimpleDataSetInformationDTO
();
dataSet1
.
setDataSetCode
(
"ds1"
);
dataSet1
.
setDataStoreCode
(
DATA_STORE_CODE
);
dataSet1
.
setDataSetShareId
(
"1"
);
dataSet1
.
setDataSetLocation
(
LOCATION
);
dataSet1
.
setDataSetSize
(
11L
);
SimpleDataSetInformationDTO
dataSet2
=
new
SimpleDataSetInformationDTO
();
dataSet2
.
setDataSetCode
(
"ds2"
);
dataSet2
.
setDataStoreCode
(
DATA_STORE_CODE
);
dataSet2
.
setDataSetShareId
(
"1"
);
dataSet2
.
setDataSetLocation
(
LOCATION
);
dataSet2
.
setDataSetSize
(
22L
);
will
(
returnValue
(
Arrays
.
asList
(
dataSet1
,
dataSet2
)));
one
(
fileOperations
Manager
).
r
et
rieveFromDestination
(
file2
,
ds2
);
will
(
returnValue
(
Status
.
createError
(
"Unarchiving failed"
)
));
one
(
shareId
Manager
).
g
et
ShareId
(
"ds1"
);
will
(
returnValue
(
"2"
));
one
(
statusUpdater
).
update
(
Arrays
.
asList
(
"ds1"
),
one
(
statusUpdater
).
update
(
Arrays
.
<
String
>
asList
(),
DataSetArchivingStatus
.
AVAILABLE
,
true
);
one
(
statusUpdater
).
update
(
Arrays
.
asList
(
"ds2"
),
DataSetArchivingStatus
.
ARCHIVED
,
one
(
statusUpdater
).
update
(
Arrays
.
asList
(
"ds1"
,
"ds2"
),
DataSetArchivingStatus
.
ARCHIVED
,
true
);
}
});
ProcessingStatus
status
=
archiver
.
unarchive
(
Arrays
.
asList
(
ds1
,
ds2
),
archiverTaskContext
);
assertEquals
(
"[ERROR: \"Unarchiving failed\"]"
,
status
.
getErrorStatuses
().
toString
());
assertEquals
(
"[ERROR: \"Unarchiving failed
: null
\"]"
,
status
.
getErrorStatuses
().
toString
());
}
}
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