Package org.apache.openejb.testng

Examples of org.apache.openejb.testng.PropertiesBuilder


@RunWith(ApplicationComposer.class)
public class ServiceInfosTest {
    @Configuration
    public Properties config() {
        return new PropertiesBuilder().p("ds", "new://Resource?type=DataSource").build();
    }
View Full Code Here


@RunWith(ApplicationComposer.class)
public class CustomInjectionTest {
    @Configuration
    public Properties configuration() {
        return new PropertiesBuilder()

            .property("concurrent/es", "new://Resource?type=ManagedExecutorService")
            .property("concurrent/es.core", "2")
            .property("concurrent/es.max", "10")
            .property("concurrent/es.keepAlive", "4 minutes")
View Full Code Here

    private int port;

    @Configuration
    public Properties randomPort() {
        port = NetworkUtil.getNextAvailablePort();
        return new PropertiesBuilder().p("httpejbd.port", Integer.toString(port)).build();
    }
View Full Code Here

        return new WebApp().contextRoot("web");
    }

    @Configuration
    public Properties config() {
        return new PropertiesBuilder().p("openejb.hessian." + MyCdiHessianService.class.getName() + "_" + CdiService.class.getName() + ".path", "foo").build();
    }
View Full Code Here

    }

    @Test
    public void client() throws Exception {
        final MyApi client = MyApi.class.cast(
                new InitialContext(new PropertiesBuilder()
                        .p(Context.INITIAL_CONTEXT_FACTORY, HessianInitialContextFactory.class.getName())
                        .p(Context.PROVIDER_URL, "http://127.0.0.1:4204/HessianInitialContextTest/hessian/")
                        .build())
                    .lookup("Server"));
View Full Code Here

        return new EjbJar();
    }

    @Configuration
    public Properties props() {
        return new PropertiesBuilder()
            .p("openejb.jdbc.datasource-creator", BoneCPDataSourceCreator.class.getName())

            .p("txMgr", "new://TransactionManager?type=TransactionManager")
            .p("txMgr.txRecovery", "true")
            .p("txMgr.logFileDir", "target/test/xa/howl")
View Full Code Here

@RunWith(ApplicationComposer.class)
public class CustomInjectionTest {
    @Configuration
    public Properties configuration() {
        return new PropertiesBuilder()

                .property("concurrent/es", "new://Resource?type=ManagedExecutorService")
                .property("concurrent/es.core", "2")
                .property("concurrent/es.max", "10")
                .property("concurrent/es.keepAlive", "4 minutes")
View Full Code Here

        }
    }

    @Configuration
    public Properties configuration() {
        return datasource(datasource(new PropertiesBuilder(), "fo1"), "fo2")
                .property("fo1.JtaManaged", "true")
                .property("fo2.JtaManaged", "true")
                .property("router", "new://Resource?class-name=" + FailOverRouter.class.getName())
                .property("router.datasourceNames", "fo1,fo2")
                .property("router.strategy", "reverse")
View Full Code Here

        }
    }

    @Configuration
    public Properties configuration() {
        return datasource(datasource(new PropertiesBuilder(), "fo1"), "fo2")

                .property("router", "new://Resource?class-name=" + FailOverRouter.class.getName())
                .property("router.datasourceNames", "fo1,fo2")
                .property("router.strategy", "reverse")
View Full Code Here

    @Test
    public void invoke() throws Exception {
        final EjbServer ejbServer = new EjbServer();

        OpenEJB.init(new PropertiesBuilder().p(DeploymentsResolver.DEPLOYMENTS_CLASSPATH_PROPERTY, "false").build(), new ServerFederation());
        ejbServer.init(new Properties());

        final ServiceDaemon serviceDaemon = new ServiceDaemon(ejbServer, 0, "localhost");
        serviceDaemon.start();

        final int port = serviceDaemon.getPort();

        final Assembler assembler = SystemInstance.get().getComponent(Assembler.class);
        final ConfigurationFactory config = new ConfigurationFactory();

        final EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(new StatelessBean(RemoteWithSecurity.class));
        assembler.createApplication(config.configureApplication(ejbJar));

        try {

            final Context context = new InitialContext(new PropertiesBuilder()
                                                           .p(Context.INITIAL_CONTEXT_FACTORY, RemoteInitialContextFactory.class.getName())
                                                           .p(Context.PROVIDER_URL, "ejbd://127.0.0.1:" + port)
                                                           .p(JNDIContext.AUTHENTICATE_WITH_THE_REQUEST, "true")
                                                           .p("java.naming.security.principal", "foo")
                                                           .p("java.naming.security.credentials", "bar")
View Full Code Here

TOP

Related Classes of org.apache.openejb.testng.PropertiesBuilder

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.