PageRenderTime 33ms CodeModel.GetById 15ms app.highlight 12ms RepoModel.GetById 2ms app.codeStats 0ms

/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
 1/*
 2 * Copyright (c) 2010 Tonic Solutions LLC.
 3 *
 4 * http://www.nimbits.com
 5 *
 6 *
 7 * 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
 8 *
 9 * http://www.gnu.org/licenses/gpl.html
10 *
11 * 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.
12 */
13
14import com.nimbits.client.model.Const;
15import com.nimbits.client.model.category.CategoryName;
16import com.nimbits.client.model.common.CommonFactoryLocator;
17import com.nimbits.client.model.point.PointName;
18import com.nimbits.client.model.user.User;
19import org.junit.Assert;
20import org.junit.Ignore;
21import org.junit.Test;
22
23import java.io.IOException;
24import java.util.List;
25
26/**
27 * Created by bsautner
28 * User: benjamin
29 * Date: 6/24/11
30 * Time: 2:44 PM
31 */
32public class UserTest {
33
34    @Test
35    public void testGetAllUsersQA() {
36        List<User> users = Common.authOnQA().getUsers();
37        Assert.assertNotNull(users);
38        Assert.assertTrue(users.size() > 1);
39        System.out.println(users.size());
40
41
42    }
43
44
45    @Test
46    public void testGetAllUsersProd() {
47        List<User> users = Common.specificVersion().getUsers();
48        Assert.assertNotNull(users);
49        Assert.assertTrue(users.size() > 1);
50
51    }
52
53    @Test
54    @Ignore
55    public void countUsersTest() throws IOException {
56        List<User> users = Common.specificVersion().getUsers();
57
58        Assert.assertNotNull(users);
59        Assert.assertTrue(users.size() > 1);
60        System.out.println(users.size());
61        System.out.println(Common.meOnProd().isLoggedIn());
62        PointName pointName = (PointName) CommonFactoryLocator.getInstance().createPointName("usercount");
63        Common.meOnProd().deletePoint(pointName);
64        CategoryName cat = CommonFactoryLocator.getInstance().createCategoryName(Const.CONST_HIDDEN_CATEGORY);
65
66        Common.meOnProd().addPoint(cat, pointName);
67        double i = 0.0;
68        for (User u : users) {
69            i++;
70            System.out.println(u.getEmail() + " " + u.getDateCreated());
71            // double prev = Double.valueOf(Common.meOnProd().currentValue("usercount"));
72
73            //   Common.meOnProd().recordValue(pointName, i, u.getDateCreated());
74
75
76        }
77
78    }
79
80
81}