Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
caopu16
whatsmars
提交
a7136e5d
W
whatsmars
项目概览
caopu16
/
whatsmars
与 Fork 源项目一致
Fork自
武汉红喜 / whatsmars
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
whatsmars
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a7136e5d
编写于
7月 05, 2016
作者:
武汉红喜
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
spring-test
上级
9acbd1c6
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
61 addition
and
0 deletion
+61
-0
pom.xml
pom.xml
+12
-0
whatsmars-spring/pom.xml
whatsmars-spring/pom.xml
+8
-0
whatsmars-spring/src/main/java/com/itlong/whatsmars/spring/DbRouterTest.java
...c/main/java/com/itlong/whatsmars/spring/DbRouterTest.java
+19
-0
whatsmars-spring/src/test/java/com/itlong/whatsmars/spring/XxDemo.java
...ing/src/test/java/com/itlong/whatsmars/spring/XxDemo.java
+22
-0
未找到文件。
pom.xml
浏览文件 @
a7136e5d
...
...
@@ -69,6 +69,18 @@
<artifactId>
mybatis-spring
</artifactId>
<version>
1.2.2
</version>
</dependency>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<version>
4.11
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-test
</artifactId>
<version>
${spring.version}
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-context
</artifactId>
...
...
whatsmars-spring/pom.xml
浏览文件 @
a7136e5d
...
...
@@ -15,6 +15,14 @@
<url>
http://maven.apache.org
</url>
<dependencies>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-test
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-context
</artifactId>
...
...
whatsmars-spring/src/main/java/com/itlong/whatsmars/spring/DbRouterTest.java
0 → 100644
浏览文件 @
a7136e5d
package
com.itlong.whatsmars.spring
;
/**
* Created by shenhongxi on 2016/6/30.
*/
public
class
DbRouterTest
{
public
static
void
main
(
String
[]
args
)
{
String
payid
=
"140331160123935469773"
;
String
resource
=
payid
.
substring
(
payid
.
length
()
-
4
);
int
routeFieldInt
=
Integer
.
valueOf
(
resource
).
intValue
();
int
dbs
=
12
;
int
tbs
=
400
;
int
mode
=
tbs
*
dbs
;
int
dbIndex
=
routeFieldInt
%
mode
/
tbs
;
int
tbIndex
=
routeFieldInt
%
tbs
;
System
.
out
.
println
(
dbIndex
+
"-->"
+
tbIndex
);
}
}
whatsmars-spring/src/test/java/com/itlong/whatsmars/spring/XxDemo.java
0 → 100644
浏览文件 @
a7136e5d
package
com.itlong.whatsmars.spring
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.test.context.ContextConfiguration
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
/**
* Created by shenhongxi on 2016/7/5.
*/
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@ContextConfiguration
(
"/spring-test.xml"
)
public
class
XxDemo
{
@Autowired
private
Mars
mars
;
@Test
public
void
hi
()
{
System
.
out
.
println
(
mars
.
getAge
());
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录