From: simonbrandhof Date: Mon, 8 Nov 2010 15:10:44 +0000 (+0000) Subject: improve integration tests: rename the reference plugin with standard convention of... X-Git-Tag: 2.6~620 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5b8fdc0fefa57b102971e073208955003c0e6f3c;p=sonarqube.git improve integration tests: rename the reference plugin with standard convention of artifact ids --- diff --git a/tests/integration/pom.xml b/tests/integration/pom.xml index fe363492826..c62430f66b4 100644 --- a/tests/integration/pom.xml +++ b/tests/integration/pom.xml @@ -13,7 +13,7 @@ Sonar :: Integration Tests - reference-plugin + sonar-it-reference-plugin checkstyle-extensions pmd-extensions tests diff --git a/tests/integration/reference-plugin/pom.xml b/tests/integration/reference-plugin/pom.xml deleted file mode 100644 index fbe536ac8ac..00000000000 --- a/tests/integration/reference-plugin/pom.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - 4.0.0 - - org.codehaus.sonar.tests - integration - 2.4-SNAPSHOT - - - reference-plugin - Sonar :: Integration Tests :: Reference Plugin - sonar-plugin - My Sonar plugin - - - - LGPL 3 - - - - - SonarSource - http://www.sonarsource.org - - - - - org.codehaus.sonar - sonar-plugin-api - ${project.version} - - - org.codehaus.sonar - sonar-gwt-api - ${project.version} - provided - - - - - - commons-i18n - commons-i18n - 0.5 - - - - - org.apache.maven - maven-project - 2.0.7 - provided - - - org.apache.maven - maven-plugin-api - 2.0.7 - provided - - - org.apache.maven - maven-core - 2.0.7 - provided - - - - - com.google.gwt - gwt-user - 2.0.3 - provided - - - com.google.gwt - gwt-incubator - 2.0.1 - provided - - - - - org.codehaus.sonar - sonar-testing-harness - ${project.version} - test - - - - - - - org.codehaus.sonar - sonar-packaging-maven-plugin - 0.4-SNAPSHOT - true - - itests.ITestsPlugin - - - - - - org.codehaus.mojo - gwt-maven-plugin - 1.2 - - - - - itests.resourcetab.GwtSampleResourceTab - itests.page.GwtModule - - ${project.build.directory}/classes - - - -Xmx512m -Dgwt.jjs.permutationWorkerFactory=com.google.gwt.dev.ThreadedPermutationWorkerFactory - - - compile - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.5 - 1.5 - UTF-8 - - - - - - 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 index 73c30c51ca9..00000000000 --- a/tests/integration/reference-plugin/src/main/java/itests/ITestsPlugin.java +++ /dev/null @@ -1,71 +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 itests.footer.SampleFooter; -import itests.languages.LanguageWithoutRulesEngine; -import itests.page.GwtSamplePage; -import itests.page.RubyApiTestsPage; -import itests.resourcetab.SampleResourceTab; -import itests.ws.RubyWebService; -import org.sonar.api.Plugin; - -import java.util.ArrayList; -import java.util.List; - -public class ITestsPlugin implements Plugin { - - public String getKey() { - return "it"; - } - - public String getName() { - return "Integration tests"; - } - - public String getDescription() { - return "Integration tests"; - } - - public List getExtensions() { - List extensions = new ArrayList(); - - extensions.add(SampleSensor.class); - extensions.add(LanguageWithoutRulesEngine.class); - extensions.add(ServerSideExtensionUsingExternalDependency.class); - - - // web - extensions.add(SampleResourceTab.class); - extensions.add(SampleFooter.class); - extensions.add(GwtSamplePage.class); - extensions.add(RubyApiTestsPage.class); - - // web service - extensions.add(RubyWebService.class); - - return extensions; - } - - @Override - public String toString() { - return getKey(); - } -} 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 index b4172e8b5bf..00000000000 --- a/tests/integration/reference-plugin/src/main/java/itests/SampleSensor.java +++ /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 index 3debe0b73f9..00000000000 --- a/tests/integration/reference-plugin/src/main/java/itests/ServerSideExtensionUsingExternalDependency.java +++ /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 index 6db3846990d..00000000000 --- a/tests/integration/reference-plugin/src/main/java/itests/footer/SampleFooter.java +++ /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 "
Sample footer
"; - } -} 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 index 787551c058f..00000000000 --- a/tests/integration/reference-plugin/src/main/java/itests/languages/LanguageWithoutRulesEngine.java +++ /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 index e2c045d126d..00000000000 --- a/tests/integration/reference-plugin/src/main/java/itests/page/GwtSamplePage.java +++ /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 index 021bb584458..00000000000 --- a/tests/integration/reference-plugin/src/main/java/itests/page/RubyApiTestsPage.java +++ /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 index d65b4a21f90..00000000000 --- a/tests/integration/reference-plugin/src/main/java/itests/page/client/GwtModule.java +++ /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 index 8906e4452c7..00000000000 --- a/tests/integration/reference-plugin/src/main/java/itests/resourcetab/SampleResourceTab.java +++ /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 index d788e93333e..00000000000 --- a/tests/integration/reference-plugin/src/main/java/itests/resourcetab/client/GwtSampleResourceTab.java +++ /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 index 5ae5ebc7044..00000000000 --- a/tests/integration/reference-plugin/src/main/java/itests/ws/RubyWebService.java +++ /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 index 9046f23e85e..00000000000 --- a/tests/integration/reference-plugin/src/main/resources/itests/page/GwtModule.gwt.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - 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 index 8326ef10ebf..00000000000 --- a/tests/integration/reference-plugin/src/main/resources/itests/page/ruby_api_tests_page.html.erb +++ /dev/null @@ -1,34 +0,0 @@ -

