protected boolean isMatch(EObject source, EObject target) { if (source.getClass().equals(target.getClass())) { return false; } else if (source instanceof UsesPortStub) { return InterfacesUtil.areSuggestedMatch((UsesPortStub) source, target); } else if (target instanceof UsesPortStub) { return InterfacesUtil.areSuggestedMatch((UsesPortStub) target, source); } return false; }
/** IDE-1430 Objects for external ports (@link Port) should be gracefully refused. */ @Test public void externalPort() { UsesPortStub source = getUsesPortStub(SIGGEN_1, SIGGEN_FLOAT_OUT); Port target = this.sad.getExternalPorts().getPort().get(0); Assert.assertNotNull(target); Assert.assertFalse(InterfacesUtil.areCompatible(source, target)); }
/** Tests uses port -> provides port, of different types */ @Test public void usesToProvides_differentTypes() { UsesPortStub source = getUsesPortStub(SIGGEN_1, SIGGEN_SHORT_OUT); ProvidesPortStub target = getProvidesPortStub(HARDLIMIT_1, HARDLIMIT_FLOAT_IN); Assert.assertFalse(InterfacesUtil.areCompatible(source, target)); }