diff --git a/.github/workflows/build_jar.yml b/.github/workflows/build_jar.yml index ca7f0f24..e2eae0f8 100644 --- a/.github/workflows/build_jar.yml +++ b/.github/workflows/build_jar.yml @@ -17,6 +17,8 @@ distribution: 'adopt-hotspot' - name: Grant execute permission for gradlew run: chmod +x gradlew + - name: Grant execute permission for OMERO server setup script + run: chmod +x src/test/resources/qupath/ext/omero/setupOmeroServer.sh - name: Build with Gradle run: ./gradlew build -P toolchain=11 - uses: actions/upload-artifact@v2 diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 0566ee69..3a6a785e 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -17,5 +17,7 @@ distribution: 'adopt-hotspot' - name: Grant execute permission for gradlew run: chmod +x gradlew + - name: Grant execute permission for OMERO server setup script + run: chmod +x src/test/resources/qupath/ext/omero/setupOmeroServer.sh - name: Build with Gradle run: ./gradlew build -P toolchain=11 diff --git a/src/test/java/qupath/ext/omero/OmeroServer.java b/src/test/java/qupath/ext/omero/OmeroServer.java index ea4bd756..cda5e1e2 100644 --- a/src/test/java/qupath/ext/omero/OmeroServer.java +++ b/src/test/java/qupath/ext/omero/OmeroServer.java @@ -112,8 +112,8 @@ protected void waitUntilReady() { "/analysis.csv" ) .withFileSystemBind( - Objects.requireNonNull(OmeroServer.class.getResource("Dot_Blot.tif")).getPath(), - "/Dot_Blot.tif" + Objects.requireNonNull(OmeroServer.class.getResource("Cardio.tif")).getPath(), + "/Cardio.tif" ) .withFileSystemBind( Objects.requireNonNull(OmeroServer.class.getResource("mitosis.tif")).getPath(), @@ -309,33 +309,33 @@ protected static URI getImageURI() { return URI.create(getServerURL() + "/webclient/?show=image-" + getImage().getId()); } - protected static String getImageAttributeValue(int informationIndex) { + protected static Image getOrphanedImage() { + return new Image(2); + } + + protected static String getOrphanedImageAttributeValue(int informationIndex) { return switch (informationIndex) { - case 0 -> "mitosis.tif"; - case 1 -> String.valueOf(getImage().getId()); + case 0 -> "Cardio.tif"; + case 1 -> String.valueOf(getOrphanedImage().getId()); case 2 -> getCurrentOwner().getFullName(); case 3 -> getCurrentGroup().getName(); case 4, 13 -> "-"; - case 5 -> "171 px"; - case 6 -> "196 px"; - case 7 -> "32.6 MB"; - case 8 -> "5"; - case 9 -> "2"; - case 10 -> "51"; - case 11, 12 -> "0.08850000022125 µm"; - case 14 -> "uint16"; + case 5 -> "1000 px"; + case 6 -> "1000 px"; + case 7 -> "2.9 MB"; + case 8 -> "1"; + case 9 -> "3"; + case 10 -> "1"; + case 11, 12 -> "-"; + case 14 -> "uint8"; default -> ""; }; } - protected static int getImageNumberOfAttributes() { + protected static int getOrphanedImageNumberOfAttributes() { return 15; } - protected static Image getOrphanedImage() { - return new Image(2); - } - protected static List getGroups() { return List.of( new Group(0, "system"), diff --git a/src/test/java/qupath/ext/omero/core/entities/repositoryentities/serverentities/image/TestImage.java b/src/test/java/qupath/ext/omero/core/entities/repositoryentities/serverentities/image/TestImage.java index 036d0aad..91c5c839 100644 --- a/src/test/java/qupath/ext/omero/core/entities/repositoryentities/serverentities/image/TestImage.java +++ b/src/test/java/qupath/ext/omero/core/entities/repositoryentities/serverentities/image/TestImage.java @@ -8,9 +8,8 @@ import qupath.ext.omero.OmeroServer; import qupath.ext.omero.core.WebClient; import qupath.ext.omero.core.WebClients; +import qupath.ext.omero.core.entities.repositoryentities.OrphanedFolder; import qupath.ext.omero.core.entities.repositoryentities.RepositoryEntity; -import qupath.ext.omero.core.entities.repositoryentities.serverentities.Dataset; -import qupath.ext.omero.core.entities.repositoryentities.serverentities.Project; import java.util.List; import java.util.concurrent.ExecutionException; @@ -24,34 +23,19 @@ public class TestImage extends OmeroServer { static void createClient() throws ExecutionException, InterruptedException { client = OmeroServer.createValidClient(); - while (client.getServer().isPopulatingChildren()) { - TimeUnit.MILLISECONDS.sleep(50); - } - Project project = client.getServer().getChildren().stream() - .filter(child -> child instanceof Project) - .map(p -> (Project) p) - .findAny() - .orElse(null); - assert project != null; - - List projectChildren = project.getChildren(); - while (project.isPopulatingChildren()) { - TimeUnit.MILLISECONDS.sleep(50); - } - - Dataset dataset = projectChildren.stream() - .filter(child -> child instanceof Dataset) - .map(d -> (Dataset) d) + OrphanedFolder orphanedFolder = client.getServer().getChildren().stream() + .filter(child -> child instanceof OrphanedFolder) + .map(p -> (OrphanedFolder) p) .findAny() .orElse(null); - assert dataset != null; + assert orphanedFolder != null; - List datasetChildren = dataset.getChildren(); - while (dataset.isPopulatingChildren()) { + List orphanedFolderChildren = orphanedFolder.getChildren(); + while (orphanedFolder.isPopulatingChildren()) { TimeUnit.MILLISECONDS.sleep(50); } - image = datasetChildren.stream() + image = orphanedFolderChildren.stream() .filter(child -> child instanceof Image) .map(d -> (Image) d) .findAny() @@ -86,10 +70,10 @@ void Check_Children() throws InterruptedException { @Test void Check_Attributes() { - int numberOfValues = OmeroServer.getImageNumberOfAttributes(); + int numberOfValues = OmeroServer.getOrphanedImageNumberOfAttributes(); String[] expectedAttributeValues = new String[numberOfValues]; for (int i=0; i