aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGodin <mandrikov@gmail.com>2010-11-01 23:21:03 +0000
committerGodin <mandrikov@gmail.com>2010-11-01 23:21:03 +0000
commitbb56d58e1583a1066e3e0fd5f156de9b1af10986 (patch)
treed967376c49a029fa7295cb6ee3d08824cdcddb50
parentf4a655bb737d89ee8503b63ec0eecd01ef9402c3 (diff)
downloadsonarqube-bb56d58e1583a1066e3e0fd5f156de9b1af10986.tar.gz
sonarqube-bb56d58e1583a1066e3e0fd5f156de9b1af10986.zip
SONAR-1772: Add integration test
-rw-r--r--tests/integration/tests/maven-projects/SONAR-1772/pom.xml26
-rw-r--r--tests/integration/tests/maven-projects/SONAR-1772/src/main/java/org/sonar/tests/Hello.java17
-rw-r--r--tests/integration/tests/src/it/selenium/SONAR-1772.html57
3 files changed, 100 insertions, 0 deletions
diff --git a/tests/integration/tests/maven-projects/SONAR-1772/pom.xml b/tests/integration/tests/maven-projects/SONAR-1772/pom.xml
new file mode 100644
index 00000000000..c03659a65d7
--- /dev/null
+++ b/tests/integration/tests/maven-projects/SONAR-1772/pom.xml
@@ -0,0 +1,26 @@
+<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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.sonar.tests</groupId>
+ <artifactId>findbugs</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+ <name>[SONAR-1772]</name>
+ <description>see http://jira.codehaus.org/browse/SONAR-1772</description>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <properties>
+ <sonar.profile>Sonar way with Findbugs</sonar.profile>
+ </properties>
+</project>
diff --git a/tests/integration/tests/maven-projects/SONAR-1772/src/main/java/org/sonar/tests/Hello.java b/tests/integration/tests/maven-projects/SONAR-1772/src/main/java/org/sonar/tests/Hello.java
new file mode 100644
index 00000000000..4591cf3649a
--- /dev/null
+++ b/tests/integration/tests/maven-projects/SONAR-1772/src/main/java/org/sonar/tests/Hello.java
@@ -0,0 +1,17 @@
+package org.sonar.tests;
+
+import java.io.IOException;
+import java.io.LineNumberReader;
+import java.io.Reader;
+
+public final class Hello {
+ private final LineNumberReader reader;
+
+ public Hello(Reader r) {
+ this.reader = new LineNumberReader(r);
+ }
+
+ public String[] readTokens() throws IOException {
+ return reader.readLine().split("\\|"); // Dodgy - Dereference of the result of readLine() without nullcheck
+ }
+}
diff --git a/tests/integration/tests/src/it/selenium/SONAR-1772.html b/tests/integration/tests/src/it/selenium/SONAR-1772.html
new file mode 100644
index 00000000000..6cc3947287d
--- /dev/null
+++ b/tests/integration/tests/src/it/selenium/SONAR-1772.html
@@ -0,0 +1,57 @@
+<?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" />
+<link rel="selenium.base" href="http://localhost:9000/" />
+<title>SONAR-1772</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">SONAR-1772</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/project/index/org.sonar.tests:findbugs</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertTextPresent</td>
+ <td>profile Sonar way with Findbugs</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>m_violations</td>
+ <td>1</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>m_critical_violations</td>
+ <td>1</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>m_major_violations</td>
+ <td>0</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>m_minor_violations</td>
+ <td>0</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>m_blocker_violations</td>
+ <td>0</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>m_info_violations</td>
+ <td>0</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>