]> source.dussan.org Git - sonarqube.git/commitdiff
Migrate EncodingTest IT
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Mon, 15 Feb 2016 08:12:05 +0000 (09:12 +0100)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Mon, 15 Feb 2016 14:20:24 +0000 (15:20 +0100)
it/it-projects/sourceCode/japanese-charset/sonar-project.properties [new file with mode: 0644]
it/it-projects/sourceCode/japanese-charset/src/main/xoo/com/test/App.xoo [new file with mode: 0644]
it/it-projects/sourceCode/japanese-charset/src/main/xoo/com/test/App.xoo.measures [new file with mode: 0644]
it/it-projects/sourceCode/japanese-charset/src/main/xoo/com/test/AppCpdBug.xoo [new file with mode: 0644]
it/it-projects/sourceCode/japanese-charset/src/main/xoo/com/test/AppCpdBug.xoo.measures [new file with mode: 0644]
it/it-projects/sourceCode/japanese-charset/src/main/xoo/com/test/AppDuplication.xoo [new file with mode: 0644]
it/it-projects/sourceCode/japanese-charset/src/main/xoo/com/test/AppDuplication.xoo.measures [new file with mode: 0644]
it/it-tests/src/test/java/it/Category1Suite.java
it/it-tests/src/test/java/it/sourceCode/EncodingTest.java [new file with mode: 0644]
it/it-tests/src/test/resources/sourceCode/EncodingTest/japanese_sources.html [new file with mode: 0644]

