Package com.alvazan.test.db

Examples of com.alvazan.test.db.TimeSeriesData


    trade.setId("myid");
    trade.setNumber(89);
    mgr.put(trade);

    //throw an a guy with Long key types as well...
    TimeSeriesData d = new TimeSeriesData();
    d.setKey(897L);
    d.setSomeName("qwer");
    mgr.put(d);
    mgr.flush();
   
    //unfortunately, the two rows are written as one (ie. MERGED) so
    //to really TEST this out, we remove the trade row to make sure we still have the Activity
    //row
    mgr.remove(trade);
    mgr.flush();
   
    NoSqlEntityManager mgr2 = factory.createEntityManager();
   
    PartitionedSingleTrade r = mgr2.find(PartitionedSingleTrade.class, trade.getId());
    Assert.assertNull(r);
   
    Activity act = mgr2.find(Activity.class, act1.getId());
    Assert.assertNotNull(act);
    Assert.assertEquals(act1.getName(), act.getName());
   
    TimeSeriesData d2 = mgr2.find(TimeSeriesData.class, d.getKey());
    Assert.assertEquals(d.getSomeName(), d2.getSomeName());
  }
View Full Code Here


    Assert.assertNull(newResult);
  }
 
  @Test
  public void testPrimaryKeyLongIndex() {
    TimeSeriesData data = new TimeSeriesData();
    data.setKey(67L);
    data.setSomeName("dean");
   
    mgr.put(data);
    mgr.flush();

    TimeSeriesData newData = TimeSeriesData.findById(mgr, data.getKey());
    Assert.assertEquals(data.getSomeName(), newData.getSomeName());
  }
View Full Code Here

    Assert.assertEquals(data.getSomeName(), newData.getSomeName());
  }
 
  @Test
  public void testFloatKey() {
    TimeSeriesData data = new TimeSeriesData();
    data.setKey(67L);
    data.setSomeName("dean");
    data.setTemp(67.8f);
   
    mgr.put(data);
    mgr.flush();

    TimeSeriesData newData = TimeSeriesData.findByTemp(mgr, 67.8f);
    Assert.assertEquals(data.getSomeName(), newData.getSomeName());
  }
View Full Code Here

TOP

Related Classes of com.alvazan.test.db.TimeSeriesData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.