Examples of WsInformation


Examples of main.java.org.squidy.WsInformation

public class WsInformationTest extends AbstractXmlTest
{
  public void testNewEmptyConfigration() throws IOException, ParsingException
  {
    Document expectedDoc = XmlUtil.loadDocument(WsInformation.class.getResource("/main/resources/ws/ws-deployed-empty.xml"));
    WsInformation ws = WsInformation.newEmptyConfiguration();
    assertDocumentEquals(expectedDoc , ws.getDocument());
  }
View Full Code Here

Examples of main.java.org.squidy.WsInformation

  public void testAddWs() throws IOException, ParsingException
  {
    Document doc1 = XmlUtil.loadDocument(WsInformation.class.getResource("/test/resources/ws/ws-1.xml"));
    Document expectedDoc = XmlUtil.loadDocument(WsInformation.class.getResource("/test/resources/ws/ws-expected-1.xml"));

    WsInformation ws1 = new WsInformation(doc1);

    // Add a ws with a Mule name that already exists
    try
    {
      ws1.addWs(WS_1);
      fail(EXPECT_ILLEGAL_ARGUMENT_EXCEPTION);
    }
    catch (IllegalStateException e)
    {
    }

    // Add a good ws with a description
    ws1.addWs(WS_2);
    assertDocumentEquals(expectedDoc , doc1);

    //add a WS with a description to an empty document
    WsInformation ws2 = WsInformation.newEmptyConfiguration();

    ws2.addWs(WS_1);
    ws2.addWs(WS_2);

    assertDocumentEquals(expectedDoc , ws2.getDocument());
 
  }
View Full Code Here

Examples of main.java.org.squidy.WsInformation

  public void testRemoveWs() throws IOException, ParsingException
  {
    Document doc1 = XmlUtil.loadDocument(WsInformation.class.getResource("/test/resources/ws/ws-expected-1.xml"));
    Document expectedDoc = XmlUtil.loadDocument(WsInformation.class.getResource("/test/resources/ws/ws-expected-2.xml"));

    WsInformation ws1 = new WsInformation(doc1);

    // Remove a ws that does not exist
    try
    {
      ws1.removeWs(WS_5);
      fail(EXPECT_ILLEGAL_ARGUMENT_EXCEPTION);
    }
    catch (IllegalStateException e)
    {
    }

    ws1.removeWs(WS_1);
    assertDocumentEquals(expectedDoc , doc1);
  }
View Full Code Here

Examples of main.java.org.squidy.WsInformation


  public void testGetPath() throws IOException, ParsingException
  {
    Document doc = XmlUtil.loadDocument(WsInformation.class.getResource("/test/resources/ws/ws-expected-1.xml"));
    WsInformation ws = new WsInformation(doc);

    // get a ws's path that does not exist
    try
    {
      ws.getPath(NAME_3);
      fail(EXPECT_ILLEGAL_ARGUMENT_EXCEPTION);
    }
    catch (IllegalStateException e)
    {
    }
    assertEquals(ws.getPath(NAME_2),PATH_1);
  }
View Full Code Here

Examples of main.java.org.squidy.WsInformation


  public void testGetContainerName()throws IOException, ParsingException
  {
    Document doc = XmlUtil.loadDocument(WsInformation.class.getResource("/test/resources/ws/ws-expected-1.xml"));
    WsInformation ws = new WsInformation(doc);

    // get a ws's path that does not exist
    try
    {
      ws.getContainerName(NAME_3);
      fail(EXPECT_ILLEGAL_ARGUMENT_EXCEPTION);
    }
    catch (IllegalStateException e)
    {
    }
    assertEquals(ws.getContainerName(NAME_1),CONTAINERNAME_1);
  }
View Full Code Here

Examples of main.java.org.squidy.WsInformation


  public void testGetDescription()throws IOException, ParsingException
  {
    Document doc = XmlUtil.loadDocument(WsInformation.class.getResource("/test/resources/ws/ws-expected-1.xml"));
    WsInformation ws = new WsInformation(doc);

    // get a ws's path that does not exist
    try
    {
      ws.getDescription(NAME_3);
      fail(EXPECT_ILLEGAL_ARGUMENT_EXCEPTION);
    }
    catch (IllegalStateException e)
    {
    }
    assertEquals(ws.getDescription(NAME_2),DESCRIPTION_1);
  }
View Full Code Here

Examples of main.java.org.squidy.WsInformation


  public void testGetAllInformation()throws IOException, ParsingException
  {
    Document doc = XmlUtil.loadDocument(WsInformation.class.getResource("/test/resources/ws/ws-2.xml"));
    WsInformation ws = new WsInformation(doc);

    final List<List<String>> List = new LinkedList<List<String>>();
    List.add(MULE_DESCRIPTION_3);
    List.add(MULE_DESCRIPTION_4);

    final List<List<String>> expectedList = new LinkedList<List<String>>();
    final List<String> l1 = Arrays.asList("name1", "endpoint1", "containername1", "containeradress1", "path1", null);
    final List<String> l2 = Arrays.asList("name2", "endpoint2", "containername2", "containeradress2", "path2", "description2");
    expectedList.add(l1);
    expectedList.add(l2);

    assertEquals(expectedList, ws.getAllInformation(List));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.