// Test setting wavelet title.
wavelet.setTitle("A wavelet title");
// Test inserting image.
blip.append(new Image("http://www.google.com/logos/clickortreat1.gif", 320, 118,
"Click or treat"));
// Test inserting list.
Line line = new Line();
line.setLineType("li");
line.setIndent("2");
blip.append(line);
blip.append("bulleted!");
// Test inserting extension installer.
String installerUrl = "http://wave-skynet.appspot.com/public/extensions/areyouin/manifest.xml";
blip.append(new Installer(installerUrl));
// Test adding a proxied reply. The reply will be posted by
// jkitchensinky+proxy@appspot.com. Note that as a side effect this will
// also add this participant to the wave.
wavelet.proxyFor("proxy").reply("\n").append("Douwe says Java rocks!");
// Test inserting inline blip.
Blip inlineBlip = blip.insertInlineBlip(5);
inlineBlip.append("Hello again!");
// Test creating a new wave. The new wave will have its own operation queue.
// {@link AbstractRobot#newWave(String, Set, String, String)} takes a
// {@code message} parameter which can be set to an arbitrary string. By
// setting it to the serialized version of the current wave, we can
// reconstruct the current wave when the other wave is constructed and
// update the current wave.
JsonElement waveletJson = SERIALIZER.toJsonTree(wavelet.serialize());
JsonElement blipJson = SERIALIZER.toJsonTree(blip.serialize());
JsonObject json = new JsonObject();
json.add("wavelet", waveletJson);
json.add("blip", blipJson);
Wavelet newWave = this.newWave(wavelet.getDomain(), wavelet.getParticipants(),
SERIALIZER.toJson(json), null);
newWave.getParticipants().setParticipantRole(wavelet.getCreator(), Participants.Role.READ_ONLY);
newWave.getRootBlip().append("A new day and a new wave");
newWave.getRootBlip().appendMarkup("<p>Some stuff!</p><p>Not the <b>beautiful</b></p>");
// Since the new wave has its own operation queue, we need to submit it
// explicitly through the active gateway, or, as in this case, submit it
// together with wavelet, which will handle the submit automatically.
newWave.submitWith(wavelet);
// Test inserting a form element.
blip.append(new FormElement(ElementType.CHECK, "My Label", "true", "false"));
// Test inserting replies with image.
String imgUrl = "http://upload.wikimedia.org/wikipedia/en/thumb/c/cc/Googlewave.svg/" +
"200px-Googlewave.svg.png";
Blip replyBlip = blip.reply();
replyBlip.append("Hello");
replyBlip.append(new Image(imgUrl, 50, 50, "caption"));
replyBlip.append("\nHello");
replyBlip.append(new Image(imgUrl, 50, 50, "caption"));
replyBlip.append("\nHello");
replyBlip.append(new Image(imgUrl, 50, 50, "caption"));
}