Ejemplo n.º 1
0
  public void testPIPATask() throws Exception {
    String id = "taskID";
    URI formURL = new URI("http://localhost/form");
    URI processEndpoint = new URI("http://localhost/process-endpoint");
    URI namespace = new URI("urn:initNS");
    String soapAction = "urn:initSOAPAction";

    PIPATask task = new PIPATask(id, formURL, processEndpoint, namespace, soapAction);
    Assert.assertEquals(processEndpoint, task.getProcessEndpoint());
    Assert.assertEquals(namespace, task.getInitMessageNamespaceURI());
    Assert.assertEquals(soapAction, task.getInitOperationSOAPAction());

    try {
      PIPATask task1 = new PIPATask(id, formURL, null, namespace, soapAction);
      task1.getProcessEndpoint();
      Assert.fail("IllegalStateException expected");
    } catch (IllegalStateException e) {

    }
    try {
      PIPATask task1 = new PIPATask(id, formURL, processEndpoint, null, soapAction);
      task1.getInitMessageNamespaceURI();
      Assert.fail("IllegalStateException expected");
    } catch (IllegalStateException e) {

    }
    try {
      PIPATask task1 = new PIPATask(id, formURL, processEndpoint, namespace, null);
      task1.getInitOperationSOAPAction();
      Assert.fail("IllegalStateException expected");
    } catch (IllegalStateException e) {

    }
  }
Ejemplo n.º 2
0
  public void testGetAndSetInitMessageNamespaceURI() throws Exception {
    PIPATask task = this.createPIPATask();
    URI nsURI = new URI("urn:test");
    task.setInitMessageNamespaceURI(nsURI);
    Assert.assertEquals(nsURI, task.getInitMessageNamespaceURI());
    try {
      task.setInitMessageNamespaceURI(null);
      Assert.fail("RequiredArgumentException expected");
    } catch (RequiredArgumentException e) {

    }
  }