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) { } }
public void testGetAndSetUserOwners() throws Exception { PIPATask task = this.createPIPATask(); task.setUserOwners(new String[] {"test/user1", "test/user2"}); assertTrue(task.getUserOwners().contains("test/user1")); assertTrue(task.getUserOwners().contains("test/user2")); assertFalse(task.getRoleOwners().contains("test/user3")); }
public void testGetAndSetProcessEndpoint() throws Exception { PIPATask task = this.createPIPATask(); URI processEndpoint = new URI("http://localhost/processEndpoint"); task.setProcessEndpointFromString(processEndpoint.toString()); Assert.assertEquals(processEndpoint, task.getProcessEndpoint()); try { task.setProcessEndpointFromString(null); Assert.fail("RequiredArgumentException expected"); } catch (RequiredArgumentException e) { } }
public void testGetAndSetInitOperationSOAPAction() throws Exception { PIPATask task = this.createPIPATask(); String soapAction = "urn:test"; task.setInitOperationSOAPAction(soapAction); Assert.assertEquals(soapAction, task.getInitOperationSOAPAction()); try { task.setInitOperationSOAPAction(null); Assert.fail("RequiredArgumentException expected"); } catch (RequiredArgumentException e) { } }
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) { } }
public void testPIPAEquality() throws Exception { PIPATask task1 = createPIPATask(); TaskEquality.isEqual(task1, task1); PIPATask task2 = createPIPATask(); task2.setCreationDate(new Date()); try { TaskEquality.isEqual(task1, task2); } catch (Exception NotEqualException) { } }