35 |
public void testNewBlock(StormPool pool) throws IOException{ |
public void testNewBlock(StormPool pool) throws IOException{ |
36 |
|
|
37 |
BlockOutputStream bos = pool.getBlockOutputStream("text/plain"); |
BlockOutputStream bos = pool.getBlockOutputStream("text/plain"); |
38 |
|
|
39 |
|
Header822 header = bos.getHeader(); |
40 |
|
if(!header.get("Content-Type").equals("text/plain")) |
41 |
|
throw new Error(); |
42 |
|
|
43 |
OutputStreamWriter osw = new OutputStreamWriter( bos ); |
OutputStreamWriter osw = new OutputStreamWriter( bos ); |
44 |
osw.write("Hallo, Welt!"); |
osw.write("Hallo, Welt!"); |
45 |
osw.close(); |
osw.close(); |
46 |
Block b = pool.get(bos.getBlockId()); |
Block b = pool.get(bos.getBlockId()); |
47 |
|
|
48 |
|
if(bos.getBlock().getPool() != pool) |
49 |
|
throw new Error(); |
50 |
|
if(b.getPool() != pool) |
51 |
|
throw new Error(); |
52 |
|
|
53 |
InputStreamReader isr = new InputStreamReader(b.getInputStream()); |
InputStreamReader isr = new InputStreamReader(b.getInputStream()); |
54 |
char[] array = new char[12]; |
char[] array = new char[12]; |