aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api/src/test/java
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2011-02-26 01:14:52 +0100
committersimonbrandhof <simon.brandhof@gmail.com>2011-02-26 01:14:52 +0100
commit4bb50d01dcb3e31939bb1bdaa646c971664ab7a8 (patch)
tree95f99e3c886f562bfa3e8b984d660f6516756886 /sonar-plugin-api/src/test/java
parenta1473df87a3dedafdf3c5f663caddec1384bea09 (diff)
downloadsonarqube-4bb50d01dcb3e31939bb1bdaa646c971664ab7a8.tar.gz
sonarqube-4bb50d01dcb3e31939bb1bdaa646c971664ab7a8.zip
SONAR-1914 reload measures with PersistenceMode.DATABASE on demand
Diffstat (limited to 'sonar-plugin-api/src/test/java')
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/measures/MeasureTest.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/measures/MeasureTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/measures/MeasureTest.java
index 50f2a329574..6a29f0c1c22 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/measures/MeasureTest.java
+++ b/sonar-plugin-api/src/test/java/org/sonar/api/measures/MeasureTest.java
@@ -114,4 +114,17 @@ public class MeasureTest {
assertFalse(measure.equals(ruleMeasure));
assertFalse(ruleMeasure.equals(measure));
}
+
+ @Test
+ public void shouldUnsetData() {
+ String data = "1=10;21=456";
+ Measure measure = new Measure(CoreMetrics.CONDITIONS_BY_LINE).setData( data);
+ assertThat(measure.hasData(), is(true));
+ assertThat(measure.getData(), is(data));
+
+ measure.unsetData();
+
+ assertThat(measure.hasData(), is(false));
+ assertThat(measure.getData(), nullValue());
+ }
}