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
2e3065de
Commit
2e3065de
authored
14 years ago
by
tpylak
Browse files
Options
Downloads
Patches
Plain Diff
LMS-1966 fix unit tests
SVN: 19473
parent
5e8d9762
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/etlserver/registrator/JythonTopLevelDataSetRegistratorTest.java
+38
-10
38 additions, 10 deletions
...ver/registrator/JythonTopLevelDataSetRegistratorTest.java
with
38 additions
and
10 deletions
datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/registrator/JythonTopLevelDataSetRegistratorTest.java
+
38
−
10
View file @
2e3065de
...
@@ -113,20 +113,17 @@ public class JythonTopLevelDataSetRegistratorTest extends AbstractFileSystemTest
...
@@ -113,20 +113,17 @@ public class JythonTopLevelDataSetRegistratorTest extends AbstractFileSystemTest
}
}
@Test
@Test
public
void
test
Invalid
ScriptPath
()
public
void
testScriptPath
DeletedLater
()
{
{
setUpHomeDataBaseExpectations
();
setUpHomeDataBaseExpectations
();
String
scriptPath
=
"foo.py"
;
Properties
threadProperties
=
createThreadProperties
(
scriptPath
);
Properties
threadProperties
=
new
Properties
();
// test the situation where script has been deleted later
threadProperties
.
put
(
ThreadParameters
.
INCOMING_DIR
,
"incoming"
);
File
scriptFile
=
new
File
(
scriptPath
);
threadProperties
.
put
(
ThreadParameters
.
INCOMING_DATA_COMPLETENESS_CONDITION
,
FileUtilities
.
writeToFile
(
scriptFile
,
"x"
);
ThreadParameters
.
INCOMING_DATA_COMPLETENESS_CONDITION_MARKER_FILE
);
threadProperties
.
put
(
ThreadParameters
.
DELETE_UNIDENTIFIED_KEY
,
"false"
);
threadProperties
.
put
(
IStorageProcessor
.
STORAGE_PROCESSOR_KEY
,
MockStorageProcessor
.
class
.
getName
());
threadProperties
.
put
(
JythonTopLevelDataSetHandler
.
SCRIPT_PATH_KEY
,
"foo.py"
);
createHandler
(
threadProperties
);
createHandler
(
threadProperties
);
FileUtilities
.
delete
(
scriptFile
);
try
try
{
{
incomingDataSetFile
=
createDirectory
(
workingDirectory
,
"data_set"
);
incomingDataSetFile
=
createDirectory
(
workingDirectory
,
"data_set"
);
...
@@ -146,6 +143,37 @@ public class JythonTopLevelDataSetRegistratorTest extends AbstractFileSystemTest
...
@@ -146,6 +143,37 @@ public class JythonTopLevelDataSetRegistratorTest extends AbstractFileSystemTest
}
}
}
}
@Test
public
void
testScriptPathMissing
()
{
setUpHomeDataBaseExpectations
();
String
scriptPath
=
"foo.py"
;
Properties
threadProperties
=
createThreadProperties
(
scriptPath
);
// it should not be possible to create a handler if script does not exist
try
{
createHandler
(
threadProperties
);
fail
(
"The script should does not exist"
);
}
catch
(
ConfigurationFailureException
ex
)
{
assertEquals
(
ex
.
getMessage
(),
"Script file 'foo.py' does not exist!"
);
}
}
private
Properties
createThreadProperties
(
String
scriptPath
)
{
Properties
threadProperties
=
new
Properties
();
threadProperties
.
put
(
ThreadParameters
.
INCOMING_DIR
,
"incoming"
);
threadProperties
.
put
(
ThreadParameters
.
INCOMING_DATA_COMPLETENESS_CONDITION
,
ThreadParameters
.
INCOMING_DATA_COMPLETENESS_CONDITION_MARKER_FILE
);
threadProperties
.
put
(
ThreadParameters
.
DELETE_UNIDENTIFIED_KEY
,
"false"
);
threadProperties
.
put
(
IStorageProcessor
.
STORAGE_PROCESSOR_KEY
,
MockStorageProcessor
.
class
.
getName
());
threadProperties
.
put
(
JythonTopLevelDataSetHandler
.
SCRIPT_PATH_KEY
,
scriptPath
);
return
threadProperties
;
}
@Test
@Test
public
void
testNoScriptPath
()
public
void
testNoScriptPath
()
{
{
...
...
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