RadioButton extends FormControl { public void setValue(String value) { ((FormRadioElement) mElement).setFormValueAttribute(value); } RadioButton(FormRadioElement element); static RadioButton getInstanceOf(FormRadioElement element); @Override void setControlImplementation(String controlImpl); @Override String getId(); @Override void setId(String id); void setLabel(String label); String getLabel(); @Override String getName(); @Override void setName(String name); String getValue(); void setValue(String value); void setDefaultSelected(boolean isSelected); boolean getDefaultSelected(); void setCurrentSelected(boolean isSelected); boolean getCurrentSelected(); static Iterator<FormControl> getSimpleIterator(Form container);  }
@Test public void testSetValue() { try { TextDocument textDoc = TextDocument.loadDocument(ResourceUtilities .getTestResourceAsStream("TestCreateRadioButton.odt")); Form form = textDoc.getFormByName("Test Form"); Iterator<FormControl> iterator = RadioButton .getSimpleIterator(form); RadioButton find = null; while (iterator.hasNext()) { RadioButton radio = (RadioButton) iterator.next(); if (radio.getLabel().equals("RadioButton 1")) { find = radio; break; } } Assert.assertNotNull(find); Assert.assertEquals("1", find.getValue()); find.setValue("15"); Assert.assertEquals("15", find.getValue()); textDoc.save(ResourceUtilities .newTestOutputFile("TestSetRadioButtonValue.odt")); } catch (Exception e) { Logger.getLogger(RadioButtonTest.class.getName()).log(Level.SEVERE, null, e); Assert.fail(); } }