]> source.dussan.org Git - sonarqube.git/commitdiff
improve integration tests: rename the reference plugin with standard convention of...
authorsimonbrandhof <simon.brandhof@gmail.com>
Mon, 8 Nov 2010 15:10:44 +0000 (15:10 +0000)
committersimonbrandhof <simon.brandhof@gmail.com>
Mon, 8 Nov 2010 15:10:44 +0000 (15:10 +0000)
39 files changed:
tests/integration/pom.xml
tests/integration/reference-plugin/pom.xml [deleted file]
tests/integration/reference-plugin/src/main/java/itests/ITestsPlugin.java [deleted file]
tests/integration/reference-plugin/src/main/java/itests/SampleSensor.java [deleted file]
tests/integration/reference-plugin/src/main/java/itests/ServerSideExtensionUsingExternalDependency.java [deleted file]
tests/integration/reference-plugin/src/main/java/itests/footer/SampleFooter.java [deleted file]
tests/integration/reference-plugin/src/main/java/itests/languages/LanguageWithoutRulesEngine.java [deleted file]
tests/integration/reference-plugin/src/main/java/itests/page/GwtSamplePage.java [deleted file]
tests/integration/reference-plugin/src/main/java/itests/page/RubyApiTestsPage.java [deleted file]
tests/integration/reference-plugin/src/main/java/itests/page/client/GwtModule.java [deleted file]
tests/integration/reference-plugin/src/main/java/itests/resourcetab/SampleResourceTab.java [deleted file]
tests/integration/reference-plugin/src/main/java/itests/resourcetab/client/GwtSampleResourceTab.java [deleted file]
tests/integration/reference-plugin/src/main/java/itests/ws/RubyWebService.java [deleted file]
tests/integration/reference-plugin/src/main/resources/itests/page/GwtModule.gwt.xml [deleted file]
tests/integration/reference-plugin/src/main/resources/itests/page/ruby_api_tests_page.html.erb [deleted file]
tests/integration/reference-plugin/src/main/resources/itests/resourcetab/GwtSampleResourceTab.gwt.xml [deleted file]
tests/integration/reference-plugin/src/main/resources/itests/resourcetab/public/sample.html [deleted file]
tests/integration/reference-plugin/src/main/resources/itests/ws/ruby_ws_controller.rb [deleted file]
tests/integration/reference-plugin/src/main/resources/static/file.html [deleted file]
tests/integration/sonar-it-reference-plugin/pom.xml [new file with mode: 0644]
tests/integration/sonar-it-reference-plugin/src/main/java/itests/ITestsPlugin.java [new file with mode: 0644]
tests/integration/sonar-it-reference-plugin/src/main/java/itests/SampleSensor.java [new file with mode: 0644]
tests/integration/sonar-it-reference-plugin/src/main/java/itests/ServerSideExtensionUsingExternalDependency.java [new file with mode: 0644]
tests/integration/sonar-it-reference-plugin/src/main/java/itests/footer/SampleFooter.java [new file with mode: 0644]
tests/integration/sonar-it-reference-plugin/src/main/java/itests/languages/LanguageWithoutRulesEngine.java [new file with mode: 0644]
tests/integration/sonar-it-reference-plugin/src/main/java/itests/page/GwtSamplePage.java [new file with mode: 0644]
tests/integration/sonar-it-reference-plugin/src/main/java/itests/page/RubyApiTestsPage.java [new file with mode: 0644]
tests/integration/sonar-it-reference-plugin/src/main/java/itests/page/client/GwtModule.java [new file with mode: 0644]
tests/integration/sonar-it-reference-plugin/src/main/java/itests/resourcetab/SampleResourceTab.java [new file with mode: 0644]
tests/integration/sonar-it-reference-plugin/src/main/java/itests/resourcetab/client/GwtSampleResourceTab.java [new file with mode: 0644]
tests/integration/sonar-it-reference-plugin/src/main/java/itests/ws/RubyWebService.java [new file with mode: 0644]
tests/integration/sonar-it-reference-plugin/src/main/resources/itests/page/GwtModule.gwt.xml [new file with mode: 0644]
tests/integration/sonar-it-reference-plugin/src/main/resources/itests/page/ruby_api_tests_page.html.erb [new file with mode: 0644]
tests/integration/sonar-it-reference-plugin/src/main/resources/itests/resourcetab/GwtSampleResourceTab.gwt.xml [new file with mode: 0644]
tests/integration/sonar-it-reference-plugin/src/main/resources/itests/resourcetab/public/sample.html [new file with mode: 0644]
tests/integration/sonar-it-reference-plugin/src/main/resources/itests/ws/ruby_ws_controller.rb [new file with mode: 0644]
tests/integration/sonar-it-reference-plugin/src/main/resources/static/file.html [new file with mode: 0644]
tests/integration/tests/build.xml
tests/integration/tests/pom.xml

index fe363492826eb88add327fb3c78d0be73f27fda7..c62430f66b41bc82422dbbf255b5aa08f2298c03 100644 (file)
@@ -13,7 +13,7 @@
   <name>Sonar :: Integration Tests</name>
 
   <modules>
-    <module>reference-plugin</module>
+    <module>sonar-it-reference-plugin</module>
     <module>checkstyle-extensions</module>
     <module>pmd-extensions</module>
     <module>tests</module>
