()
| 214 | } |
| 215 | |
| 216 | @Test |
| 217 | public void testBag() throws Exception{ |
| 218 | String myBag = "{(1,a),(2,b)}"; |
| 219 | Object o = ps.getLoadCaster().bytesToBag(myBag.getBytes(), getBagFieldSchema()); |
| 220 | assertTrue(o instanceof DataBag); |
| 221 | DataBag b = (DataBag)o; |
| 222 | DataBag expectedBag = bagFactory.newDefaultBag(); |
| 223 | Tuple expectedTuple = tupleFactory.newTuple(2); |
| 224 | expectedTuple.set(0, 1); |
| 225 | expectedTuple.set(1, "a"); |
| 226 | expectedBag.add(expectedTuple); |
| 227 | expectedTuple = tupleFactory.newTuple(2); |
| 228 | expectedTuple.set(0, 2); |
| 229 | expectedTuple.set(1, "b"); |
| 230 | expectedBag.add(expectedTuple); |
| 231 | assertEquals(expectedBag, b); |
| 232 | } |
| 233 | |
| 234 | @Test |
| 235 | public void testEmptyBag() throws Exception{ |
nothing calls this directly
no test coverage detected