directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r638518 - /directory/sandbox/akarasulu/bigbang/apacheds/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMarshallerTest.java
Date Tue, 18 Mar 2008 19:24:06 GMT
Author: kayyagari
Date: Tue Mar 18 12:24:04 2008
New Revision: 638518

URL: http://svn.apache.org/viewvc?rev=638518&view=rev
Log:
replaced sysout statements with logger
added a new method to test deserialization with null data

Modified:
    directory/sandbox/akarasulu/bigbang/apacheds/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMarshallerTest.java

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMarshallerTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMarshallerTest.java?rev=638518&r1=638517&r2=638518&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMarshallerTest.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMarshallerTest.java
Tue Mar 18 12:24:04 2008
@@ -20,17 +20,23 @@
 package org.apache.directory.server.core.avltree;
 
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertEquals;
 
-import java.io.*;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.Serializable;
 import java.util.Comparator;
 
 import org.junit.Before;
 import org.junit.Test;
-import org.junit.Ignore;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -49,6 +55,8 @@
     
     File treeFile = new File( System.getProperty( "java.io.tmpdir" ) + File.separator + "avl.tree");
     
+    private static final Logger LOG = LoggerFactory.getLogger( AvlTreeMarshallerTest.class.getSimpleName()
);
+    
     @Before
     public void createTree()
     {
@@ -299,7 +307,7 @@
         
         savedTree = tree; // to reference in other tests
         
-        System.out.println("saved tree\n--------");
+        LOG.debug("saved tree\n--------");
         tree.printTree();
         
         assertTrue( true );
@@ -316,7 +324,7 @@
         
         AvlTree<Integer> unmarshalledTree = treeMarshaller.deserialize( data );
         
-        System.out.println("\nunmarshalled tree\n---------------");
+        LOG.debug("\nunmarshalled tree\n---------------");
         unmarshalledTree.printTree();
         
         assertTrue( savedTree.getRoot().getKey() == unmarshalledTree.getRoot().getKey() );
@@ -335,10 +343,17 @@
         unmarshalledTree.insert( 0 );
         assertTrue( 0 == unmarshalledTree.getFirst().getKey() );
         
-        System.out.println("\nmodified tree after unmarshalling\n---------------");
+        LOG.debug("\nmodified tree after unmarshalling\n---------------");
         unmarshalledTree.printTree();
         
         assertNotNull(unmarshalledTree.getFirst());
         assertNotNull(unmarshalledTree.getLast());
+    }
+    
+    
+    @Test( expected = IOException.class )
+    public void testDeserializeNullData() throws IOException
+    {
+        treeMarshaller.deserialize( null );
     }
 }



Mime
View raw message