Exemplo n.º 1
0
  /** Test object creation with factory. */
  @Test(timeout = 1000)
  public void testFactory() {
    FBindingOperation bindingOperation = null;
    FBindingOperationInputMessage input = new FBindingOperationInputMessage("input");
    FBindingOperationOutputMessage output = new FBindingOperationOutputMessage("output");
    FBindingOperationFaultMessage fault = new FBindingOperationFaultMessage("fault");
    HashSet<FBindingOperationFaultMessage> faults = new HashSet<FBindingOperationFaultMessage>();
    faults.add(fault);

    // Test first create()
    bindingOperation =
        FBindingOperation.factory.create("foo", FOperationType.ONE_WAY, input, output);

    assertNotNull("FBindingOperation object must not be null.", bindingOperation);
    assertEquals(
        "Binding operation name must match initial value.",
        "foo",
        bindingOperation.getBindingOperationName());

    // Test second create
    bindingOperation =
        FBindingOperation.factory.create("bar", FOperationType.ONE_WAY, input, output, faults);

    assertNotNull("FBindingOperation object must not be null.", bindingOperation);
    assertEquals(
        "Binding operation name must match initial value.",
        "bar",
        bindingOperation.getBindingOperationName());
  }
Exemplo n.º 2
0
  /** Test setter and getter methods. */
  @Test(timeout = 1000)
  public void testSetterGetter() {
    FBindingOperationInputMessage input = new FBindingOperationInputMessage("input");
    FBindingOperationOutputMessage output = new FBindingOperationOutputMessage("output");
    FBindingOperation bindingOperation =
        FBindingOperation.factory.create("foo", FOperationType.ONE_WAY, input, output);

    // Test operation name
    bindingOperation.setBindingOperationName("bar");
    assertEquals(
        "Binding operation name must match new value.",
        "bar",
        bindingOperation.getBindingOperationName());

    // Test operation input
    bindingOperation.setInputMessage(new FBindingOperationInputMessage("newInput"));
    assertEquals(
        "Binding operation input message name must match new value.",
        "newInput",
        bindingOperation.getInputMessage().getBindingOperationMessageName());

    // Test operation output
    bindingOperation.setOutputMessage(new FBindingOperationOutputMessage("newOutput"));
    assertEquals(
        "Binding operation output message name must match new value.",
        "newOutput",
        bindingOperation.getOutputMessage().getBindingOperationMessageName());
  }