/[gzz]/gzz/lava/test/gzz/storm/StormPoolTest.java
ViewVC logotype

Diff of /gzz/lava/test/gzz/storm/StormPoolTest.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by benja, Wed Nov 6 22:02:56 2002 UTC revision 1.6 by benja, Thu Nov 7 21:42:50 2002 UTC
# Line 151  public class StormPoolTest { Line 151  public class StormPoolTest {
151          if(!newIds.contains(bos.getBlockId()))          if(!newIds.contains(bos.getBlockId()))
152              throw new Error("Id was not added");              throw new Error("Id was not added");
153      }      }
154    
155        /** Add a block and check its id.
156         */
157        public void testBlockId(StormPool pool) throws IOException {
158            Header822 header = new VerbatimHeader822();
159            header.add("Content-Transfer-Encoding", "binary");
160            header.add("Content-Type","text/plain; charset=UTF-8");
161            header.add("Date", "Tue, 1 Oct 2002 12:30:30 +0000");
162            header.add("X-Injected-By", "benja@joy");
163    
164            byte[] body = "foo".getBytes("UTF-8");
165    
166            BlockId id = new BlockId(
167                "storm:block:01E88CEE7CF19F016EEF00B315C0B930C953DB7EF2");
168    
169            BlockOutputStream bos = pool.getBlockOutputStream(header);
170            bos.write(body);
171            bos.close();
172    
173            BlockId
174                id1 = bos.getBlockId(),
175                id2 = bos.getBlock().getId();
176    
177            if(!id.equals(id1))
178                throw new Error("bos.getBlockId() does not match");
179    
180            if(!id.equals(id2))
181                throw new Error("bos.getBlock().getId() does not match");
182        }
183  }  }

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26