diff --git a/tests/integration/reference-plugin/pom.xml b/tests/integration/reference-plugin/pom.xml
deleted file mode 100644 (file)
index fbe536a..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <groupId>org.codehaus.sonar.tests</groupId>
-    <artifactId>integration</artifactId>
-    <version>2.4-SNAPSHOT</version>
-  </parent>
-  
-  <artifactId>reference-plugin</artifactId>
-  <name>Sonar :: Integration Tests :: Reference Plugin</name>
-  <packaging>sonar-plugin</packaging>
-  <description>My Sonar plugin</description>
-
-  <licenses>
-    <license>
-      <name>LGPL 3</name>
-    </license>
-  </licenses>
-
-  <organization>
-    <name>SonarSource</name>
-    <url>http://www.sonarsource.org</url>
-  </organization>
-  
-  <dependencies>
-    <dependency>
-      <groupId>org.codehaus.sonar</groupId>
-      <artifactId>sonar-plugin-api</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.codehaus.sonar</groupId>
-      <artifactId>sonar-gwt-api</artifactId>
-      <version>${project.version}</version>
-      <scope>provided</scope>
-    </dependency>
-
-
-    <!-- required dependencies which are not provided by sonar -->
-    <dependency>
-      <groupId>commons-i18n</groupId>
-      <artifactId>commons-i18n</artifactId>
-      <version>0.5</version>
-    </dependency>
-
-    <!-- external dependencies -->
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-project</artifactId>
-      <version>2.0.7</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-plugin-api</artifactId>
-      <version>2.0.7</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-core</artifactId>
-      <version>2.0.7</version>
-      <scope>provided</scope>
-    </dependency>
-
-    <!-- only for GWT extensions -->
-    <dependency>
-      <groupId>com.google.gwt</groupId>
-      <artifactId>gwt-user</artifactId>
-      <version>2.0.3</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>com.google.gwt</groupId>
-      <artifactId>gwt-incubator</artifactId>
-      <version>2.0.1</version>
-      <scope>provided</scope>
-    </dependency>
-
-    <!-- unit tests -->
-    <dependency>
-      <groupId>org.codehaus.sonar</groupId>
-      <artifactId>sonar-testing-harness</artifactId>
-      <version>${project.version}</version>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.codehaus.sonar</groupId>
-        <artifactId>sonar-packaging-maven-plugin</artifactId>
-        <version>0.4-SNAPSHOT</version>
-        <extensions>true</extensions>
-        <configuration>
-          <pluginClass>itests.ITestsPlugin</pluginClass>
-        </configuration>
-      </plugin>
-
-      <plugin>
-        <!-- build GWT extensions -->
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>gwt-maven-plugin</artifactId>
-        <version>1.2</version>
-        <executions>
-          <execution>
-            <configuration>
-              <modules>
-                <module>itests.resourcetab.GwtSampleResourceTab</module>
-                <module>itests.page.GwtModule</module>
-              </modules>
-              <webappDirectory>${project.build.directory}/classes</webappDirectory>
-
-              <!-- do not break on two lines -->
-              <extraJvmArgs>-Xmx512m -Dgwt.jjs.permutationWorkerFactory=com.google.gwt.dev.ThreadedPermutationWorkerFactory</extraJvmArgs>
-            </configuration>
-            <goals>
-              <goal>compile</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-
-      <plugin>
-        <!-- Java 1.5 -->
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.5</source>
-          <target>1.5</target>
-          <encoding>UTF-8</encoding>
-        </configuration>
-      </plugin>
-
-    </plugins>
-  </build>
-</project>
diff --git a/tests/integration/reference-plugin/src/main/java/itests/ITestsPlugin.java b/tests/integration/reference-plugin/src/main/java/itests/ITestsPlugin.java
deleted file mode 100644 (file)
index 73c30c5..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*\r
- * Sonar, open source software quality management tool.\r
- * Copyright (C) 2009 SonarSource SA\r
- * mailto:contact AT sonarsource DOT com\r
- *\r
- * Sonar is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU Lesser General Public\r
- * License as published by the Free Software Foundation; either\r
- * version 3 of the License, or (at your option) any later version.\r
- *\r
- * Sonar is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
- * Lesser General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU Lesser General Public\r
- * License along with Sonar; if not, write to the Free Software\r
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02\r
- */\r
-package itests;\r
-\r
-import itests.footer.SampleFooter;\r
-import itests.languages.LanguageWithoutRulesEngine;\r
-import itests.page.GwtSamplePage;\r
-import itests.page.RubyApiTestsPage;\r
-import itests.resourcetab.SampleResourceTab;\r
-import itests.ws.RubyWebService;\r
-import org.sonar.api.Plugin;\r
-\r
-import java.util.ArrayList;\r
-import java.util.List;\r
-\r
-public class ITestsPlugin implements Plugin {\r
-\r
-  public String getKey() {\r
-    return "it";\r
-  }\r
-\r
-  public String getName() {\r
-    return "Integration tests";\r
-  }\r
-\r
-  public String getDescription() {\r
-    return "Integration tests";\r
-  }\r
-\r
-  public List getExtensions() {\r
-    List extensions = new ArrayList();\r
-\r
-    extensions.add(SampleSensor.class);\r
-    extensions.add(LanguageWithoutRulesEngine.class);\r
-    extensions.add(ServerSideExtensionUsingExternalDependency.class);\r
-\r
-\r
-    // web\r
-    extensions.add(SampleResourceTab.class);\r
-    extensions.add(SampleFooter.class);\r
-    extensions.add(GwtSamplePage.class);\r
-    extensions.add(RubyApiTestsPage.class);\r
-    \r
-    // web service\r
-    extensions.add(RubyWebService.class);\r
-\r
-    return extensions;\r
-  }\r
-\r
-  @Override\r
-  public String toString() {\r
-    return getKey();\r
-  }\r
-}\r
diff --git a/tests/integration/reference-plugin/src/main/java/itests/SampleSensor.java b/tests/integration/reference-plugin/src/main/java/itests/SampleSensor.java
deleted file mode 100644 (file)
index b4172e8..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2009 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar 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.
- *
- * Sonar 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 Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
- */
-package itests;
-
-import org.apache.commons.i18n.bundles.MessageBundle;
-import org.sonar.api.batch.Sensor;
-import org.sonar.api.batch.SensorContext;
-import org.sonar.api.resources.Project;
-
-public class SampleSensor implements Sensor {
-  public boolean shouldExecuteOnProject(Project project) {
-    return true;
-  }
-
-  public void analyse(Project project, SensorContext context) {
-    System.out.println(" Check usage of plugin dependencies (new feature since sonar 2.2)");
-
-
-    System.out.print("Loading external dependency from " + getClass().getName() + ": ");
-    MessageBundle bundle = new MessageBundle("12345");
-    System.out.println("OK");
-
-    System.out.print("  Plugin isolation (can not access other plugin classes): ");
-    try {
-      Class.forName("org.sonar.plugins.checkstyle.CheckstyleSensor");
-      System.out.println("KO");
-
-    } catch (ClassNotFoundException e) {
-      System.out.println("OK");
-    }
-  }
-
-  @Override
-  public String toString() {
-    return getClass().getSimpleName();
-  }
-}
diff --git a/tests/integration/reference-plugin/src/main/java/itests/ServerSideExtensionUsingExternalDependency.java b/tests/integration/reference-plugin/src/main/java/itests/ServerSideExtensionUsingExternalDependency.java
deleted file mode 100644 (file)
index 3debe0b..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2009 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar 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.
- *
- * Sonar 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 Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
- */
-package itests;
-
-import org.apache.commons.i18n.bundles.MessageBundle;
-import org.sonar.api.ServerExtension;
-
-public class ServerSideExtensionUsingExternalDependency implements ServerExtension {
-
-  public ServerSideExtensionUsingExternalDependency() {
-    System.out.print("Loading external dependency from " + getClass().getName() + ": ");
-    MessageBundle bundle = new MessageBundle("12345");
-    System.out.println("OK");
-  }
-}
diff --git a/tests/integration/reference-plugin/src/main/java/itests/footer/SampleFooter.java b/tests/integration/reference-plugin/src/main/java/itests/footer/SampleFooter.java
deleted file mode 100644 (file)
index 6db3846..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2009 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar 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.
- *
- * Sonar 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 Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
- */
-package itests.footer;
-
-import org.sonar.api.web.Footer;
-
-public class SampleFooter implements Footer {
-  public String getHtml() {
-    return "<div style='background-color: #111;color: #efefef;text-align=left;padding: 5px 10px;'>Sample footer</div>";
-  }
-}
diff --git a/tests/integration/reference-plugin/src/main/java/itests/languages/LanguageWithoutRulesEngine.java b/tests/integration/reference-plugin/src/main/java/itests/languages/LanguageWithoutRulesEngine.java
deleted file mode 100644 (file)
index 787551c..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2009 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar 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.
- *
- * Sonar 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 Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
- */
-package itests.languages;
-
-import org.sonar.api.database.model.ResourceModel;
-import org.sonar.api.resources.AbstractLanguage;
-
-public class LanguageWithoutRulesEngine extends AbstractLanguage {
-  private static final String[] SUFFIXES = new String[]{"unknown"};
-
-  public LanguageWithoutRulesEngine() {
-    super("lwre", "Language without rules engine");
-  }
-
-  public ResourceModel getParent(ResourceModel resource) {
-    return null;
-  }
-
-  public boolean matchExclusionPattern(ResourceModel resource, String wildcardPattern) {
-    return false;
-  }
-
-  public String[] getFileSuffixes() {
-    return SUFFIXES;
-  }
-}
diff --git a/tests/integration/reference-plugin/src/main/java/itests/page/GwtSamplePage.java b/tests/integration/reference-plugin/src/main/java/itests/page/GwtSamplePage.java
deleted file mode 100644 (file)
index e2c045d..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2009 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar 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.
- *
- * Sonar 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 Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
- */
-package itests.page;
-
-import itests.page.client.GwtModule;
-import org.sonar.api.web.GwtPage;
-import org.sonar.api.web.NavigationSection;
-
-@NavigationSection({NavigationSection.HOME})
-public class GwtSamplePage extends GwtPage {
-
-  public String getGwtId() {
-    return GwtModule.GWT_ID;
-  }
-
-  public String getTitle() {
-    return "GWT sample";
-  }
-}
diff --git a/tests/integration/reference-plugin/src/main/java/itests/page/RubyApiTestsPage.java b/tests/integration/reference-plugin/src/main/java/itests/page/RubyApiTestsPage.java
deleted file mode 100644 (file)
index 021bb58..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2009 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar 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.
- *
- * Sonar 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 Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
- */
-package itests.page;
-
-import org.sonar.api.web.AbstractRubyTemplate;
-import org.sonar.api.web.NavigationSection;
-import org.sonar.api.web.RubyRailsPage;
-import org.sonar.api.web.UserRole;
-
-@NavigationSection({NavigationSection.HOME})
-@UserRole(UserRole.USER)
-public class RubyApiTestsPage extends AbstractRubyTemplate implements RubyRailsPage {
-
-  public String getTitle() {
-    return "Ruby API tests";
-  }
-
-  @Override
-  public String getTemplatePath() {
-    return "/itests/page/ruby_api_tests_page.html.erb";
-  }
-
-  public String getId() {
-    return this.getClass().getName();
-  }
-}
diff --git a/tests/integration/reference-plugin/src/main/java/itests/page/client/GwtModule.java b/tests/integration/reference-plugin/src/main/java/itests/page/client/GwtModule.java
deleted file mode 100644 (file)
index d65b4a2..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2009 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar 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.
- *
- * Sonar 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 Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
- */
-package itests.page.client;
-
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.Widget;
-import org.sonar.gwt.ui.Page;
-
-public class GwtModule extends Page {
-  
-  public static final String GWT_ID = "itests.page.GwtModule";
-  
-  @Override
-  protected Widget doOnModuleLoad() {
-    return new Label("this is a GWT sample");
-  }
-}
diff --git a/tests/integration/reference-plugin/src/main/java/itests/resourcetab/SampleResourceTab.java b/tests/integration/reference-plugin/src/main/java/itests/resourcetab/SampleResourceTab.java
deleted file mode 100644 (file)
index 8906e44..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2009 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar 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.
- *
- * Sonar 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 Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
- */
-package itests.resourcetab;
-
-import itests.resourcetab.client.GwtSampleResourceTab;
-import org.sonar.api.web.GwtPage;
-import org.sonar.api.web.NavigationSection;
-import org.sonar.api.web.UserRole;
-
-@UserRole(UserRole.USER)
-@NavigationSection(NavigationSection.RESOURCE_TAB)
-public class SampleResourceTab extends GwtPage {
-  public String getTitle() {
-    return "Tab Sample";
-  }
-
-  public String getGwtId() {
-    return GwtSampleResourceTab.GWT_ID;
-  }
-}
\ No newline at end of file
diff --git a/tests/integration/reference-plugin/src/main/java/itests/resourcetab/client/GwtSampleResourceTab.java b/tests/integration/reference-plugin/src/main/java/itests/resourcetab/client/GwtSampleResourceTab.java
deleted file mode 100644 (file)
index d788e93..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2009 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar 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.
- *
- * Sonar 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 Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
- */
-package itests.resourcetab.client;
-
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.Widget;
-import org.sonar.gwt.ui.Page;
-import org.sonar.wsclient.services.Resource;
-
-public class GwtSampleResourceTab extends Page {
-  public static final String GWT_ID = "itests.resourcetab.GwtSampleResourceTab";
-
-  @Override
-  protected Widget doOnResourceLoad(Resource resource) {
-    return new HTML("This is a sample of viewer");
-  }
-
-}
\ No newline at end of file
diff --git a/tests/integration/reference-plugin/src/main/java/itests/ws/RubyWebService.java b/tests/integration/reference-plugin/src/main/java/itests/ws/RubyWebService.java
deleted file mode 100644 (file)
index 5ae5ebc..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2009 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar 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.
- *
- * Sonar 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 Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
- */
-package itests.ws;
-
-import org.sonar.api.web.AbstractRubyTemplate;
-import org.sonar.api.web.RubyRailsWebservice;
-
-public class RubyWebService extends AbstractRubyTemplate implements RubyRailsWebservice {
-
-  @Override
-  public String getTemplatePath() {
-    return "/itests/ws/ruby_ws_controller.rb";
-  }
-
-  public String getId() {
-    return "RubyWebService";
-  }
-
-}
diff --git a/tests/integration/reference-plugin/src/main/resources/itests/page/GwtModule.gwt.xml b/tests/integration/reference-plugin/src/main/resources/itests/page/GwtModule.gwt.xml
deleted file mode 100644 (file)
index 9046f23..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<module>
-
-  <inherits name='com.google.gwt.user.User'/>
-  <inherits name="com.google.gwt.json.JSON"/>
-  <inherits name="com.google.gwt.http.HTTP"/>
-  <inherits name="org.sonar.Sonar"/>
-
-  <entry-point class='itests.page.client.GwtModule'/>
-
-</module>
diff --git a/tests/integration/reference-plugin/src/main/resources/itests/page/ruby_api_tests_page.html.erb b/tests/integration/reference-plugin/src/main/resources/itests/page/ruby_api_tests_page.html.erb
deleted file mode 100644 (file)
index 8326ef1..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<h1>Ruby API tests</h1>
-
-
-<% success=true %>
-
-<% if logged_in? %>
-  <h2>User Properties</h2>
-  <ul id="user_properties">
-      <%
-        current_user.set_property({:prop_key => 'foo', :text_value => 'bar'})
-        test=current_user.property_value('foo')=='bar'
-        success&=test
-      %>
-      <li>create: <%= 'OK' if test -%></li>
-
-      <%
-        current_user.delete_property('foo')
-        test=current_user.property('foo').nil?
-        success&=test
-      %>
-      <li>delete: <%= 'OK' if test -%></li>
-
-      <%
-        current_user.set_property({:prop_key => 'foo', :text_value => 'bar'})
-        current_user.set_property({:prop_key => 'foo', :text_value => 'newbar'})
-        test=current_user.property_value('foo')=='newbar'
-        success&=test
-      %>
-      <li>update: <%= 'OK' if test -%></li>
-  </ul>
-<% end %>
-
-<br/>
-<p>Result: <span id="result"><%= success ? 'OK' : 'FAIL' %></span></p>
\ No newline at end of file
diff --git a/tests/integration/reference-plugin/src/main/resources/itests/resourcetab/GwtSampleResourceTab.gwt.xml b/tests/integration/reference-plugin/src/main/resources/itests/resourcetab/GwtSampleResourceTab.gwt.xml
deleted file mode 100644 (file)
index 5c6f660..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<module>
-
-  <inherits name='com.google.gwt.user.User'/>
-  <inherits name="com.google.gwt.json.JSON"/>
-  <inherits name="com.google.gwt.http.HTTP"/>
-  <inherits name="org.sonar.Sonar"/>
-
-  <entry-point class='itests.resourcetab.client.GwtSampleResourceTab'/>
-
-</module>
diff --git a/tests/integration/reference-plugin/src/main/resources/itests/resourcetab/public/sample.html b/tests/integration/reference-plugin/src/main/resources/itests/resourcetab/public/sample.html
deleted file mode 100644 (file)
index 6aecf69..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-    "http://www.w3.org/TR/html4/loose.dtd">
-
-<html>
-<head>
-  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
-  <title>Metrics</title>
-  <link href="http://localhost:9000/dev/stylesheets/reset-fonts-grids-2.2.2.css" media="all" rel="Stylesheet" type="text/css" />
-  <link href="http://localhost:9000/dev/stylesheets/style.css" media="all" rel="Stylesheet" type="text/css" />
-  <link href="http://localhost:9000/dev/stylesheets/style-gwt.css" media="all" rel="Stylesheet" type="text/css" />
-  <script src="http://localhost:9000/dev/javascripts/application.js" type="text/javascript"></script>
-  <script src="http://localhost:9000/dev/javascripts/prototype.js" type="text/javascript"></script>
-  <script src="http://localhost:9000/dev/javascripts/scriptaculous.js" type="text/javascript"></script>
-</head>
-
-<body>
-<script type="text/javascript">
-var config = {
-  "sonar_url": "http://localhost:9000/dev",
-  "sourceviewer_source_key": "org.sonar.samples:main-sample:org.sonar.samples.ClassUnderTest"
-};
-var sourceviewers = {
-  "Sample": "itests.sourceviewer.GwtSampleSourceViewer"
-};
-</script>
-<div class="error" id="error" style="display:none"><span id="errormsg"></span> &nbsp;&nbsp;[<a href="#" onclick="javascript:$('error').hide();return false;">hide</a>]</div>
-<div class="warning" id="warning" style="display:none"><span id="warningmsg"></span> &nbsp;&nbsp;[<a href="#" onclick="javascript:$('warning').hide();return false;">hide</a>]</div>
-<div class="notice" id="info" style="display:none"><span id="infomsg"></span> &nbsp;&nbsp;[<a href="#" onclick="javascript:$('info').hide();return false;">hide</a>]</div>
-
-
-<a href="#" onclick="load_itests_sourceviewer_GwtSampleSourceViewer();">load source</a>
-
-
-<div id="sourceviewers"></div>
-<script type="text/javascript" language="javascript" src="itests.sourceviewer.GwtSampleSourceViewer.nocache.js"></script>
-</body>
-</html>
\ No newline at end of file
diff --git a/tests/integration/reference-plugin/src/main/resources/itests/ws/ruby_ws_controller.rb b/tests/integration/reference-plugin/src/main/resources/itests/ws/ruby_ws_controller.rb
deleted file mode 100644 (file)
index e48166d..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# Sonar, open source software quality management tool.
-# Copyright (C) 2009 SonarSource SA
-# mailto:contact AT sonarsource DOT com
-#
-# Sonar 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.
-#
-# Sonar 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 Sonar; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
-#
-class Api::RubyWebServiceController < Api::RestController
-
-  def custom_method
-    render :text => "Custom method output"
-  end
-
-  private
-  
-  def rest_call
-    render :text => "Rest method output"
-  end
-  
-end
\ No newline at end of file
diff --git a/tests/integration/reference-plugin/src/main/resources/static/file.html b/tests/integration/reference-plugin/src/main/resources/static/file.html
deleted file mode 100644 (file)
index 5ae990c..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>\r
-<body>\r
-Text from static resource\r
-</body>\r
-</html>\r
diff --git a/tests/integration/sonar-it-reference-plugin/pom.xml b/tests/integration/sonar-it-reference-plugin/pom.xml
new file mode 100644 (file)
index 0000000..3e256ae
--- /dev/null
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.codehaus.sonar.tests</groupId>
+    <artifactId>integration</artifactId>
+    <version>2.4-SNAPSHOT</version>
+  </parent>
+  
+  <artifactId>sonar-it-reference-plugin</artifactId>
+  <name>Sonar :: Integration Tests :: Reference Plugin</name>
+  <packaging>sonar-plugin</packaging>
+  <description>My Sonar plugin</description>
+
+  <licenses>
+    <license>
+      <name>LGPL 3</name>
+    </license>
+  </licenses>
+
+  <organization>
+    <name>SonarSource</name>
+    <url>http://www.sonarsource.org</url>
+  </organization>
+  
+  <dependencies>
+    <dependency>
+      <groupId>org.codehaus.sonar</groupId>
+      <artifactId>sonar-plugin-api</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.sonar</groupId>
+      <artifactId>sonar-gwt-api</artifactId>
+      <version>${project.version}</version>
+      <scope>provided</scope>
+    </dependency>
+
+
+    <!-- required dependencies which are not provided by sonar -->
+    <dependency>
+      <groupId>commons-i18n</groupId>
+      <artifactId>commons-i18n</artifactId>
+      <version>0.5</version>
+    </dependency>
+
+    <!-- external dependencies -->
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-project</artifactId>
+      <version>2.0.7</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>2.0.7</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-core</artifactId>
+      <version>2.0.7</version>
+      <scope>provided</scope>
+    </dependency>
+
+    <!-- only for GWT extensions -->
+    <dependency>
+      <groupId>com.google.gwt</groupId>
+      <artifactId>gwt-user</artifactId>
+      <version>2.0.3</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.google.gwt</groupId>
+      <artifactId>gwt-incubator</artifactId>
+      <version>2.0.1</version>
+      <scope>provided</scope>
+    </dependency>
+
+    <!-- unit tests -->
+    <dependency>
+      <groupId>org.codehaus.sonar</groupId>
+      <artifactId>sonar-testing-harness</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.sonar</groupId>
+        <artifactId>sonar-packaging-maven-plugin</artifactId>
+        <version>0.4</version>
+        <extensions>true</extensions>
+        <configuration>
+          <pluginClass>itests.ITestsPlugin</pluginClass>
+        </configuration>
+      </plugin>
+
+      <plugin>
+        <!-- build GWT extensions -->
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>gwt-maven-plugin</artifactId>
+        <version>1.2</version>
+        <executions>
+          <execution>
+            <configuration>
+              <modules>
+                <module>itests.resourcetab.GwtSampleResourceTab</module>
+                <module>itests.page.GwtModule</module>
+              </modules>
+              <webappDirectory>${project.build.directory}/classes</webappDirectory>
+
+              <!-- do not break on two lines -->
+              <extraJvmArgs>-Xmx512m -Dgwt.jjs.permutationWorkerFactory=com.google.gwt.dev.ThreadedPermutationWorkerFactory</extraJvmArgs>
+            </configuration>
+            <goals>
+              <goal>compile</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+
+      <plugin>
+        <!-- Java 1.5 -->
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+          <encoding>UTF-8</encoding>
+        </configuration>
+      </plugin>
+
+    </plugins>
+  </build>
+</project>
diff --git a/tests/integration/sonar-it-reference-plugin/src/main/java/itests/ITestsPlugin.java b/tests/integration/sonar-it-reference-plugin/src/main/java/itests/ITestsPlugin.java
new file mode 100644 (file)
index 0000000..73c30c5
--- /dev/null
@@ -0,0 +1,71 @@
+/*\r
+ * Sonar, open source software quality management tool.\r
+ * Copyright (C) 2009 SonarSource SA\r
+ * mailto:contact AT sonarsource DOT com\r
+ *\r
+ * Sonar is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU Lesser General Public\r
+ * License as published by the Free Software Foundation; either\r
+ * version 3 of the License, or (at your option) any later version.\r
+ *\r
+ * Sonar is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+ * Lesser General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU Lesser General Public\r
+ * License along with Sonar; if not, write to the Free Software\r
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02\r
+ */\r
+package itests;\r
+\r
+import itests.footer.SampleFooter;\r
+import itests.languages.LanguageWithoutRulesEngine;\r
+import itests.page.GwtSamplePage;\r
+import itests.page.RubyApiTestsPage;\r
+import itests.resourcetab.SampleResourceTab;\r
+import itests.ws.RubyWebService;\r
+import org.sonar.api.Plugin;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+\r
+public class ITestsPlugin implements Plugin {\r
+\r
+  public String getKey() {\r
+    return "it";\r
+  }\r
+\r
+  public String getName() {\r
+    return "Integration tests";\r
+  }\r
+\r
+  public String getDescription() {\r
+    return "Integration tests";\r
+  }\r
+\r
+  public List getExtensions() {\r
+    List extensions = new ArrayList();\r
+\r
+    extensions.add(SampleSensor.class);\r
+    extensions.add(LanguageWithoutRulesEngine.class);\r
+    extensions.add(ServerSideExtensionUsingExternalDependency.class);\r
+\r
+\r
+    // web\r
+    extensions.add(SampleResourceTab.class);\r
+    extensions.add(SampleFooter.class);\r
+    extensions.add(GwtSamplePage.class);\r
+    extensions.add(RubyApiTestsPage.class);\r
+    \r
+    // web service\r
+    extensions.add(RubyWebService.class);\r
+\r
+    return extensions;\r
+  }\r
+\r
+  @Override\r
+  public String toString() {\r
+    return getKey();\r
+  }\r
+}\r
diff --git a/tests/integration/sonar-it-reference-plugin/src/main/java/itests/SampleSensor.java b/tests/integration/sonar-it-reference-plugin/src/main/java/itests/SampleSensor.java
new file mode 100644 (file)
index 0000000..b4172e8
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2009 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * Sonar 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.
+ *
+ * Sonar 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 Sonar; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
+ */
+package itests;
+
+import org.apache.commons.i18n.bundles.MessageBundle;
+import org.sonar.api.batch.Sensor;
+import org.sonar.api.batch.SensorContext;
+import org.sonar.api.resources.Project;
+
+public class SampleSensor implements Sensor {
+  public boolean shouldExecuteOnProject(Project project) {
+    return true;
+  }
+
+  public void analyse(Project project, SensorContext context) {
+    System.out.println(" Check usage of plugin dependencies (new feature since sonar 2.2)");
+
+
+    System.out.print("Loading external dependency from " + getClass().getName() + ": ");
+    MessageBundle bundle = new MessageBundle("12345");
+    System.out.println("OK");
+
+    System.out.print("  Plugin isolation (can not access other plugin classes): ");
+    try {
+      Class.forName("org.sonar.plugins.checkstyle.CheckstyleSensor");
+      System.out.println("KO");
+
+    } catch (ClassNotFoundException e) {
+      System.out.println("OK");
+    }
+  }
+
+  @Override
+  public String toString() {
+    return getClass().getSimpleName();
+  }
+}
diff --git a/tests/integration/sonar-it-reference-plugin/src/main/java/itests/ServerSideExtensionUsingExternalDependency.java b/tests/integration/sonar-it-reference-plugin/src/main/java/itests/ServerSideExtensionUsingExternalDependency.java
new file mode 100644 (file)
index 0000000..3debe0b
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2009 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * Sonar 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.
+ *
+ * Sonar 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 Sonar; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
+ */
+package itests;
+
+import org.apache.commons.i18n.bundles.MessageBundle;
+import org.sonar.api.ServerExtension;
+
+public class ServerSideExtensionUsingExternalDependency implements ServerExtension {
+
+  public ServerSideExtensionUsingExternalDependency() {
+    System.out.print("Loading external dependency from " + getClass().getName() + ": ");
+    MessageBundle bundle = new MessageBundle("12345");
+    System.out.println("OK");
+  }
+}
diff --git a/tests/integration/sonar-it-reference-plugin/src/main/java/itests/footer/SampleFooter.java b/tests/integration/sonar-it-reference-plugin/src/main/java/itests/footer/SampleFooter.java
new file mode 100644 (file)
index 0000000..6db3846
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2009 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * Sonar 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.
+ *
+ * Sonar 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 Sonar; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
+ */
+package itests.footer;
+
+import org.sonar.api.web.Footer;
+
+public class SampleFooter implements Footer {
+  public String getHtml() {
+    return "<div style='background-color: #111;color: #efefef;text-align=left;padding: 5px 10px;'>Sample footer</div>";
+  }
+}
diff --git a/tests/integration/sonar-it-reference-plugin/src/main/java/itests/languages/LanguageWithoutRulesEngine.java b/tests/integration/sonar-it-reference-plugin/src/main/java/itests/languages/LanguageWithoutRulesEngine.java
new file mode 100644 (file)
index 0000000..787551c
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2009 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * Sonar 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.
+ *
+ * Sonar 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 Sonar; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
+ */
+package itests.languages;
+
+import org.sonar.api.database.model.ResourceModel;
+import org.sonar.api.resources.AbstractLanguage;
+
+public class LanguageWithoutRulesEngine extends AbstractLanguage {
+  private static final String[] SUFFIXES = new String[]{"unknown"};
+
+  public LanguageWithoutRulesEngine() {
+    super("lwre", "Language without rules engine");
+  }
+
+  public ResourceModel getParent(ResourceModel resource) {
+    return null;
+  }
+
+  public boolean matchExclusionPattern(ResourceModel resource, String wildcardPattern) {
+    return false;
+  }
+
+  public String[] getFileSuffixes() {
+    return SUFFIXES;
+  }
+}
diff --git a/tests/integration/sonar-it-reference-plugin/src/main/java/itests/page/GwtSamplePage.java b/tests/integration/sonar-it-reference-plugin/src/main/java/itests/page/GwtSamplePage.java
new file mode 100644 (file)
index 0000000..e2c045d
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2009 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * Sonar 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.
+ *
+ * Sonar 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 Sonar; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
+ */
+package itests.page;
+
+import itests.page.client.GwtModule;
+import org.sonar.api.web.GwtPage;
+import org.sonar.api.web.NavigationSection;
+
+@NavigationSection({NavigationSection.HOME})
+public class GwtSamplePage extends GwtPage {
+
+  public String getGwtId() {
+    return GwtModule.GWT_ID;
+  }
+
+  public String getTitle() {
+    return "GWT sample";
+  }
+}
diff --git a/tests/integration/sonar-it-reference-plugin/src/main/java/itests/page/RubyApiTestsPage.java b/tests/integration/sonar-it-reference-plugin/src/main/java/itests/page/RubyApiTestsPage.java
new file mode 100644 (file)
index 0000000..021bb58
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2009 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * Sonar 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.
+ *
+ * Sonar 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 Sonar; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
+ */
+package itests.page;
+
+import org.sonar.api.web.AbstractRubyTemplate;
+import org.sonar.api.web.NavigationSection;
+import org.sonar.api.web.RubyRailsPage;
+import org.sonar.api.web.UserRole;
+
+@NavigationSection({NavigationSection.HOME})
+@UserRole(UserRole.USER)
+public class RubyApiTestsPage extends AbstractRubyTemplate implements RubyRailsPage {
+
+  public String getTitle() {
+    return "Ruby API tests";
+  }
+
+  @Override
+  public String getTemplatePath() {
+    return "/itests/page/ruby_api_tests_page.html.erb";
+  }
+
+  public String getId() {
+    return this.getClass().getName();
+  }
+}
diff --git a/tests/integration/sonar-it-reference-plugin/src/main/java/itests/page/client/GwtModule.java b/tests/integration/sonar-it-reference-plugin/src/main/java/itests/page/client/GwtModule.java
new file mode 100644 (file)
index 0000000..d65b4a2
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2009 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * Sonar 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.
+ *
+ * Sonar 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 Sonar; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
+ */
+package itests.page.client;
+
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.Widget;
+import org.sonar.gwt.ui.Page;
+
+public class GwtModule extends Page {
+  
+  public static final String GWT_ID = "itests.page.GwtModule";
+  
+  @Override
+  protected Widget doOnModuleLoad() {
+    return new Label("this is a GWT sample");
+  }
+}
diff --git a/tests/integration/sonar-it-reference-plugin/src/main/java/itests/resourcetab/SampleResourceTab.java b/tests/integration/sonar-it-reference-plugin/src/main/java/itests/resourcetab/SampleResourceTab.java
new file mode 100644 (file)
index 0000000..8906e44
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2009 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * Sonar 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.
+ *
+ * Sonar 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 Sonar; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
+ */
+package itests.resourcetab;
+
+import itests.resourcetab.client.GwtSampleResourceTab;
+import org.sonar.api.web.GwtPage;
+import org.sonar.api.web.NavigationSection;
+import org.sonar.api.web.UserRole;
+
+@UserRole(UserRole.USER)
+@NavigationSection(NavigationSection.RESOURCE_TAB)
+public class SampleResourceTab extends GwtPage {
+  public String getTitle() {
+    return "Tab Sample";
+  }
+
+  public String getGwtId() {
+    return GwtSampleResourceTab.GWT_ID;
+  }
+}
\ No newline at end of file
diff --git a/tests/integration/sonar-it-reference-plugin/src/main/java/itests/resourcetab/client/GwtSampleResourceTab.java b/tests/integration/sonar-it-reference-plugin/src/main/java/itests/resourcetab/client/GwtSampleResourceTab.java
new file mode 100644 (file)
index 0000000..d788e93
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2009 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * Sonar 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.
+ *
+ * Sonar 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 Sonar; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
+ */
+package itests.resourcetab.client;
+
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.Widget;
+import org.sonar.gwt.ui.Page;
+import org.sonar.wsclient.services.Resource;
+
+public class GwtSampleResourceTab extends Page {
+  public static final String GWT_ID = "itests.resourcetab.GwtSampleResourceTab";
+
+  @Override
+  protected Widget doOnResourceLoad(Resource resource) {
+    return new HTML("This is a sample of viewer");
+  }
+
+}
\ No newline at end of file
diff --git a/tests/integration/sonar-it-reference-plugin/src/main/java/itests/ws/RubyWebService.java b/tests/integration/sonar-it-reference-plugin/src/main/java/itests/ws/RubyWebService.java
new file mode 100644 (file)
index 0000000..5ae5ebc
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2009 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * Sonar 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.
+ *
+ * Sonar 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 Sonar; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
+ */
+package itests.ws;
+
+import org.sonar.api.web.AbstractRubyTemplate;
+import org.sonar.api.web.RubyRailsWebservice;
+
+public class RubyWebService extends AbstractRubyTemplate implements RubyRailsWebservice {
+
+  @Override
+  public String getTemplatePath() {
+    return "/itests/ws/ruby_ws_controller.rb";
+  }
+
+  public String getId() {
+    return "RubyWebService";
+  }
+
+}
diff --git a/tests/integration/sonar-it-reference-plugin/src/main/resources/itests/page/GwtModule.gwt.xml b/tests/integration/sonar-it-reference-plugin/src/main/resources/itests/page/GwtModule.gwt.xml
new file mode 100644 (file)
index 0000000..9046f23
--- /dev/null
@@ -0,0 +1,10 @@
+<module>
+
+  <inherits name='com.google.gwt.user.User'/>
+  <inherits name="com.google.gwt.json.JSON"/>
+  <inherits name="com.google.gwt.http.HTTP"/>
+  <inherits name="org.sonar.Sonar"/>
+
+  <entry-point class='itests.page.client.GwtModule'/>
+
+</module>
diff --git a/tests/integration/sonar-it-reference-plugin/src/main/resources/itests/page/ruby_api_tests_page.html.erb b/tests/integration/sonar-it-reference-plugin/src/main/resources/itests/page/ruby_api_tests_page.html.erb
new file mode 100644 (file)
index 0000000..8326ef1
--- /dev/null
@@ -0,0 +1,34 @@
+<h1>Ruby API tests</h1>
+
+
+<% success=true %>
+
+<% if logged_in? %>
+  <h2>User Properties</h2>
+  <ul id="user_properties">
+      <%
+        current_user.set_property({:prop_key => 'foo', :text_value => 'bar'})
+        test=current_user.property_value('foo')=='bar'
+        success&=test
+      %>
+      <li>create: <%= 'OK' if test -%></li>
+
+      <%
+        current_user.delete_property('foo')
+        test=current_user.property('foo').nil?
+        success&=test
+      %>
+      <li>delete: <%= 'OK' if test -%></li>
+
+      <%
+        current_user.set_property({:prop_key => 'foo', :text_value => 'bar'})
+        current_user.set_property({:prop_key => 'foo', :text_value => 'newbar'})
+        test=current_user.property_value('foo')=='newbar'
+        success&=test
+      %>
+      <li>update: <%= 'OK' if test -%></li>
+  </ul>
+<% end %>
+
+<br/>
+<p>Result: <span id="result"><%= success ? 'OK' : 'FAIL' %></span></p>
\ No newline at end of file
diff --git a/tests/integration/sonar-it-reference-plugin/src/main/resources/itests/resourcetab/GwtSampleResourceTab.gwt.xml b/tests/integration/sonar-it-reference-plugin/src/main/resources/itests/resourcetab/GwtSampleResourceTab.gwt.xml
new file mode 100644 (file)
index 0000000..5c6f660
--- /dev/null
@@ -0,0 +1,10 @@
+<module>
+
+  <inherits name='com.google.gwt.user.User'/>
+  <inherits name="com.google.gwt.json.JSON"/>
+  <inherits name="com.google.gwt.http.HTTP"/>
+  <inherits name="org.sonar.Sonar"/>
+
+  <entry-point class='itests.resourcetab.client.GwtSampleResourceTab'/>
+
+</module>
diff --git a/tests/integration/sonar-it-reference-plugin/src/main/resources/itests/resourcetab/public/sample.html b/tests/integration/sonar-it-reference-plugin/src/main/resources/itests/resourcetab/public/sample.html
new file mode 100644 (file)
index 0000000..6aecf69
--- /dev/null
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+    "http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+<head>
+  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+  <title>Metrics</title>
+  <link href="http://localhost:9000/dev/stylesheets/reset-fonts-grids-2.2.2.css" media="all" rel="Stylesheet" type="text/css" />
+  <link href="http://localhost:9000/dev/stylesheets/style.css" media="all" rel="Stylesheet" type="text/css" />
+  <link href="http://localhost:9000/dev/stylesheets/style-gwt.css" media="all" rel="Stylesheet" type="text/css" />
+  <script src="http://localhost:9000/dev/javascripts/application.js" type="text/javascript"></script>
+  <script src="http://localhost:9000/dev/javascripts/prototype.js" type="text/javascript"></script>
+  <script src="http://localhost:9000/dev/javascripts/scriptaculous.js" type="text/javascript"></script>
+</head>
+
+<body>
+<script type="text/javascript">
+var config = {
+  "sonar_url": "http://localhost:9000/dev",
+  "sourceviewer_source_key": "org.sonar.samples:main-sample:org.sonar.samples.ClassUnderTest"
+};
+var sourceviewers = {
+  "Sample": "itests.sourceviewer.GwtSampleSourceViewer"
+};
+</script>
+<div class="error" id="error" style="display:none"><span id="errormsg"></span> &nbsp;&nbsp;[<a href="#" onclick="javascript:$('error').hide();return false;">hide</a>]</div>
+<div class="warning" id="warning" style="display:none"><span id="warningmsg"></span> &nbsp;&nbsp;[<a href="#" onclick="javascript:$('warning').hide();return false;">hide</a>]</div>
+<div class="notice" id="info" style="display:none"><span id="infomsg"></span> &nbsp;&nbsp;[<a href="#" onclick="javascript:$('info').hide();return false;">hide</a>]</div>
+
+
+<a href="#" onclick="load_itests_sourceviewer_GwtSampleSourceViewer();">load source</a>
+
+
+<div id="sourceviewers"></div>
+<script type="text/javascript" language="javascript" src="itests.sourceviewer.GwtSampleSourceViewer.nocache.js"></script>
+</body>
+</html>
\ No newline at end of file
diff --git a/tests/integration/sonar-it-reference-plugin/src/main/resources/itests/ws/ruby_ws_controller.rb b/tests/integration/sonar-it-reference-plugin/src/main/resources/itests/ws/ruby_ws_controller.rb
new file mode 100644 (file)
index 0000000..e48166d
--- /dev/null
@@ -0,0 +1,32 @@
+#
+# Sonar, open source software quality management tool.
+# Copyright (C) 2009 SonarSource SA
+# mailto:contact AT sonarsource DOT com
+#
+# Sonar 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.
+#
+# Sonar 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 Sonar; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
+#
+class Api::RubyWebServiceController < Api::RestController
+
+  def custom_method
+    render :text => "Custom method output"
+  end
+
+  private
+  
+  def rest_call
+    render :text => "Rest method output"
+  end
+  
+end
\ No newline at end of file
diff --git a/tests/integration/sonar-it-reference-plugin/src/main/resources/static/file.html b/tests/integration/sonar-it-reference-plugin/src/main/resources/static/file.html
new file mode 100644 (file)
index 0000000..5ae990c
--- /dev/null
@@ -0,0 +1,5 @@
+<html>\r
+<body>\r
+Text from static resource\r
+</body>\r
+</html>\r
index 16d74fc489ff5f0a490e8402ff2d320e4790ba6b..1b21d45cdca2e55735199f18c4de95ed6f6f7a74 100644 (file)
@@ -24,8 +24,8 @@
       <fileset dir="${basedir}/target/sonar-gwt-sample-plugin/target/">
         <include name="sonar-gwt-sample-plugin-*-SNAPSHOT.jar"/>
       </fileset>
-      <fileset dir="${basedir}/../reference-plugin/">
-        <include name="target/reference-plugin-*-SNAPSHOT.jar"/>
+      <fileset dir="${basedir}/../sonar-it-reference-plugin/">
+        <include name="target/sonar-it-reference-plugin-*-SNAPSHOT.jar"/>
       </fileset>
     </copy>
   </target>
index 7832c3402ba61877ed1c0eb8b152bfb94d7fb0bd..86043ce6409ae9cb91234a519710b155119f02d1 100644 (file)
     </dependency>
     <dependency>
       <groupId>org.codehaus.sonar.tests</groupId>
-      <artifactId>reference-plugin</artifactId>
+      <artifactId>sonar-it-reference-plugin</artifactId>
       <version>${project.version}</version>
     </dependency>