Search in sources :

Example 1 with NamingMixIn

use of org.switchyard.component.test.mixins.naming.NamingMixIn in project quickstarts by jboss-switchyard.

the class CamelJpaBindingTest method beforeClass.

@BeforeClass
public static void beforeClass() throws Exception {
    namingMixIn = new NamingMixIn();
    namingMixIn.initialize();
    connection = DriverManager.getConnection("jdbc:h2:mem:events-jpa-quickstart", "sa", "sa");
    JdbcDataSource ds = new JdbcDataSource();
    ds.setURL("jdbc:h2:mem:events-jpa-quickstart");
    ds.setUser("sa");
    ds.setPassword("sa");
    InitialContext initialContext = new InitialContext();
    bind(initialContext, System.getProperty("jpa.persistence.datasource.name"), ds);
}
Also used : JdbcDataSource(org.h2.jdbcx.JdbcDataSource) NamingMixIn(org.switchyard.component.test.mixins.naming.NamingMixIn) InitialContext(javax.naming.InitialContext) BeforeClass(org.junit.BeforeClass)

Example 2 with NamingMixIn

use of org.switchyard.component.test.mixins.naming.NamingMixIn in project quickstarts by jboss-switchyard.

the class QpidServer method main.

public static void main(String[] args) throws Exception {
    NamingMixIn namingMixIn = new NamingMixIn();
    namingMixIn.initialize();
    AMQPMixIn mixIn = new AMQPMixIn();
    mixIn.initialize();
    System.in.read();
    // clean up
    mixIn.uninitialize();
    namingMixIn.uninitialize();
}
Also used : AMQPMixIn(org.switchyard.test.mixins.amqp.AMQPMixIn) NamingMixIn(org.switchyard.component.test.mixins.naming.NamingMixIn)

Example 3 with NamingMixIn

use of org.switchyard.component.test.mixins.naming.NamingMixIn in project quickstarts by jboss-switchyard.

the class CamelSqlBindingTest method startUp.

@BeforeClass
public static void startUp() throws Exception {
    dataSource = new JdbcDataSource();
    dataSource.setURL("jdbc:h2:mem:test");
    dataSource.setUser("sa");
    dataSource.setPassword("sa");
    connection = dataSource.getConnection();
    String createStatement = "CREATE TABLE greetings (" + "id INT PRIMARY KEY AUTO_INCREMENT, " + "receiver VARCHAR(255), " + "sender VARCHAR(255) " + ");";
    connection.createStatement().executeUpdate("DROP TABLE IF EXISTS greetings");
    connection.createStatement().executeUpdate(createStatement);
    namingMixIn = new NamingMixIn();
    namingMixIn.initialize();
    bindDataSource(namingMixIn.getInitialContext(), "java:jboss/myDS", dataSource);
}
Also used : JdbcDataSource(org.h2.jdbcx.JdbcDataSource) NamingMixIn(org.switchyard.component.test.mixins.naming.NamingMixIn) BeforeClass(org.junit.BeforeClass)

Aggregations

NamingMixIn (org.switchyard.component.test.mixins.naming.NamingMixIn)3 JdbcDataSource (org.h2.jdbcx.JdbcDataSource)2 BeforeClass (org.junit.BeforeClass)2 InitialContext (javax.naming.InitialContext)1 AMQPMixIn (org.switchyard.test.mixins.amqp.AMQPMixIn)1