aboutsummaryrefslogtreecommitdiffstats
path: root/its/plugin/src/test/java
diff options
context:
space:
mode:
authorElena Vilchik2018-06-27 15:22:56 +0200
committerGitHub2018-06-27 15:22:56 +0200
commitcea9681a811f5bced88e443d5fda14ba15396343 (patch)
tree3746b822ead44cf60de9336e6454770710c76960 /its/plugin/src/test/java
parentbde3e646ffe1b1ba1b513cac042f5c1e379da4ff (diff)
downloadsonar-css-cea9681a811f5bced88e443d5fda14ba15396343.tar.bz2
Exclude minified files (#93)
Diffstat (limited to 'its/plugin/src/test/java')
-rw-r--r--its/plugin/src/test/java/org/sonar/css/its/MinifiedTest.java47
-rw-r--r--its/plugin/src/test/java/org/sonar/css/its/Tests.java4
2 files changed, 49 insertions, 2 deletions
diff --git a/its/plugin/src/test/java/org/sonar/css/its/MinifiedTest.java b/its/plugin/src/test/java/org/sonar/css/its/MinifiedTest.java
new file mode 100644
index 0000000..91580bc
--- /dev/null
+++ b/its/plugin/src/test/java/org/sonar/css/its/MinifiedTest.java
@@ -0,0 +1,47 @@
+/*
+ * SonarCSS
+ * Copyright (C) 2018-2018 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.sonar.css.its;
+
+import com.sonar.orchestrator.Orchestrator;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.sonar.css.its.Tests.getProjectMeasureAsDouble;
+
+public class MinifiedTest {
+
+ private static String PROJECT_KEY = "minified-project";
+
+ @ClassRule
+ public static Orchestrator orchestrator = Tests.ORCHESTRATOR;
+
+ @BeforeClass
+ public static void prepare() {
+ orchestrator.executeBuild(Tests.createScanner(PROJECT_KEY));
+ }
+
+ @Test
+ public void test() {
+ assertThat(getProjectMeasureAsDouble("files", PROJECT_KEY)).isEqualTo(1);
+ }
+
+}
diff --git a/its/plugin/src/test/java/org/sonar/css/its/Tests.java b/its/plugin/src/test/java/org/sonar/css/its/Tests.java
index d94a633..df30c9f 100644
--- a/its/plugin/src/test/java/org/sonar/css/its/Tests.java
+++ b/its/plugin/src/test/java/org/sonar/css/its/Tests.java
@@ -29,7 +29,6 @@ import java.util.List;
import org.junit.ClassRule;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
-import org.sonar.css.plugin.StylelintReport;
import org.sonarqube.ws.Measures.ComponentWsResponse;
import org.sonarqube.ws.Measures.Measure;
import org.sonarqube.ws.client.HttpConnector;
@@ -41,7 +40,8 @@ import org.sonarqube.ws.client.measures.ComponentRequest;
@Suite.SuiteClasses({
MetricsTest.class,
IssuesTest.class,
- StylelintReportTest.class
+ StylelintReportTest.class,
+ MinifiedTest.class
})
public class Tests {