@@ -47,21 +47,11 @@ public TestData(int testInt, String testStr, RawJson testRaw) {
4747 }
4848 }
4949
50- public static final Service Local = new Service () {
51- public URL serviceUrl () {
52- try {
53- return new URL ("http" , "beta.precog.com" , 80 , "/v1/" );
54- } catch (MalformedURLException ex ) {
55- throw new RuntimeException ("Invalid client URL" , ex );
56- }
57- }
58- };
59-
6050 @ BeforeClass
6151 public static void beforeAll () throws Exception {
6252 testId = "" + Double .valueOf (java .lang .Math .random () * 10000 ).intValue ();
6353
64- Client testClient = new Client (Local , null );
54+ Client testClient = new Client (Service . BetaPrecogHttps , null );
6555 String result = testClient .createAccount ("java-test@precog.com" , "password" );
6656 AccountInfo res = GsonFromJson .of (new TypeToken <AccountInfo >() {
6757 }).deserialize (result );
@@ -77,7 +67,7 @@ public static void beforeAll() throws Exception {
7767 @ Test
7868 public void testStore () throws IOException {
7969 ToJson <Object > toJson = new GsonToJson ();
80- Client testClient = new Client (Local , testApiKey );
70+ Client testClient = new Client (Service . BetaPrecogHttps , testApiKey );
8171
8272 RawJson testJson = new RawJson ("{\" test\" :[{\" v\" : 1}, {\" v\" : 2}]}" );
8373 TestData testData = new TestData (42 , "Hello\" World" , testJson );
@@ -89,23 +79,23 @@ public void testStore() throws IOException {
8979 @ Test
9080 public void testStoreStrToJson () throws IOException {
9181 ToJson <String > toJson = new RawStringToJson ();
92- Client testClient = new Client (Local , testApiKey );
82+ Client testClient = new Client (Service . BetaPrecogHttps , testApiKey );
9383
9484 Record <String > testRecord = new Record <String >("{\" test\" :[{\" v\" : 1}, {\" v\" : 2}]}" );
9585 testClient .store (testPath , testRecord , toJson );
9686 }
9787
9888 @ Test
9989 public void testStoreRawString () throws IOException {
100- Client testClient = new Client (Local , testApiKey );
90+ Client testClient = new Client (Service . BetaPrecogHttps , testApiKey );
10191
10292 String rawJson = "{\" test\" :[{\" v\" : 1}, {\" v\" : 2}]}" ;
10393 testClient .store (testPath , rawJson );
10494 }
10595
10696 @ Test
10797 public void testStoreRawUTF8 () throws IOException {
108- Client testClient = new Client (Local , testApiKey );
98+ Client testClient = new Client (Service . BetaPrecogHttps , testApiKey );
10999 String rawJson = "{\" test\" :[{\" ดีลลิเชียส\" : 1}, {\" v\" : 2}]}" ;
110100 testClient .store (testPath , rawJson );
111101 }
@@ -117,7 +107,7 @@ public static Map<String, String> jsonToStrMap(String json) {
117107
118108 @ Test
119109 public void testIngestCSV () throws IOException {
120- Client testClient = new Client (Local , testApiKey );
110+ Client testClient = new Client (Service . BetaPrecogHttps , testApiKey );
121111 IngestOptions options = new CSVIngestOptions ();
122112 String response = testClient .ingest (testPath , "blah,\n \n " , options );
123113 IngestResult result = GsonFromJson .of (new TypeToken <IngestResult >() {
@@ -127,7 +117,7 @@ public void testIngestCSV() throws IOException {
127117
128118 @ Test
129119 public void testIngestJSON () throws IOException {
130- Client testClient = new Client (Local , testApiKey );
120+ Client testClient = new Client (Service . BetaPrecogHttps , testApiKey );
131121 IngestOptions options = new IngestOptions (ContentType .JSON );
132122 String rawJson = "{\" test\" :[{\" v\" : 1}, {\" v\" : 2}]}" ;
133123 String response = testClient .ingest (testPath , rawJson , options );
@@ -138,7 +128,7 @@ public void testIngestJSON() throws IOException {
138128
139129 @ Test
140130 public void testIngestCsvWithOptions () throws IOException {
141- Client testClient = new Client (Local , testApiKey );
131+ Client testClient = new Client (Service . BetaPrecogHttps , testApiKey );
142132 CSVIngestOptions options = new CSVIngestOptions ();
143133 options .setDelimiter ("," );
144134 options .setQuote ("'" );
@@ -151,7 +141,7 @@ public void testIngestCsvWithOptions() throws IOException {
151141
152142 @ Test
153143 public void testIngestAsync () throws IOException {
154- Client testClient = new Client (Local , testApiKey );
144+ Client testClient = new Client (Service . BetaPrecogHttps , testApiKey );
155145 IngestOptions options = new CSVIngestOptions ();
156146 options .setAsync (true );
157147 String response = testClient .ingest (testPath , "blah,\n \n " , options );
@@ -200,7 +190,7 @@ public void testOddCharacters() throws IOException {
200190
201191 @ Test
202192 public void testCreateAccount () throws IOException {
203- Client testClient = new Client (Local , null );
193+ Client testClient = new Client (Service . BetaPrecogHttps , null );
204194 String result = testClient .createAccount ("java-test@precog.com" , "password" );
205195 assertNotNull (result );
206196 AccountInfo res = GsonFromJson .of (new TypeToken <AccountInfo >() {
@@ -213,7 +203,7 @@ public void testCreateAccount() throws IOException {
213203
214204 @ Test
215205 public void testDescribeAccount () throws IOException {
216- Client testClient = new Client (Local , null );
206+ Client testClient = new Client (Service . BetaPrecogHttps , null );
217207 String result = testClient .describeAccount ("java-test@precog.com" , "password" , testAccountId );
218208 assertNotNull (result );
219209 AccountInfo res = GsonFromJson .of (new TypeToken <AccountInfo >() {
@@ -224,7 +214,7 @@ public void testDescribeAccount() throws IOException {
224214 @ Test
225215 public void testQuery () throws IOException {
226216 //just test the query was sent and executed successfully
227- Client testClient = new Client (Local , testApiKey );
217+ Client testClient = new Client (Service . BetaPrecogHttps , testApiKey );
228218 String result = testClient .query (new Path (testAccountId ), "count(//" + testAccountId + ")" );
229219 assertNotNull (result );
230220 String [] res = GsonFromJson .of (String [].class ).deserialize (result );
0 commit comments