Skip to content

Commit 2c5b704

Browse files
committed
Additional tests
1 parent b087083 commit 2c5b704

3 files changed

Lines changed: 21 additions & 6 deletions

File tree

src/org/labkey/remoteapi/plate/PlateParams.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22

33
import org.json.JSONObject;
44

5+
import java.util.List;
56
import java.util.Map;
67

78
public class PlateParams
89
{
910
private boolean _archived;
1011
private String _assayType;
12+
private String _barcode;
1113
private int _columns;
1214
private String _description;
1315
private String _name;
@@ -50,13 +52,19 @@ public PlateParams(JSONObject json)
5052

5153
if (json.has("archived"))
5254
_archived = json.getBoolean("archived");
55+
56+
if (json.has("barcode"))
57+
_barcode = json.getString("barcode");
5358
}
5459

60+
public static final List<String> QUERY_COLUMNS = List.of("Archived", "AssayType", "Barcode", "Description", "Name", "PlateId", "PlateSet", "PlateType", "PlateType/Columns", "PlateType/Rows", "RowId", "Template");
61+
5562
public static PlateParams fromQueryRow(Map<String, Object> row)
5663
{
5764
var params = new PlateParams();
5865
params._archived = (Boolean) row.get("Archived");
5966
params._assayType = (String) row.get("AssayType");
67+
params._barcode = (String) row.get("Barcode");
6068
params._columns = (Integer) row.get("PlateType/Columns");
6169
params._description = (String) row.get("Description");
6270
params._name = (String) row.get("Name");
@@ -70,6 +78,11 @@ public static PlateParams fromQueryRow(Map<String, Object> row)
7078
return params;
7179
}
7280

81+
public String getBarcode()
82+
{
83+
return _barcode;
84+
}
85+
7386
public String getName()
7487
{
7588
return _name;

src/org/labkey/remoteapi/plate/PlateSetParams.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import org.json.JSONObject;
44

5-
import java.util.Date;
5+
import java.util.List;
66
import java.util.Map;
77

88
public class PlateSetParams
@@ -65,6 +65,8 @@ public PlateSetParams(JSONObject json)
6565
_plateSetType = CreatePlateSetParams.PlateSetType.fromName(json.getString("type"));
6666
}
6767

68+
public static final List<String> QUERY_COLUMNS = List.of("Archived", "Created", "CreatedBy", "Description", "Folder/EntityId", "Folder/Name", "Folder/Path", "Modified", "ModifiedBy", "Name", "PlateCount", "PlateSetId", "PrimaryPlateSetId", "RootPlateSetId", "RowId", "Template", "Type");
69+
6870
public static PlateSetParams fromQueryRow(Map<String, Object> row)
6971
{
7072
var params = new PlateSetParams();

src/org/labkey/test/LabKeySiteWrapper.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,26 +1530,26 @@ protected SelectRowsResponse executeSelectRowCommand(String schemaName, String q
15301530
protected SelectRowsResponse executeSelectRowCommand(String schemaName, String queryName, ContainerFilter containerFilter,
15311531
String path, @Nullable List<Filter> filters, @Nullable List<String> requestedColumns)
15321532
{
1533-
Connection cn = createDefaultConnection();
15341533
SelectRowsCommand selectCmd = new SelectRowsCommand(schemaName, queryName);
15351534
selectCmd.setMaxRows(-1);
15361535
selectCmd.setContainerFilter(containerFilter);
15371536
selectCmd.setColumns(requestedColumns);
15381537
if (filters != null)
15391538
selectCmd.setFilters(filters);
15401539

1541-
SelectRowsResponse selectResp;
1540+
return executeSelectRowCommand(path, selectCmd);
1541+
}
15421542

1543+
protected SelectRowsResponse executeSelectRowCommand(String containerPath, SelectRowsCommand command)
1544+
{
15431545
try
15441546
{
1545-
selectResp = selectCmd.execute(cn, path);
1547+
return command.execute(createDefaultConnection(), containerPath);
15461548
}
15471549
catch (CommandException | IOException e)
15481550
{
15491551
throw new RuntimeException(e);
15501552
}
1551-
1552-
return selectResp;
15531553
}
15541554

15551555
// Returns the text contents of every "Status" cell in the pipeline StatusFiles grid

0 commit comments

Comments
 (0)