[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz/lava gzz/storm/impl/DirPool.java gzz/storm/...
From: |
Benja Fallenstein |
Subject: |
[Gzz-commits] gzz/lava gzz/storm/impl/DirPool.java gzz/storm/... |
Date: |
Thu, 14 Nov 2002 15:05:23 -0500 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Benja Fallenstein <address@hidden> 02/11/14 15:05:23
Modified files:
lava/gzz/storm/impl: DirPool.java TransientPool.java
lava/test/gzz/storm: StormPoolTest.java
Log message:
Implement a tad more Storm
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/storm/impl/DirPool.java.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/storm/impl/TransientPool.java.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/test/gzz/storm/StormPoolTest.java.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
Patches:
Index: gzz/lava/gzz/storm/impl/DirPool.java
diff -u gzz/lava/gzz/storm/impl/DirPool.java:1.3
gzz/lava/gzz/storm/impl/DirPool.java:1.4
--- gzz/lava/gzz/storm/impl/DirPool.java:1.3 Fri Nov 8 16:55:34 2002
+++ gzz/lava/gzz/storm/impl/DirPool.java Thu Nov 14 15:05:23 2002
@@ -55,7 +55,7 @@
header.writeTo(baos);
}
public Block getBlock() { return block; }
- public Header822 getHeader() { return null; }
+ public Header822 getHeader() { return header; }
public void close() throws IOException {
byte[] bytes = baos.toByteArray();
BlockId id = BlockId.getIdForData(bytes);
@@ -84,7 +84,7 @@
is.close();
}
public BlockId getId() { return id; }
- public StormPool getPool() { return null; }
+ public StormPool getPool() { return DirPool.this; }
public Header822 getHeader() { return header; }
public InputStream getInputStream() throws IOException {
InputStream is = new FileInputStream(file);
Index: gzz/lava/gzz/storm/impl/TransientPool.java
diff -u gzz/lava/gzz/storm/impl/TransientPool.java:1.10
gzz/lava/gzz/storm/impl/TransientPool.java:1.11
--- gzz/lava/gzz/storm/impl/TransientPool.java:1.10 Thu Nov 7 17:07:00 2002
+++ gzz/lava/gzz/storm/impl/TransientPool.java Thu Nov 14 15:05:23 2002
@@ -52,7 +52,7 @@
headerLength = baos.size();
}
public Block getBlock() { return block; }
- public Header822 getHeader() { return null; }
+ public Header822 getHeader() { return header; }
public void close() throws IOException {
block = new TransientBlock(baos.toByteArray(),
header, headerLength);
@@ -76,7 +76,7 @@
id = BlockId.getIdForData(bytes);
}
public BlockId getId() { return id; }
- public StormPool getPool() { return null; }
+ public StormPool getPool() { return TransientPool.this; }
public Header822 getHeader() { return header; }
public InputStream getInputStream() {
return new ByteArrayInputStream(bytes, headerLength,
Index: gzz/lava/test/gzz/storm/StormPoolTest.java
diff -u gzz/lava/test/gzz/storm/StormPoolTest.java:1.7
gzz/lava/test/gzz/storm/StormPoolTest.java:1.8
--- gzz/lava/test/gzz/storm/StormPoolTest.java:1.7 Thu Nov 7 17:07:00 2002
+++ gzz/lava/test/gzz/storm/StormPoolTest.java Thu Nov 14 15:05:23 2002
@@ -35,10 +35,20 @@
public void testNewBlock(StormPool pool) throws IOException{
BlockOutputStream bos = pool.getBlockOutputStream("text/plain");
+
+ Header822 header = bos.getHeader();
+ if(!header.get("Content-Type").equals("text/plain"))
+ throw new Error();
+
OutputStreamWriter osw = new OutputStreamWriter( bos );
osw.write("Hallo, Welt!");
osw.close();
Block b = pool.get(bos.getBlockId());
+
+ if(bos.getBlock().getPool() != pool)
+ throw new Error();
+ if(b.getPool() != pool)
+ throw new Error();
InputStreamReader isr = new InputStreamReader(b.getInputStream());
char[] array = new char[12];
- [Gzz-commits] gzz/lava gzz/storm/impl/DirPool.java gzz/storm/...,
Benja Fallenstein <=