use of org.jivesoftware.smackx.softwareinfo.form.SoftwareInfoForm in project Smack by igniterealtime.
the class SoftwareInfoManagerTest method buildSoftwareInfoFromDataForm.
public static SoftwareInfoForm buildSoftwareInfoFromDataForm() throws URISyntaxException {
DataForm.Builder dataFormBuilder = DataForm.builder(DataForm.Type.result);
dataFormBuilder.addField(FormField.buildHiddenFormType(SoftwareInfoForm.FORM_TYPE));
dataFormBuilder.addField(FormField.builder("icon").addFormFieldChildElement(createMediaElement()).build());
dataFormBuilder.addField(FormField.builder("os").setValue("Windows").build());
dataFormBuilder.addField(FormField.builder("os_version").setValue("XP").build());
dataFormBuilder.addField(FormField.builder("software").setValue("Exodus").build());
dataFormBuilder.addField(FormField.builder("software_version").setValue("0.9.1").build());
SoftwareInfoForm softwareInfoForm = SoftwareInfoForm.getBuilder().setDataForm(dataFormBuilder.build()).build();
return softwareInfoForm;
}
use of org.jivesoftware.smackx.softwareinfo.form.SoftwareInfoForm in project Smack by igniterealtime.
the class SoftwareInfoManagerTest method buildSoftwareInfoFormUsingBuilder.
public static SoftwareInfoForm buildSoftwareInfoFormUsingBuilder() throws URISyntaxException {
SoftwareInfoForm.Builder builder = SoftwareInfoForm.getBuilder();
MediaElement mediaElement = createMediaElement();
builder.setIcon(mediaElement);
builder.setOS("Windows");
builder.setOSVersion("XP");
builder.setSoftware("Exodus");
builder.setSoftwareVersion("0.9.1");
return builder.build();
}
use of org.jivesoftware.smackx.softwareinfo.form.SoftwareInfoForm in project Smack by igniterealtime.
the class SoftwareInfoFormTest method createSoftwareInfoFormUsingDataForm.
public static SoftwareInfoForm createSoftwareInfoFormUsingDataForm() throws URISyntaxException {
DataForm.Builder dataFormBuilder = DataForm.builder(DataForm.Type.result);
TextSingleFormField formField = FormField.buildHiddenFormType(SoftwareInfoForm.FORM_TYPE);
dataFormBuilder.addField(formField);
dataFormBuilder.addField(FormField.builder("icon").addFormFieldChildElement(createMediaElement()).build());
dataFormBuilder.addField(FormField.builder("os").setValue("Windows").build());
dataFormBuilder.addField(FormField.builder("os_version").setValue("XP").build());
dataFormBuilder.addField(FormField.builder("software").setValue("Exodus").build());
dataFormBuilder.addField(FormField.builder("software_version").setValue("0.9.1").build());
SoftwareInfoForm softwareInfoForm = SoftwareInfoForm.getBuilder().setDataForm(dataFormBuilder.build()).build();
return softwareInfoForm;
}
use of org.jivesoftware.smackx.softwareinfo.form.SoftwareInfoForm in project Smack by igniterealtime.
the class SoftwareInfoIntegrationTest method test.
@SmackIntegrationTest
public void test() throws Exception {
SoftwareInfoForm softwareInfoSent = createSoftwareInfoForm();
performActionAndWaitForPresence(conTwo, conOne, new ThrowingRunnable() {
@Override
public void runOrThrow() throws Exception {
sim1.publishSoftwareInformationForm(softwareInfoSent);
}
});
SoftwareInfoForm softwareInfoFormReceived = sim2.fromJid(conOne.getUser());
assertEquals(softwareInfoSent, softwareInfoFormReceived);
}
use of org.jivesoftware.smackx.softwareinfo.form.SoftwareInfoForm in project Smack by igniterealtime.
the class SoftwareInfoIntegrationTest method createSoftwareInfoForm.
private static SoftwareInfoForm createSoftwareInfoForm() throws URISyntaxException {
SoftwareInfoForm.Builder builder = SoftwareInfoForm.getBuilder();
MediaElement mediaElement = MediaElement.builder().addUri(new MediaElement.Uri(new URI("http://example.org"), "test-type")).setHeightAndWidth(16, 16).build();
SoftwareInfoForm softwareInfoForm = builder.setIcon(mediaElement).setOS("Linux").setOSVersion("Debian").setSoftware("Gajim").setSoftwareVersion("1.4.0").build();
return softwareInfoForm;
}
Aggregations