DroolsDataObjectEditorTest.java 文件源码

java
阅读 17 收藏 0 点赞 0 评论 0

项目:kie-wb-common 作者:
@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( ) ) );
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号