@Test
public void testRemotableChangeTest( ) {
preloadEmptyObject( );
// tests the data object being marked as "remotable".
// emulate that the legacy annotation @Remotable was set for whatever reason. e.g. a project generated in an
// older WB version.
context.getDataObject( ).addAnnotation( DataModelerEditorsTestHelper.createAnnotation( Remotable.class ) );
when( view.getRemotable( ) ).thenReturn( true );
objectEditor.onRemotableChange( );
// the new defined annotation XmlRootElement for marking the data object as "remotable should have been set
assertNotNull( context.getDataObject( ).getAnnotation( XmlRootElement.class.getName( ) ) );
// the legacy annotation should have been removed.
assertNull( context.getDataObject( ).getAnnotation( Remotable.class.getName( ) ) );
// emulate that the legacy annotation @Remotable was set for whatever reason. e.g. a project generated in an
// older WB version.
context.getDataObject( ).addAnnotation( DataModelerEditorsTestHelper.createAnnotation( Remotable.class ) );
// tests the data object being maked as non "remotable".
when( view.getRemotable( ) ).thenReturn( false );
objectEditor.onRemotableChange( );
//the XmlRootElement annotation should have been removed.
assertNull( context.getDataObject( ).getAnnotation( XmlRootElement.class.getName( ) ) );
// the legacy annotation should have been removed.
assertNull( context.getDataObject( ).getAnnotation( Remotable.class.getName( ) ) );
}
DroolsDataObjectEditorTest.java 文件源码
java
阅读 17
收藏 0
点赞 0
评论 0
项目:kie-wb-common
作者:
评论列表
文章目录