org.kie.workbench.common.stunner.core.graph.content.definition.Definition.setDefinition()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(179)

本文整理了Java中org.kie.workbench.common.stunner.core.graph.content.definition.Definition.setDefinition()方法的一些代码示例,展示了Definition.setDefinition()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Definition.setDefinition()方法的具体详情如下:
包路径:org.kie.workbench.common.stunner.core.graph.content.definition.Definition
类名称:Definition
方法名:setDefinition

Definition.setDefinition介绍

暂无

代码示例

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common

@Test
@SuppressWarnings("unchecked")
public void testExecute() {
  final CommandResult<RuleViolation> result = tested.execute(graphCommandExecutionContext);
  assertEquals(CommandResult.Type.INFO,
         result.getType());
  verify(content).setDefinition(eq(NEW_DEFINITION));
  assertEquals(2, labels.size());
  assertTrue(labels.contains(NEW_DEFINITION_ID));
  assertTrue(labels.contains(NEW_DEFINITION_LABEL));
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common

@Test
  @SuppressWarnings("unchecked")
  public void testUndo() {
    //Execute command and mock new state
    tested.execute(graphCommandExecutionContext);
    reset(content);
    when(content.getDefinition()).thenReturn(NEW_DEFINITION);

    final CommandResult<RuleViolation> result = tested.undo(graphCommandExecutionContext);
    assertEquals(CommandResult.Type.INFO,
           result.getType());

    verify(content).setDefinition(eq(CURRENT_DEFINITION));
    assertEquals(1, labels.size());
    assertTrue(labels.contains(CURRENT_DEFINITION_ID));
  }
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common

candidate.getContent().setDefinition(newDef);

相关文章