File tree Expand file tree Collapse file tree 8 files changed +20
-20
lines changed
src/test/java/com/xncoding/webservice
src/main/java/com/xncoding
java/com/xncoding/pos/dao/repository/impl
test/java/com/xncoding/pos Expand file tree Collapse file tree 8 files changed +20
-20
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,10 @@ com.xncoding.webservice.client.User user = c.getCommonServiceImplPort().getUser(
4646assertThat(user. getName(), is(" Tom" ));
4747```
4848
49+ ## 测试步骤
50+
51+ 先启动springboot项目,然后执行` com.xncoding.webservice.ApplicationTests ` 单元测试类。
52+
4953## 许可证
5054
5155Copyright (c) 2018 Xiong Neng
Original file line number Diff line number Diff line change 11package com .xncoding .webservice ;
22
3- import com .xncoding .webservice .client .CommonService_Service ;
43import com .xncoding .webservice .model .User ;
54import com .xncoding .webservice .service .ICommonService ;
65import org .apache .cxf .endpoint .Client ;
76import org .apache .cxf .jaxws .JaxWsProxyFactoryBean ;
87import org .apache .cxf .jaxws .endpoint .dynamic .JaxWsDynamicClientFactory ;
98import org .junit .Before ;
109import org .junit .Test ;
11- import org .junit .runner .RunWith ;
12- import org .springframework .boot .test .context .SpringBootTest ;
13- import org .springframework .boot .web .server .LocalServerPort ;
14- import org .springframework .test .context .junit4 .SpringRunner ;
1510
16- import static org .hamcrest .MatcherAssert .assertThat ;
17- import static org .hamcrest .Matchers .is ;
18-
19- @ RunWith (SpringRunner .class )
20- @ SpringBootTest (classes = Application .class , webEnvironment = SpringBootTest .WebEnvironment .RANDOM_PORT )
2111public class ApplicationTests {
22- @ LocalServerPort
12+
2313 private Integer port ;
2414 /**
2515 * 接口地址
@@ -28,7 +18,7 @@ public class ApplicationTests {
2818
2919 @ Before
3020 public void prepare () {
31- wsdlAddress = "http://localhost:" + port + " /services/CommonService?wsdl" ;
21+ wsdlAddress = "http://localhost:8092 /services/CommonService?wsdl" ;
3222 }
3323
3424 /**
Original file line number Diff line number Diff line change 1919
2020尝试采用页面js轮询方式,1秒轮询一次,有数据的时候就导出图片。结果导出图片太大了,不知道怎么回事,另外轮询方案始终不是很好。
2121
22- 最后还是老老实实使用websocket方案,自己手动打开这个网页吧。 < http://localhost:9075/ >
22+ 最后还是老老实实使用websocket方案
2323
2424## JMH性能测试
2525
2626在包` com.xncoding.benchmark ` 中,有几个基准测试,并且可将测试结果利用echarts图片导出到图片。
2727
28+ ## 测试步骤
29+
30+ 1 . 启动应用后,用浏览器打开首页:< http://localhost:9075/ >
31+ 2 . 然后再执行图片生成测试方法` com.xncoding.echarts.common.util.ApplicationTests.testOption() `
32+
2833## 许可证
2934
3035Copyright (c) 2018 Xiong Neng
Original file line number Diff line number Diff line change 2323 <project .reporting.outputEncoding>UTF-8</project .reporting.outputEncoding>
2424 <java .version>1.8</java .version>
2525 <netty .version>4.1.19.Final</netty .version>
26- <thymeleaf .version>3.0.7.RELEASE</thymeleaf .version>
27- <thymeleaf-layout-dialect .version>2.2.2</thymeleaf-layout-dialect .version>
2826 <jmh .version>1.20</jmh .version>
2927 </properties >
3028
Original file line number Diff line number Diff line change 1- package com .xncoding . echarts ;
1+ package com .xncoding ;
22
33import org .springframework .boot .SpringApplication ;
44import org .springframework .boot .autoconfigure .SpringBootApplication ;
Original file line number Diff line number Diff line change @@ -53,8 +53,9 @@ public void deleteArticle(int articleId) {
5353 @ Override
5454 public boolean articleExists (String title , String category ) {
5555 String hql = "FROM Article as atcl WHERE atcl.title = ? and atcl.category = ?" ;
56- int count = entityManager .createQuery (hql ).setParameter (1 , title )
57- .setParameter (2 , category ).getResultList ().size ();
56+ int count = entityManager .createQuery (hql )
57+ .setParameter (0 , title )
58+ .setParameter (1 , category ).getResultList ().size ();
5859 return count > 0 ;
5960 }
6061}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ logging:
2626spring :
2727 profiles : dev
2828 datasource :
29- url : jdbc:mysql://127.0.0.1:3306/pos?useSSL=false&autoReconnect=true&tinyInt1isBit=false&useUnicode=true&characterEncoding=utf8
29+ url : jdbc:mysql://127.0.0.1:3306/pos?serverTimezone=UTC& useSSL=false&autoReconnect=true&tinyInt1isBit=false&useUnicode=true&characterEncoding=utf8
3030 username : root
3131 password : 123456
3232
@@ -46,7 +46,7 @@ logging:
4646spring :
4747 profiles : test
4848 datasource :
49- url : jdbc:mysql://127.0.0.1:3306/pos?useSSL=false&autoReconnect=true&tinyInt1isBit=false&useUnicode=true&characterEncoding=utf8
49+ url : jdbc:mysql://127.0.0.1:3306/pos?serverTimezone=UTC& useSSL=false&autoReconnect=true&tinyInt1isBit=false&useUnicode=true&characterEncoding=utf8
5050 username : root
5151 password : 123456
5252
Original file line number Diff line number Diff line change 88import org .slf4j .LoggerFactory ;
99import org .springframework .boot .test .context .SpringBootTest ;
1010import org .springframework .test .context .junit4 .SpringRunner ;
11+ import org .springframework .transaction .annotation .Transactional ;
1112
1213import javax .annotation .Resource ;
1314
2324 */
2425@ RunWith (SpringRunner .class )
2526@ SpringBootTest
27+ @ Transactional
2628public class ApplicationTests {
2729 private static final Logger log = LoggerFactory .getLogger (ApplicationTests .class );
2830
You can’t perform that action at this time.
0 commit comments