Skip to content
Snippets Groups Projects
Commit f0575482 authored by yvesn's avatar yvesn
Browse files

SSDM-5463: fixing build - not relying on ordering in query result which might...

SSDM-5463: fixing build - not relying on ordering in query result which might change; specifying data set kind CONTAINER for container data set

SVN: 38772
parent f4530bf5
No related branches found
No related tags found
No related merge requests found
...@@ -175,12 +175,11 @@ public class DataSetListerTest extends AbstractDAOTest ...@@ -175,12 +175,11 @@ public class DataSetListerTest extends AbstractDAOTest
{ {
if (url.getDataStoreURL().equals("http://download_1")) if (url.getDataStoreURL().equals("http://download_1"))
{ {
assertEquals(Arrays.asList("20081105092159188-3", "20081105092159111-1", assertListContains(Arrays.asList("20081105092159188-3", "20081105092159111-1",
"20081105092259000-19"), url.getDataSetCodes()); "20081105092259000-19"), url.getDataSetCodes());
} else if (url.getDataStoreURL().equals("http://download_2")) } else if (url.getDataStoreURL().equals("http://download_2"))
{ {
assertEquals(Arrays.asList("20081105092259000-20", "20081105092259000-21"), assertListContains(Arrays.asList("20081105092259000-20", "20081105092259000-21"), url.getDataSetCodes());
url.getDataSetCodes());
} else } else
{ {
fail("URL " + url + " not expected."); fail("URL " + url + " not expected.");
...@@ -193,12 +192,11 @@ public class DataSetListerTest extends AbstractDAOTest ...@@ -193,12 +192,11 @@ public class DataSetListerTest extends AbstractDAOTest
{ {
if (url.getDataStoreURL().equals("http://remote_1")) if (url.getDataStoreURL().equals("http://remote_1"))
{ {
assertEquals(Arrays.asList("20081105092159188-3", "20081105092159111-1", assertListContains(Arrays.asList("20081105092159188-3", "20081105092159111-1",
"20081105092259000-19"), url.getDataSetCodes()); "20081105092259000-19"), url.getDataSetCodes());
} else if (url.getDataStoreURL().equals("http://remote_2")) } else if (url.getDataStoreURL().equals("http://remote_2"))
{ {
assertEquals(Arrays.asList("20081105092259000-20", "20081105092259000-21"), assertListContains(Arrays.asList("20081105092259000-20", "20081105092259000-21"), url.getDataSetCodes());
url.getDataSetCodes());
} else } else
{ {
fail("URL " + url + " not expected."); fail("URL " + url + " not expected.");
...@@ -210,7 +208,18 @@ public class DataSetListerTest extends AbstractDAOTest ...@@ -210,7 +208,18 @@ public class DataSetListerTest extends AbstractDAOTest
} }
} }
@Test private void assertListContains(List<String> expectedCodes, List<String> dataSetCodes)
{
for (String expectedCode : expectedCodes)
{
if (false == dataSetCodes.contains(expectedCode))
{
fail("Data set code " + expectedCode + " is expected to be in collection " + dataSetCodes);
}
}
}
@Test
public void testGetDataSetMetaDataForExistingDataSetCodesWithParentsShouldReturnDataSetsWithParents() public void testGetDataSetMetaDataForExistingDataSetCodesWithParentsShouldReturnDataSetsWithParents()
{ {
List<String> codes = new ArrayList<String>(); List<String> codes = new ArrayList<String>();
......
...@@ -67,6 +67,7 @@ import ch.systemsx.cisd.openbis.dss.generic.shared.ServiceProvider; ...@@ -67,6 +67,7 @@ import ch.systemsx.cisd.openbis.dss.generic.shared.ServiceProvider;
import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1.IDataSetImmutable; import ch.systemsx.cisd.openbis.dss.generic.shared.api.internal.v1.IDataSetImmutable;
import ch.systemsx.cisd.openbis.dss.generic.shared.dto.DataSetInformation; import ch.systemsx.cisd.openbis.dss.generic.shared.dto.DataSetInformation;
import ch.systemsx.cisd.openbis.dss.generic.shared.dto.Size; import ch.systemsx.cisd.openbis.dss.generic.shared.dto.Size;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.DataSetKind;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.SearchCriteria; import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.SearchCriteria;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.SearchCriteria.MatchClause; import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.SearchCriteria.MatchClause;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.SearchCriteria.MatchClauseAttribute; import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.SearchCriteria.MatchClauseAttribute;
...@@ -595,6 +596,7 @@ public class ImagingDataSetRegistrationTransaction extends DataSetRegistrationTr ...@@ -595,6 +596,7 @@ public class ImagingDataSetRegistrationTransaction extends DataSetRegistrationTr
factory.featureVectorContainerDatasetFactory, containerDatasetTypeCode); factory.featureVectorContainerDatasetFactory, containerDatasetTypeCode);
containerDataSet.setContainedDataSetCodes(Collections.singletonList(mainDataset containerDataSet.setContainedDataSetCodes(Collections.singletonList(mainDataset
.getDataSetCode())); .getDataSetCode()));
containerDataSet.setDataSetKind(DataSetKind.CONTAINER);
containerDataSet.setOriginalDataSet(mainDataset); containerDataSet.setOriginalDataSet(mainDataset);
......
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