final static int PORT = 8080;
final static boolean SECURE = false;
@Test
public void basicTest() throws SerializationException {
final BasicAuthentication authentication = new BasicAuthentication("foo", "bar");
TaskGroup queryGroup = new TaskGroup();
// GET
final GetQuery getQuery = new GetQuery(HOSTNAME, PORT, PATH, SECURE);
getQuery.getParameters().put("a", "b");
getQuery.setSerializer(new BinarySerializer());
getQuery.getRequestHeaders().add("bar", "hello");
getQuery.getRequestHeaders().add("bar", "world");
authentication.authenticate(getQuery);
queryGroup.add(getQuery);
// POST
final PostQuery postQuery = new PostQuery(HOSTNAME, PORT, PATH, SECURE);
authentication.authenticate(postQuery);
postQuery.setValue(JSONSerializer.parseList("[1, 2, 3]"));
queryGroup.add(postQuery);
// PUT
final PutQuery putQuery = new PutQuery(HOSTNAME, PORT, PATH, SECURE);
authentication.authenticate(putQuery);
putQuery.setValue(JSONSerializer.parseMap("{a:100, b:200, c:300}"));
queryGroup.add(putQuery);
// POST
final DeleteQuery deleteQuery = new DeleteQuery(HOSTNAME, PORT, PATH, SECURE);
authentication.authenticate(deleteQuery);
queryGroup.add(deleteQuery);
queryGroup.execute(new TaskListener<Void>() {
@SuppressWarnings("unchecked")
@Override