1 package org.jboss.cache.buddyreplication; 2 3 import junit.framework.TestCase; 4 import org.jboss.cache.Fqn; 5 import org.jboss.cache.Node; 6 7 import java.util.ArrayList ; 8 import java.util.List ; 9 10 public class GravitateResultTest extends TestCase 11 { 12 13 public void testBasic() 14 { 15 GravitateResult gr = GravitateResult.noDataFound(); 16 assertEquals(false, gr.getDataFound()); 17 gr.toString(); 18 assertEquals(1, gr.asList().size()); 19 assertEquals(Boolean.FALSE, gr.asList().get(0)); 20 21 List <Node> l = new ArrayList (); 22 gr = GravitateResult.subtreeResult(l, Fqn.ROOT); 23 assertEquals(true, gr.getDataFound()); 24 assertEquals(l, gr.getSubtree()); 25 gr.toString(); 26 assertEquals(Fqn.ROOT, gr.getBuddyBackupRegion()); 27 assertEquals(3, gr.asList().size()); 28 assertEquals(Boolean.TRUE, gr.asList().get(0)); 29 30 byte b[] = new byte[0]; 31 gr = GravitateResult.marshalledResult(b, Fqn.ROOT); 32 assertEquals(b, gr.getMarshalledData()); 33 gr.toString(); 34 } 35 36 } 37 | Popular Tags |