1 21 package com.db4o.test; 22 23 import com.db4o.*; 24 import com.db4o.query.*; 25 26 27 public class GetAllSoda { 28 29 public String name; 30 31 32 public GetAllSoda() { 33 34 } 35 36 public GetAllSoda(String name) { 37 this.name = name; 38 } 39 40 public void store(){ 41 Test.store(new GetAllSoda("one")); 42 Test.store(new GetAllSoda("two")); 43 } 44 45 public void test(){ 46 Query q = Test.query(); 47 ObjectSet objectSet = q.execute(); 48 Test.ensure(objectSet.size() >= 2); 49 int i = 0; 50 while(objectSet.hasNext()){ 51 Object obj = objectSet.next(); 52 Test.ensure(obj != null); 53 i ++; 54 } 55 Test.ensure(i >= 2); 56 } 57 58 } 59 | Popular Tags |