PageRenderTime 23ms queryTime 54ms sortTime 2ms getByIdsTime 40ms findMatchingLines 35ms

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

Not the results you expected?
ParseAsyncJobFromHttpResponseTest.java https://github.com/alasdairhodge/jclouds.git | Java | 222 lines
                    
42import com.google.common.collect.ImmutableMap;
                    
43import com.google.inject.Guice;
                    
44import com.google.inject.Injector;
                    
51
                    
52   Injector i = Guice.createInjector(new GsonModule() {
                    
53
                    
                
FreemarkerTemplateCompilerTest.java https://github.com/mgenov/sitebricks.git | Java | 429 lines
                    
4import com.google.inject.AbstractModule;
                    
5import com.google.inject.Guice;
                    
6import com.google.inject.Injector;
                    
60
                    
61    injector = Guice.createInjector(new AbstractModule() {
                    
62      protected void configure() {
                    
236//  public final void readAndRenderRequireWidget() {
                    
237//    final Injector injector = Guice.createInjector(new AbstractModule() {
                    
238//      protected void configure() {
                    
338//  public final void readEmbedWidgetAndStoreAsPage() {
                    
339//    final Injector injector = Guice.createInjector(new AbstractModule() {
                    
340//      protected void configure() {
                    
378//  public final void readEmbedWidgetOnly() {
                    
379//    final Injector injector = Guice.createInjector(new AbstractModule() {
                    
380//      protected void configure() {
                    
                
VirtualGuestToNodeMetadataTest.java https://github.com/richardcloudsoft/legacy-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
                    
                
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
                    
                
BaseTemplateBuilderLiveTest.java https://github.com/richardcloudsoft/legacy-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));
                    
                
BaseTemplateBuilderLiveTest.java https://github.com/andreisavu/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));
                    
                
VAppHandlerTest.java https://github.com/raschyoung/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
                    
                
ElasticStackClientLiveTest.java https://github.com/richardcloudsoft/legacy-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);
                    
                
BaseTemplateBuilderLiveTest.java https://github.com/alasdairhodge/jclouds.git | Java | 304 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;
                    
56import com.google.common.collect.Sets;
                    
57import com.google.inject.Guice;
                    
58import com.google.inject.Module;
                    
129      Map<OsFamily, Map<String, String>> map = new BaseComputeServiceContextModule() {
                    
130      }.provideOsVersionMap(new ComputeServiceConstants.ReferenceData(), Guice.createInjector(new GsonModule())
                    
131            .getInstance(Json.class));
                    
                
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
                    
                
CredentialStoreModuleTest.java https://github.com/richardcloudsoft/legacy-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   }
                    
                
CredentialStoreModuleTest.java https://github.com/andreisavu/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   }
                    
                
VAppHandlerTest.java https://github.com/dmitrib/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() {
                    
                
WebAppTests.java https://github.com/vicaya/hadoop-patches.git | Java | 172 lines
                    
28
                    
29import com.google.inject.Module;
                    
30import com.google.inject.Scopes;
                    
30import com.google.inject.Scopes;
                    
31import com.google.inject.servlet.RequestScoped;
                    
32import com.google.inject.AbstractModule;
                    
32import com.google.inject.AbstractModule;
                    
33import com.google.inject.Guice;
                    
34import com.google.inject.Injector;
                    
34import com.google.inject.Injector;
                    
35import com.google.inject.Provides;
                    
36
                    
56                                                final Module... modules) {
                    
57    return Guice.createInjector(new AbstractModule() {
                    
58      final PrintWriter writer = spy(new PrintWriter(System.out));
                    
                
RestfuWebServiceWithSubpaths2AcceptanceTest.java https://github.com/mgenov/sitebricks.git | Java | 167 lines
                    
4import com.google.inject.AbstractModule;
                    
5import com.google.inject.Guice;
                    
6import com.google.inject.Injector;
                    
25  public void shouldServiceTopLevelDynamicPath() {
                    
26    WebResponse response = createInjector()
                    
27        .getInstance(Web.class)
                    
36  public void shouldServiceFirstLevelStaticPath() {
                    
37    WebResponse response = createInjector()
                    
38        .getInstance(Web.class)
                    
47  public void shouldServiceSameFirstLevelStaticPathWithPutMethod() {
                    
48    WebResponse response = createInjector()
                    
49        .getInstance(Web.class)
                    
137	private Injector createInjector() {
                    
138		return Guice.createInjector(new AbstractModule() {
                    
139	      protected void configure() {
                    
                
WebAppTests.java https://github.com/patrickangeles/hadoop-common.git | Java | 172 lines
                    
28
                    
29import com.google.inject.Module;
                    
30import com.google.inject.Scopes;
                    
30import com.google.inject.Scopes;
                    
31import com.google.inject.servlet.RequestScoped;
                    
32import com.google.inject.AbstractModule;
                    
32import com.google.inject.AbstractModule;
                    
33import com.google.inject.Guice;
                    
34import com.google.inject.Injector;
                    
34import com.google.inject.Injector;
                    
35import com.google.inject.Provides;
                    
36
                    
56                                                final Module... modules) {
                    
57    return Guice.createInjector(new AbstractModule() {
                    
58      final PrintWriter writer = spy(new PrintWriter(System.out));
                    
                
GreenQloudComputeReviseParsedImageTest.java https://github.com/richardcloudsoft/legacy-jclouds.git | Java | 256 lines
                    
44
                    
45import com.google.common.base.Predicates;
                    
46import com.google.common.base.Suppliers;
                    
46import com.google.common.base.Suppliers;
                    
47import com.google.common.collect.ImmutableMap;
                    
48import com.google.common.collect.ImmutableSet;
                    
48import com.google.common.collect.ImmutableSet;
                    
49import com.google.common.collect.Iterables;
                    
50import com.google.common.collect.Sets;
                    
50import com.google.common.collect.Sets;
                    
51import com.google.inject.Guice;
                    
52
                    
243      Map<OsFamily, Map<String, String>> map = new BaseComputeServiceContextModule() {
                    
244      }.provideOsVersionMap(new ComputeServiceConstants.ReferenceData(), Guice.createInjector(new GsonModule())
                    
245               .getInstance(Json.class));
                    
                
WebAppTests.java https://github.com/Beckham007/hadoop-common.git | Java | 172 lines
                    
28
                    
29import com.google.inject.Module;
                    
30import com.google.inject.Scopes;
                    
30import com.google.inject.Scopes;
                    
31import com.google.inject.servlet.RequestScoped;
                    
32import com.google.inject.AbstractModule;
                    
32import com.google.inject.AbstractModule;
                    
33import com.google.inject.Guice;
                    
34import com.google.inject.Injector;
                    
34import com.google.inject.Injector;
                    
35import com.google.inject.Provides;
                    
36
                    
56                                                final Module... modules) {
                    
57    return Guice.createInjector(new AbstractModule() {
                    
58      final PrintWriter writer = spy(new PrintWriter(System.out));
                    
                
ParseAsyncJobFromHttpResponseTest.java https://github.com/richardcloudsoft/legacy-jclouds.git | Java | 222 lines
                    
41import com.google.common.collect.ImmutableMap;
                    
42import com.google.inject.Guice;
                    
43import com.google.inject.Injector;
                    
50
                    
51   Injector i = Guice.createInjector(new GsonModule() {
                    
52
                    
                
WebAppTests.java https://github.com/yuvrajm/hadoop-common.git | Java | 172 lines
                    
28
                    
29import com.google.inject.Module;
                    
30import com.google.inject.Scopes;
                    
30import com.google.inject.Scopes;
                    
31import com.google.inject.servlet.RequestScoped;
                    
32import com.google.inject.AbstractModule;
                    
32import com.google.inject.AbstractModule;
                    
33import com.google.inject.Guice;
                    
34import com.google.inject.Injector;
                    
34import com.google.inject.Injector;
                    
35import com.google.inject.Provides;
                    
36
                    
56                                                final Module... modules) {
                    
57    return Guice.createInjector(new AbstractModule() {
                    
58      final PrintWriter writer = spy(new PrintWriter(System.out));
                    
                
ParseAsyncJobFromHttpResponseTest.java https://github.com/andreisavu/jclouds.git | Java | 222 lines
                    
41import com.google.common.collect.ImmutableMap;
                    
42import com.google.inject.Guice;
                    
43import com.google.inject.Injector;
                    
50
                    
51   Injector i = Guice.createInjector(new GsonModule() {
                    
52
                    
                
FormatSharedNamesAndAppendUniqueStringToThoseWhichRepeatTest.java https://github.com/richardcloudsoft/legacy-jclouds.git | Java | 182 lines
                    
30
                    
31import com.google.common.base.Supplier;
                    
32import com.google.common.base.Suppliers;
                    
33import com.google.inject.AbstractModule;
                    
34import com.google.inject.Guice;
                    
35import com.google.inject.TypeLiteral;
                    
111   public void testPropertyChangesDelimiter() {
                    
112      GroupNamingConvention fn = Guice.createInjector(new AbstractModule() {
                    
113
                    
126   public void testPropertyChangesPrefix() {
                    
127      GroupNamingConvention fn = Guice.createInjector(new AbstractModule() {
                    
128
                    
142   public void testCanChangeSuffixSupplier() {
                    
143      GroupNamingConvention fn = Guice.createInjector(new AbstractModule() {
                    
144
                    
                
FormatSharedNamesAndAppendUniqueStringToThoseWhichRepeatTest.java https://github.com/andreisavu/jclouds.git | Java | 182 lines
                    
30
                    
31import com.google.common.base.Supplier;
                    
32import com.google.common.base.Suppliers;
                    
33import com.google.inject.AbstractModule;
                    
34import com.google.inject.Guice;
                    
35import com.google.inject.TypeLiteral;
                    
111   public void testPropertyChangesDelimiter() {
                    
112      GroupNamingConvention fn = Guice.createInjector(new AbstractModule() {
                    
113
                    
126   public void testPropertyChangesPrefix() {
                    
127      GroupNamingConvention fn = Guice.createInjector(new AbstractModule() {
                    
128
                    
142   public void testCanChangeSuffixSupplier() {
                    
143      GroupNamingConvention fn = Guice.createInjector(new AbstractModule() {
                    
144
                    
                
VAppHandlerTest.java https://github.com/dmitrib/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
                    
                
StatsIntegrationTest.java https://github.com/mgenov/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
                    
                
EmbeddedOozieServer.java https://github.com/apache/oozie.git | Java | 290 lines
                    
20
                    
21import com.google.inject.Guice;
                    
22import com.google.inject.Inject;
                    
22import com.google.inject.Inject;
                    
23import com.google.inject.Injector;
                    
24import com.google.inject.ProvisionException;
                    
25import org.apache.hadoop.conf.Configuration;
                    
26import org.apache.oozie.server.guice.OozieGuiceModule;
                    
27import org.apache.oozie.service.ConfigurationService;
                    
268    public static void main(String[] args) throws Exception {
                    
269        final Injector guiceInjector = Guice.createInjector(new OozieGuiceModule());
                    
270
                    
272        try {
                    
273            embeddedOozieServer = guiceInjector.getInstance(EmbeddedOozieServer.class);
                    
274        }
                    
                
VAppHandlerTest.java https://github.com/regularfry/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
                    
                
CatalogHandlerTest.java https://github.com/regularfry/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);
                    
                
FoobarServiceTest.java https://github.com/yizumi/foobar-server.git | Java | 357 lines
                    
10
                    
11import com.google.appengine.tools.development.testing.LocalDatastoreServiceTestConfig;
                    
12import com.google.appengine.tools.development.testing.LocalServiceTestHelper;
                    
12import com.google.appengine.tools.development.testing.LocalServiceTestHelper;
                    
13import com.google.inject.Guice;
                    
14import com.google.inject.Injector;
                    
30		helper.setUp();
                    
31		injector = Guice.createInjector(new TestModule());
                    
32	}
                    
                
AWSRunningInstanceToNodeMetadataTest.java https://github.com/alasdairhodge/jclouds.git | Java | 201 lines
                    
46
                    
47import com.google.common.base.Supplier;
                    
48import com.google.common.base.Suppliers;
                    
48import com.google.common.base.Suppliers;
                    
49import com.google.common.cache.LoadingCache;
                    
50import com.google.common.cache.CacheBuilder;
                    
50import com.google.common.cache.CacheBuilder;
                    
51import com.google.common.cache.CacheLoader;
                    
52import com.google.common.collect.ImmutableMap;
                    
54import com.google.common.collect.Iterables;
                    
55import com.google.inject.Guice;
                    
56
                    
70   protected void setUpInjector() {
                    
71      dateService = Guice.createInjector().getInstance(DateService.class);
                    
72      assert dateService != null;
                    
                
S3ParserTest.java https://github.com/alasdairhodge/jclouds.git | Java | 189 lines
                    
51import com.google.common.collect.Iterables;
                    
52import com.google.inject.Guice;
                    
53import com.google.inject.Injector;
                    
68   protected void setUpInjector() {
                    
69      injector = Guice.createInjector(new SaxParserModule() {
                    
70         public void configure() {
                    
                
VAppHandlerTest.java https://github.com/richardcloudsoft/legacy-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
                    
                
VAppHandlerTest.java https://github.com/andreisavu/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
                    
                
BindRestContextWithWildcardExtendsExplicitAndRawTypeTest.java https://github.com/andreisavu/jclouds.git | Java | 128 lines
                    
37
                    
38import com.google.common.reflect.TypeToken;
                    
39import com.google.inject.AbstractModule;
                    
39import com.google.inject.AbstractModule;
                    
40import com.google.inject.Guice;
                    
41import com.google.inject.Injector;
                    
74   private Injector injectorFor(ProviderMetadata md) {
                    
75      return Guice.createInjector(
                    
76               new BindNameToContext("test"),
                    
                
BindCloneVAppTemplateParamsToXmlPayloadTest.java https://github.com/andreisavu/jclouds.git | Java | 123 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 BindCloneVAppTemplateParamsToXmlPayloadTest {
                    
51   Injector injector = Guice.createInjector(new AbstractModule() {
                    
52
                    
                
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);
                    
                
RedirectionRetryHandlerTest.java https://github.com/regularfry/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")
                    
                
BaseLoadBalancerServiceLiveTest.java https://github.com/alasdairhodge/jclouds.git | Java | 181 lines
                    
20
                    
21import static com.google.common.base.Preconditions.checkNotNull;
                    
22import static org.testng.Assert.assertNotNull;
                    
50import com.google.common.collect.ImmutableSet;
                    
51import com.google.inject.Guice;
                    
52import com.google.inject.Module;
                    
134   protected void buildSocketTester() {
                    
135      SocketOpen socketOpen = Guice.createInjector(getSshModule()).getInstance(SocketOpen.class);
                    
136      socketTester = new RetryablePredicate<IPSocket>(socketOpen, 60, 1, TimeUnit.SECONDS);
                    
                
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);
                    
                
VAppHandlerTest.java https://github.com/vkris/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
                    
                
VAppHandlerTest.java https://github.com/ddurnev/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
                    
                
LocalizationTest.java https://github.com/mgenov/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
                    
                
CatalogHandlerTest.java https://github.com/vkris/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);
                    
                
CatalogHandlerTest.java https://github.com/ddurnev/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);
                    
                
YamlNodeStoreModuleTest.java https://github.com/vkris/jclouds.git | Java | 196 lines
                    
42import com.google.inject.AbstractModule;
                    
43import com.google.inject.Guice;
                    
44import com.google.inject.Injector;
                    
75      checkConsistent(map, getStore(createInjectorWithProvidedMap(map)), "test", "instance1", "instancename");
                    
76      checkConsistent(map, getStore(createInjectorWithProvidedMap(map)), "test", "instance1", "instancename");
                    
77      remove(map, getStore(createInjectorWithProvidedMap(map)), "test");
                    
84
                    
85      Injector injector = createInjectorWithProvidedMap(map);
                    
86      assertEquals(injector.getInstance(Key.get(new TypeLiteral<Map<String, InputStream>>() {
                    
127   protected Injector createInjectorWithProvidedMap(Map<String, InputStream> map) {
                    
128      return Guice.createInjector(new YamlNodeStoreModule(map), new AbstractModule() {
                    
129
                    
139   protected Injector createInjector() {
                    
140      return Guice.createInjector(new YamlNodeStoreModule(), new AbstractModule() {
                    
141
                    
                
YamlNodeStoreModuleTest.java https://github.com/ddurnev/jclouds.git | Java | 196 lines
                    
42import com.google.inject.AbstractModule;
                    
43import com.google.inject.Guice;
                    
44import com.google.inject.Injector;
                    
75      checkConsistent(map, getStore(createInjectorWithProvidedMap(map)), "test", "instance1", "instancename");
                    
76      checkConsistent(map, getStore(createInjectorWithProvidedMap(map)), "test", "instance1", "instancename");
                    
77      remove(map, getStore(createInjectorWithProvidedMap(map)), "test");
                    
84
                    
85      Injector injector = createInjectorWithProvidedMap(map);
                    
86      assertEquals(injector.getInstance(Key.get(new TypeLiteral<Map<String, InputStream>>() {
                    
127   protected Injector createInjectorWithProvidedMap(Map<String, InputStream> map) {
                    
128      return Guice.createInjector(new YamlNodeStoreModule(map), new AbstractModule() {
                    
129
                    
139   protected Injector createInjector() {
                    
140      return Guice.createInjector(new YamlNodeStoreModule(), new AbstractModule() {
                    
141
                    
                
GuiceServletConfig.java https://github.com/regularfry/jclouds.git | Java | 169 lines
                    
56import com.google.appengine.api.taskqueue.TaskOptions.Method;
                    
57import com.google.appengine.repackaged.com.google.common.base.Splitter;
                    
58import com.google.common.collect.ImmutableSet;
                    
65import com.google.inject.name.Names;
                    
66import com.google.inject.servlet.GuiceServletContextListener;
                    
67import com.google.inject.servlet.ServletModule;
                    
73 */
                    
74public class GuiceServletConfig extends GuiceServletContextListener {
                    
75   public static final String PROPERTY_BLOBSTORE_CONTEXTS = "blobstore.contexts";
                    
88
                    
89      Module googleModule = new GoogleAppEngineConfigurationModule();
                    
90      Set<Module> modules = ImmutableSet.<Module> of(googleModule);
                    
147   protected Injector getInjector() {
                    
148      return Guice.createInjector(new ServletModule() {
                    
149         @Override
                    
                
MainUI.java https://github.com/mistaecko/jstestdriver.git | Java | 178 lines
                    
24import com.google.inject.Binder;
                    
25import com.google.inject.Guice;
                    
26import com.google.inject.Injector;
                    
33import com.google.jstestdriver.Flags;
                    
34import com.google.jstestdriver.JsTestDriver;
                    
35import com.google.jstestdriver.PluginLoader;
                    
42import com.google.jstestdriver.config.YamlParser;
                    
43import com.google.jstestdriver.guice.TestResultPrintingModule.TestResultPrintingInitializer;
                    
44import com.google.jstestdriver.hooks.PluginInitializer;
                    
133      });
                    
134      final Injector initializeInjector = Guice.createInjector(initializeModules);
                    
135
                    
140
                    
141      final Injector injector = Guice.createInjector(actionRunnerModules);
                    
142
                    
                
TestLifeCycleManager.java https://gitlab.com/CORP-RESELLER/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,
                    
                
CommandTestSupport.java https://github.com/olamy/tesla.git | Java | 248 lines
                    
18import com.google.inject.AbstractModule;
                    
19import com.google.inject.Guice;
                    
20import com.google.inject.Injector;
                    
20import com.google.inject.Injector;
                    
21import com.google.inject.Module;
                    
22import com.google.inject.Stage;
                    
37import org.sonatype.gshell.console.ConsolePrompt;
                    
38import org.sonatype.gshell.guice.CoreModule;
                    
39import org.sonatype.gshell.logging.LoggingSystem;
                    
46import org.sonatype.gshell.variables.VariablesImpl;
                    
47import org.sonatype.guice.bean.binders.SpaceModule;
                    
48import org.sonatype.guice.bean.binders.WireModule;
                    
122
                    
123        Injector injector = Guice.createInjector(Stage.DEVELOPMENT, new WireModule(modules));
                    
124        container.add(injector, 0);
                    
                
SshjSshClientTest.java https://github.com/alasdairhodge/jclouds.git | Java | 215 lines
                    
20
                    
21import static com.google.inject.name.Names.bindProperties;
                    
22import static org.easymock.EasyMock.expect;
                    
52import com.google.inject.AbstractModule;
                    
53import com.google.inject.Guice;
                    
54import com.google.inject.Injector;
                    
54import com.google.inject.Injector;
                    
55import com.google.inject.Module;
                    
56
                    
75   protected SshjSshClient createClient(final Properties props) {
                    
76      Injector i = Guice.createInjector(module(), new AbstractModule() {
                    
77
                    
                
WebAppTests.java https://github.com/bmahe/hadoop-common.git | Java | 172 lines
                    
28
                    
29import com.google.inject.Module;
                    
30import com.google.inject.Scopes;
                    
30import com.google.inject.Scopes;
                    
31import com.google.inject.servlet.RequestScoped;
                    
32import com.google.inject.AbstractModule;
                    
32import com.google.inject.AbstractModule;
                    
33import com.google.inject.Guice;
                    
34import com.google.inject.Injector;
                    
34import com.google.inject.Injector;
                    
35import com.google.inject.Provides;
                    
36
                    
56                                                final Module... modules) {
                    
57    return Guice.createInjector(new AbstractModule() {
                    
58      final PrintWriter writer = spy(new PrintWriter(System.out));
                    
                
RedirectionRetryHandlerTest.java https://github.com/vkris/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")
                    
                
RedirectionRetryHandlerTest.java https://github.com/ddurnev/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")
                    
                
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
                    
                
ParseImageFromJsonResponseTest.java https://github.com/regularfry/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
                    
                
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)));
                    
                
AutobindTests.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(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)));
                    
                
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 =
                    
                
GuiceServletConfig.java https://github.com/vkris/jclouds.git | Java | 169 lines
                    
56import com.google.appengine.api.taskqueue.TaskOptions.Method;
                    
57import com.google.appengine.repackaged.com.google.common.base.Splitter;
                    
58import com.google.common.collect.ImmutableSet;
                    
65import com.google.inject.name.Names;
                    
66import com.google.inject.servlet.GuiceServletContextListener;
                    
67import com.google.inject.servlet.ServletModule;
                    
73 */
                    
74public class GuiceServletConfig extends GuiceServletContextListener {
                    
75   public static final String PROPERTY_BLOBSTORE_CONTEXTS = "blobstore.contexts";
                    
88
                    
89      Module googleModule = new GoogleAppEngineConfigurationModule();
                    
90      Set<Module> modules = ImmutableSet.<Module> of(googleModule);
                    
147   protected Injector getInjector() {
                    
148      return Guice.createInjector(new ServletModule() {
                    
149         @Override
                    
                
GuiceServletConfig.java https://github.com/ddurnev/jclouds.git | Java | 169 lines
                    
56import com.google.appengine.api.taskqueue.TaskOptions.Method;
                    
57import com.google.appengine.repackaged.com.google.common.base.Splitter;
                    
58import com.google.common.collect.ImmutableSet;
                    
65import com.google.inject.name.Names;
                    
66import com.google.inject.servlet.GuiceServletContextListener;
                    
67import com.google.inject.servlet.ServletModule;
                    
73 */
                    
74public class GuiceServletConfig extends GuiceServletContextListener {
                    
75   public static final String PROPERTY_BLOBSTORE_CONTEXTS = "blobstore.contexts";
                    
88
                    
89      Module googleModule = new GoogleAppEngineConfigurationModule();
                    
90      Set<Module> modules = ImmutableSet.<Module> of(googleModule);
                    
147   protected Injector getInjector() {
                    
148      return Guice.createInjector(new ServletModule() {
                    
149         @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  }
                    
                
BindBlockDeviceMappingToIndexedFormParamsTest.java https://github.com/regularfry/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
                    
                
BindNodeConfigurationToXmlPayloadTest.java https://github.com/regularfry/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
                    
                
WebAppTests.java https://github.com/dralves/hadoop-common.git | Java | 172 lines
                    
28
                    
29import com.google.inject.Module;
                    
30import com.google.inject.Scopes;
                    
30import com.google.inject.Scopes;
                    
31import com.google.inject.servlet.RequestScoped;
                    
32import com.google.inject.AbstractModule;
                    
32import com.google.inject.AbstractModule;
                    
33import com.google.inject.Guice;
                    
34import com.google.inject.Injector;
                    
34import com.google.inject.Injector;
                    
35import com.google.inject.Provides;
                    
36
                    
56                                                final Module... modules) {
                    
57    return Guice.createInjector(new AbstractModule() {
                    
58      final PrintWriter writer = spy(new PrintWriter(System.out));
                    
                
WebAppTests.java https://github.com/gregsfortytwo/hadoop-common.git | Java | 172 lines
                    
28
                    
29import com.google.inject.Module;
                    
30import com.google.inject.Scopes;
                    
30import com.google.inject.Scopes;
                    
31import com.google.inject.servlet.RequestScoped;
                    
32import com.google.inject.AbstractModule;
                    
32import com.google.inject.AbstractModule;
                    
33import com.google.inject.Guice;
                    
34import com.google.inject.Injector;
                    
34import com.google.inject.Injector;
                    
35import com.google.inject.Provides;
                    
36
                    
56                                                final Module... modules) {
                    
57    return Guice.createInjector(new AbstractModule() {
                    
58      final PrintWriter writer = spy(new PrintWriter(System.out));
                    
                
ElasticStackClientLiveTest.java https://github.com/regularfry/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);
                    
                
ParseObjectMetadataFromHeadersTest.java https://github.com/regularfry/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
                    
                
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>();
                    
                
ParseContainerCDNMetadataListFromJsonResponseTest.java https://github.com/regularfry/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
                    
                
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() {
                    
                
WebAppTests.java https://github.com/lobotomyme/hadoop-common.git | Java | 172 lines
                    
28
                    
29import com.google.inject.Module;
                    
30import com.google.inject.Scopes;
                    
30import com.google.inject.Scopes;
                    
31import com.google.inject.servlet.RequestScoped;
                    
32import com.google.inject.AbstractModule;
                    
32import com.google.inject.AbstractModule;
                    
33import com.google.inject.Guice;
                    
34import com.google.inject.Injector;
                    
34import com.google.inject.Injector;
                    
35import com.google.inject.Provides;
                    
36
                    
56                                                final Module... modules) {
                    
57    return Guice.createInjector(new AbstractModule() {
                    
58      final PrintWriter writer = spy(new PrintWriter(System.out));
                    
                
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() {
                    
                
SoftLayerErrorHandlerTest.java https://github.com/richardcloudsoft/legacy-jclouds.git | Java | 124 lines
                    
36
                    
37import com.google.inject.Guice;
                    
38
                    
87
                    
88      SoftLayerErrorHandler function = Guice.createInjector().getInstance(SoftLayerErrorHandler.class);
                    
89
                    
                
BindInstantiateVAppTemplateParamsToXmlPayloadTest.java https://github.com/andreisavu/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
                    
                
RunScriptOnNodeAsInitScriptUsingSshAndBlockUntilCompleteTest.java https://github.com/alasdairhodge/jclouds.git | Java | 287 lines
                    
49
                    
50import com.google.common.base.Functions;
                    
51import com.google.common.base.Stopwatch;
                    
51import com.google.common.base.Stopwatch;
                    
52import com.google.common.collect.ImmutableMap;
                    
53import com.google.common.collect.ImmutableSet;
                    
54import com.google.inject.AbstractModule;
                    
55import com.google.inject.Guice;
                    
56import com.google.inject.assistedinject.FactoryModuleBuilder;
                    
64
                    
65   BlockUntilInitScriptStatusIsZeroThenReturnOutput.Factory statusFactory = Guice.createInjector(
                    
66            new ExecutorServiceModule(MoreExecutors.sameThreadExecutor(), MoreExecutors.sameThreadExecutor()),
                    
80   // fail faster than normal
                    
81   Timeouts timeouts = Guice.createInjector(new AbstractModule() {
                    
82
                    
                
ListKeysTest.java https://github.com/regularfry/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   }
                    
                
ListAccountsResponseTest.java https://github.com/regularfry/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
                    
                
ParseImageFromJsonResponseTest.java https://github.com/vkris/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
                    
                
ParseImageFromJsonResponseTest.java https://github.com/ddurnev/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
                    
                
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
                    
                
BindBlockDeviceMappingToIndexedFormParamsTest.java https://github.com/vkris/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
                    
                
BindBlockDeviceMappingToIndexedFormParamsTest.java https://github.com/ddurnev/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
                    
                
AWSRunInstancesResponseHandlerTest.java https://github.com/regularfry/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
                    
                
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();
                    
                
BindNodeConfigurationToXmlPayloadTest.java https://github.com/vkris/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
                    
                
BindNodeConfigurationToXmlPayloadTest.java https://github.com/ddurnev/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
                    
                
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
                    
                
Rules4JBIBootstrap.java https://bitbucket.org/ssteinmetz/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        
                    
                
CatalogHandlerTest.java https://github.com/richardcloudsoft/legacy-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);
                    
                
CatalogHandlerTest.java https://github.com/andreisavu/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);
                    
                
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
                    
                
ParseObjectMetadataFromHeadersTest.java https://github.com/vkris/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
                    
                
ParseObjectMetadataFromHeadersTest.java https://github.com/ddurnev/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
                    
                
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
                    
                
ElasticStackClientLiveTest.java https://github.com/vkris/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);
                    
                
ElasticStackClientLiveTest.java https://github.com/ddurnev/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);
                    
                
TestLifeCycleManager.java https://gitlab.com/github-cloud-corp/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,
                    
                
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,
                    
                
VDCHandlerTest.java https://github.com/regularfry/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);
                    
                
ParseContainerCDNMetadataListFromJsonResponseTest.java https://github.com/vkris/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
                    
                
ParseContainerCDNMetadataListFromJsonResponseTest.java https://github.com/ddurnev/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
                    
                
ListKeysTest.java https://github.com/vkris/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   }
                    
                
ListKeysTest.java https://github.com/ddurnev/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   }
                    
                
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);
                    
                
VAppTemplateHandlerTest.java https://github.com/regularfry/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);
                    
                
ParseAsyncJobFromHttpResponseTest.java https://github.com/regularfry/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
                    
                
ListAccountsResponseTest.java https://github.com/vkris/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
                    
                
ListAccountsResponseTest.java https://github.com/ddurnev/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
                    
                
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);
                    
                
VAppHandlerTest.java https://github.com/gnodet/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
                    
                
RunScriptOnNodeAsInitScriptUsingSshAndBlockUntilCompleteTest.java https://github.com/machak/jclouds.git | Java | 245 lines
                    
44
                    
45import com.google.common.base.Functions;
                    
46import com.google.common.collect.ImmutableMap;
                    
46import com.google.common.collect.ImmutableMap;
                    
47import com.google.common.collect.ImmutableSet;
                    
48import com.google.inject.AbstractModule;
                    
48import com.google.inject.AbstractModule;
                    
49import com.google.inject.Guice;
                    
50import com.google.inject.assistedinject.FactoryModuleBuilder;
                    
58
                    
59   BlockUntilInitScriptStatusIsZeroThenReturnOutput.Factory statusFactory = Guice.createInjector(
                    
60            new ExecutorServiceModule(MoreExecutors.sameThreadExecutor(), MoreExecutors.sameThreadExecutor()),
                    
74   // fail faster than normal
                    
75   Timeouts timeouts = Guice.createInjector(new AbstractModule() {
                    
76
                    
                
AtmosphereGuiceServlet.java https://github.com/ayush/atmosphere.git | Java | 183 lines
                    
58import com.google.inject.name.Names;
                    
59import com.sun.jersey.guice.spi.container.servlet.GuiceContainer;
                    
60import org.atmosphere.cpr.AtmosphereServlet;
                    
84            &lt;servlet-name&gt;AtmosphereServlet&lt;/servlet-name&gt;
                    
85            &lt;servlet-class&gt;org.atmosphere.guice.AtmosphereGuiceServlet&lt;/servlet-class&gt;
                    
86            &lt;load-on-startup&gt;0&lt;/load-on-startup&gt;
                    
99        protected Injector getInjector() {
                    
100            return Guice.createInjector(new ServletModule() {
                    
101                @Override
                    
119    public static final String JERSEY_PROPERTIES = AtmosphereGuiceServlet.class.getName() + ".properties";
                    
120    private static final String GUICE_FILTER = "com.google.inject.servlet.GuiceFilter";
                    
121
                    
146        Injector injector = (Injector) config.getServletContext().getAttribute(Injector.class.getName());
                    
147        GuiceContainer guiceServlet = injector.getInstance(GuiceContainer.class);
                    
148
                    
                
Errors.java https://github.com/avar/elasticsearch.git | Java | 649 lines
                    
1/**
                    
2 * Copyright (C) 2006 Google Inc.
                    
3 *
                    
62 *
                    
63 * @author jessewilson@google.com (Jesse Wilson)
                    
64 */
                    
116     * same message for both bind time errors:
                    
117     * <pre><code>Guice.createInjector(new AbstractModule() {
                    
118     *   public void configure() {
                    
122     * ...and at provide-time errors:
                    
123     * <pre><code>Guice.createInjector().getInstance(Runnable.class);</code></pre>
                    
124     * Otherwise we need to know who's calling when resolving a just-in-time
                    
197
                    
198    public Errors cannotBindToGuiceType(String simpleName) {
                    
199        return addMessage("Binding to core guice framework type is not allowed: %s.", simpleName);
                    
                
Errors.java https://github.com/bluelu/elasticsearch.git | Java | 649 lines
                    
1/**
                    
2 * Copyright (C) 2006 Google Inc.
                    
3 *
                    
62 *
                    
63 * @author jessewilson@google.com (Jesse Wilson)
                    
64 */
                    
116     * same message for both bind time errors:
                    
117     * <pre><code>Guice.createInjector(new AbstractModule() {
                    
118     *   public void configure() {
                    
122     * ...and at provide-time errors:
                    
123     * <pre><code>Guice.createInjector().getInstance(Runnable.class);</code></pre>
                    
124     * Otherwise we need to know who's calling when resolving a just-in-time
                    
197
                    
198    public Errors cannotBindToGuiceType(String simpleName) {
                    
199        return addMessage("Binding to core guice framework type is not allowed: %s.", simpleName);
                    
                
Errors.java https://github.com/tatemae/elasticsearch.git | Java | 649 lines
                    
1/**
                    
2 * Copyright (C) 2006 Google Inc.
                    
3 *
                    
62 *
                    
63 * @author jessewilson@google.com (Jesse Wilson)
                    
64 */
                    
116     * same message for both bind time errors:
                    
117     * <pre><code>Guice.createInjector(new AbstractModule() {
                    
118     *   public void configure() {
                    
122     * ...and at provide-time errors:
                    
123     * <pre><code>Guice.createInjector().getInstance(Runnable.class);</code></pre>
                    
124     * Otherwise we need to know who's calling when resolving a just-in-time
                    
197
                    
198    public Errors cannotBindToGuiceType(String simpleName) {
                    
199        return addMessage("Binding to core guice framework type is not allowed: %s.", simpleName);
                    
                
ComputeServiceUtilsTest.java https://github.com/richardcloudsoft/legacy-jclouds.git | Java | 146 lines
                    
43
                    
44import com.google.common.collect.ImmutableMap;
                    
45import com.google.common.collect.ImmutableSet;
                    
45import com.google.common.collect.ImmutableSet;
                    
46import com.google.inject.Guice;
                    
47
                    
79   Map<OsFamily, Map<String, String>> map = new BaseComputeServiceContextModule() {
                    
80   }.provideOsVersionMap(new ComputeServiceConstants.ReferenceData(), Guice.createInjector(new GsonModule())
                    
81         .getInstance(Json.class));
                    
                
ComputeServiceUtilsTest.java https://github.com/andreisavu/jclouds.git | Java | 146 lines
                    
43
                    
44import com.google.common.collect.ImmutableMap;
                    
45import com.google.common.collect.ImmutableSet;
                    
45import com.google.common.collect.ImmutableSet;
                    
46import com.google.inject.Guice;
                    
47
                    
79   Map<OsFamily, Map<String, String>> map = new BaseComputeServiceContextModule() {
                    
80   }.provideOsVersionMap(new ComputeServiceConstants.ReferenceData(), Guice.createInjector(new GsonModule())
                    
81         .getInstance(Json.class));
                    
                
AWSRunInstancesResponseHandlerTest.java https://github.com/vkris/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
                    
                
AWSRunInstancesResponseHandlerTest.java https://github.com/ddurnev/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
                    
                
AbstractChangeNotesTest.java https://gitlab.com/chenfengxu/gerrit | Java | 299 lines
                    
14
                    
15package com.google.gerrit.server.notedb;
                    
16
                    
16
                    
17import static com.google.inject.Scopes.SINGLETON;
                    
18import static java.util.concurrent.TimeUnit.SECONDS;
                    
19
                    
20import com.google.common.collect.ImmutableList;
                    
21import com.google.gerrit.common.TimeUtil;
                    
61import com.google.gwtorm.server.SchemaFactory;
                    
62import com.google.inject.Guice;
                    
63import com.google.inject.Inject;
                    
145    injector =
                    
146        Guice.createInjector(
                    
147            new FactoryModule() {
                    
                
CatalogHandlerTest.java https://github.com/gnodet/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);
                    
                
AWSRunningInstanceToNodeMetadataTest.java https://github.com/vkris/jclouds.git | Java | 172 lines
                    
45
                    
46import com.google.common.base.Function;
                    
47import com.google.common.base.Supplier;
                    
47import com.google.common.base.Supplier;
                    
48import com.google.common.base.Suppliers;
                    
49import com.google.common.cache.Cache;
                    
49import com.google.common.cache.Cache;
                    
50import com.google.common.cache.CacheBuilder;
                    
51import com.google.common.cache.CacheLoader;
                    
55import com.google.common.collect.Maps;
                    
56import com.google.inject.Guice;
                    
57
                    
71   protected void setUpInjector() {
                    
72      dateService = Guice.createInjector().getInstance(DateService.class);
                    
73      assert dateService != null;
                    
                
AWSRunningInstanceToNodeMetadataTest.java https://github.com/ddurnev/jclouds.git | Java | 172 lines
                    
45
                    
46import com.google.common.base.Function;
                    
47import com.google.common.base.Supplier;
                    
47import com.google.common.base.Supplier;
                    
48import com.google.common.base.Suppliers;
                    
49import com.google.common.cache.Cache;
                    
49import com.google.common.cache.Cache;
                    
50import com.google.common.cache.CacheBuilder;
                    
51import com.google.common.cache.CacheLoader;
                    
55import com.google.common.collect.Maps;
                    
56import com.google.inject.Guice;
                    
57
                    
71   protected void setUpInjector() {
                    
72      dateService = Guice.createInjector().getInstance(DateService.class);
                    
73      assert dateService != null;
                    
                
ExceptionMeteredTest.java https://github.com/dinomite/metrics.git | Java | 387 lines
                    
2
                    
3import com.google.inject.Guice;
                    
4import com.google.inject.Injector;
                    
6import com.yammer.metrics.guice.ExceptionMetered;
                    
7import com.yammer.metrics.guice.InstrumentationModule;
                    
8
                    
26    public void setup() {
                    
27        Injector injector = Guice.createInjector(new InstrumentationModule());
                    
28        instance = injector.getInstance(InstrumentedWithExceptionMetered.class);
                    
235
                    
236        assertThat("Guice creates a meter with the given rate unit",
                    
237                   ((MeterMetric) metric).rateUnit(),
                    
260
                    
261        assertThat("Guice creates a metric",
                    
262                   errorMetric,
                    
                
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            }
                    
                
SoftLayerErrorHandlerTest.java https://github.com/andreisavu/jclouds.git | Java | 124 lines
                    
36
                    
37import com.google.inject.Guice;
                    
38
                    
87
                    
88      SoftLayerErrorHandler function = Guice.createInjector().getInstance(SoftLayerErrorHandler.class);
                    
89
                    
                
RsaSshKeyPairGeneratorTest.java https://github.com/richardcloudsoft/legacy-jclouds.git | Java | 98 lines
                    
47
                    
48import com.google.common.collect.ImmutableMap;
                    
49import com.google.inject.AbstractModule;
                    
49import com.google.inject.AbstractModule;
                    
50import com.google.inject.Guice;
                    
51
                    
84
                    
85      RsaSshKeyPairGenerator supplier = Guice.createInjector(new AbstractModule(){
                    
86         protected void configure() {
                    
                
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);
                    
                
GuiceServletConfig.java https://github.com/edwardt/jclouds.git | Java | 169 lines
                    
56import com.google.appengine.api.taskqueue.TaskOptions.Method;
                    
57import com.google.appengine.repackaged.com.google.common.base.Splitter;
                    
58import com.google.common.collect.ImmutableSet;
                    
65import com.google.inject.name.Names;
                    
66import com.google.inject.servlet.GuiceServletContextListener;
                    
67import com.google.inject.servlet.ServletModule;
                    
73 */
                    
74public class GuiceServletConfig extends GuiceServletContextListener {
                    
75   public static final String PROPERTY_BLOBSTORE_CONTEXTS = "blobstore.contexts";
                    
88
                    
89      Module googleModule = new GoogleAppEngineConfigurationModule();
                    
90      Set<Module> modules = ImmutableSet.<Module> of(googleModule);
                    
147   protected Injector getInjector() {
                    
148      return Guice.createInjector(new ServletModule() {
                    
149         @Override
                    
                
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")
                    
                
BindTagFiltersToIndexedFormParamsTest.java https://github.com/machak/jclouds.git | Java | 108 lines
                    
33
                    
34import com.google.common.collect.ImmutableMap;
                    
35import com.google.common.collect.ImmutableSet;
                    
35import com.google.common.collect.ImmutableSet;
                    
36import com.google.inject.Guice;
                    
37import com.google.inject.Injector;
                    
45public class BindTagFiltersToIndexedFormParamsTest {
                    
46   Injector injector = Guice.createInjector();
                    
47   BindTagFiltersToIndexedFormParams binder = injector.getInstance(BindTagFiltersToIndexedFormParams.class);
                    
                
VirtualMachineToNodeMetadataTest.java https://github.com/richardcloudsoft/legacy-jclouds.git | Java | 192 lines
                    
43
                    
44import com.google.common.base.Supplier;
                    
45import com.google.common.base.Suppliers;
                    
45import com.google.common.base.Suppliers;
                    
46import com.google.common.cache.CacheBuilder;
                    
47import com.google.common.cache.CacheLoader;
                    
47import com.google.common.cache.CacheLoader;
                    
48import com.google.common.collect.ImmutableSet;
                    
49import com.google.common.collect.Iterables;
                    
49import com.google.common.collect.Iterables;
                    
50import com.google.inject.Guice;
                    
51
                    
57
                    
58   GroupNamingConvention.Factory namingConvention = Guice.createInjector().getInstance(GroupNamingConvention.Factory.class);
                    
59
                    
                
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     */
                    
                
BindVAppConfigurationToXmlPayloadTest.java https://github.com/regularfry/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
                    
                
VDCHandlerTest.java https://github.com/vkris/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);
                    
                
VDCHandlerTest.java https://github.com/ddurnev/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);
                    
                
IMachineToImageTest.java https://github.com/alasdairhodge/jclouds.git | Java | 139 lines
                    
42
                    
43import com.google.inject.Guice;
                    
44
                    
48   Map<OsFamily, Map<String, String>> map = new BaseComputeServiceContextModule() {
                    
49   }.provideOsVersionMap(new ComputeServiceConstants.ReferenceData(), Guice.createInjector(new GsonModule())
                    
50         .getInstance(Json.class));
                    
                
BindTagFiltersToIndexedFormParamsTest.java https://github.com/alasdairhodge/jclouds.git | Java | 108 lines
                    
33
                    
34import com.google.common.collect.ImmutableMap;
                    
35import com.google.common.collect.ImmutableSet;
                    
35import com.google.common.collect.ImmutableSet;
                    
36import com.google.inject.Guice;
                    
37import com.google.inject.Injector;
                    
45public class BindTagFiltersToIndexedFormParamsTest {
                    
46   Injector injector = Guice.createInjector();
                    
47   BindTagFiltersToIndexedFormParams binder = injector.getInstance(BindTagFiltersToIndexedFormParams.class);
                    
                
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
                    
                
PokerActivator.java https://github.com/boltonli/Poker-Galore.git | Java | 267 lines
                    
38import com.cubeia.games.poker.tournament.activator.TournamentTableSettings;
                    
39import com.cubeia.poker.PokerGuiceModule;
                    
40import com.cubeia.poker.PokerState;
                    
44import com.cubeia.poker.timing.Timings;
                    
45import com.google.inject.Guice;
                    
46import com.google.inject.Injector;
                    
86        initJmx();
                    
87        log.debug("Calling Guice.createInjector");
                    
88        injector = Guice.createInjector(
                    
88        injector = Guice.createInjector(
                    
89        		new ActivatorGuiceModule(context),
                    
90        		new PokerGuiceModule());
                    
                
ParseAsyncJobFromHttpResponseTest.java https://github.com/vkris/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
                    
                
ParseAsyncJobFromHttpResponseTest.java https://github.com/ddurnev/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
                    
                
VAppHandlerTest.java https://github.com/machak/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
                    
                
BindToJsonPayloadWrappedWithTest.java https://github.com/richardcloudsoft/legacy-jclouds.git | Java | 71 lines
                    
27import com.google.common.collect.ImmutableMap;
                    
28import com.google.inject.Guice;
                    
29import com.google.inject.Injector;
                    
29import com.google.inject.Injector;
                    
30import com.google.inject.assistedinject.FactoryModuleBuilder;
                    
31
                    
39
                    
40   Injector injector = Guice.createInjector(new GsonModule(), new FactoryModuleBuilder()
                    
41            .build(BindToJsonPayloadWrappedWith.Factory.class));
                    
                
BindToJsonPayloadWrappedWithTest.java https://github.com/andreisavu/jclouds.git | Java | 71 lines
                    
27import com.google.common.collect.ImmutableMap;
                    
28import com.google.inject.Guice;
                    
29import com.google.inject.Injector;
                    
29import com.google.inject.Injector;
                    
30import com.google.inject.assistedinject.FactoryModuleBuilder;
                    
31
                    
39
                    
40   Injector injector = Guice.createInjector(new GsonModule(), new FactoryModuleBuilder()
                    
41            .build(BindToJsonPayloadWrappedWith.Factory.class));
                    
                
GuiceServletConfig.java https://github.com/gnodet/jclouds.git | Java | 169 lines
                    
56import com.google.appengine.api.taskqueue.TaskOptions.Method;
                    
57import com.google.appengine.repackaged.com.google.common.base.Splitter;
                    
58import com.google.common.collect.ImmutableSet;
                    
65import com.google.inject.name.Names;
                    
66import com.google.inject.servlet.GuiceServletContextListener;
                    
67import com.google.inject.servlet.ServletModule;
                    
73 */
                    
74public class GuiceServletConfig extends GuiceServletContextListener {
                    
75   public static final String PROPERTY_BLOBSTORE_CONTEXTS = "blobstore.contexts";
                    
88
                    
89      Module googleModule = new GoogleAppEngineConfigurationModule();
                    
90      Set<Module> modules = ImmutableSet.<Module> of(googleModule);
                    
147   protected Injector getInjector() {
                    
148      return Guice.createInjector(new ServletModule() {
                    
149         @Override
                    
                
Rules4JBIComponent.java https://bitbucket.org/ssteinmetz/openesb-components.git | Java | 365 lines
                    
39
                    
40import com.google.inject.Guice;
                    
41import com.google.inject.Inject;
                    
41import com.google.inject.Inject;
                    
42import com.google.inject.Injector;
                    
43import com.google.inject.Stage;
                    
48
                    
49import org.openesb.components.rules4jbi.engine.guice.annotations.Main;
                    
50import org.openesb.components.rules4jbi.engine.guice.annotations.MessageExchangeProcessor;
                    
50import org.openesb.components.rules4jbi.engine.guice.annotations.MessageExchangeProcessor;
                    
51import org.openesb.components.rules4jbi.engine.guice.modules.ConstantModule;
                    
52import org.openesb.components.rules4jbi.engine.guice.modules.ExecutorModule;
                    
142        
                    
143        injector = Guice.createInjector(Stage.PRODUCTION,
                    
144                new JBIModule(componentContext),
                    
                
VAppTemplateHandlerTest.java https://github.com/vkris/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);
                    
                
VAppTemplateHandlerTest.java https://github.com/ddurnev/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);
                    
                
BaseParserTest.java https://github.com/richardcloudsoft/legacy-jclouds.git | Java | 102 lines
                    
39
                    
40import com.google.common.base.Function;
                    
41import com.google.common.base.Throwables;
                    
42import com.google.common.collect.ImmutableList;
                    
43import com.google.inject.Guice;
                    
44import com.google.inject.Injector;
                    
87   protected Injector injector() {
                    
88      return Guice.createInjector(new GsonModule() {
                    
89         protected void configure() {
                    
                
ParseServerListTest.java https://github.com/richardcloudsoft/legacy-jclouds.git | Java | 87 lines
                    
36import com.google.common.collect.ImmutableSet;
                    
37import com.google.inject.Guice;
                    
38import com.google.inject.Injector;
                    
83   protected Injector injector() {
                    
84      return Guice.createInjector(new NovaParserModule(), new GsonModule());
                    
85   }
                    
                
ParseFlavorListTest.java https://github.com/richardcloudsoft/legacy-jclouds.git | Java | 87 lines
                    
36import com.google.common.collect.ImmutableSet;
                    
37import com.google.inject.Guice;
                    
38import com.google.inject.Injector;
                    
83   protected Injector injector() {
                    
84      return Guice.createInjector(new NovaParserModule(), new GsonModule());
                    
85   }
                    
                
ParseImageListTest.java https://github.com/richardcloudsoft/legacy-jclouds.git | Java | 87 lines
                    
36import com.google.common.collect.ImmutableSet;
                    
37import com.google.inject.Guice;
                    
38import com.google.inject.Injector;
                    
83   protected Injector injector() {
                    
84      return Guice.createInjector(new NovaParserModule(), new GsonModule());
                    
85   }
                    
                
ParseFlavorListTest.java https://github.com/andreisavu/jclouds.git | Java | 87 lines
                    
36import com.google.common.collect.ImmutableSet;
                    
37import com.google.inject.Guice;
                    
38import com.google.inject.Injector;
                    
83   protected Injector injector() {
                    
84      return Guice.createInjector(new NovaParserModule(), new GsonModule());
                    
85   }
                    
                
ParseServerListTest.java https://github.com/andreisavu/jclouds.git | Java | 87 lines
                    
36import com.google.common.collect.ImmutableSet;
                    
37import com.google.inject.Guice;
                    
38import com.google.inject.Injector;
                    
83   protected Injector injector() {
                    
84      return Guice.createInjector(new NovaParserModule(), new GsonModule());
                    
85   }
                    
                
ParseImageListTest.java https://github.com/andreisavu/jclouds.git | Java | 87 lines
                    
36import com.google.common.collect.ImmutableSet;
                    
37import com.google.inject.Guice;
                    
38import com.google.inject.Injector;
                    
83   protected Injector injector() {
                    
84      return Guice.createInjector(new NovaParserModule(), new GsonModule());
                    
85   }
                    
                
RedirectionRetryHandlerTest.java https://github.com/gnodet/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")
                    
                
MediaController.java https://github.com/rik0/blogracy.git | Java | 558 lines
                    
76import com.google.inject.Binder;
                    
77import com.google.inject.Guice;
                    
78import com.google.inject.Module;
                    
78import com.google.inject.Module;
                    
79import com.google.inject.name.Names;
                    
80
                    
96    private static BeanJsonConverter CONVERTER = new BeanJsonConverter(
                    
97            Guice.createInjector(new Module() {
                    
98                @Override
                    
                
ElasticStackErrorHandlerTest.java https://github.com/regularfry/jclouds.git | Java | 140 lines
                    
38
                    
39import com.google.inject.Guice;
                    
40
                    
102
                    
103      ElasticStackErrorHandler function = Guice.createInjector().getInstance(ElasticStackErrorHandler.class);
                    
104
                    
                
VAppHandlerTest.java https://github.com/alasdairhodge/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
                    
                
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
                    
                
YamlNodeStoreModuleTest.java https://github.com/machak/jclouds.git | Java | 196 lines
                    
42import com.google.inject.AbstractModule;
                    
43import com.google.inject.Guice;
                    
44import com.google.inject.Injector;
                    
75      checkConsistent(map, getStore(createInjectorWithProvidedMap(map)), "test", "instance1", "instancename");
                    
76      checkConsistent(map, getStore(createInjectorWithProvidedMap(map)), "test", "instance1", "instancename");
                    
77      remove(map, getStore(createInjectorWithProvidedMap(map)), "test");
                    
84
                    
85      Injector injector = createInjectorWithProvidedMap(map);
                    
86      assertEquals(injector.getInstance(Key.get(new TypeLiteral<Map<String, InputStream>>() {
                    
127   protected Injector createInjectorWithProvidedMap(Map<String, InputStream> map) {
                    
128      return Guice.createInjector(new YamlNodeStoreModule(map), new AbstractModule() {
                    
129
                    
139   protected Injector createInjector() {
                    
140      return Guice.createInjector(new YamlNodeStoreModule(), new AbstractModule() {
                    
141
                    
                
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        
                    
                
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
                    
                
Rules4JBIBootstrap.java https://bitbucket.org/rsaqc/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        
                    
                
CatalogHandlerTest.java https://github.com/machak/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);
                    
                
GuiceServletConfig.java https://github.com/regularfry/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
                    
                
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() {
                    
                
ListKeysTest.java https://github.com/richardcloudsoft/legacy-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   }
                    
                
ValueOfConfigurationKeyOrNullTest.java https://github.com/richardcloudsoft/legacy-jclouds.git | Java | 65 lines
                    
25import com.google.inject.AbstractModule;
                    
26import com.google.inject.Guice;
                    
27import com.google.inject.name.Names;
                    
38   public void testNotThere() {
                    
39      assertEquals(Guice.createInjector().getInstance(ValueOfConfigurationKeyOrNull.class).apply("foo"), null);
                    
40   }
                    
43   public void testThere() {
                    
44      assertEquals(Guice.createInjector(new AbstractModule() {
                    
45
                    
55   public void testEmptyIsThere() {
                    
56      assertEquals(Guice.createInjector(new AbstractModule() {
                    
57
                    
                
 

Source

Language