KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > cache > buddyreplication > GravitateResultTest


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 JavaDoc;
8 import java.util.List JavaDoc;
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 JavaDoc<Node> l = new ArrayList JavaDoc();
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