mirror of
https://github.com/SonarSource/sonarqube.git
synced 2024-08-08 03:05:57 +02:00
Move server category test from it-sonar
This commit is contained in:
parent
5050ad482c
commit
60a09b3395
39
it/it-plugins/global-property-change-plugin/pom.xml
Normal file
39
it/it-plugins/global-property-change-plugin/pom.xml
Normal file
@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.sonarsource.it</groupId>
|
||||
<artifactId>it-plugins</artifactId>
|
||||
<version>5.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>global-property-change-plugin</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>sonar-plugin</packaging>
|
||||
<description>Plugins :: Global Property Change</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.sonar</groupId>
|
||||
<artifactId>sonar-plugin-api</artifactId>
|
||||
<version>${apiVersion}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.sonar</groupId>
|
||||
<artifactId>sonar-packaging-maven-plugin</artifactId>
|
||||
<version>1.12.1</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<pluginClass>GlobalPropertyChangePlugin</pluginClass>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@ -0,0 +1,12 @@
|
||||
import org.sonar.api.Properties;
|
||||
import org.sonar.api.Property;
|
||||
import org.sonar.api.config.GlobalPropertyChangeHandler;
|
||||
|
||||
@Properties(@Property(key = "globalPropertyChange.received", name = "Check that extension has correctly been notified by global property change", category = "fake"))
|
||||
public final class FakeGlobalPropertyChange extends GlobalPropertyChangeHandler {
|
||||
|
||||
@Override
|
||||
public void onChange(PropertyChange propertyChange) {
|
||||
System.out.println("Received change: " + propertyChange);
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import org.sonar.api.SonarPlugin;
|
||||
|
||||
public class GlobalPropertyChangePlugin extends SonarPlugin {
|
||||
public List getExtensions() {
|
||||
return Arrays.asList(FakeGlobalPropertyChange.class);
|
||||
}
|
||||
}
|
38
it/it-plugins/license-plugin/pom.xml
Normal file
38
it/it-plugins/license-plugin/pom.xml
Normal file
@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.sonarsource.it</groupId>
|
||||
<artifactId>it-plugins</artifactId>
|
||||
<version>5.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>license-plugin</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>sonar-plugin</packaging>
|
||||
<description>Plugins :: License</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.sonar</groupId>
|
||||
<artifactId>sonar-plugin-api</artifactId>
|
||||
<version>${apiVersion}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.sonar</groupId>
|
||||
<artifactId>sonar-packaging-maven-plugin</artifactId>
|
||||
<version>1.12.1</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<pluginClass>LicensePlugin</pluginClass>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@ -0,0 +1,24 @@
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import org.sonar.api.CoreProperties;
|
||||
import org.sonar.api.Properties;
|
||||
import org.sonar.api.Property;
|
||||
import org.sonar.api.PropertyType;
|
||||
import org.sonar.api.SonarPlugin;
|
||||
|
||||
@Properties({
|
||||
@Property(
|
||||
key = "untyped.license.secured",
|
||||
name = "Property without license type",
|
||||
category = CoreProperties.CATEGORY_GENERAL),
|
||||
@Property(
|
||||
key = "typed.license.secured",
|
||||
name = "Typed property",
|
||||
category = CoreProperties.CATEGORY_GENERAL,
|
||||
type = PropertyType.LICENSE)
|
||||
})
|
||||
public class LicensePlugin extends SonarPlugin {
|
||||
public List getExtensions() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
@ -30,8 +30,13 @@
|
||||
</properties>
|
||||
|
||||
<modules>
|
||||
<module>global-property-change-plugin</module>
|
||||
<module>l10n-fr-pack</module>
|
||||
<module>license-plugin</module>
|
||||
<module>property-relocation-plugin</module>
|
||||
<module>property-sets-plugin</module>
|
||||
<module>server-plugin</module>
|
||||
<module>settings-plugin</module>
|
||||
<module>sonar-fake-plugin</module>
|
||||
<module>sonar-subcategories-plugin</module>
|
||||
</modules>
|
||||
|
39
it/it-plugins/property-relocation-plugin/pom.xml
Normal file
39
it/it-plugins/property-relocation-plugin/pom.xml
Normal file
@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.sonarsource.it</groupId>
|
||||
<artifactId>it-plugins</artifactId>
|
||||
<version>5.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>property-relocation-plugin</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>sonar-plugin</packaging>
|
||||
<description>Plugins :: Property Relocation</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.sonar</groupId>
|
||||
<artifactId>sonar-plugin-api</artifactId>
|
||||
<version>${apiVersion}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.sonar</groupId>
|
||||
<artifactId>sonar-packaging-maven-plugin</artifactId>
|
||||
<version>1.12.1</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<pluginClass>PropertyRelocationPlugin</pluginClass>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@ -0,0 +1,16 @@
|
||||
import org.sonar.api.BatchExtension;
|
||||
import org.sonar.api.config.Settings;
|
||||
|
||||
public class CheckProperties implements BatchExtension {
|
||||
private Settings settings;
|
||||
|
||||
public CheckProperties(Settings settings) {
|
||||
this.settings = settings;
|
||||
}
|
||||
|
||||
public void start() {
|
||||
if (settings.getBoolean("sonar.newKey") != true) {
|
||||
throw new IllegalStateException("Property not found: sonar.newKey");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import org.sonar.api.Properties;
|
||||
import org.sonar.api.Property;
|
||||
import org.sonar.api.SonarPlugin;
|
||||
|
||||
@Properties({
|
||||
@Property(key = "sonar.newKey", deprecatedKey = "sonar.deprecatedKey", name = "New Key", category = "general")
|
||||
})
|
||||
public class PropertyRelocationPlugin extends SonarPlugin {
|
||||
public List getExtensions() {
|
||||
return Arrays.asList(CheckProperties.class);
|
||||
}
|
||||
}
|
39
it/it-plugins/server-plugin/pom.xml
Normal file
39
it/it-plugins/server-plugin/pom.xml
Normal file
@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.sonarsource.it</groupId>
|
||||
<artifactId>it-plugins</artifactId>
|
||||
<version>5.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>server-plugin</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>sonar-plugin</packaging>
|
||||
<name>SonarQube Integration Tests :: Plugins :: Server</name>
|
||||
<description>Main plugin for Server tests</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.sonar</groupId>
|
||||
<artifactId>sonar-plugin-api</artifactId>
|
||||
<version>${apiVersion}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.sonar</groupId>
|
||||
<artifactId>sonar-packaging-maven-plugin</artifactId>
|
||||
<version>1.12.1</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<pluginClass>ServerPlugin</pluginClass>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
14
it/it-plugins/server-plugin/src/main/java/ServerPlugin.java
Normal file
14
it/it-plugins/server-plugin/src/main/java/ServerPlugin.java
Normal file
@ -0,0 +1,14 @@
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import org.sonar.api.Properties;
|
||||
import org.sonar.api.Property;
|
||||
import org.sonar.api.SonarPlugin;
|
||||
|
||||
@Properties({
|
||||
@Property(key = "some-property", name = "Some Property", defaultValue = "aDefaultValue", global = true, project = false)
|
||||
})
|
||||
public class ServerPlugin extends SonarPlugin {
|
||||
public List getExtensions() {
|
||||
return Arrays.asList(WidgetDisplayingProperties.class, TempFolderExtension.class);
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
import org.sonar.api.Properties;
|
||||
import org.sonar.api.Property;
|
||||
import org.sonar.api.PropertyType;
|
||||
import org.sonar.api.ServerExtension;
|
||||
import org.sonar.api.config.Settings;
|
||||
import org.sonar.api.utils.TempFolder;
|
||||
import org.sonar.api.utils.log.Logger;
|
||||
import org.sonar.api.utils.log.Loggers;
|
||||
|
||||
@Properties({
|
||||
@Property(
|
||||
key = TempFolderExtension.CREATE_TEMP_FILES,
|
||||
type = PropertyType.BOOLEAN,
|
||||
name = "Property to decide if it should create temp files",
|
||||
defaultValue = "false")
|
||||
})
|
||||
public class TempFolderExtension implements ServerExtension {
|
||||
|
||||
private static final Logger LOG = Loggers.get(TempFolderExtension.class);
|
||||
|
||||
public static final String CREATE_TEMP_FILES = "sonar.createTempFiles";
|
||||
|
||||
private Settings settings;
|
||||
|
||||
private TempFolder tempFolder;
|
||||
|
||||
public TempFolderExtension(Settings settings, TempFolder tempFolder) {
|
||||
this.settings = settings;
|
||||
this.tempFolder = tempFolder;
|
||||
start();
|
||||
}
|
||||
|
||||
public void start() {
|
||||
if (settings.getBoolean(CREATE_TEMP_FILES)) {
|
||||
LOG.info("Creating temp directory: " + tempFolder.newDir("sonar-it").getAbsolutePath());
|
||||
LOG.info("Creating temp file: " + tempFolder.newFile("sonar-it", ".txt").getAbsolutePath());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
import org.sonar.api.web.AbstractRubyTemplate;
|
||||
import org.sonar.api.web.RubyRailsWidget;
|
||||
import org.sonar.api.web.WidgetScope;
|
||||
|
||||
import static org.sonar.api.web.WidgetScope.GLOBAL;
|
||||
|
||||
@WidgetScope(GLOBAL)
|
||||
public class WidgetDisplayingProperties extends AbstractRubyTemplate implements RubyRailsWidget {
|
||||
|
||||
public String getId() {
|
||||
return "widget-displaying-properties";
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return "Widget Displaying Properties";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTemplatePath() {
|
||||
return "/widgets/widget-displaying-properties.html.erb";
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Property</th>
|
||||
<th>Value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<td>some-property</td>
|
||||
<td id="some-property"><%= configuration('some-property') -%></td>
|
||||
</tr>
|
||||
</table>
|
40
it/it-plugins/settings-plugin/pom.xml
Normal file
40
it/it-plugins/settings-plugin/pom.xml
Normal file
@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.sonarsource.it</groupId>
|
||||
<artifactId>it-plugins</artifactId>
|
||||
<version>5.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>settings-plugin</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>sonar-plugin</packaging>
|
||||
<description>Plugins :: Settings</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.sonar</groupId>
|
||||
<artifactId>sonar-plugin-api</artifactId>
|
||||
<version>${apiVersion}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.sonar</groupId>
|
||||
<artifactId>sonar-packaging-maven-plugin</artifactId>
|
||||
<version>1.12.1</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<pluginClass>SettingsPlugin</pluginClass>
|
||||
<pluginName>Settings</pluginName>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@ -0,0 +1,16 @@
|
||||
import org.sonar.api.Properties;
|
||||
import org.sonar.api.Property;
|
||||
import org.sonar.api.PropertyType;
|
||||
import org.sonar.api.ServerExtension;
|
||||
|
||||
@Properties({
|
||||
@Property(key = "boolean", name = "Boolean", type=PropertyType.BOOLEAN),
|
||||
@Property(key = "integer", name = "Integer", type=PropertyType.INTEGER),
|
||||
@Property(key = "float", name = "Float", type=PropertyType.FLOAT),
|
||||
@Property(key = "password", name = "Password", type=PropertyType.PASSWORD, defaultValue = "sonar"),
|
||||
@Property(key = "text", name = "Text", type=PropertyType.TEXT),
|
||||
@Property(key = "metric", name = "Metric", type=PropertyType.METRIC),
|
||||
@Property(key = "single_select_list", name = "Single Select List", type=PropertyType.SINGLE_SELECT_LIST, options = {"de", "en", "nl"})
|
||||
})
|
||||
public class PropertyTypes implements ServerExtension {
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
import org.sonar.api.Properties;
|
||||
import org.sonar.api.Property;
|
||||
import org.sonar.api.ServerExtension;
|
||||
import org.sonar.api.config.Settings;
|
||||
|
||||
@Properties({
|
||||
@Property(key = "settings.extension.hidden", name = "Hidden Property", description = "Hidden Property defined on extension but not plugin", global = false, project = false, module = false, defaultValue = "teahupoo"),
|
||||
@Property(key = "settings.extension.global", name = "Global Property", global = true, project = false, module = false)
|
||||
})
|
||||
public final class ServerExtensionWithProperties implements ServerExtension {
|
||||
|
||||
private Settings settings;
|
||||
|
||||
public ServerExtensionWithProperties(Settings settings) {
|
||||
this.settings = settings;
|
||||
}
|
||||
|
||||
public void start() {
|
||||
System.out.println("Test that the default value of properties are automatically injected by the component Settings");
|
||||
if (!"teahupoo".equals(settings.getString("settings.extension.hidden"))) {
|
||||
throw new IllegalStateException("The property settings.extension.hidden is not registered");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import org.sonar.api.SonarPlugin;
|
||||
|
||||
public class SettingsPlugin extends SonarPlugin {
|
||||
public List getExtensions() {
|
||||
return Arrays.asList(ServerExtensionWithProperties.class, PropertyTypes.class);
|
||||
}
|
||||
}
|
182
it/it-tests/src/test/java/administation/HttpsTest.java
Normal file
182
it/it-tests/src/test/java/administation/HttpsTest.java
Normal file
@ -0,0 +1,182 @@
|
||||
/*
|
||||
* Copyright (C) 2009-2014 SonarSource SA
|
||||
* All rights reserved
|
||||
* mailto:contact AT sonarsource DOT com
|
||||
*/
|
||||
package administation;
|
||||
|
||||
import com.sonar.orchestrator.Orchestrator;
|
||||
import com.sonar.orchestrator.util.NetworkUtils;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.List;
|
||||
import javax.net.ssl.HostnameVerifier;
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.SSLHandshakeException;
|
||||
import javax.net.ssl.SSLSession;
|
||||
import javax.net.ssl.SSLSocketFactory;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
public class HttpsTest {
|
||||
|
||||
public static final String HTTPS_PROTOCOLS = "https.protocols";
|
||||
|
||||
Orchestrator orchestrator;
|
||||
|
||||
int httpsPort = NetworkUtils.getNextAvailablePort();
|
||||
|
||||
@Rule
|
||||
public ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
String initialHttpsProtocols = null;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
// SSLv3 is not supported since SQ 4.5.2. Only TLS v1, v1.1 and v1.2 are
|
||||
// enabled by Tomcat.
|
||||
// The problem is that java 1.6 supports only TLSv1 but not v1.1 nor 1.2,
|
||||
// so version to be used must be explicitly set on JVM.
|
||||
initialHttpsProtocols = StringUtils.defaultString(System.getProperty(HTTPS_PROTOCOLS), "");
|
||||
System.setProperty(HTTPS_PROTOCOLS, "TLSv1");
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
if (orchestrator != null) {
|
||||
orchestrator.stop();
|
||||
}
|
||||
System.setProperty(HTTPS_PROTOCOLS, initialHttpsProtocols);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void fail_to_start_if_bad_keystore_credentials() throws Exception {
|
||||
try {
|
||||
URL jksKeystore = getClass().getResource("/administration/HttpsTest/keystore.jks");
|
||||
orchestrator = Orchestrator.builderEnv()
|
||||
.setServerProperty("sonar.web.https.port", String.valueOf(httpsPort))
|
||||
.setServerProperty("sonar.web.https.keyAlias", "tests")
|
||||
.setServerProperty("sonar.web.https.keyPass", "__wrong__")
|
||||
.setServerProperty("sonar.web.https.keystoreFile", new File(jksKeystore.toURI()).getAbsolutePath())
|
||||
.setServerProperty("sonar.web.https.keystorePass", "__wrong__")
|
||||
.build();
|
||||
orchestrator.start();
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
File logFile = orchestrator.getServer().getLogs();
|
||||
assertThat(FileUtils.readFileToString(logFile)).contains("Password verification failed");
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void enable_https_port() throws Exception {
|
||||
// start server
|
||||
URL jksKeystore = getClass().getResource("/administration/HttpsTest/keystore.jks");
|
||||
orchestrator = Orchestrator.builderEnv()
|
||||
.setServerProperty("sonar.web.https.port", String.valueOf(httpsPort))
|
||||
.setServerProperty("sonar.web.https.keyAlias", "tests")
|
||||
.setServerProperty("sonar.web.https.keyPass", "thetests")
|
||||
.setServerProperty("sonar.web.https.keystoreFile", new File(jksKeystore.toURI()).getAbsolutePath())
|
||||
.setServerProperty("sonar.web.https.keystorePass", "thepassword")
|
||||
.build();
|
||||
orchestrator.start();
|
||||
|
||||
// check logs
|
||||
File logFile = orchestrator.getServer().getLogs();
|
||||
assertThat(FileUtils.readFileToString(logFile)).contains("HTTPS connector enabled on port " + httpsPort);
|
||||
|
||||
// connect from clients
|
||||
connectTrusted();
|
||||
connectUntrusted();
|
||||
}
|
||||
|
||||
private void connectTrusted() throws IOException {
|
||||
URL url = new URL("https://localhost:" + httpsPort + "/sonar");
|
||||
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
|
||||
try {
|
||||
connection.getInputStream();
|
||||
fail();
|
||||
} catch (SSLHandshakeException e) {
|
||||
// ok, the certificate is not trusted
|
||||
}
|
||||
}
|
||||
|
||||
private void connectUntrusted() throws Exception {
|
||||
// Create a trust manager that does not validate certificate chains
|
||||
TrustManager[] trustAllCerts = new TrustManager[] {new X509TrustManager() {
|
||||
public X509Certificate[] getAcceptedIssuers() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void checkClientTrusted(X509Certificate[] certs, String authType) {
|
||||
}
|
||||
|
||||
public void checkServerTrusted(X509Certificate[] certs, String authType) {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Install the all-trusting trust manager
|
||||
// SSLv3 is disabled since SQ 4.5.2 : https://jira.codehaus.org/browse/SONAR-5860
|
||||
SSLContext sc = SSLContext.getInstance("TLS");
|
||||
sc.init(null, trustAllCerts, new java.security.SecureRandom());
|
||||
|
||||
SSLSocketFactory untrustedSocketFactory = sc.getSocketFactory();
|
||||
|
||||
|
||||
// Create all-trusting host name verifier
|
||||
HostnameVerifier allHostsValid = new HostnameVerifier() {
|
||||
public boolean verify(String hostname, SSLSession session) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
URL url = new URL("https://localhost:" + httpsPort + "/sonar/sessions/login");
|
||||
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
|
||||
connection.setRequestMethod("POST");
|
||||
connection.setAllowUserInteraction(true);
|
||||
connection.setSSLSocketFactory(untrustedSocketFactory);
|
||||
connection.setHostnameVerifier(allHostsValid);
|
||||
|
||||
InputStream input = connection.getInputStream();
|
||||
checkCookieFlags(connection);
|
||||
try {
|
||||
String html = IOUtils.toString(input);
|
||||
assertThat(html).contains("<body");
|
||||
} finally {
|
||||
IOUtils.closeQuietly(input);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* SSF-13 HttpOnly flag
|
||||
* SSF-16 Secure flag
|
||||
*/
|
||||
private void checkCookieFlags(HttpsURLConnection connection) {
|
||||
List<String> cookies = connection.getHeaderFields().get("Set-Cookie");
|
||||
boolean foundSessionCookie = false;
|
||||
for (String cookie : cookies) {
|
||||
if (StringUtils.containsIgnoreCase(cookie, "JSESSIONID")) {
|
||||
foundSessionCookie = true;
|
||||
assertThat(cookie).containsIgnoringCase("Secure").containsIgnoringCase("HttpOnly");
|
||||
}
|
||||
}
|
||||
if (!foundSessionCookie) {
|
||||
fail("Session cookie not found");
|
||||
}
|
||||
}
|
||||
}
|
313
it/it-tests/src/test/java/administation/ServerTest.java
Normal file
313
it/it-tests/src/test/java/administation/ServerTest.java
Normal file
@ -0,0 +1,313 @@
|
||||
/*
|
||||
* Copyright (C) 2009-2014 SonarSource SA
|
||||
* All rights reserved
|
||||
* mailto:contact AT sonarsource DOT com
|
||||
*/
|
||||
package administation;
|
||||
|
||||
import com.sonar.orchestrator.Orchestrator;
|
||||
import com.sonar.orchestrator.OrchestratorBuilder;
|
||||
import com.sonar.orchestrator.build.SonarRunner;
|
||||
import com.sonar.orchestrator.locator.FileLocation;
|
||||
import com.sonar.orchestrator.selenium.Selenese;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang.SystemUtils;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.junit.After;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.sonar.wsclient.base.HttpException;
|
||||
import org.sonar.wsclient.services.PropertyDeleteQuery;
|
||||
import org.sonar.wsclient.services.PropertyUpdateQuery;
|
||||
import org.sonar.wsclient.services.Server;
|
||||
import org.sonar.wsclient.services.ServerQuery;
|
||||
import util.ItUtils;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
public class ServerTest {
|
||||
|
||||
Orchestrator orchestrator;
|
||||
|
||||
@Rule
|
||||
public ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@After
|
||||
public void stop() {
|
||||
if (orchestrator != null) {
|
||||
orchestrator.stop();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* See http://jira.codehaus.org/browse/SONAR-2727
|
||||
*/
|
||||
@Test
|
||||
public void display_warnings_when_using_h2() {
|
||||
OrchestratorBuilder builder = Orchestrator.builderEnv();
|
||||
if (builder.getOrchestratorConfiguration().getString("sonar.jdbc.dialect").equals("h2")) {
|
||||
orchestrator = builder.build();
|
||||
orchestrator.start();
|
||||
|
||||
Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("derby-warnings",
|
||||
"/administration/ServerTest/derby-warning.html").build();
|
||||
orchestrator.executeSelenese(selenese);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* See http://jira.codehaus.org/browse/SONAR-2840
|
||||
*/
|
||||
@Test
|
||||
public void hide_jdbc_settings_to_non_admin() {
|
||||
orchestrator = Orchestrator.createEnv();
|
||||
orchestrator.start();
|
||||
|
||||
Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("jdbc-settings",
|
||||
"/administration/ServerTest/hide-jdbc-settings.html").build();
|
||||
orchestrator.executeSelenese(selenese);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_settings() {
|
||||
URL secretKeyUrl = getClass().getResource("/administration/ServerTest/sonar-secret.txt");
|
||||
orchestrator = Orchestrator.builderEnv()
|
||||
.addPlugin(ItUtils.pluginArtifact("settings-plugin"))
|
||||
.addPlugin(ItUtils.pluginArtifact("license-plugin"))
|
||||
.setServerProperty("sonar.secretKeyPath", secretKeyUrl.getFile())
|
||||
.build();
|
||||
orchestrator.start();
|
||||
|
||||
Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("settings",
|
||||
"/administration/ServerTest/settings/general-settings.html",
|
||||
|
||||
// SONAR-2869 the annotation @Properties can be used on extensions and not only on plugin entry points
|
||||
"/administration/ServerTest/settings/hidden-extension-property.html",
|
||||
"/administration/ServerTest/settings/global-extension-property.html",
|
||||
|
||||
// SONAR-3344 - licenses
|
||||
"/administration/ServerTest/settings/ignore-corrupted-license.html",
|
||||
"/administration/ServerTest/settings/display-license.html",
|
||||
"/administration/ServerTest/settings/display-untyped-license.html",
|
||||
|
||||
// SONAR-2084 - encryption
|
||||
"/administration/ServerTest/settings/generate-secret-key.html",
|
||||
"/administration/ServerTest/settings/encrypt-text.html",
|
||||
|
||||
// SONAR-1378 - property types
|
||||
"/administration/ServerTest/settings/validate-property-type.html",
|
||||
|
||||
// SONAR-3127 - hide passwords
|
||||
"/administration/ServerTest/settings/hide-passwords.html"
|
||||
).build();
|
||||
orchestrator.executeSelenese(selenese);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void property_relocation() {
|
||||
orchestrator = Orchestrator.builderEnv()
|
||||
.addPlugin(ItUtils.pluginArtifact("property-relocation-plugin"))
|
||||
.addPlugin(ItUtils.xooPlugin())
|
||||
.setServerProperty("sonar.deprecatedKey", "true")
|
||||
.build();
|
||||
orchestrator.start();
|
||||
|
||||
SonarRunner withDeprecatedKey = SonarRunner.create(ItUtils.projectDir("shared/xoo-sample"))
|
||||
.setProperty("sonar.deprecatedKey", "true");
|
||||
SonarRunner withNewKey = SonarRunner.create(ItUtils.projectDir("shared/xoo-sample"))
|
||||
.setProperty("sonar.newKey", "true");
|
||||
// should not fail
|
||||
orchestrator.executeBuilds(withDeprecatedKey, withNewKey);
|
||||
|
||||
Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("property_relocation",
|
||||
"/administration/ServerTest/settings/property_relocation.html"
|
||||
).build();
|
||||
orchestrator.executeSelenese(selenese);
|
||||
}
|
||||
|
||||
/**
|
||||
* SONAR-5542
|
||||
*/
|
||||
@Test
|
||||
public void force_authentication_should_be_used_on_java_web_services_but_not_on_batch_index_and_file() throws IOException {
|
||||
orchestrator = Orchestrator.createEnv();
|
||||
orchestrator.start();
|
||||
|
||||
try {
|
||||
orchestrator.getServer().getAdminWsClient().update(new PropertyUpdateQuery("sonar.forceAuthentication", "true"));
|
||||
|
||||
// /batch/index should never need authentication
|
||||
String batchIndex = orchestrator.getServer().wsClient().get("/batch/index");
|
||||
assertThat(batchIndex).isNotEmpty();
|
||||
|
||||
String jar = batchIndex.split("\\|")[0];
|
||||
|
||||
// /batch/file should never need authentication
|
||||
HttpClient httpclient = new DefaultHttpClient();
|
||||
try {
|
||||
HttpGet get = new HttpGet(orchestrator.getServer().getUrl() + "/batch/file?name=" + jar);
|
||||
HttpResponse response = httpclient.execute(get);
|
||||
assertThat(response.getStatusLine().getStatusCode()).isEqualTo(200);
|
||||
EntityUtils.consume(response.getEntity());
|
||||
|
||||
// As Sonar runner is still using /batch/key, we have to also verify it
|
||||
get = new HttpGet(orchestrator.getServer().getUrl() + "/batch/" + jar);
|
||||
response = httpclient.execute(get);
|
||||
assertThat(response.getStatusLine().getStatusCode()).isEqualTo(200);
|
||||
EntityUtils.consume(response.getEntity());
|
||||
|
||||
} finally {
|
||||
httpclient.getConnectionManager().shutdown();
|
||||
}
|
||||
|
||||
// but other java web services should need authentication
|
||||
try {
|
||||
orchestrator.getServer().wsClient().get("/api");
|
||||
} catch (HttpException e) {
|
||||
assertThat(e.getMessage()).contains("401");
|
||||
}
|
||||
|
||||
} finally {
|
||||
orchestrator.getServer().getAdminWsClient().delete(new PropertyDeleteQuery("sonar.forceAuthentication"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* SONAR-3320
|
||||
*/
|
||||
@Test
|
||||
public void global_property_change_extension_point() throws IOException {
|
||||
orchestrator = Orchestrator.builderEnv()
|
||||
.addPlugin(ItUtils.pluginArtifact("global-property-change-plugin"))
|
||||
.build();
|
||||
orchestrator.start();
|
||||
|
||||
orchestrator.getServer().adminWsClient().post("api/properties/create?id=globalPropertyChange.received&value=NEWVALUE");
|
||||
assertThat(FileUtils.readFileToString(orchestrator.getServer().getLogs()).contains("Received change: NEWVALUE"));
|
||||
}
|
||||
|
||||
/**
|
||||
* SONAR-3516
|
||||
*/
|
||||
@Test
|
||||
public void check_minimal_sonar_version_at_startup() throws Exception {
|
||||
try {
|
||||
orchestrator = Orchestrator.builderEnv()
|
||||
.addPlugin(FileLocation.of(new File(ServerTest.class.getResource("/administration/ServerTest/incompatible-plugin-1.0.jar").toURI())))
|
||||
.build();
|
||||
orchestrator.start();
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertThat(FileUtils.readFileToString(orchestrator.getServer().getLogs())).contains(
|
||||
"Plugin incompatible-plugin [incompatibleplugin] requires at least SonarQube 5.9");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* SONAR-3962
|
||||
*/
|
||||
@Test
|
||||
public void not_fail_with_url_ending_by_jsp() {
|
||||
orchestrator = Orchestrator.builderEnv().addPlugin(ItUtils.xooPlugin()).build();
|
||||
orchestrator.start();
|
||||
|
||||
orchestrator.executeBuild(SonarRunner.create(ItUtils.projectDir("shared/xoo-sample"))
|
||||
.setProperty("sonar.projectKey", "myproject.jsp"));
|
||||
// Access dashboard
|
||||
Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("url_ending_by_jsp",
|
||||
"/administration/ServerTest/url_ending_by_jsp.html").build();
|
||||
orchestrator.executeSelenese(selenese);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void support_install_dir_with_whitespaces() throws Exception {
|
||||
String dirName = "target/has space";
|
||||
FileUtils.deleteDirectory(new File(dirName));
|
||||
orchestrator = Orchestrator.builderEnv().setOrchestratorProperty("orchestrator.workspaceDir", dirName).build();
|
||||
orchestrator.start();
|
||||
|
||||
Server.Status status = orchestrator.getServer().getAdminWsClient().find(new ServerQuery()).getStatus();
|
||||
assertThat(status).isEqualTo(Server.Status.UP);
|
||||
}
|
||||
|
||||
// SONAR-4404
|
||||
@Test
|
||||
public void should_get_settings_default_value() {
|
||||
orchestrator = Orchestrator.builderEnv()
|
||||
.addPlugin(ItUtils.pluginArtifact("server-plugin"))
|
||||
.build();
|
||||
orchestrator.start();
|
||||
|
||||
Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("settings-default-value",
|
||||
"/administration/ServerTest/settings-default-value.html").build();
|
||||
orchestrator.executeSelenese(selenese);
|
||||
}
|
||||
|
||||
// SONAR-4748
|
||||
@Test
|
||||
public void should_create_in_temp_folder() throws Exception {
|
||||
orchestrator = Orchestrator.builderEnv()
|
||||
.addPlugin(ItUtils.pluginArtifact("server-plugin"))
|
||||
.setServerProperty("sonar.createTempFiles", "true")
|
||||
.build();
|
||||
orchestrator.start();
|
||||
|
||||
File tempDir = new File(orchestrator.getServer().getHome(), "temp/tmp");
|
||||
|
||||
String logs = FileUtils.readFileToString(orchestrator.getServer().getLogs());
|
||||
assertThat(logs).contains("Creating temp directory: " + tempDir.getAbsolutePath() + File.separator + "sonar-it");
|
||||
assertThat(logs).contains("Creating temp file: " + tempDir.getAbsolutePath() + File.separator + "sonar-it");
|
||||
|
||||
// Verify temp folder is created
|
||||
assertThat(new File(tempDir, "sonar-it")).isDirectory().exists();
|
||||
|
||||
orchestrator.stop();
|
||||
|
||||
// Verify temp folder is deleted after shutdown
|
||||
assertThat(new File(tempDir, "sonar-it")).doesNotExist();
|
||||
}
|
||||
|
||||
/**
|
||||
* SONAR-4843
|
||||
*/
|
||||
@Test
|
||||
public void restart_forbidden_if_not_dev_mode() throws Exception {
|
||||
// server classloader locks Jar files on Windows
|
||||
if (!SystemUtils.IS_OS_WINDOWS) {
|
||||
orchestrator = Orchestrator.builderEnv().build();
|
||||
orchestrator.start();
|
||||
try {
|
||||
orchestrator.getServer().adminWsClient().systemClient().restart();
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertThat(e.getMessage()).contains("403");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* SONAR-4843
|
||||
*/
|
||||
@Test
|
||||
public void restart_on_dev_mode() throws Exception {
|
||||
// server classloader locks Jar files on Windows
|
||||
if (!SystemUtils.IS_OS_WINDOWS) {
|
||||
orchestrator = Orchestrator.builderEnv().setServerProperty("sonar.web.dev", "true").build();
|
||||
orchestrator.start();
|
||||
|
||||
orchestrator.getServer().adminWsClient().systemClient().restart();
|
||||
assertThat(FileUtils.readFileToString(orchestrator.getServer().getLogs()))
|
||||
.contains("Restart server")
|
||||
.contains("Server restarted");
|
||||
}
|
||||
}
|
||||
}
|
@ -30,14 +30,15 @@ import util.ItUtils;
|
||||
BulkDeletionTest.class,
|
||||
ProjectAdministrationTest.class,
|
||||
PropertySetsTest.class,
|
||||
SubCategoriesTest.class
|
||||
SubCategoriesTest.class,
|
||||
WebServiceTest.class,
|
||||
ServerAdministrationTest.class
|
||||
})
|
||||
public class AdministrationTestSuite {
|
||||
|
||||
@ClassRule
|
||||
public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv()
|
||||
.setServerProperty("sonar.notifications.delay", "1")
|
||||
// .addPlugin(ItUtils.pluginArtifact("crash-plugin"))
|
||||
.addPlugin(ItUtils.pluginArtifact("property-sets-plugin"))
|
||||
.addPlugin(ItUtils.pluginArtifact("sonar-subcategories-plugin"))
|
||||
.addPlugin(ItUtils.xooPlugin())
|
||||
|
@ -49,7 +49,7 @@ public class BulkDeletionTest {
|
||||
executeBuild("cameleon-3", "Bar-Sonar-Plugin");
|
||||
|
||||
Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("project-bulk-deletion-on-selected-project",
|
||||
"/administration/project-bulk-deletion/bulk-delete-filter-projects.html"
|
||||
"/administration/suite/BulkDeletionTest/project-bulk-deletion/bulk-delete-filter-projects.html"
|
||||
).build();
|
||||
orchestrator.executeSelenese(selenese);
|
||||
}
|
||||
@ -63,8 +63,8 @@ public class BulkDeletionTest {
|
||||
|
||||
Selenese selenese = Selenese.builder()
|
||||
.setHtmlTestsInClasspath("bulk-delete-projects-with-short-name",
|
||||
"/administration/project-bulk-deletion/display-two-letters-long-project.html",
|
||||
"/administration/project-bulk-deletion/filter-two-letters-long-project.html"
|
||||
"/administration/suite/BulkDeletionTest/project-bulk-deletion/display-two-letters-long-project.html",
|
||||
"/administration/suite/BulkDeletionTest/project-bulk-deletion/filter-two-letters-long-project.html"
|
||||
).build();
|
||||
orchestrator.executeSelenese(selenese);
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ public class ProjectAdministrationTest {
|
||||
PermissionParameters.create().user(projectAdminUser).component("sample").permission("admin"));
|
||||
|
||||
orchestrator.executeSelenese(
|
||||
Selenese.builder().setHtmlTestsInClasspath("project-deletion", "/administration/project-deletion/project-deletion.html").build()
|
||||
Selenese.builder().setHtmlTestsInClasspath("project-deletion", "/administration/suite/ProjectAdministrationTest/project-deletion/project-deletion.html").build()
|
||||
);
|
||||
} finally {
|
||||
adminClient.userClient().deactivate(projectAdminUser);
|
||||
@ -143,7 +143,7 @@ public class ProjectAdministrationTest {
|
||||
Selenese selenese = Selenese
|
||||
.builder()
|
||||
.setHtmlTestsInClasspath("delete_version_of_multimodule_project",
|
||||
"/administration/project-administration/multimodule-project-modify-version.html"
|
||||
"/administration/suite/ProjectAdministrationTest/project-administration/multimodule-project-modify-version.html"
|
||||
).build();
|
||||
orchestrator.executeSelenese(selenese);
|
||||
|
||||
@ -152,7 +152,7 @@ public class ProjectAdministrationTest {
|
||||
selenese = Selenese
|
||||
.builder()
|
||||
.setHtmlTestsInClasspath("delete_version_of_multimodule_project",
|
||||
"/administration/project-administration/multimodule-project-delete-version.html"
|
||||
"/administration/suite/ProjectAdministrationTest/project-administration/multimodule-project-delete-version.html"
|
||||
).build();
|
||||
orchestrator.executeSelenese(selenese);
|
||||
|
||||
@ -176,7 +176,7 @@ public class ProjectAdministrationTest {
|
||||
Selenese selenese = Selenese
|
||||
.builder()
|
||||
.setHtmlTestsInClasspath("display-alerts-history-page",
|
||||
"/administration/display-alerts-history-page/should-display-alerts-correctly-history-page.html"
|
||||
"/administration/suite/ProjectAdministrationTest/display-alerts-history-page/should-display-alerts-correctly-history-page.html"
|
||||
).build();
|
||||
orchestrator.executeSelenese(selenese);
|
||||
|
||||
@ -204,7 +204,7 @@ public class ProjectAdministrationTest {
|
||||
Selenese selenese = Selenese
|
||||
.builder()
|
||||
.setHtmlTestsInClasspath("display-period-alerts",
|
||||
"/administration/display-alerts/should-display-period-alerts-correctly.html"
|
||||
"/administration/suite/ProjectAdministrationTest/display-alerts/should-display-period-alerts-correctly.html"
|
||||
).build();
|
||||
orchestrator.executeSelenese(selenese);
|
||||
|
||||
@ -221,9 +221,9 @@ public class ProjectAdministrationTest {
|
||||
|
||||
Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("project-settings",
|
||||
// SONAR-3425
|
||||
"/administration/project-settings/override-global-settings.html",
|
||||
"/administration/suite/ProjectAdministrationTest/project-settings/override-global-settings.html",
|
||||
|
||||
"/administration/project-settings/only-on-project-settings.html"
|
||||
"/administration/suite/ProjectAdministrationTest/project-settings/only-on-project-settings.html"
|
||||
).build();
|
||||
orchestrator.executeSelenese(selenese);
|
||||
|
||||
@ -242,10 +242,10 @@ public class ProjectAdministrationTest {
|
||||
Selenese selenese = Selenese
|
||||
.builder()
|
||||
.setHtmlTestsInClasspath("project-bulk-update-keys",
|
||||
"/administration/project-update-keys/bulk-update-impossible-because-duplicate-keys.html",
|
||||
"/administration/project-update-keys/bulk-update-impossible-because-no-input.html",
|
||||
"/administration/project-update-keys/bulk-update-impossible-because-no-match.html",
|
||||
"/administration/project-update-keys/bulk-update-success.html"
|
||||
"/administration/suite/ProjectAdministrationTest/project-update-keys/bulk-update-impossible-because-duplicate-keys.html",
|
||||
"/administration/suite/ProjectAdministrationTest/project-update-keys/bulk-update-impossible-because-no-input.html",
|
||||
"/administration/suite/ProjectAdministrationTest/project-update-keys/bulk-update-impossible-because-no-match.html",
|
||||
"/administration/suite/ProjectAdministrationTest/project-update-keys/bulk-update-success.html"
|
||||
).build();
|
||||
orchestrator.executeSelenese(selenese);
|
||||
}
|
||||
@ -261,8 +261,8 @@ public class ProjectAdministrationTest {
|
||||
Selenese selenese = Selenese
|
||||
.builder()
|
||||
.setHtmlTestsInClasspath("project-fine-grained-update-keys",
|
||||
"/administration/project-update-keys/fine-grained-update-impossible.html",
|
||||
"/administration/project-update-keys/fine-grained-update-success.html"
|
||||
"/administration/suite/ProjectAdministrationTest/project-update-keys/fine-grained-update-impossible.html",
|
||||
"/administration/suite/ProjectAdministrationTest/project-update-keys/fine-grained-update-success.html"
|
||||
).build();
|
||||
orchestrator.executeSelenese(selenese);
|
||||
}
|
||||
@ -273,7 +273,7 @@ public class ProjectAdministrationTest {
|
||||
|
||||
Selenese selenese = Selenese.builder()
|
||||
.setHtmlTestsInClasspath("anonymous_should_have_user_role_to_access_project",
|
||||
"/administration/anonymous_should_have_user_role_to_access_project/remove_user_role.html"
|
||||
"/administration/suite/ProjectAdministrationTest/anonymous_should_have_user_role_to_access_project/remove_user_role.html"
|
||||
).build();
|
||||
orchestrator.executeSelenese(selenese);
|
||||
}
|
||||
@ -287,7 +287,7 @@ public class ProjectAdministrationTest {
|
||||
|
||||
Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("module-settings",
|
||||
// SONAR-3425
|
||||
"/administration/module-settings/display-module-settings.html"
|
||||
"/administration/suite/ProjectAdministrationTest/module-settings/display-module-settings.html"
|
||||
).build();
|
||||
orchestrator.executeSelenese(selenese);
|
||||
}
|
||||
|
@ -36,10 +36,10 @@ public class PropertySetsTest {
|
||||
@Test
|
||||
public void should_support_property_sets() {
|
||||
Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("property-sets",
|
||||
"/administration/property-sets/create.html",
|
||||
"/administration/property-sets/delete.html",
|
||||
"/administration/property-sets/reference.html",
|
||||
"/administration/property-sets/all_types.html"
|
||||
"/administration/suite/PropertySetsTest/property-sets/create.html",
|
||||
"/administration/suite/PropertySetsTest/property-sets/delete.html",
|
||||
"/administration/suite/PropertySetsTest/property-sets/reference.html",
|
||||
"/administration/suite/PropertySetsTest/property-sets/all_types.html"
|
||||
).build();
|
||||
orchestrator.executeSelenese(selenese);
|
||||
|
||||
@ -66,7 +66,7 @@ public class PropertySetsTest {
|
||||
@Test
|
||||
public void should_support_property_sets_with_auto_generated_keys() {
|
||||
orchestrator.executeSelenese(Selenese.builder().setHtmlTestsInClasspath("create-auto-generated",
|
||||
"/administration/auto-generated/create.html"
|
||||
"/administration/suite/PropertySetsTest/auto-generated/create.html"
|
||||
).build());
|
||||
|
||||
String[] keys = getProperty("sonar.autogenerated").split("[,]");
|
||||
@ -75,7 +75,7 @@ public class PropertySetsTest {
|
||||
assertThat(getProperty("sonar.autogenerated." + keys[2] + ".value")).isEqualTo("THIRD");
|
||||
|
||||
orchestrator.executeSelenese(Selenese.builder().setHtmlTestsInClasspath("update-auto-generated",
|
||||
"/administration/auto-generated/update.html"
|
||||
"/administration/suite/PropertySetsTest/auto-generated/update.html"
|
||||
).build());
|
||||
|
||||
keys = getProperty("sonar.autogenerated").split("[,]");
|
||||
|
@ -0,0 +1,110 @@
|
||||
/*
|
||||
* Copyright (C) 2009-2014 SonarSource SA
|
||||
* All rights reserved
|
||||
* mailto:contact AT sonarsource DOT com
|
||||
*/
|
||||
package administation.suite;
|
||||
|
||||
import com.sonar.orchestrator.Orchestrator;
|
||||
import com.sonar.orchestrator.selenium.Selenese;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.json.simple.JSONValue;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Test;
|
||||
import org.sonar.wsclient.services.Server;
|
||||
import org.sonar.wsclient.services.ServerQuery;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
public class ServerAdministrationTest {
|
||||
|
||||
@ClassRule
|
||||
public static Orchestrator orchestrator = AdministrationTestSuite.ORCHESTRATOR;
|
||||
|
||||
@Test
|
||||
public void get_sonar_version() {
|
||||
String version = orchestrator.getServer().getWsClient().find(new ServerQuery()).getVersion();
|
||||
if (!StringUtils.startsWithAny(version, new String[] {"5.", "6."})) {
|
||||
fail("Bad version: " + version);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void get_server_status() {
|
||||
assertThat(orchestrator.getServer().getWsClient().find(new ServerQuery()).getStatus()).isEqualTo(Server.Status.UP);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void generate_server_id() {
|
||||
Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("server_id",
|
||||
"/administration/suite/ServerAdministrationTest/server_id/missing_ip.html",
|
||||
// SONAR-4102
|
||||
"/administration/suite/ServerAdministrationTest/organisation_must_not_accept_special_chars.html",
|
||||
"/administration/suite/ServerAdministrationTest/valid_id.html").build();
|
||||
orchestrator.executeSelenese(selenese);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void display_system_info() {
|
||||
Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("server-administration",
|
||||
"/administration/suite/ServerAdministrationTest/server-administration/system_info.html"
|
||||
).build();
|
||||
orchestrator.executeSelenese(selenese);
|
||||
}
|
||||
|
||||
/**
|
||||
* SONAR-3147
|
||||
*/
|
||||
@Test
|
||||
public void test_widgets_web_service() throws IOException {
|
||||
HttpClient httpclient = new DefaultHttpClient();
|
||||
try {
|
||||
HttpGet get = new HttpGet(orchestrator.getServer().getUrl() + "/api/widgets");
|
||||
HttpResponse response = httpclient.execute(get);
|
||||
|
||||
assertThat(response.getStatusLine().getStatusCode()).isEqualTo(200);
|
||||
String json = IOUtils.toString(response.getEntity().getContent());
|
||||
List widgets = (List) JSONValue.parse(json);
|
||||
assertThat(widgets.size()).isGreaterThan(10);
|
||||
|
||||
// quick test of the first widget
|
||||
assertThat(((Map) widgets.get(0)).get("title")).isNotNull();
|
||||
|
||||
EntityUtils.consume(response.getEntity());
|
||||
|
||||
} finally {
|
||||
httpclient.getConnectionManager().shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* SONAR-5197
|
||||
*/
|
||||
@Test
|
||||
public void api_ws_shortcut() throws Exception {
|
||||
HttpClient httpclient = new DefaultHttpClient();
|
||||
try {
|
||||
HttpGet get = new HttpGet(orchestrator.getServer().getUrl() + "/api");
|
||||
HttpResponse response = httpclient.execute(get);
|
||||
|
||||
assertThat(response.getStatusLine().getStatusCode()).isEqualTo(200);
|
||||
String json = IOUtils.toString(response.getEntity().getContent());
|
||||
Map jsonAsMap = (Map) JSONValue.parse(json);
|
||||
assertThat(jsonAsMap.get("webServices")).isNotNull();
|
||||
EntityUtils.consume(response.getEntity());
|
||||
|
||||
} finally {
|
||||
httpclient.getConnectionManager().shutdown();
|
||||
}
|
||||
}
|
||||
}
|
@ -40,9 +40,9 @@ public class SubCategoriesTest {
|
||||
@Test
|
||||
public void should_support_global_subcategories() {
|
||||
Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("subcategories",
|
||||
"/administration/subcategories/global-subcategories.html",
|
||||
"/administration/suite/SubCategoriesTest/subcategories/global-subcategories.html",
|
||||
// SONAR-4495
|
||||
"/administration/subcategories/global-subcategories-no-default.html"
|
||||
"/administration/suite/SubCategoriesTest/subcategories/global-subcategories-no-default.html"
|
||||
).build();
|
||||
orchestrator.executeSelenese(selenese);
|
||||
assertThat(getProperty("prop3", null)).isEqualTo("myValue");
|
||||
@ -56,9 +56,9 @@ public class SubCategoriesTest {
|
||||
orchestrator.executeBuild(SonarRunner.create(projectDir("shared/xoo-sample")));
|
||||
|
||||
Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("subcategories",
|
||||
"/administration/subcategories/project-subcategories.html",
|
||||
"/administration/suite/SubCategoriesTest/subcategories/project-subcategories.html",
|
||||
// SONAR-4495
|
||||
"/administration/subcategories/project-subcategories-no-default.html"
|
||||
"/administration/suite/SubCategoriesTest/subcategories/project-subcategories-no-default.html"
|
||||
).build();
|
||||
orchestrator.executeSelenese(selenese);
|
||||
assertThat(getProperty("prop3", "sample")).isEqualTo("myValue2");
|
||||
|
@ -0,0 +1,101 @@
|
||||
/*
|
||||
* Copyright (C) 2009-2014 SonarSource SA
|
||||
* All rights reserved
|
||||
* mailto:contact AT sonarsource DOT com
|
||||
*/
|
||||
package administation.suite;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.sonar.orchestrator.Orchestrator;
|
||||
import com.sonar.orchestrator.build.SonarRunner;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.junit.Before;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Test;
|
||||
import org.sonar.wsclient.Sonar;
|
||||
import org.sonar.wsclient.services.Favourite;
|
||||
import org.sonar.wsclient.services.FavouriteCreateQuery;
|
||||
import org.sonar.wsclient.services.FavouriteDeleteQuery;
|
||||
import org.sonar.wsclient.services.FavouriteQuery;
|
||||
|
||||
import static com.google.common.collect.Lists.newArrayList;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static util.ItUtils.projectDir;
|
||||
|
||||
public class WebServiceTest {
|
||||
|
||||
@ClassRule
|
||||
public static Orchestrator orchestrator = AdministrationTestSuite.ORCHESTRATOR;
|
||||
|
||||
@Before
|
||||
public void inspectProject() {
|
||||
orchestrator.resetData();
|
||||
orchestrator.executeBuild(SonarRunner.create(projectDir("shared/xoo-sample")));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void favourites_web_service() throws Exception {
|
||||
Sonar adminWsClient = orchestrator.getServer().getAdminWsClient();
|
||||
|
||||
// GET (nothing)
|
||||
List<Favourite> favourites = adminWsClient.findAll(new FavouriteQuery());
|
||||
assertThat(favourites).isEmpty();
|
||||
|
||||
// POST (create favourites)
|
||||
Favourite favourite = adminWsClient.create(new FavouriteCreateQuery("sample"));
|
||||
assertThat(favourite).isNotNull();
|
||||
assertThat(favourite.getKey()).isEqualTo("sample");
|
||||
adminWsClient.create(new FavouriteCreateQuery("sample:src/main/xoo/sample/Sample.xoo"));
|
||||
|
||||
// GET (created favourites)
|
||||
favourites = adminWsClient.findAll(new FavouriteQuery());
|
||||
assertThat(favourites).hasSize(2);
|
||||
List<String> keys = newArrayList(Iterables.transform(favourites, new Function<Favourite, String>() {
|
||||
@Override
|
||||
public String apply(Favourite input) {
|
||||
return input.getKey();
|
||||
}
|
||||
}));
|
||||
assertThat(keys).containsOnly("sample", "sample:src/main/xoo/sample/Sample.xoo");
|
||||
|
||||
// DELETE (a favourite)
|
||||
adminWsClient.delete(new FavouriteDeleteQuery("sample"));
|
||||
favourites = adminWsClient.findAll(new FavouriteQuery());
|
||||
assertThat(favourites).hasSize(1);
|
||||
assertThat(favourites.get(0).getKey()).isEqualTo("sample:src/main/xoo/sample/Sample.xoo");
|
||||
}
|
||||
|
||||
/**
|
||||
* SONAR-3105
|
||||
*/
|
||||
@Test
|
||||
public void projects_web_service() throws IOException {
|
||||
SonarRunner build = SonarRunner.create(projectDir("shared/xoo-sample"));
|
||||
orchestrator.executeBuild(build);
|
||||
|
||||
String url = orchestrator.getServer().getUrl() + "/api/projects?key=sample&versions=true";
|
||||
HttpClient httpclient = new DefaultHttpClient();
|
||||
try {
|
||||
HttpGet get = new HttpGet(url);
|
||||
HttpResponse response = httpclient.execute(get);
|
||||
|
||||
assertThat(response.getStatusLine().getStatusCode()).isEqualTo(200);
|
||||
String content = IOUtils.toString(response.getEntity().getContent());
|
||||
assertThat(content).doesNotContain("error");
|
||||
assertThat(content).contains("sample");
|
||||
EntityUtils.consume(response.getEntity());
|
||||
|
||||
} finally {
|
||||
httpclient.getConnectionManager().shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Binary file not shown.
@ -0,0 +1,3 @@
|
||||
keytool -genkey -alias tests -keyalg RSA -keystore keystore.jks
|
||||
keystore password: thepassword
|
||||
key password for <tests>: thetests
|
@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>derby-warning</title>
|
||||
</head>
|
||||
<body>
|
||||
<table cellpadding="1" cellspacing="1" border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<td rowspan="1" colspan="3">derby-warning</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertElementPresent</td>
|
||||
<td>evaluation_warning</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertText</td>
|
||||
<td>footer</td>
|
||||
<td>glob:*evaluation*</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>hide-jdbc-settings</title>
|
||||
</head>
|
||||
<body>
|
||||
<table cellpadding="1" cellspacing="1" border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<td rowspan="1" colspan="3">hide-jdbc-settings</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/setup/index</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertTextNotPresent</td>
|
||||
<td>jdbc:</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
Binary file not shown.
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>settings-default-value</title>
|
||||
</head>
|
||||
<body>
|
||||
<table cellpadding="1" cellspacing="1" border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<td rowspan="1" colspan="3">settings-default-value</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/widget?id=widget-displaying-properties</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertText</td>
|
||||
<td>some-property</td>
|
||||
<td>aDefaultValue</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>display-license</title>
|
||||
</head>
|
||||
<body>
|
||||
<table cellpadding="1" cellspacing="1" border="1">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/sessions/logout</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/settings?category=general</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=login</td>
|
||||
<td>admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=password</td>
|
||||
<td>admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>name=commit</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=input_typed.license.secured</td>
|
||||
<td>TmFtZTogRGV2ZWxvcHBlcnMKUGx1Z2luOiBhdXRvY29udHJvbApFeHBpcmVzOiAyMDEyLTA0LTAxCktleTogNjI5N2MxMzEwYzg2NDZiZTE5MDU1MWE4ZmZmYzk1OTBmYzEyYTIyMgo=</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>id=submit_settings</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>waitForText</td>
|
||||
<td>block_typed.license.secured</td>
|
||||
<td>*autocontrol*</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertText</td>
|
||||
<td>block_typed.license.secured</td>
|
||||
<td>*Developpers*</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertText</td>
|
||||
<td>block_typed.license.secured</td>
|
||||
<td>*2012*</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>display-untyped-license</title>
|
||||
</head>
|
||||
<body>
|
||||
<table cellpadding="1" cellspacing="1" border="1">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/sessions/logout</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/settings?category=general</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=login</td>
|
||||
<td>admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=password</td>
|
||||
<td>admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>name=commit</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=input_untyped.license.secured</td>
|
||||
<td>TmFtZTogRGV2ZWxvcHBlcnMKUGx1Z2luOiBhdXRvY29udHJvbApFeHBpcmVzOiAyMDEyLTA0LTAxCktleTogNjI5N2MxMzEwYzg2NDZiZTE5MDU1MWE4ZmZmYzk1OTBmYzEyYTIyMgo=</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>submit_settings</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>waitForText</td>
|
||||
<td>block_untyped.license.secured</td>
|
||||
<td>*autocontrol*</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertText</td>
|
||||
<td>block_untyped.license.secured</td>
|
||||
<td>*Developpers*</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertText</td>
|
||||
<td>block_untyped.license.secured</td>
|
||||
<td>*2012*</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>encrypt-text</title>
|
||||
</head>
|
||||
<body>
|
||||
<table cellpadding="1" cellspacing="1" border="1">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/sessions/logout</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/settings?category=security&subcategory=encryption</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=login</td>
|
||||
<td>admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=password</td>
|
||||
<td>admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>name=commit</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>selectFrame</td>
|
||||
<td>settings_iframe</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=clear_text</td>
|
||||
<td>clear</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>id=submit_encrypt</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>waitForVisible</td>
|
||||
<td>encrypted_text</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertValue</td>
|
||||
<td>encrypted_text</td>
|
||||
<td>{aes}4aQbfYe1lrEjiRzv/ETbyg==</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>settings_on_core_plugins</title>
|
||||
</head>
|
||||
<body>
|
||||
<table cellpadding="1" cellspacing="1" border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<td rowspan="1" colspan="3">settings_on_core_plugins</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/sessions/logout</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/sessions/new</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>login</td>
|
||||
<td>admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>password</td>
|
||||
<td>admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>commit</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/settings/index</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertText</td>
|
||||
<td>plugins</td>
|
||||
<td>*General*</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>generate-secret-key</title>
|
||||
</head>
|
||||
<body>
|
||||
<table cellpadding="1" cellspacing="1" border="1">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/sessions/logout</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/settings?category=security&subcategory=encryption</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=login</td>
|
||||
<td>admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=password</td>
|
||||
<td>admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>name=commit</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>selectFrame</td>
|
||||
<td>settings_iframe</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>link=secret key can be changed</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>submit_generate_secret</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>waitForVisible</td>
|
||||
<td>secret</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
@ -3,10 +3,15 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>register_to_new_violations_on_project</title>
|
||||
<title>global-extension-property</title>
|
||||
</head>
|
||||
<body>
|
||||
<table cellpadding="1" cellspacing="1" border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<td rowspan="1" colspan="3">global-extension-property</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
@ -16,43 +21,30 @@
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>login</td>
|
||||
<td>tester</td>
|
||||
<td>admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>password</td>
|
||||
<td>tester</td>
|
||||
<td>admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>commit</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/account/index</td>
|
||||
<td>/sonar/settings?category=Settings</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>waitForElementPresent</td>
|
||||
<td>new_project</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>typeAndWait</td>
|
||||
<td>new_project</td>
|
||||
<td>com.sonarsource.it.projects.rule:notification-for-new-violations</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>//input[@value='Save changes']</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertText</td>
|
||||
<td>notif_form</td>
|
||||
<td>*New violations*notification-for-new-violations*Email*</td>
|
||||
<td>assertNotText</td>
|
||||
<td>plugins</td>
|
||||
<td>glob:*Hidden*</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>hidden-extension-property</title>
|
||||
</head>
|
||||
<body>
|
||||
<table cellpadding="1" cellspacing="1" border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<td rowspan="1" colspan="3">hidden-extension-property</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/sessions/new</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>login</td>
|
||||
<td>admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>password</td>
|
||||
<td>admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>commit</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/settings?category=Settings</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertNotText</td>
|
||||
<td>plugins</td>
|
||||
<td>glob:*Hidden*</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>hide-passwords</title>
|
||||
</head>
|
||||
<body>
|
||||
<table cellpadding="1" cellspacing="1" border="1">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/sessions/logout</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/settings?category=Settings</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=login</td>
|
||||
<td>admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=password</td>
|
||||
<td>admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>name=commit</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertText</td>
|
||||
<td>block_password</td>
|
||||
<td>*Default*</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertNotText</td>
|
||||
<td>block_password</td>
|
||||
<td>*Default*sonar*</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>ignore-corrupted-license</title>
|
||||
</head>
|
||||
<body>
|
||||
<table cellpadding="1" cellspacing="1" border="1">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/sessions/logout</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/settings?category=general</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=login</td>
|
||||
<td>admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=password</td>
|
||||
<td>admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>name=commit</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=input_typed.license.secured</td>
|
||||
<td>ABCDE</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>id=submit_settings</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>waitForText</td>
|
||||
<td>block_typed.license.secured</td>
|
||||
<td>*Product*-*Organization*-*Expiration*-*</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
@ -3,7 +3,7 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>create-user</title>
|
||||
<title>property-relocation</title>
|
||||
</head>
|
||||
<body>
|
||||
<table cellpadding="1" cellspacing="1" border="1">
|
||||
@ -15,7 +15,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/users</td>
|
||||
<td>/sonar/settings/index?category=general</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -33,50 +33,15 @@
|
||||
<td>name=commit</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>id=create-link-user</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>waitForVisible</td>
|
||||
<td>user_create_form</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=user_login</td>
|
||||
<td>user</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=user_name</td>
|
||||
<td>Simple User</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=user_password</td>
|
||||
<td>userpwd</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=user_password_confirmation</td>
|
||||
<td>userpwd</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>name=commit</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>waitForVisible</td>
|
||||
<td>info</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertText</td>
|
||||
<td>info</td>
|
||||
<td>*User is created*</td>
|
||||
<td>properties</td>
|
||||
<td>*sonar.newKey*</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertNotText</td>
|
||||
<td>properties</td>
|
||||
<td>*sonar.deprecatedKey*</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>validate-property-type</title>
|
||||
</head>
|
||||
<body>
|
||||
<table cellpadding="1" cellspacing="1" border="1">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/sessions/logout</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/settings?category=Settings</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=login</td>
|
||||
<td>admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=password</td>
|
||||
<td>admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>name=commit</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=input_float</td>
|
||||
<td>abc</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=input_integer</td>
|
||||
<td>123</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>id=submit_settings</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>waitForText</td>
|
||||
<td>properties</td>
|
||||
<td>*Not a floating point number*</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertValue</td>
|
||||
<td>input_integer</td>
|
||||
<td>123</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/settings?category=Settings</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertValue</td>
|
||||
<td>input_float</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1 @@
|
||||
0PZz+G+f8mjr3sPn4+AhHg==
|
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
</head>
|
||||
<body>
|
||||
<table cellpadding="1" cellspacing="1" border="1">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/dashboard/index/myproject.jsp</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertElementPresent</td>
|
||||
<td>dashboard</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
@ -1,124 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>create-user</title>
|
||||
</head>
|
||||
<body>
|
||||
<table cellpadding="1" cellspacing="1" border="1">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/sessions/logout</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/users</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=login</td>
|
||||
<td>admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=password</td>
|
||||
<td>admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>name=commit</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=user_login</td>
|
||||
<td>profileadm</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=user_name</td>
|
||||
<td>Profile Admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=user_password</td>
|
||||
<td>papwd</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=user_password_confirmation</td>
|
||||
<td>papwd</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>name=commit</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>link=Groups</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>id=group_name</td>
|
||||
<td>profile-admins</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>name=commit</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>id=select-profile-admins</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>addSelection</td>
|
||||
<td>id=from</td>
|
||||
<td>label=Profile Admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>id=select_right</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>id=save</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>link=Administrators</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>xpath=(//a[contains(text(),'select')])[4]</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>addSelection</td>
|
||||
<td>id=from</td>
|
||||
<td>label=profile-admins</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>id=select_right</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>id=save</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
@ -3,17 +3,22 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>create_user_with_email</title>
|
||||
<title>system_info</title>
|
||||
</head>
|
||||
<body>
|
||||
<table cellpadding="1" cellspacing="1" border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<td rowspan="1" colspan="3">create_user_with_email</td>
|
||||
<td rowspan="1" colspan="3">system_info</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/sessions/logout</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/sessions/new</td>
|
||||
<td></td>
|
||||
@ -35,48 +40,28 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/users</td>
|
||||
<td>/sonar/system/index</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>id=create-link-user</td>
|
||||
<td></td>
|
||||
<td>assertText</td>
|
||||
<td>sonarqube</td>
|
||||
<td>*Version*.*-SNAPSHOT*</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>waitForVisible</td>
|
||||
<td>user_create_form</td>
|
||||
<td></td>
|
||||
<td>assertText</td>
|
||||
<td>database</td>
|
||||
<td>*Database Version*Pool Active Connections*</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertText</td>
|
||||
<td>system</td>
|
||||
<td>*Start Time*Processors*</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>user_login</td>
|
||||
<td>tester</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>user_name</td>
|
||||
<td>Tester</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>user_email</td>
|
||||
<td>tester@example.org</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>user_password</td>
|
||||
<td>tester</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>user_password_confirmation</td>
|
||||
<td>tester</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>commit</td>
|
||||
<td></td>
|
||||
<td>assertText</td>
|
||||
<td>jvmproperties</td>
|
||||
<td>*java.class.path*java.specification.version*</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>missing_ip</title>
|
||||
</head>
|
||||
<body>
|
||||
<table cellpadding="1" cellspacing="1" border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<td rowspan="1" colspan="3">missing_ip</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/sessions/new</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>login</td>
|
||||
<td>admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>password</td>
|
||||
<td>admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>commit</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/settings/index</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>link=Licenses</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>link=Server ID</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>selectFrame</td>
|
||||
<td>settings_iframe</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>name=organisation</td>
|
||||
<td>DEMO</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>name=address</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>generate-button</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertElementPresent</td>
|
||||
<td>error</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertElementNotPresent</td>
|
||||
<td>server_id</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,89 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>organisation_must_not_accept_special_chars</title>
|
||||
</head>
|
||||
<body>
|
||||
<table cellpadding="1" cellspacing="1" border="1">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/sessions/new</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>login</td>
|
||||
<td>admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>password</td>
|
||||
<td>admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>commit</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/settings/index</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>link=Licenses</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>link=Server ID</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>selectFrame</td>
|
||||
<td>settings_iframe</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>storeText</td>
|
||||
<td>address_0</td>
|
||||
<td>valid_ip</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>name=organisation</td>
|
||||
<td>Name with invalid chars like $</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>name=address</td>
|
||||
<td>${valid_ip}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>generate-button</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertElementPresent</td>
|
||||
<td>error</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertText</td>
|
||||
<td>error</td>
|
||||
<td>*Organisation does not match the required pattern.*</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertElementNotPresent</td>
|
||||
<td>server_id</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,109 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>valid_id</title>
|
||||
</head>
|
||||
<body>
|
||||
<table cellpadding="1" cellspacing="1" border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<td rowspan="1" colspan="3">valid_id</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/sessions/new</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>login</td>
|
||||
<td>admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>password</td>
|
||||
<td>admin</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>commit</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/settings/index</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>link=Licenses</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>link=Server ID</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>waitForElementPresent</td>
|
||||
<td>settings_iframe</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>selectFrame</td>
|
||||
<td>settings_iframe</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>storeText</td>
|
||||
<td>address_0</td>
|
||||
<td>valid_ip</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>name=organisation</td>
|
||||
<td>DEMO</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>name=address</td>
|
||||
<td>${valid_ip}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>generate-button</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertElementPresent</td>
|
||||
<td>server_id</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>storeText</td>
|
||||
<td>server_id</td>
|
||||
<td>server_id</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>selectFrame</td>
|
||||
<td>relative=parent</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>open</td>
|
||||
<td>/sonar/system</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertText</td>
|
||||
<td>sonarqube</td>
|
||||
<td>glob:*Server ID*${server_id}*</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
@ -3,7 +3,7 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>create_user_with_email</title>
|
||||
<title>reate_user_with_email</title>
|
||||
</head>
|
||||
<body>
|
||||
<table cellpadding="1" cellspacing="1" border="1">
|
||||
|
Loading…
Reference in New Issue
Block a user