コード例 #1
0
  /** Test isDataFlavorSupported, with correct dataFlavor. */
  public void testIsDataFlavorSupported() {
    Generalization generalizationElement = new GeneralizationImpl();
    ClassElementsTransfer classElementsTransfer = new ClassElementsTransfer(generalizationElement);

    assertTrue(
        "Should be GENERALIZATION_FLAVOR",
        classElementsTransfer.isDataFlavorSupported(ClassElementsTransfer.GENERALIZATION_FLAVOR));
    assertFalse(
        "Should not be DEPENDENCY_FLAVOR",
        classElementsTransfer.isDataFlavorSupported(ClassElementsTransfer.DEPENDENCY_FLAVOR));
  }
コード例 #2
0
  /** Test lostOwnership, with null dataFlavor. IllegalArgumentException is expected. */
  public void testIsDataFlavorSupportedWithNull() {
    try {
      Generalization generalizationElement = new GeneralizationImpl();
      ClassElementsTransfer classElementsTransfer =
          new ClassElementsTransfer(generalizationElement);

      classElementsTransfer.isDataFlavorSupported(null);

      fail("IllegalArgumentException is expected.");
    } catch (IllegalArgumentException iae) {
      // pass
    }
  }