Package play.api.inject

Examples of play.api.inject.Injector


            "db.other.driver", "org.h2.Driver",
            "db.other.url", "jdbc:h2:mem:other"
        );
        running(fakeApplication(config), new Runnable() {
            public void run() {
                Injector injector = play.api.Play.current().injector();
                assertThat(injector.instanceOf(DefaultComponent.class).db.getUrl(), equalTo("jdbc:h2:mem:default"));
                assertThat(injector.instanceOf(NamedDefaultComponent.class).db.getUrl(), equalTo("jdbc:h2:mem:default"));
                assertThat(injector.instanceOf(NamedOtherComponent.class).db.getUrl(), equalTo("jdbc:h2:mem:other"));
            }
        });
    }
View Full Code Here


            "db.other.driver", "org.h2.Driver",
            "db.other.url", "jdbc:h2:mem:other"
        );
        running(fakeApplication(config), new Runnable() {
            public void run() {
                Injector injector = play.api.Play.current().injector();
                assertThat(injector.instanceOf(NamedOtherComponent.class).db.getUrl(), equalTo("jdbc:h2:mem:other"));
                exception.expect(com.google.inject.ConfigurationException.class);
                injector.instanceOf(DefaultComponent.class);
            }
        });
    }
View Full Code Here

            "db.other.driver", "org.h2.Driver",
            "db.other.url", "jdbc:h2:mem:other"
        );
        running(fakeApplication(config), new Runnable() {
            public void run() {
                Injector injector = play.api.Play.current().injector();
                assertThat(injector.instanceOf(NamedOtherComponent.class).db.getUrl(), equalTo("jdbc:h2:mem:other"));
                exception.expect(com.google.inject.ConfigurationException.class);
                injector.instanceOf(NamedDefaultComponent.class);
            }
        });
    }
View Full Code Here

            "db.other.driver", "org.h2.Driver",
            "db.other.url", "jdbc:h2:mem:other"
        );
        running(fakeApplication(config), new Runnable() {
            public void run() {
                Injector injector = play.api.Play.current().injector();
                assertThat(injector.instanceOf(DefaultComponent.class).db.getUrl(), equalTo("jdbc:h2:mem:other"));
                assertThat(injector.instanceOf(NamedOtherComponent.class).db.getUrl(), equalTo("jdbc:h2:mem:other"));
                exception.expect(com.google.inject.ConfigurationException.class);
                injector.instanceOf(NamedDefaultComponent.class);
            }
        });
    }
View Full Code Here

            "databases.default.driver", "org.h2.Driver",
            "databases.default.url", "jdbc:h2:mem:default"
        );
        running(fakeApplication(config), new Runnable() {
            public void run() {
                Injector injector = play.api.Play.current().injector();
                assertThat(injector.instanceOf(DefaultComponent.class).db.getUrl(), equalTo("jdbc:h2:mem:default"));
                assertThat(injector.instanceOf(NamedDefaultComponent.class).db.getUrl(), equalTo("jdbc:h2:mem:default"));
            }
        });
    }
View Full Code Here

TOP

Related Classes of play.api.inject.Injector

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.