Ruby API tests

- - -<% success=true %> - -<% if logged_in? %> -

User Properties

- -<% end %> - -
-

Result: <%= success ? 'OK' : 'FAIL' %>

\ 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 index 5c6f660ab10..00000000000 --- a/tests/integration/reference-plugin/src/main/resources/itests/resourcetab/GwtSampleResourceTab.gwt.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - 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 index 6aecf69f757..00000000000 --- a/tests/integration/reference-plugin/src/main/resources/itests/resourcetab/public/sample.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - Metrics - - - - - - - - - - - - - - - -load source - - -
- - - \ 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 index e48166dc4bb..00000000000 --- a/tests/integration/reference-plugin/src/main/resources/itests/ws/ruby_ws_controller.rb +++ /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 index 5ae990c1af3..00000000000 --- a/tests/integration/reference-plugin/src/main/resources/static/file.html +++ /dev/null @@ -1,5 +0,0 @@ - - -Text from static resource - - diff --git a/tests/integration/sonar-it-reference-plugin/pom.xml b/tests/integration/sonar-it-reference-plugin/pom.xml new file mode 100644 index 00000000000..3e256ae9fbe --- /dev/null +++ b/tests/integration/sonar-it-reference-plugin/pom.xml @@ -0,0 +1,139 @@ + + + 4.0.0 + + org.codehaus.sonar.tests + integration + 2.4-SNAPSHOT + + + sonar-it-reference-plugin + Sonar :: Integration Tests :: Reference Plugin + sonar-plugin + My Sonar plugin + + + + LGPL 3 + + + + + SonarSource + http://www.sonarsource.org + + + + + org.codehaus.sonar + sonar-plugin-api + ${project.version} + + + org.codehaus.sonar + sonar-gwt-api + ${project.version} + provided + + + + + + commons-i18n + commons-i18n + 0.5 + + + + + org.apache.maven + maven-project + 2.0.7 + provided + + + org.apache.maven + maven-plugin-api + 2.0.7 + provided + + + org.apache.maven + maven-core + 2.0.7 + provided + + + + + com.google.gwt + gwt-user + 2.0.3 + provided + + + com.google.gwt + gwt-incubator + 2.0.1 + provided + + + + + org.codehaus.sonar + sonar-testing-harness + ${project.version} + test + + + + + + + org.codehaus.sonar + sonar-packaging-maven-plugin + 0.4 + true + + itests.ITestsPlugin + + + + + + org.codehaus.mojo + gwt-maven-plugin + 1.2 + + + + + itests.resourcetab.GwtSampleResourceTab + itests.page.GwtModule + + ${project.build.directory}/classes + + + -Xmx512m -Dgwt.jjs.permutationWorkerFactory=com.google.gwt.dev.ThreadedPermutationWorkerFactory + + + compile + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.5 + 1.5 + UTF-8 + + + + + + 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 index 00000000000..73c30c51ca9 --- /dev/null +++ b/tests/integration/sonar-it-reference-plugin/src/main/java/itests/ITestsPlugin.java @@ -0,0 +1,71 @@ +/* + * 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 itests.footer.SampleFooter; +import itests.languages.LanguageWithoutRulesEngine; +import itests.page.GwtSamplePage; +import itests.page.RubyApiTestsPage; +import itests.resourcetab.SampleResourceTab; +import itests.ws.RubyWebService; +import org.sonar.api.Plugin; + +import java.util.ArrayList; +import java.util.List; + +public class ITestsPlugin implements Plugin { + + public String getKey() { + return "it"; + } + + public String getName() { + return "Integration tests"; + } + + public String getDescription() { + return "Integration tests"; + } + + public List getExtensions() { + List extensions = new ArrayList(); + + extensions.add(SampleSensor.class); + extensions.add(LanguageWithoutRulesEngine.class); + extensions.add(ServerSideExtensionUsingExternalDependency.class); + + + // web + extensions.add(SampleResourceTab.class); + extensions.add(SampleFooter.class); + extensions.add(GwtSamplePage.class); + extensions.add(RubyApiTestsPage.class); + + // web service + extensions.add(RubyWebService.class); + + return extensions; + } + + @Override + public String toString() { + return getKey(); + } +} 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 index 00000000000..b4172e8b5bf --- /dev/null +++ b/tests/integration/sonar-it-reference-plugin/src/main/java/itests/SampleSensor.java @@ -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 index 00000000000..3debe0b73f9 --- /dev/null +++ b/tests/integration/sonar-it-reference-plugin/src/main/java/itests/ServerSideExtensionUsingExternalDependency.java @@ -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 index 00000000000..6db3846990d --- /dev/null +++ b/tests/integration/sonar-it-reference-plugin/src/main/java/itests/footer/SampleFooter.java @@ -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 "
Sample footer
"; + } +} 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 index 00000000000..787551c058f --- /dev/null +++ b/tests/integration/sonar-it-reference-plugin/src/main/java/itests/languages/LanguageWithoutRulesEngine.java @@ -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 index 00000000000..e2c045d126d --- /dev/null +++ b/tests/integration/sonar-it-reference-plugin/src/main/java/itests/page/GwtSamplePage.java @@ -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 index 00000000000..021bb584458 --- /dev/null +++ b/tests/integration/sonar-it-reference-plugin/src/main/java/itests/page/RubyApiTestsPage.java @@ -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 index 00000000000..d65b4a21f90 --- /dev/null +++ b/tests/integration/sonar-it-reference-plugin/src/main/java/itests/page/client/GwtModule.java @@ -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 index 00000000000..8906e4452c7 --- /dev/null +++ b/tests/integration/sonar-it-reference-plugin/src/main/java/itests/resourcetab/SampleResourceTab.java @@ -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 index 00000000000..d788e93333e --- /dev/null +++ b/tests/integration/sonar-it-reference-plugin/src/main/java/itests/resourcetab/client/GwtSampleResourceTab.java @@ -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 index 00000000000..5ae5ebc7044 --- /dev/null +++ b/tests/integration/sonar-it-reference-plugin/src/main/java/itests/ws/RubyWebService.java @@ -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 index 00000000000..9046f23e85e --- /dev/null +++ b/tests/integration/sonar-it-reference-plugin/src/main/resources/itests/page/GwtModule.gwt.xml @@ -0,0 +1,10 @@ + + + + + + + + + + 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 index 00000000000..8326ef10ebf --- /dev/null +++ b/tests/integration/sonar-it-reference-plugin/src/main/resources/itests/page/ruby_api_tests_page.html.erb @@ -0,0 +1,34 @@ +

