Skip to content
Snippets Groups Projects
Commit 3d45bf25 authored by ribeaudc's avatar ribeaudc
Browse files

fix: - Integration tests (maybe...).

SVN: 5320
parent 80979e1a
No related branches found
No related tags found
No related merge requests found
...@@ -36,9 +36,6 @@ public final class DataSet implements IStorable ...@@ -36,9 +36,6 @@ public final class DataSet implements IStorable
static final String NO_PARENT_FOR_MEASURED_DATA = static final String NO_PARENT_FOR_MEASURED_DATA =
"No parent could be specified for measured data."; "No parent could be specified for measured data.";
static final String PARENT_FOR_DERIVED_DATA =
"At least one parent must be specified for derived data.";
static final String FOLDER = "data_set"; static final String FOLDER = "data_set";
static final String CODE = "code"; static final String CODE = "code";
...@@ -105,21 +102,12 @@ public final class DataSet implements IStorable ...@@ -105,21 +102,12 @@ public final class DataSet implements IStorable
this.isMeasured = isMeasured; this.isMeasured = isMeasured;
assert StringUtils.isEmpty(observableType) == false : "Unspecified observable type."; assert StringUtils.isEmpty(observableType) == false : "Unspecified observable type.";
this.observableTypeCode = observableType; this.observableTypeCode = observableType;
if (isMeasured == false) if (isMeasured == true && parentCodesOrNull != null && parentCodesOrNull.size() > 0)
{
if (parentCodesOrNull == null || parentCodesOrNull.size() == 0)
{
throw new IllegalArgumentException(PARENT_FOR_DERIVED_DATA);
}
this.parentCodes = parentCodesOrNull;
} else
{ {
if (parentCodesOrNull != null && parentCodesOrNull.size() > 0) throw new IllegalArgumentException(String.format(NO_PARENT_FOR_MEASURED_DATA));
{
throw new IllegalArgumentException(String.format(NO_PARENT_FOR_MEASURED_DATA));
}
this.parentCodes = Collections.<String> emptyList();
} }
this.parentCodes =
parentCodesOrNull == null ? Collections.<String> emptyList() : parentCodesOrNull;
this.producerCode = producerCodeOrNull; this.producerCode = producerCodeOrNull;
this.productionTimestamp = productionTimestampOrNull; this.productionTimestamp = productionTimestampOrNull;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment