aboutsummaryrefslogtreecommitdiffstats
path: root/tests/integration
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2011-01-25 19:21:35 +0100
committersimonbrandhof <simon.brandhof@gmail.com>2011-01-25 19:26:43 +0100
commitb989d6432701e603f9f75f84d21e8f23cf3cb7e0 (patch)
tree28afc38251f928fa5edb10dcdde0bfdfc4ae5222 /tests/integration
parent1d97046d483bb2bfad503abd467f20b80faabdd5 (diff)
downloadsonarqube-b989d6432701e603f9f75f84d21e8f23cf3cb7e0.tar.gz
sonarqube-b989d6432701e603f9f75f84d21e8f23cf3cb7e0.zip
Squid for Java : remove unused code
Diffstat (limited to 'tests/integration')
-rw-r--r--tests/integration/tests/custom-projects/ant-dynamic-junit/build.xml133
-rw-r--r--tests/integration/tests/custom-projects/ant-dynamic-junit/pom.xml114
-rw-r--r--tests/integration/tests/custom-projects/ant-dynamic-junit/src/FailTest.java10
-rw-r--r--tests/integration/tests/custom-projects/ant-dynamic-junit/src/ant/HelloWorldTest.java14
-rw-r--r--tests/integration/tests/maven-projects/maven-custom-type/src/main/java/mycompany/com/com/sourcesense/demoamp/Demo.java38
-rw-r--r--tests/integration/tests/maven-projects/maven-custom-type/src/main/java/mycompany/com/com/sourcesense/demoamp/DemoComponent.java41
6 files changed, 129 insertions, 221 deletions
diff --git a/tests/integration/tests/custom-projects/ant-dynamic-junit/build.xml b/tests/integration/tests/custom-projects/ant-dynamic-junit/build.xml
index 5b1c2c486b9..72a7217740a 100644
--- a/tests/integration/tests/custom-projects/ant-dynamic-junit/build.xml
+++ b/tests/integration/tests/custom-projects/ant-dynamic-junit/build.xml
@@ -1,72 +1,81 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<project name="ant-dynamic-junit" default="all" basedir=".">
-
- <property name="src.dir" value="src"/>
- <property name="lib.dir" value="lib"/>
- <property name="build.dir" value="build"/>
- <property name="classes.dir" value="${build.dir}/classes"/>
- <property name="reports.dir" value="reports"/>
- <property name="reports.junit.xml.dir" value="${reports.dir}/junit/xml"/>
- <property name="reports.junit.html.dir" value="${reports.dir}/junit/html"/>
-
- <path id="classpath">
- <fileset dir="${lib.dir}" includes="*.jar"/>
- </path>
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project name="ant-dynamic-junit" default="all" basedir=".">
+
+ <property name="src.dir" value="src"/>
+ <property name="test.dir" value="test"/>
+ <property name="lib.dir" value="lib"/>
+ <property name="build.dir" value="build"/>
+ <property name="classes.main.dir" value="${build.dir}/classes"/>
+ <property name="classes.test.dir" value="${build.dir}/test"/>
+ <property name="reports.dir" value="reports"/>
+ <property name="reports.junit.xml.dir" value="${reports.dir}/junit/xml"/>
+ <property name="reports.junit.html.dir" value="${reports.dir}/junit/html"/>
+
+ <path id="classpath">
+ <fileset dir="${lib.dir}" includes="*.jar"/>
+ </path>
<taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
<classpath>
<path refid="classpath"/>
</classpath>
</taskdef>
-
+
<taskdef name="junitreport" classname="org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator">
<classpath>
<path refid="classpath"/>
</classpath>
- </taskdef>
-
- <target name="init">
- <mkdir dir="${build.dir}" />
- <mkdir dir="${classes.dir}" />
- <mkdir dir="${reports.dir}" />
- <mkdir dir="${reports.junit.xml.dir}" />
- <mkdir dir="${reports.junit.html.dir}" />
- </target>
-
-
-
- <target name="compile" depends="init">
- <javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="classpath" fork="true"/>
- </target>
-
- <target name="test" depends="init,compile">
- <junit fork="yes" dir="${basedir}" failureProperty="test.failed">
- <classpath location="${classes.dir}" />
- <classpath refid="classpath" />
-
- <formatter type="xml" />
- <batchtest todir="${reports.junit.xml.dir}">
- <fileset dir="${src.dir}">
- <include name="**/*Test.java" />
- </fileset>
- </batchtest>
- </junit>
-
- <junitreport todir="${reports.junit.html.dir}">
- <fileset dir="${reports.junit.xml.dir}">
- <include name="TEST-*.xml" />
- </fileset>
- <report format="frames" todir="${reports.junit.html.dir}" />
- </junitreport>
- </target>
-
-
- <target name="clean" description="Remove all files created by the build/test process.">
- <delete dir="${build.dir}" />
- <delete dir="${reports.dir}" />
- </target>
-
- <target name="all" depends="clean,compile,test"/>
-
-</project>
+ </taskdef>
+
+ <target name="init">
+ <mkdir dir="${build.dir}"/>
+ <mkdir dir="${classes.main.dir}"/>
+ <mkdir dir="${classes.test.dir}"/>
+ <mkdir dir="${reports.dir}"/>
+ <mkdir dir="${reports.junit.xml.dir}"/>
+ <mkdir dir="${reports.junit.html.dir}"/>
+ </target>
+
+ <target name="compile" depends="init">
+ <javac srcdir="${src.dir}" destdir="${classes.main.dir}" classpathref="classpath" fork="true"/>
+ <javac srcdir="${test.dir}" destdir="${classes.test.dir}" fork="true">
+ <classpath location="${classes.main.dir}"/>
+ <classpath refid="classpath"/>
+ </javac>
+ </target>
+
+ <target name="test" depends="init,compile">
+ <junit fork="yes" dir="${basedir}" failureProperty="test.failed">
+ <classpath>
+ <pathelement location="${classes.main.dir}"/>
+ <pathelement location="${classes.test.dir}"/>
+ <fileset dir="${lib.dir}" includes="*.jar"/>
+ </classpath>
+
+ <formatter type="xml"/>
+ <batchtest todir="${reports.junit.xml.dir}">
+ <fileset dir="${test.dir}">
+ <include name="**/*Test.java"/>
+ </fileset>
+ </batchtest>
+ </junit>
+
+ <junitreport todir="${reports.junit.html.dir}">
+ <fileset dir="${reports.junit.xml.dir}">
+ <include name="TEST-*.xml"/>
+ </fileset>
+ <report format="frames" todir="${reports.junit.html.dir}"/>
+ </junitreport>
+ </target>
+
+
+ <target name="clean" description="Remove all files created by the build/test process.">
+ <delete dir="${build.dir}"/>
+ <delete dir="${reports.dir}"/>
+ <delete dir="target"/>
+ </target>
+
+ <target name="all" depends="clean,compile,test"/>
+
+</project>
diff --git a/tests/integration/tests/custom-projects/ant-dynamic-junit/pom.xml b/tests/integration/tests/custom-projects/ant-dynamic-junit/pom.xml
index 2aac7c947a0..cda311eeedf 100644
--- a/tests/integration/tests/custom-projects/ant-dynamic-junit/pom.xml
+++ b/tests/integration/tests/custom-projects/ant-dynamic-junit/pom.xml
@@ -1,57 +1,59 @@
-<!-- this maven file is used by sonar only. Project is built with ant (see build.xml). -->
-
-<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/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.sonar.tests</groupId>
- <artifactId>ant-dynamic-junit</artifactId>
- <name>ant-dynamic-junit</name>
- <version>1.0</version>
-
- <build>
- <sourceDirectory>src</sourceDirectory>
-
- <!-- ant compiles sources into this directory -->
- <outputDirectory>build/classes</outputDirectory>
-
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- <failOnError>false</failOnError>
- <excludes><exclude>**/*</exclude></excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <!--
- Findbugs needs the auxiliary classpath to get results as accurate as possible. It avoids getting warnings like :
-
- The following classes needed for analysis were missing:
- junit.framework.TestCase
- -->
- <dependencies>
- <dependency>
- <groupId>deps</groupId>
- <artifactId>dep1</artifactId>
- <version>0.1</version>
- <scope>system</scope>
- <systemPath>${basedir}/lib/log4j-1.2.13.jar</systemPath>
- </dependency>
- <dependency>
- <groupId>deps</groupId>
- <artifactId>dep2</artifactId>
- <version>0.1</version>
- <scope>system</scope>
- <systemPath>${basedir}/lib/junit-3.8.2.jar</systemPath>
- </dependency>
- </dependencies>
-
- <properties>
- <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
- <sonar.surefire.reportsPath>reports/junit/xml</sonar.surefire.reportsPath>
- </properties>
+<!-- this maven file is used by sonar only. Project is built with ant (see build.xml). -->
+
+<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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.sonar.tests</groupId>
+ <artifactId>ant-dynamic-junit</artifactId>
+ <name>ant-dynamic-junit</name>
+ <version>1.0</version>
+
+ <build>
+ <sourceDirectory>src</sourceDirectory>
+ <testSourceDirectory>test</testSourceDirectory>
+
+ <!-- ant compiles sources into this directory -->
+ <outputDirectory>build/classes</outputDirectory>
+ <testOutputDirectory>build/test</testOutputDirectory>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <failOnError>false</failOnError>
+ <excludes><exclude>**/*</exclude></excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <!--
+ Findbugs needs the auxiliary classpath to get results as accurate as possible. It avoids getting warnings like :
+
+ The following classes needed for analysis were missing:
+ junit.framework.TestCase
+ -->
+ <dependencies>
+ <dependency>
+ <groupId>deps</groupId>
+ <artifactId>dep1</artifactId>
+ <version>0.1</version>
+ <scope>system</scope>
+ <systemPath>${basedir}/lib/log4j-1.2.13.jar</systemPath>
+ </dependency>
+ <dependency>
+ <groupId>deps</groupId>
+ <artifactId>dep2</artifactId>
+ <version>0.1</version>
+ <scope>system</scope>
+ <systemPath>${basedir}/lib/junit-3.8.2.jar</systemPath>
+ </dependency>
+ </dependencies>
+
+ <properties>
+ <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
+ <sonar.surefire.reportsPath>reports/junit/xml</sonar.surefire.reportsPath>
+ </properties>
</project> \ No newline at end of file
diff --git a/tests/integration/tests/custom-projects/ant-dynamic-junit/src/FailTest.java b/tests/integration/tests/custom-projects/ant-dynamic-junit/src/FailTest.java
deleted file mode 100644
index d75067caf7f..00000000000
--- a/tests/integration/tests/custom-projects/ant-dynamic-junit/src/FailTest.java
+++ /dev/null
@@ -1,10 +0,0 @@
-public class FailTest extends junit.framework.TestCase {
-
- public void testNothing() {
- }
-
- public void testWillAlwaysFail() {
- fail("An error message");
- }
-
-} \ No newline at end of file
diff --git a/tests/integration/tests/custom-projects/ant-dynamic-junit/src/ant/HelloWorldTest.java b/tests/integration/tests/custom-projects/ant-dynamic-junit/src/ant/HelloWorldTest.java
deleted file mode 100644
index 891a5bd9962..00000000000
--- a/tests/integration/tests/custom-projects/ant-dynamic-junit/src/ant/HelloWorldTest.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package ant;
-
-public class HelloWorldTest extends junit.framework.TestCase {
-
- public void testClone() {
- HelloWorld hello = new HelloWorld();
- assertEquals(hello, hello.clone());
- }
-
- public void testWillAlwaysFail() {
- fail("An error message");
- }
-
-} \ No newline at end of file
diff --git a/tests/integration/tests/maven-projects/maven-custom-type/src/main/java/mycompany/com/com/sourcesense/demoamp/Demo.java b/tests/integration/tests/maven-projects/maven-custom-type/src/main/java/mycompany/com/com/sourcesense/demoamp/Demo.java
deleted file mode 100644
index 8a29824cf5a..00000000000
--- a/tests/integration/tests/maven-projects/maven-custom-type/src/main/java/mycompany/com/com/sourcesense/demoamp/Demo.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2005-2007 Alfresco Software Limited.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
- * As a special exception to the terms and conditions of version 2.0 of
- * the GPL, you may redistribute this Program in connection with Free/Libre
- * and Open Source Software ("FLOSS") applications as described in Alfresco's
- * FLOSS exception. You should have recieved a copy of the text describing
- * the FLOSS exception, and it is also available here:
- * http://www.alfresco.com/legal/licensing"
- */
-package com.sourcesense.demoamp;
-
-/**
- * This class does nothing except dump some output to <i>system.out</i>.
- *
- * @author Derek Hulley
- */
-public class Demo
-{
- public void init()
- {
- System.out.println("SDK Demo AMP class has been loaded");
- }
-}
diff --git a/tests/integration/tests/maven-projects/maven-custom-type/src/main/java/mycompany/com/com/sourcesense/demoamp/DemoComponent.java b/tests/integration/tests/maven-projects/maven-custom-type/src/main/java/mycompany/com/com/sourcesense/demoamp/DemoComponent.java
deleted file mode 100644
index f6ef5bf5d71..00000000000
--- a/tests/integration/tests/maven-projects/maven-custom-type/src/main/java/mycompany/com/com/sourcesense/demoamp/DemoComponent.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- */
-package com.sourcesense.demoamp;
-
-import java.util.logging.Logger;
-
-import org.alfresco.repo.module.AbstractModuleComponent;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * A basic component that will be started for this module.
- *
- * @author Derek Hulley
- */
-public class DemoComponent extends AbstractModuleComponent
-{
- Log log = LogFactory.getLog(DemoComponent.class);
-
- @Override
- protected void executeInternal() throws Throwable
- {
- System.out.println("DemoComponent has been executed");
- log.debug("Test debug logging is working");
- log.info("This should not be outputted by default");
- }
-}