From 01c783faff86f4ebdb1a3e5ba74810817c48cbf0 Mon Sep 17 00:00:00 2001 From: Karl Levik Date: Tue, 8 Feb 2022 17:47:09 +0000 Subject: [PATCH 1/3] Upgrade h2 to 2.1.210 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1fab494..1b965db 100644 --- a/pom.xml +++ b/pom.xml @@ -182,7 +182,7 @@ com.h2database h2 - 1.4.196 + 2.1.210 test From d003516fa0b8265e8ade18db0b3ba12bc642c935 Mon Sep 17 00:00:00 2001 From: Karl Levik Date: Mon, 14 Feb 2022 17:01:14 +0000 Subject: [PATCH 2/3] Use latest database schema version --- downloadschemascript.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/downloadschemascript.sh b/downloadschemascript.sh index 23bcac7..ac9ac67 100755 --- a/downloadschemascript.sh +++ b/downloadschemascript.sh @@ -1,6 +1,6 @@ #!/bin/bash -version=1.25.2 +version=1.29.0 fname=ispyb-database-${version}.tar.gz cd target/test-classes From d502fa01e09d03189c39ef033636cf0453d99e81 Mon Sep 17 00:00:00 2001 From: Karl Levik Date: Mon, 14 Feb 2022 17:02:56 +0000 Subject: [PATCH 3/3] Add updateContainerUnqueue method to IspybPlateApi, IspybPlateDAO, and add test --- .../java/uk/ac/diamond/ispyb/api/IspybPlateApi.java | 2 ++ .../java/uk/ac/diamond/ispyb/dao/IspybPlateDAO.java | 5 +++++ .../uk/ac/diamond/ispyb/test/PlateIntegrationTest.java | 10 ++++++++++ 3 files changed, 17 insertions(+) diff --git a/src/main/java/uk/ac/diamond/ispyb/api/IspybPlateApi.java b/src/main/java/uk/ac/diamond/ispyb/api/IspybPlateApi.java index e61806a..58f565b 100644 --- a/src/main/java/uk/ac/diamond/ispyb/api/IspybPlateApi.java +++ b/src/main/java/uk/ac/diamond/ispyb/api/IspybPlateApi.java @@ -34,6 +34,8 @@ public interface IspybPlateApi extends Closeable { void finishContainer(String barcode) throws SQLException; + void updateContainerUnqueue(String barcode) throws SQLException; + List retrieveContainerLSQueue(String beamline) throws SQLException; List retrieveContainersOnBeamlineWithStatus(String beamline, ContainerStatus status) throws SQLException; diff --git a/src/main/java/uk/ac/diamond/ispyb/dao/IspybPlateDAO.java b/src/main/java/uk/ac/diamond/ispyb/dao/IspybPlateDAO.java index 5c6d97d..9d04532 100644 --- a/src/main/java/uk/ac/diamond/ispyb/dao/IspybPlateDAO.java +++ b/src/main/java/uk/ac/diamond/ispyb/dao/IspybPlateDAO.java @@ -60,6 +60,11 @@ public void finishContainer(String barcode) throws SQLException { templateWrapper.updateIspyb("finish_container", map(BARCODE, barcode)); } + @Override + public void updateContainerUnqueue(String barcode) throws SQLException { + templateWrapper.updateIspyb("update_container_unqueue", map(BARCODE, barcode)); + } + @Override public List retrieveContainerLSQueue(String beamline) throws SQLException { return templateWrapper.callIspybForListBeans("retrieve_container_ls_queue", ContainerLSQueueEntry.class, map(BEAMLINE, beamline)); diff --git a/src/test/java/uk/ac/diamond/ispyb/test/PlateIntegrationTest.java b/src/test/java/uk/ac/diamond/ispyb/test/PlateIntegrationTest.java index 0c059ea..8c39adb 100644 --- a/src/test/java/uk/ac/diamond/ispyb/test/PlateIntegrationTest.java +++ b/src/test/java/uk/ac/diamond/ispyb/test/PlateIntegrationTest.java @@ -268,6 +268,16 @@ public void testRetrieveContainerQueueWithMostRecentCompletedTimestamp() throws assertThat(timestamp.isPresent(), is(true)); } + @Test + public void testUpdateContainerUnqueue() throws SQLException, IOException, InterruptedException { + Optional date= helper.execute(api -> { + api.updateContainerUnqueue("test_plate3"); + return api.retrieveContainerQueueTimestamp("test_plate3"); + }); + + assertThat(date.isPresent(), is(false)); + } + @Test public void testUpsertRetrieveSleeves() throws IOException, SQLException{ List sleeves = helper.execute(api -> {