+paging.banner.page.separator=
+
+
+# external sort and pagination
+pagination.sort.param=sort
+pagination.sortdirection.param=dir
+pagination.pagenumber.param=pageNumber
+pagination.searchid.param=searchid
+pagination.sort.asc.value=asc
+pagination.sort.desc.value=desc
+pagination.sort.skippagenumber=true
+
+# unused
+save.excel.banner=\u4fdd\u5b58 ({1} \u5b57\u8282)
+save.excel.filename=export.xls
\ No newline at end of file
diff --git a/src/main/resources/logging.properties b/src/main/resources/logging.properties
new file mode 100644
index 0000000..1d66b3e
--- /dev/null
+++ b/src/main/resources/logging.properties
@@ -0,0 +1,14 @@
+handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
+
+############################################################
+# Handler specific properties.
+# Describes specific configuration info for Handlers.
+# The configuration for Tomcat server
+############################################################
+
+org.apache.juli.FileHandler.level = FINE
+org.apache.juli.FileHandler.directory = ${catalina.base}/logs
+org.apache.juli.FileHandler.prefix = error-debug.
+
+java.util.logging.ConsoleHandler.level = FINE
+java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
diff --git a/src/main/resources/mail.properties b/src/main/resources/mail.properties
new file mode 100644
index 0000000..7656705
--- /dev/null
+++ b/src/main/resources/mail.properties
@@ -0,0 +1,22 @@
+#Email configure
+#mail host name
+host.name=smtp.exmail.qq.com
+#mail send port,default 25
+mail.smtp.port=25
+#mail use username
+mail.username=no-reply@honyee.cc
+#mail use password
+mail.password=honyee@2013
+#default mail address
+default.mail.address=no-reply@honyee.cc
+ # auth
+mail.smtp.auth=true
+# true is use new thread send mail, default false
+#If develop in production, change it to true
+mail.send.use.thread=false
+
+
+#Develop configuration
+#If develop in production, change it to false
+mail.develop.environment=true
+mail.develop.address=shengzhao@honyee.cc
\ No newline at end of file
diff --git a/src/main/resources/mybatis.xml b/src/main/resources/mybatis.xml
new file mode 100644
index 0000000..b37fd4c
--- /dev/null
+++ b/src/main/resources/mybatis.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/resources/spring/context.xml b/src/main/resources/spring/context.xml
new file mode 100644
index 0000000..c8573c1
--- /dev/null
+++ b/src/main/resources/spring/context.xml
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ classpath:database.properties
+ classpath:mail.properties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/resources/spring/infrastructure.xml b/src/main/resources/spring/infrastructure.xml
new file mode 100644
index 0000000..7f2abf3
--- /dev/null
+++ b/src/main/resources/spring/infrastructure.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ${mail.smtp.auth}
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/resources/spring/security.xml b/src/main/resources/spring/security.xml
new file mode 100644
index 0000000..388f33d
--- /dev/null
+++ b/src/main/resources/spring/security.xml
@@ -0,0 +1,181 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/resources/spring/transaction.xml b/src/main/resources/spring/transaction.xml
new file mode 100644
index 0000000..5084b2a
--- /dev/null
+++ b/src/main/resources/spring/transaction.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/resources/template/job_default_content.html b/src/main/resources/template/job_default_content.html
new file mode 100644
index 0000000..9cd9e64
--- /dev/null
+++ b/src/main/resources/template/job_default_content.html
@@ -0,0 +1,21 @@
+
职位描述:
+
+
+
+
+
+
岗位职责:
+
+
+
+
+
+
+
+
联系方式:
+
+
+
+
+
+
diff --git a/src/main/webapp/WEB-INF/decorators.xml b/src/main/webapp/WEB-INF/decorators.xml
new file mode 100644
index 0000000..27d7f9c
--- /dev/null
+++ b/src/main/webapp/WEB-INF/decorators.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+ /*
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/webapp/WEB-INF/hy-servlet.xml b/src/main/webapp/WEB-INF/hy-servlet.xml
new file mode 100644
index 0000000..5173212
--- /dev/null
+++ b/src/main/webapp/WEB-INF/hy-servlet.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/webapp/WEB-INF/jsp/decorators/main.jsp b/src/main/webapp/WEB-INF/jsp/decorators/main.jsp
new file mode 100644
index 0000000..ba8a025
--- /dev/null
+++ b/src/main/webapp/WEB-INF/jsp/decorators/main.jsp
@@ -0,0 +1,41 @@
+<%--
+ * Copyright (c) 2013 Honyee Industry Group Co., Ltd
+ * www.honyee.biz
+ * All rights reserved.
+ *
+ * This software is the confidential and proprietary information of
+ * Honyee Industry Group Co., Ltd ("Confidential Information").
+ * You shall not disclose such Confidential Information and shall use
+ * it only in accordance with the terms of the license agreement you
+ * entered into with Honyee Industry Group Co., Ltd.
+--%>
+<%--
+ *
+ * @author Shengzhao Li
+--%>
+
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+
+
+
+
+
+
+
+
+
+
+
+
+ - Oauth
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/webapp/WEB-INF/jsp/mobile/dashboard.jsp b/src/main/webapp/WEB-INF/jsp/mobile/dashboard.jsp
new file mode 100644
index 0000000..0031bac
--- /dev/null
+++ b/src/main/webapp/WEB-INF/jsp/mobile/dashboard.jsp
@@ -0,0 +1,26 @@
+<%--
+ * Copyright (c) 2013 Honyee Industry Group Co., Ltd
+ * www.honyee.biz
+ * All rights reserved.
+ *
+ * This software is the confidential and proprietary information of
+ * Honyee Industry Group Co., Ltd ("Confidential Information").
+ * You shall not disclose such Confidential Information and shall use
+ * it only in accordance with the terms of the license agreement you
+ * entered into with Honyee Industry Group Co., Ltd.
+--%>
+<%--
+ *
+ * @author Shengzhao Li
+--%>
+
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+
+
+
+ Mobile dashboard
+
+
+
Hi Mobile.
+
+
\ No newline at end of file
diff --git a/src/main/webapp/WEB-INF/jsp/oauth_approval.jsp b/src/main/webapp/WEB-INF/jsp/oauth_approval.jsp
new file mode 100644
index 0000000..7cda532
--- /dev/null
+++ b/src/main/webapp/WEB-INF/jsp/oauth_approval.jsp
@@ -0,0 +1,38 @@
+<%--
+ * Copyright (c) 2013 Honyee Industry Group Co., Ltd
+ * www.honyee.biz
+ * All rights reserved.
+ *
+ * This software is the confidential and proprietary information of
+ * Honyee Industry Group Co., Ltd ("Confidential Information").
+ * You shall not disclose such Confidential Information and shall use
+ * it only in accordance with the terms of the license agreement you
+ * entered into with Honyee Industry Group Co., Ltd.
+--%>
+<%--
+ *
+ * @author Shengzhao Li
+--%>
+
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+
+
+
+
+ Oauth Approval
+
+
OAuth Approval
+
+
Do you authorize '${authorizationRequest.clientId}' to access your protected resources?
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/webapp/WEB-INF/jsp/oauth_error.jsp b/src/main/webapp/WEB-INF/jsp/oauth_error.jsp
new file mode 100644
index 0000000..6a75683
--- /dev/null
+++ b/src/main/webapp/WEB-INF/jsp/oauth_error.jsp
@@ -0,0 +1,28 @@
+<%--
+ * Copyright (c) 2013 Honyee Industry Group Co., Ltd
+ * www.honyee.biz
+ * All rights reserved.
+ *
+ * This software is the confidential and proprietary information of
+ * Honyee Industry Group Co., Ltd ("Confidential Information").
+ * You shall not disclose such Confidential Information and shall use
+ * it only in accordance with the terms of the license agreement you
+ * entered into with Honyee Industry Group Co., Ltd.
+--%>
+<%--
+ *
+ * @author Shengzhao Li
+--%>
+
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+
+
+
+ Oauth Error
+
+
+
+ Illegal action.
+
+
+
\ No newline at end of file
diff --git a/src/main/webapp/WEB-INF/jsp/unity/dashboard.jsp b/src/main/webapp/WEB-INF/jsp/unity/dashboard.jsp
new file mode 100644
index 0000000..57493a2
--- /dev/null
+++ b/src/main/webapp/WEB-INF/jsp/unity/dashboard.jsp
@@ -0,0 +1,26 @@
+<%--
+ * Copyright (c) 2013 Honyee Industry Group Co., Ltd
+ * www.honyee.biz
+ * All rights reserved.
+ *
+ * This software is the confidential and proprietary information of
+ * Honyee Industry Group Co., Ltd ("Confidential Information").
+ * You shall not disclose such Confidential Information and shall use
+ * it only in accordance with the terms of the license agreement you
+ * entered into with Honyee Industry Group Co., Ltd.
+--%>
+<%--
+ *
+ * @author Shengzhao Li
+--%>
+
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+
+
+
+ Unity dashboard
+
+
+
Hi Unity.
+
+
\ No newline at end of file
diff --git a/src/main/webapp/WEB-INF/jsp/user_overview.jsp b/src/main/webapp/WEB-INF/jsp/user_overview.jsp
new file mode 100644
index 0000000..a3a69d5
--- /dev/null
+++ b/src/main/webapp/WEB-INF/jsp/user_overview.jsp
@@ -0,0 +1,26 @@
+<%--
+ * Copyright (c) 2013 Honyee Industry Group Co., Ltd
+ * www.honyee.biz
+ * All rights reserved.
+ *
+ * This software is the confidential and proprietary information of
+ * Honyee Industry Group Co., Ltd ("Confidential Information").
+ * You shall not disclose such Confidential Information and shall use
+ * it only in accordance with the terms of the license agreement you
+ * entered into with Honyee Industry Group Co., Ltd.
+--%>
+<%--
+ *
+ * @author Shengzhao Li
+--%>
+
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+
+
+
+ User Overview
+
+
+
User Overview
+
+
\ No newline at end of file
diff --git a/src/main/webapp/WEB-INF/logback.xml b/src/main/webapp/WEB-INF/logback.xml
new file mode 100644
index 0000000..a74bca6
--- /dev/null
+++ b/src/main/webapp/WEB-INF/logback.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+ %d{yyyy-MM-dd HH:mm:ss} %level %class:%line - %msg%n
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..22f6e82
--- /dev/null
+++ b/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,140 @@
+
+
+
+ spring-oauth
+
+
+
+ webAppRootKey
+ spring-oauth-server
+
+
+
+
+ encodingFilter
+ org.springframework.web.filter.CharacterEncodingFilter
+
+ encoding
+ UTF-8
+
+
+ forceEncoding
+ true
+
+
+
+ encodingFilter
+ /*
+
+
+
+
+ gzipFilter
+
+ net.sf.ehcache.constructs.web.filter.GzipFilter
+
+
+
+ gzipFilter
+ *.css
+
+
+ gzipFilter
+ *.png
+
+
+ gzipFilter
+ *.gif
+
+
+ gzipFilter
+ *.html
+
+
+ gzipFilter
+ *.htm
+
+
+ gzipFilter
+ *.js
+
+
+ gzipFilter
+ *.json
+
+
+
+
+ springSecurityFilterChain
+ org.springframework.web.filter.DelegatingFilterProxy
+
+
+
+ springSecurityFilterChain
+ /*
+
+
+
+
+ sitemesh
+ com.opensymphony.sitemesh.webapp.SiteMeshFilter
+
+
+ sitemesh
+ /*
+
+
+
+ ico
+ image/vnd.microsoft.icon
+
+
+
+
+ contextConfigLocation
+ classpath:spring/*.xml
+
+
+ logbackConfigLocation
+ /WEB-INF/logback.xml
+
+
+ ch.qos.logback.ext.spring.web.LogbackConfigListener
+
+
+
+
+ cc.honyee.web.context.BeanContextLoaderListener
+
+
+
+
+ hy
+ org.springframework.web.servlet.DispatcherServlet
+ 2
+
+
+ hy
+ /
+
+
+
+
+
+
+
+
+ 30
+
+
+
+
+ index.jsp
+
+
+
+
\ No newline at end of file
diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp
new file mode 100644
index 0000000..d4d7bb8
--- /dev/null
+++ b/src/main/webapp/index.jsp
@@ -0,0 +1,38 @@
+<%--
+ * Copyright (c) 2013 Honyee Industry Group Co., Ltd
+ * www.honyee.biz
+ * All rights reserved.
+ *
+ * This software is the confidential and proprietary information of
+ * Honyee Industry Group Co., Ltd ("Confidential Information").
+ * You shall not disclose such Confidential Information and shall use
+ * it only in accordance with the terms of the license agreement you
+ * entered into with Honyee Industry Group Co., Ltd.
+--%>
+<%--
+ *
+ * @author Shengzhao Li
+--%>
+
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+
+
+
+ Home
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/webapp/login.jsp b/src/main/webapp/login.jsp
new file mode 100644
index 0000000..e47f029
--- /dev/null
+++ b/src/main/webapp/login.jsp
@@ -0,0 +1,38 @@
+<%--
+ * Copyright (c) 2013 Honyee Industry Group Co., Ltd
+ * www.honyee.biz
+ * All rights reserved.
+ *
+ * This software is the confidential and proprietary information of
+ * Honyee Industry Group Co., Ltd ("Confidential Information").
+ * You shall not disclose such Confidential Information and shall use
+ * it only in accordance with the terms of the license agreement you
+ * entered into with Honyee Industry Group Co., Ltd.
+--%>
+<%--
+ *
+ * @author Shengzhao Li
+--%>
+
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+
+
+
+ Unity login
+
+
+
Unity login
+
+
+
+
\ No newline at end of file
diff --git a/src/test/java/cc/honyee/ContextTest.java b/src/test/java/cc/honyee/ContextTest.java
new file mode 100644
index 0000000..f02c248
--- /dev/null
+++ b/src/test/java/cc/honyee/ContextTest.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2013 Honyee Industry Group Co., Ltd
+ * www.honyee.biz
+ * All rights reserved.
+ *
+ * This software is the confidential and proprietary information of
+ * Honyee Industry Group Co., Ltd ("Confidential Information").
+ * You shall not disclose such Confidential Information and shall use
+ * it only in accordance with the terms of the license agreement you
+ * entered into with Honyee Industry Group Co., Ltd.
+ */
+package cc.honyee;
+
+import cc.honyee.domain.shared.BeanProvider;
+import cc.honyee.domain.shared.security.HonyeeUserDetails;
+import cc.honyee.domain.shared.security.SecurityUtils;
+import cc.honyee.web.context.SpringSecurityHolder;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests;
+import org.springframework.test.context.transaction.BeforeTransaction;
+
+/**
+ * @author Shengzhao Li
+ */
+@ContextConfiguration(locations = {"classpath:testApplicationContext.xml"})
+public abstract class ContextTest extends AbstractTransactionalTestNGSpringContextTests {
+
+ @BeforeTransaction
+ public void beforeTest() {
+ BeanProvider.initialize(applicationContext);
+ SecurityUtils securityUtils = new SecurityUtils();
+ securityUtils.setSecurityHolder(new SpringSecurityHolder() {
+ @Override
+ public HonyeeUserDetails userDetails() {
+ return null;
+ }
+ });
+ }
+}
\ No newline at end of file
diff --git a/src/test/java/cc/honyee/infrastructure/AbstractRepositoryTest.java b/src/test/java/cc/honyee/infrastructure/AbstractRepositoryTest.java
new file mode 100644
index 0000000..e9aaf58
--- /dev/null
+++ b/src/test/java/cc/honyee/infrastructure/AbstractRepositoryTest.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2013 Honyee Industry Group Co., Ltd
+ * www.honyee.biz
+ * All rights reserved.
+ *
+ * This software is the confidential and proprietary information of
+ * Honyee Industry Group Co., Ltd ("Confidential Information").
+ * You shall not disclose such Confidential Information and shall use
+ * it only in accordance with the terms of the license agreement you
+ * entered into with Honyee Industry Group Co., Ltd.
+ */
+package cc.honyee.infrastructure;
+
+import cc.honyee.ContextTest;
+import org.mybatis.spring.SqlSessionTemplate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jdbc.core.JdbcTemplate;
+
+/**
+ * @author Shengzhao Li
+ */
+public abstract class AbstractRepositoryTest extends ContextTest {
+
+
+ @Autowired
+ private JdbcTemplate jdbcTemplate;
+
+ @Autowired
+ private SqlSessionTemplate sqlSessionTemplate;
+
+
+ public SqlSessionTemplate sqlSessionTemplate() {
+ return sqlSessionTemplate;
+ }
+
+ public JdbcTemplate jdbcTemplate() {
+ return jdbcTemplate;
+ }
+
+
+}
\ No newline at end of file
diff --git a/src/test/java/cc/honyee/infrastructure/DateUtilsTest.java b/src/test/java/cc/honyee/infrastructure/DateUtilsTest.java
new file mode 100644
index 0000000..631f012
--- /dev/null
+++ b/src/test/java/cc/honyee/infrastructure/DateUtilsTest.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2013 Honyee Industry Group Co., Ltd
+ * www.honyee.biz
+ * All rights reserved.
+ *
+ * This software is the confidential and proprietary information of
+ * Honyee Industry Group Co., Ltd ("Confidential Information").
+ * You shall not disclose such Confidential Information and shall use
+ * it only in accordance with the terms of the license agreement you
+ * entered into with Honyee Industry Group Co., Ltd.
+ */
+package cc.honyee.infrastructure;
+
+import org.testng.annotations.Test;
+
+import java.util.Date;
+
+import static org.testng.Assert.*;
+
+/**
+ * @author Shengzhao Li
+ */
+public class DateUtilsTest {
+
+ @Test
+ public void isToday() throws Exception {
+ boolean today = DateUtils.isToday(DateUtils.now());
+ assertTrue(today);
+
+ today = DateUtils.isToday(DateUtils.getDate("2013-03-09"));
+ assertFalse(today);
+ }
+
+ @Test
+ public void isDate() throws Exception {
+ boolean isDate = DateUtils.isDate(null);
+ assertFalse(isDate);
+
+ isDate = DateUtils.isDate("2013-09-11");
+ assertTrue(isDate);
+
+ isDate = DateUtils.isDate("20130911");
+ assertFalse(isDate);
+ }
+
+ /**
+ * OOps! what happened, waiting................
+ */
+ @Test(enabled = false)
+ public void periodAsDays() {
+ Date start = DateUtils.now();
+ Date end = DateUtils.now();
+
+ long days = DateUtils.periodAsDays(start, end);
+ System.out.println("Period: " + days);
+ assertEquals(days, 0);
+
+ start = DateUtils.getDate("2013-03-01 12:23:23", DateUtils.DEFAULT_DATE_TIME_FORMAT);
+ end = DateUtils.getDate("2013-03-11 16:00:11", DateUtils.DEFAULT_DATE_TIME_FORMAT);
+ System.out.println("Start [" + DateUtils.toDateTime(start) + "], End [" + DateUtils.toDateTime(end) + "]");
+
+ days = DateUtils.periodAsDays(start, end);
+ System.out.println("Period: " + days);
+ assertEquals(days, 10);
+ }
+}
\ No newline at end of file
diff --git a/src/test/java/cc/honyee/infrastructure/DimensionalCodeHelperTest.java b/src/test/java/cc/honyee/infrastructure/DimensionalCodeHelperTest.java
new file mode 100644
index 0000000..ccb9024
--- /dev/null
+++ b/src/test/java/cc/honyee/infrastructure/DimensionalCodeHelperTest.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2013 Honyee Industry Group Co., Ltd
+ * www.honyee.biz
+ * All rights reserved.
+ *
+ * This software is the confidential and proprietary information of
+ * Honyee Industry Group Co., Ltd ("Confidential Information").
+ * You shall not disclose such Confidential Information and shall use
+ * it only in accordance with the terms of the license agreement you
+ * entered into with Honyee Industry Group Co., Ltd.
+ */
+package cc.honyee.infrastructure;
+
+import com.google.zxing.*;
+import com.google.zxing.client.j2se.BufferedImageLuminanceSource;
+import com.google.zxing.client.j2se.MatrixToImageWriter;
+import com.google.zxing.common.BitMatrix;
+import com.google.zxing.common.HybridBinarizer;
+import com.google.zxing.qrcode.QRCodeReader;
+import com.google.zxing.qrcode.QRCodeWriter;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.Resource;
+import org.testng.annotations.Test;
+
+import javax.imageio.ImageIO;
+import java.io.File;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.testng.Assert.assertNotNull;
+
+/**
+ * @author Shengzhao Li
+ */
+public class DimensionalCodeHelperTest {
+
+ @Test
+ public void encode() throws Exception {
+
+ File file = file();
+
+ Map hints = new HashMap<>();
+ hints.put(EncodeHintType.CHARACTER_SET, "UTF-8");
+
+ QRCodeWriter qrCodeWriter = new QRCodeWriter();
+ BitMatrix encode = qrCodeWriter.encode("http://honyee.biz 宏义", BarcodeFormat.QR_CODE, 200, 200, hints);
+
+ assertNotNull(encode);
+ MatrixToImageWriter.writeToFile(encode, "png", file);
+
+ }
+
+ @Test
+ public void decode() throws Exception {
+
+ File file = file();
+
+ QRCodeReader qrCodeReader = new QRCodeReader();
+
+ Map hints = new HashMap<>();
+ hints.put(DecodeHintType.CHARACTER_SET, "UTF-8");
+
+ LuminanceSource source = new BufferedImageLuminanceSource(ImageIO.read(file));
+ Binarizer binarizer = new HybridBinarizer(source);
+ BinaryBitmap image = new BinaryBitmap(binarizer);
+
+ Result result = qrCodeReader.decode(image, hints);
+ String text = result.getText();
+ System.out.println(text);
+ }
+
+ private File file() throws IOException, URISyntaxException {
+ Resource resource = new ClassPathResource("dim-code.png");
+ return resource.getFile();
+ }
+
+}
\ No newline at end of file
diff --git a/src/test/java/cc/honyee/infrastructure/GuidTest.java b/src/test/java/cc/honyee/infrastructure/GuidTest.java
new file mode 100644
index 0000000..1341045
--- /dev/null
+++ b/src/test/java/cc/honyee/infrastructure/GuidTest.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2013 Honyee Industry Group Co., Ltd
+ * www.honyee.biz
+ * All rights reserved.
+ *
+ * This software is the confidential and proprietary information of
+ * Honyee Industry Group Co., Ltd ("Confidential Information").
+ * You shall not disclose such Confidential Information and shall use
+ * it only in accordance with the terms of the license agreement you
+ * entered into with Honyee Industry Group Co., Ltd.
+ */
+package cc.honyee.infrastructure;
+
+import cc.honyee.domain.shared.GuidGenerator;
+import org.testng.annotations.Test;
+
+/**
+ * @author Shengzhao Li
+ */
+public class GuidTest {
+
+
+ @Test
+ public void guid() {
+ for (int i = 0; i < 5; i++) {
+ String generate = GuidGenerator.generate();
+ System.out.println(generate);
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/src/test/java/cc/honyee/infrastructure/MD5Test.java b/src/test/java/cc/honyee/infrastructure/MD5Test.java
new file mode 100644
index 0000000..61d7f32
--- /dev/null
+++ b/src/test/java/cc/honyee/infrastructure/MD5Test.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2013 Honyee Industry Group Co., Ltd
+ * www.honyee.biz
+ * All rights reserved.
+ *
+ * This software is the confidential and proprietary information of
+ * Honyee Industry Group Co., Ltd ("Confidential Information").
+ * You shall not disclose such Confidential Information and shall use
+ * it only in accordance with the terms of the license agreement you
+ * entered into with Honyee Industry Group Co., Ltd.
+ */
+package cc.honyee.infrastructure;
+
+import org.springframework.security.authentication.encoding.Md5PasswordEncoder;
+import org.testng.annotations.Test;
+
+/**
+ * @author Shengzhao Li
+ */
+public class MD5Test {
+
+
+ @Test
+ public void encode() {
+ Md5PasswordEncoder encoder = new Md5PasswordEncoder();
+ String encode = encoder.encodePassword("honyee2013", null);
+ System.out.println(encode);
+ }
+
+}
\ No newline at end of file
diff --git a/src/test/java/cc/honyee/infrastructure/MatchUtilsTest.java b/src/test/java/cc/honyee/infrastructure/MatchUtilsTest.java
new file mode 100644
index 0000000..3bff5ff
--- /dev/null
+++ b/src/test/java/cc/honyee/infrastructure/MatchUtilsTest.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2013 Honyee Industry Group Co., Ltd
+ * www.honyee.biz
+ * All rights reserved.
+ *
+ * This software is the confidential and proprietary information of
+ * Honyee Industry Group Co., Ltd ("Confidential Information").
+ * You shall not disclose such Confidential Information and shall use
+ * it only in accordance with the terms of the license agreement you
+ * entered into with Honyee Industry Group Co., Ltd.
+ */
+package cc.honyee.infrastructure;
+
+import org.testng.annotations.Test;
+
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+
+/**
+ * @author Shengzhao Li
+ */
+public class MatchUtilsTest {
+
+
+ @Test
+ public void isEmail() {
+
+ boolean result = MatchUtils.isEmail("addd");
+ assertFalse(result);
+
+ result = MatchUtils.isEmail("addd@honyee.cc");
+ assertTrue(result);
+ }
+
+}
\ No newline at end of file
diff --git a/src/test/java/cc/honyee/infrastructure/mybatis/OauthRepositoryMyBatisTest.java b/src/test/java/cc/honyee/infrastructure/mybatis/OauthRepositoryMyBatisTest.java
new file mode 100644
index 0000000..e5bebae
--- /dev/null
+++ b/src/test/java/cc/honyee/infrastructure/mybatis/OauthRepositoryMyBatisTest.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2013 Honyee Industry Group Co., Ltd
+ * www.honyee.biz
+ * All rights reserved.
+ *
+ * This software is the confidential and proprietary information of
+ * Honyee Industry Group Co., Ltd ("Confidential Information").
+ * You shall not disclose such Confidential Information and shall use
+ * it only in accordance with the terms of the license agreement you
+ * entered into with Honyee Industry Group Co., Ltd.
+ */
+package cc.honyee.infrastructure.mybatis;
+
+import cc.honyee.domain.oauth.OauthClientDetails;
+import cc.honyee.domain.oauth.OauthRepository;
+import cc.honyee.infrastructure.AbstractRepositoryTest;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.testng.annotations.Test;
+
+import static org.testng.Assert.assertNull;
+
+/**
+ * @author Shengzhao Li
+ */
+public class OauthRepositoryMyBatisTest extends AbstractRepositoryTest {
+
+
+ @Autowired
+ private OauthRepository oauthRepositoryMyBatis;
+
+
+ @Test
+ public void findOauthClientDetails() {
+ OauthClientDetails oauthClientDetails = oauthRepositoryMyBatis.findOauthClientDetails("unity-client");
+ assertNull(oauthClientDetails);
+
+ }
+
+}
\ No newline at end of file
diff --git a/src/test/java/cc/honyee/infrastructure/mybatis/UserRepositoryMyBatisTest.java b/src/test/java/cc/honyee/infrastructure/mybatis/UserRepositoryMyBatisTest.java
new file mode 100644
index 0000000..41c5f9a
--- /dev/null
+++ b/src/test/java/cc/honyee/infrastructure/mybatis/UserRepositoryMyBatisTest.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2013 Honyee Industry Group Co., Ltd
+ * www.honyee.biz
+ * All rights reserved.
+ *
+ * This software is the confidential and proprietary information of
+ * Honyee Industry Group Co., Ltd ("Confidential Information").
+ * You shall not disclose such Confidential Information and shall use
+ * it only in accordance with the terms of the license agreement you
+ * entered into with Honyee Industry Group Co., Ltd.
+ */
+package cc.honyee.infrastructure.mybatis;
+
+import cc.honyee.domain.user.User;
+import cc.honyee.domain.user.UserRepository;
+import cc.honyee.infrastructure.AbstractRepositoryTest;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.testng.annotations.Test;
+
+import static org.testng.AssertJUnit.*;
+
+/**
+ * @author Shengzhao Li
+ */
+public class UserRepositoryMyBatisTest extends AbstractRepositoryTest {
+
+ @Autowired
+ private UserRepository userRepository;
+
+
+ @Test
+ public void findByGuid() {
+ User user = userRepository.findByGuid("oood");
+ assertNull(user);
+
+ user = new User("user", "123", "123", "ewo@honyee.cc");
+ userRepository.saveUser(user);
+
+ user = userRepository.findByGuid(user.guid());
+ assertNotNull(user);
+ assertNotNull(user.email());
+
+
+ }
+
+
+ @Test
+ public void updateUser() {
+ User user = new User("user", "123", "123", "ewo@honyee.cc");
+ userRepository.saveUser(user);
+
+ user = userRepository.findByGuid(user.guid());
+ assertNotNull(user);
+ assertNotNull(user.email());
+
+ String newEmail = "test@honyee.cc";
+ user.email(newEmail).phone("12344444");
+ userRepository.updateUser(user);
+
+ user = userRepository.findByGuid(user.guid());
+ assertNotNull(user);
+ assertEquals(user.email(), newEmail);
+ }
+
+
+ @Test
+ public void findByUsername() {
+ String username = "user";
+ User user = new User(username, "123", "123", "ewo@honyee.cc");
+ userRepository.saveUser(user);
+
+ User result = userRepository.findByUsername(username);
+ assertNotNull(result);
+ }
+
+
+}
\ No newline at end of file
diff --git a/src/test/resources/database.properties b/src/test/resources/database.properties
new file mode 100644
index 0000000..2d50ba3
--- /dev/null
+++ b/src/test/resources/database.properties
@@ -0,0 +1,8 @@
+#JDBC configuration information
+jdbc.driverClassName=com.mysql.jdbc.Driver
+############
+# localhost
+############
+jdbc.url=jdbc:mysql://localhost:3306/oauth2_test?autoReconnect=true&autoReconnectForPools=true&useUnicode=true&characterEncoding=utf8
+jdbc.username=honyee
+jdbc.password=honyee
\ No newline at end of file
diff --git a/src/test/resources/dim-code.png b/src/test/resources/dim-code.png
new file mode 100644
index 0000000..683af6e
Binary files /dev/null and b/src/test/resources/dim-code.png differ
diff --git a/src/test/resources/testApplicationContext.xml b/src/test/resources/testApplicationContext.xml
new file mode 100644
index 0000000..6497252
--- /dev/null
+++ b/src/test/resources/testApplicationContext.xml
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+ classpath:database.properties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file