use of edu.umass.cs.gnscommon.exceptions.client.ClientException in project GNS by MobilityFirst.
the class AclAllFieldsSuperuser method test_144_ACLCreateSuperUser.
/**
*
*/
@Test
public void test_144_ACLCreateSuperUser() {
String superUserName = "superuser" + RandomString.randomString(12);
try {
try {
clientCommands.lookupGuid(superUserName);
Utils.failWithStackTrace(superUserName + " entity should not exist");
} catch (ClientException e) {
}
superuserEntry = clientCommands.guidCreate(masterGuid, superUserName);
try {
Assert.assertEquals(superuserEntry.getGuid(), clientCommands.lookupGuid(superUserName));
} catch (ClientException e) {
}
} catch (IOException | ClientException e) {
Utils.failWithStackTrace("Exception when we were not expecting it in ACLALLFields: ", e);
}
}
use of edu.umass.cs.gnscommon.exceptions.client.ClientException in project GNS by MobilityFirst.
the class CreateGuidBatchTestWithPublicKeys method test_03_CheckBatch.
/**
*
*/
@Test
public void test_03_CheckBatch() {
try {
JSONObject accountRecord = clientCommands.lookupAccountRecord(batchAccountGuid.getGuid());
Assert.assertEquals(numberTocreate, accountRecord.getInt("guidCnt"));
} catch (JSONException | ClientException | IOException e) {
Utils.failWithStackTrace("Exception while fetching account record: " + e);
}
}
use of edu.umass.cs.gnscommon.exceptions.client.ClientException in project GNS by MobilityFirst.
the class CreateGuidTest method test_01_CreateEntity.
/**
*
*/
@Test
public void test_01_CreateEntity() {
String alias = "testGUID" + RandomString.randomString(12);
GuidEntry guidEntry = null;
try {
guidEntry = clientCommands.guidCreate(masterGuid, alias);
} catch (ClientException | IOException e) {
Utils.failWithStackTrace("Exception while creating guid: " + e);
}
Assert.assertNotNull(guidEntry);
Assert.assertEquals(alias, guidEntry.getEntityName());
try {
clientCommands.guidRemove(masterGuid, guidEntry.getGuid());
} catch (ClientException | IOException e) {
Utils.failWithStackTrace("Exception while creating guid: " + e);
}
}
use of edu.umass.cs.gnscommon.exceptions.client.ClientException in project GNS by MobilityFirst.
the class CreateIndexTest method test_03_SelectPass.
/**
*
*/
@Test
public void test_03_SelectPass() {
try {
JSONArray result = clientCommands.selectQuery(masterGuid, buildQuery(testField, AREA_EXTENT));
for (int i = 0; i < result.length(); i++) {
System.out.println(result.get(i).toString());
}
Assert.assertThat(result.length(), greaterThanOrEqualTo(1));
} catch (JSONException | ClientException | IOException e) {
Utils.failWithStackTrace("Exception executing second selectNear: " + e);
}
}
use of edu.umass.cs.gnscommon.exceptions.client.ClientException in project GNS by MobilityFirst.
the class AclTest method test_106_ACLNotReadOtherGuidFieldTest.
/**
*
*/
@Test
public void test_106_ACLNotReadOtherGuidFieldTest() {
try {
try {
String result = clientCommands.fieldReadArrayFirstElement(westyEntry.getGuid(), "environment", samEntry);
Utils.failWithStackTrace("Result of read of westy's environment by sam is " + result + " which is wrong because it should have been rejected.");
} catch (ClientException e) {
}
} catch (IOException e) {
Utils.failWithStackTrace("Exception while reading fields in ACLNotReadOtherGuidFieldTest: " + e);
}
}
Aggregations