gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] storm/org/nongnu/storm/impl DirPool.java DirPoo...


From: Benja Fallenstein
Subject: [Gzz-commits] storm/org/nongnu/storm/impl DirPool.java DirPoo...
Date: Tue, 08 Apr 2003 04:10:13 -0400

CVSROOT:        /cvsroot/storm
Module name:    storm
Changes by:     Benja Fallenstein <address@hidden>      03/04/08 04:10:12

Modified files:
        org/nongnu/storm/impl: DirPool.java DirPool.test 

Log message:
        fix bug

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/storm/storm/org/nongnu/storm/impl/DirPool.java.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/storm/storm/org/nongnu/storm/impl/DirPool.test.diff?tr1=1.1&tr2=1.2&r1=text&r2=text

Patches:
Index: storm/org/nongnu/storm/impl/DirPool.java
diff -u storm/org/nongnu/storm/impl/DirPool.java:1.3 
storm/org/nongnu/storm/impl/DirPool.java:1.4
--- storm/org/nongnu/storm/impl/DirPool.java:1.3        Tue Apr  8 04:04:46 2003
+++ storm/org/nongnu/storm/impl/DirPool.java    Tue Apr  8 04:10:12 2003
@@ -176,7 +176,7 @@
 
     protected Set readTypes(String bitprint) throws IOException {
        HashSet types = new HashSet();
-       File file = new File("types_"+bitprint);
+       File file = new File(dir, "types_"+bitprint);
        if(!file.exists()) return types;
        String t;
        BufferedReader r = new BufferedReader(new FileReader(file));
@@ -189,7 +189,7 @@
        String file = "types_"+block.getId().getBitprint();
        Set types = readTypes(block.getId().getBitprint());
        types.add(block.getId().getContentType());
-       PrintWriter p = new PrintWriter(new FileWriter(file));
+       PrintWriter p = new PrintWriter(new FileWriter(new File(dir, file)));
        for(Iterator i = types.iterator(); i.hasNext();)
            p.println(i.next());
        p.close();
Index: storm/org/nongnu/storm/impl/DirPool.test
diff -u storm/org/nongnu/storm/impl/DirPool.test:1.1 
storm/org/nongnu/storm/impl/DirPool.test:1.2
--- storm/org/nongnu/storm/impl/DirPool.test:1.1        Tue Apr  8 04:04:46 2003
+++ storm/org/nongnu/storm/impl/DirPool.test    Tue Apr  8 04:10:12 2003
@@ -79,6 +79,13 @@
 
     assert i != None
     assert i.getBlocks("text/plain") == set([id1, id2])
+
+def testTypesFiles():
+    """Test that the types_ files are written to the correct dir"""
+    os = pool.getBlockOutputStream("text/plain")
+    os.close()
+    name = 'types_' + os.getBlockId().getBitprint()
+    assert File(directory, name).exists()
     
 
 def tearDown():




reply via email to

[Prev in Thread] Current Thread [Next in Thread]