| 252 | } |
| 253 | |
| 254 | public static void smokeTest(){ |
| 255 | // Construct a hash map suitable for a doc. |
| 256 | HashMap<Object,Object> h1 = new HashMap<Object,Object>(); |
| 257 | HashMap<Object,Object> h2 = new HashMap<Object,Object>(); |
| 258 | HashMap<Object,Object> h3 = new HashMap<Object,Object>(); |
| 259 | ArrayList<Object> a1 = new ArrayList<Object>(); |
| 260 | a1.add("sales"); a1.add("service"); |
| 261 | h3.put("friend_of", "smith"); h3.put("group", a1); |
| 262 | HashMap<Object,Object> h4 = new HashMap<Object,Object>(); |
| 263 | ArrayList<Object> a2 = new ArrayList<Object>(); |
| 264 | a2.add("dev"); a2.add("research"); |
| 265 | h4.put("friend_of", "jones"); h4.put("group",a2); |
| 266 | h2.put("jones", h3); h2.put("smith",h4); |
| 267 | h1.put("user", h2); |
| 268 | |
| 269 | // ArrayList<Tuple> tupList = toTuples(h1); |
| 270 | // for(Tuple t : tupList){ |
| 271 | // System.out.println(tupleRep(t)); |
| 272 | // } |
| 273 | // |
| 274 | // Object ret = fromTuples(tupList); |
| 275 | // System.out.println(ret); |
| 276 | |
| 277 | Object id = insertDoc(db, h1); |
| 278 | System.out.println(id); |
| 279 | |
| 280 | printSubspace(db, docSpace); |
| 281 | System.out.println(getDoc(db, id, Tuple.from("user","jones","friend_of"))); |
| 282 | } |
| 283 | |
| 284 | public static void main(String[] args) { |
| 285 | clearSubspace(db, docSpace); |