Mercurial > hg > blitz_stable
view 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 |
line wrap: on
line source
package org.dancres.blitz; import net.jini.core.entry.Entry; import net.jini.core.lease.Lease; import org.dancres.blitz.mangler.*; public class SpaceWriteTest { public static void main(String args[]) { try { System.out.println("Start space"); SpaceImpl mySpace = new SpaceImpl(null); System.out.println("Prepare entry"); EntryMangler myMangler = new EntryMangler(); TestEntry myEntry = new TestEntry(); myEntry.init(); System.out.println("init'd entry"); MangledEntry myPackedEntry = myMangler.mangle(myEntry); System.out.println("Do write"); mySpace.write(myPackedEntry, null, Lease.FOREVER); System.out.println("Do stop"); mySpace.stop(); } catch (Exception anE) { System.err.println("Got exception :("); anE.printStackTrace(System.err); } } public static class TestEntry implements Entry { public String rhubarb; public Integer count; public Integer meta; public TestEntry() { } public void init() { rhubarb = "blah"; count = new Integer(5); // another = new Integer(6); } public String toString() { return super.toString() + ", " + rhubarb + ", " + count; } } }