package com.tempoiq;

import java.io.IOException;
import org.junit.*;
import static org.junit.Assert.*;

public class DataPointReadTest {

  @Test
  public void smokeTest() throws IOException {
    // Selection sel = new Selection().
    //   addSelector(Selector.Type.DEVICE, Selector.or(
    // 		    Selector.key("building-1234"), Selector.key("building-4321"))).
    //   addSelector(Selector.Type.SENSOR, Selector.key("temp-1"));
  }
}

@@ -54,151 +54,1295 @@
 ort 
-org.junit.*;%0Aimport static org.junit.Assert.*;%0A%0Apublic class DataPointReadTest %7B%0A%0A  @Test%0A  public void smokeTest() throws IOException %7B%0A    //
+java.util.HashMap;%0Aimport java.util.Map;%0A%0Aimport org.apache.http.*;%0Aimport org.apache.http.client.HttpClient;%0Aimport org.joda.time.DateTime;%0Aimport org.joda.time.DateTimeZone;%0Aimport org.joda.time.Interval;%0Aimport org.junit.*;%0Aimport static org.junit.Assert.*;%0A%0Apublic class DataPointReadTest %7B%0A  private static final DateTimeZone timezone = DateTimeZone.UTC;%0A  private static final Device device = new Device(%22device1%22);%0A  private static final String json1 = %22%7B%22 +%0A    %22%5C%22data%5C%22:%5B%22 +%0A       %22%7B%5C%22t%5C%22:%5C%222012-01-01T01:00:00.000Z%5C%22,%5C%22data%5C%22:%7B%22 +%0A         %22%5C%22device1%5C%22:%7B%22 +%0A           %22%5C%22sensor1%5C%22:1.23,%22 +%0A           %22%5C%22sensor2%5C%22:1.677%7D%7D%7D%5D%7D%22;%0A%0A  @Test%0A  public void smokeTest() throws IOException %7B%0A    HttpResponse response = Util.getResponse(200, json1);%0A    Client client = Util.getClient(response);%0A    DateTime start = new DateTime(2012, 1, 1, 0, 0, 0, 0, timezone);%0A    DateTime stop = new DateTime(2012, 1, 2, 0, 0, 0, 0, timezone);%0A%0A    Map%3CString, Number%3E points = new HashMap%3CString, Number%3E();%0A    points.put(%22sensor1%22, 1.23);%0A    points.put(%22sensor2%22, 1.677);%0A    MultiDataPoint mp = new MultiDataPoint(new DateTime(2012, 1, 1, 1, 0, 0, 0, timezone), points);%0A    Result%3CVoid%3E result = client.writeDataPoints(device, mp);%0A    assertEquals(State.SUCCESS, result.getState());%0A%0A   
  Sel
@@ -1371,29 +1371,26 @@
 tion().%0A    
-//
   
- 
 addSelector(
@@ -1409,16 +1409,17 @@
 e.DEVICE
+S
 , Select
@@ -1425,156 +1425,299 @@
 tor.
-or(%0A    // %09%09    Selector.key(%22building-1234%22), Selector.key(%22building-432
+key(device.getKey()));%0A    Cursor%3CRow%3E cursor = client.read(sel, start, stop);%0A    assert(cursor.iterator().hasNext());%0A    for (Row row : cursor) %7B%0A      assertEquals(1.23, row.getValue(device.getKey(), %22sensor
 1%22))
-).
+;
 %0A   
- //
    a
-ddSelector(Selector.Type.SENSOR, Selector.key(%22temp-1%22));
+ssertEquals(1.677, row.getValue(device.getKey(), %22sensor2%22));%0A    %7D
 %0A  %7D

Add simple client test with stubbed result