diff --git "a/GIT\347\273\203\344\271\240\346\211\213\345\206\214.docx" "b/GIT\347\273\203\344\271\240\346\211\213\345\206\214.docx" new file mode 100644 index 0000000..65d0294 Binary files /dev/null and "b/GIT\347\273\203\344\271\240\346\211\213\345\206\214.docx" differ diff --git a/JMeterDemo.jmx b/JMeterDemo.jmx new file mode 100644 index 0000000..05af341 --- /dev/null +++ b/JMeterDemo.jmx @@ -0,0 +1,271 @@ + + + + + + false + false + + + + + + + + continue + + false + -1 + + 5 + 5 + 1373789594000 + 1373789594000 + true + 60 + 5 + Virtual Users Running Scenario 1. +Make test last 1 minute (see Scheduler) + + + + + + + example.org + + + + + Notice Timeouts: +Read to 30s +Connect to 5s + 4 + 5000 + 30000 + + + + + false + + + + + + User-Agent + Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:48.0) Gecko/20100101 Firefox/48.0 + + + Accept + text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 + + + Accept-Language + fr,en-US;q=0.7,en;q=0.3 + + + Accept-Encoding + gzip, deflate + + + + + + + + + + + + + / + GET + true + false + true + false + + + + + + + + <h1>Example Domain</h1> + + Assertion.response_data + false + 16 + + + + + + 1 + 0 + 0 + + + + 1000 + 100.0 + + + + + + + + + + + + /test + GET + true + false + true + false + + + + It does not fails because we use an assertion that ignores status + + + + + 404 + + The assertion is specia: +- It ignores status which would make it in error by default (404) +- It checks Response Code is equal to 404 + Assertion.response_code + true + 8 + + + + + + + + + false + + = + true + + + + 106.14.68.164 + 8088 + + + SimpleMavenJunitWebApp/ + GET + true + false + true + false + + + + + + + 0 + 0 + auto + false + 0 + + + + + + Welcome + + + Assertion.response_data_as_document + false + 2 + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + + + + + + + + false + + saveConfig + + + true + true + true + + true + true + true + false + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + + + For scripting only + + + + + + diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..130a077 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,89 @@ +pipeline { + agent any + stages { + stage('Code') { + steps { + git 'https://github.com/xbsoft/SimpleMavenJunitWebApp' + } + } + + + stage('Build and Test') { + parallel { + stage('Build') { + steps { + readFile 'pom.xml' + script { + if(isUnix() == true) { + sh 'mvn install -DskipTests' + }else { + bat 'mvn install -DskipTests' + } + } + } + } + + stage('UnitTest') { + steps { + script { + if(isUnix() == true) { + sh 'mvn package' + }else { + bat 'mvn package' + } + } + } + } + } + } + stage('Check') { + parallel { + stage('Check') { + steps { + script { + if(isUnix() == true) { + sh 'mvn -e -B sonar:sonar -Dsonar.host.url=http://106.14.68.164:9000 -Dsonar.sources=src\\main -Dsonar.scm.provider=git -Dsonar.java.binaries=target && exit %%ERRORLEVEL%%' + }else { + bat 'mvn -e -B sonar:sonar -Dsonar.host.url=http://106.14.68.164:9000 -Dsonar.sources=src\\main -Dsonar.scm.provider=git -Dsonar.java.binaries=target && exit %%ERRORLEVEL%%' + } + } + } + } + stage('checkx') { + steps { + script { + if(isUnix() == true) { + sh 'ls -l' + }else { + bat 'dir' + } + } + } + } + } + } + stage('NexusUpload') { + steps { + sleep 10 + build 'NexusUpload' + } + } + stage('Selenium') { + steps { + build 'SeleniumDemo' + } + } + stage('Jmeter') { + steps { + build 'JMeterDemo' + } + } + } + post { + always { + junit '**/reports/junit/*.xml' + + } + + } +} diff --git a/README.md b/README.md index a5abf51..0ace5ee 100644 --- a/README.md +++ b/README.md @@ -1 +1,50 @@ -# SimpleMavenJunitWebApp +# SimpleMavenJunitWebApp +# demo 9.2 + +演示目标 +课程学员:初级、中级、高级 +角色:开发,测试,项目经理,产品经理 +价值: 快速引入业界最佳实践,短期落地,长期规划,系统化培训与实施,能力培养,社区引荐等 + +范围 +CI/CD/DevOps + +基础 +JDK +Tomcat + +RedMine/GitHub/Maven/Jenkins/SonarQube/JUnit样例 +Jenkins Job: +MavenGitDemo +步骤: +指定Redmine演示项目 +从github取demo代码 +使用Maven编译、运行JUnit +使用Maven调用SonarQube +部署war到Tomcat + +效果: +手动触发完整编译 +在Jenkins编译结果的变更说明中link到RedMine的记录 +链接编译结果至Sonar报告 +在编译结果中查看JUnit测试结果 + +后续 +编译时从Nexus中取得依赖项 +编译后将新版本存入Nexus +在测试后进行一键提权 + + +工具链 +code, GitHub +IDE +Jira/Confluence +Maven +Jenkins +SonarQube +Zephyr +Selenium +Jmeter +Docker +K8s +Hygieia diff --git a/Zjm.docx b/Zjm.docx new file mode 100644 index 0000000..1b76e59 Binary files /dev/null and b/Zjm.docx differ diff --git a/licedse b/licedse new file mode 100644 index 0000000..e69de29 diff --git a/one.txt b/one.txt new file mode 100644 index 0000000..1549b67 --- /dev/null +++ b/one.txt @@ -0,0 +1 @@ +demo diff --git a/qn.txt b/qn.txt new file mode 100644 index 0000000..e69de29 diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..8d63c94 --- /dev/null +++ b/readme.txt @@ -0,0 +1,2 @@ +hello shuai +demo2 diff --git a/songyang.txt b/songyang.txt new file mode 100644 index 0000000..f09e9c3 --- /dev/null +++ b/songyang.txt @@ -0,0 +1 @@ +hello git \ No newline at end of file diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp index c502241..ab8989b 100644 --- a/src/main/webapp/index.jsp +++ b/src/main/webapp/index.jsp @@ -2,5 +2,6 @@

Welcome TO AdaptNext

Version 101 +Author: You diff --git a/src/test/java/com/nijjwal/SimpleTest.java b/src/test/java/com/nijjwal/SimpleTest.java index e33fdd9..0c495b5 100644 --- a/src/test/java/com/nijjwal/SimpleTest.java +++ b/src/test/java/com/nijjwal/SimpleTest.java @@ -1,3 +1,4 @@ +//demo9 package com.nijjwal; import static org.junit.Assert.assertEquals; diff --git a/src/test/test.docx b/src/test/test.docx new file mode 100644 index 0000000..e69de29 diff --git a/testxj b/testxj new file mode 100644 index 0000000..63299aa --- /dev/null +++ b/testxj @@ -0,0 +1 @@ +qwqweqasd diff --git a/two.txt b/two.txt new file mode 100644 index 0000000..e69de29 diff --git a/ypk.txt b/ypk.txt new file mode 100644 index 0000000..43d02ee --- /dev/null +++ b/ypk.txt @@ -0,0 +1 @@ +git is a tool