Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
The client-side library for Java developers is a separate JAR from the LabKey Server code base. It can be used by any Java program, including another Java web application.
/*
* Copyright (c) 2008-2016 LabKey Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.labkey.remoteapi.test;
import org.json.simple.JSONObject;
import org.labkey.remoteapi.CommandException;
import org.labkey.remoteapi.Connection;
import org.labkey.remoteapi.assay.AssayListCommand;
import org.labkey.remoteapi.assay.AssayListResponse;
import org.labkey.remoteapi.assay.nab.NAbRunsCommand;
import org.labkey.remoteapi.assay.nab.NAbRunsResponse;
import org.labkey.remoteapi.assay.nab.model.NAbNeutralizationResult;
import org.labkey.remoteapi.assay.nab.model.NAbRun;
import org.labkey.remoteapi.assay.nab.model.NAbSample;
import org.labkey.remoteapi.query.*;
import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/*
* User: Dave
* Date: Jul 10, 2008
* Time: 10:20:49 AM
*/
public class Test
{
public static void main(String[] args) throws Exception
{
String baseUrl = "http://localhost:8080/labkey";
Connection cn = args.length < 2 ? new Connection(baseUrl) : new Connection(baseUrl, args[0], args[1]);
// Connection cn = new Connection(baseUrl, new ApiKeyCredentialsProvider("session:d7c3a4aeb283e3e54c4126a707908420"));
// Connection cn = new Connection(baseUrl, new NetRcCredentialsProvider(baseUrl));
try
{
// Import /remoteapi/sas/People.xls as list "People" into project "Api Test"
selectTest(cn, "Api Test");
crudTest(cn, "Api Test");
execSqlTest(cn, "Api Test");
schemasTest(cn, "Api Test");
extendedFormatTest(cn, "Api Test");
// Run ShortStudyTest with -Dclean=false
datasetTest(cn, "StudyVerifyProject/My Study");
// Run NabAssayTest with -Dclean=false and rename subfolder "Rename############" to "nabassay"
nabTest(cn, "/Nab Test Verify Project/nabassay");
assayTest(cn, "/Nab Test Verify Project/nabassay");
System.out.println("*** All tests completed successfully ***");
}
catch(CommandException e)
{
e.printStackTrace();
}
}
// Assumes that /remoteapi/sas/People.xls has been imported as a list into folder
public static void selectTest(Connection cn, String folder) throws Exception
{
SelectRowsCommand cmd = new SelectRowsCommand("lists", "People");
cmd.addSort(new Sort("Last"));
cmd.getColumns().add("First");
cmd.getColumns().add("Last");
SelectRowsResponse response = cmd.execute(cn, folder);
System.out.println("Number of rows: " + response.getRowCount());
List