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
a8c970a5
Commit
a8c970a5
authored
10 years ago
by
pkupczyk
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-1286 : QGF: Setup of automatic testing of dropboxes
SVN: 33026
parent
34c50d19
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
61
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/util/TestInitializer.java
+46
-9
46 additions, 9 deletions
...msx/cisd/openbis/generic/server/util/TestInitializer.java
with
46 additions
and
9 deletions
openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/util/TestInitializer.java
+
46
−
9
View file @
a8c970a5
...
@@ -47,13 +47,17 @@ public class TestInitializer
...
@@ -47,13 +47,17 @@ public class TestInitializer
static
final
Logger
operationLog
=
LogFactory
.
getLogger
(
LogCategory
.
OPERATION
,
static
final
Logger
operationLog
=
LogFactory
.
getLogger
(
LogCategory
.
OPERATION
,
TestInitializer
.
class
);
TestInitializer
.
class
);
p
ublic
static
final
String
LUCENE_INDEX_TEMPLATE_PATH
=
"targets/tempLuceneIndices"
;
p
rivate
static
final
String
LUCENE_INDEX_TEMPLATE_PATH
=
"targets/tempLuceneIndices"
;
p
ublic
static
final
String
LUCENE_INDEX_PATH
=
"targets/lucene/indices"
;
p
rivate
static
final
String
LUCENE_INDEX_PATH
=
"targets/lucene/indices"
;
p
ublic
static
final
String
SCRIPT_FOLDER_TEST_DB
=
"../openbis/source
Test"
;
p
rivate
static
final
String
SCRIPT_FOLDER_TEST_DB
_PROPERTY_NAME
=
"scriptFolder
Test
DB
"
;
public
static
final
String
SCRIPT_FOLDER_EMPTY_DB
=
"../openbis/source"
;
private
static
final
String
SCRIPT_FOLDER_EMPTY_DB_PROPERTY_NAME
=
"scriptFolderEmptyDB"
;
private
static
final
String
DEFAULT_SCRIPT_FOLDER_TEST_DB
=
"../openbis/sourceTest"
;
private
static
final
String
DEFAULT_SCRIPT_FOLDER_EMPTY_DB
=
"../openbis/source"
;
public
static
void
init
()
public
static
void
init
()
{
{
...
@@ -62,22 +66,22 @@ public class TestInitializer
...
@@ -62,22 +66,22 @@ public class TestInitializer
public
static
void
initWithoutIndex
()
public
static
void
initWithoutIndex
()
{
{
init
(
IndexMode
.
NO_INDEX
,
SCRIPT_FOLDER_TEST_DB
);
init
(
IndexMode
.
NO_INDEX
,
getScriptFolderTestDB
()
);
}
}
public
static
void
initWithIndex
()
public
static
void
initWithIndex
()
{
{
init
(
IndexMode
.
SKIP_IF_MARKER_FOUND
,
SCRIPT_FOLDER_TEST_DB
);
init
(
IndexMode
.
SKIP_IF_MARKER_FOUND
,
getScriptFolderTestDB
()
);
}
}
public
static
void
initEmptyDbNoIndex
()
public
static
void
initEmptyDbNoIndex
()
{
{
init
(
IndexMode
.
NO_INDEX
,
SCRIPT_FOLDER_EMPTY_DB
);
init
(
IndexMode
.
NO_INDEX
,
getScriptFolderEmptyDB
()
);
}
}
public
static
void
initEmptyDbWithIndex
()
public
static
void
initEmptyDbWithIndex
()
{
{
init
(
IndexMode
.
SKIP_IF_MARKER_FOUND
,
SCRIPT_FOLDER_EMPTY_DB
);
init
(
IndexMode
.
SKIP_IF_MARKER_FOUND
,
getScriptFolderEmptyDB
()
);
}
}
private
static
boolean
firstTry
=
true
;
private
static
boolean
firstTry
=
true
;
...
@@ -97,7 +101,7 @@ public class TestInitializer
...
@@ -97,7 +101,7 @@ public class TestInitializer
FileUtilities
.
deleteRecursively
(
temporaryFile
);
FileUtilities
.
deleteRecursively
(
temporaryFile
);
temporaryFile
.
mkdirs
();
temporaryFile
.
mkdirs
();
System
.
setProperty
(
"script-folder"
,
SCRIPT_FOLDER_TEST_DB
);
System
.
setProperty
(
"script-folder"
,
scriptFolder
);
IndexCreationUtil
.
main
(
databaseKind
,
temporaryFile
.
getAbsolutePath
(),
"true"
);
IndexCreationUtil
.
main
(
databaseKind
,
temporaryFile
.
getAbsolutePath
(),
"true"
);
}
catch
(
Exception
ex
)
}
catch
(
Exception
ex
)
...
@@ -173,4 +177,37 @@ public class TestInitializer
...
@@ -173,4 +177,37 @@ public class TestInitializer
}
}
}
}
public
static
String
getScriptFolderTestDBPropertyName
()
{
return
TestInitializer
.
class
.
getName
()
+
"."
+
SCRIPT_FOLDER_TEST_DB_PROPERTY_NAME
;
}
public
static
String
getScriptFolderEmptyDBPropertyName
()
{
return
TestInitializer
.
class
.
getName
()
+
"."
+
SCRIPT_FOLDER_EMPTY_DB_PROPERTY_NAME
;
}
private
static
String
getScriptFolderTestDB
()
{
return
getSystemProperty
(
getScriptFolderTestDBPropertyName
(),
DEFAULT_SCRIPT_FOLDER_TEST_DB
);
}
private
static
String
getScriptFolderEmptyDB
()
{
return
getSystemProperty
(
getScriptFolderEmptyDBPropertyName
(),
DEFAULT_SCRIPT_FOLDER_EMPTY_DB
);
}
private
static
String
getSystemProperty
(
String
propertyName
,
String
defaultValue
)
{
String
propertyValue
=
System
.
getProperty
(
propertyName
);
if
(
propertyValue
!=
null
&&
false
==
propertyValue
.
trim
().
isEmpty
())
{
return
propertyValue
.
trim
();
}
else
{
return
defaultValue
;
}
}
}
}
This diff is collapsed.
Click to expand it.
Prev
1
2
3
4
Next
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