Package org.camunda.bpm.engine.variable.value

Examples of org.camunda.bpm.engine.variable.value.ObjectValue


    verify(historicDetailQueryMock, never()).disableCustomObjectDeserialization();
  }

  @Test
  public void testGetSingleVariableUpdateSerialized() {
    ObjectValue serializedValue = Variables.serializedObjectValue("a serialized value")
        .serializationDataFormat("aDataFormat").objectTypeName("aTypeName").create();

    MockHistoricVariableUpdateBuilder builder = MockProvider.mockHistoricVariableUpdate().typedValue(serializedValue);
    HistoricVariableUpdate variableInstanceMock = builder.build();
View Full Code Here


    Assert.assertEquals(MockProvider.EXAMPLE_HISTORIC_FORM_FIELD_VALUE, returnedFieldValue);
  }

  @Test
  public void testSerializableVariableInstanceRetrieval() {
    ObjectValue serializedValue = Variables.serializedObjectValue("a serialized value").create();
    MockHistoricVariableUpdateBuilder builder = MockProvider.mockHistoricVariableUpdate()
        .typedValue(serializedValue);

    List<HistoricDetail> details = new ArrayList<HistoricDetail>();
    details.add(builder.build());

    mockedQuery = setUpMockedDetailsQuery(details);

    given()
        .then().expect().statusCode(Status.OK.getStatusCode())
        .and()
          .body("[0].value", equalTo("a serialized value"))
          .body("[0].variableType", equalTo(VariableTypeHelper.toExpectedValueTypeName(serializedValue.getType())))
          .body("[0].errorMessage", nullValue())
        .when().get(HISTORIC_DETAIL_RESOURCE_URL);

    // should not resolve custom objects but existing API requires it
//  verify(mockedQuery).disableCustomObjectDeserialization();
View Full Code Here

    when(mockVariable.getId()).thenReturn(id);
    when(mockVariable.getVariableName()).thenReturn(name);
    when(mockVariable.getVariableTypeName()).thenReturn(typedValue.getType().getName());

    if (ObjectValue.class.isAssignableFrom(typedValue.getClass())) {
      ObjectValue objectValue = (ObjectValue) typedValue;
      if (objectValue.isDeserialized()) {
        when(mockVariable.getValue()).thenReturn(typedValue.getValue());
      } else {
        when(mockVariable.getValue()).thenReturn(null);
      }
    } else {
View Full Code Here

  public void testGetLocalObjectVariables() {
    // given
    String variableKey = "aVariableId";

    List<String> payload = Arrays.asList("a", "b");
    ObjectValue variableValue =
        MockObjectValue
            .fromObjectValue(Variables
                .objectValue(payload)
                .serializationDataFormat("application/json")
                .create())
View Full Code Here

  @Test
  public void testGetLocalObjectVariablesSerialized() {
    // given
    String variableKey = "aVariableId";

    ObjectValue variableValue =
        Variables
          .serializedObjectValue("a serialized value")
          .serializationDataFormat("application/json")
          .objectTypeName(ArrayList.class.getName())
          .create();
View Full Code Here

  public void testGetSingleLocalObjectVariable() {
    // given
    String variableKey = "aVariableId";

    List<String> payload = Arrays.asList("a", "b");
    ObjectValue variableValue =
        MockObjectValue
            .fromObjectValue(Variables
                .objectValue(payload)
                .serializationDataFormat("application/json")
                .create())
View Full Code Here

  @Test
  public void testGetSingleLocalObjectVariableSerialized() {
    // given
    String variableKey = "aVariableId";

    ObjectValue variableValue =
        Variables
          .serializedObjectValue("a serialized value")
          .serializationDataFormat("application/json")
          .objectTypeName(ArrayList.class.getName())
          .create();
View Full Code Here

    when(mockVariable.getVariableName()).thenReturn(name);
    when(mockVariable.getTypeName()).thenReturn(value.getType().getName());
    when(mockVariable.getVariableTypeName()).thenReturn(value.getType().getName());

    if (ObjectValue.class.isAssignableFrom(value.getClass())) {
      ObjectValue objectValue = (ObjectValue) value;
      if (objectValue.isDeserialized()) {
        when(mockVariable.getValue()).thenReturn(value.getValue());
      } else {
        when(mockVariable.getValue()).thenReturn(null);
      }
    } else {
View Full Code Here

    if (!ObjectValue.class.isAssignableFrom(argument.getClass())) {
      return false;
    }

    ObjectValue objectValue = (ObjectValue) argument;

    if (isDeserialized) {
      if (!objectValue.isDeserialized()) {
        return false;
      }

      if (value == null) {
        if (objectValue.getValue() != null) {
          return false;
        }
      } else {
        if (!value.equals(objectValue.getValue())) {
          return false;
        }
      }

    } else {
      if (objectValue.isDeserialized()) {
        return false;
      }


      if (serializationFormat == null) {
        if (objectValue.getSerializationDataFormat() != null) {
          return false;
        }
      } else {
        if (!serializationFormat.equals(objectValue.getSerializationDataFormat())) {
          return false;
        }
      }

      if (objectTypeName == null) {
        if (objectValue.getObjectTypeName() != null) {
          return false;
        }
      } else {
        if (!objectTypeName.equals(objectValue.getObjectTypeName())) {
          return false;
        }
      }

      if (serializedValue == null) {
        if (objectValue.getValueSerialized() != null) {
          return false;
        }
      } else {
        if (!serializedValue.equals(objectValue.getValueSerialized())) {
          return false;
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.camunda.bpm.engine.variable.value.ObjectValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.