PageRenderTime 2582ms queryTime 526ms sortTime 1ms getByIdsTime 72ms findMatchingLines 92ms

100+ results results for 'google guice createinjector lang:java' (2582 ms)

Not the results you expected?
VAppHandlerTest.java https://github.com/raschyoung/jclouds.git | Java | 184 lines
                    
43
                    
44import com.google.common.collect.ImmutableListMultimap;
                    
45import com.google.common.collect.ImmutableSet;
                    
45import com.google.common.collect.ImmutableSet;
                    
46import com.google.common.collect.ListMultimap;
                    
47import com.google.inject.AbstractModule;
                    
47import com.google.inject.AbstractModule;
                    
48import com.google.inject.Guice;
                    
49import com.google.inject.name.Names;
                    
61   protected void setUpInjector() {
                    
62      injector = Guice.createInjector(new SaxParserModule(), new AbstractModule() {
                    
63
                    
                
MethodInterceptionTest.java https://gitlab.com/metamorphiccode/guice | Java | 369 lines
                    
67  public void testSharedProxyClasses() {
                    
68    Injector injector = Guice.createInjector(new AbstractModule() {
                    
69      protected void configure() {
                    
256  public void testInterceptingNonBridgeWorks() {
                    
257    Injector injector = Guice.createInjector(new AbstractModule() {
                    
258      @Override
                    
286    final List<String> callList = Lists.newArrayList();
                    
287    Injector injector = Guice.createInjector(new AbstractModule() {
                    
288      protected void configure() {
                    
317  public void testDeDuplicateInterceptors() throws Exception {
                    
318    Injector injector = Guice.createInjector(new AbstractModule() {
                    
319      @Override protected void configure() {
                    
332    final Queue<Runnable> queue = Lists.newLinkedList();
                    
333    Injector injector = Guice.createInjector(new AbstractModule() {
                    
334      protected void configure() {
                    
                
CommaFeedApplication.java https://gitlab.com/gmi7/commafeed | Java | 174 lines
                    
48import com.commafeed.frontend.session.SessionHelperFactoryProvider;
                    
49import com.google.inject.Guice;
                    
50import com.google.inject.Injector;
                    
50import com.google.inject.Injector;
                    
51import com.google.inject.Key;
                    
52import com.google.inject.TypeLiteral;
                    
110		// guice init
                    
111		Injector injector = Guice.createInjector(new CommaFeedModule(hibernateBundle.getSessionFactory(), config, environment.metrics()));
                    
112
                    
                
Util.java https://github.com/neville-agius/Jetwick.git | Java | 353 lines
                    
17
                    
18import com.google.inject.Guice;
                    
19import com.google.inject.Inject;
                    
19import com.google.inject.Inject;
                    
20import com.google.inject.Injector;
                    
21import com.google.inject.Module;
                    
21import com.google.inject.Module;
                    
22import com.google.inject.Provider;
                    
23import de.jetwick.config.Configuration;
                    
132        Module module = new DefaultModule();
                    
133        Guice.createInjector(module).injectMembers(this);
                    
134    }
                    
144        Module module = new DefaultModule();
                    
145        Injector injector = Guice.createInjector(module);
                    
146        Provider<RMIClient> rmiProvider = injector.getProvider(RMIClient.class);
                    
                
S3ParserTest.java https://github.com/mattstep/jclouds.git | Java | 180 lines
                    
48import com.google.common.collect.Iterables;
                    
49import com.google.inject.Guice;
                    
50import com.google.inject.Injector;
                    
64   protected void setUpInjector() {
                    
65      injector = Guice.createInjector(new SaxParserModule());
                    
66      factory = injector.getInstance(ParseSax.Factory.class);
                    
                
SiteProgram.java https://gitlab.com/chenfengxu/gerrit | Java | 266 lines
                    
41import com.google.inject.CreationException;
                    
42import com.google.inject.Guice;
                    
43import com.google.inject.Injector;
                    
157    modules.add(configModule);
                    
158    Injector cfgInjector = Guice.createInjector(sitePathModule, configModule);
                    
159    Config cfg = cfgInjector.getInstance(Key.get(Config.class, GerritServerConfig.class));
                    
171    DataSourceType dst =
                    
172        Guice.createInjector(new DataSourceModule(), configModule, sitePathModule)
                    
173            .getInstance(Key.get(DataSourceType.class, Names.named(dbType.toLowerCase())));
                    
187    try {
                    
188      return Guice.createInjector(PRODUCTION, modules);
                    
189    } catch (CreationException ce) {
                    
243    modules.add(new DataSourceModule());
                    
244    Injector i = Guice.createInjector(modules);
                    
245    List<Binding<DataSourceType>> dsTypeBindings =
                    
                
ParentInjectorTest.java https://gitlab.com/metamorphiccode/guice | Java | 331 lines
                    
69  public void testChildCannotBindToAParentJitBinding() {
                    
70    Injector parent = Guice.createInjector();
                    
71    parent.getInstance(A.class);
                    
81  public void testJustInTimeBindingsAreSharedWithParentIfPossible() {
                    
82    Injector parent = Guice.createInjector();
                    
83    Injector child = parent.createChildInjector();
                    
140  public void testInterceptorsInherited() {
                    
141    Injector parent = Guice.createInjector(new AbstractModule() {
                    
142      @Override protected void configure() {
                    
158  public void testTypeConvertersInherited() {
                    
159    Injector parent = Guice.createInjector(bindListConverterModule);
                    
160    Injector child = parent.createChildInjector(bindStringNamedB);
                    
240  public void testErrorInParentButOkayInChild() {
                    
241    Injector parent = Guice.createInjector();
                    
242    Injector childInjector = parent.createChildInjector(new AbstractModule() {
                    
                
Activator.java https://github.com/peterlynch/spice.git | Java | 244 lines
                    
12 */
                    
13package org.sonatype.guice.bean.containers;
                    
14
                    
31import org.sonatype.guice.bean.binders.SpaceModule;
                    
32import org.sonatype.guice.bean.binders.WireModule;
                    
33import org.sonatype.guice.bean.locators.DefaultBeanLocator;
                    
33import org.sonatype.guice.bean.locators.DefaultBeanLocator;
                    
34import org.sonatype.guice.bean.locators.MutableBeanLocator;
                    
35import org.sonatype.guice.bean.reflect.BundleClassSpace;
                    
38import com.google.inject.Binder;
                    
39import com.google.inject.Guice;
                    
40import com.google.inject.Injector;
                    
185            final ClassSpace space = new BundleClassSpace( bundle );
                    
186            injector = Guice.createInjector( new WireModule( this, new SpaceModule( space ) ) );
                    
187            final Dictionary<Object, Object> metadata = new Hashtable<Object, Object>();
                    
                
TestAleaGameCheck.java https://github.com/PoliM/playground.git | Java | 228 lines
                    
31import com.google.inject.AbstractModule;
                    
32import com.google.inject.Guice;
                    
33
                    
45		MockitoAnnotations.initMocks(this);
                    
46		WorkflowServiceFactory.setInjector(Guice.createInjector(new AbstractModule() {
                    
47
                    
                
ProvidesIntoTest.java https://gitlab.com/metamorphiccode/guice | Java | 373 lines
                    
49  public void testAnnotation() throws Exception {
                    
50    Injector injector = Guice.createInjector(MultibindingsScanner.asModule(), new AbstractModule() {
                    
51      @Override protected void configure() {}
                    
297    try {
                    
298      Guice.createInjector(MultibindingsScanner.asModule(), m);
                    
299      fail();
                    
312    try {
                    
313      Guice.createInjector(MultibindingsScanner.asModule(), m);
                    
314      fail();
                    
339    try {
                    
340      Guice.createInjector(MultibindingsScanner.asModule(), m);
                    
341      fail();
                    
364    try {
                    
365      Guice.createInjector(MultibindingsScanner.asModule(), m);
                    
366      fail();
                    
                
TransferRequestIntegrationTest.java https://gitlab.com/metamorphiccode/guice | Java | 215 lines
                    
1/**
                    
2 * Copyright (C) 2012 Google Inc.
                    
3 *
                    
16
                    
17package com.google.inject.servlet;
                    
18
                    
20import com.google.inject.AbstractModule;
                    
21import com.google.inject.Guice;
                    
22import com.google.inject.Injector;
                    
69  public void testTransferNonHttpRequest() throws Exception {
                    
70    final Injector injector = Guice.createInjector(new AbstractModule() {
                    
71      @Override protected void configure() {
                    
99  public void testTransferNonHttpRequest_closeable() throws Exception {
                    
100    final Injector injector = Guice.createInjector(new AbstractModule() {
                    
101      @Override protected void configure() {
                    
                
PackageFilterTests.java https://github.com/manzke/guice-automatic-injection.git | Java | 145 lines
                    
25import com.google.inject.ConfigurationException;
                    
26import com.google.inject.Guice;
                    
27import com.google.inject.Injector;
                    
40	public void createDynamicModule() {
                    
41		Injector injector = Guice.createInjector(new TestStartupModule(SonatypeScanner.class,
                    
42			PackageFilter.create(PackageFilterTests.class)));
                    
63	public void createTestInterface() {
                    
64		Injector injector = Guice.createInjector(new TestStartupModule(SonatypeScanner.class,
                    
65			PackageFilter.create(PackageFilterTests.class)));
                    
76	public void createSecondTestInterface() {
                    
77		Injector injector = Guice.createInjector(new TestStartupModule(SonatypeScanner.class,
                    
78			PackageFilter.create(PackageFilterTests.class)));
                    
89	public void createAllInterfaces() {
                    
90		Injector injector = Guice.createInjector(new TestStartupModule(SonatypeScanner.class,
                    
91			PackageFilter.create(PackageFilterTests.class)));
                    
                
TestLifeCycleManager.java https://gitlab.com/vectorci/airlift | Java | 328 lines
                    
20import com.google.inject.CreationException;
                    
21import com.google.inject.Guice;
                    
22import com.google.inject.Injector;
                    
124        };
                    
125        Injector injector = Guice.createInjector(
                    
126                Stage.PRODUCTION,
                    
249    {
                    
250        Injector injector = Guice.createInjector(
                    
251                Stage.PRODUCTION,
                    
275    {
                    
276        Injector injector = Guice.createInjector(
                    
277                Stage.PRODUCTION,
                    
314        };
                    
315        Injector injector = Guice.createInjector(
                    
316                Stage.PRODUCTION,
                    
                
VarargsFilterDispatchIntegrationTest.java https://gitlab.com/metamorphiccode/guice | Java | 182 lines
                    
1package com.google.inject.servlet;
                    
2
                    
7
                    
8import com.google.inject.Guice;
                    
9import com.google.inject.Injector;
                    
9import com.google.inject.Injector;
                    
10import com.google.inject.Key;
                    
11import com.google.inject.Singleton;
                    
47  public final void testDispatchRequestToManagedPipeline() throws ServletException, IOException {
                    
48    final Injector injector = Guice.createInjector(new ServletModule() {
                    
49
                    
87  public final void testDispatchThatNoFiltersFire() throws ServletException, IOException {
                    
88    final Injector injector = Guice.createInjector(new ServletModule() {
                    
89
                    
128
                    
129    final Injector injector = Guice.createInjector(new ServletModule() {
                    
130
                    
                
GuiceCamelContext.java https://gitlab.com/matticala/apache-camel | Java | 176 lines
                    
16 */
                    
17package org.apache.camel.guice;
                    
18
                    
26
                    
27import com.google.inject.Binding;
                    
28import com.google.inject.Inject;
                    
32import org.apache.camel.TypeConverter;
                    
33import org.apache.camel.guice.impl.GuiceInjector;
                    
34import org.apache.camel.guice.inject.Injectors;
                    
48 * It is recommended you use this implementation with the
                    
49 * <a href="http://code.google.com/p/guiceyfruit/wiki/GuiceyJndi">Guicey JNDI Provider</a>
                    
50 *
                    
56    @Inject
                    
57    public GuiceCamelContext(com.google.inject.Injector injector) {
                    
58        this.injector = injector;
                    
                
VirtualGuestToNodeMetadataTest.java https://github.com/mattstep/jclouds.git | Java | 218 lines
                    
44
                    
45import com.google.common.base.Function;
                    
46import com.google.common.base.Supplier;
                    
46import com.google.common.base.Supplier;
                    
47import com.google.common.base.Suppliers;
                    
48import com.google.common.collect.ImmutableSet;
                    
48import com.google.common.collect.ImmutableSet;
                    
49import com.google.inject.Guice;
                    
50
                    
55public class VirtualGuestToNodeMetadataTest {
                    
56   GroupNamingConvention.Factory namingConvention = Guice.createInjector().getInstance(GroupNamingConvention.Factory.class);
                    
57
                    
                
LocalToJpaDataMigratorTest.java https://gitlab.com/unofficial-mirrors/eclipse-che | Java | 300 lines
                    
12
                    
13import com.google.common.collect.ImmutableMap;
                    
14import com.google.gson.Gson;
                    
15import com.google.gson.JsonElement;
                    
16import com.google.gson.JsonObject;
                    
17import com.google.gson.JsonPrimitive;
                    
18import com.google.gson.JsonSerializationContext;
                    
19import com.google.gson.JsonSerializer;
                    
20import com.google.inject.AbstractModule;
                    
20import com.google.inject.AbstractModule;
                    
21import com.google.inject.Guice;
                    
22import com.google.inject.Injector;
                    
104        factory = new LocalStorageFactory(workingDir.toString());
                    
105        injector = Guice.createInjector(Stage.PRODUCTION, new AbstractModule() {
                    
106            @Override
                    
                
NamedDatabaseTest.java https://github.com/playframework/playframework.git | Java | 126 lines
                    
10import com.google.common.collect.ImmutableMap;
                    
11import com.google.inject.Guice;
                    
12import com.google.inject.Injector;
                    
20import play.inject.guice.GuiceApplicationBuilder;
                    
21import play.inject.guice.GuiceApplicationLoader;
                    
22
                    
37            "db.other.url", "jdbc:h2:mem:other");
                    
38    Injector injector = createInjector(config);
                    
39    assertThat(
                    
66            "db.other.url", "jdbc:h2:mem:other");
                    
67    Injector injector = createInjector(config);
                    
68    assertThat(
                    
107        new GuiceApplicationLoader().builder(new Context(Environment.simple(), config));
                    
108    return Guice.createInjector(builder.applicationModule());
                    
109  }
                    
                
StatsIntegrationTest.java https://github.com/juven/sitebricks.git | Java | 234 lines
                    
1package com.google.sitebricks.stat;
                    
2
                    
2
                    
3import com.google.common.collect.ImmutableMap;
                    
4import com.google.inject.AbstractModule;
                    
4import com.google.inject.AbstractModule;
                    
5import com.google.inject.Guice;
                    
6import com.google.inject.Injector;
                    
6import com.google.inject.Injector;
                    
7import com.google.sitebricks.stat.testservices.ChildDummyService;
                    
8import com.google.sitebricks.stat.testservices.DummyService;
                    
8import com.google.sitebricks.stat.testservices.DummyService;
                    
9import com.google.sitebricks.stat.testservices.StatExposerTestingService;
                    
10import com.google.sitebricks.stat.testservices.StaticDummyService;
                    
27  public final void before() {
                    
28    injector = Guice.createInjector(new AbstractModule() {
                    
29      @Override
                    
                
VAppHandlerTest.java https://github.com/edwardt/jclouds.git | Java | 196 lines
                    
20
                    
21import static com.google.common.collect.Iterables.find;
                    
22import static org.testng.Assert.assertEquals;
                    
45
                    
46import com.google.common.collect.ImmutableList;
                    
47import com.google.common.collect.ImmutableSet;
                    
47import com.google.common.collect.ImmutableSet;
                    
48import com.google.common.collect.Iterables;
                    
49import com.google.common.collect.Lists;
                    
50import com.google.inject.AbstractModule;
                    
51import com.google.inject.Guice;
                    
52import com.google.inject.name.Names;
                    
65   protected void setUpInjector() {
                    
66      injector = Guice.createInjector(new SaxParserModule(), new AbstractModule() {
                    
67
                    
                
LimeTestUtils.java https://github.com/WIZARDISHUNGRY/limewire.git | Java | 318 lines
                    
29import com.google.inject.AbstractModule;
                    
30import com.google.inject.Guice;
                    
31import com.google.inject.Injector;
                    
171    
                    
172    public static Injector createInjector(Stage stage, Class<? extends ActivityCallback> callbackClass, Module...modules) {
                    
173        Module combinedReplacements = Modules.combine(modules);
                    
175        Module replaced = Modules.override(combinedOriginals).with(combinedReplacements);
                    
176        return Guice.createInjector(stage, replaced);
                    
177    }
                    
179    /**
                    
180     * Wraps {@link #createInjector(Module, Class) createInjector(Module, ActivityCallbackStub.class)}.
                    
181     */
                    
208    /**
                    
209     * Wraps {@link #createInjectorAndStart(Module, Class) createInjectorAndStart(Module, ActivityCallbackStub.class)}.
                    
210     */
                    
                
CatalogHandlerTest.java https://github.com/edwardt/jclouds.git | Java | 137 lines
                    
36
                    
37import com.google.common.collect.ImmutableList;
                    
38import com.google.common.collect.ImmutableMap;
                    
38import com.google.common.collect.ImmutableMap;
                    
39import com.google.inject.Guice;
                    
40import com.google.inject.Injector;
                    
55      InputStream is = getClass().getResourceAsStream("/catalog-blank.xml");
                    
56      injector = Guice.createInjector(new SaxParserModule());
                    
57      factory = injector.getInstance(ParseSax.Factory.class);
                    
67      InputStream is = getClass().getResourceAsStream("/catalog.xml");
                    
68      injector = Guice.createInjector(new SaxParserModule());
                    
69      factory = injector.getInstance(ParseSax.Factory.class);
                    
                
AbstractLdapSynchronizer.java https://gitlab.com/gesnaud/xivo-lib-ldap | Java | 252 lines
                    
29
                    
30import com.google.inject.Guice;
                    
31import com.google.inject.Inject;
                    
31import com.google.inject.Inject;
                    
32import com.google.inject.Injector;
                    
33
                    
60        AbstractLDAPModule module = getModuleInstance(moduleClass, parsing);
                    
61        Injector injector = Guice.createInjector(module);
                    
62        AbstractLdapSynchronizer synchronizer = injector.getInstance(AbstractLdapSynchronizer.class);
                    
                
ModuleAnnotatedMethodScannerTest.java https://gitlab.com/metamorphiccode/guice | Java | 394 lines
                    
62    };
                    
63    Injector injector = Guice.createInjector(module, NamedMunger.module());
                    
64
                    
317  public void testPrivateModuleInheritScanner_skipSourcesFromPrivateBinder2() {
                    
318    Injector injector = Guice.createInjector(NamedMunger.module(), new AbstractModule() {
                    
319      @Override protected void configure() {
                    
332  public void testPrivateModuleScannersDontImpactSiblings_usingPrivateModule() {
                    
333    Injector injector = Guice.createInjector(new PrivateModule() {
                    
334      @Override protected void configure() {
                    
352  public void testPrivateModuleScannersDontImpactSiblings_usingPrivateBinder() {
                    
353    Injector injector = Guice.createInjector(new AbstractModule() {
                    
354      @Override protected void configure() {
                    
379  public void testPrivateModuleWithinPrivateModule() {
                    
380    Injector injector = Guice.createInjector(NamedMunger.module(), new PrivateModule() {
                    
381      @Override protected void configure() {
                    
                
RedirectionRetryHandlerTest.java https://github.com/edwardt/jclouds.git | Java | 184 lines
                    
38
                    
39import com.google.common.collect.ImmutableMultimap;
                    
40import com.google.common.collect.LinkedHashMultimap;
                    
40import com.google.common.collect.LinkedHashMultimap;
                    
41import com.google.common.collect.Multimap;
                    
42import com.google.inject.AbstractModule;
                    
42import com.google.inject.AbstractModule;
                    
43import com.google.inject.Guice;
                    
44import com.google.inject.Injector;
                    
44import com.google.inject.Injector;
                    
45import com.google.inject.Provides;
                    
46
                    
53public class RedirectionRetryHandlerTest {
                    
54   Injector injector = Guice.createInjector(new MockModule(), new RestModule(), new AbstractModule() {
                    
55      @SuppressWarnings("unused")
                    
                
VDCHandlerTest.java https://github.com/raschyoung/jclouds.git | Java | 193 lines
                    
36import com.google.common.collect.ImmutableSet;
                    
37import com.google.inject.Guice;
                    
38import com.google.inject.Injector;
                    
49      InputStream is = getClass().getResourceAsStream("/vdc.xml");
                    
50      Injector injector = Guice.createInjector(new SaxParserModule());
                    
51      Factory factory = injector.getInstance(ParseSax.Factory.class);
                    
95      InputStream is = getClass().getResourceAsStream("/vdc-1net.xml");
                    
96      Injector injector = Guice.createInjector(new SaxParserModule());
                    
97      Factory factory = injector.getInstance(ParseSax.Factory.class);
                    
120      InputStream is = getClass().getResourceAsStream("/vdc-failed.xml");
                    
121      Injector injector = Guice.createInjector(new SaxParserModule());
                    
122      Factory factory = injector.getInstance(ParseSax.Factory.class);
                    
139      InputStream is = getClass().getResourceAsStream("/vdc-saved.xml");
                    
140      Injector injector = Guice.createInjector(new SaxParserModule());
                    
141      Factory factory = injector.getInstance(ParseSax.Factory.class);
                    
                
InjectorTest.java https://gitlab.com/metamorphiccode/guice | Java | 413 lines
                    
113      throws CreationException {
                    
114    Injector injector = Guice.createInjector(new AbstractModule() {
                    
115      protected void configure() {
                    
124  public void testInjectorApiIsNotSerializable() throws IOException {
                    
125    Injector injector = Guice.createInjector();
                    
126    assertNotSerializable(injector);
                    
205  public void testInjectStatics() throws CreationException {
                    
206    Guice.createInjector(new AbstractModule() {
                    
207      protected void configure() {
                    
342    try {
                    
343      Guice.createInjector().getInstance(SeaHorse.class);
                    
344      fail();
                    
353    try {
                    
354      Guice.createInjector().getInstance(Chicken.class);
                    
355      fail();
                    
                
LocalizationTest.java https://github.com/juven/sitebricks.git | Java | 289 lines
                    
48
                    
49    String msg = Guice.createInjector(new AbstractModule() {
                    
50      @Override
                    
144
                    
145    Guice.createInjector(new AbstractModule() {
                    
146      @Override
                    
163
                    
164    String msg = Guice.createInjector(new AbstractModule() {
                    
165      @Override
                    
198
                    
199    Injector injector = Guice.createInjector(new AbstractModule() {
                    
200      @Override
                    
243  public final void parameterizedWithNoExternalBundle() {
                    
244    String msg = Guice.createInjector(new AbstractModule() {
                    
245      @Override
                    
                
AutobindTests.java https://github.com/simonetripodi/guice-automatic-injection.git | Java | 145 lines
                    
25import com.google.inject.ConfigurationException;
                    
26import com.google.inject.Guice;
                    
27import com.google.inject.Injector;
                    
40	public void createDynamicModule() {
                    
41		Injector injector = Guice.createInjector(new TestStartupModule(SonatypeScanner.class,
                    
42			PackageFilter.create(AutobindTests.class, false)));
                    
63	public void createTestInterface() {
                    
64		Injector injector = Guice.createInjector(new TestStartupModule(SonatypeScanner.class,
                    
65			PackageFilter.create(AutobindTests.class, false)));
                    
76	public void createSecondTestInterface() {
                    
77		Injector injector = Guice.createInjector(new TestStartupModule(SonatypeScanner.class,
                    
78			PackageFilter.create(AutobindTests.class, false)));
                    
89	public void createAllInterfaces() {
                    
90		Injector injector = Guice.createInjector(new TestStartupModule(SonatypeScanner.class,
                    
91			PackageFilter.create(AutobindTests.class, false)));
                    
                
TestHttpServerModule.java https://gitlab.com/CORP-RESELLER/airlift | Java | 379 lines
                    
27import com.google.inject.Binder;
                    
28import com.google.inject.Guice;
                    
29import com.google.inject.Injector;
                    
121        ConfigurationFactory configFactory = new ConfigurationFactory(properties);
                    
122        Injector injector = Guice.createInjector(new HttpServerModule(),
                    
123                new NodeModule(),
                    
149        ConfigurationFactory configFactory = new ConfigurationFactory(properties);
                    
150        Injector injector = Guice.createInjector(new HttpServerModule(),
                    
151                new NodeModule(),
                    
190        ConfigurationFactory configFactory = new ConfigurationFactory(properties);
                    
191        Injector injector = Guice.createInjector(new HttpServerModule(),
                    
192                new NodeModule(),
                    
264        ConfigurationFactory configFactory = new ConfigurationFactory(properties);
                    
265        Injector injector = Guice.createInjector(new HttpServerModule(),
                    
266                new NodeModule(),
                    
                
ConfigurationFactoryTest.java https://gitlab.com/CORP-RESELLER/airlift | Java | 464 lines
                    
20import com.google.inject.CreationException;
                    
21import com.google.inject.Guice;
                    
22import com.google.inject.Injector;
                    
22import com.google.inject.Injector;
                    
23import com.google.inject.Module;
                    
24import com.google.inject.spi.Message;
                    
113        TestMonitor monitor = new TestMonitor();
                    
114        Injector injector = createInjector(properties, monitor, new Module()
                    
115        {
                    
137        TestMonitor monitor = new TestMonitor();
                    
138        Injector injector = createInjector(properties, monitor, new Module()
                    
139        {
                    
297        List<Message> messages = new ConfigurationValidator(configurationFactory, null).validate(module);
                    
298        return Guice.createInjector(new ConfigurationModule(configurationFactory), module, new ValidationErrorModule(messages));
                    
299    }
                    
                
MyApp.java https://github.com/leoneu/s4-piper.git | Java | 152 lines
                    
25
                    
26import com.google.inject.Guice;
                    
27import com.google.inject.Injector;
                    
134
                    
135        Injector injector = Guice.createInjector(new Module());
                    
136        MyApp myApp = injector.getInstance(MyApp.class);
                    
                
Main.java https://bitbucket.org/edowd/gentoo_bootstrap_java.git | Java | 103 lines
                    
26
                    
27import com.google.inject.Guice;
                    
28import com.google.inject.Injector;
                    
32import com.netflix.config.DynamicStringProperty;
                    
33import com.netflix.governator.guice.LifecycleInjector;
                    
34import com.netflix.governator.lifecycle.LifecycleManager;
                    
64        {
                    
65//            Injector injector = Guice.createInjector(new Amd64MinimalBootstrapModule());
                    
66        
                    
66        
                    
67//            Injector injector = LifecycleInjector.builder().withBootstrapModule(new GentooBootstrapModule()).createInjector();
                    
68
                    
71            {
                    
72                injector = LifecycleInjector.builder().withBootstrapModule(new HvmBootstrapModule()).createInjector();
                    
73            }
                    
                
Main.java https://github.com/WIZARDISHUNGRY/limewire.git | Java | 292 lines
                    
15
                    
16import com.google.inject.Guice;
                    
17import com.google.inject.Injector;
                    
17import com.google.inject.Injector;
                    
18import com.google.inject.Singleton;
                    
19import com.google.inject.Stage;
                    
31    public static void main(String args[]) {
                    
32        Injector injector = Guice.createInjector(Stage.PRODUCTION, new LimeWireCoreModule(MainCallback.class));
                    
33        LimeWireCore core = injector.getInstance(LimeWireCore.class);
                    
                
JsonTest.java https://github.com/mattstep/jclouds.git | Java | 214 lines
                    
20
                    
21import static com.google.common.io.BaseEncoding.base16;
                    
22import static com.google.common.primitives.Bytes.asList;
                    
32
                    
33import com.google.common.collect.ImmutableList;
                    
34import com.google.common.collect.ImmutableMap;
                    
37import com.google.inject.AbstractModule;
                    
38import com.google.inject.Guice;
                    
39import com.google.inject.TypeLiteral;
                    
42public class JsonTest {
                    
43   private Json json = Guice.createInjector(new GsonModule()).getInstance(Json.class);
                    
44
                    
101   public void testExcluder() {
                    
102      Json excluder = Guice.createInjector(new GsonModule(), new AbstractModule() {
                    
103         protected void configure() {
                    
                
ParseImageFromJsonResponseTest.java https://github.com/edwardt/jclouds.git | Java | 92 lines
                    
37import com.google.inject.AbstractModule;
                    
38import com.google.inject.Guice;
                    
39import com.google.inject.Injector;
                    
39import com.google.inject.Injector;
                    
40import com.google.inject.Key;
                    
41import com.google.inject.TypeLiteral;
                    
49public class ParseImageFromJsonResponseTest {
                    
50   Injector i = Guice.createInjector(new AbstractModule() {
                    
51
                    
74   public static Image parseImage() {
                    
75      Injector i = Guice.createInjector(new AbstractModule() {
                    
76
                    
                
Rules4JBIBootstrap.java https://bitbucket.org/pymma/openesb-components.git | Java | 225 lines
                    
31
                    
32import com.google.inject.Guice;
                    
33import com.google.inject.Inject;
                    
33import com.google.inject.Inject;
                    
34import com.google.inject.Injector;
                    
35import com.google.inject.Stage;
                    
35import com.google.inject.Stage;
                    
36import com.google.inject.name.Named;
                    
37
                    
40
                    
41import org.openesb.components.rules4jbi.engine.guice.modules.LoggerModule;
                    
42import org.openesb.components.rules4jbi.engine.util.DOMUtils;
                    
78        Injector injector =
                    
79                Guice.createInjector(Stage.PRODUCTION, new LoggerModule(installationContext.getContext()));
                    
80        
                    
                
ListOfKeyValuesDelimitedByBlankLinesToServerInfoSetTest.java https://github.com/edwardt/jclouds.git | Java | 80 lines
                    
35
                    
36import com.google.common.base.Function;
                    
37import com.google.common.collect.ImmutableSet;
                    
38import com.google.inject.AbstractModule;
                    
39import com.google.inject.Guice;
                    
40import com.google.inject.TypeLiteral;
                    
48
                    
49   private static final ListOfKeyValuesDelimitedByBlankLinesToServerInfoSet FN = Guice.createInjector(
                    
50         new AbstractModule() {
                    
                
ServerPlugin.java https://gitlab.com/chenfengxu/gerrit | Java | 313 lines
                    
19import com.google.gerrit.common.Nullable;
                    
20import com.google.gerrit.extensions.registration.RegistrationHandle;
                    
21import com.google.gerrit.extensions.registration.ReloadableRegistrationHandle;
                    
21import com.google.gerrit.extensions.registration.ReloadableRegistrationHandle;
                    
22import com.google.gerrit.lifecycle.LifecycleManager;
                    
23import com.google.gerrit.server.PluginUser;
                    
24import com.google.gerrit.server.util.RequestContext;
                    
25import com.google.inject.Guice;
                    
26import com.google.inject.Injector;
                    
26import com.google.inject.Injector;
                    
27import com.google.inject.Module;
                    
28import java.io.IOException;
                    
259    modules.add(new ServerPluginInfoModule(this, env.getServerMetrics()));
                    
260    return Guice.createInjector(modules);
                    
261  }
                    
                
BindBlockDeviceMappingToIndexedFormParamsTest.java https://github.com/edwardt/jclouds.git | Java | 74 lines
                    
35import com.google.common.collect.Maps;
                    
36import com.google.inject.Guice;
                    
37import com.google.inject.Injector;
                    
45public class BindBlockDeviceMappingToIndexedFormParamsTest {
                    
46   Injector injector = Guice.createInjector();
                    
47   BindBlockDeviceMappingToIndexedFormParams binder = injector
                    
                
OSGiTestActivator.java https://gitlab.com/metamorphiccode/guice | Java | 511 lines
                    
1/**
                    
2 * Copyright (C) 2009 Google Inc.
                    
3 *
                    
16
                    
17package com.googlecode.guice.bundle;
                    
18
                    
21import com.google.inject.AbstractModule;
                    
22import com.google.inject.Guice;
                    
23import com.google.inject.Inject;
                    
486
                    
487    Injector injector = Guice.createInjector(new TestModule(bundle));
                    
488/*if[AOP]*/
                    
488/*if[AOP]*/
                    
489    Injector aopInjector = Guice.createInjector(new TestModule(bundle), new InterceptorModule());
                    
490/*end[AOP]*/
                    
                
BindNodeConfigurationToXmlPayloadTest.java https://github.com/edwardt/jclouds.git | Java | 100 lines
                    
20
                    
21import static com.google.common.base.Preconditions.checkNotNull;
                    
22import static org.easymock.EasyMock.expect;
                    
40
                    
41import com.google.common.collect.ImmutableMap;
                    
42import com.google.inject.AbstractModule;
                    
42import com.google.inject.AbstractModule;
                    
43import com.google.inject.Guice;
                    
44import com.google.inject.Injector;
                    
44import com.google.inject.Injector;
                    
45import com.google.inject.name.Names;
                    
46
                    
53public class BindNodeConfigurationToXmlPayloadTest {
                    
54   Injector injector = Guice.createInjector(new AbstractModule() {
                    
55
                    
                
VMHandlerTest.java https://github.com/adiantum/jclouds.git | Java | 132 lines
                    
22
                    
23import com.google.inject.Guice;
                    
24import com.google.inject.Injector;
                    
34      InputStream is = getClass().getResourceAsStream("/vm.xml");
                    
35      Injector injector = Guice.createInjector(new SaxParserModule());
                    
36      Factory factory = injector.getInstance(ParseSax.Factory.class);
                    
                
TestThriftClientAndServerModules.java https://gitlab.com/mayakarya/swift | Java | 312 lines
                    
39import com.google.inject.BindingAnnotation;
                    
40import com.google.inject.Guice;
                    
41import com.google.inject.Injector;
                    
91        final List<Object> eventHandlerContexts = newArrayList();
                    
92        Injector injector = Guice.createInjector(Stage.PRODUCTION,
                    
93                new ConfigurationModule(new ConfigurationFactory(ImmutableMap.<String, String>of())),
                    
158    {
                    
159        Injector injector = Guice.createInjector(Stage.PRODUCTION,
                    
160                new ConfigurationModule(new ConfigurationFactory(ImmutableMap.<String, String>of())),
                    
205    {
                    
206        Injector injector = Guice.createInjector(Stage.PRODUCTION,
                    
207                new ConfigurationModule(new ConfigurationFactory(ImmutableMap.<String, String>of())),
                    
271
                    
272        Injector injector = Guice.createInjector(
                    
273                Stage.PRODUCTION,
                    
                
BaseTemplateBuilderLiveTest.java https://github.com/mattstep/jclouds.git | Java | 305 lines
                    
50
                    
51import com.google.common.base.Predicate;
                    
52import com.google.common.base.Predicates;
                    
52import com.google.common.base.Predicates;
                    
53import com.google.common.base.Splitter;
                    
54import com.google.common.collect.ImmutableSet;
                    
54import com.google.common.collect.ImmutableSet;
                    
55import com.google.common.collect.Iterables;
                    
56import com.google.common.collect.Sets;
                    
57import com.google.common.io.InputSupplier;
                    
58import com.google.inject.Guice;
                    
59import com.google.inject.Module;
                    
121      Map<OsFamily, Map<String, String>> map = new BaseComputeServiceContextModule() {
                    
122      }.provideOsVersionMap(new ComputeServiceConstants.ReferenceData(), Guice.createInjector(new GsonModule())
                    
123            .getInstance(Json.class));
                    
                
VirtualboxLiveTest.java https://github.com/edwardt/jclouds.git | Java | 329 lines
                    
20
                    
21import static com.google.common.base.Preconditions.checkNotNull;
                    
22import static org.testng.Assert.assertEquals;
                    
59import com.google.common.base.Predicate;
                    
60import com.google.inject.Guice;
                    
61import com.google.inject.Injector;
                    
143
                    
144      injector = Guice.createInjector(new SshjSshClientModule(), new SLF4JLoggingModule(),
                    
145            new BouncyCastleCryptoModule());
                    
                
ParseObjectMetadataFromHeadersTest.java https://github.com/edwardt/jclouds.git | Java | 162 lines
                    
43
                    
44import com.google.common.collect.ImmutableMap;
                    
45import com.google.common.collect.ImmutableMultimap;
                    
46import com.google.inject.AbstractModule;
                    
47import com.google.inject.Guice;
                    
48import com.google.inject.name.Names;
                    
149   void setUp() {
                    
150      parser = Guice.createInjector(new AbstractModule() {
                    
151
                    
                
PluginGuiceEnvironment.java https://gitlab.com/chenfengxu/gerrit | Java | 648 lines
                    
19import static com.google.gerrit.extensions.registration.PrivateInternals_DynamicTypes.dynamicMapsOf;
                    
20import static com.google.gerrit.extensions.registration.PrivateInternals_DynamicTypes.dynamicSetsOf;
                    
21
                    
36import com.google.gerrit.extensions.webui.WebUiPlugin;
                    
37import com.google.gerrit.index.IndexCollection;
                    
38import com.google.gerrit.metrics.MetricMaker;
                    
43import com.google.inject.Binding;
                    
44import com.google.inject.Guice;
                    
45import com.google.inject.Inject;
                    
67/**
                    
68 * Tracks Guice bindings that should be exposed to loaded plugins.
                    
69 *
                    
115    this.copyConfigModule = ccm;
                    
116    this.copyConfigKeys = Guice.createInjector(ccm).getAllBindings().keySet();
                    
117    this.serverMetrics = serverMetrics;
                    
                
BaseInit.java https://gitlab.com/chenfengxu/gerrit | Java | 525 lines
                    
19import static com.google.inject.Scopes.SINGLETON;
                    
20import static com.google.inject.Stage.PRODUCTION;
                    
21
                    
40import com.google.gerrit.server.config.SitePaths;
                    
41import com.google.gerrit.server.git.GitRepositoryManager;
                    
42import com.google.gerrit.server.index.IndexModule;
                    
56import com.google.inject.CreationException;
                    
57import com.google.inject.Guice;
                    
58import com.google.inject.Inject;
                    
59import com.google.inject.Injector;
                    
60import com.google.inject.Module;
                    
61import com.google.inject.Provider;
                    
299    try {
                    
300      return Guice.createInjector(PRODUCTION, m).getInstance(SiteInit.class);
                    
301    } catch (CreationException ce) {
                    
                
VirtualboxAdministrationLiveTest.java https://github.com/edwardt/jclouds.git | Java | 542 lines
                    
61
                    
62import com.google.common.base.Predicate;
                    
63import com.google.common.io.Files;
                    
64import com.google.common.io.InputSupplier;
                    
65import com.google.inject.Guice;
                    
66import com.google.inject.Injector;
                    
244
                    
245      injector = Guice.createInjector(new SshjSshClientModule(), new SLF4JLoggingModule(),
                    
246            new BouncyCastleCryptoModule());
                    
                
ElasticStackClientLiveTest.java https://github.com/edwardt/jclouds.git | Java | 385 lines
                    
20
                    
21import static com.google.common.base.Preconditions.checkNotNull;
                    
22import static org.testng.Assert.assertEquals;
                    
60
                    
61import com.google.common.base.Predicate;
                    
62import com.google.common.base.Predicates;
                    
62import com.google.common.base.Predicates;
                    
63import com.google.common.collect.ImmutableMap;
                    
64import com.google.common.collect.ImmutableSet;
                    
65import com.google.gson.Gson;
                    
66import com.google.inject.Guice;
                    
67import com.google.inject.Module;
                    
314   protected void doConnectViaSsh(Server server, Credentials creds) throws IOException {
                    
315      SshClient ssh = Guice.createInjector(new SshjSshClientModule()).getInstance(SshClient.Factory.class).create(
                    
316               new IPSocket(server.getVnc().getIp(), 22), creds);
                    
                
ListKeysTest.java https://github.com/edwardt/jclouds.git | Java | 58 lines
                    
31import com.google.common.collect.ImmutableSet;
                    
32import com.google.inject.Guice;
                    
33import com.google.inject.Injector;
                    
42   protected Injector injector() {
                    
43      return Guice.createInjector(new GsonModule(), new IBMSmartCloudParserModule());
                    
44   }
                    
                
ParseContainerCDNMetadataListFromJsonResponseTest.java https://github.com/edwardt/jclouds.git | Java | 66 lines
                    
35import com.google.common.collect.ImmutableSortedSet;
                    
36import com.google.inject.Guice;
                    
37import com.google.inject.Injector;
                    
37import com.google.inject.Injector;
                    
38import com.google.inject.Key;
                    
39import com.google.inject.TypeLiteral;
                    
47public class ParseContainerCDNMetadataListFromJsonResponseTest {
                    
48   Injector i = Guice.createInjector(new GsonModule());
                    
49
                    
                
Errors.java https://bitbucket.org/dkartaschew/elasticsearch.git | Java | 634 lines
                    
1/**
                    
2 * Copyright (C) 2006 Google Inc.
                    
3 *
                    
18
                    
19import com.google.common.collect.ImmutableList;
                    
20import com.google.common.collect.ImmutableSet;
                    
20import com.google.common.collect.ImmutableSet;
                    
21import com.google.common.collect.Lists;
                    
22import org.elasticsearch.common.inject.*;
                    
101     * same message for both bind time errors:
                    
102     * <pre><code>Guice.createInjector(new AbstractModule() {
                    
103     *   public void configure() {
                    
107     * ...and at provide-time errors:
                    
108     * <pre><code>Guice.createInjector().getInstance(Runnable.class);</code></pre>
                    
109     * Otherwise we need to know who's calling when resolving a just-in-time
                    
                
ListAccountsResponseTest.java https://github.com/edwardt/jclouds.git | Java | 112 lines
                    
34import com.google.common.collect.ImmutableSet;
                    
35import com.google.inject.Guice;
                    
36import com.google.inject.Injector;
                    
46   protected Injector injector() {
                    
47      return Guice.createInjector(new CloudStackParserModule(), new GsonModule() {
                    
48
                    
                
BindInstantiateVAppTemplateParamsToXmlPayloadTest.java https://github.com/ahgittin/legacy-jclouds.git | Java | 102 lines
                    
38import org.jclouds.util.Strings2;
                    
39import org.nnsoft.guice.rocoto.Rocoto;
                    
40import org.nnsoft.guice.rocoto.configuration.ConfigurationModule;
                    
43import com.google.common.base.Supplier;
                    
44import com.google.common.base.Suppliers;
                    
45import com.google.common.collect.HashMultimap;
                    
45import com.google.common.collect.HashMultimap;
                    
46import com.google.common.collect.ImmutableList;
                    
47import com.google.common.collect.Maps;
                    
49import com.google.common.collect.Multimaps;
                    
50import com.google.inject.Guice;
                    
51import com.google.inject.Injector;
                    
60public class BindInstantiateVAppTemplateParamsToXmlPayloadTest {
                    
61   Injector injector = Guice.createInjector(Rocoto.expandVariables(new ConfigurationModule() {
                    
62
                    
                
JpaFlatFormDaoTest.java https://github.com/gatherdata/gather-data.git | Java | 171 lines
                    
44
                    
45import com.google.inject.Guice;
                    
46import com.google.inject.Inject;
                    
46import com.google.inject.Inject;
                    
47import com.google.inject.Injector;
                    
48
                    
63        // guice up the instance
                    
64        Injector injector = Guice.createInjector(new JpaTestingModule());
                    
65        injector.injectMembers(dao);
                    
                
AWSRunInstancesResponseHandlerTest.java https://github.com/edwardt/jclouds.git | Java | 124 lines
                    
42
                    
43import com.google.common.collect.ImmutableList;
                    
44import com.google.common.collect.ImmutableSet;
                    
45import com.google.inject.AbstractModule;
                    
46import com.google.inject.Guice;
                    
47
                    
62   protected void setUpInjector() {
                    
63      injector = Guice.createInjector(new SaxParserModule(), new AbstractModule() {
                    
64
                    
                
DTKitBuilder.java https://github.com/jenkinsci/dtkit-plugin.git | Java | 445 lines
                    
3import com.google.inject.AbstractModule;
                    
4import com.google.inject.Guice;
                    
5import com.google.inject.Singleton;
                    
165
                    
166		final DTKitBuilderLog log = Guice.createInjector(new AbstractModule() {
                    
167			@Override
                    
191
                    
192			DTKitReportProcessingService processingService = Guice.createInjector(new AbstractModule() {
                    
193				@Override
                    
325		// Archiving tool reports into JUnit files
                    
326		DTKitBuilderTransformer dtkitBuilderTransformer = Guice.createInjector(new AbstractModule() {
                    
327			@Override
                    
                
WebApps.java https://github.com/lalithsuresh/Scaling-HDFS-NameNode.git | Java | 221 lines
                    
22import com.google.inject.AbstractModule;
                    
23import com.google.inject.Guice;
                    
24import com.google.inject.Injector;
                    
25import com.google.inject.Module;
                    
26import com.google.inject.servlet.GuiceFilter;
                    
27
                    
151            new HttpServer(name, bindAddress, port, findPort, conf);
                    
152        server.addGlobalFilter("guice", GuiceFilter.class.getName(), null);
                    
153        webapp.setConf(conf);
                    
159      }
                    
160      Injector injector = Guice.createInjector(webapp, new AbstractModule() {
                    
161        @Override
                    
169      // save a guice filter instance for webapp stop (mostly for unit tests)
                    
170      webapp.setGuiceFilter(injector.getInstance(GuiceFilter.class));
                    
171      if (devMode) {
                    
                
Main.java https://github.com/zootella/Lost-in-the-Space.git | Java | 308 lines
                    
16
                    
17import com.google.inject.Guice;
                    
18import com.google.inject.Inject;
                    
18import com.google.inject.Inject;
                    
19import com.google.inject.Injector;
                    
20import com.google.inject.Singleton;
                    
20import com.google.inject.Singleton;
                    
21import com.google.inject.Stage;
                    
22import com.limegroup.gnutella.browser.MagnetOptions;
                    
40    public static void main(String args[]) {
                    
41        Injector injector = Guice.createInjector(Stage.PRODUCTION, new LimeWireCoreModule(MainCallback.class));
                    
42        Main main = injector.getInstance(Main.class);
                    
                
MembersInjectorTest.java https://gitlab.com/metamorphiccode/guice | Java | 401 lines
                    
178    try {
                    
179      Guice.createInjector(new AbstractModule() {
                    
180        protected void configure() {
                    
237  public void testGettingRawMembersInjector() {
                    
238    Injector injector = Guice.createInjector();
                    
239    try {
                    
248  public void testGettingAnnotatedMembersInjector() {
                    
249    Injector injector = Guice.createInjector();
                    
250    try {
                    
332    final ParallelMemberInjectionCallback2 c2 = new ParallelMemberInjectionCallback2();
                    
333    Guice.createInjector(new AbstractModule() {
                    
334      @Override
                    
358    final RecursiveMemberInjection rmi = new RecursiveMemberInjection();
                    
359    Guice.createInjector(new AbstractModule() {
                    
360      @Override
                    
                
BindDriveDataToPlainTextStringTest.java https://github.com/raschyoung/jclouds.git | Java | 86 lines
                    
37
                    
38import com.google.common.base.Function;
                    
39import com.google.common.collect.ImmutableSet;
                    
40import com.google.inject.AbstractModule;
                    
41import com.google.inject.Guice;
                    
42import com.google.inject.TypeLiteral;
                    
50
                    
51   private static final BindDriveDataToPlainTextString FN = Guice.createInjector(new AbstractModule() {
                    
52
                    
                
ParseAsyncJobFromHttpResponseTest.java https://github.com/edwardt/jclouds.git | Java | 170 lines
                    
36import com.google.common.collect.ImmutableMap;
                    
37import com.google.inject.Guice;
                    
38import com.google.inject.Injector;
                    
46
                    
47   Injector i = Guice.createInjector(new GsonModule() {
                    
48
                    
                
RestfulJsonPeopleTest.java https://github.com/thesmith/bbc-shindig-example.git | Java | 262 lines
                    
40
                    
41import bbc.social.shindig.example.GuiceModule;
                    
42
                    
42
                    
43import com.google.common.collect.Lists;
                    
44import com.google.common.collect.Maps;
                    
44import com.google.common.collect.Maps;
                    
45import com.google.inject.Guice;
                    
46import com.google.inject.Injector;
                    
46import com.google.inject.Injector;
                    
47import com.google.inject.Key;
                    
48import com.google.inject.TypeLiteral;
                    
65  protected void setUp() throws Exception {
                    
66    Injector injector = Guice.createInjector(new PropertiesModule(),
                    
67        new GuiceModule());
                    
                
Init.java https://gitlab.com/chenfengxu/gerrit | Java | 257 lines
                    
19import com.google.gerrit.common.IoUtil;
                    
20import com.google.gerrit.common.PageLinks;
                    
21import com.google.gerrit.common.PluginData;
                    
21import com.google.gerrit.common.PluginData;
                    
22import com.google.gerrit.pgm.init.BaseInit;
                    
23import com.google.gerrit.pgm.init.Browser;
                    
25import com.google.gerrit.pgm.init.api.ConsoleUI;
                    
26import com.google.gerrit.pgm.util.ErrorLogFile;
                    
27import com.google.gerrit.server.config.GerritServerConfigModule;
                    
31import com.google.inject.AbstractModule;
                    
32import com.google.inject.Guice;
                    
33import com.google.inject.Inject;
                    
140    modules.add(new GerritServerConfigModule());
                    
141    Guice.createInjector(modules).injectMembers(this);
                    
142    start(run);
                    
                
CredentialStoreModuleTest.java https://github.com/mattstep/jclouds.git | Java | 206 lines
                    
42import com.google.common.io.InputSupplier;
                    
43import com.google.inject.Guice;
                    
44import com.google.inject.Injector;
                    
67   public void deleteObject(String identity, String credential) throws InterruptedException, IOException {
                    
68      Injector injector = createInjector();
                    
69      Map<String, InputStream> map = getMap(injector);
                    
111
                    
112      put(map, getStore(createInjector()), "test", new Credentials("user", "pass"));
                    
113      checkConsistent(map, getStore(createInjector()), "test", new Credentials("user", "pass"));
                    
149   protected Injector createInjectorWithProvidedMap(Map<String, InputStream> map) {
                    
150      return Guice.createInjector(new CredentialStoreModule(map), new GsonModule());
                    
151   }
                    
153   protected Injector createInjector() {
                    
154      return Guice.createInjector(new CredentialStoreModule(), new GsonModule());
                    
155   }
                    
                
GuiceServletConfig.java https://github.com/csamuel/jclouds.git | Java | 141 lines
                    
45import com.google.appengine.api.labs.taskqueue.TaskOptions.Method;
                    
46import com.google.appengine.repackaged.com.google.common.base.Splitter;
                    
47import com.google.common.collect.ImmutableSet;
                    
49import com.google.common.io.Closeables;
                    
50import com.google.inject.Guice;
                    
51import com.google.inject.Injector;
                    
54import com.google.inject.name.Names;
                    
55import com.google.inject.servlet.GuiceServletContextListener;
                    
56import com.google.inject.servlet.ServletModule;
                    
76
                    
77      Module googleModule = new GoogleAppEngineConfigurationModule();
                    
78      Set<Module> modules = ImmutableSet.<Module> of(googleModule);
                    
120   protected Injector getInjector() {
                    
121      return Guice.createInjector(new ServletModule() {
                    
122         @Override
                    
                
Injectors.java https://gitlab.com/matticala/apache-camel | Java | 457 lines
                    
32import com.google.inject.Binding;
                    
33import com.google.inject.Guice;
                    
34import com.google.inject.Injector;
                    
34import com.google.inject.Injector;
                    
35import com.google.inject.Key;
                    
36import com.google.inject.Module;
                    
43import com.google.inject.matcher.Matcher;
                    
44import com.google.inject.name.Names;
                    
45import com.google.inject.util.Modules;
                    
46
                    
47import org.apache.camel.guice.jndi.GuiceInitialContextFactory;
                    
48import org.apache.camel.guice.jndi.internal.Classes;
                    
98        }
                    
99        Injector injector = Guice.createInjector(Modules.override(modules)
                    
100                .with(overridingModules));
                    
                
ProjectTypeTest.java https://gitlab.com/gaal/che-core | Java | 371 lines
                    
13import com.google.inject.AbstractModule;
                    
14import com.google.inject.Guice;
                    
15import com.google.inject.Injector;
                    
15import com.google.inject.Injector;
                    
16import com.google.inject.multibindings.Multibinder;
                    
17import org.eclipse.che.api.core.NotFoundException;
                    
42        // Bind components
                    
43        injector = Guice.createInjector(new AbstractModule() {
                    
44            @Override
                    
                
BTSwarmCoordinatorTest.java https://github.com/r3n/limewire5-ruby.git | Java | 352 lines
                    
26
                    
27import com.google.inject.Guice;
                    
28import com.google.inject.Injector;
                    
77    protected void setUp() throws Exception {
                    
78        injector = Guice.createInjector(new LimeWireCoreModule(ActivityCallbackStub.class));
                    
79        metaInfoFactory = injector.getInstance(BTMetaInfoFactory.class);
                    
                
VDCHandlerTest.java https://github.com/gnodet/jclouds.git | Java | 81 lines
                    
36import com.google.common.collect.ImmutableMap;
                    
37import com.google.inject.Guice;
                    
38import com.google.inject.Injector;
                    
49      InputStream is = getClass().getResourceAsStream("/vdc.xml");
                    
50      Injector injector = Guice.createInjector(new SaxParserModule());
                    
51      Factory factory = injector.getInstance(ParseSax.Factory.class);
                    
                
package-info.java https://github.com/imyousuf/jersey.git | Java | 188 lines
                    
44 * Guice support is enabled by referencing the Guice filter
                    
45 * {@link com.google.inject.servlet.GuiceFilter} and an application
                    
46 * specific {@link javax.servlet.ServletContextListener} that extends from
                    
46 * specific {@link javax.servlet.ServletContextListener} that extends from
                    
47 * {@link com.google.inject.servlet.GuiceServletContextListener} in the web.xml.
                    
48 * For example, the web.xml may be as follows:
                    
100 * <code>GuiceResource</code> will be managed according to the scope declared
                    
101 * using Guice defined scopes. For example the <code>GuiceResource</code>
                    
102 * could be as follows:
                    
144 * 
                    
145 *     public class GuiceServletConfig extends GuiceServletContextListener {
                    
146 * 
                    
148 *         protected Injector getInjector() {
                    
149 *             return Guice.createInjector(new JerseyServletModule() {
                    
150 * 
                    
                
EmbulkService.java https://gitlab.com/CORP-RESELLER/embulk | Java | 76 lines
                    
4import com.google.common.collect.ImmutableList;
                    
5import com.google.inject.Guice;
                    
6import com.google.inject.Injector;
                    
6import com.google.inject.Injector;
                    
7import com.google.inject.Module;
                    
8import org.embulk.config.ConfigSource;
                    
14import org.embulk.jruby.JRubyScriptingModule;
                    
15import static com.google.common.base.Preconditions.checkState;
                    
16
                    
61
                    
62        injector = Guice.createInjector(modules);
                    
63        initialized = true;
                    
                
SoyTransformer.java https://bitbucket.org/Adaptavist/atlassian-plugins-osgi-testrunner-parent.git | Java | 109 lines
                    
12
                    
13import com.google.inject.*;
                    
14import com.google.inject.multibindings.Multibinder;
                    
14import com.google.inject.multibindings.Multibinder;
                    
15import com.google.template.soy.SoyFileSet;
                    
16import com.google.template.soy.SoyModule;
                    
16import com.google.template.soy.SoyModule;
                    
17import com.google.template.soy.jssrc.SoyJsSrcOptions;
                    
18import com.google.template.soy.shared.restricted.SoyFunction;
                    
18import com.google.template.soy.shared.restricted.SoyFunction;
                    
19import com.google.template.soy.xliffmsgplugin.XliffMsgPluginModule;
                    
20
                    
67
                    
68            final Injector injector = Guice.createInjector(guiceModules);
                    
69
                    
                
OptionalBindingTest.java https://github.com/peterlynch/spice.git | Java | 293 lines
                    
107    HasOptionalInjections instance = new HasOptionalInjections();
                    
108    Guice.createInjector(partialModule).injectMembers(instance);
                    
109    instance.assertNothingInjected();
                    
113    HasOptionalInjections instance = new HasOptionalInjections();
                    
114    Guice.createInjector().injectMembers(instance);
                    
115    instance.assertNothingInjected();
                    
118  public void testEverythingInjectorToInstance() {
                    
119    Guice.createInjector(everythingModule, toInstanceModule)
                    
120        .getInstance(HasOptionalInjections.class)
                    
246    try {
                    
247      Guice.createInjector().getInstance(HasOptionalConstructor.class);
                    
248      fail();
                    
263    staticInjectA = injectA;
                    
264    Guice.createInjector(new AbstractModule() {
                    
265      protected void configure() {
                    
                
BindVAppConfigurationToXmlPayloadTest.java https://github.com/edwardt/jclouds.git | Java | 220 lines
                    
20
                    
21import static com.google.common.base.Preconditions.checkNotNull;
                    
22import static org.easymock.EasyMock.expect;
                    
43
                    
44import com.google.common.collect.ImmutableList;
                    
45import com.google.common.collect.ImmutableListMultimap;
                    
45import com.google.common.collect.ImmutableListMultimap;
                    
46import com.google.common.collect.ImmutableSet;
                    
47import com.google.common.collect.Maps;
                    
48import com.google.inject.AbstractModule;
                    
49import com.google.inject.Guice;
                    
50import com.google.inject.Injector;
                    
59public class BindVAppConfigurationToXmlPayloadTest {
                    
60   Injector injector = Guice.createInjector(new AbstractModule() {
                    
61
                    
                
CommonDaoWriteTest.java https://github.com/saumitra123/smart-dao.git | Java | 290 lines
                    
21import com.google.inject.AbstractModule;
                    
22import com.google.inject.Guice;
                    
23import com.google.inject.Inject;
                    
23import com.google.inject.Inject;
                    
24import com.google.inject.Injector;
                    
25import com.google.inject.PrivateModule;
                    
26import com.google.inject.Scopes;
                    
27import com.google.inject.Singleton;
                    
28import com.google.inject.TypeLiteral;
                    
28import com.google.inject.TypeLiteral;
                    
29import com.google.inject.name.Named;
                    
30import com.google.inject.name.Names;
                    
102     */
                    
103    injector = Guice.createInjector(new TestModule(), new TestNoModule(), new TestOpModule(), new TestPesModule());
                    
104    commonDaos = injector.getInstance(CommonDaos.class);
                    
                
VAppTemplateHandlerTest.java https://github.com/gnodet/jclouds.git | Java | 151 lines
                    
41
                    
42import com.google.common.collect.ImmutableList;
                    
43import com.google.common.collect.ImmutableSet;
                    
44import com.google.common.collect.Iterables;
                    
45import com.google.inject.Guice;
                    
46import com.google.inject.Injector;
                    
57      InputStream is = getClass().getResourceAsStream("/vAppTemplate.xml");
                    
58      Injector injector = Guice.createInjector(new SaxParserModule());
                    
59      Factory factory = injector.getInstance(ParseSax.Factory.class);
                    
122      InputStream is = getClass().getResourceAsStream("/vAppTemplate-copying.xml");
                    
123      Injector injector = Guice.createInjector(new SaxParserModule());
                    
124      Factory factory = injector.getInstance(ParseSax.Factory.class);
                    
                
ElasticStackErrorHandlerTest.java https://github.com/edwardt/jclouds.git | Java | 140 lines
                    
38
                    
39import com.google.inject.Guice;
                    
40
                    
102
                    
103      ElasticStackErrorHandler function = Guice.createInjector().getInstance(ElasticStackErrorHandler.class);
                    
104
                    
                
ThrowingProviderTest.java https://gitlab.com/metamorphiccode/guice | Java | 878 lines
                    
66  private final TestScope testScope = new TestScope();
                    
67  private Injector bindInjector = Guice.createInjector(new AbstractModule() {
                    
68    protected void configure() {
                    
368    try {
                    
369      Guice.createInjector(new AbstractModule() {
                    
370        protected void configure() {
                    
390    try {
                    
391      bindInjector = Guice.createInjector(new AbstractModule() {
                    
392        protected void configure() {
                    
406    try {
                    
407      Guice.createInjector(new AbstractModule() {
                    
408        protected void configure() {
                    
426  public void testDependencies_Bind() {
                    
427    bindInjector = Guice.createInjector(new AbstractModule() {
                    
428      protected void configure() {
                    
                
CheckedProviderTest.java https://gitlab.com/metamorphiccode/guice | Java | 1486 lines
                    
30import com.google.inject.CreationException;
                    
31import com.google.inject.Guice;
                    
32import com.google.inject.Inject;
                    
320    final MockRemoteProvider<Foo> mockRemoteProviderB = new MockRemoteProvider<Foo>();
                    
321    providesInjector = Guice.createInjector(new AbstractModule() {
                    
322      @Override
                    
354  public void testAnnotations_Cxtor() throws Exception {
                    
355    cxtorInjector = Guice.createInjector(new AbstractModule() {
                    
356      @Override
                    
415
                    
416    bindInjector = Guice.createInjector(new AbstractModule() {
                    
417      @Override
                    
432    try {
                    
433      Guice.createInjector(new AbstractModule() {
                    
434        @Override
                    
                
BoundFieldModuleTest.java https://gitlab.com/metamorphiccode/guice | Java | 753 lines
                    
122    BoundFieldModule module = BoundFieldModule.of(instance);
                    
123    Injector injector = Guice.createInjector(module);
                    
124
                    
316    try {
                    
317      Guice.createInjector(module);
                    
318      fail();
                    
364    BoundFieldModule module = BoundFieldModule.of(instance);
                    
365    Injector injector = Guice.createInjector(module);
                    
366
                    
470    BoundFieldModule module = BoundFieldModule.of(instance);
                    
471    Injector injector = Guice.createInjector(module);
                    
472
                    
482    BoundFieldModule module = BoundFieldModule.of(instance);
                    
483    Injector injector = Guice.createInjector(module);
                    
484
                    
                
ServletTest.java https://gitlab.com/metamorphiccode/guice | Java | 471 lines
                    
32import com.google.inject.CreationException;
                    
33import com.google.inject.Guice;
                    
34import com.google.inject.Inject;
                    
314
                    
315    GuiceFilter filter = new GuiceFilter();
                    
316    final boolean[] invoked = new boolean[1];
                    
339
                    
340    GuiceFilter filter = new GuiceFilter();
                    
341    final boolean[] invoked = new boolean[1];
                    
360
                    
361    GuiceFilter filter = new GuiceFilter();
                    
362    final boolean[] invoked = new boolean[1];
                    
385
                    
386    GuiceFilter filter = new GuiceFilter();
                    
387    final boolean[] invoked = new boolean[1];
                    
                
SpiUtils.java https://gitlab.com/metamorphiccode/guice | Java | 1117 lines
                    
1/**
                    
2 * Copyright (C) 2010 Google Inc.
                    
3 *
                    
16
                    
17package com.google.inject.multibindings;
                    
18
                    
18
                    
19import static com.google.inject.multibindings.MapBinder.entryOfProviderOf;
                    
20import static com.google.inject.multibindings.MapBinder.mapOf;
                    
54import com.google.inject.Binding;
                    
55import com.google.inject.Guice;
                    
56import com.google.inject.Injector;
                    
131      int expectedMapBindings, MapResult... results) {
                    
132    Injector injector = Guice.createInjector(modules);
                    
133    Visitor<T> visitor = new Visitor<T>();
                    
                
OptionalBinderTest.java https://gitlab.com/metamorphiccode/guice | Java | 1241 lines
                    
36import com.google.inject.CreationException;
                    
37import com.google.inject.Guice;
                    
38import com.google.inject.Injector;
                    
224    };
                    
225    Injector injector = Guice.createInjector(module);
                    
226    assertEquals("a", injector.getInstance(String.class));
                    
263    };
                    
264    Injector injector = Guice.createInjector(module);
                    
265    assertEquals("a", injector.getInstance(String.class));
                    
305    };
                    
306    Injector injector = Guice.createInjector(module);
                    
307    assertEquals("b", injector.getInstance(String.class));
                    
361
                    
362    Injector injector = Guice.createInjector(module1, module2, module3);
                    
363    assertEquals("b", injector.getInstance(String.class));
                    
                
MultibinderTest.java https://gitlab.com/metamorphiccode/guice | Java | 1221 lines
                    
41import com.google.inject.CreationException;
                    
42import com.google.inject.Guice;
                    
43import com.google.inject.Injector;
                    
119
                    
120    Injector injector = Guice.createInjector(abc, de);
                    
121    Key<Set<String>> setKey = Key.get(setOfString);
                    
141    };
                    
142    Injector injector = Guice.createInjector(module);
                    
143
                    
163    };
                    
164    Injector injector = Guice.createInjector(module);
                    
165
                    
188    };
                    
189    Injector injector = Guice.createInjector(module);
                    
190
                    
                
MapBinderTest.java https://gitlab.com/metamorphiccode/guice | Java | 1032 lines
                    
39import com.google.inject.CreationException;
                    
40import com.google.inject.Guice;
                    
41import com.google.inject.Inject;
                    
234    };
                    
235    Injector injector = Guice.createInjector(module);
                    
236
                    
262    };
                    
263    Injector injector = Guice.createInjector(module);
                    
264
                    
297    };
                    
298    Injector injector = Guice.createInjector(module);
                    
299
                    
326    };
                    
327    Injector injector = Guice.createInjector(module);
                    
328
                    
                
FactoryProviderTest.java https://gitlab.com/metamorphiccode/guice | Java | 840 lines
                    
54  public void testAssistedFactory() {
                    
55    Injector injector = Guice.createInjector(new AbstractModule() {
                    
56      @Override
                    
90  public void testAssistedFactoryWithAnnotations() {
                    
91    Injector injector = Guice.createInjector(new AbstractModule() {
                    
92      @Override
                    
359  public void testAssistInjectionInNonPublicConstructor() {
                    
360    Injector injector = Guice.createInjector(new AbstractModule() {
                    
361      @Override
                    
377  public void testExceptionDuringConstruction() {
                    
378    Injector injector = Guice.createInjector(new AbstractModule() {
                    
379      @Override
                    
424  public void testConstructorExceptionsAreThrownByFactory() {
                    
425    Injector injector = Guice.createInjector(new AbstractModule() {
                    
426      @Override
                    
                
FactoryProvider2Test.java https://gitlab.com/metamorphiccode/guice | Java | 1220 lines
                    
50  public void testAssistedFactory() {
                    
51    Injector injector = Guice.createInjector(new AbstractModule() {
                    
52      @Override
                    
356  public void testAssistInjectionInNonPublicConstructor() {
                    
357    Injector injector = Guice.createInjector(new AbstractModule() {
                    
358      @Override
                    
375  public void testExceptionDuringConstruction() {
                    
376    Injector injector = Guice.createInjector(new AbstractModule() {
                    
377      @Override
                    
413  public void testConstructorExceptionsAreThrownByFactory() {
                    
414    Injector injector = Guice.createInjector(new AbstractModule() {
                    
415      @Override
                    
440  public void testWildcardGenerics() {
                    
441    Injector injector = Guice.createInjector(new AbstractModule() {
                    
442      @Override
                    
                
FactoryModuleBuilderTest.java https://gitlab.com/metamorphiccode/guice | Java | 540 lines
                    
56    try {
                    
57      Guice.createInjector(new AbstractModule() {
                    
58        @Override
                    
274    try {
                    
275      Injector injector = Guice.createInjector(new AbstractModule() {
                    
276        @Override
                    
295  public void testMultipleReturnTypes() {
                    
296    Injector injector = Guice.createInjector(new AbstractModule() {
                    
297      @Override
                    
313  public void testParameterizedClassesWithNoImplements() {
                    
314    Injector injector = Guice.createInjector(new AbstractModule() {
                    
315      @Override
                    
327    try {
                    
328      Guice.createInjector(new AbstractModule() {
                    
329        @Override
                    
                
OverrideModuleTest.java https://gitlab.com/metamorphiccode/guice | Java | 731 lines
                    
20import static com.google.inject.Asserts.assertContains;
                    
21import static com.google.inject.Guice.createInjector;
                    
22import static com.google.inject.name.Names.named;
                    
33import com.google.inject.Exposed;
                    
34import com.google.inject.Guice;
                    
35import com.google.inject.Injector;
                    
365    value.set("B");
                    
366    Injector injector = Guice.createInjector(overridden);
                    
367    assertEquals("B", injector.getInstance(Key.get(String.class, named("original"))));
                    
413    // override forwards
                    
414    Injector injector = Guice.createInjector(Modules.override(exposes5and6).with(exposes15));
                    
415    assertEquals(15, injector.getInstance(Integer.class).intValue());
                    
418    // and in reverse order
                    
419    Injector reverse = Guice.createInjector(Modules.override(exposes15).with(exposes5and6));
                    
420    assertEquals(5, reverse.getInstance(Integer.class).intValue());
                    
                
SpiBindingsTest.java https://gitlab.com/metamorphiccode/guice | Java | 463 lines
                    
26import com.google.inject.Binding;
                    
27import com.google.inject.Guice;
                    
28import com.google.inject.Inject;
                    
29import com.google.inject.Injector;
                    
30import com.google.inject.Key;
                    
31import com.google.inject.Module;
                    
244  public void testConvertedConstantBinding() {
                    
245    Injector injector = Guice.createInjector(new AbstractModule() {
                    
246      protected void configure() {
                    
265  public void testProviderBinding() {
                    
266    Injector injector = Guice.createInjector(new AbstractModule() {
                    
267      protected void configure() {
                    
356    
                    
357    final Injector injector = Guice.createInjector(new AbstractModule() {
                    
358      protected void configure() {
                    
                
ProviderMethodsTest.java https://gitlab.com/metamorphiccode/guice | Java | 952 lines
                    
72  public void testProviderMethods() {
                    
73    Injector injector = Guice.createInjector(this);
                    
74
                    
361
                    
362    Injector injector = Guice.createInjector(module);
                    
363
                    
383    try {
                    
384      Guice.createInjector(new AbstractModule() {
                    
385        @Override protected void configure() {}
                    
398    AtomicReference<Logger> loggerRef = new AtomicReference<Logger>();
                    
399    Injector injector = Guice.createInjector(new FooModule(loggerRef));
                    
400
                    
435    };
                    
436    Injector injector = Guice.createInjector(m1, m2);
                    
437
                    
                
WeakKeySetTest.java https://gitlab.com/metamorphiccode/guice | Java | 528 lines
                    
23import static com.google.inject.internal.WeakKeySetUtils.assertNotBlacklisted;
                    
24import static com.google.inject.internal.WeakKeySetUtils.assertNotInSet;
                    
25import static com.google.inject.internal.WeakKeySetUtils.assertSourceNotInSet;
                    
31import com.google.inject.Binding;
                    
32import com.google.inject.Guice;
                    
33import com.google.inject.Injector;
                    
336  public void testWeakKeySet_integration() {
                    
337    Injector parentInjector = Guice.createInjector(new AbstractModule() {
                    
338          @Override protected void configure() {
                    
358  public void testWeakKeySet_integration_multipleChildren() {
                    
359    Injector parentInjector = Guice.createInjector(new AbstractModule() {
                    
360          @Override protected void configure() {
                    
398  public void testWeakKeySet_integration_multipleChildren_overlappingKeys() {
                    
399    Injector parentInjector = Guice.createInjector(new AbstractModule() {
                    
400          @Override protected void configure() {
                    
                
TypeListenerTest.java https://gitlab.com/metamorphiccode/guice | Java | 710 lines
                    
96
                    
97    Guice.createInjector(new AbstractModule() {
                    
98      @Override protected void configure() {
                    
288    try {
                    
289      Guice.createInjector(new AbstractModule() {
                    
290        @Override protected void configure() {
                    
315
                    
316    Injector injector = Guice.createInjector(new AbstractModule() {
                    
317      @Override protected void configure() {
                    
375
                    
376    Guice.createInjector(new AbstractModule() {
                    
377      @Override protected void configure() {
                    
413  public void testLookupsPostCreate() {
                    
414    Injector injector = Guice.createInjector(new AbstractModule() {
                    
415      @Override protected void configure() {
                    
                
TypeConversionTest.java https://gitlab.com/metamorphiccode/guice | Java | 495 lines
                    
76  public void testOneConstantInjection() throws CreationException {
                    
77    Injector injector = Guice.createInjector(new AbstractModule() {
                    
78      @Override protected void configure() {
                    
215  public void testInvalidEnum() throws CreationException {
                    
216    Injector injector = Guice.createInjector(new AbstractModule() {
                    
217      @Override protected void configure() {
                    
253
                    
254    Injector injector = Guice.createInjector(new AbstractModule() {
                    
255      @Override protected void configure() {
                    
330    try {
                    
331      Guice.createInjector(new OuterModule(new ConverterNullModule()));
                    
332      fail();
                    
387
                    
388    Injector injector = Guice.createInjector(new AbstractModule() {
                    
389      @Override protected void configure() {
                    
                
ScopesTest.java https://gitlab.com/metamorphiccode/guice | Java | 1192 lines
                    
123  public void testJustInTimeAnnotatedSingleton() {
                    
124    Injector injector = Guice.createInjector();
                    
125
                    
132    assertNotSame(
                    
133        Guice.createInjector().getInstance(AnnotatedSingleton.class),
                    
134        Guice.createInjector().getInstance(AnnotatedSingleton.class));
                    
222    try {
                    
223      Guice.createInjector(new AbstractModule() {
                    
224        @Override protected void configure() {
                    
326    try {
                    
327      Guice.createInjector(new OuterDeprecatedModule());
                    
328      fail();
                    
424  public void testSingletonAnnotationOnParameterizedType() {
                    
425    Injector injector = Guice.createInjector();
                    
426    assertSame(injector.getInstance(new Key<Injected<String>>() {}),
                    
                
ProvisionListenerTest.java https://gitlab.com/metamorphiccode/guice | Java | 796 lines
                    
51  public void testExceptionInListenerBeforeProvisioning() {
                    
52    Injector injector = Guice.createInjector(new AbstractModule() {
                    
53      @Override
                    
277    final Counter count2 = new Counter();
                    
278    Injector injector = Guice.createInjector(new AbstractModule() {
                    
279      @Override
                    
302    final Capturer capturer = new Capturer();
                    
303    Injector injector = Guice.createInjector(new AbstractModule() {
                    
304      @Override
                    
362    final Counter counter = new Counter();
                    
363    Injector injector = Guice.createInjector(new AbstractModule() {
                    
364      @Override
                    
383  public void testCallingBindingDotGetProviderDotGet() {
                    
384    Injector injector = Guice.createInjector(new AbstractModule() {
                    
385      @Override
                    
                
ProvisionExceptionTest.java https://gitlab.com/metamorphiccode/guice | Java | 470 lines
                    
120    try {
                    
121      Guice.createInjector(new AbstractModule() {
                    
122        @Override protected void configure() {
                    
278    final RuntimeException sharedException = new RuntimeException("fail");
                    
279    Injector injector = Guice.createInjector(new AbstractModule() {
                    
280      @Override protected void configure() {}
                    
302    final RuntimeException exception2 = new RuntimeException("abort");
                    
303    Injector injector = Guice.createInjector(new AbstractModule() {
                    
304      @Override protected void configure() {}
                    
339  public void testDuplicatesDifferentInstances() {
                    
340    Injector injector = Guice.createInjector(new AbstractModule() {
                    
341      @Override protected void configure() {}
                    
359  public void testMultipleDuplicatesDifferentInstaces() {
                    
360    Injector injector = Guice.createInjector(new AbstractModule() {
                    
361      @Override protected void configure() {}
                    
                
PrivateModuleTest.java https://gitlab.com/metamorphiccode/guice | Java | 564 lines
                    
231    try {
                    
232      Guice.createInjector(
                    
233          new PrivateModule() {
                    
274  public void testInstallingRegularModulesFromPrivateModules() {
                    
275    Injector injector = Guice.createInjector(new PrivateModule() {
                    
276      @Override public void configure() {
                    
326  public void testDependenciesBetweenPrivateAndPublic() {
                    
327    Injector injector = Guice.createInjector(
                    
328        new PrivateModule() {
                    
355  public void testDependenciesBetweenPrivateAndPublicWithPublicEagerSingleton() {
                    
356    Injector injector = Guice.createInjector(
                    
357        new PrivateModule() {
                    
392  public void testDependenciesBetweenPrivateAndPublicWithPrivateEagerSingleton() {
                    
393    Injector injector = Guice.createInjector(
                    
394        new AbstractModule() {
                    
                
JitBindingsTest.java https://gitlab.com/metamorphiccode/guice | Java | 731 lines
                    
160    try {
                    
161      Guice.createInjector(new AbstractModule() {
                    
162        @Override
                    
176  public void testLinkedProviderBindingWorks() {
                    
177    Injector injector = Guice.createInjector(new AbstractModule() {
                    
178      @Override
                    
192    try {
                    
193      Guice.createInjector(new AbstractModule() {
                    
194        @Override
                    
267  public void testImplementedBySomethingThatIsAnnotated() {
                    
268    Injector injector = Guice.createInjector(new AbstractModule() {
                    
269      @Override
                    
403    try {
                    
404      Guice.createInjector(new AbstractModule() {
                    
405        protected void configure() {
                    
                
DuplicateBindingsTest.java https://gitlab.com/metamorphiccode/guice | Java | 576 lines
                    
100    
                    
101    Guice.createInjector(
                    
102        new ScopedModule(Scopes.NO_SCOPE, foo, pFoo, pclFoo, clFoo, cFoo),
                    
107  public void testSameScopeAnnotationIgnored() {
                    
108    Guice.createInjector(
                    
109        new AnnotatedScopeModule(Singleton.class, foo, pFoo, pclFoo, clFoo, cFoo),
                    
189  public void testChildInjectorDuplicateParentFail() {
                    
190    Injector injector = Guice.createInjector(
                    
191        new SimpleModule(foo, pFoo, pclFoo, clFoo, cFoo)
                    
235        try {
                    
236          Guice.createInjector(Elements.getModule(Arrays.asList(e1, e2)));
                    
237          if(e1 != e2) {
                    
312    b.equality = "test";
                    
313    Guice.createInjector(new AbstractModule() {
                    
314      @Override
                    
                
CircularDependencyTest.java https://gitlab.com/metamorphiccode/guice | Java | 652 lines
                    
206    try {
                    
207      Guice.createInjector().getInstance(C.class);
                    
208      fail();
                    
217    try {
                    
218      Guice.createInjector(new AbstractModule() {
                    
219        @Override protected void configure() {}
                    
232    try {
                    
233      Guice.createInjector(new AbstractModule() {
                    
234        @Override protected void configure() {
                    
322    try {
                    
323      Guice.createInjector(new AbstractModule() {
                    
324        @Override protected void configure() {
                    
338    try {
                    
339      Guice.createInjector(new AbstractModule() {
                    
340        @Override
                    
                
BindingTest.java https://gitlab.com/metamorphiccode/guice | Java | 503 lines
                    
126  public void testScopeIsAppliedToKeyNotTarget() {
                    
127    Injector injector = Guice.createInjector(new AbstractModule() {
                    
128      protected void configure() {
                    
195  private void assertBindingSucceeds(final Class<?> clazz) {
                    
196    assertNotNull(Guice.createInjector().getInstance(clazz));
                    
197  }
                    
292
                    
293    Injector injector = Guice.createInjector(new AbstractModule() {
                    
294      protected void configure() {
                    
327
                    
328    Injector injector = Guice.createInjector(new AbstractModule() {
                    
329      protected void configure() {
                    
465  public void testTurkeyBaconProblemUsingToConstuctor() {
                    
466    Injector injector = Guice.createInjector(new AbstractModule() {
                    
467      @SuppressWarnings("unchecked")
                    
                
BinderTestSuite.java https://gitlab.com/metamorphiccode/guice | Java | 769 lines
                    
1/**
                    
2 * Copyright (C) 2008 Google Inc.
                    
3 *
                    
18
                    
19import static com.google.inject.Asserts.assertContains;
                    
20import static com.google.inject.name.Names.named;
                    
24
                    
25import com.google.common.collect.ImmutableList;
                    
26import com.google.common.collect.Lists;
                    
26import com.google.common.collect.Lists;
                    
27import com.google.inject.binder.AnnotatedBindingBuilder;
                    
28import com.google.inject.binder.ScopedBindingBuilder;
                    
399      nextId.set(101);
                    
400      return Guice.createInjector(modules);
                    
401    }
                    
                
BinderTest.java https://gitlab.com/metamorphiccode/guice | Java | 634 lines
                    
91    try {
                    
92      Guice.createInjector(new AbstractModule() {
                    
93        @Override
                    
128    try {
                    
129      Guice.createInjector(new AbstractModule() {
                    
130        @Override
                    
250
                    
251    Injector injector = Guice.createInjector(new AbstractModule() {
                    
252      @Override
                    
362   * See issue 614, Problem One
                    
363   * https://github.com/google/guice/issues/614
                    
364   */
                    
418  public void testPartialInjectorGetInstance() {
                    
419    Injector injector = Guice.createInjector();
                    
420    try {
                    
                
Errors.java https://gitlab.com/metamorphiccode/guice | Java | 870 lines
                    
26import com.google.common.collect.Ordering;
                    
27import com.google.inject.ConfigurationException;
                    
28import com.google.inject.CreationException;
                    
28import com.google.inject.CreationException;
                    
29import com.google.inject.Guice;
                    
30import com.google.inject.Key;
                    
34import com.google.inject.ProvisionException;
                    
35import com.google.inject.Scope;
                    
36import com.google.inject.TypeLiteral;
                    
139   * same message for both bind time errors:
                    
140   * <pre><code>Guice.createInjector(new AbstractModule() {
                    
141   *   public void configure() {
                    
145   * ...and at provide-time errors:
                    
146   * <pre><code>Guice.createInjector().getInstance(Runnable.class);</code></pre>
                    
147   * Otherwise we need to know who's calling when resolving a just-in-time
                    
                
GuiceServletConfig.java https://github.com/edwardt/jclouds.git | Java | 117 lines
                    
40import com.google.common.io.Closeables;
                    
41import com.google.inject.Guice;
                    
42import com.google.inject.Injector;
                    
42import com.google.inject.Injector;
                    
43import com.google.inject.Module;
                    
44import com.google.inject.TypeLiteral;
                    
44import com.google.inject.TypeLiteral;
                    
45import com.google.inject.servlet.GuiceServletContextListener;
                    
46import com.google.inject.servlet.ServletModule;
                    
52 */
                    
53public class GuiceServletConfig extends GuiceServletContextListener {
                    
54
                    
91   protected Injector getInjector() {
                    
92      return Guice.createInjector(new ServletModule() {
                    
93         @Override
                    
                
ElasticStackClientLiveTest.java https://github.com/mattstep/jclouds.git | Java | 354 lines
                    
54
                    
55import com.google.common.base.Predicate;
                    
56import com.google.common.base.Predicates;
                    
56import com.google.common.base.Predicates;
                    
57import com.google.common.collect.ImmutableMap;
                    
58import com.google.common.collect.ImmutableSet;
                    
58import com.google.common.collect.ImmutableSet;
                    
59import com.google.common.net.HostAndPort;
                    
60import com.google.gson.Gson;
                    
60import com.google.gson.Gson;
                    
61import com.google.inject.Guice;
                    
62
                    
283   protected void doConnectViaSsh(Server server, LoginCredentials creds) throws IOException {
                    
284      SshClient ssh = Guice.createInjector(new SshjSshClientModule()).getInstance(SshClient.Factory.class).create(
                    
285               HostAndPort.fromParts(server.getVnc().getIp(), 22), creds);
                    
                
BindGroupNamesToIndexedFormParamsTest.java https://github.com/edwardt/jclouds.git | Java | 62 lines
                    
30
                    
31import com.google.inject.Guice;
                    
32import com.google.inject.Injector;
                    
40public class BindGroupNamesToIndexedFormParamsTest {
                    
41   Injector injector = Guice.createInjector();
                    
42   BindGroupNamesToIndexedFormParams binder = injector.getInstance(BindGroupNamesToIndexedFormParams.class);
                    
                
BindInstanceIdsToIndexedFormParamsTest.java https://github.com/edwardt/jclouds.git | Java | 62 lines
                    
30
                    
31import com.google.inject.Guice;
                    
32import com.google.inject.Injector;
                    
40public class BindInstanceIdsToIndexedFormParamsTest {
                    
41   Injector injector = Guice.createInjector();
                    
42   BindInstanceIdsToIndexedFormParams binder = injector.getInstance(BindInstanceIdsToIndexedFormParams.class);
                    
                
MainActivity.java https://bitbucket.org/pbuitvydas/droid-care.git | Java | 188 lines
                    
1package com.googlecode.droidcare.ui;
                    
2
                    
25
                    
26import com.google.inject.Guice;
                    
27import com.googlecode.droidcare.common.AppContext;
                    
28import com.googlecode.droidcare.common.ScriptEngine;
                    
29import com.googlecode.droidcare.common.di.GuiceModule;
                    
30import com.googlecode.droidcare.common.provider.ProviderUpdateEvent;
                    
30import com.googlecode.droidcare.common.provider.ProviderUpdateEvent;
                    
31import com.googlecode.droidcare.common.provider.SelfServiceProvider;
                    
32import com.googlecode.droidcare.common.provider.ProviderListener;
                    
32import com.googlecode.droidcare.common.provider.ProviderListener;
                    
33import com.googlecode.droidcare.common.provider.ProviderManager;
                    
34import com.googlecode.droidcare.common.usr.User;
                    
61        super.onCreate(savedInstanceState);
                    
62        Guice.createInjector(new GuiceModule());
                    
63        setContentView(R.layout.activity_main);
                    
                
S3ParserTest.java https://github.com/edwardt/jclouds.git | Java | 190 lines
                    
52import com.google.common.collect.Iterables;
                    
53import com.google.inject.Guice;
                    
54import com.google.inject.Injector;
                    
69   protected void setUpInjector() {
                    
70      injector = Guice.createInjector(new SaxParserModule() {
                    
71         public void configure() {
                    
                
BindCloneVAppParamsToXmlPayloadTest.java https://github.com/edwardt/jclouds.git | Java | 120 lines
                    
35
                    
36import com.google.common.collect.ImmutableList;
                    
37import com.google.common.collect.ImmutableMap;
                    
37import com.google.common.collect.ImmutableMap;
                    
38import com.google.common.collect.ImmutableMap.Builder;
                    
39import com.google.inject.AbstractModule;
                    
39import com.google.inject.AbstractModule;
                    
40import com.google.inject.Guice;
                    
41import com.google.inject.Injector;
                    
41import com.google.inject.Injector;
                    
42import com.google.inject.name.Names;
                    
43
                    
50public class BindCloneVAppParamsToXmlPayloadTest {
                    
51   Injector injector = Guice.createInjector(new AbstractModule() {
                    
52
                    
                
PatternRepositoryTest.java https://github.com/Zenika/DORM.git | Java | 90 lines
                    
3import com.google.inject.AbstractModule;
                    
4import com.google.inject.Guice;
                    
5import com.google.inject.Injector;
                    
59        DormResource expectedResource = new DefaultDormResource("zenika_test", "jar", testJarRepo);
                    
60        Injector injector = Guice.createInjector(new AbstractModule() {
                    
61            @Override
                    
                
Errors.java https://gitlab.com/sharadag/elasticsearch | Java | 658 lines
                    
1/*
                    
2 * Copyright (C) 2006 Google Inc.
                    
3 *
                    
65 *
                    
66 * @author jessewilson@google.com (Jesse Wilson)
                    
67 */
                    
119     * same message for both bind time errors:
                    
120     * <pre><code>Guice.createInjector(new AbstractModule() {
                    
121     *   public void configure() {
                    
125     * ...and at provide-time errors:
                    
126     * <pre><code>Guice.createInjector().getInstance(Runnable.class);</code></pre>
                    
127     * Otherwise we need to know who's calling when resolving a just-in-time
                    
200
                    
201    public Errors cannotBindToGuiceType(String simpleName) {
                    
202        return addMessage("Binding to core guice framework type is not allowed: %s.", simpleName);
                    
                
SpiBindingsTest.java https://github.com/peterlynch/spice.git | Java | 388 lines
                    
21import com.google.inject.Binding;
                    
22import com.google.inject.Guice;
                    
23import com.google.inject.Inject;
                    
26import com.google.inject.Module;
                    
27import com.google.inject.Provider;
                    
28import com.google.inject.Scope;
                    
237  public void testConvertedConstantBinding() {
                    
238    Injector injector = Guice.createInjector(new AbstractModule() {
                    
239      protected void configure() {
                    
258  public void testProviderBinding() {
                    
259    Injector injector = Guice.createInjector(new AbstractModule() {
                    
260      protected void configure() {
                    
347  public void checkInjector(Module module, ElementVisitor<?>... visitors) {
                    
348    Injector injector = Guice.createInjector(module);
                    
349
                    
                
RoboGuice.java https://code.google.com/p/roboguice/ | Java | 218 lines
                    
67     *
                    
68     * RoboGuice.setAppliationInjector( app, RoboGuice.DEFAULT_STAGE, Modules.override(RoboGuice.newDefaultRoboModule(app)).with(new MyModule() );
                    
69     *
                    
70     * @see com.google.inject.util.Modules#override(com.google.inject.Module...)
                    
71     * @see roboguice.RoboGuice#setBaseApplicationInjector(android.app.Application, com.google.inject.Stage, com.google.inject.Module...)
                    
72     * @see roboguice.RoboGuice#newDefaultRoboModule(android.app.Application)
                    
72     * @see roboguice.RoboGuice#newDefaultRoboModule(android.app.Application)
                    
73     * @see roboguice.RoboGuice#DEFAULT_STAGE
                    
74     *
                    
74     *
                    
75     * If using this method with test cases, be sure to call {@link roboguice.RoboGuice.util#reset()} in your test teardown methods
                    
76     * to avoid polluting our other tests with your custom injector.  Don't do this in your real application though.
                    
93        synchronized (RoboGuice.class) {
                    
94            final Injector rtrn = Guice.createInjector(stage, modules);
                    
95            injectors.put(application,rtrn);
                    
                
HeadlessReplyTest.java https://github.com/juven/sitebricks.git | Java | 230 lines
                    
19import com.google.inject.AbstractModule;
                    
20import com.google.inject.Guice;
                    
21import com.google.inject.Injector;
                    
22import com.google.sitebricks.client.transport.Json;
                    
23import com.google.sitebricks.client.transport.Text;
                    
24import com.google.sitebricks.client.transport.Xml;
                    
56  public void textReply() throws IOException {
                    
57    Injector injector = Guice.createInjector();
                    
58    HeadlessRenderer renderer = injector.getInstance(HeadlessRenderer.class);
                    
80  public void jsonReply() throws IOException {
                    
81    Injector injector = Guice.createInjector(new AbstractModule() {
                    
82      @SuppressWarnings("rawtypes")
                    
121  public void xmlReplyWithHeaders() throws IOException {
                    
122    Injector injector = Guice.createInjector();
                    
123    HeadlessRenderer renderer = injector.getInstance(HeadlessRenderer.class);
                    
                
BundleActivation.java https://github.com/sonatype/sonatype-peaberry.git | Java | 193 lines
                    
29import com.google.inject.Binding;
                    
30import com.google.inject.Guice;
                    
31import com.google.inject.Injector;
                    
31import com.google.inject.Injector;
                    
32import com.google.inject.Key;
                    
33import com.google.inject.Module;
                    
34import com.google.inject.Scope;
                    
35import com.google.inject.Scopes;
                    
36import com.google.inject.Singleton;
                    
36import com.google.inject.Singleton;
                    
37import com.google.inject.spi.BindingScopingVisitor;
                    
38
                    
159    injector =
                    
160        Guice.createInjector(Peaberry.osgiModule(bundle.getBundleContext()), Reflection
                    
161            .create(moduleClass));
                    
                
InstantiateVAppTemplateOptionsTest.java https://github.com/edwardt/jclouds.git | Java | 90 lines
                    
33import com.google.common.collect.Iterables;
                    
34import com.google.inject.Guice;
                    
35import com.google.inject.Injector;
                    
44
                    
45   Injector injector = Guice.createInjector(new SaxParserModule());
                    
46
                    
                
TodoServlet.java https://github.com/jskvara/ae-sources.git | Java | 138 lines
                    
2
                    
3import com.google.inject.Guice;
                    
4import com.google.inject.Injector;
                    
5import entity.TodoEntity;
                    
6import guice.GuiceModule;
                    
7import java.io.IOException;
                    
24
                    
25		Injector injector = Guice.createInjector(new GuiceModule());
                    
26		TodoService todoService = injector.getInstance(TodoService.class);
                    
                
TestJsonModule.java https://gitlab.com/CORP-RESELLER/airlift | Java | 389 lines
                    
25import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
                    
26import com.google.common.base.Joiner;
                    
27import com.google.common.base.Splitter;
                    
27import com.google.common.base.Splitter;
                    
28import com.google.common.collect.ImmutableList;
                    
29import com.google.common.collect.ImmutableSet;
                    
31import com.google.inject.Binder;
                    
32import com.google.inject.Guice;
                    
33import com.google.inject.Injector;
                    
64    {
                    
65        Injector injector = Guice.createInjector(new JsonModule(),
                    
66                new Module()
                    
81    {
                    
82        Injector injector = Guice.createInjector(new JsonModule());
                    
83        JsonCodecFactory codecFactory = injector.getInstance(JsonCodecFactory.class);
                    
                
 

Source

Language