comparison test/org/dancres/blitz/SpaceWriteTest.java @ 0:3dc0c5604566

Initial checkin of blitz 2.0 fcs - no installer yet.
author Dan Creswell <dan.creswell@gmail.com>
date Sat, 21 Mar 2009 11:00:06 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:3dc0c5604566
1 package org.dancres.blitz;
2
3 import net.jini.core.entry.Entry;
4 import net.jini.core.lease.Lease;
5
6 import org.dancres.blitz.mangler.*;
7
8 public class SpaceWriteTest {
9 public static void main(String args[]) {
10
11 try {
12 System.out.println("Start space");
13
14 SpaceImpl mySpace = new SpaceImpl(null);
15
16 System.out.println("Prepare entry");
17
18 EntryMangler myMangler = new EntryMangler();
19 TestEntry myEntry = new TestEntry();
20 myEntry.init();
21
22 System.out.println("init'd entry");
23 MangledEntry myPackedEntry = myMangler.mangle(myEntry);
24
25 System.out.println("Do write");
26
27 mySpace.write(myPackedEntry, null, Lease.FOREVER);
28
29 System.out.println("Do stop");
30
31 mySpace.stop();
32
33 } catch (Exception anE) {
34 System.err.println("Got exception :(");
35 anE.printStackTrace(System.err);
36 }
37
38 }
39
40 public static class TestEntry implements Entry {
41 public String rhubarb;
42 public Integer count;
43 public Integer meta;
44
45 public TestEntry() {
46 }
47
48 public void init() {
49 rhubarb = "blah";
50 count = new Integer(5);
51 // another = new Integer(6);
52 }
53
54 public String toString() {
55 return super.toString() + ", " + rhubarb + ", " + count;
56 }
57 }
58 }