@Override public boolean completeEquals(final Object obj) { return Function.class.isInstance(obj) && super.completeEquals(obj) && Objects.equal(((Function) obj).getFunctionType(), getFunctionType()) && Objects.equal(((Function) obj).getParameters(), getParameters()) && Objects.equal(((Function) obj).getFunctionDescription(), getFunctionDescription()); } }
/** * {@inheritDoc} */ @Override public void updateObjectInternal(final FUNCTIONIMPL object, final FUNCTIONIMPL updateObject) throws DMPPersistenceException { final LinkedList<String> parameters = object.getParameters(); updateObject.setParameters(parameters); updateObject.setFunctionDescription(object.getFunctionDescription()); super.updateObjectInternal(object, updateObject); }
private static Function checkFunction(final Component component, final String uuid, final String name, final String description, final String... parameters) { final Function function = component.getFunction(); MatcherAssert.assertThat(function, Matchers.is(Matchers.notNullValue())); MatcherAssert.assertThat(function.getUuid(), Matchers.equalTo(uuid)); MatcherAssert.assertThat(function.getName(), Matchers.equalTo(name)); MatcherAssert.assertThat(function.getDescription(), Matchers.equalTo(description)); MatcherAssert.assertThat(function.getFunctionType(), Matchers.equalTo(FunctionType.Function)); MatcherAssert.assertThat(function.getParameters(), Matchers.hasItems(parameters)); return function; } }
/** * {@inheritDoc}<br/> * Updates the name, description, parameters and machine processable function description of the function. */ @Override protected POJOCLASS prepareObjectForUpdate(final POJOCLASS objectWithUpdates, final POJOCLASS object) { super.prepareObjectForUpdate(objectWithUpdates, object); object.setFunctionDescription(objectWithUpdates.getFunctionDescription()); object.setParameters(objectWithUpdates.getParameters()); return object; } }
Assert.assertNotNull("the function parameters shouldn't be null", function.getParameters()); Assert.assertEquals("the function parameters' size are not equal", 1, function.getParameters().size()); Assert.assertEquals("the function parameter '" + functionParameter + "' are not equal", functionParameter, function.getParameters().get(0));
Assert.assertEquals("the " + pojoClassName + " parameters should be equal", expectedObject.getParameters(), actualObject.getParameters());
Assert.assertEquals("the transformation descriptions are not equal", transformationDescription, mapping.getTransformation().getFunction() .getDescription()); Assert.assertEquals("the transformation parameters' size are not equal", 1, mapping.getTransformation().getFunction().getParameters().size()); Assert.assertTrue("the transformation parameters doesn't contain transformation parameter '" + transformationParameter + "'", mapping .getTransformation().getFunction().getParameters().contains(transformationParameter)); Assert.assertEquals("the transformation parameter for '" + transformationParameter + "' are not equal", transformationParameter, mapping .getTransformation().getFunction().getParameters().iterator().next()); Assert.assertNotNull("the transformation components set shouldn't be null", ((Transformation) mapping.getTransformation().getFunction()).getComponents());
Assert.assertEquals("the transformation descriptions are not equal", transformationDescription, mapping.getTransformation().getFunction() .getDescription()); Assert.assertEquals("the transformation parameters' size are not equal", 1, mapping.getTransformation().getFunction().getParameters().size()); Assert.assertTrue("the transformation parameters doesn't contain transformation parameter '" + transformationParameter + "'", mapping .getTransformation().getFunction().getParameters().contains(transformationParameter)); Assert.assertEquals("the transformation parameter for '" + transformationParameter + "' are not equal", transformationParameter, mapping .getTransformation().getFunction().getParameters().iterator().next()); Assert.assertNotNull("the transformation components set shouldn't be null", ((Transformation) mapping.getTransformation().getFunction()).getComponents());
Assert.assertEquals("the transformation descriptions are not equal", transformationDescription, mapping.getTransformation().getFunction() .getDescription()); Assert.assertEquals("the transformation parameters' size are not equal", 1, mapping.getTransformation().getFunction().getParameters().size()); Assert.assertTrue("the transformation parameters doesn't contain transformation parameter '" + transformationParameter + "'", mapping .getTransformation().getFunction().getParameters().contains(transformationParameter)); Assert.assertEquals("the transformation parameter for '" + transformationParameter + "' are not equal", transformationParameter, mapping .getTransformation().getFunction().getParameters().iterator().next()); Assert.assertNotNull("the transformation components set shouldn't be null", ((Transformation) mapping.getTransformation().getFunction()).getComponents());
Assert.assertEquals("the transformation descriptions are not equal", transformationDescription, mapping.getTransformation().getFunction() .getDescription()); Assert.assertEquals("the transformation parameters' size are not equal", 1, mapping.getTransformation().getFunction().getParameters().size()); Assert.assertTrue("the transformation parameters doesn't contain transformation parameter '" + transformationParameter + "'", mapping .getTransformation().getFunction().getParameters().contains(transformationParameter)); Assert.assertEquals("the transformation parameter for '" + transformationParameter + "' are not equal", transformationParameter, mapping .getTransformation().getFunction().getParameters().iterator().next()); Assert.assertNotNull("the transformation components set shouldn't be null", ((Transformation) mapping.getTransformation().getFunction()).getComponents());
Assert.assertEquals("the transformation descriptions are not equal", transformationDescription, mapping.getTransformation().getFunction() .getDescription()); Assert.assertEquals("the transformation parameters' size are not equal", 1, mapping.getTransformation().getFunction().getParameters().size()); Assert.assertTrue("the transformation parameters doesn't contain transformation parameter '" + transformationParameter + "'", mapping .getTransformation().getFunction().getParameters().contains(transformationParameter)); Assert.assertEquals("the transformation parameter for '" + transformationParameter + "' are not equal", transformationParameter, mapping .getTransformation().getFunction().getParameters().iterator().next()); Assert.assertNotNull("the transformation components set shouldn't be null", ((Transformation) mapping.getTransformation().getFunction()).getComponents());