/** 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)); }
/** 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 } }