├── .github ├── settings.yml └── workflows │ ├── backup.yaml │ └── build.yaml ├── .gitignore ├── Jenkinsfile ├── Jenkinsfile-build-other-job.groovy ├── Jenkinsfile-input ├── Jenkinsfile-junit-k8s ├── Jenkinsfile-milestone.groovy ├── Jenkinsfile-parameters.groovy ├── Jenkinsfile-sonar.groovy ├── Jenkinsfile.jmeter.groovy ├── Jenkinsfile_lighthouse.groovy ├── Jenkinsfile_longrun.groovy ├── LICENSE ├── OWNERS ├── README-zh.md ├── README.md ├── pom.xml └── src ├── main ├── java │ ├── cli │ │ └── App.java │ └── hello │ │ ├── GenerateTestCases.java │ │ └── Web.java ├── resources │ ├── AccountSystemTest.java │ ├── UserSystemTest.java │ └── WithExceptionTest.java └── webapp │ ├── WEB-INF │ └── web.xml │ └── index.html └── test ├── java └── test │ ├── AccountSystemTest.java │ ├── UserSystemTest.java │ └── WithExceptionTest.java └── resources └── baidu-jmeter.jmx /.github/settings.yml: -------------------------------------------------------------------------------- 1 | repository: 2 | name: demo-junit 3 | description: A demo project for the Jenkins Pipeline 4 | homepage: https://jenkins-zh.cn 5 | private: false 6 | has_issues: true 7 | has_wiki: false 8 | has_downloads: false 9 | default_branch: master 10 | allow_squash_merge: true 11 | allow_merge_commit: true 12 | allow_rebase_merge: true 13 | labels: 14 | - name: newbie 15 | color: abe7f4 16 | description: 新手上路 17 | - name: bug 18 | color: d73a4a 19 | description: Something isn't working 20 | - name: feature 21 | color: ffc6a3 22 | - name: enhancement 23 | color: a2eeef 24 | description: New feature or request 25 | - name: help wanted 26 | color: 008672 27 | description: Extra attention is needed 28 | - name: bugfix 29 | color: 0412d6 30 | - name: regression 31 | color: c5def5 32 | - name: documentation 33 | color: 5ce05e 34 | - name: test 35 | color: c2c2fc 36 | - name: chore 37 | color: c2c2fc 38 | branches: 39 | - name: master 40 | protection: 41 | required_pull_request_reviews: 42 | required_approving_review_count: 2 43 | dismiss_stale_reviews: true 44 | require_code_owner_reviews: false 45 | dismissal_restrictions: 46 | users: [] 47 | teams: [] 48 | required_status_checks: 49 | strict: true 50 | contexts: [] 51 | enforce_admins: false 52 | restrictions: 53 | users: [] 54 | teams: [] 55 | -------------------------------------------------------------------------------- /.github/workflows/backup.yaml: -------------------------------------------------------------------------------- 1 | name: Backup Git repository 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | git-repo-backup: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@master 13 | - name: Backup to Gitee 14 | uses: jenkins-zh/git-backup-actions@v0.0.4 15 | env: 16 | GIT_DEPLOY_KEY: ${{ secrets.GIT_DEPLOY_KEY }} 17 | TARGET_GIT: "git@gitee.com:devops-ws/learn-pipeline-java.git" 18 | - name: Backup to CodeChina 19 | uses: jenkins-zh/git-backup-actions@v0.0.4 20 | env: 21 | GIT_DEPLOY_KEY: ${{ secrets.GIT_DEPLOY_KEY }} 22 | TARGET_GIT: "git@codechina.csdn.net:devops-ws/learn-pipeline-java.git" 23 | -------------------------------------------------------------------------------- /.github/workflows/build.yaml: -------------------------------------------------------------------------------- 1 | # This workflow will build a package using Maven and then publish it to GitHub packages when a release is created 2 | # For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path 3 | 4 | name: Maven Package 5 | 6 | on: 7 | release: 8 | types: [created] 9 | 10 | jobs: 11 | build: 12 | 13 | runs-on: ubuntu-latest 14 | permissions: 15 | contents: read 16 | packages: write 17 | 18 | steps: 19 | - uses: actions/checkout@v2 20 | - name: Set up JDK 11 21 | uses: actions/setup-java@v2 22 | with: 23 | java-version: '11' 24 | distribution: 'adopt' 25 | server-id: github # Value of the distributionManagement/repository/id field of the pom.xml 26 | settings-path: ${{ github.workspace }} # location for the settings.xml file 27 | 28 | - name: Build with Maven 29 | run: mvn -B package --file pom.xml 30 | 31 | - name: Publish to GitHub Packages Apache Maven 32 | run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml 33 | env: 34 | GITHUB_TOKEN: ${{ github.token }} 35 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | *.iml 3 | .idea 4 | 5 | .project 6 | .classpath 7 | .settings 8 | bin 9 | src/main/webapp/WEB-INF/classes 10 | src/main/webapp/WEB-INF/lib -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | pipeline { 2 | agent any 3 | 4 | stages { 5 | stage('one') { 6 | steps { 7 | echo 'first stage' 8 | echo env.CHANGE_ID 9 | } 10 | } 11 | stage('two') { 12 | steps { 13 | sh 'echo test > log.txt' 14 | 15 | archiveArtifacts artifacts: 'log.txt', followSymlinks: false 16 | } 17 | } 18 | stage('three') { 19 | steps { 20 | sh 'echo test > three.txt' 21 | 22 | archiveArtifacts artifacts: 'three.txt', followSymlinks: false 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Jenkinsfile-build-other-job.groovy: -------------------------------------------------------------------------------- 1 | pipeline { 2 | agent any 3 | 4 | stages { 5 | stage('trigger job') { 6 | steps { 7 | // please modify the job path 8 | build job: 'other-job', parameters: 9 | [string(name: 'name', value: 'rick'), booleanParam(name: 'DEBUG', value: true)] 10 | } 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Jenkinsfile-input: -------------------------------------------------------------------------------- 1 | pipeline { 2 | agent any 3 | 4 | stages{ 5 | stage('simple'){ 6 | steps{ 7 | input message: 'Please input your name!', ok: 'Confirm', 8 | parameters: [string(defaultValue: 'rick', 9 | description: 'This should not be your real name.', name: 'name', trim: true)] 10 | } 11 | } 12 | 13 | stage('complex'){ 14 | parallel { 15 | stage('channel-1'){ 16 | steps{ 17 | input message: 'Please input your age!', ok: 'Confirm', 18 | parameters: [string(defaultValue: '18', 19 | description: 'Just a joke.', name: 'age', trim: true)] 20 | } 21 | } 22 | stage('channel-2'){ 23 | steps{ 24 | input message: 'Please input your weight!', ok: 'Confirm', 25 | parameters: [string(defaultValue: '50', 26 | description: 'Just a joke.', name: 'weight', trim: true)] 27 | } 28 | } 29 | } 30 | } 31 | 32 | stage('use result'){ 33 | parallel { 34 | stage('one param'){ 35 | steps{ 36 | script{ 37 | result = input message: 'Please input the git branch name!', ok: 'Confirm', 38 | parameters: [string(defaultValue: 'master', 39 | description: 'The branch name of git repo', name: 'branchName', trim: true)] 40 | 41 | git branch: result, url: 'https://github.com/devops-workspace/demo-junit' 42 | } 43 | } 44 | } 45 | 46 | stage('multi-param'){ 47 | steps{ 48 | script{ 49 | result = input message: 'Please input the git branch name with debug info!', ok: 'Confirm', 50 | parameters: [string(defaultValue: 'master', 51 | description: 'The branch name of git repo', name: 'branchName', trim: true), 52 | string(defaultValue: 'debug info', 53 | description: 'Output the debug info', name: 'debugInfo', trim: true)] 54 | 55 | git branch: result.branchName, url: 'https://github.com/devops-workspace/demo-junit' 56 | echo result.debugInfo 57 | } 58 | } 59 | } 60 | 61 | stage('param-boolean'){ 62 | steps{ 63 | script{ 64 | result = input message: 'Please input the git branch name with debug info!', ok: 'Confirm', 65 | parameters: [string(defaultValue: 'master', 66 | description: 'The branch name of git repo', name: 'branchName', trim: true), 67 | string(defaultValue: 'debug info', 68 | description: 'Output the debug info', name: 'debugInfo', trim: true), 69 | booleanParam(defaultValue: false, description: 'Run this Pipeline in debug mode.', name: 'debug')] 70 | 71 | git branch: result.branchName, url: 'https://github.com/devops-workspace/demo-junit' 72 | echo result.debugInfo 73 | } 74 | } 75 | } 76 | 77 | } 78 | } 79 | 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /Jenkinsfile-junit-k8s: -------------------------------------------------------------------------------- 1 | pipeline { 2 | agent { 3 | label 'maven' 4 | } 5 | 6 | options { 7 | disableConcurrentBuilds() 8 | } 9 | 10 | 11 | stages{ 12 | stage('Clone'){ 13 | steps{ 14 | //checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'https://gitee.com/devops-workspace/learn-pipeline-java']]]) 15 | echo "clone demo" 16 | } 17 | } 18 | 19 | stage('Build & Test'){ 20 | steps{ 21 | script{ 22 | container('java'){ 23 | sh 'mvn test -DSERVER_PORT=1234' 24 | //sh 'mvn test -DSERVER_PORT=2345' 25 | } 26 | } 27 | } 28 | } 29 | 30 | stage('Only for demo'){ 31 | when { 32 | allOf { 33 | branch 'master' 34 | } 35 | } 36 | steps{ 37 | echo 'only for demo' 38 | } 39 | } 40 | } 41 | 42 | post{ 43 | always{ 44 | junit 'target/surefire-reports/**/*.xml' 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Jenkinsfile-milestone.groovy: -------------------------------------------------------------------------------- 1 | // inspired from https://stackoverflow.com/questions/40760716/jenkins-abort-running-build-if-new-one-is-started 2 | 3 | def buildNumber = env.BUILD_NUMBER as int 4 | if (buildNumber > 1) milestone(buildNumber - 1) 5 | milestone(buildNumber) 6 | 7 | sleep 20 -------------------------------------------------------------------------------- /Jenkinsfile-parameters.groovy: -------------------------------------------------------------------------------- 1 | pipeline { 2 | agent any 3 | 4 | parameters { 5 | string defaultValue: 'rick', description: 'just for testing', name: 'name', trim: true 6 | booleanParam defaultValue: false, description: 'You can use this flag to debug your Pipeline', name: 'debug' 7 | choice choices: ['v1.18.8', 'v1.18.9'], description: 'Please choose the target Kubernetes version', name: 'kubernetesVersion' 8 | } 9 | 10 | stages{ 11 | stage('simple'){ 12 | steps{ 13 | echo "My name is ${params.name}." 14 | echo "Target Kubernetes version is " + params.kubernetesVersion 15 | 16 | script { 17 | if ("${params.debug}" == "true") { 18 | echo "You can put some debug info at here." 19 | echo "Another way to use param: " + params.name 20 | } 21 | } 22 | } 23 | } 24 | 25 | stage('debug stage') { 26 | when { 27 | equals expected: true, actual: params.debug 28 | } 29 | steps { 30 | echo "It's joke, there're debug info here." 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Jenkinsfile-sonar.groovy: -------------------------------------------------------------------------------- 1 | // this demo runs in a k8s pod which has a docker container named 'java' 2 | // also, maven is needed in this case. 3 | pipeline { 4 | agent { 5 | label 'maven' 6 | } 7 | 8 | stages{ 9 | stage('build'){ 10 | steps{ 11 | container('java'){ 12 | sh 'mvn clean package' 13 | } 14 | } 15 | } 16 | 17 | stage('sonar scan') { 18 | steps { 19 | container('java'){ 20 | sh ''' 21 | mvn sonar:sonar \ 22 | -Dsonar.projectKey=test \ 23 | -Dsonar.host.url=${SONAR_HOST_URL} \ 24 | -Dsonar.login=${SONAR_LOGIN} 25 | ''' 26 | } 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Jenkinsfile.jmeter.groovy: -------------------------------------------------------------------------------- 1 | // this case requires docker image egaillardon/jmeter 2 | // you should run this pipeline under the kubernetes, and a container named jmeter is required 3 | // In order to execute this successfuly, please install plugins using below command 4 | // jcli plugin install kubernetes htmlpublisher pipeline-restful-api 5 | pipeline{ 6 | agent{ 7 | label 'jmeter' 8 | } 9 | 10 | stages{ 11 | stage('test'){ 12 | steps{ 13 | script{ 14 | container('jmeter'){ 15 | sh 'rm -rf result && rm -rf result.jtl && jmeter -n -t src/test/resources/baidu-jmeter.jmx -l result.jtl -e -o result' 16 | 17 | // below is an example for sending test report to a generic artifact server 18 | // see more details from https://github.com/mayth/go-simple-upload-server/pull/14 19 | // sh 'curl http://10.0.129.98:12345' 20 | // def files = findFiles glob: 'result/**/*' 21 | // for(file in files) { 22 | // def path = file.path.replaceAll('result/', '').replaceAll(file.name, '') 23 | // path = currentBuild.fullProjectName + '/' + currentBuild.number + '/' + path 24 | // sh 'curl -Ffile=@' + file.path + ' "http://10.0.129.98:12345/upload?token=testtoken&path=' + path + '"' 25 | // } 26 | 27 | // echo 'http://10.0.129.98:12345/' + currentBuild.fullProjectName + '/' + currentBuild.number + '/index.html' 28 | } 29 | } 30 | } 31 | } 32 | 33 | stage('report'){ 34 | steps{ 35 | script{ 36 | container('jmeter'){ 37 | publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'result', reportFiles: 'index.html', reportName: 'HTML Report', reportTitles: '']) 38 | } 39 | } 40 | } 41 | } 42 | 43 | stage('artifacts') { 44 | steps { 45 | container('jmeter') { 46 | sh 'tar czf result.tar.gz result' 47 | archiveArtifacts 'result.tar.gz' 48 | } 49 | } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Jenkinsfile_lighthouse.groovy: -------------------------------------------------------------------------------- 1 | 2 | pipeline { 3 | agent any 4 | 5 | parameters { 6 | string(name: 'JOB_NAME', defaultValue: '', description: 'Job name') 7 | string(name: 'JOB_TYPE', defaultValue: '', description: 'Job type') 8 | string(name: 'JOB_SPEC', defaultValue: '', description: 'Job spec') 9 | string(name: 'BUILD_ID', defaultValue: '', description: 'Build id') 10 | string(name: 'LIGHTHOUSE_JOB_ID', defaultValue: '', description: 'Lighthouse job id') 11 | } 12 | 13 | stages{ 14 | stage('simple'){ 15 | steps{ 16 | echo "My name is ${params.LIGHTHOUSE_JOB_ID}." 17 | } 18 | } 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Jenkinsfile_longrun.groovy: -------------------------------------------------------------------------------- 1 | pipeline { 2 | agent any 3 | 4 | stages { 5 | stage('one') { 6 | steps { 7 | script { 8 | for (i = 0; i < 60; i++) { 9 | sleep 1 10 | echo "1" 11 | } 12 | } 13 | } 14 | } 15 | stage('two') { 16 | steps { 17 | script { 18 | for (i = 0; i < 60; i++) { 19 | sleep 1 20 | echo "1" 21 | } 22 | } 23 | } 24 | } 25 | stage('three') { 26 | steps { 27 | script { 28 | for (i = 0; i < 60; i++) { 29 | sleep 1 30 | echo "1" 31 | } 32 | } 33 | } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 rick 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - linuxsuren 3 | -------------------------------------------------------------------------------- /README-zh.md: -------------------------------------------------------------------------------- 1 | 该项目旨在提供一种轻松的方法来体验 Jenkins 流水线。 2 | 3 | 根据不同的使用场景,我们提供了一些 Jenkinsfile: 4 | 5 | |文件|需求|描述| 6 | |---|---|---| 7 | |[Jenkinsfile-parameters.groovy](Jenkinsfile-parameters.groovy)|没有特别需要依赖的。|在 Jenkinsfile 中使用参数化流水线的例子。| 8 | |[Jenkinsfile-junit-k8s](Jenkinsfile-junit-k8s)|需要有一个带 `maven` 标签的代理节点。这个节点必须是在一个包含 `java` 容器的 pod 中。|生成 junit 报告。| 9 | |[Jenkinsfile-input](Jenkinsfile-input)|任何类型的节点。|需要用户输入,然后流水线才可以继续。| 10 | |[Jenkinsfile.jmeter.groovy](Jenkinsfile.jmeter.groovy)|一个 kubernetes 环境|在 Jenkins 中运行 JMeter 测试| 11 | |[Jenkinsfile-milestone.groovy](Jenkinsfile-milestone.groovy)|无|当有新的构建任务时,把已经运行的停止| 12 | 13 | 查看更多 https://jenkins-zh.cn/about/course/#1 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This project is aim to provide an easy way to try Jenkins pipeline. 2 | 3 | According to different use cases, we provide several Jenkinsfile for you: 4 | 5 | |File|Requirement|Description| 6 | |---|---|---| 7 | |[Jenkinsfile-parameters.groovy](Jenkinsfile-parameters.groovy)|No particular things are required.|A demo about how to use parameters in Jenkinsfile pipeline.| 8 | |[Jenkinsfile-junit-k8s](Jenkinsfile-junit-k8s)|It requires an agent which has a label `maven`. The agent should be a pod which contains a container named `java`.|Generate junit report.| 9 | |[Jenkinsfile-input](Jenkinsfile-input)|Any types of agent.|Require a user to input something, then the Pipeline will keep going.| 10 | |[Jenkinsfile.jmeter.groovy](Jenkinsfile.jmeter.groovy)|A kubernetes environment|Running a JMeter test in Jenkins| 11 | |[Jenkinsfile-milestone.groovy](Jenkinsfile-milestone.groovy)|None|Abort running build if new one is started| 12 | See also https://jenkins-zh.cn/about/course/#1 13 | 14 | # Jar 15 | 16 | You can run it via the following: 17 | 18 | ``` 19 | mvn package 20 | java -jar target/demo-junit-1.0.1-20170422.jar 21 | ``` 22 | 23 | # War -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | test 6 | demo-junit 7 | 1.0.2-SNAPSHOT 8 | 9 | war 10 | 11 | 12 | 13 | github 14 | https://maven.pkg.github.com/devops-ws/learn-pipeline-java 15 | 16 | 17 | github 18 | https://maven.pkg.github.com/devops-ws/learn-pipeline-java 19 | 20 | 21 | 22 | 23 | 24 | 25 | org.apache.maven.plugins 26 | maven-surefire-plugin 27 | 28 | false 29 | 30 | 31 | 32 | org.apache.maven.plugins 33 | maven-compiler-plugin 34 | 35 | 7 36 | 7 37 | 38 | 39 | 40 | org.apache.maven.plugins 41 | maven-war-plugin 42 | 43 | 44 | package 45 | 46 | true 47 | ${basedir}/src/main/webapp/WEB-INF/web.xml 48 | 49 | 50 | inplace 51 | 52 | 53 | 54 | 55 | 56 | org.apache.maven.plugins 57 | maven-jar-plugin 58 | 59 | 60 | make-a-jar 61 | compile 62 | 63 | jar 64 | 65 | 66 | 67 | 68 | 69 | 70 | true 71 | 72 | cli.App 73 | 74 | 75 | 76 | 77 | 78 | 79 | org.apache.maven.plugins 80 | maven-install-plugin 81 | 82 | 83 | Add-2-local-repository 84 | package 85 | 86 | jar 87 | test 88 | demo-junit 89 | 1.0.1-20170422 90 | ${project.build.directory}/${artifactId}-${version}.jar 91 | 92 | 93 | install-file 94 | 95 | 96 | 97 | 98 | 99 | org.codehaus.mojo 100 | build-helper-maven-plugin 101 | 1.7 102 | 103 | 104 | attach-artifacts 105 | package 106 | 107 | attach-artifact 108 | 109 | 110 | 111 | 112 | ${project.build.directory}/${artifactId}-${version}.jar 113 | jar 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | org.freemarker 126 | freemarker 127 | 2.3.20 128 | 129 | 130 | 131 | 132 | javax.servlet 133 | servlet-api 134 | 2.5 135 | provided 136 | 137 | 138 | 139 | junit 140 | junit 141 | 4.13.1 142 | test 143 | 144 | 145 | -------------------------------------------------------------------------------- /src/main/java/cli/App.java: -------------------------------------------------------------------------------- 1 | package cli; 2 | 3 | /** 4 | * This is a demo for Java executable jar 5 | */ 6 | public class App { 7 | public static void main(String[] args) { 8 | System.out.println("Env: NAME=" + System.getenv("NAME")); 9 | System.out.println("Property: cli.name=" + System.getProperty("cli.name")); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/hello/GenerateTestCases.java: -------------------------------------------------------------------------------- 1 | package hello; 2 | 3 | import freemarker.template.Configuration; 4 | import freemarker.template.Template; 5 | 6 | import java.io.File; 7 | import java.io.FileOutputStream; 8 | import java.io.OutputStreamWriter; 9 | 10 | /** 11 | * Generate test cases by freemarker. 12 | */ 13 | public class GenerateTestCases { 14 | private Configuration config = new Configuration(); 15 | 16 | public static void main(String[] args) throws Exception { 17 | GenerateTestCases generator = new GenerateTestCases(); 18 | 19 | generator.generate("UserSystemTest.java"); 20 | generator.generate("AccountSystemTest.java"); 21 | generator.generate("WithExceptionTest.java"); 22 | } 23 | 24 | private void generate(final String fileName) throws Exception { 25 | config.setClassForTemplateLoading(GenerateTestCases.class,"/"); 26 | 27 | try (OutputStreamWriter writer = 28 | new OutputStreamWriter(new FileOutputStream(new File("target", fileName)))){ 29 | Template template = config.getTemplate(fileName, "UTF-8"); 30 | template.setEncoding("UTF-8"); 31 | template.process(null, writer); 32 | } 33 | } 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/main/java/hello/Web.java: -------------------------------------------------------------------------------- 1 | package hello; 2 | 3 | import javax.servlet.http.HttpServlet; 4 | import javax.servlet.http.HttpServletRequest; 5 | import javax.servlet.http.HttpServletResponse; 6 | import java.io.IOException; 7 | import java.io.PrintWriter; 8 | 9 | public class Web extends HttpServlet { 10 | public void doGet(HttpServletRequest req, HttpServletResponse res) 11 | throws IOException { 12 | res.setContentType("text/html");//setting the content type 13 | PrintWriter pw = res.getWriter();//get the stream to write the data 14 | 15 | //writing html in the stream 16 | pw.println(""); 17 | pw.println("Welcome to servlet"); 18 | pw.println(""); 19 | 20 | pw.close();//closing the stream 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/resources/AccountSystemTest.java: -------------------------------------------------------------------------------- 1 | package test; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.assertEquals; 6 | 7 | /** 8 | * This class is only for the test purpose. 9 | */ 10 | public class AccountSystemTest { 11 | private final String EXPECT_IP = "0.0.0.0"; 12 | private final String SERVER_IP = System.getProperty("SERVER_IP", EXPECT_IP); 13 | 14 | <#list 1..62 as i> 15 | @Test 16 | public void name_${i}() { 17 | assertEquals(EXPECT_IP, SERVER_IP); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/resources/UserSystemTest.java: -------------------------------------------------------------------------------- 1 | package test; 2 | 3 | import org.junit.Ignore; 4 | import org.junit.Test; 5 | 6 | import static org.junit.Assert.assertEquals; 7 | 8 | /** 9 | * This class is only for the test purpose. 10 | */ 11 | public class UserSystemTest { 12 | private final String EXPECT_PORT = "1234"; 13 | private final String SERVER_PORT = System.getProperty("SERVER_PORT", EXPECT_PORT); 14 | 15 | <#list 1..62 as i> 16 | @Test 17 | public void name_${i}() { 18 | assertEquals(EXPECT_PORT, SERVER_PORT); 19 | } 20 | 21 | 22 | <#list 1..62 as i> 23 | @Test 24 | @Ignore 25 | public void skip_${i}() {} 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/resources/WithExceptionTest.java: -------------------------------------------------------------------------------- 1 | package test; 2 | 3 | import org.junit.Test; 4 | 5 | /** 6 | * This class is only for the test purpose. 7 | */ 8 | public class WithExceptionTest { 9 | private final String EXPECT_EXCEPTION = "false"; 10 | private final String TEST_EXCEPTION = System.getProperty("TEST_EXCEPTION", EXPECT_EXCEPTION); 11 | 12 | <#list 1..62 as i> 13 | @Test 14 | public void name_${i}() throws Exception { 15 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 16 | throw new Exception(); 17 | } 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | sonoojaiswal 5 | hello.Web 6 | 7 | 8 | 9 | sonoojaiswal 10 | /welcome 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | hello learn-pipeline-java 2 | -------------------------------------------------------------------------------- /src/test/java/test/AccountSystemTest.java: -------------------------------------------------------------------------------- 1 | package test; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.assertEquals; 6 | 7 | /** 8 | * This class is only for the test purpose. 9 | */ 10 | public class AccountSystemTest { 11 | @Test 12 | public void name_1() { 13 | assertEquals(1, 1); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/test/java/test/UserSystemTest.java: -------------------------------------------------------------------------------- 1 | package test; 2 | 3 | import org.junit.Ignore; 4 | import org.junit.Test; 5 | 6 | import static org.junit.Assert.assertEquals; 7 | 8 | /** 9 | * This class is only for the test purpose. 10 | */ 11 | public class UserSystemTest { 12 | private final String EXPECT_PORT = "1234"; 13 | private final String SERVER_PORT = System.getProperty("SERVER_PORT", EXPECT_PORT); 14 | 15 | @Test 16 | public void name_1() { 17 | assertEquals(EXPECT_PORT, SERVER_PORT); 18 | } 19 | @Test 20 | public void name_2() { 21 | assertEquals(EXPECT_PORT, SERVER_PORT); 22 | } 23 | @Test 24 | public void name_3() { 25 | assertEquals(EXPECT_PORT, SERVER_PORT); 26 | } 27 | @Test 28 | public void name_4() { 29 | assertEquals(EXPECT_PORT, SERVER_PORT); 30 | } 31 | @Test 32 | public void name_5() { 33 | assertEquals(EXPECT_PORT, SERVER_PORT); 34 | } 35 | @Test 36 | public void name_6() { 37 | assertEquals(EXPECT_PORT, SERVER_PORT); 38 | } 39 | @Test 40 | public void name_7() { 41 | assertEquals(EXPECT_PORT, SERVER_PORT); 42 | } 43 | @Test 44 | public void name_8() { 45 | assertEquals(EXPECT_PORT, SERVER_PORT); 46 | } 47 | @Test 48 | public void name_9() { 49 | assertEquals(EXPECT_PORT, SERVER_PORT); 50 | } 51 | @Test 52 | public void name_10() { 53 | assertEquals(EXPECT_PORT, SERVER_PORT); 54 | } 55 | @Test 56 | public void name_11() { 57 | assertEquals(EXPECT_PORT, SERVER_PORT); 58 | } 59 | @Test 60 | public void name_12() { 61 | assertEquals(EXPECT_PORT, SERVER_PORT); 62 | } 63 | @Test 64 | public void name_13() { 65 | assertEquals(EXPECT_PORT, SERVER_PORT); 66 | } 67 | @Test 68 | public void name_14() { 69 | assertEquals(EXPECT_PORT, SERVER_PORT); 70 | } 71 | @Test 72 | public void name_15() { 73 | assertEquals(EXPECT_PORT, SERVER_PORT); 74 | } 75 | @Test 76 | public void name_16() { 77 | assertEquals(EXPECT_PORT, SERVER_PORT); 78 | } 79 | @Test 80 | public void name_17() { 81 | assertEquals(EXPECT_PORT, SERVER_PORT); 82 | } 83 | @Test 84 | public void name_18() { 85 | assertEquals(EXPECT_PORT, SERVER_PORT); 86 | } 87 | @Test 88 | public void name_19() { 89 | assertEquals(EXPECT_PORT, SERVER_PORT); 90 | } 91 | @Test 92 | public void name_20() { 93 | assertEquals(EXPECT_PORT, SERVER_PORT); 94 | } 95 | @Test 96 | public void name_21() { 97 | assertEquals(EXPECT_PORT, SERVER_PORT); 98 | } 99 | @Test 100 | public void name_22() { 101 | assertEquals(EXPECT_PORT, SERVER_PORT); 102 | } 103 | @Test 104 | public void name_23() { 105 | assertEquals(EXPECT_PORT, SERVER_PORT); 106 | } 107 | @Test 108 | public void name_24() { 109 | assertEquals(EXPECT_PORT, SERVER_PORT); 110 | } 111 | @Test 112 | public void name_25() { 113 | assertEquals(EXPECT_PORT, SERVER_PORT); 114 | } 115 | @Test 116 | public void name_26() { 117 | assertEquals(EXPECT_PORT, SERVER_PORT); 118 | } 119 | @Test 120 | public void name_27() { 121 | assertEquals(EXPECT_PORT, SERVER_PORT); 122 | } 123 | @Test 124 | public void name_28() { 125 | assertEquals(EXPECT_PORT, SERVER_PORT); 126 | } 127 | @Test 128 | public void name_29() { 129 | assertEquals(EXPECT_PORT, SERVER_PORT); 130 | } 131 | @Test 132 | public void name_30() { 133 | assertEquals(EXPECT_PORT, SERVER_PORT); 134 | } 135 | @Test 136 | public void name_31() { 137 | assertEquals(EXPECT_PORT, SERVER_PORT); 138 | } 139 | @Test 140 | public void name_32() { 141 | assertEquals(EXPECT_PORT, SERVER_PORT); 142 | } 143 | @Test 144 | public void name_33() { 145 | assertEquals(EXPECT_PORT, SERVER_PORT); 146 | } 147 | @Test 148 | public void name_34() { 149 | assertEquals(EXPECT_PORT, SERVER_PORT); 150 | } 151 | @Test 152 | public void name_35() { 153 | assertEquals(EXPECT_PORT, SERVER_PORT); 154 | } 155 | @Test 156 | public void name_36() { 157 | assertEquals(EXPECT_PORT, SERVER_PORT); 158 | } 159 | @Test 160 | public void name_37() { 161 | assertEquals(EXPECT_PORT, SERVER_PORT); 162 | } 163 | @Test 164 | public void name_38() { 165 | assertEquals(EXPECT_PORT, SERVER_PORT); 166 | } 167 | @Test 168 | public void name_39() { 169 | assertEquals(EXPECT_PORT, SERVER_PORT); 170 | } 171 | @Test 172 | public void name_40() { 173 | assertEquals(EXPECT_PORT, SERVER_PORT); 174 | } 175 | @Test 176 | public void name_41() { 177 | assertEquals(EXPECT_PORT, SERVER_PORT); 178 | } 179 | @Test 180 | public void name_42() { 181 | assertEquals(EXPECT_PORT, SERVER_PORT); 182 | } 183 | @Test 184 | public void name_43() { 185 | assertEquals(EXPECT_PORT, SERVER_PORT); 186 | } 187 | @Test 188 | public void name_44() { 189 | assertEquals(EXPECT_PORT, SERVER_PORT); 190 | } 191 | @Test 192 | public void name_45() { 193 | assertEquals(EXPECT_PORT, SERVER_PORT); 194 | } 195 | @Test 196 | public void name_46() { 197 | assertEquals(EXPECT_PORT, SERVER_PORT); 198 | } 199 | @Test 200 | public void name_47() { 201 | assertEquals(EXPECT_PORT, SERVER_PORT); 202 | } 203 | @Test 204 | public void name_48() { 205 | assertEquals(EXPECT_PORT, SERVER_PORT); 206 | } 207 | @Test 208 | public void name_49() { 209 | assertEquals(EXPECT_PORT, SERVER_PORT); 210 | } 211 | @Test 212 | public void name_50() { 213 | assertEquals(EXPECT_PORT, SERVER_PORT); 214 | } 215 | @Test 216 | public void name_51() { 217 | assertEquals(EXPECT_PORT, SERVER_PORT); 218 | } 219 | @Test 220 | public void name_52() { 221 | assertEquals(EXPECT_PORT, SERVER_PORT); 222 | } 223 | @Test 224 | public void name_53() { 225 | assertEquals(EXPECT_PORT, SERVER_PORT); 226 | } 227 | @Test 228 | public void name_54() { 229 | assertEquals(EXPECT_PORT, SERVER_PORT); 230 | } 231 | @Test 232 | public void name_55() { 233 | assertEquals(EXPECT_PORT, SERVER_PORT); 234 | } 235 | @Test 236 | public void name_56() { 237 | assertEquals(EXPECT_PORT, SERVER_PORT); 238 | } 239 | @Test 240 | public void name_57() { 241 | assertEquals(EXPECT_PORT, SERVER_PORT); 242 | } 243 | @Test 244 | public void name_58() { 245 | assertEquals(EXPECT_PORT, SERVER_PORT); 246 | } 247 | @Test 248 | public void name_59() { 249 | assertEquals(EXPECT_PORT, SERVER_PORT); 250 | } 251 | @Test 252 | public void name_60() { 253 | assertEquals(EXPECT_PORT, SERVER_PORT); 254 | } 255 | @Test 256 | public void name_61() { 257 | assertEquals(EXPECT_PORT, SERVER_PORT); 258 | } 259 | @Test 260 | public void name_62() { 261 | assertEquals(EXPECT_PORT, SERVER_PORT); 262 | } 263 | 264 | @Test 265 | @Ignore 266 | public void skip_1() {} 267 | @Test 268 | @Ignore 269 | public void skip_2() {} 270 | @Test 271 | @Ignore 272 | public void skip_3() {} 273 | @Test 274 | @Ignore 275 | public void skip_4() {} 276 | @Test 277 | @Ignore 278 | public void skip_5() {} 279 | @Test 280 | @Ignore 281 | public void skip_6() {} 282 | @Test 283 | @Ignore 284 | public void skip_7() {} 285 | @Test 286 | @Ignore 287 | public void skip_8() {} 288 | @Test 289 | @Ignore 290 | public void skip_9() {} 291 | @Test 292 | @Ignore 293 | public void skip_10() {} 294 | @Test 295 | @Ignore 296 | public void skip_11() {} 297 | @Test 298 | @Ignore 299 | public void skip_12() {} 300 | @Test 301 | @Ignore 302 | public void skip_13() {} 303 | @Test 304 | @Ignore 305 | public void skip_14() {} 306 | @Test 307 | @Ignore 308 | public void skip_15() {} 309 | @Test 310 | @Ignore 311 | public void skip_16() {} 312 | @Test 313 | @Ignore 314 | public void skip_17() {} 315 | @Test 316 | @Ignore 317 | public void skip_18() {} 318 | @Test 319 | @Ignore 320 | public void skip_19() {} 321 | @Test 322 | @Ignore 323 | public void skip_20() {} 324 | @Test 325 | @Ignore 326 | public void skip_21() {} 327 | @Test 328 | @Ignore 329 | public void skip_22() {} 330 | @Test 331 | @Ignore 332 | public void skip_23() {} 333 | @Test 334 | @Ignore 335 | public void skip_24() {} 336 | @Test 337 | @Ignore 338 | public void skip_25() {} 339 | @Test 340 | @Ignore 341 | public void skip_26() {} 342 | @Test 343 | @Ignore 344 | public void skip_27() {} 345 | @Test 346 | @Ignore 347 | public void skip_28() {} 348 | @Test 349 | @Ignore 350 | public void skip_29() {} 351 | @Test 352 | @Ignore 353 | public void skip_30() {} 354 | @Test 355 | @Ignore 356 | public void skip_31() {} 357 | @Test 358 | @Ignore 359 | public void skip_32() {} 360 | @Test 361 | @Ignore 362 | public void skip_33() {} 363 | @Test 364 | @Ignore 365 | public void skip_34() {} 366 | @Test 367 | @Ignore 368 | public void skip_35() {} 369 | @Test 370 | @Ignore 371 | public void skip_36() {} 372 | @Test 373 | @Ignore 374 | public void skip_37() {} 375 | @Test 376 | @Ignore 377 | public void skip_38() {} 378 | @Test 379 | @Ignore 380 | public void skip_39() {} 381 | @Test 382 | @Ignore 383 | public void skip_40() {} 384 | @Test 385 | @Ignore 386 | public void skip_41() {} 387 | @Test 388 | @Ignore 389 | public void skip_42() {} 390 | @Test 391 | @Ignore 392 | public void skip_43() {} 393 | @Test 394 | @Ignore 395 | public void skip_44() {} 396 | @Test 397 | @Ignore 398 | public void skip_45() {} 399 | @Test 400 | @Ignore 401 | public void skip_46() {} 402 | @Test 403 | @Ignore 404 | public void skip_47() {} 405 | @Test 406 | @Ignore 407 | public void skip_48() {} 408 | @Test 409 | @Ignore 410 | public void skip_49() {} 411 | @Test 412 | @Ignore 413 | public void skip_50() {} 414 | @Test 415 | @Ignore 416 | public void skip_51() {} 417 | @Test 418 | @Ignore 419 | public void skip_52() {} 420 | @Test 421 | @Ignore 422 | public void skip_53() {} 423 | @Test 424 | @Ignore 425 | public void skip_54() {} 426 | @Test 427 | @Ignore 428 | public void skip_55() {} 429 | @Test 430 | @Ignore 431 | public void skip_56() {} 432 | @Test 433 | @Ignore 434 | public void skip_57() {} 435 | @Test 436 | @Ignore 437 | public void skip_58() {} 438 | @Test 439 | @Ignore 440 | public void skip_59() {} 441 | @Test 442 | @Ignore 443 | public void skip_60() {} 444 | @Test 445 | @Ignore 446 | public void skip_61() {} 447 | @Test 448 | @Ignore 449 | public void skip_62() {} 450 | } 451 | -------------------------------------------------------------------------------- /src/test/java/test/WithExceptionTest.java: -------------------------------------------------------------------------------- 1 | package test; 2 | 3 | import org.junit.Test; 4 | 5 | /** 6 | * This class is only for the test purpose. 7 | */ 8 | public class WithExceptionTest { 9 | private final String EXPECT_EXCEPTION = "false"; 10 | private final String TEST_EXCEPTION = System.getProperty("TEST_EXCEPTION", EXPECT_EXCEPTION); 11 | 12 | @Test 13 | public void name_1() throws Exception { 14 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 15 | throw new Exception(); 16 | } 17 | } 18 | @Test 19 | public void name_2() throws Exception { 20 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 21 | throw new Exception(); 22 | } 23 | } 24 | @Test 25 | public void name_3() throws Exception { 26 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 27 | throw new Exception(); 28 | } 29 | } 30 | @Test 31 | public void name_4() throws Exception { 32 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 33 | throw new Exception(); 34 | } 35 | } 36 | @Test 37 | public void name_5() throws Exception { 38 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 39 | throw new Exception(); 40 | } 41 | } 42 | @Test 43 | public void name_6() throws Exception { 44 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 45 | throw new Exception(); 46 | } 47 | } 48 | @Test 49 | public void name_7() throws Exception { 50 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 51 | throw new Exception(); 52 | } 53 | } 54 | @Test 55 | public void name_8() throws Exception { 56 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 57 | throw new Exception(); 58 | } 59 | } 60 | @Test 61 | public void name_9() throws Exception { 62 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 63 | throw new Exception(); 64 | } 65 | } 66 | @Test 67 | public void name_10() throws Exception { 68 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 69 | throw new Exception(); 70 | } 71 | } 72 | @Test 73 | public void name_11() throws Exception { 74 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 75 | throw new Exception(); 76 | } 77 | } 78 | @Test 79 | public void name_12() throws Exception { 80 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 81 | throw new Exception(); 82 | } 83 | } 84 | @Test 85 | public void name_13() throws Exception { 86 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 87 | throw new Exception(); 88 | } 89 | } 90 | @Test 91 | public void name_14() throws Exception { 92 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 93 | throw new Exception(); 94 | } 95 | } 96 | @Test 97 | public void name_15() throws Exception { 98 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 99 | throw new Exception(); 100 | } 101 | } 102 | @Test 103 | public void name_16() throws Exception { 104 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 105 | throw new Exception(); 106 | } 107 | } 108 | @Test 109 | public void name_17() throws Exception { 110 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 111 | throw new Exception(); 112 | } 113 | } 114 | @Test 115 | public void name_18() throws Exception { 116 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 117 | throw new Exception(); 118 | } 119 | } 120 | @Test 121 | public void name_19() throws Exception { 122 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 123 | throw new Exception(); 124 | } 125 | } 126 | @Test 127 | public void name_20() throws Exception { 128 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 129 | throw new Exception(); 130 | } 131 | } 132 | @Test 133 | public void name_21() throws Exception { 134 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 135 | throw new Exception(); 136 | } 137 | } 138 | @Test 139 | public void name_22() throws Exception { 140 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 141 | throw new Exception(); 142 | } 143 | } 144 | @Test 145 | public void name_23() throws Exception { 146 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 147 | throw new Exception(); 148 | } 149 | } 150 | @Test 151 | public void name_24() throws Exception { 152 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 153 | throw new Exception(); 154 | } 155 | } 156 | @Test 157 | public void name_25() throws Exception { 158 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 159 | throw new Exception(); 160 | } 161 | } 162 | @Test 163 | public void name_26() throws Exception { 164 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 165 | throw new Exception(); 166 | } 167 | } 168 | @Test 169 | public void name_27() throws Exception { 170 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 171 | throw new Exception(); 172 | } 173 | } 174 | @Test 175 | public void name_28() throws Exception { 176 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 177 | throw new Exception(); 178 | } 179 | } 180 | @Test 181 | public void name_29() throws Exception { 182 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 183 | throw new Exception(); 184 | } 185 | } 186 | @Test 187 | public void name_30() throws Exception { 188 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 189 | throw new Exception(); 190 | } 191 | } 192 | @Test 193 | public void name_31() throws Exception { 194 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 195 | throw new Exception(); 196 | } 197 | } 198 | @Test 199 | public void name_32() throws Exception { 200 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 201 | throw new Exception(); 202 | } 203 | } 204 | @Test 205 | public void name_33() throws Exception { 206 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 207 | throw new Exception(); 208 | } 209 | } 210 | @Test 211 | public void name_34() throws Exception { 212 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 213 | throw new Exception(); 214 | } 215 | } 216 | @Test 217 | public void name_35() throws Exception { 218 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 219 | throw new Exception(); 220 | } 221 | } 222 | @Test 223 | public void name_36() throws Exception { 224 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 225 | throw new Exception(); 226 | } 227 | } 228 | @Test 229 | public void name_37() throws Exception { 230 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 231 | throw new Exception(); 232 | } 233 | } 234 | @Test 235 | public void name_38() throws Exception { 236 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 237 | throw new Exception(); 238 | } 239 | } 240 | @Test 241 | public void name_39() throws Exception { 242 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 243 | throw new Exception(); 244 | } 245 | } 246 | @Test 247 | public void name_40() throws Exception { 248 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 249 | throw new Exception(); 250 | } 251 | } 252 | @Test 253 | public void name_41() throws Exception { 254 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 255 | throw new Exception(); 256 | } 257 | } 258 | @Test 259 | public void name_42() throws Exception { 260 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 261 | throw new Exception(); 262 | } 263 | } 264 | @Test 265 | public void name_43() throws Exception { 266 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 267 | throw new Exception(); 268 | } 269 | } 270 | @Test 271 | public void name_44() throws Exception { 272 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 273 | throw new Exception(); 274 | } 275 | } 276 | @Test 277 | public void name_45() throws Exception { 278 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 279 | throw new Exception(); 280 | } 281 | } 282 | @Test 283 | public void name_46() throws Exception { 284 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 285 | throw new Exception(); 286 | } 287 | } 288 | @Test 289 | public void name_47() throws Exception { 290 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 291 | throw new Exception(); 292 | } 293 | } 294 | @Test 295 | public void name_48() throws Exception { 296 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 297 | throw new Exception(); 298 | } 299 | } 300 | @Test 301 | public void name_49() throws Exception { 302 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 303 | throw new Exception(); 304 | } 305 | } 306 | @Test 307 | public void name_50() throws Exception { 308 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 309 | throw new Exception(); 310 | } 311 | } 312 | @Test 313 | public void name_51() throws Exception { 314 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 315 | throw new Exception(); 316 | } 317 | } 318 | @Test 319 | public void name_52() throws Exception { 320 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 321 | throw new Exception(); 322 | } 323 | } 324 | @Test 325 | public void name_53() throws Exception { 326 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 327 | throw new Exception(); 328 | } 329 | } 330 | @Test 331 | public void name_54() throws Exception { 332 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 333 | throw new Exception(); 334 | } 335 | } 336 | @Test 337 | public void name_55() throws Exception { 338 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 339 | throw new Exception(); 340 | } 341 | } 342 | @Test 343 | public void name_56() throws Exception { 344 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 345 | throw new Exception(); 346 | } 347 | } 348 | @Test 349 | public void name_57() throws Exception { 350 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 351 | throw new Exception(); 352 | } 353 | } 354 | @Test 355 | public void name_58() throws Exception { 356 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 357 | throw new Exception(); 358 | } 359 | } 360 | @Test 361 | public void name_59() throws Exception { 362 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 363 | throw new Exception(); 364 | } 365 | } 366 | @Test 367 | public void name_60() throws Exception { 368 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 369 | throw new Exception(); 370 | } 371 | } 372 | @Test 373 | public void name_61() throws Exception { 374 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 375 | throw new Exception(); 376 | } 377 | } 378 | @Test 379 | public void name_62() throws Exception { 380 | if (!TEST_EXCEPTION.equals(EXPECT_EXCEPTION)) { 381 | throw new Exception(); 382 | } 383 | } 384 | } 385 | -------------------------------------------------------------------------------- /src/test/resources/baidu-jmeter.jmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | false 7 | true 8 | false 9 | 10 | 11 | 12 | param 13 | value 14 | = 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | false 23 | 24 | saveConfig 25 | 26 | 27 | true 28 | true 29 | true 30 | 31 | true 32 | true 33 | true 34 | true 35 | false 36 | true 37 | true 38 | false 39 | false 40 | false 41 | true 42 | false 43 | false 44 | false 45 | true 46 | 0 47 | true 48 | true 49 | true 50 | true 51 | true 52 | true 53 | 54 | 55 | 56 | 57 | 58 | 59 | false 60 | 61 | saveConfig 62 | 63 | 64 | true 65 | true 66 | true 67 | 68 | true 69 | true 70 | true 71 | true 72 | false 73 | true 74 | true 75 | false 76 | false 77 | false 78 | true 79 | false 80 | false 81 | false 82 | true 83 | 0 84 | true 85 | true 86 | true 87 | true 88 | true 89 | true 90 | 91 | 92 | 93 | 94 | 95 | 96 | continue 97 | 98 | false 99 | 1 100 | 101 | 1 102 | 1 103 | false 104 | 105 | 106 | 107 | 108 | 109 | true 110 | 10 111 | 112 | 113 | 114 | 115 | 116 | 117 | baidu.com 118 | 119 | 120 | 121 | 122 | GET 123 | true 124 | false 125 | true 126 | false 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | --------------------------------------------------------------------------------