]> source.dussan.org Git - vaadin-framework.git/commitdiff
Move some SCSS tests to be scanned automatically 01/401/1
authorHenri Sara <hesara@vaadin.com>
Tue, 27 Nov 2012 09:14:57 +0000 (11:14 +0200)
committerHenri Sara <hesara@vaadin.com>
Tue, 27 Nov 2012 09:14:57 +0000 (11:14 +0200)
Change-Id: I7590c6cd20f649a5c02e92673d44cf1c2721b95d

21 files changed:
theme-compiler/tests/resources/automatic/css/listmodify.css [new file with mode: 0644]
theme-compiler/tests/resources/automatic/css/microsoft-extensions.css [new file with mode: 0644]
theme-compiler/tests/resources/automatic/css/remove-directive.css [new file with mode: 0644]
theme-compiler/tests/resources/automatic/css/semicolons.css [new file with mode: 0644]
theme-compiler/tests/resources/automatic/scss/listmodify.scss [new file with mode: 0644]
theme-compiler/tests/resources/automatic/scss/microsoft-extensions.scss [new file with mode: 0644]
theme-compiler/tests/resources/automatic/scss/remove-directive.scss [new file with mode: 0644]
theme-compiler/tests/resources/automatic/scss/semicolons.scss [new file with mode: 0644]
theme-compiler/tests/resources/css/listmodify.css [deleted file]
theme-compiler/tests/resources/css/microsoft-extensions.css [deleted file]
theme-compiler/tests/resources/css/remove-directive.css [deleted file]
theme-compiler/tests/resources/css/semicolons.css [deleted file]
theme-compiler/tests/resources/scss/listmodify.scss [deleted file]
theme-compiler/tests/resources/scss/microsoft-extensions.scss [deleted file]
theme-compiler/tests/resources/scss/remove-directive.scss [deleted file]
theme-compiler/tests/resources/scss/semicolons.scss [deleted file]
theme-compiler/tests/src/com/vaadin/sass/testcases/scss/AutomaticSassTests.java [new file with mode: 0644]
theme-compiler/tests/src/com/vaadin/sass/testcases/scss/ListModify.java [deleted file]
theme-compiler/tests/src/com/vaadin/sass/testcases/scss/MicrosoftExtensions.java [deleted file]
theme-compiler/tests/src/com/vaadin/sass/testcases/scss/RemoveDirective.java [deleted file]
theme-compiler/tests/src/com/vaadin/sass/testcases/scss/Semicolons.java [deleted file]

