1515 */
1616package org .labkey .remoteapi .test ;
1717
18- import org .json .JSONObject ;
1918import org .labkey .remoteapi .CommandException ;
2019import org .labkey .remoteapi .Connection ;
2120import org .labkey .remoteapi .assay .AssayListCommand ;
@@ -59,7 +58,7 @@ public static void main(String[] args) throws Exception
5958
6059 try
6160 {
62- // Import /remoteapi/sas /People.xls as list "People" into project "Api Test"
61+ // Import /remoteapi/labkey-api-java /People.xls as list "People" into project "Api Test"
6362 selectTest (cn , "Api Test" );
6463 crudTest (cn , "Api Test" );
6564 execSqlTest (cn , "Api Test" );
@@ -83,7 +82,7 @@ public static void main(String[] args) throws Exception
8382 }
8483 }
8584
86- // Assumes that /remoteapi/sas /People.xls has been imported as a list into folder
85+ // Assumes that /remoteapi/labkey-api-java /People.xls has been imported as a list into folder
8786 public static void selectTest (Connection cn , String folder ) throws Exception
8887 {
8988 SelectRowsCommand cmd = new SelectRowsCommand ("lists" , "People" );
@@ -103,7 +102,7 @@ public static void selectTest(Connection cn, String folder) throws Exception
103102 }
104103 }
105104
106- // Assumes that /remoteapi/sas /People.xls has been imported as a list into folder
105+ // Assumes that /remoteapi/labkey-api-java /People.xls has been imported as a list into folder
107106 public static void crudTest (Connection cn , String folder ) throws Exception
108107 {
109108 int rowCount = 0 ;
@@ -148,16 +147,16 @@ public static void crudTest(Connection cn, String folder) throws Exception
148147 assert srresp .getRowCount ().intValue () == rowCount ;
149148 }
150149
151- // Assumes that /remoteapi/sas /People.xls has been imported as a list into folder
150+ // Assumes that /remoteapi/labkey-api-java /People.xls has been imported as a list into folder
152151 public static void truncateTableSuccessTest (Connection cn , String folder ) throws Exception
153152 {
154153 TruncateTableCommand trunc = new TruncateTableCommand ("lists" , "People" );
155154 TruncateTableResponse resp = trunc .execute (cn , folder );
156155
157- assert resp .getDeletedRowCount (). intValue () == 9 ;
156+ assert resp .getDeletedRowCount () == 9 ;
158157 }
159158
160- // Assumes that /remoteapi/sas /People.xls has been imported as a list into folder
159+ // Assumes that /remoteapi/labkey-api-java /People.xls has been imported as a list into folder
161160 public static void execSqlTest (Connection cn , String folder ) throws Exception
162161 {
163162 ExecuteSqlCommand cmd = new ExecuteSqlCommand ("lists" );
@@ -166,7 +165,7 @@ public static void execSqlTest(Connection cn, String folder) throws Exception
166165 System .out .println (resp .getRows ());
167166 }
168167
169- // Assumes that /remoteapi/sas /People.xls has been imported as a list into folder
168+ // Assumes that /remoteapi/labkey-api-java /People.xls has been imported as a list into folder
170169 private static void schemasTest (Connection cn , String folder ) throws Exception
171170 {
172171 GetSchemasCommand cmd = new GetSchemasCommand ();
@@ -188,7 +187,7 @@ private static void schemasTest(Connection cn, String folder) throws Exception
188187 }
189188 }
190189
191- // Assumes that /remoteapi/sas /People.xls has been imported as a list into folder
190+ // Assumes that /remoteapi/labkey-api-java /People.xls has been imported as a list into folder
192191 private static void extendedFormatTest (Connection cn , String folder ) throws Exception
193192 {
194193 SelectRowsCommand cmd = new SelectRowsCommand ("lists" , "People" );
@@ -199,7 +198,7 @@ private static void extendedFormatTest(Connection cn, String folder) throws Exce
199198 {
200199 for (Map .Entry <String , Object > entry : row .entrySet ())
201200 {
202- Object value = ((JSONObject )entry .getValue ()).get ("value" );
201+ Object value = ((Map < String , Object > )entry .getValue ()).get ("value" );
203202 System .out .println (entry .getKey () + " = " + value + " (type: " + (null == value ? "null" : value .getClass ().getName ()) + ")" );
204203 }
205204 }
@@ -306,7 +305,8 @@ public static void assayTest(Connection cn, String folder) throws Exception
306305 public static void truncateAssayFailsTest (Connection cn , String folder ) throws Exception
307306 {
308307 TruncateTableCommand trunc = new TruncateTableCommand ("assay.NAb.TestAssayNab" , "WellData" );
309- try {
308+ try
309+ {
310310 TruncateTableResponse resp = trunc .execute (cn , folder );
311311 throw new RuntimeException ("Truncate table command should not succeed for tables other than lists," +
312312 "datasets, sample sets, data classes, and issues" );
0 commit comments