aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api/src/test/java/org/sonar
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2013-03-28 11:45:29 +0100
committerJulien Lancelot <julien.lancelot@gmail.com>2013-03-28 11:45:29 +0100
commit0537460fce472a60f7ea5ba34352fd49f39eb457 (patch)
tree93074043668a3b32bf01cd3a2ca4be2bc44a409e /sonar-plugin-api/src/test/java/org/sonar
parent508b52779e7db39fce96c1d063cc9d487abfc9a5 (diff)
downloadsonarqube-0537460fce472a60f7ea5ba34352fd49f39eb457.tar.gz
sonarqube-0537460fce472a60f7ea5ba34352fd49f39eb457.zip
SONAR-4221 Make it possible for the Views and Developers plugin to define the differential periods 4 and 5
Diffstat (limited to 'sonar-plugin-api/src/test/java/org/sonar')
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/resources/ResourceTypesTest.java25
1 files changed, 15 insertions, 10 deletions
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/resources/ResourceTypesTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/resources/ResourceTypesTest.java
index 440bd1fd60b..b2dddeb572f 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/resources/ResourceTypesTest.java
+++ b/sonar-plugin-api/src/test/java/org/sonar/api/resources/ResourceTypesTest.java
@@ -55,35 +55,35 @@ public class ResourceTypesTest {
}
@Test
- public void getAll() {
+ public void get_all() {
assertThat(qualifiers(types.getAll())).containsOnly(Qualifiers.PROJECT, Qualifiers.DIRECTORY, Qualifiers.FILE, Qualifiers.VIEW, Qualifiers.SUBVIEW);
}
@Test
- public void getRoots() {
+ public void get_roots() {
assertThat(qualifiers(types.getRoots())).containsOnly(Qualifiers.PROJECT, Qualifiers.VIEW);
}
@Test
- public void getAll_predicate() {
+ public void get_all_predicate() {
Collection<ResourceType> forFilters = types.getAll(ResourceTypes.AVAILABLE_FOR_FILTERS);
assertThat(qualifiers(forFilters)).containsOnly(Qualifiers.PROJECT, Qualifiers.VIEW).doesNotHaveDuplicates();
}
@Test
- public void getAllWithPropertyKey() {
+ public void get_all_with_property_key() {
assertThat(qualifiers(types.getAllWithPropertyKey("supportsMeasureFilters"))).containsOnly(Qualifiers.VIEW, Qualifiers.PROJECT);
}
@Test
- public void getAllWithPropertyValue() {
+ public void get_all_with_property_value() {
assertThat(qualifiers(types.getAllWithPropertyValue("supportsMeasureFilters", "true"))).containsOnly(Qualifiers.VIEW, Qualifiers.PROJECT);
assertThat(qualifiers(types.getAllWithPropertyValue("supportsMeasureFilters", true))).containsOnly(Qualifiers.VIEW, Qualifiers.PROJECT);
assertThat(qualifiers(types.getAllWithPropertyValue("supportsMeasureFilters", false))).containsOnly(Qualifiers.SUBVIEW, Qualifiers.DIRECTORY, Qualifiers.FILE);
}
@Test
- public void getChildrenQualifiers() {
+ public void get_children_qualifiers() {
assertThat(types.getChildrenQualifiers(Qualifiers.PROJECT)).containsExactly(Qualifiers.DIRECTORY);
assertThat(types.getChildrenQualifiers(Qualifiers.SUBVIEW)).containsExactly(Qualifiers.PROJECT);
assertThat(types.getChildrenQualifiers("xxx")).isEmpty();
@@ -91,13 +91,13 @@ public class ResourceTypesTest {
}
@Test
- public void getChildren() {
+ public void get_children() {
assertThat(qualifiers(types.getChildren(Qualifiers.PROJECT))).contains(Qualifiers.DIRECTORY);
assertThat(qualifiers(types.getChildren(Qualifiers.SUBVIEW))).contains(Qualifiers.PROJECT);
}
@Test
- public void getLeavesQualifiers() {
+ public void get_leaves_qualifiers() {
assertThat(types.getLeavesQualifiers(Qualifiers.PROJECT)).containsExactly(Qualifiers.FILE);
assertThat(types.getLeavesQualifiers(Qualifiers.DIRECTORY)).containsExactly(Qualifiers.FILE);
@@ -108,13 +108,18 @@ public class ResourceTypesTest {
}
@Test
- public void getTree() {
+ public void get_tree() {
assertThat(qualifiers(types.getTree(Qualifiers.VIEW).getTypes())).containsOnly(Qualifiers.VIEW, Qualifiers.SUBVIEW).doesNotHaveDuplicates();
assertThat(types.getTree("xxx")).isNull();
}
+ @Test
+ public void get_root() {
+ assertThat(types.getRoot(Qualifiers.FILE).getQualifier()).isEqualTo(Qualifiers.PROJECT);
+ }
+
@Test(expected = IllegalStateException.class)
- public void failOnDuplicatedQualifier() {
+ public void fail_on_duplicated_qualifier() {
ResourceTypeTree tree1 = ResourceTypeTree.builder()
.addType(ResourceType.builder("foo").build())
.build();