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
fbe8c1be
Commit
fbe8c1be
authored
16 years ago
by
ribeaudc
Browse files
Options
Downloads
Patches
Plain Diff
fix: - Integration tests.
SVN: 8015
parent
537fde75
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bds/source/java/ch/systemsx/cisd/bds/DataSet.java
+4
-8
4 additions, 8 deletions
bds/source/java/ch/systemsx/cisd/bds/DataSet.java
common/source/java/ch/systemsx/cisd/common/types/BooleanOrUnknown.java
+17
-0
17 additions, 0 deletions
.../java/ch/systemsx/cisd/common/types/BooleanOrUnknown.java
with
21 additions
and
8 deletions
bds/source/java/ch/systemsx/cisd/bds/DataSet.java
+
4
−
8
View file @
fbe8c1be
...
@@ -17,7 +17,6 @@
...
@@ -17,7 +17,6 @@
package
ch.systemsx.cisd.bds
;
package
ch.systemsx.cisd.bds
;
import
java.io.StringWriter
;
import
java.io.StringWriter
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
...
@@ -171,20 +170,17 @@ public final class DataSet implements IStorable
...
@@ -171,20 +170,17 @@ public final class DataSet implements IStorable
final
String
code
=
Utilities
.
getTrimmedString
(
idFolder
,
CODE
);
final
String
code
=
Utilities
.
getTrimmedString
(
idFolder
,
CODE
);
final
String
observableTypeCode
=
Utilities
.
getTrimmedString
(
idFolder
,
OBSERVABLE_TYPE
);
final
String
observableTypeCode
=
Utilities
.
getTrimmedString
(
idFolder
,
OBSERVABLE_TYPE
);
final
Boolean
isMeasured
=
Utilities
.
getBoolean
(
idFolder
,
IS_MEASURED
);
final
Boolean
isMeasured
=
Utilities
.
getBoolean
(
idFolder
,
IS_MEASURED
);
final
Date
productionTimestampOrNull
=
final
Date
productionTimestampOrNull
=
Utilities
.
tryGetDate
(
idFolder
,
PRODUCTION_TIMESTAMP
);
Utilities
.
tryGetDate
(
idFolder
,
PRODUCTION_TIMESTAMP
);
final
String
producerCode
=
Utilities
.
getTrimmedString
(
idFolder
,
PRODUCER_CODE
);
final
String
producerCode
=
Utilities
.
getTrimmedString
(
idFolder
,
PRODUCER_CODE
);
final
List
<
String
>
parentCodes
=
Utilities
.
getStringList
(
idFolder
,
PARENT_CODES
);
final
List
<
String
>
parentCodes
=
Utilities
.
getStringList
(
idFolder
,
PARENT_CODES
);
final
String
strIsComplete
=
Utilities
.
getTrimmedString
(
idFolder
,
IS_COMPLETE
);
final
String
strIsComplete
=
Utilities
.
getTrimmedString
(
idFolder
,
IS_COMPLETE
);
BooleanOrUnknown
completeFlag
;
BooleanOrUnknown
completeFlag
;
try
try
{
{
completeFlag
=
BooleanOrUnknown
.
valueOf
(
strIsComplete
);
completeFlag
=
BooleanOrUnknown
.
getByNiceRepresentation
(
strIsComplete
);
}
catch
(
final
IllegalArgumentException
ex
)
}
catch
(
final
IllegalArgumentException
ex
)
{
{
throw
new
DataStructureException
(
String
.
format
(
throw
new
DataStructureException
(
ex
.
getMessage
());
"'%s' value must be one of '%s' but is '%s'."
,
IS_COMPLETE
,
Arrays
.
asList
(
BooleanOrUnknown
.
values
()),
strIsComplete
));
}
}
assert
completeFlag
!=
null
:
"Complete flag not specified."
;
assert
completeFlag
!=
null
:
"Complete flag not specified."
;
final
DataSet
dataSet
=
final
DataSet
dataSet
=
...
@@ -208,7 +204,7 @@ public final class DataSet implements IStorable
...
@@ -208,7 +204,7 @@ public final class DataSet implements IStorable
folder
.
addKeyValuePair
(
PRODUCER_CODE
,
StringUtils
.
emptyIfNull
(
producerCode
));
folder
.
addKeyValuePair
(
PRODUCER_CODE
,
StringUtils
.
emptyIfNull
(
producerCode
));
folder
.
addKeyValuePair
(
IS_MEASURED
,
isMeasured
.
toString
());
folder
.
addKeyValuePair
(
IS_MEASURED
,
isMeasured
.
toString
());
folder
.
addKeyValuePair
(
OBSERVABLE_TYPE
,
observableTypeCode
);
folder
.
addKeyValuePair
(
OBSERVABLE_TYPE
,
observableTypeCode
);
folder
.
addKeyValuePair
(
IS_COMPLETE
,
isComplete
.
toString
());
folder
.
addKeyValuePair
(
IS_COMPLETE
,
isComplete
.
getNiceRepresentation
());
final
String
value
;
final
String
value
;
if
(
parentCodes
.
size
()
>
0
)
if
(
parentCodes
.
size
()
>
0
)
{
{
...
...
This diff is collapsed.
Click to expand it.
common/source/java/ch/systemsx/cisd/common/types/BooleanOrUnknown.java
+
17
−
0
View file @
fbe8c1be
...
@@ -43,6 +43,23 @@ public enum BooleanOrUnknown
...
@@ -43,6 +43,23 @@ public enum BooleanOrUnknown
return
niceRepresentation
;
return
niceRepresentation
;
}
}
public
final
static
BooleanOrUnknown
getByNiceRepresentation
(
final
String
niceRepresentation
)
{
if
(
niceRepresentation
.
equals
(
"FALSE"
))
{
return
F
;
}
if
(
niceRepresentation
.
equals
(
"TRUE"
))
{
return
T
;
}
if
(
niceRepresentation
.
equals
(
"UNKNOWN"
))
{
return
U
;
}
throw
new
IllegalArgumentException
(
String
.
format
(
"Given nice representation '%s' unknown."
));
}
/**
/**
* Resolve the specified boolean flag to either {@link #T} or {@link #F}.
* Resolve the specified boolean flag to either {@link #T} or {@link #F}.
*/
*/
...
...
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