My favorites | Sign in
Project Home Downloads Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions

Issue 589 attachment: SampleBasicTest.java.patch (1.1 KB)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
### Eclipse Workspace Patch 1.0
#P mybatis-guice
Index: src/test/java/org/mybatis/guice/sample/SampleBasicTest.java
===================================================================
--- src/test/java/org/mybatis/guice/sample/SampleBasicTest.java (revision 5234)
+++ src/test/java/org/mybatis/guice/sample/SampleBasicTest.java (working copy)
@@ -40,6 +40,7 @@
import org.mybatis.guice.sample.service.FooServiceMapperImpl;

import com.google.inject.Injector;
+import com.google.inject.name.Names;

/**
* Example of MyBatis-Guice basic integration usage.
@@ -68,7 +69,11 @@
bindTransactionFactoryType(JdbcTransactionFactory.class);
addMapperClass(UserMapper.class);

+ Properties vars = new Properties();
+ vars.setProperty("user.id", "u1");
+
bindProperties(binder(), createTestProperties());
+ bind(Properties.class).annotatedWith(Names.named("mybatis.configuration.variables")).toInstance(vars);
bind(FooService.class).to(FooServiceMapperImpl.class);
}

Powered by Google Project Hosting