完成springboot-hibernate升级

This commit is contained in:
Xiong Neng 2018-09-14 15:11:47 +08:00
parent ce308f2b6d
commit 7b5e72ab34
8 changed files with 20 additions and 20 deletions

View File

@ -46,6 +46,10 @@ com.xncoding.webservice.client.User user = c.getCommonServiceImplPort().getUser(
assertThat(user.getName(), is("Tom"));
```
## 测试步骤
先启动springboot项目然后执行`com.xncoding.webservice.ApplicationTests`单元测试类。
## 许可证
Copyright (c) 2018 Xiong Neng

View File

@ -1,6 +1,5 @@
package com.xncoding.webservice;
import com.xncoding.webservice.client.CommonService_Service;
import com.xncoding.webservice.model.User;
import com.xncoding.webservice.service.ICommonService;
import org.apache.cxf.endpoint.Client;
@ -8,18 +7,9 @@ import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.test.context.junit4.SpringRunner;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class ApplicationTests {
@LocalServerPort
private Integer port;
/**
* 接口地址
@ -28,7 +18,7 @@ public class ApplicationTests {
@Before
public void prepare() {
wsdlAddress = "http://localhost:" + port + "/services/CommonService?wsdl";
wsdlAddress = "http://localhost:8092/services/CommonService?wsdl";
}
/**

View File

@ -19,12 +19,17 @@
尝试采用页面js轮询方式1秒轮询一次有数据的时候就导出图片。结果导出图片太大了不知道怎么回事另外轮询方案始终不是很好。
最后还是老老实实使用websocket方案,自己手动打开这个网页吧。<http://localhost:9075/>
最后还是老老实实使用websocket方案
## JMH性能测试
在包`com.xncoding.benchmark`中有几个基准测试并且可将测试结果利用echarts图片导出到图片。
## 测试步骤
1. 启动应用后,用浏览器打开首页:<http://localhost:9075/>
2. 然后再执行图片生成测试方法`com.xncoding.echarts.common.util.ApplicationTests.testOption()`
## 许可证
Copyright (c) 2018 Xiong Neng

View File

@ -23,8 +23,6 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<netty.version>4.1.19.Final</netty.version>
<thymeleaf.version>3.0.7.RELEASE</thymeleaf.version>
<thymeleaf-layout-dialect.version>2.2.2</thymeleaf-layout-dialect.version>
<jmh.version>1.20</jmh.version>
</properties>

View File

@ -1,4 +1,4 @@
package com.xncoding.echarts;
package com.xncoding;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

View File

@ -53,8 +53,9 @@ public class ArticleDAO implements IArticleDAO {
@Override
public boolean articleExists(String title, String category) {
String hql = "FROM Article as atcl WHERE atcl.title = ? and atcl.category = ?";
int count = entityManager.createQuery(hql).setParameter(1, title)
.setParameter(2, category).getResultList().size();
int count = entityManager.createQuery(hql)
.setParameter(0, title)
.setParameter(1, category).getResultList().size();
return count > 0;
}
}

View File

@ -26,7 +26,7 @@ logging:
spring:
profiles: dev
datasource:
url: jdbc:mysql://127.0.0.1:3306/pos?useSSL=false&autoReconnect=true&tinyInt1isBit=false&useUnicode=true&characterEncoding=utf8
url: jdbc:mysql://127.0.0.1:3306/pos?serverTimezone=UTC&useSSL=false&autoReconnect=true&tinyInt1isBit=false&useUnicode=true&characterEncoding=utf8
username: root
password: 123456
@ -46,7 +46,7 @@ logging:
spring:
profiles: test
datasource:
url: jdbc:mysql://127.0.0.1:3306/pos?useSSL=false&autoReconnect=true&tinyInt1isBit=false&useUnicode=true&characterEncoding=utf8
url: jdbc:mysql://127.0.0.1:3306/pos?serverTimezone=UTC&useSSL=false&autoReconnect=true&tinyInt1isBit=false&useUnicode=true&characterEncoding=utf8
username: root
password: 123456

View File

@ -8,6 +8,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
@ -23,6 +24,7 @@ import static org.hamcrest.Matchers.nullValue;
*/
@RunWith(SpringRunner.class)
@SpringBootTest
@Transactional
public class ApplicationTests {
private static final Logger log = LoggerFactory.getLogger(ApplicationTests.class);