Skip to content
Snippets Groups Projects
Commit c9486c43 authored by anttil's avatar anttil
Browse files

SSDM-1676: more test fixes

SVN: 33838
parent fac86d50
No related branches found
No related tags found
No related merge requests found
...@@ -960,7 +960,7 @@ public class UpdateSampleTest extends AbstractSampleTest ...@@ -960,7 +960,7 @@ public class UpdateSampleTest extends AbstractSampleTest
{ {
v3api.updateSamples(sessionToken, Arrays.asList(update)); v3api.updateSamples(sessionToken, Arrays.asList(update));
} }
}, "Circular dependency found: /CISD/3VCP8"); }, "Circular dependency found: /CISD/3V-125");
} }
@Test @Test
...@@ -1110,7 +1110,7 @@ public class UpdateSampleTest extends AbstractSampleTest ...@@ -1110,7 +1110,7 @@ public class UpdateSampleTest extends AbstractSampleTest
{ {
v3api.updateSamples(sessionToken, Arrays.asList(update)); v3api.updateSamples(sessionToken, Arrays.asList(update));
} }
}, "Circular dependency found: /CISD/3VCP8"); }, "Circular dependency found: /CISD/3V-125");
} }
@Test @Test
......
...@@ -617,7 +617,7 @@ public class DataBOTest extends AbstractBOTest ...@@ -617,7 +617,7 @@ public class DataBOTest extends AbstractBOTest
one(propertiesConverter).checkMandatoryProperties( one(propertiesConverter).checkMandatoryProperties(
Collections.<DataSetPropertyPE> emptySet(), dataSet.getDataSetType()); Collections.<DataSetPropertyPE> emptySet(), dataSet.getDataSetType());
one(dataDAO).validateAndSaveUpdatedEntity(dataSet); allowing(dataDAO).validateAndSaveUpdatedEntity(dataSet);
} }
}); });
...@@ -762,7 +762,7 @@ public class DataBOTest extends AbstractBOTest ...@@ -762,7 +762,7 @@ public class DataBOTest extends AbstractBOTest
expectMandatoryPropertiesCheck(this, ds1.getDataSetType()); expectMandatoryPropertiesCheck(this, ds1.getDataSetType());
one(dataDAO).validateAndSaveUpdatedEntity(ds1); allowing(dataDAO).validateAndSaveUpdatedEntity(ds1);
} }
}); });
......
...@@ -411,9 +411,9 @@ public class DynamicPropertyEvaluatorTest extends AbstractBOTest ...@@ -411,9 +411,9 @@ public class DynamicPropertyEvaluatorTest extends AbstractBOTest
sample = createSample("s1", properties); sample = createSample("s1", properties);
evaluator.evaluateProperties(sample, sessionProvider.getSession()); evaluator.evaluateProperties(sample, sessionProvider.getSession());
// cyclic dependency should be found // cyclic dependency should be found
assertEquals(expectedCyclicDependencyErrorMessage(dp1, dp2, dp3, dp1), dp1.getValue()); assertEquals(expectedCyclicDependencyErrorMessage(dp2, dp3, dp1, dp2), dp1.getValue());
assertEquals(expectedCyclicDependencyErrorMessage(dp1, dp2, dp3, dp1), dp2.getValue()); assertEquals(expectedCyclicDependencyErrorMessage(dp2, dp3, dp1, dp2), dp2.getValue());
assertEquals(expectedCyclicDependencyErrorMessage(dp1, dp2, dp3, dp1), dp3.getValue()); assertEquals(expectedCyclicDependencyErrorMessage(dp2, dp3, dp1, dp2), dp3.getValue());
} }
// //
......
...@@ -123,7 +123,7 @@ public class GeneralInformationServiceJsonApiTest extends RemoteApiTestCase ...@@ -123,7 +123,7 @@ public class GeneralInformationServiceJsonApiTest extends RemoteApiTestCase
Map<String, Set<Role>> namedRoleSets = Map<String, Set<Role>> namedRoleSets =
generalInformationService.listNamedRoleSets(sessionToken); generalInformationService.listNamedRoleSets(sessionToken);
assertEquals("[ADMIN(instance), ADMIN(space)]", namedRoleSets.get("SPACE_ADMIN").toString()); assertEquals("[ADMIN(space), ADMIN(instance)]", namedRoleSets.get("SPACE_ADMIN").toString());
} }
@Test @Test
......
...@@ -17,14 +17,15 @@ ...@@ -17,14 +17,15 @@
package ch.systemsx.cisd.openbis.systemtest; package ch.systemsx.cisd.openbis.systemtest;
import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.fail;
import java.util.List;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig;
import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GridRowModels;
import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SessionContext; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SessionContext;
import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet;
import ch.systemsx.cisd.openbis.generic.shared.basic.GridRowModel;
import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Attachment; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Attachment;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AttachmentHolderKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AttachmentHolderKind;
...@@ -105,15 +106,19 @@ public class AttachmentUploadTest extends SystemTestCase ...@@ -105,15 +106,19 @@ public class AttachmentUploadTest extends SystemTestCase
holderID, holderID,
holderKind, holderKind,
new DefaultResultSetConfig<String, TableModelRowWithObject<AttachmentVersions>>()); new DefaultResultSetConfig<String, TableModelRowWithObject<AttachmentVersions>>());
List<Attachment> attachments =
attachmentVersions.getResultSet().getList().get(0).getOriginalObject()
.getObjectOrNull().getVersions();
Attachment attachment = attachments.get(0); GridRowModels<TableModelRowWithObject<AttachmentVersions>> list = attachmentVersions.getResultSet().getList();
assertEquals(FILE_NAME, attachment.getFileName()); for (GridRowModel<TableModelRowWithObject<AttachmentVersions>> tmrl : list) {
assertEquals("my file", attachment.getTitle()); Attachment attachment = tmrl.getOriginalObject().getObjectOrNull().getVersions().get(0);
assertEquals("example file", attachment.getDescription()); if (attachment.getFileName().equals(FILE_NAME)) {
assertEquals(1, attachment.getVersion()); assertEquals("my file", attachment.getTitle());
assertEquals(FILE_CONTENT, new String(attachmentWithContent.getContent())); assertEquals("example file", attachment.getDescription());
assertEquals(1, attachment.getVersion());
assertEquals(FILE_CONTENT, new String(attachmentWithContent.getContent()));
return;
}
}
fail("Attachment with file name "+FILE_NAME+" was not found");
} }
} }
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