diff --git a/src/test/java/fr/igred/omero/repository/PlateAcquisitionTest.java b/src/test/java/fr/igred/omero/repository/PlateAcquisitionTest.java index 4e7e6fec..7c1ad123 100644 --- a/src/test/java/fr/igred/omero/repository/PlateAcquisitionTest.java +++ b/src/test/java/fr/igred/omero/repository/PlateAcquisitionTest.java @@ -99,6 +99,27 @@ void testAddTagToPlateAcquisition() throws Exception { } + @Test + void testAddAndRemoveTagFromPlateAcquisition() throws Exception { + PlateWrapper plate = client.getPlate(PLATE1.id); + + PlateAcquisitionWrapper acq = plate.getPlateAcquisitions().get(0); + + String name = "Plate acq. tag"; + String desc = "tag attached to a plate acq."; + + TagAnnotationWrapper tag = new TagAnnotationWrapper(client, name, desc); + acq.link(client, tag); + List tags = acq.getTags(client); + acq.unlink(client, tag); + List removedTags = acq.getTags(client); + client.delete(tag); + + assertEquals(1, tags.size()); + assertEquals(0, removedTags.size()); + } + + @Test void testSetName() throws Exception { PlateWrapper plate = client.getPlate(PLATE1.id); diff --git a/src/test/java/fr/igred/omero/repository/PlateTest.java b/src/test/java/fr/igred/omero/repository/PlateTest.java index 4effb7b2..6be47b4b 100644 --- a/src/test/java/fr/igred/omero/repository/PlateTest.java +++ b/src/test/java/fr/igred/omero/repository/PlateTest.java @@ -102,6 +102,25 @@ void testAddTagToPlate() throws Exception { } + @Test + void testAddAndRemoveTagFromPlate() throws Exception { + PlateWrapper plate = client.getPlate(PLATE2.id); + + String name = "Plate tag"; + String desc = "tag attached to a plate"; + + TagAnnotationWrapper tag = new TagAnnotationWrapper(client, name, desc); + plate.link(client, tag); + List tags = plate.getTags(client); + plate.unlink(client, tag); + List removedTags = plate.getTags(client); + client.delete(tag); + + assertEquals(1, tags.size()); + assertEquals(0, removedTags.size()); + } + + @Test void testSetName() throws Exception { PlateWrapper plate = client.getPlate(PLATE1.id); diff --git a/src/test/java/fr/igred/omero/repository/ScreenTest.java b/src/test/java/fr/igred/omero/repository/ScreenTest.java index ff8ff609..d1c3fb8f 100644 --- a/src/test/java/fr/igred/omero/repository/ScreenTest.java +++ b/src/test/java/fr/igred/omero/repository/ScreenTest.java @@ -18,6 +18,7 @@ package fr.igred.omero.repository; +import fr.igred.omero.GatewayWrapper; import fr.igred.omero.UserTest; import fr.igred.omero.annotations.TagAnnotationWrapper; import org.junit.jupiter.api.Test; @@ -90,6 +91,25 @@ void testAddTagToScreen() throws Exception { } + @Test + void testAddAndRemoveTagFromScreen() throws Exception { + ScreenWrapper screen = client.getScreen(SCREEN2.id); + + String name = "Screen tag"; + String desc = "tag attached to a screen"; + + TagAnnotationWrapper tag = new TagAnnotationWrapper(client, name, desc); + screen.link(client, tag); + List tags = screen.getTags(client); + screen.unlink(client, tag); + List removedTags = screen.getTags(client); + client.delete(tag); + + assertEquals(1, tags.size()); + assertEquals(0, removedTags.size()); + } + + @Test void testSetName() throws Exception { ScreenWrapper screen = client.getScreen(SCREEN1.id); @@ -248,7 +268,7 @@ void testImportImage() throws Exception { client.delete(wells); client.delete(plates); - screen.refresh(client); + screen.refresh((GatewayWrapper) client); List endPlates = screen.getPlates(); client.delete(screen); diff --git a/src/test/java/fr/igred/omero/repository/WellTest.java b/src/test/java/fr/igred/omero/repository/WellTest.java index 84d96762..5c5f8592 100644 --- a/src/test/java/fr/igred/omero/repository/WellTest.java +++ b/src/test/java/fr/igred/omero/repository/WellTest.java @@ -48,6 +48,25 @@ void testAddTagToWell() throws Exception { } + @Test + void testAddAndRemoveTagFromWell() throws Exception { + WellWrapper well = client.getWell(2L); + + String name = "Well tag"; + String desc = "tag attached to a well"; + + TagAnnotationWrapper tag = new TagAnnotationWrapper(client, name, desc); + well.link(client, tag); + List tags = well.getTags(client); + well.unlink(client, tag); + List removedTags = well.getTags(client); + client.delete(tag); + + assertEquals(1, tags.size()); + assertEquals(0, removedTags.size()); + } + + @Test void testGetWellSamples() throws Exception { WellWrapper well = client.getWell(1L);