Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add updateContainerUnqueue method + upgrade h2 lib #109

Merged
merged 3 commits into from
Feb 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion downloadschemascript.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

version=1.25.2
version=1.29.0
fname=ispyb-database-${version}.tar.gz

cd target/test-classes
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.196</version>
<version>2.1.210</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/uk/ac/diamond/ispyb/api/IspybPlateApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public interface IspybPlateApi extends Closeable {

void finishContainer(String barcode) throws SQLException;

void updateContainerUnqueue(String barcode) throws SQLException;

List<ContainerLSQueueEntry> retrieveContainerLSQueue(String beamline) throws SQLException;

List<ContainerForBeamlineAndStatusEntry> retrieveContainersOnBeamlineWithStatus(String beamline, ContainerStatus status) throws SQLException;
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/uk/ac/diamond/ispyb/dao/IspybPlateDAO.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<ContainerLSQueueEntry> retrieveContainerLSQueue(String beamline) throws SQLException {
return templateWrapper.callIspybForListBeans("retrieve_container_ls_queue", ContainerLSQueueEntry.class, map(BEAMLINE, beamline));
Expand Down
10 changes: 10 additions & 0 deletions src/test/java/uk/ac/diamond/ispyb/test/PlateIntegrationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,16 @@ public void testRetrieveContainerQueueWithMostRecentCompletedTimestamp() throws
assertThat(timestamp.isPresent(), is(true));
}

@Test
public void testUpdateContainerUnqueue() throws SQLException, IOException, InterruptedException {
Optional<Date> 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<Sleeve> sleeves = helper.execute(api -> {
Expand Down