SwtGroupbox extends SwtBox implements XulGroupbox { public void setCaption( String caption ) { if ( label != null ) { label.setValue( caption ); } } SwtGroupbox( Element self, XulComponent parent, XulDomContainer container, String tagName ); void setCaption( String caption );  }
@Test public void testSetCaption() throws Exception { SwtGroupbox groupBox = (SwtGroupbox) container.getDocumentRoot().getElementById( "database-options-box" ); String expectedCaptionText = "someText"; groupBox.setCaption( expectedCaptionText ); assertEquals(expectedCaptionText, groupBox.label.getValue()); }
@Test(expected = Test.None.class ) public void testSetCaptionNullLabel() throws Exception { SwtGroupbox groupBox = (SwtGroupbox) container.getDocumentRoot().getElementById( "database-options-box" ); groupBox.label = null; groupBox.setCaption( "someText" ); }