├── .cirrus.yml
├── .github
└── workflows
│ └── release.yml
├── .gitignore
├── LICENSE.txt
├── NOTICE.txt
├── README.md
├── its
├── pom.xml
├── scm-repo
│ ├── 1.6
│ │ ├── repo-svn-with-merge.zip
│ │ └── repo-svn.zip
│ └── 1.8
│ │ ├── repo-svn-with-merge.zip
│ │ └── repo-svn.zip
└── src
│ └── test
│ └── java
│ └── com
│ └── sonarsource
│ └── it
│ └── scm
│ └── SvnTest.java
├── pom.xml
├── sonar-scm-svn-plugin
├── pom.xml
├── src
│ ├── main
│ │ └── java
│ │ │ └── org
│ │ │ └── sonar
│ │ │ └── plugins
│ │ │ └── scm
│ │ │ └── svn
│ │ │ ├── AnnotationHandler.java
│ │ │ ├── ChangedLinesComputer.java
│ │ │ ├── FindFork.java
│ │ │ ├── ForkPoint.java
│ │ │ ├── SvnBlameCommand.java
│ │ │ ├── SvnConfiguration.java
│ │ │ ├── SvnPlugin.java
│ │ │ ├── SvnScmProvider.java
│ │ │ └── package-info.java
│ └── test
│ │ ├── java
│ │ └── org
│ │ │ └── sonar
│ │ │ └── plugins
│ │ │ └── scm
│ │ │ └── svn
│ │ │ ├── ChangedLinesComputerTest.java
│ │ │ ├── FindForkTest.java
│ │ │ ├── SvnBlameCommandTest.java
│ │ │ ├── SvnConfigurationTest.java
│ │ │ ├── SvnPluginTest.java
│ │ │ ├── SvnScmProviderTest.java
│ │ │ ├── SvnTester.java
│ │ │ └── SvnTesterTest.java
│ │ └── resources
│ │ ├── blame-with-anonymous-commit.xml
│ │ ├── blame-with-merge-history.xml
│ │ ├── blame-with-uncomitted-changes.xml
│ │ └── blame.xml
└── test-repos
│ ├── 1.6
│ ├── repo-svn-with-merge.zip
│ └── repo-svn.zip
│ ├── 1.7
│ ├── repo-svn-with-merge.zip
│ └── repo-svn.zip
│ ├── 1.8
│ ├── repo-svn-with-merge.zip
│ └── repo-svn.zip
│ └── 1.9
│ ├── repo-svn-with-merge.zip
│ └── repo-svn.zip
└── third-party-licenses.sh
/.cirrus.yml:
--------------------------------------------------------------------------------
1 | # content of service-account-credentials.json, used to access to Google Cloud Platform
2 | gcp_credentials: ENCRYPTED[!e5f7207bd8d02d383733bef47e18296ac32e3b7d22eb480354e8dd8fdc0004be45a8a4e72c797bd66ee94eb3340fa363!]
3 |
4 | #
5 | # ENV VARIABLES
6 | #
7 | env:
8 | ### Shared variables
9 | ARTIFACTORY_URL: ENCRYPTED[!2f8fa307d3289faa0aa6791f18b961627ae44f1ef46b136e1a1e63b0b4c86454dbb25520d49b339e2d50a1e1e5f95c88!]
10 | ARTIFACTORY_PRIVATE_USERNAME: repox-private-reader
11 | ARTIFACTORY_PRIVATE_PASSWORD: ENCRYPTED[!35ca4446564213d4fd2d1a96e42a871d5de6e6aac4e1dd3e89342892a60a2badf74a966bcc8e885e9c9d09a775ffe4c0!]
12 | ARTIFACTORY_API_KEY: ENCRYPTED[!35ca4446564213d4fd2d1a96e42a871d5de6e6aac4e1dd3e89342892a60a2badf74a966bcc8e885e9c9d09a775ffe4c0!]
13 | ARTIFACTORY_DEPLOY_USERNAME: repox-qa-deployer
14 | ARTIFACTORY_DEPLOY_PASSWORD: ENCRYPTED[!d484e19f33c9ce63b165f70e414a33b1ac6c215a126791aacbf8059626caf0fd8a78e999a20af5c1a4ba01c0b0247921!]
15 | ARTIFACTORY_DEPLOY_REPO: sonarsource-public-qa
16 |
17 | GCF_ACCESS_TOKEN: ENCRYPTED[!1fb91961a5c01e06e38834e55755231d649dc62eca354593105af9f9d643d701ae4539ab6a8021278b8d9348ae2ce8be!]
18 | PROMOTE_URL: ENCRYPTED[!e22ed2e34a8f7a1aea5cff653585429bbd3d5151e7201022140218f9c5d620069ec2388f14f83971e3fd726215bc0f5e!]
19 |
20 | GITHUB_TOKEN: ENCRYPTED[!f272985ea5b49b3cf9c414b98de6a8e9096be47bfcee52f33311ba3131a2af637c1b956f49585b7757dd84b7c030233a!]
21 |
22 | BURGR_URL: ENCRYPTED[!c7e294da94762d7bac144abef6310c5db300c95979daed4454ca977776bfd5edeb557e1237e3aa8ed722336243af2d78!]
23 | BURGR_USERNAME: ENCRYPTED[!b29ddc7610116de511e74bec9a93ad9b8a20ac217a0852e94a96d0066e6e822b95e7bc1fe152afb707f16b70605fddd3!]
24 | BURGR_PASSWORD: ENCRYPTED[!83e130718e92b8c9de7c5226355f730e55fb46e45869149a9223e724bb99656878ef9684c5f8cfef434aa716e87f4cf2!]
25 |
26 | ### Project variables
27 | DEPLOY_PULL_REQUEST: true
28 | ARTIFACTS: org.sonarsource.scm.svn:sonar-scm-svn:jar
29 |
30 | #
31 | # RE-USABLE CONFIGS
32 | #
33 | container_definition: &CONTAINER_DEFINITION
34 | image: us.gcr.io/sonarqube-team/base:j11-m3-latest
35 | cluster_name: cirrus-ci-cluster
36 | zone: us-central1-a
37 | namespace: default
38 |
39 | only_sonarsource_qa: &ONLY_SONARSOURCE_QA
40 | only_if: $CIRRUS_USER_COLLABORATOR == 'true' && ($CIRRUS_PR != "" || $CIRRUS_BRANCH == "master" || $CIRRUS_BRANCH =~ "branch-.*" || $CIRRUS_BRANCH =~ "dogfood-on-.*")
41 |
42 | #
43 | # TASKS
44 | #
45 | build_task:
46 | gke_container:
47 | <<: *CONTAINER_DEFINITION
48 | cpu: 2
49 | memory: 2G
50 | env:
51 | SONAR_TOKEN: ENCRYPTED[!b6fd814826c51e64ee61b0b6f3ae621551f6413383f7170f73580e2e141ac78c4b134b506f6288c74faa0dd564c05a29!]
52 | SONAR_HOST_URL: https://next.sonarqube.com/sonarqube
53 | maven_cache:
54 | folder: ${CIRRUS_WORKING_DIR}/.m2/repository
55 | script:
56 | - source cirrus-env BUILD
57 | - regular_mvn_build_deploy_analyze
58 | cleanup_before_cache_script:
59 | - cleanup_maven_repository
60 |
61 | qa_task:
62 | depends_on:
63 | - build
64 | <<: *ONLY_SONARSOURCE_QA
65 | gke_container:
66 | <<: *CONTAINER_DEFINITION
67 | cpu: 1.7
68 | memory: 5Gb
69 | env:
70 | matrix:
71 | - SQ_VERSION: LATEST_RELEASE[7.9]
72 | maven_cache:
73 | folder: ${CIRRUS_WORKING_DIR}/.m2/repository
74 | qa_script:
75 | - source cirrus-env QA
76 | - source set_maven_build_version $BUILD_NUMBER
77 | - cd its
78 | - mvn -Dsonar.runtimeVersion="$SQ_VERSION" -Dmaven.test.redirectTestOutputToFile=false verify -B -e -V
79 | cleanup_before_cache_script:
80 | - cleanup_maven_repository
81 |
82 | promote_task:
83 | depends_on:
84 | - qa
85 | <<: *ONLY_SONARSOURCE_QA
86 | gke_container:
87 | <<: *CONTAINER_DEFINITION
88 | cpu: 0.5
89 | memory: 500M
90 | maven_cache:
91 | folder: $CIRRUS_WORKING_DIR/.m2/repository
92 | script:
93 | - cirrus_promote_maven
94 | cleanup_before_cache_script:
95 | - cleanup_maven_repository
96 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Release
2 | # This workflow is triggered when publishing a GitHub release
3 | on:
4 | release:
5 | types:
6 | - published
7 |
8 | jobs:
9 | release:
10 | runs-on: ubuntu-latest
11 | name: Start release process
12 | steps:
13 | # Not sure why this is needed... Fixes issue with running the action.
14 | - name: Checkout release action
15 | uses: actions/checkout@v2
16 | with:
17 | repository: SonarSource/gh-action_LT_release
18 | - name: Run release action
19 | id: run_release
20 | with:
21 | distribute: true
22 | uses: SonarSource/gh-action_LT_release@master
23 | env:
24 | GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
25 | - name: Log outputs
26 | if: always()
27 | run: |
28 | echo "${{ steps.run_release.outputs.releasability }}"
29 | echo "${{ steps.run_release.outputs.release }}"
30 | - name: Notify success on Slack
31 | uses: Ilshidur/action-slack@2.0.0
32 | env:
33 | SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
34 | with:
35 | args: "Release successful for {{ GITHUB_REPOSITORY }} by {{ GITHUB_ACTOR }}"
36 | - name: Notify failures on Slack
37 | uses: Ilshidur/action-slack@2.0.0
38 | if: failure()
39 | env:
40 | SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
41 | with:
42 | args: "Release failed, see the logs at https://github.com/{{ GITHUB_REPOSITORY }}/actions by {{ GITHUB_ACTOR }}"
43 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # The following should be moved in related sub-directories
2 | server/sonar-web/src/main/webapp/stylesheets/sonar-colorizer.css
3 | server/sonar-web/src/main/webapp/deploy/plugins
4 | server/sonar-web/src/main/webapp/deploy/bootstrap
5 | server/sonar-web/src/main/webapp/deploy/maven/org
6 | server/sonar-web/src/main/webapp/WEB-INF/log/
7 | server/sonar-web/src/main/webapp/deploy/*.jar
8 | server/sonar-web/src/main/webapp/deploy/jdbc-driver.txt
9 |
10 |
11 | # ---- Javadoc
12 | docs.tar
13 |
14 | # ---- Maven
15 | target/
16 | dependency-reduced-pom.xml
17 |
18 | # ---- IntelliJ IDEA
19 | *.iws
20 | *.iml
21 | *.ipr
22 | .idea/
23 |
24 | # ---- Eclipse
25 | .classpath
26 | .project
27 | .settings
28 | .externalToolBuilders
29 |
30 | # ---- Mac OS X
31 | .DS_Store
32 | Icon?
33 | # Thumbnails
34 | ._*
35 | # Files that might appear on external disk
36 | .Spotlight-V100
37 | .Trashes
38 |
39 | # ---- Windows
40 | # Windows image file caches
41 | Thumbs.db
42 | # Folder config file
43 | Desktop.ini
44 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | GNU LESSER GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 |
9 | This version of the GNU Lesser General Public License incorporates
10 | the terms and conditions of version 3 of the GNU General Public
11 | License, supplemented by the additional permissions listed below.
12 |
13 | 0. Additional Definitions.
14 |
15 | As used herein, "this License" refers to version 3 of the GNU Lesser
16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU
17 | General Public License.
18 |
19 | "The Library" refers to a covered work governed by this License,
20 | other than an Application or a Combined Work as defined below.
21 |
22 | An "Application" is any work that makes use of an interface provided
23 | by the Library, but which is not otherwise based on the Library.
24 | Defining a subclass of a class defined by the Library is deemed a mode
25 | of using an interface provided by the Library.
26 |
27 | A "Combined Work" is a work produced by combining or linking an
28 | Application with the Library. The particular version of the Library
29 | with which the Combined Work was made is also called the "Linked
30 | Version".
31 |
32 | The "Minimal Corresponding Source" for a Combined Work means the
33 | Corresponding Source for the Combined Work, excluding any source code
34 | for portions of the Combined Work that, considered in isolation, are
35 | based on the Application, and not on the Linked Version.
36 |
37 | The "Corresponding Application Code" for a Combined Work means the
38 | object code and/or source code for the Application, including any data
39 | and utility programs needed for reproducing the Combined Work from the
40 | Application, but excluding the System Libraries of the Combined Work.
41 |
42 | 1. Exception to Section 3 of the GNU GPL.
43 |
44 | You may convey a covered work under sections 3 and 4 of this License
45 | without being bound by section 3 of the GNU GPL.
46 |
47 | 2. Conveying Modified Versions.
48 |
49 | If you modify a copy of the Library, and, in your modifications, a
50 | facility refers to a function or data to be supplied by an Application
51 | that uses the facility (other than as an argument passed when the
52 | facility is invoked), then you may convey a copy of the modified
53 | version:
54 |
55 | a) under this License, provided that you make a good faith effort to
56 | ensure that, in the event an Application does not supply the
57 | function or data, the facility still operates, and performs
58 | whatever part of its purpose remains meaningful, or
59 |
60 | b) under the GNU GPL, with none of the additional permissions of
61 | this License applicable to that copy.
62 |
63 | 3. Object Code Incorporating Material from Library Header Files.
64 |
65 | The object code form of an Application may incorporate material from
66 | a header file that is part of the Library. You may convey such object
67 | code under terms of your choice, provided that, if the incorporated
68 | material is not limited to numerical parameters, data structure
69 | layouts and accessors, or small macros, inline functions and templates
70 | (ten or fewer lines in length), you do both of the following:
71 |
72 | a) Give prominent notice with each copy of the object code that the
73 | Library is used in it and that the Library and its use are
74 | covered by this License.
75 |
76 | b) Accompany the object code with a copy of the GNU GPL and this license
77 | document.
78 |
79 | 4. Combined Works.
80 |
81 | You may convey a Combined Work under terms of your choice that,
82 | taken together, effectively do not restrict modification of the
83 | portions of the Library contained in the Combined Work and reverse
84 | engineering for debugging such modifications, if you also do each of
85 | the following:
86 |
87 | a) Give prominent notice with each copy of the Combined Work that
88 | the Library is used in it and that the Library and its use are
89 | covered by this License.
90 |
91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license
92 | document.
93 |
94 | c) For a Combined Work that displays copyright notices during
95 | execution, include the copyright notice for the Library among
96 | these notices, as well as a reference directing the user to the
97 | copies of the GNU GPL and this license document.
98 |
99 | d) Do one of the following:
100 |
101 | 0) Convey the Minimal Corresponding Source under the terms of this
102 | License, and the Corresponding Application Code in a form
103 | suitable for, and under terms that permit, the user to
104 | recombine or relink the Application with a modified version of
105 | the Linked Version to produce a modified Combined Work, in the
106 | manner specified by section 6 of the GNU GPL for conveying
107 | Corresponding Source.
108 |
109 | 1) Use a suitable shared library mechanism for linking with the
110 | Library. A suitable mechanism is one that (a) uses at run time
111 | a copy of the Library already present on the user's computer
112 | system, and (b) will operate properly with a modified version
113 | of the Library that is interface-compatible with the Linked
114 | Version.
115 |
116 | e) Provide Installation Information, but only if you would otherwise
117 | be required to provide such information under section 6 of the
118 | GNU GPL, and only to the extent that such information is
119 | necessary to install and execute a modified version of the
120 | Combined Work produced by recombining or relinking the
121 | Application with a modified version of the Linked Version. (If
122 | you use option 4d0, the Installation Information must accompany
123 | the Minimal Corresponding Source and Corresponding Application
124 | Code. If you use option 4d1, you must provide the Installation
125 | Information in the manner specified by section 6 of the GNU GPL
126 | for conveying Corresponding Source.)
127 |
128 | 5. Combined Libraries.
129 |
130 | You may place library facilities that are a work based on the
131 | Library side by side in a single library together with other library
132 | facilities that are not Applications and are not covered by this
133 | License, and convey such a combined library under terms of your
134 | choice, if you do both of the following:
135 |
136 | a) Accompany the combined library with a copy of the same work based
137 | on the Library, uncombined with any other library facilities,
138 | conveyed under the terms of this License.
139 |
140 | b) Give prominent notice with the combined library that part of it
141 | is a work based on the Library, and explaining where to find the
142 | accompanying uncombined form of the same work.
143 |
144 | 6. Revised Versions of the GNU Lesser General Public License.
145 |
146 | The Free Software Foundation may publish revised and/or new versions
147 | of the GNU Lesser General Public License from time to time. Such new
148 | versions will be similar in spirit to the present version, but may
149 | differ in detail to address new problems or concerns.
150 |
151 | Each version is given a distinguishing version number. If the
152 | Library as you received it specifies that a certain numbered version
153 | of the GNU Lesser General Public License "or any later version"
154 | applies to it, you have the option of following the terms and
155 | conditions either of that published version or of any later version
156 | published by the Free Software Foundation. If the Library as you
157 | received it does not specify a version number of the GNU Lesser
158 | General Public License, you may choose any version of the GNU Lesser
159 | General Public License ever published by the Free Software Foundation.
160 |
161 | If the Library as you received it specifies that a proxy can decide
162 | whether future versions of the GNU Lesser General Public License shall
163 | apply, that proxy's public statement of acceptance of any version is
164 | permanent authorization for you to choose that version for the
165 | Library.
166 |
--------------------------------------------------------------------------------
/NOTICE.txt:
--------------------------------------------------------------------------------
1 | SonarQube :: Plugins :: SCM :: SVN
2 | Copyright (C) 2014-2017 SonarSource SA
3 | mailto:info AT sonarsource DOT com
4 |
5 | This product includes software developed at
6 | SonarSource (http://www.sonarsource.com/).
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # SonarQube SVN Plugin
2 |
3 | [](https://cirrus-ci.com/github/SonarSource/sonar-scm-svn)
4 |
5 | ### Enbedded since SonarQube 8.5
6 |
7 | This plugin is embedded in SonarQube starting 8.5, see [embedded sources](https://github.com/SonarSource/sonarqube/tree/master/sonar-scanner-engine/src/main/java/org/sonar/scm/svn).
8 |
9 | ### Have Question or Feedback?
10 |
11 | For support questions ("How do I?", "I got this error, why?", ...), please head to the [SonarSource forum](https://community.sonarsource.com/c/help). There are chances that a question similar to yours has already been answered.
12 |
13 | Be aware that this forum is a community, so the standard pleasantries ("Hi", "Thanks", ...) are expected. And if you don't get an answer to your thread, you should sit on your hands for at least three days before bumping it. Operators are not standing by. :-)
14 |
15 | ### Contributing
16 |
17 | If you would like to see a new feature, please create a new thread in the forum ["Suggest new features"](https://community.sonarsource.com/c/suggestions/features).
18 |
19 | Please be aware that we are not actively looking for feature contributions. The truth is that it's extremely difficult for someone outside SonarSource to comply with our roadmap and expectations. Therefore, we typically only accept minor cosmetic changes and typo fixes.
20 |
21 | With that in mind, if you would like to submit a code contribution, please create a pull request for this repository. Please explain your motives to contribute this change: what problem you are trying to fix, what improvement you are trying to make.
22 |
23 | Make sure that you follow our code style and all tests are passing (Travis build is executed for each pull request).
24 |
25 | ### License
26 |
27 | Copyright 2014-2017 SonarSource.
28 |
29 | Licensed under the [GNU Lesser General Public License, Version 3.0](http://www.gnu.org/licenses/lgpl.txt)
30 |
--------------------------------------------------------------------------------
/its/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 |
7 | org.sonarsource.scm.svn
8 | svn
9 | 1.10-SNAPSHOT
10 |
11 |
12 | org.sonarsource.scm.svn
13 | it-scmsvn
14 | SVN :: Integration Tests
15 |
16 | 2014
17 |
18 |
19 |
20 | org.sonarsource.orchestrator
21 | sonar-orchestrator
22 | 3.22.0.1791
23 | test
24 |
25 |
26 | junit
27 | junit
28 | 4.13.1
29 | test
30 |
31 |
32 | org.assertj
33 | assertj-core
34 | 3.11.1
35 | test
36 |
37 |
38 | org.tmatesoft.svnkit
39 | svnkit
40 | 1.9.3
41 | test
42 |
43 |
44 |
45 |
46 |
47 | qa
48 |
49 |
50 | env.SONARSOURCE_QA
51 | true
52 |
53 |
54 |
55 |
56 |
57 | org.apache.maven.plugins
58 | maven-dependency-plugin
59 | 2.10
60 |
61 |
62 | copy-plugin
63 | generate-test-resources
64 |
65 | copy
66 |
67 |
68 |
69 |
70 | ${project.groupId}
71 | sonar-scm-svn-plugin
72 | ${project.version}
73 | sonar-plugin
74 | true
75 |
76 |
77 | ../sonar-scm-svn-plugin/target
78 | true
79 | true
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
--------------------------------------------------------------------------------
/its/scm-repo/1.6/repo-svn-with-merge.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-scm-svn/0767c846b3d4bf306a8a8c3b194b465ebc549498/its/scm-repo/1.6/repo-svn-with-merge.zip
--------------------------------------------------------------------------------
/its/scm-repo/1.6/repo-svn.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-scm-svn/0767c846b3d4bf306a8a8c3b194b465ebc549498/its/scm-repo/1.6/repo-svn.zip
--------------------------------------------------------------------------------
/its/scm-repo/1.8/repo-svn-with-merge.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-scm-svn/0767c846b3d4bf306a8a8c3b194b465ebc549498/its/scm-repo/1.8/repo-svn-with-merge.zip
--------------------------------------------------------------------------------
/its/scm-repo/1.8/repo-svn.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SonarSource/sonar-scm-svn/0767c846b3d4bf306a8a8c3b194b465ebc549498/its/scm-repo/1.8/repo-svn.zip
--------------------------------------------------------------------------------
/its/src/test/java/com/sonarsource/it/scm/SvnTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SVN :: Integration Tests
3 | * Copyright (C) 2014-2021 SonarSource SA
4 | * mailto:info AT sonarsource DOT com
5 | *
6 | * This program is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 3 of the License, or (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public License
17 | * along with this program; if not, write to the Free Software Foundation,
18 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 | */
20 | package com.sonarsource.it.scm;
21 |
22 | import com.sonar.orchestrator.Orchestrator;
23 | import com.sonar.orchestrator.build.BuildResult;
24 | import com.sonar.orchestrator.build.MavenBuild;
25 | import com.sonar.orchestrator.locator.FileLocation;
26 | import com.sonar.orchestrator.locator.MavenLocation;
27 | import com.sonar.orchestrator.util.ZipUtils;
28 | import java.io.File;
29 | import java.io.IOException;
30 | import java.nio.charset.StandardCharsets;
31 | import java.nio.file.Files;
32 | import java.text.ParseException;
33 | import java.text.SimpleDateFormat;
34 | import java.util.Arrays;
35 | import java.util.Date;
36 | import java.util.HashMap;
37 | import java.util.Map;
38 | import org.apache.commons.io.FileUtils;
39 | import org.apache.commons.lang.StringUtils;
40 | import org.apache.commons.lang.builder.EqualsBuilder;
41 | import org.apache.commons.lang.builder.HashCodeBuilder;
42 | import org.apache.commons.lang.builder.ToStringBuilder;
43 | import org.apache.commons.lang.builder.ToStringStyle;
44 | import org.assertj.core.data.MapEntry;
45 | import org.junit.Before;
46 | import org.junit.ClassRule;
47 | import org.junit.Rule;
48 | import org.junit.Test;
49 | import org.junit.rules.ExpectedException;
50 | import org.junit.rules.TemporaryFolder;
51 | import org.junit.runner.RunWith;
52 | import org.junit.runners.Parameterized;
53 | import org.junit.runners.Parameterized.Parameters;
54 | import org.sonar.wsclient.jsonsimple.JSONArray;
55 | import org.sonar.wsclient.jsonsimple.JSONObject;
56 | import org.sonar.wsclient.jsonsimple.JSONValue;
57 | import org.tmatesoft.svn.core.SVNDepth;
58 | import org.tmatesoft.svn.core.SVNURL;
59 | import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager;
60 | import org.tmatesoft.svn.core.internal.wc2.compat.SvnCodec;
61 | import org.tmatesoft.svn.core.wc.ISVNOptions;
62 | import org.tmatesoft.svn.core.wc.SVNClientManager;
63 | import org.tmatesoft.svn.core.wc.SVNRevision;
64 | import org.tmatesoft.svn.core.wc.SVNUpdateClient;
65 | import org.tmatesoft.svn.core.wc.SVNWCUtil;
66 | import org.tmatesoft.svn.core.wc2.SvnCheckout;
67 | import org.tmatesoft.svn.core.wc2.SvnTarget;
68 |
69 | import static org.apache.commons.lang.StringUtils.substringAfter;
70 | import static org.assertj.core.api.Assertions.assertThat;
71 |
72 | @RunWith(Parameterized.class)
73 | public class SvnTest {
74 |
75 | @Rule
76 | public TemporaryFolder temp = new TemporaryFolder();
77 |
78 | public static final File REPO_DIR = new File("scm-repo");
79 |
80 | @ClassRule
81 | public static Orchestrator orchestrator = Orchestrator.builderEnv()
82 | .setSonarVersion(System.getProperty("sonar.runtimeVersion", "LATEST_RELEASE[7.9]"))
83 | .addPlugin(FileLocation.byWildcardMavenFilename(new File("../sonar-scm-svn-plugin/target"), "sonar-scm-svn-plugin-*.jar"))
84 | .addPlugin(MavenLocation.of("org.sonarsource.java", "sonar-java-plugin", "LATEST_RELEASE"))
85 | .build();
86 |
87 | @Rule
88 | public ExpectedException thrown = ExpectedException.none();
89 |
90 | private String serverVersion;
91 | private int wcVersion;
92 | private String wkSubPath;
93 | private String baseDirSubPath;
94 |
95 | @Parameters(name = "SVN server version {0}, WC version {1}, WC subPath \"{2}\", baseDir subPath \"{3}\"")
96 | public static Iterable