You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2018/05/18 07:57:44 UTC
[myfaces-tobago] branch master updated: TOBAGO-1899: Error building
tobago 4.2.1 on windows 10
This is an automated email from the ASF dual-hosted git repository.
lofwyr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git
The following commit(s) were added to refs/heads/master by this push:
new 279b25a TOBAGO-1899: Error building tobago 4.2.1 on windows 10
279b25a is described below
commit 279b25a4b8f8acd121650373d52faa860177d3d2
Author: Udo Schnurpfeil <lo...@apache.org>
AuthorDate: Fri May 18 09:48:32 2018 +0200
TOBAGO-1899: Error building tobago 4.2.1 on windows 10
---
.../myfaces/tobago/renderkit/css/CssClassUtils.java | 16 ++++++----------
.../tobago/renderkit/css/TobagoClassUnitTest.java | 4 ++--
2 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/css/CssClassUtils.java b/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/css/CssClassUtils.java
index ae51686..11a7cc8 100644
--- a/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/css/CssClassUtils.java
+++ b/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/css/CssClassUtils.java
@@ -19,27 +19,23 @@
package org.apache.myfaces.tobago.renderkit.css;
-import org.junit.Assert;
-
-import java.io.File;
-import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.nio.charset.Charset;
+import java.nio.file.Files;
+import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
-import java.util.Scanner;
class CssClassUtils {
/**
* Checks, if CSS class names are defined in the file.
*/
- static List<CssItem> compareCss(final String cssFileName, final CssItem[] cssItems) throws FileNotFoundException {
+ static List<CssItem> compareCss(final String cssFileName, final CssItem[] cssItems) throws IOException {
final List<CssItem> missing = new ArrayList<>();
- final File cssFile = new File(cssFileName);
- Assert.assertTrue(cssFile.exists());
-
- final String fileContent = new Scanner(cssFile).useDelimiter("\\Z").next();
+ final String fileContent = new String(Files.readAllBytes(Paths.get(cssFileName)), Charset.forName("UTF-8"));
for (final CssItem cssItem : cssItems) {
if (!containsClassName(fileContent, cssItem.getName())) {
diff --git a/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/css/TobagoClassUnitTest.java b/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/css/TobagoClassUnitTest.java
index 5f0712f..c22067f 100644
--- a/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/css/TobagoClassUnitTest.java
+++ b/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/css/TobagoClassUnitTest.java
@@ -22,7 +22,7 @@ package org.apache.myfaces.tobago.renderkit.css;
import org.junit.Assert;
import org.junit.Test;
-import java.io.FileNotFoundException;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@@ -69,7 +69,7 @@ public class TobagoClassUnitTest {
* This test checks whether every item of the {@link TobagoClass} occurs in the _tobago.scss.
*/
@Test
- public void testCompareTobagoCss() throws FileNotFoundException, NoSuchFieldException {
+ public void testCompareTobagoCss() throws IOException, NoSuchFieldException {
final TobagoClass[] allValues = TobagoClass.values();
final List<TobagoClass> toCheck = new ArrayList<>();
--
To stop receiving notification emails like this one, please contact
lofwyr@apache.org.