diff --git a/theme-compiler/tests/resources/automatic/css/listmodify.css b/theme-compiler/tests/resources/automatic/css/listmodify.css
new file mode 100644 (file)
index 0000000..b07d5d9
--- /dev/null
@@ -0,0 +1,23 @@
+.v-button {
+       font-size: 12px;
+}
+
+.v-label {
+       font-size: 12px;
+}
+
+.v-button {
+       font-color: red;
+}
+
+.v-label {
+       font-color: red;
+}
+
+.v-textfield {
+       font-color: red;
+}
+
+.v-button {
+       background-color: black;
+}
\ No newline at end of file
diff --git a/theme-compiler/tests/resources/automatic/css/microsoft-extensions.css b/theme-compiler/tests/resources/automatic/css/microsoft-extensions.css
new file mode 100644 (file)
index 0000000..18bc34c
--- /dev/null
@@ -0,0 +1,6 @@
+.v-ie6 .v-shadow-window {
+       background: #000000;
+       filter: progid:DXImageTransform.Microsoft.Blur(pixelRadius=5 ) alpha(opacity = 20);
+       margin-top: 2px;
+       margin-left: 2px;
+}
\ No newline at end of file
diff --git a/theme-compiler/tests/resources/automatic/css/remove-directive.css b/theme-compiler/tests/resources/automatic/css/remove-directive.css
new file mode 100644 (file)
index 0000000..1e6d41c
--- /dev/null
@@ -0,0 +1,39 @@
+.animals .platypus-icon {
+       background-image: url('/images/platypus.png');
+}
+
+.animals .rhinoceros-icon {
+       background-image: url('/images/rhinoceros.png');
+}
+
+.animals .llama-icon {
+       background-image: url('/images/llama.png');
+}
+
+.animals .duck-icon {
+       background-image: url('/images/duck.png');
+}
+
+.animals .duck-icon {
+       background-image: url('/images/duck.png');
+}
+
+.exotic-animals .platypus-icon {
+       background-image: url('/images/platypus.png');
+}
+
+.exotic-animals .rhinoceros-icon {
+       background-image: url('/images/rhinoceros.png');
+}
+
+.exotic-animals .llama-icon {
+       background-image: url('/images/llama.png');
+}
+
+.ball {
+       font-size: 12px;
+}
+
+.cube {
+       font-size: 12px;
+}
\ No newline at end of file
diff --git a/theme-compiler/tests/resources/automatic/css/semicolons.css b/theme-compiler/tests/resources/automatic/css/semicolons.css
new file mode 100644 (file)
index 0000000..ba28e8c
--- /dev/null
@@ -0,0 +1,10 @@
+.all-the-properties {
+       font-family: Arial, Helvetica, "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
+       position: absolute;
+       overflow: hidden;
+}
+
+.missing-semicolon-on-last-row {
+       color: red;
+       background-color: blue;
+}
\ No newline at end of file
diff --git a/theme-compiler/tests/resources/automatic/scss/listmodify.scss b/theme-compiler/tests/resources/automatic/scss/listmodify.scss
new file mode 100644 (file)
index 0000000..814f315
--- /dev/null
@@ -0,0 +1,25 @@
+$list : .v-button, .v-panel, .v-label;
+
+$basics : remove($list, .v-panel);
+
+@each $component in $basics{
+       .#{$component} {
+               font-size: 12px;
+       }
+}
+
+$items : append($basics, .v-textfield);
+
+@each $component in $items{
+       .#{$component} {
+               font-color: red;
+       }
+}
+
+$contains : contains($items, .v-button);
+
+@if($contains){
+       .v-button {
+               background-color: black;
+       }
+}
diff --git a/theme-compiler/tests/resources/automatic/scss/microsoft-extensions.scss b/theme-compiler/tests/resources/automatic/scss/microsoft-extensions.scss
new file mode 100644 (file)
index 0000000..6967096
--- /dev/null
@@ -0,0 +1,6 @@
+.v-ie6 .v-shadow-window {
+       background: #000000;
+       filter: progid:DXImageTransform.Microsoft.Blur(pixelRadius=5 ) alpha(opacity = 20);
+       margin-top: 2px;
+       margin-left: 2px;
+}
diff --git a/theme-compiler/tests/resources/automatic/scss/remove-directive.scss b/theme-compiler/tests/resources/automatic/scss/remove-directive.scss
new file mode 100644 (file)
index 0000000..ca9a195
--- /dev/null
@@ -0,0 +1,24 @@
+$animals : platypus, rhinoceros, llama, duck, duck;
+$remove : duck;
+
+@each $animal in $animals {
+       .animals .#{$animal}-icon {
+               background-image: url('/images/#{$animal}.png');
+       }
+}
+
+$exotic : remove($animals, $remove, space);
+
+@each $animal in $exotic{
+       .exotic-animals .#{$animal}-icon {
+               background-image: url('/images/#{$animal}.png');
+       }
+}
+
+$things : remove((ball,cube,duck), duck); 
+
+@each $thing in $things{
+       .#{$thing}{
+               font-size: 12px;
+       }
+}
\ No newline at end of file
diff --git a/theme-compiler/tests/resources/automatic/scss/semicolons.scss b/theme-compiler/tests/resources/automatic/scss/semicolons.scss
new file mode 100644 (file)
index 0000000..a4a5604
--- /dev/null
@@ -0,0 +1,9 @@
+.all-the-properties {
+       font-family: Arial, Helvetica, "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; ;
+       position: absolute;;
+       overflow: hidden;
+}
+.missing-semicolon-on-last-row {
+       color: red;
+       background-color: blue
+}
diff --git a/theme-compiler/tests/resources/css/listmodify.css b/theme-compiler/tests/resources/css/listmodify.css
deleted file mode 100644 (file)
index b07d5d9..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-.v-button {
-       font-size: 12px;
-}
-
-.v-label {
-       font-size: 12px;
-}
-
-.v-button {
-       font-color: red;
-}
-
-.v-label {
-       font-color: red;
-}
-
-.v-textfield {
-       font-color: red;
-}
-
-.v-button {
-       background-color: black;
-}
\ No newline at end of file
diff --git a/theme-compiler/tests/resources/css/microsoft-extensions.css b/theme-compiler/tests/resources/css/microsoft-extensions.css
deleted file mode 100644 (file)
index 18bc34c..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-.v-ie6 .v-shadow-window {
-       background: #000000;
-       filter: progid:DXImageTransform.Microsoft.Blur(pixelRadius=5 ) alpha(opacity = 20);
-       margin-top: 2px;
-       margin-left: 2px;
-}
\ No newline at end of file
diff --git a/theme-compiler/tests/resources/css/remove-directive.css b/theme-compiler/tests/resources/css/remove-directive.css
deleted file mode 100644 (file)
index 1e6d41c..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-.animals .platypus-icon {
-       background-image: url('/images/platypus.png');
-}
-
-.animals .rhinoceros-icon {
-       background-image: url('/images/rhinoceros.png');
-}
-
-.animals .llama-icon {
-       background-image: url('/images/llama.png');
-}
-
-.animals .duck-icon {
-       background-image: url('/images/duck.png');
-}
-
-.animals .duck-icon {
-       background-image: url('/images/duck.png');
-}
-
-.exotic-animals .platypus-icon {
-       background-image: url('/images/platypus.png');
-}
-
-.exotic-animals .rhinoceros-icon {
-       background-image: url('/images/rhinoceros.png');
-}
-
-.exotic-animals .llama-icon {
-       background-image: url('/images/llama.png');
-}
-
-.ball {
-       font-size: 12px;
-}
-
-.cube {
-       font-size: 12px;
-}
\ No newline at end of file
diff --git a/theme-compiler/tests/resources/css/semicolons.css b/theme-compiler/tests/resources/css/semicolons.css
deleted file mode 100644 (file)
index ba28e8c..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-.all-the-properties {
-       font-family: Arial, Helvetica, "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
-       position: absolute;
-       overflow: hidden;
-}
-
-.missing-semicolon-on-last-row {
-       color: red;
-       background-color: blue;
-}
\ No newline at end of file
diff --git a/theme-compiler/tests/resources/scss/listmodify.scss b/theme-compiler/tests/resources/scss/listmodify.scss
deleted file mode 100644 (file)
index 814f315..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-$list : .v-button, .v-panel, .v-label;
-
-$basics : remove($list, .v-panel);
-
-@each $component in $basics{
-       .#{$component} {
-               font-size: 12px;
-       }
-}
-
-$items : append($basics, .v-textfield);
-
-@each $component in $items{
-       .#{$component} {
-               font-color: red;
-       }
-}
-
-$contains : contains($items, .v-button);
-
-@if($contains){
-       .v-button {
-               background-color: black;
-       }
-}
diff --git a/theme-compiler/tests/resources/scss/microsoft-extensions.scss b/theme-compiler/tests/resources/scss/microsoft-extensions.scss
deleted file mode 100644 (file)
index 6967096..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-.v-ie6 .v-shadow-window {
-       background: #000000;
-       filter: progid:DXImageTransform.Microsoft.Blur(pixelRadius=5 ) alpha(opacity = 20);
-       margin-top: 2px;
-       margin-left: 2px;
-}
diff --git a/theme-compiler/tests/resources/scss/remove-directive.scss b/theme-compiler/tests/resources/scss/remove-directive.scss
deleted file mode 100644 (file)
index ca9a195..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-$animals : platypus, rhinoceros, llama, duck, duck;
-$remove : duck;
-
-@each $animal in $animals {
-       .animals .#{$animal}-icon {
-               background-image: url('/images/#{$animal}.png');
-       }
-}
-
-$exotic : remove($animals, $remove, space);
-
-@each $animal in $exotic{
-       .exotic-animals .#{$animal}-icon {
-               background-image: url('/images/#{$animal}.png');
-       }
-}
-
-$things : remove((ball,cube,duck), duck); 
-
-@each $thing in $things{
-       .#{$thing}{
-               font-size: 12px;
-       }
-}
\ No newline at end of file
diff --git a/theme-compiler/tests/resources/scss/semicolons.scss b/theme-compiler/tests/resources/scss/semicolons.scss
deleted file mode 100644 (file)
index a4a5604..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-.all-the-properties {
-       font-family: Arial, Helvetica, "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; ;
-       position: absolute;;
-       overflow: hidden;
-}
-.missing-semicolon-on-last-row {
-       color: red;
-       background-color: blue
-}
diff --git a/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/AutomaticSassTests.java b/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/AutomaticSassTests.java
new file mode 100644 (file)
index 0000000..1e5ec1a
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2011 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.sass.testcases.scss;
+
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.Collection;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+@RunWith(Parameterized.class)
+public class AutomaticSassTests extends AbstractDirectoryScanningSassTests {
+
+    public AutomaticSassTests(String scssResourceName) {
+        super(scssResourceName);
+    }
+
+    @Override
+    protected URL getResourceURL(String path) {
+        return getResourceURLInternal(path);
+    }
+
+    private static URL getResourceURLInternal(String path) {
+        return AutomaticSassTests.class.getResource("/automatic" + path);
+    }
+
+    @Parameters
+    public static Collection<Object[]> getScssResourceNames()
+            throws URISyntaxException {
+        return getScssResourceNames(getResourceURLInternal(""));
+    }
+
+}
diff --git a/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/ListModify.java b/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/ListModify.java
deleted file mode 100644 (file)
index 4a65591..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.vaadin.sass.testcases.scss;
-
-import org.junit.Test;
-
-import com.vaadin.sass.AbstractTestBase;
-
-public class ListModify extends AbstractTestBase {
-
-    String scss = "/scss/listmodify.scss";
-    String css = "/css/listmodify.css";
-
-    @Test
-    public void testCompiler() throws Exception {
-        testCompiler(scss, css);
-    }
-
-}
diff --git a/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/MicrosoftExtensions.java b/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/MicrosoftExtensions.java
deleted file mode 100644 (file)
index 5460700..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2011 Vaadin Ltd.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.vaadin.sass.testcases.scss;
-
-import org.junit.Test;
-
-import com.vaadin.sass.AbstractTestBase;
-
-/**
- * Test for Microsoft specific CSS extensions.
- */
-public class MicrosoftExtensions extends AbstractTestBase {
-    String scss = "/scss/microsoft-extensions.scss";
-    String css = "/css/microsoft-extensions.css";
-
-    @Test
-    public void testCompiler() throws Exception {
-        testCompiler(scss, css);
-    }
-}
diff --git a/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/RemoveDirective.java b/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/RemoveDirective.java
deleted file mode 100644 (file)
index e9e87e7..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.vaadin.sass.testcases.scss;
-
-import java.io.IOException;
-
-import org.junit.Test;
-import org.w3c.css.sac.CSSException;
-
-import com.vaadin.sass.AbstractTestBase;
-
-public class RemoveDirective extends AbstractTestBase {
-
-    String scss = "/scss/remove-directive.scss";
-    String css = "/css/remove-directive.css";
-
-    @Test
-    public void testParser() throws CSSException, IOException {
-
-    }
-
-    @Test
-    public void testCompiler() throws Exception {
-        testCompiler(scss, css);
-    }
-
-}
diff --git a/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/Semicolons.java b/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/Semicolons.java
deleted file mode 100644 (file)
index 9dd8a38..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2011 Vaadin Ltd.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.vaadin.sass.testcases.scss;
-
-import org.junit.Test;
-
-import com.vaadin.sass.AbstractTestBase;
-
-/**
- * Test for missing and extraneous semicolon handling.
- */
-public class Semicolons extends AbstractTestBase {
-    String scss = "/scss/semicolons.scss";
-    String css = "/css/semicolons.css";
-
-    @Test
-    public void testCompiler() throws Exception {
-        testCompiler(scss, css);
-    }
-}