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
8dd4220e
Commit
8dd4220e
authored
14 years ago
by
buczekp
Browse files
Options
Downloads
Patches
Plain Diff
[LMS-2106] improved tests
SVN: 20307
parent
b5799dbc
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
datastore_server/sourceTest/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/RsyncDataSetCopierTest.java
+23
-13
23 additions, 13 deletions
...neric/server/plugins/standard/RsyncDataSetCopierTest.java
with
23 additions
and
13 deletions
datastore_server/sourceTest/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/RsyncDataSetCopierTest.java
+
23
−
13
View file @
8dd4220e
...
...
@@ -45,9 +45,6 @@ public class RsyncDataSetCopierTest extends AbstractFileSystemTestCase
private
static
final
String
LOCATION_1
=
"l1"
;
@SuppressWarnings
(
"unused"
)
private
static
final
String
LOCATION_2
=
"l2"
;
private
static
final
String
DS1_CODE
=
"ds1"
;
private
static
final
String
DS2_CODE
=
"ds2"
;
...
...
@@ -58,7 +55,11 @@ public class RsyncDataSetCopierTest extends AbstractFileSystemTestCase
private
static
final
String
DS1_DATA_FILE
=
"data.txt"
;
private
static
final
String
DATA
=
"hello test"
;
private
static
final
String
DS2_DATA_FILE
=
"data2.txt"
;
private
static
final
String
DATA1
=
"hello test 1"
;
private
static
final
String
DATA2
=
"hello test 2"
;
private
static
final
String
ORIGINAL
=
"original"
;
...
...
@@ -120,14 +121,14 @@ public class RsyncDataSetCopierTest extends AbstractFileSystemTestCase
File
ds1Folder
=
new
File
(
ds1Location
,
ORIGINAL
);
ds1Folder
.
mkdirs
();
ds1Data
=
new
File
(
ds1Folder
,
DS1_DATA_FILE
);
FileUtilities
.
writeToFile
(
ds1Data
,
DATA
);
FileUtilities
.
writeToFile
(
ds1Data
,
DATA
1
);
ds2
=
createDataSetDescription
(
DS2_CODE
,
DS2_LOCATION
,
true
);
ds2Location
=
new
File
(
share
,
DS2_LOCATION
);
File
ds2Folder
=
new
File
(
ds2Location
,
ORIGINAL
);
ds2Folder
.
mkdirs
();
ds2Data
=
new
File
(
ds2Folder
,
"images"
);
ds2Data
.
mkdirs
(
);
ds2Data
=
new
File
(
ds2Folder
,
DS2_DATA_FILE
);
FileUtilities
.
writeToFile
(
ds2Data
,
DATA2
);
destination
=
new
File
(
workingDirectory
,
"destination"
);
destination
.
mkdirs
();
...
...
@@ -221,13 +222,13 @@ public class RsyncDataSetCopierTest extends AbstractFileSystemTestCase
Status
status2
=
dataSetCopier
.
copyToDestination
(
ds2Location
,
ds2
);
assertEquals
(
Status
.
OK
,
status2
);
assertDs2InArchive
(
copiedDataSet2
,
copiedData2
);
// check that 1st data set is still in archive
assertDs1InArchive
(
copiedDataSet1
,
copiedData1
);
// check 2nd data set
assertDs2InArchive
(
copiedDataSet2
,
copiedData2
);
// both data sets should be in the store
assertDs1InStore
();
assert
Equals
(
true
,
ds2Data
.
exists
()
);
assert
Ds2InStore
(
);
context
.
assertIsSatisfied
();
}
...
...
@@ -268,9 +269,11 @@ public class RsyncDataSetCopierTest extends AbstractFileSystemTestCase
Status
statusRetrieve
=
dataSetCopier
.
retrieveFromDestination
(
ds1Location
,
ds1
);
assertEquals
(
Status
.
OK
,
statusRetrieve
);
assertDs1InStore
();
assertDs1InArchive
(
copiedDataSet
,
copiedData
);
// ds2 shouldn't be affected at all
assertDs2InStore
();
context
.
assertIsSatisfied
();
}
...
...
@@ -330,20 +333,27 @@ public class RsyncDataSetCopierTest extends AbstractFileSystemTestCase
private
void
assertDs1InStore
()
{
assertEquals
(
true
,
ds1Data
.
exists
());
assertEquals
(
DATA
,
FileUtilities
.
loadToString
(
ds1Data
).
trim
());
assertEquals
(
DATA1
,
FileUtilities
.
loadToString
(
ds1Data
).
trim
());
}
private
void
assertDs2InStore
()
{
assertEquals
(
true
,
ds2Data
.
exists
());
assertEquals
(
DATA2
,
FileUtilities
.
loadToString
(
ds2Data
).
trim
());
}
private
void
assertDs1InArchive
(
File
copiedDataSet
,
File
copiedData
)
{
assertEquals
(
true
,
copiedDataSet
.
isDirectory
());
assertEquals
(
ds1Data
.
lastModified
(),
copiedDataSet
.
lastModified
());
assertEquals
(
DATA
,
FileUtilities
.
loadToString
(
copiedData
).
trim
());
assertEquals
(
DATA
1
,
FileUtilities
.
loadToString
(
copiedData
).
trim
());
}
private
void
assertDs2InArchive
(
File
copiedDataSet2
,
File
copiedData2
)
{
assertEquals
(
true
,
copiedDataSet2
.
isDirectory
());
assertEquals
(
ds2Data
.
lastModified
(),
copiedData2
.
lastModified
());
assertEquals
(
DATA2
,
FileUtilities
.
loadToString
(
copiedData2
).
trim
());
}
private
Properties
createLocalDestinationProperties
()
...
...
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