public class StringTest extends TestCase {
public void test() {
MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
try {
JAFuture future = new JAFuture();
JidFactories factory = new JidFactories();
factory.initialize(mailboxFactory.createMailbox());
StringJid string1 = (StringJid) StringJidFactory.fac.newActor(factory.getMailbox(), factory);
StringJid string2 = (StringJid) (new CopyJID()).send(future, string1);
(new SetString("abc")).send(future, string2);
StringJid string3 = (StringJid) (new CopyJID()).send(future, string2);
int sl = GetSerializedLength.req.send(future, string1);
assertEquals(4, sl);
sl = GetSerializedLength.req.send(future, string2);
assertEquals(10, sl);
sl = GetSerializedLength.req.send(future, string3);
assertEquals(10, sl);
assertNull(GetString.req.send(future, string1));
assertEquals("abc", GetString.req.send(future, string2));
assertEquals("abc", GetString.req.send(future, string3));
Actor jidJid1 = ActorJidFactory.fac.newActor(factory.getMailbox(), factory);
SetActor sjvbs = new SetActor(JidFactories.STRING_JID_TYPE);
sjvbs.send(future, jidJid1);
StringJid rpa = (StringJid) (new ResolvePathname("0")).send(future, jidJid1);
assertNull(GetString.req.send(future, rpa));
assertTrue((new MakeString("")).send(future, rpa));