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
5f2ca797
Commit
5f2ca797
authored
12 years ago
by
cramakri
Browse files
Options
Downloads
Patches
Plain Diff
SP-45 BIS-21 : Adde expectation for drawAUniqueId
SVN: 25337
parent
474d48bd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
eu_basynthec/sourceTest/java/eu/basynthec/cisd/dss/AbstractBaSynthecDataSetRegistratorTest.java
+48
-20
48 additions, 20 deletions
...hec/cisd/dss/AbstractBaSynthecDataSetRegistratorTest.java
with
48 additions
and
20 deletions
eu_basynthec/sourceTest/java/eu/basynthec/cisd/dss/AbstractBaSynthecDataSetRegistratorTest.java
+
48
−
20
View file @
5f2ca797
...
@@ -69,7 +69,8 @@ public abstract class AbstractBaSynthecDataSetRegistratorTest extends
...
@@ -69,7 +69,8 @@ public abstract class AbstractBaSynthecDataSetRegistratorTest extends
protected
RecordingMatcher
<
AtomicEntityOperationDetails
>
setUpDataSetRegistrationExpectations
(
protected
RecordingMatcher
<
AtomicEntityOperationDetails
>
setUpDataSetRegistrationExpectations
(
final
DataSetType
dataSetType
,
final
DataSetType
tsvDataSetType
)
final
DataSetType
dataSetType
,
final
DataSetType
tsvDataSetType
)
{
{
return
setUpDataSetRegistrationExpectations
(
dataSetType
,
tsvDataSetType
,
true
);
return
setUpDataSetRegistrationExpectations
(
dataSetType
,
tsvDataSetType
,
true
);
}
}
protected
RecordingMatcher
<
AtomicEntityOperationDetails
>
setUpDataSetRegistrationExpectations
(
protected
RecordingMatcher
<
AtomicEntityOperationDetails
>
setUpDataSetRegistrationExpectations
(
...
@@ -83,11 +84,13 @@ public abstract class AbstractBaSynthecDataSetRegistratorTest extends
...
@@ -83,11 +84,13 @@ public abstract class AbstractBaSynthecDataSetRegistratorTest extends
context
.
checking
(
new
Expectations
()
context
.
checking
(
new
Expectations
()
{
{
{
{
one
(
openBisService
).
createDataSetCode
();
one
(
openBisService
).
createDataSetCode
();
will
(
returnValue
(
DATA_SET_CODE
));
will
(
returnValue
(
DATA_SET_CODE
));
String
excelDataSetCode
=
DATA_SET_CODE
+
"-EXCEL"
;
String
excelDataSetCode
=
DATA_SET_CODE
+
"-EXCEL"
;
one
(
openBisService
).
createDataSetCode
();
one
(
openBisService
).
createDataSetCode
();
will
(
returnValue
(
excelDataSetCode
));
will
(
returnValue
(
excelDataSetCode
));
// Some if there is a multistrain data set type, it needs to be taken care of in
// Some if there is a multistrain data set type, it needs to be taken care of in
...
@@ -95,33 +98,44 @@ public abstract class AbstractBaSynthecDataSetRegistratorTest extends
...
@@ -95,33 +98,44 @@ public abstract class AbstractBaSynthecDataSetRegistratorTest extends
if
(
tsvDataSetType
==
TSV_MULTISTRAIN_EXPORT_DATA_SET_TYPE
)
if
(
tsvDataSetType
==
TSV_MULTISTRAIN_EXPORT_DATA_SET_TYPE
)
{
{
String
tsvMultistrain
=
DATA_SET_CODE
+
"-TSV-MULTISTRAIN"
;
String
tsvMultistrain
=
DATA_SET_CODE
+
"-TSV-MULTISTRAIN"
;
one
(
openBisService
).
createDataSetCode
();
one
(
openBisService
).
createDataSetCode
();
will
(
returnValue
(
tsvMultistrain
));
will
(
returnValue
(
tsvMultistrain
));
}
}
String
tsvDataSetCode
=
DATA_SET_CODE
+
"-TSV"
;
String
tsvDataSetCode
=
DATA_SET_CODE
+
"-TSV"
;
if
(
requireSingleStrainTsvExport
)
if
(
requireSingleStrainTsvExport
)
{
{
one
(
openBisService
).
createDataSetCode
();
one
(
openBisService
).
createDataSetCode
();
will
(
returnValue
(
tsvDataSetCode
));
will
(
returnValue
(
tsvDataSetCode
));
}
}
atLeast
(
1
).
of
(
openBisService
).
tryToGetExperiment
(
atLeast
(
1
).
of
(
openBisService
).
tryToGetExperiment
(
new
ExperimentIdentifierFactory
(
experiment
.
getIdentifier
())
new
ExperimentIdentifierFactory
(
experiment
.
getIdentifier
())
.
createIdentifier
());
.
createIdentifier
());
will
(
returnValue
(
experiment
));
will
(
returnValue
(
experiment
));
allowing
(
openBisService
).
tryToGetExperiment
(
null
);
allowing
(
openBisService
).
tryToGetExperiment
(
null
);
will
(
returnValue
(
null
));
will
(
returnValue
(
null
));
one
(
dataSetValidator
).
assertValidDataSet
(
dataSetType
,
null
);
one
(
dataSetValidator
).
assertValidDataSet
(
dataSetType
,
null
);
one
(
dataSetValidator
).
assertValidDataSet
(
new
DataSetType
(
"EXCEL_ORIGINAL"
),
one
(
dataSetValidator
).
assertValidDataSet
(
new
DataSetType
(
"EXCEL_ORIGINAL"
),
new
File
(
new
File
(
stagingDirectory
,
excelDataSetCode
),
"xls"
));
new
File
(
new
File
(
stagingDirectory
,
excelDataSetCode
),
"xls"
));
if
(
tsvDataSetType
==
TSV_MULTISTRAIN_EXPORT_DATA_SET_TYPE
)
if
(
tsvDataSetType
==
TSV_MULTISTRAIN_EXPORT_DATA_SET_TYPE
)
{
{
one
(
dataSetValidator
).
assertValidDataSet
(
one
(
dataSetValidator
).
assertValidDataSet
(
TSV_MULTISTRAIN_EXPORT_DATA_SET_TYPE
,
TSV_MULTISTRAIN_EXPORT_DATA_SET_TYPE
,
new
File
(
new
File
(
stagingDirectory
,
DATA_SET_CODE
new
File
(
new
File
(
stagingDirectory
,
DATA_SET_CODE
+
"-TSV-MULTISTRAIN"
),
"tsv-multi"
));
+
"-TSV-MULTISTRAIN"
),
"tsv-multi"
));
...
@@ -129,15 +143,25 @@ public abstract class AbstractBaSynthecDataSetRegistratorTest extends
...
@@ -129,15 +143,25 @@ public abstract class AbstractBaSynthecDataSetRegistratorTest extends
if
(
requireSingleStrainTsvExport
)
if
(
requireSingleStrainTsvExport
)
{
{
one
(
dataSetValidator
).
assertValidDataSet
(
TSV_DATA_SET_TYPE
,
one
(
dataSetValidator
).
assertValidDataSet
(
TSV_DATA_SET_TYPE
,
new
File
(
new
File
(
stagingDirectory
,
tsvDataSetCode
),
"tsv"
));
new
File
(
new
File
(
stagingDirectory
,
tsvDataSetCode
),
"tsv"
));
}
}
one
(
openBisService
).
performEntityOperations
(
with
(
atomicatOperationDetails
));
one
(
openBisService
).
drawANewUniqueID
();
will
(
returnValue
(
new
Long
(
1
)));
one
(
openBisService
).
performEntityOperations
(
with
(
atomicatOperationDetails
));
will
(
returnValue
(
new
AtomicEntityOperationResult
()));
will
(
returnValue
(
new
AtomicEntityOperationResult
()));
allowing
(
openBisService
).
setStorageConfirmed
(
with
(
any
(
String
.
class
)));
allowing
(
openBisService
).
setStorageConfirmed
(
with
(
any
(
String
.
class
)));
}
}
});
});
...
@@ -146,19 +170,21 @@ public abstract class AbstractBaSynthecDataSetRegistratorTest extends
...
@@ -146,19 +170,21 @@ public abstract class AbstractBaSynthecDataSetRegistratorTest extends
protected
Properties
createThreadProperties
()
protected
Properties
createThreadProperties
()
{
{
return
createThreadPropertiesRelativeToScriptsFolder
(
"data-set-handler.py"
,
return
createThreadPropertiesRelativeToScriptsFolder
(
"dist/etc/shared/shared-classes.py,"
+
getRegistrationScriptsFolderPath
()
"data-set-handler.py"
,
"dist/etc/shared/shared-classes.py,"
+
"/data-set-validator.py"
);
+
getRegistrationScriptsFolderPath
()
+
"/data-set-validator.py"
);
}
}
protected
void
createData
(
String
fileName
)
throws
IOException
protected
void
createData
(
String
fileName
)
throws
IOException
{
{
File
dataFile
=
new
File
(
"sourceTest/examples/"
+
fileName
);
File
dataFile
=
new
File
(
"sourceTest/examples/"
+
fileName
);
FileUtils
.
copyFileToDirectory
(
dataFile
,
workingDirectory
);
FileUtils
.
copyFileToDirectory
(
dataFile
,
workingDirectory
);
incomingDataSetFile
=
new
File
(
workingDirectory
,
dataFile
.
getName
());
incomingDataSetFile
=
new
File
(
workingDirectory
,
dataFile
.
getName
());
markerFile
=
new
File
(
workingDirectory
,
IS_FINISHED_PREFIX
+
dataFile
.
getName
());
markerFile
=
new
File
(
workingDirectory
,
IS_FINISHED_PREFIX
+
dataFile
.
getName
());
FileUtilities
.
writeToFile
(
markerFile
,
""
);
FileUtilities
.
writeToFile
(
markerFile
,
""
);
}
}
protected
HashMap
<
String
,
NewProperty
>
getDataSetPropertiesMap
(
protected
HashMap
<
String
,
NewProperty
>
getDataSetPropertiesMap
(
...
@@ -167,7 +193,8 @@ public abstract class AbstractBaSynthecDataSetRegistratorTest extends
...
@@ -167,7 +193,8 @@ public abstract class AbstractBaSynthecDataSetRegistratorTest extends
HashMap
<
String
,
NewProperty
>
propertyMap
=
new
HashMap
<
String
,
NewProperty
>();
HashMap
<
String
,
NewProperty
>
propertyMap
=
new
HashMap
<
String
,
NewProperty
>();
for
(
NewProperty
prop
:
dataSetProperties
)
for
(
NewProperty
prop
:
dataSetProperties
)
{
{
propertyMap
.
put
(
prop
.
getPropertyCode
(),
prop
);
propertyMap
.
put
(
prop
.
getPropertyCode
(),
prop
);
}
}
return
propertyMap
;
return
propertyMap
;
}
}
...
@@ -177,7 +204,8 @@ public abstract class AbstractBaSynthecDataSetRegistratorTest extends
...
@@ -177,7 +204,8 @@ public abstract class AbstractBaSynthecDataSetRegistratorTest extends
HashMap
<
String
,
NewProperty
>
propertyMap
=
HashMap
<
String
,
NewProperty
>
propertyMap
=
getDataSetPropertiesMap
(
dataSet
.
getDataSetProperties
());
getDataSetPropertiesMap
(
dataSet
.
getDataSetProperties
());
NewProperty
property
=
propertyMap
.
get
(
"DATA_TYPE"
);
NewProperty
property
=
propertyMap
.
get
(
"DATA_TYPE"
);
assertEquals
(
expectedValue
,
property
.
getValue
());
assertEquals
(
expectedValue
,
property
.
getValue
());
}
}
}
}
\ No newline at end of file
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