/v3.2/nimbits-sdk/test/UserTest.java
http://nimbits-server.googlecode.com/ · Java · 81 lines · 43 code · 18 blank · 20 comment · 1 complexity · f89f0ab7bbbfabc5574021965f7da2df MD5 · raw file
- /*
- * Copyright (c) 2010 Tonic Solutions LLC.
- *
- * http://www.nimbits.com
- *
- *
- * Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.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.gnu.org/licenses/gpl.html
- *
- * 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.
- */
- import com.nimbits.client.model.Const;
- import com.nimbits.client.model.category.CategoryName;
- import com.nimbits.client.model.common.CommonFactoryLocator;
- import com.nimbits.client.model.point.PointName;
- import com.nimbits.client.model.user.User;
- import org.junit.Assert;
- import org.junit.Ignore;
- import org.junit.Test;
- import java.io.IOException;
- import java.util.List;
- /**
- * Created by bsautner
- * User: benjamin
- * Date: 6/24/11
- * Time: 2:44 PM
- */
- public class UserTest {
- @Test
- public void testGetAllUsersQA() {
- List<User> users = Common.authOnQA().getUsers();
- Assert.assertNotNull(users);
- Assert.assertTrue(users.size() > 1);
- System.out.println(users.size());
- }
- @Test
- public void testGetAllUsersProd() {
- List<User> users = Common.specificVersion().getUsers();
- Assert.assertNotNull(users);
- Assert.assertTrue(users.size() > 1);
- }
- @Test
- @Ignore
- public void countUsersTest() throws IOException {
- List<User> users = Common.specificVersion().getUsers();
- Assert.assertNotNull(users);
- Assert.assertTrue(users.size() > 1);
- System.out.println(users.size());
- System.out.println(Common.meOnProd().isLoggedIn());
- PointName pointName = (PointName) CommonFactoryLocator.getInstance().createPointName("usercount");
- Common.meOnProd().deletePoint(pointName);
- CategoryName cat = CommonFactoryLocator.getInstance().createCategoryName(Const.CONST_HIDDEN_CATEGORY);
- Common.meOnProd().addPoint(cat, pointName);
- double i = 0.0;
- for (User u : users) {
- i++;
- System.out.println(u.getEmail() + " " + u.getDateCreated());
- // double prev = Double.valueOf(Common.meOnProd().currentValue("usercount"));
- // Common.meOnProd().recordValue(pointName, i, u.getDateCreated());
- }
- }
- }