aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src/test
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2011-03-02 14:49:14 +0100
committersimonbrandhof <simon.brandhof@gmail.com>2011-03-02 14:49:14 +0100
commit3635c6c5f851ebbc6ca3e3a11f4f687570884d6e (patch)
tree52319abb38679afd2355107f35f61275a40cd184 /sonar-server/src/test
parent81a28a44dde692fd30f2f2196ace32bff229f892 (diff)
downloadsonarqube-3635c6c5f851ebbc6ca3e3a11f4f687570884d6e.tar.gz
sonarqube-3635c6c5f851ebbc6ca3e3a11f4f687570884d6e.zip
SONAR-2218 display headers of source, coverage and violations tabs
Diffstat (limited to 'sonar-server/src/test')
-rw-r--r--sonar-server/src/test/java/org/sonar/server/ui/ViewsTest.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/sonar-server/src/test/java/org/sonar/server/ui/ViewsTest.java b/sonar-server/src/test/java/org/sonar/server/ui/ViewsTest.java
index b05a115d532..c1930b2e136 100644
--- a/sonar-server/src/test/java/org/sonar/server/ui/ViewsTest.java
+++ b/sonar-server/src/test/java/org/sonar/server/ui/ViewsTest.java
@@ -32,12 +32,16 @@ import java.util.List;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.core.IsNull.nullValue;
import static org.junit.Assert.assertThat;
+import static org.junit.matchers.JUnitMatchers.hasItem;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public class ViewsTest {
- private static final View[] VIEWS = {new FakePage(), new FakeResourceViewer(), new FakeWidget()};
+ private static FakeResourceViewer FAKE_TAB = new FakeResourceViewer();
+ private static FakeWidget FAKE_WIDGET = new FakeWidget();
+ private static FakePage FAKE_PAGE = new FakePage();
+ private static final View[] VIEWS = {FAKE_PAGE, FAKE_TAB, FAKE_WIDGET};
@Test
public void getPageById() {
@@ -63,9 +67,9 @@ public class ViewsTest {
@Test
public void getResourceViewers() {
final Views views = new Views(VIEWS);
- List<ViewProxy<Page>> resourceViewers = views.getPages(NavigationSection.RESOURCE_TAB);
- assertThat(resourceViewers.size(), is(1));
- assertThat(resourceViewers.get(0).getTarget(), is(FakeResourceViewer.class));
+ List resourceViewers = views.getPages(NavigationSection.RESOURCE_TAB);
+ assertThat(resourceViewers.size(), is(1 + 3 /* default */));
+ assertThat(resourceViewers.contains(new ViewProxy((View)FAKE_TAB)), is(true));
}
@Test