/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. import com.nimbits.client.model.value.Value;
  14. import com.nimbits.client.model.value.ValueModelFactory;
  15. import com.nimbits.server.gson.GsonFactory;
  16. import org.junit.Test;
  17. import java.util.Date;
  18. import static org.junit.Assert.assertFalse;
  19. /**
  20. * Created by bsautner
  21. * User: benjamin
  22. * Date: 7/22/11
  23. * Time: 3:00 PM
  24. */
  25. public class TestRecordValueServiceImpl {
  26. @Test
  27. public void testStartRecordValueTask() {
  28. Value v = ValueModelFactory.createValueModel(0.0, 0.0, 0.0, new Date(), 0, "");
  29. // 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
  30. String j = GsonFactory.getInstance().toJson(v);
  31. System.out.println(j);
  32. assertFalse(Double.valueOf("0000").isInfinite());
  33. assertFalse(Double.valueOf("0088").isInfinite());
  34. assertFalse(Double.valueOf("000").isInfinite());
  35. assertFalse(Double.valueOf("00.0").isInfinite());
  36. }
  37. }