PageRenderTime 9ms CodeModel.GetById 1ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/v3.2/nimbits-tds/test/TestRecordValueServiceImpl.java

http://nimbits-server.googlecode.com/
Java | 44 lines | 18 code | 7 blank | 19 comment | 0 complexity | 7e0890f6ae766089b8ce581873f10731 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.value.Value;
15import com.nimbits.client.model.value.ValueModelFactory;
16import com.nimbits.server.gson.GsonFactory;
17import org.junit.Test;
18
19import java.util.Date;
20
21import static org.junit.Assert.assertFalse;
22
23/**
24 * Created by bsautner
25 * User: benjamin
26 * Date: 7/22/11
27 * Time: 3:00 PM
28 */
29public class TestRecordValueServiceImpl {
30
31    @Test
32    public void testStartRecordValueTask() {
33        Value v = ValueModelFactory.createValueModel(0.0, 0.0, 0.0, new Date(), 0, "");
34        // 0000&p2=IN2&v2=0000&p3=IN3&v3=0000&p4=IN4&v4=0088&p5=IN5&v5=0328&p6=IN6&v6=0070&p7=INP1&v7=000&p8=INP2&v8=0&p9=Temp&v9=23.3&p10=Bat&v10=0.3&p11=Frq&v11=00.0&p12=Phi&v12=00.0" "AppEngine-Google; (+http://code.google.com/appengine)" "app.nimbits.com" ms=191 cpu_ms=287 api_cpu_ms=217 cpm_usd=0.008349 queue_name=recordvaluequeue task_name=10957361277155433609 instance=00c61b117cb1364c5c6603c8348714ca19165c
35        String j = GsonFactory.getInstance().toJson(v);
36        System.out.println(j);
37
38        assertFalse(Double.valueOf("0000").isInfinite());
39        assertFalse(Double.valueOf("0088").isInfinite());
40        assertFalse(Double.valueOf("000").isInfinite());
41        assertFalse(Double.valueOf("00.0").isInfinite());
42    }
43
44}