Przeglądaj źródła

SONAR-8637 IT to test functional version in a plugin

tags/6.3-RC1
Teryk Bellahsene 7 lat temu
rodzic
commit
017fde2c6e

+ 2
- 2
it/it-plugins/access-secured-props-plugin/pom.xml Wyświetl plik

<artifactId>access-secured-props-plugin</artifactId> <artifactId>access-secured-props-plugin</artifactId>
<packaging>sonar-plugin</packaging> <packaging>sonar-plugin</packaging>
<name>Plugins :: Access Secured Properties</name> <name>Plugins :: Access Secured Properties</name>
<version>1.0-SNAPSHOT</version>
<version>1.0.2.42</version>
<description>Access .secured properties</description> <description>Access .secured properties</description>


<dependencies> <dependencies>
<plugin> <plugin>
<groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId>
<artifactId>sonar-packaging-maven-plugin</artifactId> <artifactId>sonar-packaging-maven-plugin</artifactId>
<version>1.15</version>
<version>1.18.0.372</version>
<extensions>true</extensions> <extensions>true</extensions>
<configuration> <configuration>
<pluginClass>AccessSecuredPropsPlugin</pluginClass> <pluginClass>AccessSecuredPropsPlugin</pluginClass>

+ 2
- 0
it/it-tests/src/test/java/it/Category3Suite.java Wyświetl plik

import it.analysis.TempFolderTest; import it.analysis.TempFolderTest;
import it.measure.DecimalScaleMetricTest; import it.measure.DecimalScaleMetricTest;
import it.organization.OrganizationIt; import it.organization.OrganizationIt;
import it.plugins.VersionPluginTest;
import it.root.RootIt; import it.root.RootIt;
import it.webhook.WebhooksTest; import it.webhook.WebhooksTest;
import org.junit.ClassRule; import org.junit.ClassRule;
IssueJsonReportTest.class, IssueJsonReportTest.class,
ScannerTest.class, ScannerTest.class,
IssuesModeTest.class, IssuesModeTest.class,
VersionPluginTest.class,
SettingsEncryptionTest.class, SettingsEncryptionTest.class,
ReportDumpTest.class, ReportDumpTest.class,
SSLTest.class, SSLTest.class,

+ 57
- 0
it/it-tests/src/test/java/it/plugins/VersionPluginTest.java Wyświetl plik

/*
* SonarQube
* Copyright (C) 2009-2016 SonarSource SA
* mailto:contact AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

package it.plugins;

import com.sonar.orchestrator.Orchestrator;
import it.Category3Suite;
import java.io.IOException;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import org.sonarqube.ws.client.GetRequest;
import org.sonarqube.ws.client.WsClient;

import static org.assertj.core.api.Assertions.assertThat;
import static util.ItUtils.newAdminWsClient;

public class VersionPluginTest {

@ClassRule
public static Orchestrator orchestrator = Category3Suite.ORCHESTRATOR;
private static WsClient wsClient;

@BeforeClass
public static void init_ws_cient() {
wsClient = newAdminWsClient(orchestrator);
}

@Before
public void deleteData() throws IOException {
orchestrator.resetData();
}

@Test
public void check_functional_version() {
assertThat(wsClient.wsConnector().call(new GetRequest("api/plugins/installed")).content()).contains("1.0.2 (build 42)");

}
}

+ 1
- 1
it/it-tests/src/test/java/it/ui/UiTest.java Wyświetl plik



@Test @Test
public void footer_contains_version() { public void footer_contains_version() {
WsResponse status = ItUtils.newAdminWsClient(ORCHESTRATOR).wsConnector().call(new GetRequest("api/system/status"));
WsResponse status = ItUtils.newAdminWsClient(ORCHESTRATOR).wsConnector().call(new GetRequest("api/navigation/global"));
Map<String, Object> statusMap = ItUtils.jsonToMap(status.content()); Map<String, Object> statusMap = ItUtils.jsonToMap(status.content());


nav.getFooter().should(hasText((String) statusMap.get("version"))); nav.getFooter().should(hasText((String) statusMap.get("version")));

Ładowanie…
Anuluj
Zapisz