100+ results results for 'google guice createinjector lang:java' (3842 ms)
67 * 68 * RoboGuice.setAppliationInjector( app, RoboGuice.DEFAULT_STAGE, Modules.override(RoboGuice.newDefaultRoboModule(app)).with(new MyModule() ); 69 * 70 * @see com.google.inject.util.Modules#override(com.google.inject.Module...) 71 * @see roboguice.RoboGuice#setBaseApplicationInjector(android.app.Application, com.google.inject.Stage, com.google.inject.Module...) 72 * @see roboguice.RoboGuice#newDefaultRoboModule(android.app.Application) 72 * @see roboguice.RoboGuice#newDefaultRoboModule(android.app.Application) 73 * @see roboguice.RoboGuice#DEFAULT_STAGE 74 * 74 * 75 * If using this method with test cases, be sure to call {@link roboguice.RoboGuice.util#reset()} in your test teardown methods 76 * to avoid polluting our other tests with your custom injector. Don't do this in your real application though. 93 synchronized (RoboGuice.class) { 94 final Injector rtrn = Guice.createInjector(stage, modules); 95 injectors.put(application,rtrn);Guice1TestPlugin.java http://mycila.googlecode.com/svn/ | Java | 178 lines
20import com.google.inject.Binder; 21import com.google.inject.Guice; 22import com.google.inject.Inject; 23import com.google.inject.Injector; 24import com.google.inject.Module; 25import com.google.inject.Provider; 46 47 public static final String INJECTOR = "com.google.inject.Injector"; 48 51 context.attributes().set("guice.providers", new ArrayList<Provider<?>>()); 52 GuiceContext ctx = context.introspector().testClass().getAnnotation(GuiceContext.class); 53 77 // create injector 78 Injector injector = Guice.createInjector(findStage(ctx), modules); 79 context.attributes().set(INJECTOR, injector);DefaultPluginManager.java http://mycila.googlecode.com/svn/ | Java | 199 lines
19import com.google.inject.Binder; 20import com.google.inject.Guice; 21import com.google.inject.Injector; 21import com.google.inject.Injector; 22import com.google.inject.Key; 23import com.google.inject.Module; 23import com.google.inject.Module; 24import com.google.inject.Singleton; 25import com.google.inject.Stage; 25import com.google.inject.Stage; 26import com.mycila.guice.CyclicPluginDependencyException; 27import com.mycila.guice.InvokeException; 127 }); 128 return Guice.createInjector(Stage.PRODUCTION, mm); 129 }Guice2TestPlugin.java http://mycila.googlecode.com/svn/ | Java | 178 lines
20import com.google.inject.Binder; 21import com.google.inject.Guice; 22import com.google.inject.Inject; 29import com.google.inject.binder.LinkedBindingBuilder; 30import com.google.inject.binder.ScopedBindingBuilder; 31import com.google.inject.util.Modules; 45 */ 46public final class Guice2TestPlugin extends DefaultTestPlugin { 47 52 context.attributes().set("guice.providers", new ArrayList<Provider<?>>()); 53 GuiceContext ctx = context.introspector().testClass().getAnnotation(GuiceContext.class); 54 77 // create injector 78 Injector injector = Guice.createInjector(findStage(ctx), Modules.override(contextualModules(ctx)).with(modules)); 79 context.attributes().set(INJECTOR, injector);VirtualGuestToNodeMetadataTest.java git://github.com/jclouds/jclouds.git | Java | 158 lines
39 40import com.google.common.base.Supplier; 41import com.google.common.base.Suppliers; 41import com.google.common.base.Suppliers; 42import com.google.common.collect.ImmutableSet; 43import com.google.common.collect.Iterables; 44import com.google.common.collect.Sets; 45import com.google.inject.Guice; 46 52 53 VirtualGuestToImage virtualGuestToImage = Guice.createInjector().getInstance(VirtualGuestToImage.class); 54 VirtualGuestToHardware virtualGuestToHardware = Guice.createInjector().getInstance(VirtualGuestToHardware.class); 54 VirtualGuestToHardware virtualGuestToHardware = Guice.createInjector().getInstance(VirtualGuestToHardware.class); 55 GroupNamingConvention.Factory namingConvention = Guice.createInjector().getInstance(GroupNamingConvention.Factory.class); 56PropertyListenerTest.java https://github.com/jglick/sisu.git | Java | 205 lines
11 *******************************************************************************/ 12package org.sonatype.guice.bean.inject; 13 15 16import org.sonatype.guice.bean.reflect.BeanProperty; 17 17 18import com.google.inject.AbstractModule; 19import com.google.inject.ConfigurationException; 19import com.google.inject.ConfigurationException; 20import com.google.inject.Guice; 21import com.google.inject.Injector; 128 { 129 injector = Guice.createInjector( new AbstractModule() 130 {RestletGuice.java git://github.com/restlet/restlet-framework-java.git | Java | 330 lines
39import com.google.inject.AbstractModule; 40import com.google.inject.Guice; 41import com.google.inject.Inject; 80 injector = inj = Guice 81 .createInjector(RestletGuice.Module.this); 82 } 271 */ 272 public static Injector createInjector(com.google.inject.Module... modules) { 273 return injectorFor(null, new Module(modules)); 324 if (stage == null) { 325 return Guice.createInjector(rootModule); 326 } else { 326 } else { 327 return Guice.createInjector(stage, rootModule); 328 }Guice2TestPlugin.java http://mycila.googlecode.com/svn/ | Java | 175 lines
20import com.google.inject.Binder; 21import com.google.inject.Guice; 22import com.google.inject.Inject; 23import com.google.inject.Injector; 24import com.google.inject.Module; 25import com.google.inject.Provider; 45 */ 46public final class Guice2TestPlugin extends AbstractTestPlugin { 47 49 context.setAttribute("guice.providers", new ArrayList<Provider<?>>()); 50 GuiceContext ctx = context.getTest().getTargetClass().getAnnotation(GuiceContext.class); 51 74 // create injector 75 Injector injector = Guice.createInjector(findStage(ctx), Modules.override(contextualModules(ctx)).with(modules)); 76 context.setAttribute("com.google.inject.Injector", injector);ToIteratorOfListPageExpectTest.java git://github.com/jclouds/jclouds.git | Java | 184 lines
27import org.jclouds.googlecomputeengine.GoogleComputeEngineApi; 28import org.jclouds.googlecomputeengine.config.GoogleComputeEngineParserModule; 29import org.jclouds.googlecomputeengine.domain.Address; 30import org.jclouds.googlecomputeengine.domain.Image; 31import org.jclouds.googlecomputeengine.domain.Instance; 32import org.jclouds.googlecomputeengine.features.AddressApi; 44import com.google.common.collect.ImmutableList; 45import com.google.inject.Guice; 46 47@Test(groups = "unit", testName = "ToIteratorOfListPageTest") 48public class ToIteratorOfListPageExpectTest extends BaseGoogleComputeEngineExpectTest<GoogleComputeEngineApi> { 49 49 50 private final Json json = Guice.createInjector(new GsonModule(), new GoogleComputeEngineParserModule()) 51 .getInstance(Json.class);TudeyTool.java git://github.com/threerings/clyde.git | Java | 252 lines
5// Copyright (C) 2005-2012 Three Rings Design, Inc. 6// http://code.google.com/p/clyde/ 7// 27 28import com.google.inject.Guice; 29import com.google.inject.Injector; 157 // create the tool server 158 Injector injector = Guice.createInjector(new ToolServer.ToolModule(_client)); 159 _server = injector.getInstance(ToolServer.class);TestUtils.java https://gitlab.com/kidaa/lantern.git | Java | 411 lines
19import org.lantern.http.JettyLauncher; 20import org.lantern.oauth.LanternGoogleOAuth2Credentials; 21import org.lantern.privacy.EncryptedFileService; 39import com.google.inject.Binder; 40import com.google.inject.Guice; 41import com.google.inject.Inject; 142 143 injector = Guice.createInjector(lm); 144 269 IOException { 270 final LanternGoogleOAuth2Credentials creds = getGoogleOauthCreds(); 271 final int attempts = 2; 278 279 public static LanternGoogleOAuth2Credentials getGoogleOauthCreds() { 280 return new LanternGoogleOAuth2Credentials("anon@getlantern.org",ServerToNodeMetadataTest.java git://github.com/jclouds/jclouds.git | Java | 204 lines
54 55import com.google.common.base.Supplier; 56import com.google.common.collect.ImmutableList; 56import com.google.common.collect.ImmutableList; 57import com.google.common.collect.ImmutableSet; 58import com.google.inject.AbstractModule; 58import com.google.inject.AbstractModule; 59import com.google.inject.Guice; 60import com.google.inject.name.Names; 89 90 GroupNamingConvention.Factory namingConvention = Guice.createInjector(new AbstractModule() { 91 @OverrideFriendBrowseDownloadRUDPTest.java https://github.com/r3n/limewire5-ruby.git | Java | 294 lines
46 47import com.google.inject.Guice; 48import com.google.inject.Injector; 48import com.google.inject.Injector; 49import com.google.inject.Key; 50import com.google.inject.Module; 50import com.google.inject.Module; 51import com.google.inject.Stage; 52import com.google.inject.TypeLiteral; 83 protected void setUp() throws Exception { 84 injector = createInjector(getModules()); 85 registry = injector.getInstance(ServiceRegistry.class); 101 private Injector createInjector(Module... modules) { 102 return Guice.createInjector(Stage.PRODUCTION, modules); 103 }FormatSharedNamesAndAppendUniqueStringToThoseWhichRepeatTest.java git://github.com/jclouds/jclouds.git | Java | 176 lines
28 29import com.google.common.base.Supplier; 30import com.google.common.base.Suppliers; 31import com.google.inject.AbstractModule; 32import com.google.inject.Guice; 33import com.google.inject.TypeLiteral; 105 public void testPropertyChangesDelimiter() { 106 GroupNamingConvention fn = Guice.createInjector(new AbstractModule() { 107 120 public void testPropertyChangesPrefix() { 121 GroupNamingConvention fn = Guice.createInjector(new AbstractModule() { 122 136 public void testCanChangeSuffixSupplier() { 137 GroupNamingConvention fn = Guice.createInjector(new AbstractModule() { 138Guice1TestPlugin.java http://mycila.googlecode.com/svn/ | Java | 175 lines
20import com.google.inject.Binder; 21import com.google.inject.Guice; 22import com.google.inject.Inject; 22import com.google.inject.Inject; 23import com.google.inject.Injector; 24import com.google.inject.Module; 29import com.google.inject.binder.LinkedBindingBuilder; 30import com.google.inject.binder.ScopedBindingBuilder; 31import com.mycila.testing.core.AbstractTestPlugin; 48 context.setAttribute("guice.providers", new ArrayList<Provider<?>>()); 49 GuiceContext ctx = context.getTest().getTargetClass().getAnnotation(GuiceContext.class); 50 74 // create injector 75 Injector injector = Guice.createInjector(findStage(ctx), modules); 76 context.setAttribute("com.google.inject.Injector", injector);ParseCookbookVersionFromJsonTest.java git://github.com/jclouds/jclouds.git | Java | 133 lines
18 19import static com.google.common.io.BaseEncoding.base16; 20import static org.testng.Assert.assertEquals; 39import com.google.inject.AbstractModule; 40import com.google.inject.Guice; 41import com.google.inject.Injector; 41import com.google.inject.Injector; 42import com.google.inject.Key; 43import com.google.inject.TypeLiteral; 56 protected void setUpInjector() throws IOException { 57 injector = Guice.createInjector(new AbstractModule() { 58 @OverrideNameUsageIndexer.java http://gbif-ecat.googlecode.com/svn/trunk/ | Java | 191 lines
9 10import com.google.inject.Guice; 11import com.google.inject.Inject; 11import com.google.inject.Inject; 12import com.google.inject.Injector; 13import com.google.inject.name.Named; 81 // Creates the injector 82 Injector injector = Guice.createInjector(new IndexingModule(args[0])); 83 // Gets the indexer instance 181 super.shutdownService(tasksCount); 182 // This statement is used because the Guice container is not stopped inside the threadpool. 183 System.exit(0);ArdorPanel.java https://github.com/automenta/spacegraph1.git | Java | 292 lines
35import com.ardor3d.util.Timer; 36import com.google.inject.Guice; 37import com.google.inject.Injector; 37import com.google.inject.Injector; 38import com.google.inject.Module; 39import com.google.inject.Stage; 74 75 final Injector injector = Guice.createInjector(Stage.PRODUCTION, ardorModule); 76OrphanedGroupsFromDeadNodesTest.java git://github.com/jclouds/jclouds.git | Java | 172 lines
16 */ 17package org.jclouds.googlecomputeengine.compute.functions; 18 31import org.jclouds.compute.domain.internal.NodeMetadataImpl; 32import org.jclouds.googlecomputeengine.compute.predicates.GroupIsEmpty; 33import org.testng.annotations.Test; 34 35import com.google.common.base.Predicate; 36import com.google.common.collect.ImmutableMap; 39import com.google.inject.AbstractModule; 40import com.google.inject.Guice; 41 165 private Predicate<String> allNodesInGroupTerminated(final ComputeService mock) { 166 return Guice.createInjector(new AbstractModule() { 167 @Override protected void configure() {ServletModule.java https://bitbucket.org/cvgaviao/google-guice-mavenized | Java | 277 lines
20import com.google.inject.AbstractModule; 21import com.google.inject.Key; 22import java.util.Map; 58 * <pre> 59 * Guice.createInjector(..., new ServletModule() { 60 * 85 * 86 * Guice.createInjector(..., new ServletModule() { 87 * 112 * 113 * Since this rule matches, Guice Servlet will dispatch to {@code MyServlet}. These 114 * two mapping rules can also be written in more compact form using varargs syntax: 131 * <ul> 132 * <li>http://www.google.com/ajax.html</li> 133 * <li>http://www.google.com/content/ajax/index</li>LwjglAwtExample.java https://github.com/thecookie/Ardor3D.git | Java | 217 lines
50import com.ardor3d.util.resource.SimpleResourceLocator; 51import com.google.inject.Guice; 52import com.google.inject.Injector; 52import com.google.inject.Injector; 53import com.google.inject.Module; 54import com.google.inject.Stage; 67 68 final Injector injector = Guice.createInjector(Stage.PRODUCTION, ardorModule); 69RegionIdToAdminURIFromAccessForTypeAndVersionTest.java git://github.com/jclouds/jclouds.git | Java | 125 lines
37 38import com.google.common.base.Supplier; 39import com.google.common.base.Suppliers; 39import com.google.common.base.Suppliers; 40import com.google.common.collect.ImmutableMap; 41import com.google.common.collect.Maps; 42import com.google.inject.AbstractModule; 43import com.google.inject.Guice; 44import com.google.inject.Provides; 50public class RegionIdToAdminURIFromAccessForTypeAndVersionTest { 51 private final RegionIdToAdminURISupplier.Factory factory = Guice.createInjector(new AbstractModule() { 52 82 83 private final RegionIdToAdminURISupplier.Factory raxFactory = Guice.createInjector(new AbstractModule() { 84ParseMetadataListTest.java git://github.com/jclouds/jclouds.git | Java | 59 lines
30import com.google.common.collect.ImmutableMap; 31import com.google.inject.Guice; 32import com.google.inject.Injector; 55 protected Injector injector() { 56 return Guice.createInjector(new NovaParserModule(), new GsonModule()); 57 }JpaDynamicFindersTest.java http://warp-persist.googlecode.com/svn/trunk/ | Java | 239 lines
19import com.google.inject.AbstractModule; 20import com.google.inject.Guice; 21import com.google.inject.Inject; 21import com.google.inject.Inject; 22import com.google.inject.Injector; 23import com.wideplay.warp.persist.PersistenceService; 55 public void pre() { 56 injector = Guice.createInjector(PersistenceService.usingJpa() 57 .across(UnitOfWork.TRANSACTION)GenModelResourceDescriptionManagerTest.java git://pkgs.fedoraproject.org/eclipse-emf | Java | 151 lines
37import com.google.common.collect.Maps; 38import com.google.inject.Guice; 39import com.google.inject.Injector; 58 super.setUp(); 59 Injector injector = Guice.createInjector(new GenModelRuntimeModule()); 60 testMe = injector.getInstance(GenericResourceDescriptionManager.class);ParseCookbookVersionsFromJsonTest.java git://github.com/jclouds/jclouds.git | Java | 68 lines
30 31import com.google.common.collect.ImmutableSet; 32import com.google.inject.AbstractModule; 32import com.google.inject.AbstractModule; 33import com.google.inject.Guice; 34import com.google.inject.Injector; 45 protected void setUpInjector() throws IOException { 46 Injector injector = Guice.createInjector(new AbstractModule() { 47 @OverrideFreemarkerTemplateCompilerTest.java git://github.com/dhanji/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() {ServletModule.java https://code.google.com/p/google-guice/ | Java | 326 lines
21import com.google.common.collect.ImmutableList; 22import com.google.inject.AbstractModule; 23import com.google.inject.Key; 38 * 39 * @author crazybob@google.com (Bob Lee) 40 * @author dhanji@gmail.com (Dhanji R. Prasanna) 70 * <pre> 71 * Guice.createInjector(..., new ServletModule() { 72 * 98 * 99 * Guice.createInjector(..., new ServletModule() { 100 * 146 * <ul> 147 * <li>http://www.google.com/ajax.html</li> 148 * <li>http://www.google.com/content/ajax/index</li>ApplicationLoader.java https://github.com/jeremychone/deprecated-snow-1.x.git | Java | 199 lines
18 19import com.google.inject.Guice; 20import com.google.inject.Injector; 20import com.google.inject.Injector; 21import com.google.inject.Module; 22import com.google.inject.util.Modules; 153 154 appInjector = Guice.createInjector(rootModules); 155 /*--------- /Load WebApplication ---------*/EntityManagerPerRequestProvisionTest.java http://warp-persist.googlecode.com/svn/trunk/ | Java | 148 lines
19import com.google.inject.AbstractModule; 20import com.google.inject.Guice; 21import com.google.inject.Inject; 21import com.google.inject.Inject; 22import com.google.inject.Injector; 23import com.google.inject.matcher.Matchers; 48 public void pre() { 49 injector = Guice.createInjector(PersistenceService.usingJpa() 50 .across(UnitOfWork.REQUEST)ServerToNodeMetadataTest.java git://github.com/jclouds/jclouds.git | Java | 167 lines
44 45import com.google.common.base.Suppliers; 46import com.google.common.collect.ImmutableList; 46import com.google.common.collect.ImmutableList; 47import com.google.common.collect.ImmutableMap; 48import com.google.common.collect.ImmutableSet; 48import com.google.common.collect.ImmutableSet; 49import com.google.inject.Guice; 50 56 Location provider = new LocationBuilder().scope(LocationScope.ZONE).id("dallas").description("description").build(); 57 GroupNamingConvention.Factory namingConvention = Guice.createInjector().getInstance(GroupNamingConvention.Factory.class); 58ElasticStackClientLiveTest.java https://github.com/jclouds/legacy-jclouds.git | Java | 352 lines
53 54import com.google.common.base.Predicate; 55import com.google.common.base.Predicates; 55import com.google.common.base.Predicates; 56import com.google.common.collect.ImmutableMap; 57import com.google.common.collect.ImmutableSet; 57import com.google.common.collect.ImmutableSet; 58import com.google.common.net.HostAndPort; 59import com.google.gson.Gson; 59import com.google.gson.Gson; 60import com.google.inject.Guice; 61 281 protected void doConnectViaSsh(Server server, LoginCredentials creds) throws IOException { 282 SshClient ssh = Guice.createInjector(new SshjSshClientModule()).getInstance(SshClient.Factory.class).create( 283 HostAndPort.fromParts(server.getVnc().getIp(), 22), creds);TestTimelineWebServices.java git://github.com/apache/hadoop-common.git | Java | 671 lines
60 61import com.google.inject.Guice; 62import com.google.inject.Injector; 62import com.google.inject.Injector; 63import com.google.inject.servlet.GuiceServletContextListener; 64import com.google.inject.servlet.ServletModule; 67import com.sun.jersey.api.client.config.DefaultClientConfig; 68import com.sun.jersey.guice.spi.container.servlet.GuiceContainer; 69import com.sun.jersey.test.framework.JerseyTest; 79 80 private Injector injector = Guice.createInjector(new ServletModule() { 81 137 138 public class GuiceServletConfig extends GuiceServletContextListener { 139ServerInRegionToNodeMetadataTest.java git://github.com/jclouds/jclouds.git | Java | 366 lines
48 49import com.google.common.base.Supplier; 50import com.google.common.base.Suppliers; 50import com.google.common.base.Suppliers; 51import com.google.common.collect.ImmutableMap; 52import com.google.common.collect.ImmutableSet; 52import com.google.common.collect.ImmutableSet; 53import com.google.inject.Guice; 54 68 69 GroupNamingConvention.Factory namingConvention = Guice.createInjector().getInstance(GroupNamingConvention.Factory.class); 70WMLActivator.java git://pkgs.fedoraproject.org/wesnoth | Java | 83 lines
6import static com.google.inject.util.Modules.override; 7import static com.google.inject.Guice.createInjector; 8 13 14import com.google.inject.Injector; 15import com.google.inject.Module; 46 protected void registerInjectorFor(String language) throws Exception { 47 injectors.put(language, createInjector( 48 override(override(getRuntimeModule(language)).with(getSharedStateModule())).with(getUiModule(language))));S3ParserTest.java https://github.com/jclouds/legacy-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);HibernateDynamicFinderAbstractClassTest.java http://warp-persist.googlecode.com/svn/trunk/ | Java | 206 lines
19import com.google.inject.Injector; 20import com.google.inject.Guice; 21import com.google.inject.AbstractModule; 56 public void pre() { 57 injector = Guice.createInjector(PersistenceService.usingHibernate() 58 .across(UnitOfWork.TRANSACTION)ListDomainsResponseTest.java git://github.com/jclouds/jclouds.git | Java | 60 lines
27import com.google.common.collect.ImmutableSet; 28import com.google.inject.Guice; 29import com.google.inject.Injector; 35 protected Injector injector() { 36 return Guice.createInjector(new GsonModule() { 37 @OverrideSPIIntegrationTest.java http://groovy-guice.googlecode.com/svn/trunk/ | Java | 440 lines
89 90 Injector injector = Guice.createInjector(groovyModule, groovyGuiceModule); 91 assertEquals("fromFile", injector.getInstance(TestInterface.class).getValue()); 107 108 assertEquals("fromString", Guice.createInjector(groovyModule, groovyGuiceModule).getInstance(TestInterface.class).getValue()); 109 } 143 .build(); 144 assertEquals("fromFile", Guice.createInjector(groovyGuiceModule).getInstance(Script.class).run()); 145 } 195 .build(); 196 Injector injector=Guice.createInjector(groovyModule, groovyGuiceModule); 197 assertEquals("fromFile", injector.getInstance(TestInterface.class).getValue()); 241 .build(); 242 TestInterface ti=Guice.createInjector(groovyModule, groovyGuiceModule).getInstance(TestInterface.class); 243 assertEquals("fromFile", ti.getValue());ConfigModuleTest.java http://testability-explorer.googlecode.com/svn/trunk/ | Java | 139 lines
17 18import com.google.inject.Guice; 19import com.google.inject.Injector; 79 public void testParseMultipleClassesAndPackagesSingleArg() throws Exception { 80 Injector injector = Guice.createInjector(new ConfigModule(new String[]{ 81 "-cp", "not/default/path", 81 "-cp", "not/default/path", 82 "com.google.FirstClass com.google.second.package com.google.third.package"}, 83 outStream, errStream)); 117 public void testJarFileNoClasspath() throws Exception { 118 Guice.createInjector(new ConfigModule(new String[] {"junit.runner", "-cp"}, 119 outStream, errStream)).getInstance(CommandLineConfig.class); 130 String fileUrl = "http://code.google.com/p/testability-explorer/source/browse/trunk/src/{path}"; 131 Injector injector = Guice.createInjector(new ConfigModule(new String[]{ 132 "-srcFileLineUrl", lineUrl, "-srcFileUrl", fileUrl},DwrGuiceServletContextListener.java git://github.com/burris/dwr.git | Java | 118 lines
15 */ 16package org.directwebremoting.guice; 17 19 20import com.google.inject.Guice; 21import com.google.inject.Injector; 21import com.google.inject.Injector; 22import com.google.inject.Stage; 23 32 */ 33public abstract class DwrGuiceServletContextListener extends AbstractDwrGuiceServletContextListener 34{ 40 { 41 return Guice.createInjector(getStage(), new DwrScopeBinder(this)); 42 }MockHandlerModule.java https://code.google.com/p/gwt-platform/ | Java | 203 lines
18 19import com.google.inject.AbstractModule; 20import com.google.inject.internal.UniqueAnnotations; 28/** 29 * Module for use in test cases when creating a guice injector that needs to 30 * provide mock handlers. 31 * 32 * Your injector must also have an class that subclasses {@link com.gwtplatform.dispatch.server.guice.HandlerModule} 33 * to bind Actions to ActionHandlers and ActionValidators. 55 * Injector injector = 56 * Guice.createInjector(new MyHandlerModule(), 57 * new MockHandlerModule() { 94 * .execute( 95 * eq(new GeocodeAddressAction("2 Google Way, New Zealand", 96 * "nz")), any(AsyncCallback.class),Injector.java http://mycila.googlecode.com/svn/ | Java | 380 lines
19import com.google.inject.Binding; 20import com.google.inject.Guice; 21import com.google.inject.Key; 22import com.google.inject.MembersInjector; 23import com.google.inject.Module; 24import com.google.inject.Provider; 33import com.google.inject.name.Names; 34import org.guiceyfruit.support.CloseErrors; 35import org.guiceyfruit.support.CloseFailedException; 367 public static Injector create(Stage stage, Module... modules) { 368 return wrap(Guice.createInjector(stage, modules)); 369 } 371 public static Injector create(Stage stage, Iterable<Module> modules) { 372 return wrap(Guice.createInjector(stage, modules)); 373 }TestGameSettingsModel.java http://heavylead.googlecode.com/svn/trunk/ | Java | 632 lines
13 14import com.google.inject.Guice; 15import com.google.inject.Injector; 85 public void setUp() { 86 _testInjector = Guice.createInjector(new HeavyLeadTestModule()); 87JnarioActivator.java git://github.com/bmwcarit/Jnario.git | Java | 66 lines
16 17import com.google.inject.Guice; 18import com.google.inject.Injector; 18import com.google.inject.Injector; 19import com.google.inject.Module; 20 45 if (injector == null) { 46 injector = createInjector(); 47 } 50 51 protected Injector createInjector() { 52 try { 54 Module jnarioModule = new JnarioUiModule(this); 55 return Guice.createInjector(Modules2.mixin(jnarioModule, sharedStateModule)); 56 } catch (Exception e) {VarargsServletDispatchIntegrationTest.java https://code.google.com/p/google-guice/ | Java | 235 lines
1/** 2 * Copyright (C) 2008 Google Inc. 3 * 23 24import com.google.inject.Guice; 25import com.google.inject.Injector; 63 throws ServletException, IOException { 64 final Injector injector = Guice.createInjector(new ServletModule() { 65 103 throws ServletException, IOException { 104 final Injector injector = Guice.createInjector(new ServletModule() { 105 143 throws ServletException, IOException { 144 final Injector injector = Guice.createInjector(new ServletModule() { 145VarargsFilterDispatchIntegrationTest.java https://code.google.com/p/google-guice/ | Java | 183 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() { 130ParseMachineListTest.java git://github.com/jclouds/jclouds.git | Java | 93 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; 81 protected Injector injector() { 82 return Guice.createInjector(new GsonModule() { 83CreateUniqueKeyTest.java git://github.com/jclouds/jclouds.git | Java | 102 lines
42 43import com.google.common.base.Supplier; 44import com.google.common.base.Suppliers; 44import com.google.common.base.Suppliers; 45import com.google.common.collect.ImmutableMap; 46import com.google.inject.AbstractModule; 46import com.google.inject.AbstractModule; 47import com.google.inject.Guice; 48import com.google.inject.TypeLiteral; 61 public void setup() throws InvalidKeySpecException, NoSuchAlgorithmException, IOException { 62 namingConvention = Guice.createInjector(new AbstractModule() { 63ExceptionMeteredTest.java git://github.com/codahale/metrics.git | Java | 385 lines
2 3import com.google.inject.Guice; 4import com.google.inject.Injector; 23 public void setup() { 24 final Injector injector = Guice.createInjector(new InstrumentationModule()); 25 instance = injector.getInstance(InstrumentedWithExceptionMetered.class); 224 225 assertThat("Guice creates a meter which gets marked", 226 ((Meter) metric).count(), 249 250 assertThat("Guice creates a metric", 251 timedMetric, 253 254 assertThat("Guice creates a timer", 255 timedMetric,BindProviderMetadataContextAndCredentialsTest.java git://github.com/jclouds/jclouds.git | Java | 146 lines
46import com.google.common.reflect.TypeToken; 47import com.google.inject.Guice; 48import com.google.inject.Key; 100 101 ExpectedBindings bindings = Guice.createInjector(new BindProviderMetadataContextAndCredentials(md, creds)) 102 .getInstance(ExpectedBindings.class); 112 113 ExpectedBindings bindings = Guice.createInjector(new BindProviderMetadataContextAndCredentials(md, creds)) 114 .getInstance(ExpectedBindings.class); 126 127 ExpectedBindings bindings = Guice.createInjector(new BindProviderMetadataContextAndCredentials(md, creds)) 128 .getInstance(ExpectedBindings.class); 141 142 int session = Guice.createInjector(new BindProviderMetadataContextAndCredentials(md, creds)).getInstance( 143 Key.get(int.class, Names.named(Constants.PROPERTY_SESSION_INTERVAL)));Guice1TestPlugin.java http://mycila.googlecode.com/svn/ | Java | 129 lines
16 17package com.mycila.testing.plugin.guice; 18 20import com.google.inject.binder.AnnotatedBindingBuilder; 21import com.google.inject.binder.LinkedBindingBuilder; 22import com.google.inject.binder.ScopedBindingBuilder; 36 */ 37public final class Guice1TestPlugin extends AbstractTestPlugin { 38 39 public void prepareTestInstance(Context context) { 40 GuiceContext ctx = context.getTest().getTargetClass().getAnnotation(GuiceContext.class); 41 List<Module> modules = new ArrayList<Module>(); 48 } 49 Injector injector = Guice.createInjector(findStage(ctx), modules); 50 context.setAttribute("com.google.inject.Injector", injector);CustomizingTheSpecCreationSpec.java git://github.com/bmwcarit/Jnario.git | Java | 94 lines
9 10import com.google.inject.Inject; 11import org.eclipse.xtend2.lib.StringConcatenation; 26 * annotate your spec with `CreateWith` and pass as a value the type of the custom `SpecCreator`. 27 * Here is an example for a custom `SpecCreator` that uses Google Guice to create the specification: 28 * 31 * 32 * import com.google.inject.Guice; 33 * import com.google.inject.util.Modules; 36 * public Object create(Class<?> klass) throws Exception { 37 * return Guice.createInjector(Modules.EMPTY_MODULE).getInstance(klass); 38 * } 55 /** 56 * This example uses the Google Guice to instantiate the specification. 57 * @filter('''|.executesSuccessfully)InteractiveExample.java https://bitbucket.org/sgla/aiml-core.git | Java | 80 lines
10 11import com.google.inject.Guice; 12import com.google.inject.Injector; 73 { 74 Injector injector = Guice.createInjector(new AIMLModule()); 75 InteractiveExample example = new InteractiveExample();NovaReviseParsedImageTest.java git://github.com/jclouds/jclouds.git | Java | 98 lines
42 43import com.google.common.base.Predicates; 44import com.google.common.base.Suppliers; 44import com.google.common.base.Suppliers; 45import com.google.common.collect.ImmutableMap; 46import com.google.common.collect.ImmutableSet; 46import com.google.common.collect.ImmutableSet; 47import com.google.common.collect.Iterables; 48import com.google.common.collect.Sets; 48import com.google.common.collect.Sets; 49import com.google.inject.Guice; 50 86 Map<OsFamily, Map<String, String>> map = new BaseComputeServiceContextModule() { 87 }.provideOsVersionMap(new ComputeServiceConstants.ReferenceData(), Guice.createInjector(new GsonModule()) 88 .getInstance(Json.class));RefDslActivator.java http://grooveclipse.googlecode.com/svn/trunk/ | Java | 96 lines
6import static com.google.inject.util.Modules.override; 7import static com.google.inject.Guice.createInjector; 8 13 14import com.google.inject.Injector; 15import com.google.inject.Module; 15import com.google.inject.Module; 16import com.google.common.cache.Cache; 17import com.google.common.cache.CacheBuilder; 17import com.google.common.cache.CacheBuilder; 18import com.google.common.cache.CacheLoader; 19 38 Module mergedModule = override(override(runtimeModule).with(sharedStateModule)).with(uiModule); 39 return createInjector(mergedModule); 40 }SessionFactoryProvisionTest.java http://warp-persist.googlecode.com/svn/trunk/ | Java | 85 lines
19import com.google.inject.AbstractModule; 20import com.google.inject.Guice; 21import com.google.inject.Injector; 21import com.google.inject.Injector; 22import com.google.inject.matcher.Matchers; 23import com.wideplay.codemonkey.web.startup.Initializer; 49 public void pre() { 50 injector = Guice.createInjector(PersistenceService.usingHibernate() 51 .across(UnitOfWork.TRANSACTION)GleSYSErrorHandlerTest.java git://github.com/jclouds/jclouds.git | Java | 118 lines
35 36import com.google.inject.Guice; 37 81 82 GleSYSErrorHandler function = Guice.createInjector().getInstance(GleSYSErrorHandler.class); 83Main.java git://github.com/restlet/restlet-framework-java.git | Java | 184 lines
38import org.restlet.ext.guice.FinderFactory; 39import org.restlet.ext.guice.RestletGuice; 40import org.restlet.resource.Get; 43 44import com.google.inject.AbstractModule; 45import com.google.inject.Injector; 45import com.google.inject.Injector; 46import com.google.inject.Module; 47 52 * whether the Injector behind the FinderFactory is created explicitly with 53 * RestletGuice or implicitly from the first use of RestletGuice.Module as a 54 * FinderFactory. 159 case EXPLICIT_INJECTOR: 160 Injector injector = RestletGuice.createInjector(bindings); 161 ff = injector.getInstance(FinderFactory.class);AWSDatabaseMigrationServiceModuleInjector.java https://github.com/aws/aws-sdk-java.git | Java | 47 lines
17import com.google.inject.AbstractModule; 18import com.google.inject.Guice; 19import com.google.inject.Injector; 19import com.google.inject.Injector; 20import com.google.inject.Stage; 21 21 22import cucumber.api.guice.CucumberModules; 23import cucumber.runtime.java.guice.InjectorSource; 36 public Injector getInjector() { 37 return Guice.createInjector(Stage.PRODUCTION, CucumberModules.SCENARIO, new AWSDatabaseMigrationServiceModule()); 38 }GroovyGuice.java http://groovy-guice.googlecode.com/svn/trunk/ | Java | 396 lines
40import com.google.inject.AbstractModule; 41import com.google.inject.Guice; 42import com.google.inject.Injector; 47import de.indisopht.guice.groovy.internal.GroovyClassloaderFactory; 48import de.indisopht.guice.groovy.internal.annotations.GroovyGuiceInternal; 49 56 * <code><pre> 57 * Module groovyGuiceModule = GroovyGuice 58 * .create() 60 * .build();</pre> 61 * Guice.createInjector(myModule, groovyGuiceModule);<br> 62 * </code> 285 * at {@link GroovyGuice#create(Module...)} must be given 286 * to {@link Guice#createInjector(Module...)} as parameter 287 *JoiningLocalTransactionsTest.java http://warp-persist.googlecode.com/svn/trunk/ | Java | 188 lines
19import com.google.inject.AbstractModule; 20import com.google.inject.Guice; 21import com.google.inject.Inject; 21import com.google.inject.Inject; 22import com.google.inject.Injector; 23import com.google.inject.matcher.Matchers; 50 public void pre() { 51 injector = Guice.createInjector(PersistenceService.usingJpa() 52 .across(UnitOfWork.TRANSACTION)RestfuWebServiceWithSubpaths2AcceptanceTest.java git://github.com/dhanji/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() {ArdorAwtExample.java https://github.com/automenta/spacegraph1.git | Java | 566 lines
54import com.ardor3d.util.ReadOnlyTimer; 55import com.google.common.base.Predicate; 56import com.google.common.base.Predicates; 56import com.google.common.base.Predicates; 57import com.google.inject.Guice; 58import com.google.inject.Inject; 58import com.google.inject.Inject; 59import com.google.inject.Injector; 60import com.google.inject.Module; 60import com.google.inject.Module; 61import com.google.inject.Stage; 62import java.awt.Dimension; 111 112 final Injector injector = Guice.createInjector(Stage.PRODUCTION, ardorModule); 113GuiceXamp.java https://github.com/dburger/archive.git | Java | 160 lines
1package com.dburger.guice.xamp; 2 3import com.google.inject.AbstractModule; 4import com.google.inject.Guice; 5import com.google.inject.Inject; 5import com.google.inject.Inject; 6import com.google.inject.Injector; 7import com.google.inject.Provider; 7import com.google.inject.Provider; 8import com.google.inject.Provides; 9 9 10import com.google.inject.name.Named; 11import com.google.inject.name.Names; 153 System.out.println("================================================="); 154 Injector injector = Guice.createInjector(new WorldDominationModule()); 155 WorldDominator wd = injector.getInstance(WorldDominator.class);AWSRunningInstanceToNodeMetadataTest.java git://github.com/jclouds/jclouds.git | Java | 217 lines
50import com.google.common.cache.CacheBuilder; 51import com.google.common.cache.CacheLoader; 52import com.google.common.cache.LoadingCache; 52import com.google.common.cache.LoadingCache; 53import com.google.common.collect.ImmutableMap; 54import com.google.common.collect.ImmutableSet; 56import com.google.inject.AbstractModule; 57import com.google.inject.Guice; 58import com.google.inject.name.Names; 70 protected void setUpInjector() { 71 dateService = Guice.createInjector().getInstance(DateService.class); 72 assert dateService != null; 201 202 GroupNamingConvention.Factory namingConvention = Guice.createInjector(new AbstractModule() { 203ParseServerWithoutImageTest.java git://github.com/jclouds/jclouds.git | Java | 99 lines
18 19import com.google.common.collect.ImmutableMap; 20import com.google.common.collect.ImmutableMultimap; 20import com.google.common.collect.ImmutableMultimap; 21import com.google.inject.Guice; 22import com.google.inject.Injector; 96 protected Injector injector() { 97 return Guice.createInjector(new NovaParserModule(), new GsonModule()); 98 }SshjSshClientLiveTest.java https://gitlab.com/evgenyg/jclouds.git | Java | 191 lines
42 43import com.google.common.base.Charsets; 44import com.google.common.base.Strings; 44import com.google.common.base.Strings; 45import com.google.common.base.Suppliers; 46import com.google.common.io.Files; 47import com.google.common.net.HostAndPort; 48import com.google.inject.Guice; 49import com.google.inject.Injector; 130 } else { 131 Injector i = Guice.createInjector(new SshjSshClientModule(), new SLF4JLoggingModule()); 132 SshClient.Factory factory = i.getInstance(SshClient.Factory.class);GuiceObjectFactory.java https://github.com/jstrachan/guicey.git | Java | 241 lines
18 19import com.google.inject.AbstractModule; 20import com.google.inject.Binder; 20import com.google.inject.Binder; 21import com.google.inject.Guice; 22import com.google.inject.Injector; 24import com.google.inject.ScopeAnnotation; 25import com.google.inject.servlet.ServletModule; 26import com.opensymphony.xwork2.ActionInvocation; 39 40public class GuiceObjectFactory extends ObjectFactory { 41 118 logger.info("Creating injector..."); 119 this.injector = Guice.createInjector(new AbstractModule() { 120 protected void configure() {GuiceSelfInjectingServerResourceModuleTestCase.java git://github.com/restlet/restlet-framework-java.git | Java | 145 lines
24 25package org.restlet.test.ext.guice; 26 36import org.restlet.data.Protocol; 37import org.restlet.ext.guice.SelfInjectingServerResource; 38import org.restlet.ext.guice.SelfInjectingServerResourceModule; 44import com.google.inject.AbstractModule; 45import com.google.inject.Guice; 46import com.google.inject.Provides; 47 48public class GuiceSelfInjectingServerResourceModuleTestCase extends 49 RestletTestCase { 110 111 Guice.createInjector(new TestModule(), 112 new SelfInjectingServerResourceModule());ParseAsyncJobFromHttpResponseTest.java https://github.com/mattiasholmqvist/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() { 53GuiceInjectorFactory.java git://github.com/griffon/griffon.git | Java | 299 lines
20import com.google.inject.AbstractModule; 21import com.google.inject.Guice; 22import com.google.inject.Module; 23import com.google.inject.TypeLiteral; 24import com.google.inject.matcher.AbstractMatcher; 25import com.google.inject.matcher.Matchers; 67import static griffon.util.GriffonClassUtils.setFieldValue; 68import static integration.GuiceInjector.moduleFromBindings; 69import static java.util.Objects.requireNonNull; 74 @Override 75 public GuiceInjector createInjector(@Nonnull GriffonApplication application, @Nonnull Iterable<Binding<?>> bindings) { 76 requireNonNull(application, "Argument 'application' must not be null"); 134 135 com.google.inject.Injector injector = Guice.createInjector(modules); 136 return new GuiceInjector(injector);EdslTest.java git://pkgs.fedoraproject.org/google-guice | Java | 107 lines
1/** 2 * Copyright (C) 2008 Google Inc. 3 * 15 */ 16package com.google.inject.servlet; 17 18import com.google.inject.AbstractModule; 19import com.google.inject.Guice; 20import com.google.inject.Injector; 35 public final void testExplicitBindingsWorksWithGuiceServlet() { 36 Injector injector = Guice.createInjector( 37 new AbstractModule() { 103 //verify that it doesn't blow up! 104 Guice.createInjector(Stage.TOOL, webModule); 105 }BaseVCloudDirectorExpectTest.java git://github.com/jclouds/jclouds.git | Java | 267 lines
20 21import static com.google.common.base.Preconditions.checkNotNull; 22import static org.testng.Assert.assertNotNull; 34 35import com.google.common.base.Throwables; 36import com.google.common.collect.ImmutableMultimap; 36import com.google.common.collect.ImmutableMultimap; 37import com.google.common.collect.LinkedListMultimap; 38import com.google.common.collect.Multimap; 39import com.google.common.net.HttpHeaders; 40import com.google.inject.Guice; 41import com.jamesmurty.utils.XMLBuilder; 65 protected static void setupDateService() { 66 dateService = Guice.createInjector().getInstance(DateService.class); 67 assertNotNull(dateService);VAppToNodeMetadataTest.java git://github.com/jclouds/jclouds.git | Java | 229 lines
53import com.google.common.base.Suppliers; 54import com.google.common.collect.ImmutableMap; 55import com.google.common.collect.ImmutableSet; 55import com.google.common.collect.ImmutableSet; 56import com.google.common.collect.Maps; 57import com.google.inject.AbstractModule; 57import com.google.inject.AbstractModule; 58import com.google.inject.Guice; 59import com.google.inject.Injector; 59import com.google.inject.Injector; 60import com.google.inject.Provides; 61import com.google.inject.TypeLiteral; 72 public Injector createInjectorWithLocation(final Location location) { 73 return Guice.createInjector(new SaxParserModule(), new AbstractModule() { 74ParseVmSpecificationTest.java git://github.com/jclouds/jclouds.git | Java | 74 lines
31 32import com.google.inject.Guice; 33import com.google.inject.Injector; 70 protected Injector injector() { 71 return Guice.createInjector(new SmartOSParserModule(), new GsonModule()); 72 }GuiceServletConfig.java git://github.com/jersey/jersey-1.x.git | Java | 69 lines
42 43import com.google.inject.Guice; 44import com.google.inject.Injector; 44import com.google.inject.Injector; 45import com.google.inject.servlet.GuiceServletContextListener; 46import com.google.inject.servlet.ServletModule; 46import com.google.inject.servlet.ServletModule; 47import com.sun.jersey.guice.spi.container.servlet.GuiceContainer; 48import com.sun.jersey.test.functional.guice.resources.PerRequestResource; 53 */ 54public class GuiceServletConfig extends GuiceServletContextListener { 55 57 protected Injector getInjector() { 58 return Guice.createInjector(new ServletModule() { 59NinjaPropertiesImplTest.java https://gitlab.com/kidaa/ninja.git | Java | 318 lines
27import com.google.inject.AbstractModule; 28import com.google.inject.Guice; 29import com.google.inject.Inject; 128 @Test 129 public void testPropertiesBoundInGuice() { 130 final NinjaPropertiesImpl props = new NinjaPropertiesImpl(NinjaMode.dev); 130 final NinjaPropertiesImpl props = new NinjaPropertiesImpl(NinjaMode.dev); 131 MockService service = Guice.createInjector(new AbstractModule() { 132 @Override 136 }).getInstance(MockService.class); 137 assertNotNull("Application secret not set by Guice", 138 service.applicationSecret);ManagedLocalTransactionsTest.java http://warp-persist.googlecode.com/svn/trunk/ | Java | 145 lines
10import org.hibernate.criterion.Expression; 11import com.google.inject.Guice; 12import com.google.inject.Injector; 12import com.google.inject.Injector; 13import com.google.inject.Inject; 14import com.google.inject.AbstractModule; 14import com.google.inject.AbstractModule; 15import com.google.inject.matcher.Matchers; 16import com.wideplay.codemonkey.web.startup.Initializer; 35 public void pre() { 36 injector = Guice.createInjector(PersistenceService.usingHibernate() 37 .across(UnitOfWork.TRANSACTION)AbstractDwrGuiceServletContextListener.java git://github.com/burris/dwr.git | Java | 134 lines
17 18import static org.directwebremoting.guice.DwrGuiceUtil.INJECTOR; 19 29 30import static org.directwebremoting.guice.util.ContextCloseHandlers.newExceptionLoggingCloseableHandler; 31 31 32import com.google.inject.Injector; 33 36 * Not for subclassing directly; this is a common base for two different approaches 37 * to {@code Injector} creation and configuration, {@link DwrGuiceServletContextListener} 38 * and {@link CustomInjectorServletContextListener}. 48 final ServletContext servletContext = servletContextEvent.getServletContext(); 49 DwrGuiceUtil.withServletContext(servletContext, new Runnable() 50 {package-info.java git://github.com/burris/dwr.git | Java | 223 lines
4 * This package provides support for 5 * <a href="http://code.google.com/p/google-guice/">Guice</a> 6 * dependency injection in DWR-based web applications. 12 * <li> install a concrete extension of 13 * {@link org.directwebremoting.guice.DwrGuiceServletContextListener} 14 * as a {@code <listener>} in your web application's configuration 15 * file ({@code web.xml}), </li> 16 * <li> install {@link org.directwebremoting.guice.DwrGuiceServlet} for all 17 * requests to {@code /dwr/*}. </li> 52 * {@link org.directwebremoting.guice.CustomInjectorServletContextListener} 53 * by defining {@link org.directwebremoting.guice.CustomInjectorServletContextListener#createInjector createInjector} 54 * to return your existing {@link com.google.inject.Injector Injector}. 211 * class loader. The machinery to achieve this is called automatically with 212 * {@link org.directwebremoting.guice.DwrGuiceServletContextListener}. 213 * If you useParentInjectorTest.java https://code.google.com/p/google-guice/ | Java | 332 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() {AnnotationsCheckTest.java https://github.com/wiregit/wirecode.git | Java | 166 lines
15import org.limewire.inject.AbstractModule; 16import org.limewire.inject.GuiceUtils; 17import org.limewire.inject.LimeWireInjectModule; 30import com.google.inject.Binding; 31import com.google.inject.Guice; 32import com.google.inject.Injector; 52 public void run() { 53 Injector injector = Guice.createInjector(new AllLimeWireModules__DO_NOT_USE()); 54 GuiceUtils.loadEagerSingletons(injector); 129 injectorRef.set(null); 130 final Injector coreInjector = Guice.createInjector(new LimeWireModule()); 131 SwingUtilities.invokeAndWait(new Runnable() { 133 public void run() { 134 Injector injector = Guice.createInjector( 135 Modules.providersFrom(coreInjector),EventPublisherTest.java https://github.com/SmartITEngineering/smart-cms.git | Java | 218 lines
21import com.google.inject.AbstractModule; 22import com.google.inject.Guice; 23import com.google.inject.Injector; 58 public void setup() { 59 injector = Guice.createInjector(new EventPublicationListenerModule()); 60 }DeclarativeTransactionTest.java https://github.com/SmartITEngineering/smart-cms.git | Java | 100 lines
3import com.google.inject.AbstractModule; 4import com.google.inject.Guice; 5import com.google.inject.Inject; 5import com.google.inject.Inject; 6import com.google.inject.Injector; 7import com.google.inject.TypeLiteral; 50 writeDao = mockery.mock(CommonWriteDao.class); 51 injector = Guice.createInjector(new DemoDomainMasterModule(new AbstractModule() { 52DataHandler.java https://code.google.com/p/rabbit-eclipse/ | Java | 117 lines
38import com.google.inject.ConfigurationException; 39import com.google.inject.Guice; 40import com.google.inject.Injector; 40import com.google.inject.Injector; 41import com.google.inject.Key; 42import com.google.inject.util.Types; 51 static { 52 injector = Guice.createInjector(new XmlModule()); 53 }AssignCorrectHostnameForBucketTest.java git://github.com/jclouds/jclouds.git | Java | 71 lines
28 29import com.google.common.base.Functions; 30import com.google.common.base.Optional; 30import com.google.common.base.Optional; 31import com.google.common.base.Supplier; 32import com.google.common.base.Suppliers; 32import com.google.common.base.Suppliers; 33import com.google.common.collect.ImmutableMap; 34import com.google.inject.Binder; 34import com.google.inject.Binder; 35import com.google.inject.Guice; 36import com.google.inject.Module; 40public class AssignCorrectHostnameForBucketTest { 41 static final RegionToEndpointOrProviderIfNull REGION_TO_ENDPOINT = Guice.createInjector(new Module() { 42 @Override public void configure(Binder binder) {MockLocalProvisioner.java git://github.com/dain/galaxy-server.git | Java | 336 lines
2 3import com.google.common.base.Function; 4import com.google.common.base.Preconditions; 4import com.google.common.base.Preconditions; 5import com.google.common.base.Throwables; 6import com.google.common.collect.ImmutableList; 6import com.google.common.collect.ImmutableList; 7import com.google.common.collect.ImmutableMap; 8import com.google.common.collect.Iterables; 8import com.google.common.collect.Iterables; 9import com.google.inject.Guice; 10import com.google.inject.Injector; 229 230 Injector agentInjector = Guice.createInjector(new NodeModule(), 231 new TestingHttpServerModule(),OhaiModuleTest.java git://github.com/jclouds/jclouds-chef.git | Java | 140 lines
37 38import com.google.common.base.Supplier; 39import com.google.common.base.Suppliers; 40import com.google.inject.AbstractModule; 41import com.google.inject.Guice; 42import com.google.inject.Injector; 42import com.google.inject.Injector; 43import com.google.inject.TypeLiteral; 44import com.google.inject.util.Providers; 62 63 Injector injector = Guice.createInjector(new ChefParserModule(), new GsonModule(), new OhaiModule() { 64 @Override 91 92 Injector injector = Guice.createInjector(new ChefParserModule(), new GsonModule(), new OhaiModule() { 93 @OverrideParseUploadSandboxFromJsonTest.java git://github.com/jclouds/jclouds.git | Java | 87 lines
18 19import static com.google.common.io.BaseEncoding.base16; 20import static com.google.common.primitives.Bytes.asList; 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; 53 protected void setUpInjector() throws IOException { 54 injector = Guice.createInjector(new AbstractModule() { 55 @OverrideGuiceAwareValidationTestCase.java git://pkgs.fedoraproject.org/bval | Java | 96 lines
16 */ 17package org.apache.bval.guice; 18 27 28import com.google.inject.Guice; 29 32 * 33 * @version $Id: GuiceAwareValidationTestCase.java 1074156 2011-02-24 14:11:34Z simonetripodi $ 34 */ 34 */ 35public final class GuiceAwareValidationTestCase extends TestCase { 36 52 protected void setUp() throws Exception { 53 Guice.createInjector(new ValidationModule()).injectMembers(this); 54 }AlsActivator.java http://alloy4eclipse.googlecode.com/svn/trunk/ | Java | 341 lines
16 17import com.google.inject.Guice; 18import com.google.inject.Injector; 18import com.google.inject.Injector; 19import com.google.inject.Module; 20import com.google.inject.util.Modules; 75 .put("fr.univartois.cril.xtext.Als", 76 Guice.createInjector(Modules 77 .override(TusarNotifier.java https://github.com/jfroche/hudson-plugins.git | Java | 301 lines
26import com.google.inject.AbstractModule; 27import com.google.inject.Guice; 28import com.google.inject.Singleton; 104 105 final TusarNotifierLogger tusarNotifierLog = Guice.createInjector(new AbstractModule() { 106 @Override 120 // Archiving tool reports into JUnit files 121 TusarNotifierTransformer tusarNotifierTransformer = Guice.createInjector(new AbstractModule() { 122 @Override 151 152 final TusarNotifierLogger tusarNotifierLog = Guice.createInjector(new AbstractModule() { 153 @Override 160 161 TusarNotifierReportProcessingService tusarNotifierReportProcessingService = Guice.createInjector(new AbstractModule() { 162 @OverrideVDCHandlerTest.java https://github.com/jraghu/jclouds.git | Java | 175 lines
36 37import com.google.common.collect.ImmutableMap; 38import com.google.inject.AbstractModule; 38import com.google.inject.AbstractModule; 39import com.google.inject.Guice; 40import com.google.inject.Injector; 40import com.google.inject.Injector; 41import com.google.inject.Provides; 42 52 InputStream is = getClass().getResourceAsStream("/vdc.xml"); 53 Injector injector = Guice.createInjector(new ParserModule(), new AbstractModule() { 54 93 InputStream is = getClass().getResourceAsStream("/vdc-hosting.xml"); 94 Injector injector = Guice.createInjector(new ParserModule(), new AbstractModule() { 95CreateSharedIpGroupOptionsTest.java git://github.com/jclouds/jclouds.git | Java | 74 lines
26import com.google.common.collect.ImmutableMap; 27import com.google.inject.Guice; 28import com.google.inject.Injector; 37 38 Injector injector = Guice.createInjector(new GsonModule()); 39CreateDriveRequestToMapTest.java git://github.com/jclouds/jclouds.git | Java | 62 lines
26 27import com.google.common.collect.ImmutableMap; 28import com.google.common.collect.ImmutableSet; 28import com.google.common.collect.ImmutableSet; 29import com.google.inject.Guice; 30 33 34 private static final CreateDriveRequestToMap BASEDRIVE_TO_MAP = Guice.createInjector().getInstance( 35 CreateDriveRequestToMap.class);Injector.java http://mycila.googlecode.com/svn/ | Java | 364 lines
18import com.google.inject.Binding; 19import com.google.inject.Guice; 20import com.google.inject.Key; 20import com.google.inject.Key; 21import com.google.inject.MembersInjector; 22import com.google.inject.Module; 32import com.google.inject.name.Names; 33import org.guiceyfruit.support.CloseErrors; 34import org.guiceyfruit.support.CloseFailedException; 297 298 // delegates of guice Injector 299 356 public static Injector create(Stage stage, Module... modules) { 357 return wrap(Guice.createInjector(stage, modules)); 358 }JacobTask.java http://mu-labs.googlecode.com/svn/trunk/ | Java | 213 lines
36import com.google.inject.Binder; 37import com.google.inject.Guice; 38import com.google.inject.Injector; 38import com.google.inject.Injector; 39import com.google.inject.Module; 40import com.mu.jacob.core.ant.ConfigModule.BuilderFctory; 150 Module customModule = (module == null)? emptyModule : newInstance(module, Module.class); 151 Injector injector = Guice.createInjector(configModule, decoratorModule, elementModule, customModule); 152OrphanedGroupsByRegionIdTest.java git://github.com/jclouds/jclouds.git | Java | 91 lines
36 37import com.google.common.base.Predicates; 38import com.google.common.base.Supplier; 38import com.google.common.base.Supplier; 39import com.google.common.base.Suppliers; 40import com.google.common.collect.ImmutableMap; 40import com.google.common.collect.ImmutableMap; 41import com.google.common.collect.ImmutableMultimap; 42import com.google.common.collect.ImmutableSet; 42import com.google.common.collect.ImmutableSet; 43import com.google.inject.Guice; 44 54 55 GroupNamingConvention.Factory namingConvention = Guice.createInjector().getInstance(GroupNamingConvention.Factory.class); 56ParseOsFamilyVersion64BitFromImageNameTest.java git://github.com/jclouds/jclouds.git | Java | 74 lines
18 19import static com.google.common.collect.Iterables.transform; 20import static com.google.common.collect.Lists.newArrayList; 37 38import com.google.common.base.Function; 39import com.google.gson.Gson; 39import com.google.gson.Gson; 40import com.google.inject.Guice; 41import com.google.inject.TypeLiteral; 66 ParseOsFamilyVersion64BitFromImageName parser = new ParseOsFamilyVersion64BitFromImageName(new BaseComputeServiceContextModule() { 67 }.provideOsVersionMap(new ComputeServiceConstants.ReferenceData(), Guice.createInjector(new GsonModule()) 68 .getInstance(Json.class)));URIExtractionNamespaceTest.java https://gitlab.com/lcp0578/druid.git | Java | 338 lines
23import com.fasterxml.jackson.databind.introspect.AnnotationIntrospectorPair; 24import com.fasterxml.jackson.databind.introspect.GuiceAnnotationIntrospector; 25import com.fasterxml.jackson.databind.introspect.GuiceInjectableValues; 26import com.google.common.collect.ImmutableList; 27import com.google.common.collect.ImmutableMap; 28import com.google.inject.Binder; 28import com.google.inject.Binder; 29import com.google.inject.Guice; 30import com.google.inject.Module; 49 new GuiceInjectableValues( 50 Guice.createInjector( 51 ImmutableList.of( 65 66 final GuiceAnnotationIntrospector guiceIntrospector = new GuiceAnnotationIntrospector(); 67 mapper.setAnnotationIntrospectors(InterceptingBindingsBuilderTest.java http://guiceberry.googlecode.com/svn/trunk/ | Java | 237 lines
19import com.google.inject.CreationException; 20import com.google.inject.Guice; 21import com.google.inject.Injector; 80 81 Injector injector = Guice.createInjector(new InterceptingBindingsBuilder() 82 .intercept(String.class) 118 119 Injector injector = Guice.createInjector(new InterceptingBindingsBuilder() 120 .intercept(Integer.class) 188 try { 189 Guice.createInjector(built); 190 fail(); 202 203 Injector injector = Guice.createInjector(new InterceptingBindingsBuilder() 204 .intercept(ArrayList.class)ParseDataBagItemFromJsonTest.java git://github.com/jclouds/jclouds.git | Java | 65 lines
34import com.google.inject.AbstractModule; 35import com.google.inject.Guice; 36import com.google.inject.Injector; 36import com.google.inject.Injector; 37import com.google.inject.Key; 38import com.google.inject.TypeLiteral; 46 protected void setUpInjector() throws IOException { 47 Injector injector = Guice.createInjector(new AbstractModule() { 48 @OverrideJacobRunner.java http://mu-labs.googlecode.com/svn/trunk/ | Java | 112 lines
33import com.google.inject.Binder; 34import com.google.inject.Guice; 35import com.google.inject.Injector; 35import com.google.inject.Injector; 36import com.google.inject.Module; 37import com.mu.jacob.core.ant.ConfigModule; 49 50 /* Custom module for Guice DI */ 51 private Module module = null; 80 Module customModule = (module != null)? module : emptyModule; 81 Injector injector = Guice.createInjector(configModule, decoratorModule, elementModule, customModule); 82NinjaDaoTestBase.java https://gitlab.com/kidaa/ninja.git | Java | 97 lines
28import com.google.common.base.Optional; 29import com.google.inject.Guice; 30import com.google.inject.Injector; 47 /** 48 * Guice Injector to get DAOs 49 */ 76 NinjaPropertiesImpl ninjaProperties = new NinjaPropertiesImpl(ninjaMode); 77 injector = Guice.createInjector(new JpaModule(ninjaProperties)); 78 jpaInitializer = injector.getInstance(JpaInitializer.class);XadesProfileCore.java http://xades4j.googlecode.com/svn/trunk/ | Java | 227 lines
19import com.google.inject.Binder; 20import com.google.inject.Guice; 21import com.google.inject.Key; 21import com.google.inject.Key; 22import com.google.inject.Module; 23import com.google.inject.TypeLiteral; 23import com.google.inject.TypeLiteral; 24import com.google.inject.multibindings.MapBinder; 25import com.google.inject.multibindings.Multibinder; 25import com.google.inject.multibindings.Multibinder; 26import com.google.inject.util.Modules; 27import com.google.inject.util.Types; 218 { 219 return Guice.createInjector(finalModules).getInstance(clazz); 220 }VCloudDirectorErrorHandlerTest.java git://github.com/jclouds/jclouds.git | Java | 103 lines
36 37import com.google.inject.Guice; 38 65 66 VCloudDirectorErrorHandler function = Guice.createInjector().getInstance(VCloudDirectorErrorHandler.class); 67ParseCookbookDefinitionFromJsonTest.java git://github.com/jclouds/jclouds.git | Java | 75 lines
34import com.google.inject.AbstractModule; 35import com.google.inject.Guice; 36import com.google.inject.Injector; 45 protected void setUpInjector() throws IOException { 46 Injector injector = Guice.createInjector(new AbstractModule() { 47 @OverrideSfVsMk2.java http://java-fighting-game-engine.googlecode.com/svn/trunk/ | Java | 150 lines
41 42import com.google.inject.Guice; 43import com.google.inject.Injector; 43import com.google.inject.Injector; 44import com.google.inject.Key; 45import com.google.inject.TypeLiteral; 45import com.google.inject.TypeLiteral; 46import com.google.inject.name.Names; 47 66 public SfVsMk2() { 67 injector = Guice.createInjector( 68 new EngineModule(),NamesTest.java https://code.google.com/p/google-guice/ | Java | 113 lines
20import static com.google.inject.Asserts.assertEqualWhenReserialized; 21import static com.google.inject.Asserts.assertEqualsBothWays; 22 24import com.google.inject.AbstractModule; 25import com.google.inject.Guice; 26import com.google.inject.Injector; 62 63 Injector injector = Guice.createInjector(new AbstractModule() { 64 protected void configure() { 76 77 Injector injector = Guice.createInjector(new AbstractModule() { 78 protected void configure() { 95 96 Injector injector = Guice.createInjector(new AbstractModule() { 97 protected void configure() {Errors.java git://github.com/elasticsearch/elasticsearch.git | Java | 635 lines
1/** 2 * Copyright (C) 2006 Google Inc. 3 * 18 19import com.google.common.collect.ImmutableList; 20import com.google.common.collect.ImmutableSet; 20import com.google.common.collect.ImmutableSet; 21import com.google.common.collect.Lists; 22import org.elasticsearch.common.inject.*; 101 * same message for both bind time errors: 102 * <pre><code>Guice.createInjector(new AbstractModule() { 103 * public void configure() { 107 * ...and at provide-time errors: 108 * <pre><code>Guice.createInjector().getInstance(Runnable.class);</code></pre> 109 * Otherwise we need to know who's calling when resolving a just-in-timeSisuActivator.java git://pkgs.fedoraproject.org/sisu | Java | 296 lines
33import org.sonatype.guice.bean.binders.WireModule; 34import org.sonatype.guice.bean.locators.DefaultBeanLocator; 35import org.sonatype.guice.bean.locators.MutableBeanLocator; 35import org.sonatype.guice.bean.locators.MutableBeanLocator; 36import org.sonatype.guice.bean.reflect.BundleClassSpace; 37import org.sonatype.guice.bean.reflect.ClassSpace; 37import org.sonatype.guice.bean.reflect.ClassSpace; 38import org.sonatype.guice.bean.reflect.Logs; 39import org.sonatype.inject.BeanScanning; 41import com.google.inject.Binder; 42import com.google.inject.Guice; 43import com.google.inject.Injector; 218 219 injector = Guice.createInjector( new WireModule( this, new SpaceModule( space, scanning ) ) ); 220CheckedProviderMethodsModuleTest.java https://github.com/sonatype/sisu-guice.git | Java | 189 lines
124 public void testNoAnnotationNoScope() throws BindException, RemoteException { 125 Injector injector = Guice.createInjector(new TestModule()); 126 RpcProvider<String> provider = injector.getInstance(Key.get(rpcProviderOfString)); 143 TestModule testModule = new TestModule(); 144 Injector injector = Guice.createInjector(testModule); 145 RpcProvider<Long> provider = 151 TestModule testModule = new TestModule(); 152 Injector injector = Guice.createInjector(testModule); 153 RpcProvider<Pair<Double, String>> provider = injector.getInstance(Key.get(rpcProviderOfPair)); 159 TestModule testModule = new TestModule(); 160 Injector injector = Guice.createInjector(testModule); 161 RpcProvider<Float> provider = injector.getInstance(Key.get(rpcProviderOfFloat)); 173 TestModule testModule = new TestModule(); 174 Injector injector = Guice.createInjector(testModule); 175 RpcProvider<String> provider =TestServer.java git://github.com/dain/galaxy-server.git | Java | 492 lines
15 16import com.google.common.collect.ImmutableMap; 17import com.google.common.io.Resources; 17import com.google.common.io.Resources; 18import com.google.inject.Guice; 19import com.google.inject.Injector; 56 57import static com.google.common.base.Charsets.UTF_8; 58import static com.google.common.net.HttpHeaders.CONTENT_TYPE; 108 109 Injector injector = Guice.createInjector( 110 new TestingDiscoveryModule(),TestCliIntegration.java git://github.com/dain/galaxy-server.git | Java | 542 lines
2 3import com.google.common.collect.ArrayListMultimap; 4import com.google.common.collect.ImmutableList; 4import com.google.common.collect.ImmutableList; 5import com.google.common.collect.ImmutableMap; 6import com.google.common.collect.ListMultimap; 7import com.google.inject.Binder; 8import com.google.inject.Guice; 9import com.google.inject.Injector; 9import com.google.inject.Injector; 10import com.google.inject.Module; 11import com.google.inject.util.Modules; 109 110 Injector coordinatorInjector = Guice.createInjector(new TestingHttpServerModule(), 111 new NodeModule(),StoryHtmlRenderer.java http://wolfengine.googlecode.com/svn/trunk/ | Java | 662 lines
13 14import com.google.appengine.api.datastore.Key; 15import com.google.appengine.api.datastore.KeyFactory; 15import com.google.appengine.api.datastore.KeyFactory; 16import com.google.appengine.api.users.User; 17import com.google.appengine.api.users.UserServiceFactory; 17import com.google.appengine.api.users.UserServiceFactory; 18import com.google.inject.Guice; 19import com.google.inject.Inject; 19import com.google.inject.Inject; 20import com.google.inject.Injector; 21import com.google.inject.name.Named; 299 messages = createMessages(); 300 Injector injector = Guice.createInjector(new WolfEngineModule(this)); 301 injector.injectMembers(messages);ScenarioSharedState.java https://gitlab.com/libpgrid/github_mirror.git | Java | 137 lines
21 22import com.google.inject.Guice; 23import com.google.inject.Injector; 57 static { 58 injector_ = Guice.createInjector(new EntityModule(), new ServiceModule(localIP_, localPort_, Integer.MAX_VALUE)); 59 try {ScalaModuleTest.java http://scala-eclipse-plugin.googlecode.com/svn/trunk/ | Java | 80 lines
2 3import static com.google.inject.Guice.*; 4import static org.hamcrest.Matchers.*; 13 14import com.google.inject.*; 15 39 module = new ScalaModule(plugin, log, editorRegistry, contentTypeManager, workspace); 40 injector = createInjector(module); 41 }TestEditSettingsPresenter.java http://heavylead.googlecode.com/svn/trunk/ | Java | 263 lines
16 17import com.google.inject.Guice; 18import com.google.inject.Injector; 65 public void setUp() { 66 _testInjector = Guice.createInjector(new HeavyLeadTestModule()); 67 _mockery = _testInjector.getInstance(Mockery.class);BindHexEncodedMD5sToJsonPayloadTest.java git://github.com/jclouds/jclouds.git | Java | 70 lines
18 19import static com.google.common.io.BaseEncoding.base16; 20import static com.google.common.primitives.Bytes.asList; 33 34import com.google.common.collect.ImmutableSet; 35import com.google.inject.AbstractModule; 35import com.google.inject.AbstractModule; 36import com.google.inject.Guice; 37import com.google.inject.Injector; 41 42 Injector injector = Guice.createInjector(new AbstractModule() { 43 @OverrideGwtRpcServiceImplTest.java https://code.google.com/p/gwtrpccommlayer/ | Java | 122 lines
3import com.google.gwt.user.client.rpc.AsyncCallback; 4import com.google.inject.Guice; 5import com.google.inject.Injector; 6import com.google.inject.internal.Preconditions; 7import com.google.inject.servlet.GuiceFilter; 8import com.google.inject.servlet.GuiceServletContextListener; 9import com.google.inject.servlet.ServletModule; 10import com.googlecode.gwtrpccommlayer.client.GwtRpcService; 11import com.googlecode.gwtrpccommlayer.client.Module; 39 public void setUp() throws Exception { 40 injector = Guice.createInjector(new Module()); 41 56 protected Injector getInjector() { 57 return Guice.createInjector(new ServletModule() { 58 @OverrideParseImageTest.java git://github.com/jclouds/jclouds.git | Java | 95 lines
35 36import com.google.common.collect.ImmutableMap; 37import com.google.common.collect.ImmutableSet; 37import com.google.common.collect.ImmutableSet; 38import com.google.inject.Guice; 39import com.google.inject.Injector; 92 protected Injector injector() { 93 return Guice.createInjector(new NovaParserModule(), new GsonModule()); 94 }JschSshClientTest.java git://github.com/jclouds/jclouds.git | Java | 154 lines
18 19import static com.google.inject.name.Names.bindProperties; 20 33 34import com.google.common.net.HostAndPort; 35import com.google.inject.AbstractModule; 35import com.google.inject.AbstractModule; 36import com.google.inject.Guice; 37import com.google.inject.Injector; 37import com.google.inject.Injector; 38import com.google.inject.Module; 39import com.jcraft.jsch.ChannelSftp; 57 protected JschSshClient createClient(final Properties props) throws UnknownHostException { 58 Injector i = Guice.createInjector(module(), new AbstractModule() { 59 @OverrideSchedulerApplication.java https://bitbucket.org/okaner1/per-build-container.git | Java | 126 lines
32import com.google.inject.AbstractModule; 33import com.google.inject.Guice; 34import com.google.inject.Injector; 34import com.google.inject.Injector; 35import com.google.inject.name.Names; 36import io.dropwizard.Configuration; 79 Environment environment) { 80 Injector injector = Guice.createInjector(new AbstractModule() { 81 @OverrideDatabaseInvokeMethod.java https://github.com/xhochy/carameldb.git | Java | 154 lines
17 18import com.google.inject.Guice; 19 148 setUpDatabase(); 149 Guice.createInjector(new CaramelTestModule(conn, getJDBCString())).injectMembers(target); 150 super.evaluate();VCloudRestClientModuleTest.java https://github.com/jraghu/jclouds.git | Java | 159 lines
20 21import static com.google.common.base.Preconditions.checkNotNull; 22import static org.easymock.classextension.EasyMock.createMock; 46import com.google.common.base.Supplier; 47import com.google.common.util.concurrent.ListenableFuture; 48import com.google.inject.AbstractModule; 48import com.google.inject.AbstractModule; 49import com.google.inject.Guice; 50import com.google.inject.Injector; 50import com.google.inject.Injector; 51import com.google.inject.name.Names; 52 59 protected Injector createInjector() { 60 return Guice.createInjector(new VCloudRestClientModule(), new RestModule(), 61 new AbstractModule() {ListenerSingleInjectionTestCase.java https://bitbucket.org/noctarius/guiceidentityinjection | Java | 218 lines
24import com.google.inject.AbstractModule; 25import com.google.inject.Guice; 26import com.google.inject.Inject; 40 41 final Injector injector = Guice.createInjector(new IdentityModule() { 42 @Override 66 67 final Injector injector = Guice.createInjector(new IdentityModule() { 68 @Override 97 98 final Injector injector = Guice.createInjector(new IdentityModule() { 99 @Override 128 129 final Injector injector = Guice.createInjector(new IdentityModule() { 130 @OverrideJschSshClientModuleTest.java git://github.com/jclouds/jclouds.git | Java | 45 lines
27import com.google.common.net.HostAndPort; 28import com.google.inject.Guice; 29import com.google.inject.Injector; 38 39 Injector i = Guice.createInjector(new JschSshClientModule(), new SLF4JLoggingModule()); 40 SshClient.Factory factory = i.getInstance(SshClient.Factory.class);BasicProjectGuiceServletContextListener.java http://gwt-cx.googlecode.com/svn/trunk/ | Java | 28 lines
14 15package com.kiahu.sample.server.guice; 16 16 17import com.google.inject.Guice; 18import com.google.inject.Injector; 18import com.google.inject.Injector; 19import com.google.inject.servlet.GuiceServletContextListener; 20 20 21public class BasicProjectGuiceServletContextListener extends GuiceServletContextListener { 22 24 protected Injector getInjector() { 25 return Guice.createInjector(new BasicProjectServerModule(), new BasicProjectServletModule()); 26 }GuiceFactoryTest.java git://github.com/cucumber/cucumber-jvm.git | Java | 199 lines
41 public void factoryCanBeIntantiatedWithArgConstructor() { 42 factory = new GuiceFactory(Guice.createInjector()); 43 assertThat(factory, notNullValue()); 47 public void factoryStartFailsIfScenarioScopeIsNotBound() { 48 factory = new GuiceFactory(Guice.createInjector()); 49 try { 61 public void shouldGiveNewInstancesOfUnscopedClassWithinAScenario() { 62 factory = new GuiceFactory(injector(CucumberModules.SCENARIO)); 63 instancesFromSameScenario = getInstancesFromSameScenario(factory, UnscopedClass.class); 77 public void shouldGiveTheSameInstanceOfAnnotatedScenarioScopedClassWithinAScenario() { 78 factory = new GuiceFactory(injector(CucumberModules.SCENARIO)); 79 instancesFromSameScenario = getInstancesFromSameScenario(factory, AnnotatedScenarioScopedClass.class); 162 private Injector injector(Module... module) { 163 return Guice.createInjector(Stage.PRODUCTION, module); 164 }GroupToBootScriptTest.java git://github.com/jclouds/jclouds.git | Java | 277 lines
52import com.google.common.base.Suppliers; 53import com.google.common.cache.CacheLoader; 54import com.google.common.collect.ImmutableMap; 54import com.google.common.collect.ImmutableMap; 55import com.google.common.io.Resources; 56import com.google.inject.AbstractModule; 56import com.google.inject.AbstractModule; 57import com.google.inject.Guice; 58import com.google.inject.Injector; 70 public void setup() { 71 Injector injectorGems = Guice.createInjector(new AbstractModule() { 72 @Override 80 81 Injector injectorOmnibus = Guice.createInjector(new AbstractModule() { 82 @OverrideInjectedTest.java git://pkgs.fedoraproject.org/sisu | Java | 173 lines
11 *******************************************************************************/ 12package org.sonatype.guice.bean.containers; 13 25import org.sonatype.guice.bean.binders.SpaceModule; 26import org.sonatype.guice.bean.binders.WireModule; 27import org.sonatype.guice.bean.locators.MutableBeanLocator; 27import org.sonatype.guice.bean.locators.MutableBeanLocator; 28import org.sonatype.guice.bean.reflect.ClassSpace; 29import org.sonatype.guice.bean.reflect.URLClassSpace; 35import com.google.inject.Binder; 36import com.google.inject.Guice; 37import com.google.inject.Key; 63 { 64 Guice.createInjector( new WireModule( new SetUpModule(), new SpaceModule( space(), scanning() ) ) ); 65 }NameUsageComponentTestIT.java http://gbif-ecat.googlecode.com/svn/trunk/ | Java | 132 lines
33import org.gbif.checklistbank.api.service.VernacularNameService; 34import org.gbif.checklistbank.ws.client.guice.ChecklistBankWsClientModule; 35import org.gbif.checklistbank.ws.guice.ChecklistBankWsModule; 36 37import com.google.inject.Guice; 38import com.google.inject.Injector; 54 clientInjector = 55 Guice 56 .createInjector(new UrlBindingModule(this.getBaseURI(), "clb"), new ChecklistBankWsClientModule(false, true));GuiceProvider.java git://github.com/caelum/vraptor.git | Java | 151 lines
34import com.google.inject.ConfigurationException; 35import com.google.inject.Guice; 36import com.google.inject.Injector; 39import com.google.inject.Stage; 40import com.google.inject.TypeLiteral; 41import com.google.inject.multibindings.Multibinder; 41import com.google.inject.multibindings.Multibinder; 42import com.google.inject.util.Modules; 43 45 * 46 * A Container Provider that uses Google Guice as DI container. 47 * 96 container = new GuiceContainer(); 97 injector = Guice.createInjector(Stage.PRODUCTION, Modules.override(new VRaptorAbstractModule(context, container)).with(customModule())); 98 executeStereotypeHandlers();ManualLocalReadOnlyTransactionsTest.java http://warp-persist.googlecode.com/svn/trunk/ | Java | 182 lines
19import com.google.inject.AbstractModule; 20import com.google.inject.Guice; 21import com.google.inject.Inject; 21import com.google.inject.Inject; 22import com.google.inject.Injector; 23import com.google.inject.matcher.Matchers; 56 public void pre() { 57 injector = Guice.createInjector(PersistenceService.usingHibernate() 58 .across(UnitOfWork.REQUEST)BindInternetServiceConfigurationToXmlPayloadTest.java https://github.com/jraghu/jclouds.git | Java | 123 lines
20 21import static com.google.common.base.Preconditions.checkNotNull; 22import static org.easymock.EasyMock.expect; 31import org.jclouds.rest.internal.GeneratedHttpRequest; 32import com.google.inject.name.Names; 33import org.jclouds.vcloud.VCloudPropertiesBuilder; 36 37import com.google.common.collect.HashMultimap; 38import com.google.common.collect.Multimap; 40import com.google.inject.AbstractModule; 41import com.google.inject.Guice; 42import com.google.inject.Injector; 50public class BindInternetServiceConfigurationToXmlPayloadTest { 51 Injector injector = Guice.createInjector(new AbstractModule() { 52GuiceBerryUniverse.java http://guiceberry.googlecode.com/svn/trunk/ | Java | 388 lines
22import com.google.common.testing.TearDownStack; 23import com.google.guiceberry.GuiceBerry.GuiceBerryWrapper; 24import com.google.guiceberry.GuiceBerryModule.ToTearDown; 32import com.google.inject.testing.guiceberry.GuiceBerryEnv; 33import com.google.inject.testing.guiceberry.junit3.GuiceBerryJunit3; 34 54 */ 55 private static final Injector BOGUS_INJECTOR = Guice.createInjector(new GuiceBerryModule()); 56 276 private static TestWrapper adapt( 277 final com.google.inject.testing.guiceberry.TestScopeListener instance, 278 final TearDownAccepter tearDownAccepter) { 312 private static void callGbeMainIfBound(Injector injector) { 313 com.google.inject.testing.guiceberry.GuiceBerryEnvMain deprecatedGuiceBerryEnvMain = 314 getInstanceIfHasBinding(injector, com.google.inject.testing.guiceberry.GuiceBerryEnvMain.class);PropConfBuilder.java https://github.com/itm/itm-utils.git | Java | 101 lines
2 3import com.google.inject.Guice; 4 11 12import static com.google.common.base.Throwables.propagate; 13import static de.uniluebeck.itm.util.propconf.PropConfHelper.getDeclaredAnnotations; 18 public static <T> T buildConfig(final Class<? extends T> configClass, final Properties properties) { 19 return Guice.createInjector(new PropConfModule(properties, configClass)).getInstance(configClass); 20 }CloudSigmaErrorHandlerTest.java git://github.com/jclouds/jclouds.git | Java | 136 lines
34 35import com.google.inject.Guice; 36 98 99 CloudSigmaErrorHandler function = Guice.createInjector().getInstance(CloudSigmaErrorHandler.class); 100OrgNetworkHandlerTest.java git://github.com/jclouds/jclouds.git | Java | 105 lines
35 36import com.google.common.collect.ImmutableList; 37import com.google.common.collect.ImmutableSet; 37import com.google.common.collect.ImmutableSet; 38import com.google.inject.Guice; 39import com.google.inject.Injector; 49 InputStream is = getClass().getResourceAsStream("/orgnetwork-isolated.xml"); 50 Injector injector = Guice.createInjector(new SaxParserModule()); 51 Factory factory = injector.getInstance(ParseSax.Factory.class); 80 InputStream is = getClass().getResourceAsStream("/orgnetwork-bridged.xml"); 81 Injector injector = Guice.createInjector(new SaxParserModule()); 82 Factory factory = injector.getInstance(ParseSax.Factory.class);VirtualBoxComputeServiceAdapterTest.java git://github.com/jclouds/jclouds.git | Java | 107 lines
44 45import com.google.common.base.Function; 46import com.google.common.base.Suppliers; 47import com.google.common.collect.Lists; 48import com.google.inject.Guice; 49 53 Map<OsFamily, Map<String, String>> osMap = new BaseComputeServiceContextModule() { 54 }.provideOsVersionMap(new ComputeServiceConstants.ReferenceData(), Guice.createInjector(new GsonModule()) 55 .getInstance(Json.class));RegionIdToURIFromAccessForTypeAndVersionTest.java git://github.com/jclouds/jclouds.git | Java | 119 lines
32 33import com.google.common.base.Supplier; 34import com.google.common.base.Suppliers; 34import com.google.common.base.Suppliers; 35import com.google.common.collect.ImmutableMap; 36import com.google.common.collect.Maps; 37import com.google.inject.AbstractModule; 38import com.google.inject.Guice; 39import com.google.inject.Provides; 44public class RegionIdToURIFromAccessForTypeAndVersionTest { 45 private final RegionIdToURISupplier.Factory factory = Guice.createInjector(new AbstractModule() { 46 78 79 private final RegionIdToURISupplier.Factory raxFactory = Guice.createInjector(new AbstractModule() { 80Injector.java http://mycila.googlecode.com/svn/ | Java | 390 lines
19import com.google.inject.Binding; 20import com.google.inject.Guice; 21import com.google.inject.Key; 27import com.google.inject.Stage; 28import com.google.inject.TypeLiteral; 29import com.google.inject.internal.BindingImpl; 35import com.mycila.guice.annotation.OnStartSingleton; 36import org.guiceyfruit.support.CloseErrors; 37import org.guiceyfruit.support.CloseFailedException; 377 public static Injector create(Stage stage, Module... modules) { 378 return wrap(Guice.createInjector(stage, modules)); 379 } 381 public static Injector create(Stage stage, Iterable<Module> modules) { 382 return wrap(Guice.createInjector(stage, modules)); 383 }BeanImportTest.java git://pkgs.fedoraproject.org/sisu | Java | 715 lines
42import com.google.inject.CreationException; 43import com.google.inject.Guice; 44import com.google.inject.ImplementedBy; 383 { 384 final Injector injector = Guice.createInjector( new WireModule( new TestModule() ) ); 385 424 { 425 final Injector injector = Guice.createInjector( new WireModule( new TestModule() ) ); 426 443 { 444 final Injector injector = Guice.createInjector( new WireModule( new TestModule() ) ); 445 457 { 458 final Injector injector = Guice.createInjector( new WireModule( new TestModule() ) ); 459PlexusBeanLocatorTest.java git://pkgs.fedoraproject.org/sisu | Java | 542 lines
62 { 63 parent = Guice.createInjector( new AbstractModule() 64 { 381 382 locator.add( Guice.createInjector( new Module() 383 { 396 397 locator.add( Guice.createInjector( new Module() 398 { 411 412 locator.add( Guice.createInjector( new Module() 413 { 426 427 locator.add( Guice.createInjector( new Module() 428 {PlexusRequirementTest.java git://pkgs.fedoraproject.org/sisu | Java | 561 lines
7 *******************************************************************************/ 8package org.sonatype.guice.plexus.binders; 9 28import org.sonatype.guice.plexus.config.Hints; 29import org.sonatype.guice.plexus.config.PlexusBeanConverter; 30import org.sonatype.guice.plexus.config.PlexusBeanLocator; 34import org.sonatype.guice.plexus.converters.PlexusDateTypeConverter; 35import org.sonatype.guice.plexus.converters.PlexusXmlBeanConverter; 36import org.sonatype.guice.plexus.locators.DefaultPlexusBeanLocator; 39import com.google.inject.Binder; 40import com.google.inject.Guice; 41import com.google.inject.ImplementedBy; 58 { 59 Guice.createInjector( new AbstractModule() 60 {BindUserMetadataToHeadersTest.java git://github.com/jclouds/jclouds.git | Java | 85 lines
26 27import com.google.inject.Guice; 28import com.google.inject.Injector; 34public class BindUserMetadataToHeadersTest { 35 Injector injector = Guice.createInjector(); 36 BindUserMetadataToHeaders binder = injector.getInstance(BindUserMetadataToHeaders.class);ScreenshotPluginTest.java https://bitbucket.org/jjpx/runelite.git | Java | 211 lines
26 27import com.google.inject.Guice; 28import com.google.inject.testing.fieldbinder.Bind; 28import com.google.inject.testing.fieldbinder.Bind; 29import com.google.inject.testing.fieldbinder.BoundFieldModule; 30import java.util.concurrent.ScheduledExecutorService; 98 { 99 Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this); 100 when(screenshotConfig.screenshotRewards()).thenReturn(true);InjectorSourceFactoryTest.java git://github.com/cucumber/cucumber-jvm.git | Java | 206 lines
1package io.cucumber.guice; 2 2 3import com.google.inject.Injector; 4import org.junit.jupiter.api.Test; 24 @Test 25 void createsDefaultInjectorSourceWhenGuiceModulePropertyIsNotSet() { 26 InjectorSourceFactory injectorSourceFactory = createInjectorSourceFactory(Collections.emptyMap()); 29 30 private InjectorSourceFactory createInjectorSourceFactory(Map<String, String> properties) { 31 return new InjectorSourceFactory(properties); 36 Map<String, String> properties = new HashMap<>(); 37 properties.put(InjectorSourceFactory.GUICE_INJECTOR_SOURCE_KEY, CustomInjectorSource.class.getName()); 38 InjectorSourceFactory injectorSourceFactory = createInjectorSourceFactory(properties); 44 Map<String, String> properties = new HashMap<>(); 45 properties.put(InjectorSourceFactory.GUICE_INJECTOR_SOURCE_KEY, "some.bogus.Class"); 46 InjectorSourceFactory injectorSourceFactory = createInjectorSourceFactory(properties);CredentialStoreModuleTest.java git://github.com/jclouds/jclouds.git | Java | 228 lines
38import com.google.common.io.ByteSource; 39import com.google.inject.Guice; 40import com.google.inject.Injector; 77 78 Injector injector = createInjectorWithProvidedMap(map); 79 assertEquals(injector.getInstance(Key.get(new TypeLiteral<Map<String, ByteSource>>() { 91 put(map, getStore(createInjectorWithProvidedMap(map)), "test", new Credentials("user", "pass")); 92 checkConsistent(map, getStore(createInjectorWithProvidedMap(map)), "test", new Credentials("user", "pass")); 93 checkConsistent(map, getStore(createInjectorWithProvidedMap(map)), "test", new Credentials("user", "pass")); 171 protected Injector createInjectorWithProvidedMap(Map<String, ByteSource> map) { 172 return Guice.createInjector(new CredentialStoreModule(map), new GsonModule()); 173 } 175 protected Injector createInjector() { 176 return Guice.createInjector(new CredentialStoreModule(), new GsonModule()); 177 }ParseExtensionListNormalTest.java git://github.com/jclouds/jclouds.git | Java | 76 lines
34import com.google.common.collect.ImmutableSet; 35import com.google.inject.Guice; 36import com.google.inject.Injector; 72 protected Injector injector() { 73 return Guice.createInjector(new NovaParserModule(), new GsonModule()); 74 }GuiceTest.java https://github.com/tbaum/warp-core.git | Java | 121 lines
35 public final void testTypeLiterals() { 36 Injector injector = Guice.createInjector(new AbstractModule() { 37 57 public final void testInjections() { 58 Injector injector = Guice.createInjector(); 59 70 public final void testInjectionsWithModule() { 71 Injector injector = Guice.createInjector(new AbstractModule() { 72 82 public final void testWideningScopeInjection() { 83 Injector injector = Guice.createInjector(new AbstractModule() { 84 101 public final void testTypelessProvider() { 102 Injector injector = Guice.createInjector(new AbstractModule() { 103CloudSigmaClientLiveTest.java git://github.com/jclouds/jclouds.git | Java | 444 lines
53 54import com.google.common.base.Predicate; 55import com.google.common.base.Predicates; 55import com.google.common.base.Predicates; 56import com.google.common.collect.ImmutableMap; 57import com.google.common.collect.ImmutableSet; 57import com.google.common.collect.ImmutableSet; 58import com.google.common.net.HostAndPort; 59import com.google.gson.Gson; 59import com.google.gson.Gson; 60import com.google.inject.Guice; 61 383 protected void doConnectViaSsh(Server server, LoginCredentials creds) throws IOException { 384 SshClient ssh = Guice.createInjector(new SshjSshClientModule()).getInstance(SshClient.Factory.class) 385 .create(HostAndPort.fromParts(server.getVnc().getIp(), 22), creds);OrphanedGroupsByZoneIdTest.java git://github.com/jclouds/jclouds.git | Java | 97 lines
36 37import com.google.common.base.Predicates; 38import com.google.common.base.Supplier; 38import com.google.common.base.Supplier; 39import com.google.common.base.Suppliers; 40import com.google.common.collect.ImmutableMap; 40import com.google.common.collect.ImmutableMap; 41import com.google.common.collect.ImmutableMultimap; 42import com.google.common.collect.ImmutableSet; 42import com.google.common.collect.ImmutableSet; 43import com.google.inject.Guice; 44 59 60 GroupNamingConvention.Factory namingConvention = Guice.createInjector().getInstance(GroupNamingConvention.Factory.class); 61ListTagsResponseTest.java git://github.com/jclouds/jclouds.git | Java | 66 lines
21import com.google.common.collect.ImmutableSet; 22import com.google.inject.Guice; 23import com.google.inject.Injector; 34 protected Injector injector() { 35 return Guice.createInjector(new GsonModule() { 36AbstractPipelineBootstrapper.java https://code.google.com/p/curtain/ | Java | 307 lines
34 35import com.google.inject.Guice; 36import com.google.inject.Inject; 36import com.google.inject.Inject; 37import com.google.inject.Injector; 38 85 private Injector getInjector(CurtainContextImpl impl) { 86 return Guice.createInjector( 87 new CurtainContextModule(impl),ServiceTest.java https://github.com/xblaster/wadManager.git | Java | 200 lines
1import injection.WadGuiceModule; 2 20 21import com.google.inject.Guice; 22import com.google.inject.Injector; 26 27 private static Injector injector = Guice.createInjector(new WadGuiceModule()); 28 private BankAccountService bService;GuiceFactoryTest.java git://github.com/cucumber/cucumber-jvm.git | Java | 220 lines
4import com.google.inject.ConfigurationException; 5import com.google.inject.Guice; 6import com.google.inject.Injector; 62 void factoryCanBeIntantiatedWithArgConstructor() { 63 factory = new GuiceFactory(Guice.createInjector()); 64 assertThat(factory, notNullValue()); 68 void factoryStartFailsIfScenarioScopeIsNotBound() { 69 factory = new GuiceFactory(Guice.createInjector()); 70 73 assertThat("Unexpected exception message", actualThrown.getMessage(), startsWith( 74 "Guice configuration errors:\n" + 75 "\n" + 86 private Injector injector(Module... module) { 87 return Guice.createInjector(Stage.PRODUCTION, module); 88 }OptionalBindingTest.java https://code.google.com/p/google-guice/ | Java | 296 lines
109 HasOptionalInjections instance = new HasOptionalInjections(); 110 Guice.createInjector(partialModule).injectMembers(instance); 111 instance.assertNothingInjected(); 115 HasOptionalInjections instance = new HasOptionalInjections(); 116 Guice.createInjector().injectMembers(instance); 117 instance.assertNothingInjected(); 120 public void testEverythingInjectorToInstance() { 121 Guice.createInjector(everythingModule, toInstanceModule) 122 .getInstance(HasOptionalInjections.class) 248 try { 249 Guice.createInjector().getInstance(HasOptionalConstructor.class); 250 fail(); 265 staticInjectA = injectA; 266 Guice.createInjector(new AbstractModule() { 267 protected void configure() {MergerModuleTest.java https://code.google.com/p/rabbit-eclipse/ | Java | 80 lines
26 27import com.google.inject.Guice; 28import com.google.inject.Injector; 28import com.google.inject.Injector; 29import com.google.inject.Key; 30import com.google.inject.TypeLiteral; 71 this.mergerImpl = mergerImpl; 72 this.injector = Guice.createInjector(new MergerModule()); 73 }GuiceServletConfig.java git://github.com/jclouds/jclouds-chef.git | Java | 96 lines
20 21import static com.google.common.base.Preconditions.checkNotNull; 22import static com.google.common.collect.Iterables.concat; 41import com.google.common.collect.ImmutableSet; 42import com.google.inject.Guice; 43import com.google.inject.Injector; 43import com.google.inject.Injector; 44import com.google.inject.servlet.GuiceServletContextListener; 45import com.google.inject.servlet.ServletModule; 54 */ 55public class GuiceServletConfig extends GuiceServletContextListener { 56 79 protected Injector getInjector() { 80 return Guice.createInjector(concat(modulesForProviderInProperties("chef", properties), ImmutableSet.of( 81 new GsonModule(), new ServletModule() {ProxyPoolImpl.java http://digital-delegation.googlecode.com/svn/proj/dd/trunk/ | Java | 210 lines
26import com.google.inject.AbstractModule; 27import com.google.inject.Guice; 28import com.google.inject.Inject; 40 { 41 return Guice.createInjector(new AbstractModule() { 42 @Override protected void configure() { 55 public void work(Session with) throws Throwable { 56 with.load(new URL("http://www.google.com/")); 57 System.out.println("DONE google!!!");ParseUploadInfoFromJsonResponseTest.java https://github.com/jraghu/jclouds.git | Java | 56 lines
31import com.google.gson.Gson; 32import com.google.inject.Guice; 33import com.google.inject.Injector; 42 43 Injector i = Guice.createInjector(new ParserModule()); 44JschSshClientModuleTest.java https://github.com/jraghu/jclouds.git | Java | 54 lines
30 31import com.google.inject.Guice; 32import com.google.inject.Injector; 43 44 Injector i = Guice.createInjector(new JschSshClientModule()); 45 SshClient.Factory factory = i.getInstance(SshClient.Factory.class);TestRMWebServicesFairScheduler.java git://github.com/apache/hadoop-common.git | Java | 120 lines
37 38import com.google.inject.Guice; 39import com.google.inject.Injector; 39import com.google.inject.Injector; 40import com.google.inject.servlet.GuiceServletContextListener; 41import com.google.inject.servlet.ServletModule; 43import com.sun.jersey.api.client.WebResource; 44import com.sun.jersey.guice.spi.container.servlet.GuiceContainer; 45import com.sun.jersey.test.framework.JerseyTest; 51 52 private Injector injector = Guice.createInjector(new ServletModule() { 53 @Override 70 71 public class GuiceServletConfig extends GuiceServletContextListener { 72ElasticStackErrorHandlerTest.java git://github.com/jclouds/jclouds.git | Java | 131 lines
34 35import com.google.inject.Guice; 36 94 95 ElasticStackErrorHandler function = Guice.createInjector().getInstance(ElasticStackErrorHandler.class); 96SessionProvisionTest.java http://warp-persist.googlecode.com/svn/trunk/ | Java | 86 lines
3import com.google.inject.Injector; 4import com.google.inject.Guice; 5import com.google.inject.AbstractModule; 5import com.google.inject.AbstractModule; 6import com.google.inject.matcher.Matchers; 7import com.wideplay.codemonkey.web.startup.Initializer; 33 public void pre() { 34 injector = Guice.createInjector(PersistenceService.usingHibernate() 35 .across(UnitOfWork.TRANSACTION)InjectorTest.java https://code.google.com/p/google-guice/ | Java | 414 lines
113 throws CreationException { 114 Injector injector = Guice.createInjector(new AbstractModule() { 115 protected void configure() { 124 public void testInjectorApiIsNotSerializable() throws IOException { 125 Injector injector = Guice.createInjector(); 126 assertNotSerializable(injector); 205 public void testInjectStatics() throws CreationException { 206 Guice.createInjector(new AbstractModule() { 207 protected void configure() { 342 try { 343 Guice.createInjector().getInstance(SeaHorse.class); 344 fail(); 353 try { 354 Guice.createInjector().getInstance(Chicken.class); 355 fail();AmazonMachineLearningModuleInjector.java https://github.com/aws/aws-sdk-java.git | Java | 47 lines
17import com.google.inject.AbstractModule; 18import com.google.inject.Guice; 19import com.google.inject.Injector; 19import com.google.inject.Injector; 20import com.google.inject.Stage; 21 21 22import cucumber.api.guice.CucumberModules; 23import cucumber.runtime.java.guice.InjectorSource; 36 public Injector getInjector() { 37 return Guice.createInjector(Stage.PRODUCTION, CucumberModules.SCENARIO, new AmazonMachineLearningModule()); 38 }AmazonKinesisFirehoseModuleInjector.java https://github.com/aws/aws-sdk-java.git | Java | 47 lines
17import com.google.inject.AbstractModule; 18import com.google.inject.Guice; 19import com.google.inject.Injector; 19import com.google.inject.Injector; 20import com.google.inject.Stage; 21 21 22import cucumber.api.guice.CucumberModules; 23import cucumber.runtime.java.guice.InjectorSource; 36 public Injector getInjector() { 37 return Guice.createInjector(Stage.PRODUCTION, CucumberModules.SCENARIO, new AmazonKinesisFirehoseModule()); 38 }AmazonCognitoIdentityModuleInjector.java https://github.com/aws/aws-sdk-java.git | Java | 47 lines
17import com.google.inject.AbstractModule; 18import com.google.inject.Guice; 19import com.google.inject.Injector; 19import com.google.inject.Injector; 20import com.google.inject.Stage; 21 21 22import cucumber.api.guice.CucumberModules; 23import cucumber.runtime.java.guice.InjectorSource; 36 public Injector getInjector() { 37 return Guice.createInjector(Stage.PRODUCTION, CucumberModules.SCENARIO, new AmazonCognitoIdentityModule()); 38 }IDEPluginActionBuilder.java http://js-test-driver.googlecode.com/svn/trunk/ | Java | 0 lines
18import com.google.inject.AbstractModule; 19import com.google.inject.Guice; 20import com.google.inject.Injector; 21import com.google.inject.Module; 22import com.google.inject.Singleton; 23import com.google.inject.TypeLiteral; 23import com.google.inject.TypeLiteral; 24import com.google.inject.assistedinject.FactoryProvider; 25import com.google.inject.multibindings.Multibinder; 27import com.google.jstestdriver.config.DefaultConfiguration; 28import com.google.jstestdriver.guice.BrowserActionProvider; 29import com.google.jstestdriver.guice.FlagsModule; 98 modules.add(new HtmlDocModule()); 99 Injector injector = Guice.createInjector(new ActionFactoryModule(), 100 new ConfigurationModule(modules, tests, reset, dryRunFor,JitBindingsTest.java git://pkgs.fedoraproject.org/google-guice | Java | 605 lines
128 public void testBasicsWithScoped() { 129 Injector injector = Guice.createInjector(new AbstractModule() { 130 @Override 147 try { 148 Guice.createInjector(new AbstractModule() { 149 @Override 226 try { 227 Guice.createInjector(new AbstractModule() { 228 @Override 334 public void testChildInjectorAddsOption() { 335 Injector parent = Guice.createInjector(new AbstractModule() { 336 @Override 402 try { 403 Guice.createInjector(new AbstractModule() { 404 protected void configure() { 424 try { 425 Guice.createInjector(nScopesTest.java git://pkgs.fedoraproject.org/google-guice | Java | 605 lines
116 Guice.createInjector().getInstance(AnnotatedSingleton.class), 117 Guice.createInjector().getInstance(AnnotatedSingleton.class)); 118 } 211 public void testSingletonsInProductionStage() { 212 Guice.createInjector(Stage.PRODUCTION, singletonsModule); 213 243 244 Injector injector = Guice.createInjector(new AbstractModule() { 245 protected void configure() { 306 public void testDuplicateScopeAnnotations() { 307 Injector injector = Guice.createInjector(new AbstractModule() { 308 protected void configure() { 345 public void testSingletonAnnotationOnParameterizedType() { 346 Injector injector = Guice.createInjector(); 347 assertSame(injector.getInstance(new Key<Injected<String>>() {}),DuplicateBindingsTest.java git://pkgs.fedoraproject.org/google-guice | Java | 572 lines
100 101 Guice.createInjector( 102 new ScopedModule(Scopes.NO_SCOPE, foo, pFoo, pclFoo, clFoo, cFoo), 107 public void testSameScopeAnnotationIgnored() { 108 Guice.createInjector( 109 new AnnotatedScopeModule(Singleton.class, foo, pFoo, pclFoo, clFoo, cFoo), 184 public void testChildInjectorDuplicateParentFail() { 185 Injector injector = Guice.createInjector( 186 new SimpleModule(foo, pFoo, pclFoo, clFoo, cFoo) 230 try { 231 Guice.createInjector(Elements.getModule(Arrays.asList(e1, e2))); 232 if(e1 != e2) { 307 b.equality = "test"; 308 Guice.createInjector(new AbstractModule() { 309 @OverrideMapBinderTest.java git://pkgs.fedoraproject.org/google-guice | Java | 679 lines
32import com.google.inject.CreationException; 33import com.google.inject.Guice; 34import com.google.inject.Injector; 267 }; 268 Injector injector = Guice.createInjector(module); 269 286 try { 287 Guice.createInjector(module); 288 fail(); 315 }; 316 Injector injector = Guice.createInjector(ab, bc); 317 341 }; 342 Injector injector = Guice.createInjector(ab1c, b2c); 343