Examples of NinjaPropertiesImpl


Examples of ninja.utils.NinjaPropertiesImpl

    }

    @Test
    public void testHasKeyedRoute() {
        NinjaPropertiesImpl ninjaProperties = new NinjaPropertiesImpl(
                NinjaMode.test);
        ninjaProperties.setProperty("testkey", "true");
        RouterImpl router = new RouterImpl(injector, ninjaProperties);
        Routes routes = new Routes(ninjaProperties);
        routes.init(router);
        router.compileRoutes();
View Full Code Here

Examples of ninja.utils.NinjaPropertiesImpl

                bind(Logger.class).toProvider(LoggerProvider.class);
                bind(Lang.class).to(LangImpl.class);
                bind(Router.class).to(RouterImpl.class);

                bind(NinjaProperties.class).toInstance(new NinjaPropertiesImpl(NinjaMode.test));

                for (Class<?> clazz : toBind) {

                    bind(clazz);
View Full Code Here

Examples of ninja.utils.NinjaPropertiesImpl

   

    @Test
    public void testEhCacheDefaulLoadingWorks() {

        NinjaPropertiesImpl ninjaProperties = new NinjaPropertiesImpl(NinjaMode.test);  
       
        ninjaProperties.setProperty(NinjaConstant.CACHE_IMPLEMENTATION, null);
       
        Injector injector = Guice.createInjector(new Configuration(ninjaProperties), LifecycleSupport.getModule());
       
        Logger logger = injector.getInstance(Logger.class);
       
View Full Code Here

Examples of ninja.utils.NinjaPropertiesImpl

   
   
    @Test
    public void testMemcachedLoadingWorks() {

        NinjaPropertiesImpl ninjaProperties = new NinjaPropertiesImpl(NinjaMode.test);  
       
        ninjaProperties.setProperty(NinjaConstant.CACHE_IMPLEMENTATION, CacheMemcachedImpl.class.getName());
        // just a dummy to test that loading works
        ninjaProperties.setProperty(NinjaConstant.MEMCACHED_HOST, "127.0.0.1:1234");
       
        Injector injector = Guice.createInjector(new Configuration(ninjaProperties), LifecycleSupport.getModule());
       
        Logger logger = injector.getInstance(Logger.class);
       
View Full Code Here

Examples of ninja.utils.NinjaPropertiesImpl

   
   
    @Test
    public void testThatSettingWrongCacheImplementationYieldsException() {

        NinjaPropertiesImpl ninjaProperties = new NinjaPropertiesImpl(NinjaMode.test);  
       
        ninjaProperties.setProperty(NinjaConstant.CACHE_IMPLEMENTATION, "not_existing_implementation");
       
        Injector injector = Guice.createInjector(new Configuration(ninjaProperties), LifecycleSupport.getModule());
       
        Logger logger = injector.getInstance(Logger.class);
       
View Full Code Here

Examples of ninja.utils.NinjaPropertiesImpl

        try {
           
            context = new ServletContextHandler(server, ninjaContextPath);
           
            NinjaPropertiesImpl ninjaProperties
                    = new NinjaPropertiesImpl(ninjaMode);
            // We are using an embeded jetty for quick server testing. The
            // problem is that the port will change.
            // Therefore we inject the server name here:
            ninjaProperties.setProperty(NinjaConstant.serverName, serverUri.toString());

            ninjaServletListener.setNinjaProperties(ninjaProperties);

            context.addEventListener(ninjaServletListener);
View Full Code Here

Examples of ninja.utils.NinjaPropertiesImpl

                bind(Logger.class).toProvider(LoggerProvider.class);
                bind(Lang.class).to(LangImpl.class);
                bind(Router.class).to(RouterImpl.class);

                bind(NinjaProperties.class).toInstance(new NinjaPropertiesImpl(NinjaMode.test));

                for (Class<?> clazz : toBind) {

                    bind(clazz);
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.