diff --git a/it/it-projects/sourceCode/japanese-charset/sonar-project.properties b/it/it-projects/sourceCode/japanese-charset/sonar-project.properties
new file mode 100644 (file)
index 0000000..3c21994
--- /dev/null
@@ -0,0 +1,6 @@
+sonar.projectKey=japanese-charset
+sonar.projectName=Japanese charset
+sonar.projectVersion=1.0-SNAPSHOT
+sonar.sources=src/main/xoo
+sonar.language=xoo
+sonar.sourceEncoding=Shift_JIS
diff --git a/it/it-projects/sourceCode/japanese-charset/src/main/xoo/com/test/App.xoo b/it/it-projects/sourceCode/japanese-charset/src/main/xoo/com/test/App.xoo
new file mode 100644 (file)
index 0000000..5496fec
--- /dev/null
@@ -0,0 +1,75 @@
+package com.test;
+
+import java.io.PrintWriter;
+
+/**
+ * Hello world!
+ *
+ */
+public class App
+{
+    /**
+     * \92\8a\8fÛ\83N\83\89\83X\82ð\93±\93ü
+     * 
+     * 
+     * 
+    */
+    public static void main( String[] args )
+    {
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        int d1;
+        int d2;
+        int d3;
+        int d4;
+        int d5;
+        int d6;
+        int d7;
+        int d8;
+        int d9;
+        int d10;
+    }
+    
+    public void test(PrintWriter pw) {
+      pw.print( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+    }
+    
+    public void \83n\83\8d\81[\83\8f\81[\83\8b\83h() {
+      System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+    }
+}
diff --git a/it/it-projects/sourceCode/japanese-charset/src/main/xoo/com/test/App.xoo.measures b/it/it-projects/sourceCode/japanese-charset/src/main/xoo/com/test/App.xoo.measures
new file mode 100644 (file)
index 0000000..0478fb1
--- /dev/null
@@ -0,0 +1 @@
+ncloc:76
diff --git a/it/it-projects/sourceCode/japanese-charset/src/main/xoo/com/test/AppCpdBug.xoo b/it/it-projects/sourceCode/japanese-charset/src/main/xoo/com/test/AppCpdBug.xoo
new file mode 100644 (file)
index 0000000..61a27c9
--- /dev/null
@@ -0,0 +1,43 @@
+package com.test;
+
+/**
+ * Hello world!
+ *
+ */
+public class AppCpdBug 
+{
+    /**
+     * \92\8a\8fÛ\83N\83\89\83X\82ð\93±\93ü
+     * 
+     * 
+     * 
+    */
+    public static void main( String[] args )
+    {
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        int d1;
+        int d2;
+        int d3;
+        int d4;
+        int d5;
+        int d6;
+        int d7;
+        int d8;
+        int d9;
+        int d10;
+    }
+}
diff --git a/it/it-projects/sourceCode/japanese-charset/src/main/xoo/com/test/AppCpdBug.xoo.measures b/it/it-projects/sourceCode/japanese-charset/src/main/xoo/com/test/AppCpdBug.xoo.measures
new file mode 100644 (file)
index 0000000..9fd6244
--- /dev/null
@@ -0,0 +1 @@
+ncloc:44
diff --git a/it/it-projects/sourceCode/japanese-charset/src/main/xoo/com/test/AppDuplication.xoo b/it/it-projects/sourceCode/japanese-charset/src/main/xoo/com/test/AppDuplication.xoo
new file mode 100644 (file)
index 0000000..f69e98c
--- /dev/null
@@ -0,0 +1,65 @@
+package com.test;
+
+/**
+ * Hello world!
+ *
+ */
+public class AppDuplication 
+{
+    /**
+     * \92\8a\8fÛ\83N\83\89\83X\82ð\93±\93ü
+     * 
+     * 
+     * 
+    */
+    public static void main( String[] args )
+    {
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println( "\83n\83\8d\81[\83\8f\81[\83\8b\83h!" );
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        System.out.println("\8fØ\96¾\8f\91\83p\83X\8d\\92z\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B");
+        int d1;
+        int d2;
+        int d3;
+        int d4;
+        int d5;
+        int d6;
+        int d7;
+        int d8;
+        int d9;
+        int d10;
+    }
+}
diff --git a/it/it-projects/sourceCode/japanese-charset/src/main/xoo/com/test/AppDuplication.xoo.measures b/it/it-projects/sourceCode/japanese-charset/src/main/xoo/com/test/AppDuplication.xoo.measures
new file mode 100644 (file)
index 0000000..aad53b8
--- /dev/null
@@ -0,0 +1 @@
+ncloc:66
index a81080064be76f2a4021f42e326f003d3a7f52ce..06bd1bb8598f15ce146aa5c87551045c6e4f944d 100644 (file)
@@ -69,6 +69,7 @@ import it.qualityGate.QualityGateUiTest;
 import it.settings.PropertySetsTest;
 import it.settings.SettingsTest;
 import it.settings.SubCategoriesTest;
+import it.sourceCode.EncodingTest;
 import org.junit.ClassRule;
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite;
@@ -91,6 +92,7 @@ import static util.ItUtils.xooPlugin;
   ProjectComparisonTest.class,
   AllProjectsTest.class,
   ProjectWidgetsTest.class,
+  EncodingTest.class,
   // settings
   PropertySetsTest.class,
   SubCategoriesTest.class,
diff --git a/it/it-tests/src/test/java/it/sourceCode/EncodingTest.java b/it/it-tests/src/test/java/it/sourceCode/EncodingTest.java
new file mode 100644 (file)
index 0000000..acee93c
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2016 SonarSource SA
+ * mailto:contact 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 it.sourceCode;
+
+import com.sonar.orchestrator.Orchestrator;
+import com.sonar.orchestrator.selenium.Selenese;
+import it.Category1Suite;
+import org.junit.Before;
+import org.junit.ClassRule;
+import org.junit.Test;
+
+import static util.ItUtils.runProjectAnalysis;
+
+public class EncodingTest {
+
+  @ClassRule
+  public static Orchestrator orchestrator = Category1Suite.ORCHESTRATOR;
+
+  @Before
+  public void deleteData() {
+    orchestrator.resetData();
+  }
+
+  @Test
+  public void support_japanese_charset() {
+    runProjectAnalysis(orchestrator, "sourceCode/japanese-charset", "sonar.sourceEncoding", "Shift_JIS");
+
+    Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("java-japanese-charset",
+      "/sourceCode/EncodingTest/japanese_sources.html").build();
+    orchestrator.executeSelenese(selenese);
+  }
+}
diff --git a/it/it-tests/src/test/resources/sourceCode/EncodingTest/japanese_sources.html b/it/it-tests/src/test/resources/sourceCode/EncodingTest/japanese_sources.html
new file mode 100644 (file)
index 0000000..830afd8
--- /dev/null
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+  <title>japanese_sources</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+  <thead>
+  <tr>
+    <td rowspan="1" colspan="3">japanese_sources</td>
+  </tr>
+  </thead>
+  <tbody>
+  <tr>
+       <td>open</td>
+       <td>/component/index?id=japanese-charset%3Asrc%2Fmain%2Fxoo%2Fcom%2Ftest%2FAppDuplication.xoo</td>
+       <td></td>
+</tr>
+<tr>
+       <td>waitForElementPresent</td>
+       <td>css=.source-viewer</td>
+       <td></td>
+</tr>
+<tr>
+       <td>waitForText</td>
+       <td>css=.source-table</td>
+       <td>glob:*public class AppDuplication*</td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>css=.source-table</td>
+       <td>glob:*証明書パス構築に失敗しました。*</td>
+</tr>
+</tbody>
+</table>
+</body>
+</html>