Package org.apache.openejb.testng

Examples of org.apache.openejb.testng.PropertiesBuilder


        port = NetworkUtil.getNextAvailablePort();
    }

    @Configuration
    public Properties props() {
        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")
            .p("httpejbd.port", Integer.toString(port)).build();
    }
View Full Code Here

    @Module
    public AppModule application() {
        final EjbModule ejbModule = new EjbModule(new EjbJar());
        ejbModule.getEjbJar().addEnterpriseBean(new SingletonBean(MyTimedEjb.class).localBean());

        final Properties quartzConfig = new PropertiesBuilder()
            .p("org.apache.openejb.quartz.scheduler.instanceName", "TestScheduler")
            .p("org.apache.openejb.quartz.scheduler.instanceId", "AUTO")
            .p("org.apache.openejb.quartz.threadPool.class", SimpleThreadPool.class.getName())
            .p("org.apache.openejb.quartz.threadPool.threadCount", "4")
            .p("org.apache.openejb.quartz.threadPool.threadPriority", "5")
View Full Code Here

        return appModule;
    }

    @Configuration
    public Properties configuration() {
        return new PropertiesBuilder()
            // see src/test/resources/import-QuartzPersistenceForEJBTimersDB.sql for the init script
            .p("QuartzPersistenceForEJBTimersDB", "new://Resource?type=DataSource")
            .p("QuartzPersistenceForEJBTimersDB.JtaManaged", "true")
            .p("QuartzPersistenceForEJBTimersDB.JdbcUrl", "jdbc:hsqldb:mem:QuartzPersistenceForEJBTimersDB")
            .p("QuartzPersistenceForEJBTimersDB.UserName", "SA")
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

        port = NetworkUtil.getNextAvailablePort();
    }

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

        BASE_URL = "http://localhost:" + port + "/foo/mapping/part2/";
    }

    @Configuration
    public Properties props() {
        return new PropertiesBuilder()
            .p("httpejbd.port", Integer.toString(port))
            .p(OpenEjbContainer.OPENEJB_EMBEDDED_REMOTABLE, "true")
            .build();
    }
View Full Code Here

        BASE_URL = "http://localhost:" + port + "/foo/mapping/part2/my-app/";
    }

    @Configuration
    public Properties props() {
        return new PropertiesBuilder()
            .p("httpejbd.port", Integer.toString(port))
            .p(OpenEjbContainer.OPENEJB_EMBEDDED_REMOTABLE, "true")
            .build();
    }
View Full Code Here

        BASE_URL = "http://localhost:" + port + "/foo/my-app/";
    }

    @Configuration
    public Properties props() {
        return new PropertiesBuilder()
            .p("httpejbd.port", Integer.toString(port))
            .p(OpenEjbContainer.OPENEJB_EMBEDDED_REMOTABLE, "true")
            .build();
    }
View Full Code Here

        port = NetworkUtil.getNextAvailablePort();
    }

    @Configuration
    public Properties props() {
        return new PropertiesBuilder()
            .p("httpejbd.port", Integer.toString(port))
            .p(OpenEjbContainer.OPENEJB_EMBEDDED_REMOTABLE, "true")
            .build();
    }
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.