Ruby API tests

+ + +<% success=true %> + +<% if logged_in? %> +

User Properties

+ +<% end %> + +
+

Result: <%= success ? 'OK' : 'FAIL' %>

\ 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 index 00000000000..5c6f660ab10 --- /dev/null +++ b/tests/integration/sonar-it-reference-plugin/src/main/resources/itests/resourcetab/GwtSampleResourceTab.gwt.xml @@ -0,0 +1,10 @@ + + + + + + + + + + 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 index 00000000000..6aecf69f757 --- /dev/null +++ b/tests/integration/sonar-it-reference-plugin/src/main/resources/itests/resourcetab/public/sample.html @@ -0,0 +1,37 @@ + + + + + + Metrics + + + + + + + + + + + + + + + +load source + + +
+ + + \ 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 index 00000000000..e48166dc4bb --- /dev/null +++ b/tests/integration/sonar-it-reference-plugin/src/main/resources/itests/ws/ruby_ws_controller.rb @@ -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 index 00000000000..5ae990c1af3 --- /dev/null +++ b/tests/integration/sonar-it-reference-plugin/src/main/resources/static/file.html @@ -0,0 +1,5 @@ + + +Text from static resource + + diff --git a/tests/integration/tests/build.xml b/tests/integration/tests/build.xml index 16d74fc489f..1b21d45cdca 100644 --- a/tests/integration/tests/build.xml +++ b/tests/integration/tests/build.xml @@ -24,8 +24,8 @@ - - + + diff --git a/tests/integration/tests/pom.xml b/tests/integration/tests/pom.xml index 7832c3402ba..86043ce6409 100644 --- a/tests/integration/tests/pom.xml +++ b/tests/integration/tests/pom.xml @@ -215,7 +215,7 @@ org.codehaus.sonar.tests - reference-plugin + sonar-it-reference-plugin ${project.version}