Repository: usergrid Updated Branches: refs/heads/master fa590f5c7 -> d2f04b456
http://git-wip-us.apache.org/repos/asf/usergrid/blob/d2f04b45/sdks/java/src/test/java/org/apache/usergrid/client/UsergridResponseErrorTestCase.java ---------------------------------------------------------------------- diff --git a/sdks/java/src/test/java/org/apache/usergrid/client/UsergridResponseErrorTestCase.java b/sdks/java/src/test/java/org/apache/usergrid/client/UsergridResponseErrorTestCase.java deleted file mode 100644 index 3533805..0000000 --- a/sdks/java/src/test/java/org/apache/usergrid/client/UsergridResponseErrorTestCase.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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.apache.usergrid.client; - -import org.apache.usergrid.java.client.Usergrid; -import org.apache.usergrid.java.client.auth.UsergridAppAuth; -import org.apache.usergrid.java.client.response.UsergridResponse; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -import java.util.HashMap; -import java.util.Map; - -import static org.junit.Assert.*; - -public class UsergridResponseErrorTestCase { - - @Before - public void before() { - Usergrid.initSharedInstance(SDKTestConfiguration.ORG_NAME, SDKTestConfiguration.APP_NAME, SDKTestConfiguration.USERGRID_URL, SDKTestConfiguration.authFallBack); - UsergridAppAuth appAuth = new UsergridAppAuth(SDKTestConfiguration.APP_CLIENT_ID, SDKTestConfiguration.APP_CLIENT_SECRET); - Usergrid.authenticateApp(appAuth); - } - - @After - public void after() { - Usergrid.reset(); - } - - @Test - public void testEntityCreationSuccess() { - String collectionName = "ect" + System.currentTimeMillis(); - - Map<String, String> fields = new HashMap<>(3); - fields.put("color", "red"); - fields.put("shape", "square"); - - SDKTestUtils.createEntity(collectionName, "testEntity1", fields); - UsergridResponse eLookUp = Usergrid.GET(collectionName, "testEntity1"); - assertNull("The returned entity is null!", eLookUp.getResponseError()); - - UsergridResponse response = Usergrid.GET(collectionName, "testEntityThatShouldNotExist"); - assertFalse("Response returned should not be ok.",response.ok()); - assertTrue("StatusCode equals than 404", response.getStatusCode() == 404); - assertNotNull("The returned entity is null!", response.getResponseError()); - } -} http://git-wip-us.apache.org/repos/asf/usergrid/blob/d2f04b45/sdks/java/src/test/java/org/apache/usergrid/client/UsergridResponseTestCase.java ---------------------------------------------------------------------- diff --git a/sdks/java/src/test/java/org/apache/usergrid/client/UsergridResponseTestCase.java b/sdks/java/src/test/java/org/apache/usergrid/client/UsergridResponseTestCase.java deleted file mode 100644 index e158d85..0000000 --- a/sdks/java/src/test/java/org/apache/usergrid/client/UsergridResponseTestCase.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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.apache.usergrid.client; - -import org.apache.usergrid.java.client.Usergrid; -import org.apache.usergrid.java.client.UsergridEnums; -import org.apache.usergrid.java.client.auth.UsergridUserAuth; -import org.apache.usergrid.java.client.response.UsergridResponse; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -import java.util.HashMap; -import java.util.Map; - -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -public class UsergridResponseTestCase { - - @Before - public void before() { - Usergrid.initSharedInstance(SDKTestConfiguration.ORG_NAME, SDKTestConfiguration.APP_NAME, SDKTestConfiguration.USERGRID_URL, UsergridEnums.UsergridAuthMode.USER); - Usergrid.authenticateUser(new UsergridUserAuth(SDKTestConfiguration.APP_UserName, SDKTestConfiguration.APP_Password)); - } - - @After - public void after() { - Usergrid.reset(); - } - - @Test - public void testLogoutUser() { - String collectionName = "ect" + System.currentTimeMillis(); - - Map<String, String> fields = new HashMap<>(3); - fields.put("color", "red"); - fields.put("shape", "square"); - - SDKTestUtils.createEntity(collectionName, "testEntity1", fields); - UsergridResponse response = Usergrid.GET(collectionName, "testEntity1"); - Object instanceObj = response.getStatusCode(); - assertTrue("The returned statusCode is and object of integer", instanceObj instanceof Integer); - instanceObj = response.ok(); - assertTrue("The returned statusCode is and object of boolean", instanceObj instanceof Boolean); - - UsergridResponse resp = Usergrid.logoutUser(SDKTestConfiguration.APP_UserName,null); - - response = Usergrid.GET(collectionName, "testEntity1"); - assertNotNull("The response should throw an error",response.getResponseError()); - } - - @Test - public void testLogoutCurrentUser() { - String collectionName = "ect" + System.currentTimeMillis(); - - Map<String, String> fields = new HashMap<>(3); - fields.put("color", "red"); - fields.put("shape", "square"); - - SDKTestUtils.createEntity(collectionName, "testEntity12", fields); - UsergridResponse response = Usergrid.GET(collectionName, "testEntity12"); - assertNull("The response should not throw an error",response.getResponseError()); - - Usergrid.logoutCurrentUser(); - response = Usergrid.GET(collectionName, "testEntity1"); - assertNotNull("The response should throw an error",response.getResponseError()); - } - -} http://git-wip-us.apache.org/repos/asf/usergrid/blob/d2f04b45/sdks/java/src/test/java/org/apache/usergrid/client/UsergridTestCase.java ---------------------------------------------------------------------- diff --git a/sdks/java/src/test/java/org/apache/usergrid/client/UsergridTestCase.java b/sdks/java/src/test/java/org/apache/usergrid/client/UsergridTestCase.java deleted file mode 100644 index 5e1ab3a..0000000 --- a/sdks/java/src/test/java/org/apache/usergrid/client/UsergridTestCase.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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.apache.usergrid.client; - -import org.apache.usergrid.java.client.Usergrid; -import org.apache.usergrid.java.client.auth.UsergridAppAuth; -import org.junit.Before; -import org.junit.Test; - -public class UsergridTestCase { - - @Test - public void initialize() { - Usergrid.initSharedInstance(SDKTestConfiguration.ORG_NAME, SDKTestConfiguration.APP_NAME, SDKTestConfiguration.USERGRID_URL); - } -} http://git-wip-us.apache.org/repos/asf/usergrid/blob/d2f04b45/sdks/java/usergrid-java-client-2.1.0.jar ---------------------------------------------------------------------- diff --git a/sdks/java/usergrid-java-client-2.1.0.jar b/sdks/java/usergrid-java-client-2.1.0.jar deleted file mode 100644 index fa90a59..0000000 Binary files a/sdks/java/usergrid-java-client-2.1.0.jar and /dev/null differ http://git-wip-us.apache.org/repos/asf/usergrid/blob/d2f04b45/stack/README.md ---------------------------------------------------------------------- diff --git a/stack/README.md b/stack/README.md index adf776c..268cb7e 100644 --- a/stack/README.md +++ b/stack/README.md @@ -16,7 +16,11 @@ A highly-scalable data platform for mobile applications. ## Building -From the command line, go to the usergrid directory and type the following: +First, build the [Java SDK](https://github.com/apache/usergrid-java) as the stack uses this as a dependency for some modules: + + mvn clean install -DskipTests=true + +From the command line, go to the usergrid `stack/` directory and type the following: mvn clean install -DskipTests=true
