aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api/src/test/java/org/sonar/api/profiles/XMLProfileSerializerTest.java
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2012-11-29 14:34:30 +0100
committerJulien Lancelot <julien.lancelot@gmail.com>2012-11-29 14:46:01 +0100
commit26c6766b813955ba662f91a9a7b720b8eb6dd8f4 (patch)
treed1e036514fe6a0bc07c09b5e51978bbb479464da /sonar-plugin-api/src/test/java/org/sonar/api/profiles/XMLProfileSerializerTest.java
parent4457d168a71ca24ba9d33dbbca1f7822ed7a5443 (diff)
downloadsonarqube-26c6766b813955ba662f91a9a7b720b8eb6dd8f4.tar.gz
sonarqube-26c6766b813955ba662f91a9a7b720b8eb6dd8f4.zip
SONAR-1352 alert property "period" should not be mandatory in the different xml exports
Diffstat (limited to 'sonar-plugin-api/src/test/java/org/sonar/api/profiles/XMLProfileSerializerTest.java')
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/profiles/XMLProfileSerializerTest.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/profiles/XMLProfileSerializerTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/profiles/XMLProfileSerializerTest.java
index f54bde9a043..92c5f9c8659 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/profiles/XMLProfileSerializerTest.java
+++ b/sonar-plugin-api/src/test/java/org/sonar/api/profiles/XMLProfileSerializerTest.java
@@ -34,6 +34,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.StringWriter;
import java.io.Writer;
+import java.util.List;
import static org.junit.Assert.assertTrue;
@@ -80,8 +81,11 @@ public class XMLProfileSerializerTest {
public void exportAlerts() throws Exception {
Writer writer = new StringWriter();
RulesProfile profile = RulesProfile.create("sonar way", "java");
- Alert alert = new Alert(profile, new Metric("coverage"), Alert.OPERATOR_SMALLER, "60", "80", 1);
- profile.getAlerts().add(alert);
+ List<Alert> alerts = profile.getAlerts();
+ Alert alert1 = new Alert(profile, new Metric("coverage"), Alert.OPERATOR_SMALLER, "60", "80");
+ alerts.add(alert1);
+ Alert alert2 = new Alert(profile, new Metric("complexity"), Alert.OPERATOR_GREATER, "12", "10", 1);
+ alerts.add(alert2);
new XMLProfileSerializer().write(profile, writer);
assertSimilarXml("exportAlerts.xml", writer.toString());