From 779eb8f0c2ea746d1310e7c8ae4b9db66ff6ac07 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Vilain Date: Thu, 11 Apr 2013 18:26:42 +0200 Subject: [PATCH] SONAR-4255 Dropped syntax highlighting support in source viewer WS --- .../sonar/wsclient/services/SourceQuery.java | 17 ----------------- .../wsclient/services/SourceQueryTest.java | 11 ++--------- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/SourceQuery.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/SourceQuery.java index eac8e842bcc..a7db8f4876d 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/SourceQuery.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/SourceQuery.java @@ -25,7 +25,6 @@ public class SourceQuery extends Query { private String resourceKeyOrId; private int from = 0; private int to = 0; - private boolean highlightedSyntax = false; public SourceQuery(String resourceKeyOrId) { this.resourceKeyOrId = resourceKeyOrId; @@ -66,15 +65,6 @@ public class SourceQuery extends Query { return to; } - public boolean isHighlightedSyntax() { - return highlightedSyntax; - } - - public SourceQuery setHighlightedSyntax(boolean b) { - this.highlightedSyntax = b; - return this; - } - @Override public String getUrl() { StringBuilder url = new StringBuilder(BASE_URL); @@ -83,9 +73,6 @@ public class SourceQuery extends Query { if (from > 0 && to > 0) { url.append("from=").append(from).append("&to=").append(to).append("&"); } - if (highlightedSyntax) { - url.append("color=true&"); - } return url.toString(); } @@ -97,8 +84,4 @@ public class SourceQuery extends Query { public static SourceQuery create(String resourceKeyOrId) { return new SourceQuery(resourceKeyOrId); } - - public static SourceQuery createWithHighlightedSyntax(String resourceKeyOrId) { - return new SourceQuery(resourceKeyOrId).setHighlightedSyntax(true); - } } diff --git a/sonar-ws-client/src/test/java/org/sonar/wsclient/services/SourceQueryTest.java b/sonar-ws-client/src/test/java/org/sonar/wsclient/services/SourceQueryTest.java index 3ad9dd84130..35385de5ba1 100644 --- a/sonar-ws-client/src/test/java/org/sonar/wsclient/services/SourceQueryTest.java +++ b/sonar-ws-client/src/test/java/org/sonar/wsclient/services/SourceQueryTest.java @@ -19,11 +19,11 @@ */ package org.sonar.wsclient.services; +import org.junit.Test; + import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertThat; -import org.junit.Test; - public class SourceQueryTest extends QueryTestCase { @Test @@ -32,13 +32,6 @@ public class SourceQueryTest extends QueryTestCase { assertThat(SourceQuery.create("myproject:org.foo.Bar").getModelClass().getName(), is(Source.class.getName())); } - @Test - public void createWithHighlightedSyntax() { - assertThat(SourceQuery.createWithHighlightedSyntax("myproject:org.foo.Bar").getUrl(), - is("/api/sources?resource=myproject%3Aorg.foo.Bar&color=true&")); - assertThat(SourceQuery.createWithHighlightedSyntax("myproject:org.foo.Bar").getModelClass().getName(), is(Source.class.getName())); - } - @Test public void getOnlyAFewLines() { assertThat(SourceQuery.create("myproject:org.foo.Bar").setFromLineToLine(10, 30).getUrl(), -- 2.39.5