Package org.jboss.soa.esb.addressing.eprs

Examples of org.jboss.soa.esb.addressing.eprs.JDBCEpr


  public void testConstructor ()
  {
    try
    {
      new JDBCEpr("jdbc:arjuna:oracle:thin", "CREATE TABLE foo");
    }
    catch (Exception ex)
    {
      fail(ex.toString());
    }
View Full Code Here


 
  public void testSetGet ()
  {
    try
    {
      JDBCEpr em = new JDBCEpr("jdbc:arjuna:oracle:thin", "CREATE TABLE foo");
     
      assertEquals(em.getURL(), "jdbc:arjuna:oracle:thin");
      assertEquals(em.getSQL(), "CREATE TABLE foo");
     
      em.setURL("jdbc:arjuna:oracle:thin");
      assertEquals(em.getURL(), "jdbc:arjuna:oracle:thin");
     
      em.setUserName("me");
      assertEquals(em.getUserName(), "me");
     
      em.setPassword("foobar");
      assertEquals(em.getPassword(), "foobar");
     
      try
      {
        em.setSQL("INVALID");
       
        fail();
      }
      catch (IllegalStateException ex)
      {
      }
      catch (Exception ex)
      {
        fail(ex.toString());
      }
     
      em.setDriver("cloudscape");
      assertEquals(em.getDriver(), "cloudscape");
    }
    catch (Exception ex)
    {
      fail(ex.toString());
    }
View Full Code Here

  @Test
    public void testJdbcReplyEpr() throws MalformedEPRException, CourierException, URISyntaxException, CourierTimeoutException {
      _logger.info("_________________________________________");
      _logger.info("testJdbcReplyEpr() invoked");
        //  Send a Message that will be picked up by a listener, and specify replyTo
        JDBCEpr toEpr = getEpr("foo");
        JDBCEpr replyToEpr = (JDBCEpr)DefaultReplyTo.getReplyTo(toEpr);

        String text_1 = "Outgoing";
        Message outgoingMsg = MessageFactory.getInstance().getMessage();
        outgoingMsg.getHeader().getCall().setTo(toEpr);
        outgoingMsg.getHeader().getCall().setReplyTo(replyToEpr);
        outgoingMsg.getBody().add(text_1.getBytes());
        CourierUtil.deliverMessage(outgoingMsg);

        // Mock a service that picks up the original message and replies
        JDBCEpr serviceEpr = getEpr("foo");
        PickUpOnlyCourier listener = CourierFactory.getPickupCourier(serviceEpr);
        Message received = listener.pickup(100);
        String text_2 = new String((byte[]) received.getBody().get());
        assertTrue(text_1.equals(text_2));
//          assertTrue(replyToEpr.equals(received.getHeader().getCall().getReplyTo()));
View Full Code Here

    private static void createMessageTable(String tableName) throws Exception
    {
      try
      {
        dropTable(tableName);
        JDBCEpr epr = getEpr(tableName);
        StringBuilder sb = new StringBuilder("create table ").append(tableName)
          .append("(").append(epr.getMessageIdColumn())  .append(" varchar")
          .append(",").append(epr.getStatusColumn())    .append(" varchar")
          .append(",").append(epr.getTimestampColumn())  .append(" bigint")
          .append(",").append(epr.getDataColumn())    .append(" varchar")
          .append(")")
        ;
        _dbConn.execUpdWait(_dbConn.prepareStatement(sb.toString()),1);
            _dbConn.commit();
      }
View Full Code Here

      }
    }
   
    private static JDBCEpr getEpr(String tableName) throws URISyntaxException
    {
    JDBCEpr epr = new JDBCEpr(mDbUrl,true,true);
    epr.setDriver  (mDbDriver);
    epr.setUserName  (mDbUsername);
    epr.setPassword  (mDbPassword);

    epr.setTableName    (tableName);
    epr.setMessageIdColumn  ("message_id_col");
    epr.setStatusColumn    ("status_col");
    epr.setDataColumn    ("data_col");
    epr.setTimestampColumn  ("stamp_col");

    return epr;
    }
View Full Code Here

  {
    Message msg = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);

    try
    {
      JDBCEpr epr = new JDBCEpr("http://www.foo.bar", "SOME FAKE SQL");
     
      msg.getHeader().getCall().setTo(epr);
     
      ByteArrayOutputStream s = new ByteArrayOutputStream();
      ObjectOutputStream o = new ObjectOutputStream(s);
View Full Code Here

        if (addr.startsWith(InVMEpr.INVM_PROTOCOL))
            return new InVMCourier(new InVMEpr(epr));
    if (addr.startsWith(JMSEpr.JMS_PROTOCOL))
      return new JmsCourier(new JMSEpr(epr), pickUpOnly);
    if (addr.startsWith(JDBCEpr.JDBC_PROTOCOL))
      return new SqlTableCourier(new JDBCEpr(epr), pickUpOnly);
    // TODO magic strings
    if (addr.startsWith("file://") || addr.startsWith("ftp://")
        || addr.startsWith("sftp://") || addr.startsWith("ftps://"))
      return new FileCourier(new FileEpr(epr), pickUpOnly);
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.addressing.eprs.JDBCEpr

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.