/[storm]/storm/org/nongnu/storm/StormPool.meta
ViewVC logotype

Diff of /storm/org/nongnu/storm/StormPool.meta

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

revision 1.6 by benja, Thu Apr 17 08:36:34 2003 UTC revision 1.7 by tjl, Sat Apr 19 13:11:13 2003 UTC
# Line 64  def testNewBlock(): Line 64  def testNewBlock():
64    
65      assert b.getId().getContentType() == "text/plain"      assert b.getId().getContentType() == "text/plain"
66    
67    def testBlockTmpFile():
68        """
69        Test that creating a blocktmpfile out of a block
70        in the pool works.
71        """
72        bos = pool.getBlockOutputStream("text/plain")
73        osw = OutputStreamWriter(bos)
74        osw.write("Hallo, Welt!")
75        osw.close()
76        blockid = bos.getBlockId()
77        block = pool.get(blockid)
78        f = org.nongnu.storm.BlockTmpFile.get(block)
79        inp = java.io.FileReader(f.getFile())
80        buf = java.lang.StringBuffer()
81        str = "Hallo, Welt!"
82        ind = 0
83        while 1:
84            c = inp.read()
85            if c < 0: break
86            # print "R: ", chr(c), str[ind]
87            assert chr(c) == str[ind]
88            ind += 1
89        assert ind == len(str)
90        inp.close()
91        f.close()
92    
93    
94  def testAddTwice():  def testAddTwice():
95      """      """

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

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