20 |
# |
# |
21 |
# |
# |
22 |
|
|
23 |
import java, com |
import java, com, org |
24 |
from org.nongnu.storm import BlockId |
from org.nongnu.storm import BlockId |
25 |
from jarray import array |
from jarray import array |
26 |
|
|
233 |
|
|
234 |
assert check3(id_3, data_3) |
assert check3(id_3, data_3) |
235 |
assert (not check3(id_1, data_3)) and (not check3(id_2, data_3)) |
assert (not check3(id_1, data_3)) and (not check3(id_2, data_3)) |
236 |
|
|
237 |
|
|
238 |
|
def testCheckNullBytes(): |
239 |
|
pool = org.nongnu.storm.impl.TransientPool(java.util.HashSet()) |
240 |
|
s = pool.getBlockOutputStream("application/octet-stream") |
241 |
|
s.write(0); s.write(0) |
242 |
|
s.close() |
243 |
|
|
244 |
|
id = s.getBlockId() |
245 |
|
|
246 |
|
b = java.io.ByteArrayInputStream(array([0,0], 'b')) |
247 |
|
c = id.getCheckedInputStream(b) |
248 |
|
c.close(); |