r335 - in branches/jredmine-1.x/jredmine-client: . src src/it src/it/redmine-1.4.x src/it/redmine-1.4.x/src src/it/redmine-1.4.x/src/test src/it/redmine-1.4.x/src/test/java src/it/redmine-1.4.x/src/test/java/org src/it/redmine-1.4.x/src/test/java/org/nuiton src/it/redmine-1.4.x/src/test/java/org/nuiton/jredmine src/it/redmine-1.4.x/src/test/resources src/it/redmine-2.0.x src/it/redmine-2.0.x/src src/it/redmine-2.0.x/src/test src/it/redmine-2.0.x/src/test/java src/it/redmine-2.0.x/src/test
Author: tchemit Date: 2012-10-04 00:54:20 +0200 (Thu, 04 Oct 2012) New Revision: 335 Url: http://nuiton.org/repositories/revision/jredmine/335 Log: add it to test different versions of redmine Added: branches/jredmine-1.x/jredmine-client/src/it/ branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/ branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/LICENSE.txt branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/README.txt branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/changelog.txt branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/goals.txt branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/pom.xml branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/postbuild.groovy branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/src/ branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/src/test/ branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/src/test/java/ branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/src/test/java/org/ branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/src/test/java/org/nuiton/ branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/src/test/java/org/nuiton/jredmine/ branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/src/test/java/org/nuiton/jredmine/JRedmineTCKTest.java branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/src/test/resources/ branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/src/test/resources/test-config.properties branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/ branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/LICENSE.txt branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/README.txt branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/changelog.txt branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/goals.txt branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/pom.xml branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/postbuild.groovy branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/src/ branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/src/test/ branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/src/test/java/ branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/src/test/java/org/ branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/src/test/java/org/nuiton/ branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/src/test/java/org/nuiton/jredmine/ branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/src/test/java/org/nuiton/jredmine/JRedmineTCKTest.java branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/src/test/resources/ branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/src/test/resources/test-config.properties branches/jredmine-1.x/jredmine-client/src/it/redmine-test/ branches/jredmine-1.x/jredmine-client/src/it/redmine-test/LICENSE.txt branches/jredmine-1.x/jredmine-client/src/it/redmine-test/README.txt branches/jredmine-1.x/jredmine-client/src/it/redmine-test/changelog.txt branches/jredmine-1.x/jredmine-client/src/it/redmine-test/pom.xml branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/ branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/ branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/ branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/ branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/ branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/ branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineAnonymousFixtureClassRule.java branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineAnonymousServiceTest.java branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineFixtures.java branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineLogguedFixtureClassRule.java branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineLogguedServiceAsAnonymousTest.java branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineLogguedServiceTest.java branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineServer.java branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/resources/ branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/resources/log4j.properties branches/jredmine-1.x/jredmine-client/src/it/settings.xml Modified: branches/jredmine-1.x/jredmine-client/pom.xml branches/jredmine-1.x/jredmine-client/src/test/resources/log4j.properties Modified: branches/jredmine-1.x/jredmine-client/pom.xml =================================================================== --- branches/jredmine-1.x/jredmine-client/pom.xml 2012-10-03 22:53:13 UTC (rev 334) +++ branches/jredmine-1.x/jredmine-client/pom.xml 2012-10-03 22:54:20 UTC (rev 335) @@ -117,8 +117,6 @@ <!-- *** Build Settings ****************************************** --> <!-- ************************************************************* --> - <packaging>jar</packaging> - <properties> <!-- extra files to include in release --> <redmine.releaseFiles> @@ -174,13 +172,13 @@ <plugin> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-maven-plugin</artifactId> - <version>1.3.8</version> + <version>${plexusPluginVersion}</version> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> - <version>2.3</version> + <version>${coberturaPluginVersion}</version> </plugin> </plugins> @@ -229,6 +227,62 @@ </build> </profile> + <profile> + <id>run-its</id> + <!--activation> + <property> + <name>maven.test.skip</name> + <value>!true</value> + </property> + </activation--> + <build> + <defaultGoal>integration-test</defaultGoal> + <plugins> + <plugin> + <artifactId>maven-invoker-plugin</artifactId> + <configuration> + <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo> + <settingsFile>src/it/settings.xml</settingsFile> + <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath> + </configuration> + <executions> + <execution> + <id>pre-integration-test</id> + <phase>pre-integration-test</phase> + <goals> + <goal>install</goal> + <goal>run</goal> + </goals> + <configuration> + <pomIncludes> + <pomInclude>redmine-test/pom.xml</pomInclude> + </pomIncludes> + <pomExcludes> + <pomExclude>redmine-test-*/pom.xml</pomExclude> + </pomExcludes> + </configuration> + </execution> + <execution> + <id>integration-test</id> + <goals> + <goal>run</goal> + </goals> + <configuration> + <pomIncludes> + <pomInclude>redmine-1.4.x/pom.xml</pomInclude> + <pomInclude>redmine-2.0.x/pom.xml</pomInclude> + </pomIncludes> + <pomExcludes> + <pomExclude>redmine-test/pom.xml</pomExclude> + </pomExcludes> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> </project> Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x ___________________________________________________________________ Added: svn:ignore + target *.ipr *.iml *.iws .idea Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/LICENSE.txt ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/README.txt =================================================================== --- branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/README.txt (rev 0) +++ branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/README.txt 2012-10-03 22:54:20 UTC (rev 335) @@ -0,0 +1 @@ +Module dans lequel on lance la baterrie de tests sur un redmine 1.4.x \ No newline at end of file Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/README.txt ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/changelog.txt ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/goals.txt =================================================================== --- branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/goals.txt (rev 0) +++ branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/goals.txt 2012-10-03 22:54:20 UTC (rev 335) @@ -0,0 +1 @@ +clean test \ No newline at end of file Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/goals.txt ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/pom.xml =================================================================== --- branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/pom.xml (rev 0) +++ branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/pom.xml 2012-10-03 22:54:20 UTC (rev 335) @@ -0,0 +1,102 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + #%L + JRedmine :: Maven plugin + %% + Copyright (C) 2009 - 2012 Tony Chemit, CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Lesser Public License for more details. + + You should have received a copy of the GNU General Lesser Public + License along with this program. If not, see + <http://www.gnu.org/licenses/lgpl-3.0.html>. + #L% + --> + +<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.nuiton</groupId> + <artifactId>jredmine</artifactId> + <version>1.4-SNAPSHOT</version> + </parent> + + <groupId>org.nuiton.jredmine</groupId> + <artifactId>jredmine-client-test-1.4.x</artifactId> + <name>JRedmine :: Client Test (redmine 1.4.x)</name> + <description> + JRedmine Test for redmine 1.4.x. + </description> + + <dependencies> + + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>jredmine-client-test</artifactId> + <version>${project.version}</version> + </dependency> + + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + + </dependency> + + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + </dependency> + + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>compile</scope> + </dependency> + + </dependencies> + + <build> + <plugins> + + <!-- get login --> + <plugin> + <groupId>org.nuiton</groupId> + <artifactId>helper-maven-plugin</artifactId> + <executions> + <execution> + <id>get-redmine-test-login</id> + <goals> + <goal>share-server-secret</goal> + </goals> + <phase>initialize</phase> + <configuration> + <serverId>jredmine-test-it</serverId> + <usernameOut>jredmine-test.login</usernameOut> + <passwordOut>jredmine-test.password</passwordOut> + </configuration> + </execution> + </executions> + </plugin> + + </plugins> + </build> + +</project> Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/pom.xml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/postbuild.groovy =================================================================== --- branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/postbuild.groovy (rev 0) +++ branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/postbuild.groovy 2012-10-03 22:54:20 UTC (rev 335) @@ -0,0 +1 @@ +return true; Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/postbuild.groovy ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/src/test/java/org/nuiton/jredmine/JRedmineTCKTest.java =================================================================== --- branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/src/test/java/org/nuiton/jredmine/JRedmineTCKTest.java (rev 0) +++ branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/src/test/java/org/nuiton/jredmine/JRedmineTCKTest.java 2012-10-03 22:54:20 UTC (rev 335) @@ -0,0 +1,20 @@ +package org.nuiton.jredmine; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * Launch tests on a {@code 1.4.x} redmine server. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.4 + */ +@Suite.SuiteClasses( + { + RedmineAnonymousServiceTest.class, + RedmineLogguedServiceAsAnonymousTest.class, + RedmineLogguedServiceTest.class + } +) +@RunWith(Suite.class) +public class JRedmineTCKTest { } Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/src/test/java/org/nuiton/jredmine/JRedmineTCKTest.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/src/test/resources/test-config.properties =================================================================== --- branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/src/test/resources/test-config.properties (rev 0) +++ branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/src/test/resources/test-config.properties 2012-10-03 22:54:20 UTC (rev 335) @@ -0,0 +1,3 @@ +jredmine-test.url=http://r1.4.x.redmine-test.codelutin.home/ +jredmine-test.encoding=UTF-8 +jredmine-test.verbose=true \ No newline at end of file Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/src/test/resources/test-config.properties ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x ___________________________________________________________________ Added: svn:ignore + target *.ipr *.iws *.iml .idea *.log Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/LICENSE.txt ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/README.txt =================================================================== --- branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/README.txt (rev 0) +++ branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/README.txt 2012-10-03 22:54:20 UTC (rev 335) @@ -0,0 +1 @@ +Module dans lequel on lance la baterrie de tests sur un redmine 2.0.x \ No newline at end of file Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/README.txt ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/changelog.txt ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/goals.txt =================================================================== --- branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/goals.txt (rev 0) +++ branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/goals.txt 2012-10-03 22:54:20 UTC (rev 335) @@ -0,0 +1 @@ +clean test \ No newline at end of file Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/goals.txt ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/pom.xml =================================================================== --- branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/pom.xml (rev 0) +++ branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/pom.xml 2012-10-03 22:54:20 UTC (rev 335) @@ -0,0 +1,102 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + #%L + JRedmine :: Maven plugin + %% + Copyright (C) 2009 - 2012 Tony Chemit, CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Lesser Public License for more details. + + You should have received a copy of the GNU General Lesser Public + License along with this program. If not, see + <http://www.gnu.org/licenses/lgpl-3.0.html>. + #L% + --> + +<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.nuiton</groupId> + <artifactId>jredmine</artifactId> + <version>1.4-SNAPSHOT</version> + </parent> + + <groupId>org.nuiton.jredmine</groupId> + <artifactId>jredmine-client-test-2.0.x</artifactId> + <name>JRedmine :: Client Test (redmine 2.0.x)</name> + <description> + JRedmine Test for redmine 2.0.x. + </description> + + <dependencies> + + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>jredmine-client-test</artifactId> + <version>${project.version}</version> + </dependency> + + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + + </dependency> + + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + </dependency> + + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>compile</scope> + </dependency> + + </dependencies> + + <build> + <plugins> + + <!-- get login --> + <plugin> + <groupId>org.nuiton</groupId> + <artifactId>helper-maven-plugin</artifactId> + <executions> + <execution> + <id>get-redmine-test-login</id> + <goals> + <goal>share-server-secret</goal> + </goals> + <phase>initialize</phase> + <configuration> + <serverId>jredmine-test-it</serverId> + <usernameOut>jredmine-test.login</usernameOut> + <passwordOut>jredmine-test.password</passwordOut> + </configuration> + </execution> + </executions> + </plugin> + + </plugins> + </build> + +</project> Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/pom.xml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/postbuild.groovy =================================================================== --- branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/postbuild.groovy (rev 0) +++ branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/postbuild.groovy 2012-10-03 22:54:20 UTC (rev 335) @@ -0,0 +1 @@ +return true; Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/postbuild.groovy ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/src/test/java/org/nuiton/jredmine/JRedmineTCKTest.java =================================================================== --- branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/src/test/java/org/nuiton/jredmine/JRedmineTCKTest.java (rev 0) +++ branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/src/test/java/org/nuiton/jredmine/JRedmineTCKTest.java 2012-10-03 22:54:20 UTC (rev 335) @@ -0,0 +1,21 @@ +package org.nuiton.jredmine; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * Launch tests on a {@code 2.0.x} redmine server. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.4 + */ +@Suite.SuiteClasses( + { + RedmineAnonymousServiceTest.class, + RedmineLogguedServiceAsAnonymousTest.class, + RedmineLogguedServiceTest.class + } +) +@RunWith(Suite.class) +public class JRedmineTCKTest { +} Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/src/test/java/org/nuiton/jredmine/JRedmineTCKTest.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/src/test/resources/test-config.properties =================================================================== --- branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/src/test/resources/test-config.properties (rev 0) +++ branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/src/test/resources/test-config.properties 2012-10-03 22:54:20 UTC (rev 335) @@ -0,0 +1,3 @@ +jredmine-test.url=http://r2.0.x.redmine-test.codelutin.home/ +jredmine-test.encoding=UTF-8 +jredmine-test.verbose=true \ No newline at end of file Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/src/test/resources/test-config.properties ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-test ___________________________________________________________________ Added: svn:ignore + target *.ipr *.iml *.iws .idea Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-test/LICENSE.txt ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: branches/jredmine-1.x/jredmine-client/src/it/redmine-test/README.txt =================================================================== --- branches/jredmine-1.x/jredmine-client/src/it/redmine-test/README.txt (rev 0) +++ branches/jredmine-1.x/jredmine-client/src/it/redmine-test/README.txt 2012-10-03 22:54:20 UTC (rev 335) @@ -0,0 +1,5 @@ +Ce module contient les tests à lancer sur les différentes instances. + +A noter que dans ce modules les tests ne sont pas lancé. Pour ce faire +il faut disposer d'un fichier test-config.properties avec les informations +de connexion qui vont bien. \ No newline at end of file Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-test/README.txt ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-test/changelog.txt ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: branches/jredmine-1.x/jredmine-client/src/it/redmine-test/pom.xml =================================================================== --- branches/jredmine-1.x/jredmine-client/src/it/redmine-test/pom.xml (rev 0) +++ branches/jredmine-1.x/jredmine-client/src/it/redmine-test/pom.xml 2012-10-03 22:54:20 UTC (rev 335) @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + #%L + JRedmine :: Maven plugin + %% + Copyright (C) 2009 - 2012 Tony Chemit, CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Lesser Public License for more details. + + You should have received a copy of the GNU General Lesser Public + License along with this program. If not, see + <http://www.gnu.org/licenses/lgpl-3.0.html>. + #L% + --> + +<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.nuiton</groupId> + <artifactId>jredmine</artifactId> + <version>1.4-SNAPSHOT</version> + </parent> + + <groupId>org.nuiton.jredmine</groupId> + <artifactId>jredmine-client-test</artifactId> + <name>JRedmine :: Client Test</name> + <description> + JRedmine Test API for client test purpose. Defines Here the TCK to be green + for all redmine versions. + </description> + + <dependencies> + + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>jredmine-client</artifactId> + <version>${project.version}</version> + </dependency> + + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + + </dependency> + + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + </dependency> + + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>compile</scope> + </dependency> + + </dependencies> + +</project> Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-test/pom.xml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineAnonymousFixtureClassRule.java =================================================================== --- branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineAnonymousFixtureClassRule.java (rev 0) +++ branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineAnonymousFixtureClassRule.java 2012-10-03 22:54:20 UTC (rev 335) @@ -0,0 +1,87 @@ +package org.nuiton.jredmine; +/* + * #%L + * JRedmine :: Client + * $Id$ + * $HeadURL: http://svn.nuiton.org/svn/jredmine/branches/jredmine-1.x/jredmine-client/src... $ + * %% + * Copyright (C) 2009 - 2012 Tony Chemit, CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.junit.Assume; +import org.junit.rules.TestRule; +import org.junit.runner.Description; +import org.junit.runners.model.Statement; + +import java.io.IOException; + +/** + * A class rule that provider the {@link RedmineFixtures} and check that the + * valid anonymous configuration is found. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.4 + */ +public class RedmineAnonymousFixtureClassRule implements TestRule { + + /** Logger. */ + private static final Log log = + LogFactory.getLog(RedmineAnonymousFixtureClassRule.class); + + RedmineFixtures fixtures = new RedmineFixtures(); + + RedmineServiceConfiguration conf; + + @Override + public Statement apply(Statement base, Description description) { + + Class<?> testClass = description.getTestClass(); + + try { + conf = RedmineConfigurationUtil.obtainRedmineConfiguration( + fixtures.newAnonymousConfiguration()); + + if (conf == null) { + + // could not find any configuration + if (log.isWarnEnabled()) { + log.warn("could not connect to server " + + fixtures.newAnonymousConfiguration() + ", will skip test " + + testClass.getName()); + } + Assume.assumeTrue(false); + } + // since having a configuration available, is by force anonymous + + } catch (IOException e) { + throw new IllegalStateException("Could not check jredmine configuration in test " + testClass.getName(), e); + + } + return base; + } + + public RedmineFixtures getFixtures() { + return fixtures; + } + + public RedmineServiceConfiguration getConf() { + return conf; + } +} Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineAnonymousFixtureClassRule.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineAnonymousServiceTest.java =================================================================== --- branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineAnonymousServiceTest.java (rev 0) +++ branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineAnonymousServiceTest.java 2012-10-03 22:54:20 UTC (rev 335) @@ -0,0 +1,194 @@ +package org.nuiton.jredmine; +/* + * #%L + * JRedmine :: Client + * $Id$ + * $HeadURL: http://svn.nuiton.org/svn/jredmine/branches/jredmine-1.x/jredmine-client/src... $ + * %% + * Copyright (C) 2009 - 2012 Tony Chemit, CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +import org.junit.Assert; +import org.junit.ClassRule; +import org.junit.Rule; +import org.junit.Test; +import org.nuiton.jredmine.model.Attachment; +import org.nuiton.jredmine.model.Issue; +import org.nuiton.jredmine.model.IssueCategory; +import org.nuiton.jredmine.model.IssuePriority; +import org.nuiton.jredmine.model.IssueStatus; +import org.nuiton.jredmine.model.News; +import org.nuiton.jredmine.model.Project; +import org.nuiton.jredmine.model.TimeEntry; +import org.nuiton.jredmine.model.Tracker; +import org.nuiton.jredmine.model.User; +import org.nuiton.jredmine.model.Version; + +import java.io.IOException; + +/** + * Tests the {@link RedmineAnonymousService} service. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.4 + */ +public class RedmineAnonymousServiceTest { + + @ClassRule + public static final RedmineAnonymousFixtureClassRule classRule = + new RedmineAnonymousFixtureClassRule(); + + @Rule + public final RedmineServer<RedmineAnonymousService> server = new RedmineServer<RedmineAnonymousService>(classRule.getFixtures()) { + + @Override + protected RedmineAnonymousService createService( + RedmineServiceConfiguration configuration) throws IOException, RedmineServiceException { + + return fixtures.newRedmineAnonymousService(configuration); + } + + @Override + protected RedmineServiceConfiguration createConfiguration() throws IOException { + RedmineServiceConfiguration conf = fixtures.newAnonymousConfiguration(); + return conf; + } + }; + + protected RedmineFixtures getFixtures() { + return server.getFixtures(); + } + + protected RedmineAnonymousService getService() { + return server.getService(); + } + + @Test + public void getProjects() throws Exception { + Project[] projects = getService().getProjects(); + Assert.assertNotNull(projects); + Assert.assertTrue(projects.length > 0); + } + + @Test + public void getProject() throws Exception { + Project project = getService().getProject(getFixtures().projectName()); + Assert.assertNotNull(project); + } + + @Test + public void getNews() throws Exception { + News[] news = getService().getNews(getFixtures().projectName()); + Assert.assertNotNull(news); + Assert.assertTrue(news.length > 0); + } + + @Test + public void getProjectIssues() throws Exception { + Issue[] issues = getService().getIssues(getFixtures().projectName()); + Assert.assertNotNull(issues); + Assert.assertTrue(issues.length > 0); + } + + @Test + public void getVersions() throws Exception { + Version[] versions = getService().getVersions(getFixtures().projectName()); + Assert.assertNotNull(versions); + Assert.assertTrue(versions.length > 0); + } + + @Test + public void getVersion() throws Exception { + Version version = getService().getVersion(getFixtures().projectName(), + getFixtures().versionName()); + Assert.assertNotNull(version); + } + + @Test + public void getIssueCategories() throws Exception { + // Need to be loggued ? don't know why :( Need to report a bug + IssueCategory[] issueCategories = getService().getIssueCategories(getFixtures().projectName()); + Assert.assertNotNull(issueCategories); + Assert.assertTrue(issueCategories.length > 0); + } + + @Test + public void getProjectMembers() throws Exception { + // Need to be loggued ? don't know why :( Need to report a bug + User[] users = getService().getProjectMembers(getFixtures().projectName()); + Assert.assertNotNull(users); + Assert.assertTrue(users.length > 0); + } + + @Test + public void getOpenedIssues() throws Exception { + Issue[] issues = getService().getOpenedIssues(getFixtures().projectName()); + Assert.assertNotNull(issues); + Assert.assertTrue(issues.length > 0); + } + + @Test + public void getClosedIssues() throws Exception { + Issue[] issues = getService().getClosedIssues(getFixtures().projectName()); + Assert.assertNotNull(issues); + Assert.assertTrue(issues.length > 0); + } + + @Test + public void getIssueTimeEntries() throws Exception { + TimeEntry[] timeEntries = getService().getIssueTimeEntries(getFixtures().projectName(), getFixtures().issueId()); + Assert.assertNotNull(timeEntries); + Assert.assertTrue(timeEntries.length > 0); + } + + @Test + public void getIssuePriorities() throws Exception { + IssuePriority[] issuePriorities = getService().getIssuePriorities(); + Assert.assertNotNull(issuePriorities); + Assert.assertTrue(issuePriorities.length > 0); + } + + @Test + public void getIssueStatuses() throws Exception { + IssueStatus[] issueStatuses = getService().getIssueStatuses(); + Assert.assertNotNull(issueStatuses); + Assert.assertTrue(issueStatuses.length > 0); + } + + @Test + public void getTrackers() throws Exception { + Tracker[] trackers = getService().getTrackers(getFixtures().projectName()); + Assert.assertNotNull(trackers); + Assert.assertTrue(trackers.length > 0); + } + + @Test + public void getVersionIssues() throws Exception { + Issue[] issues = getService().getIssues(getFixtures().projectName(), getFixtures().versionName()); + Assert.assertNotNull(issues); + Assert.assertTrue(issues.length > 0); + } + + @Test + public void getAttachments() throws Exception { + Attachment[] attachments = getService().getAttachments(getFixtures().projectName(), getFixtures().versionName()); + Assert.assertNotNull(attachments); + Assert.assertTrue(attachments.length > 0); + } + +} \ No newline at end of file Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineAnonymousServiceTest.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineFixtures.java =================================================================== --- branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineFixtures.java (rev 0) +++ branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineFixtures.java 2012-10-03 22:54:20 UTC (rev 335) @@ -0,0 +1,175 @@ +package org.nuiton.jredmine; +/* + * #%L + * JRedmine :: Client + * $Id$ + * $HeadURL: http://svn.nuiton.org/svn/jredmine/branches/jredmine-1.x/jredmine-client/src... $ + * %% + * Copyright (C) 2009 - 2012 Tony Chemit, CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +import org.apache.commons.lang3.time.DateUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.codehaus.plexus.util.FileUtils; +import org.nuiton.jredmine.model.Attachment; +import org.nuiton.jredmine.model.News; +import org.nuiton.jredmine.model.TimeEntry; +import org.nuiton.jredmine.model.Version; + +import java.io.File; +import java.io.IOException; +import java.util.Date; + +/** + * TODO + * + * @author tchemit <chemit@codelutin.com> + * @since 1.4 + */ +public class RedmineFixtures { + + /** Logger. */ + private static final Log log = LogFactory.getLog(RedmineFixtures.class); + + private RedmineServiceConfiguration anonymousConfiguration; + + private RedmineServiceConfiguration logguedConfiguration; + + public static final int TIMESTAMP = Math.abs((int) System.nanoTime()); + + public String projectName() { + return "project1"; + } + + public String versionName() { + return "1.0"; + } + + public String versionId() { + return "1"; + } + + public String issueId() { + return "1"; + } + + public RedmineServiceConfiguration newAnonymousConfiguration() + throws IOException { + RedmineServiceConfiguration conf = RedmineConfigurationUtil.cloneConfiguration(getAnonymousConfiguration()); + return conf; + } + + public RedmineServiceConfiguration newLogguedConfiguration() + throws IOException { + RedmineServiceConfiguration conf = RedmineConfigurationUtil.cloneConfiguration(getLogguedConfiguration()); + return conf; + } + + public RedmineAnonymousService newRedmineAnonymousService(RedmineServiceConfiguration configuration) + throws IOException, RedmineServiceException { + RedmineAnonymousService service = new DefaultRedmineAnonymousService(); + service.init(configuration); + return service; + } + + public RedmineService newRedmineService(RedmineServiceConfiguration configuration) + throws IOException, RedmineServiceException { + RedmineService service = new DefaultRedmineService(); + service.init(configuration); + return service; + } + + protected RedmineServiceConfiguration getAnonymousConfiguration() + throws IOException { + if (anonymousConfiguration == null) { + anonymousConfiguration = RedmineConfigurationUtil.newAnonymousConfiguration( + "jredmine-test.properties", + "/test-config.properties" + ); + + } + return anonymousConfiguration; + } + + protected RedmineServiceConfiguration getLogguedConfiguration() + throws IOException { + if (logguedConfiguration == null) { + + RedmineServiceConfiguration anoConf = getAnonymousConfiguration(); + logguedConfiguration = RedmineConfigurationUtil.newLogguedConfiguration(anoConf); + } + return logguedConfiguration; + } + + public Version versionToAdd() { + Version version = new Version(); + version.setId(TIMESTAMP); + version.setName(versionName() + "_" + TIMESTAMP); + version.setDescription("Version to add"); + return version; + } + + public Version versionToUpdate() { + Version version = new Version(); + version.setName(versionName()); + version.setId(Integer.valueOf(versionId())); + version.setDescription("Version to update"); + return version; + } + + public String oldVersionName() { + return "1.2"; + } + + public News newsToAdd() { + News news = new News(); + news.setTitle("Title"); + news.setDescription("Description"); + news.setSummary("Summary"); + return news; + } + + public TimeEntry timeEntryToAdd() { + TimeEntry timeEntry = new TimeEntry(); + timeEntry.setComments("Comments"); + Date date = new Date(); + DateUtils.setYears(date, 2012); + date = DateUtils.setMonths(date, 6); + date = DateUtils.setDays(date, 15); + timeEntry.setSpentOn(date); + return timeEntry; + } + + public Attachment attachmentToAdd() { + Attachment attachmentToAdd = new Attachment(); + attachmentToAdd.setDescription("Description"); + File tmpDir = FileUtils.createTempFile("tmpDir", null, null); + File file = new File(tmpDir, TIMESTAMP + ".txt"); + try { + FileUtils.mkdir(file.getParent()); + FileUtils.fileWrite(file, "Content of file " + TIMESTAMP); + } catch (IOException e) { + if (log.isErrorEnabled()) { + log.error("Could not write file content to " + file, e); + } + } + attachmentToAdd.setToUpload(file); + return attachmentToAdd; + } +} Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineFixtures.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineLogguedFixtureClassRule.java =================================================================== --- branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineLogguedFixtureClassRule.java (rev 0) +++ branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineLogguedFixtureClassRule.java 2012-10-03 22:54:20 UTC (rev 335) @@ -0,0 +1,98 @@ +package org.nuiton.jredmine; +/* + * #%L + * JRedmine :: Client + * $Id$ + * $HeadURL: http://svn.nuiton.org/svn/jredmine/branches/jredmine-1.x/jredmine-client/src... $ + * %% + * Copyright (C) 2009 - 2012 Tony Chemit, CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.junit.Assume; +import org.junit.rules.TestRule; +import org.junit.runner.Description; +import org.junit.runners.model.Statement; + +import java.io.IOException; + +/** + * A class rule that provider the {@link RedmineFixtures} and check that the + * valid loggued configuration is found. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.4 + */ +public class RedmineLogguedFixtureClassRule implements TestRule { + + /** Logger. */ + private static final Log log = + LogFactory.getLog(RedmineLogguedFixtureClassRule.class); + + RedmineFixtures fixtures = new RedmineFixtures(); + + RedmineServiceConfiguration conf; + + @Override + public Statement apply(Statement base, Description description) { + + Class<?> testClass = description.getTestClass(); + + try { + conf = RedmineConfigurationUtil.obtainRedmineConfiguration( + fixtures.newAnonymousConfiguration()); + + if (conf == null) { + + // could not find any configuration + if (log.isWarnEnabled()) { + log.warn("could not connect to server " + + fixtures.newAnonymousConfiguration() + ", will skip test " + + testClass.getName()); + } + Assume.assumeTrue(false); + } else { + + // configuration must NOT be anonymous + + if (conf.isAnonymous()) { + + if (log.isWarnEnabled()) { + log.warn("A authenticated configuration was required, will skip test " + + testClass.getName()); + } + Assume.assumeTrue(false); + } + } + + } catch (IOException e) { + throw new IllegalStateException("Could not check jredmine configuration in test " + testClass.getName(), e); + + } + return base; + } + + public RedmineFixtures getFixtures() { + return fixtures; + } + + public RedmineServiceConfiguration getConf() { + return conf; + } +} Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineLogguedFixtureClassRule.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineLogguedServiceAsAnonymousTest.java =================================================================== --- branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineLogguedServiceAsAnonymousTest.java (rev 0) +++ branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineLogguedServiceAsAnonymousTest.java 2012-10-03 22:54:20 UTC (rev 335) @@ -0,0 +1,228 @@ +package org.nuiton.jredmine; +/* + * #%L + * JRedmine :: Client + * $Id$ + * $HeadURL: http://svn.nuiton.org/svn/jredmine/branches/jredmine-1.x/jredmine-client/src... $ + * %% + * Copyright (C) 2009 - 2012 Tony Chemit, CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +import org.junit.Assert; +import org.junit.ClassRule; +import org.junit.Rule; +import org.junit.Test; +import org.nuiton.jredmine.model.Attachment; +import org.nuiton.jredmine.model.Issue; +import org.nuiton.jredmine.model.IssueCategory; +import org.nuiton.jredmine.model.IssuePriority; +import org.nuiton.jredmine.model.IssueStatus; +import org.nuiton.jredmine.model.News; +import org.nuiton.jredmine.model.Project; +import org.nuiton.jredmine.model.TimeEntry; +import org.nuiton.jredmine.model.Tracker; +import org.nuiton.jredmine.model.User; +import org.nuiton.jredmine.model.Version; + +import java.io.IOException; + +/** + * Tests the {@link RedmineService} service with anonymous configuration. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.4 + */ +public class RedmineLogguedServiceAsAnonymousTest { + + @ClassRule + public static final RedmineAnonymousFixtureClassRule classRule = + new RedmineAnonymousFixtureClassRule(); + + + protected RedmineFixtures getFixtures() { + return server.getFixtures(); + } + + @Rule + public final RedmineServer<RedmineService> server = new RedmineServer<RedmineService>(classRule.getFixtures()) { + + @Override + protected RedmineService createService( + RedmineServiceConfiguration configuration) throws IOException, RedmineServiceException { + + return fixtures.newRedmineService(configuration); + } + + @Override + protected RedmineServiceConfiguration createConfiguration() throws IOException { + RedmineServiceConfiguration conf = fixtures.newAnonymousConfiguration(); + return conf; + } + }; + + protected RedmineService getService() { + return server.getService(); + } + + @Test + public void getProjects() throws Exception { + Project[] projects = getService().getProjects(); + Assert.assertNotNull(projects); + Assert.assertTrue(projects.length > 0); + } + + @Test + public void getProject() throws Exception { + Project project = getService().getProject(getFixtures().projectName()); + Assert.assertNotNull(project); + } + + @Test + public void getNews() throws Exception { + News[] news = getService().getNews(getFixtures().projectName()); + Assert.assertNotNull(news); + Assert.assertTrue(news.length > 0); + } + + @Test + public void getProjectIssues() throws Exception { + Issue[] issues = getService().getIssues(getFixtures().projectName()); + Assert.assertNotNull(issues); + Assert.assertTrue(issues.length > 0); + } + + @Test + public void getVersions() throws Exception { + Version[] versions = getService().getVersions(getFixtures().projectName()); + Assert.assertNotNull(versions); + Assert.assertTrue(versions.length > 0); + } + + @Test + public void getVersion() throws Exception { + Version version = getService().getVersion(getFixtures().projectName(), getFixtures().versionName()); + Assert.assertNotNull(version); + } + + @Test + public void getIssueCategories() throws Exception { + // Need to be loggued ? don't know why :( Need to report a bug + IssueCategory[] issueCategories = getService().getIssueCategories(getFixtures().projectName()); + Assert.assertNotNull(issueCategories); + Assert.assertTrue(issueCategories.length > 0); + } + + @Test + public void getProjectMembers() throws Exception { + // Need to be loggued ? don't know why :( Need to report a bug + User[] users = getService().getProjectMembers(getFixtures().projectName()); + Assert.assertNotNull(users); + Assert.assertTrue(users.length > 0); + } + + @Test + public void getOpenedIssues() throws Exception { + Issue[] issues = getService().getOpenedIssues(getFixtures().projectName()); + Assert.assertNotNull(issues); + Assert.assertTrue(issues.length > 0); + } + + @Test + public void getClosedIssues() throws Exception { + Issue[] issues = getService().getClosedIssues(getFixtures().projectName()); + Assert.assertNotNull(issues); + Assert.assertTrue(issues.length > 0); + } + + @Test + public void getIssueTimeEntries() throws Exception { + TimeEntry[] timeEntries = getService().getIssueTimeEntries(getFixtures().projectName(), getFixtures().issueId()); + Assert.assertNotNull(timeEntries); + Assert.assertTrue(timeEntries.length > 0); + } + + @Test + public void getIssuePriorities() throws Exception { + IssuePriority[] issuePriorities = getService().getIssuePriorities(); + Assert.assertNotNull(issuePriorities); + Assert.assertTrue(issuePriorities.length > 0); + } + + @Test + public void getIssueStatuses() throws Exception { + IssueStatus[] issueStatuses = getService().getIssueStatuses(); + Assert.assertNotNull(issueStatuses); + Assert.assertTrue(issueStatuses.length > 0); + } + + @Test + public void getTrackers() throws Exception { + Tracker[] trackers = getService().getTrackers(getFixtures().projectName()); + Assert.assertNotNull(trackers); + Assert.assertTrue(trackers.length > 0); + } + + @Test + public void getVersionIssues() throws Exception { + Issue[] issues = getService().getIssues(getFixtures().projectName(), getFixtures().versionName()); + Assert.assertNotNull(issues); + Assert.assertTrue(issues.length > 0); + } + + @Test + public void getAttachments() throws Exception { + Attachment[] attachments = getService().getAttachments(getFixtures().projectName(), getFixtures().versionName()); + Assert.assertNotNull(attachments); + Assert.assertTrue(attachments.length > 0); + } + + @Test(expected = RedmineServiceLoginException.class) + public void getUserProjects() throws Exception { + getService().getUserProjects(); + } + + @Test(expected = RedmineServiceLoginException.class) + public void addVersion() throws Exception { + getService().addVersion(getFixtures().projectName(), new Version()); + } + + @Test(expected = RedmineServiceLoginException.class) + public void addAttachment() throws Exception { + getService().addAttachment(getFixtures().projectName(), getFixtures().versionName(), new Attachment()); + } + + @Test(expected = RedmineServiceLoginException.class) + public void addNews() throws Exception { + getService().addNews(getFixtures().projectName(), new News()); + } + + @Test(expected = RedmineServiceLoginException.class) + public void updateVersion() throws Exception { + getService().updateVersion(getFixtures().projectName(), new Version()); + } + + @Test(expected = RedmineServiceLoginException.class) + public void nextVersion() throws Exception { + getService().nextVersion(getFixtures().projectName(), getFixtures().versionName(), new Version()); + } + + @Test(expected = RedmineServiceLoginException.class) + public void addIssueTime() throws Exception { + getService().addIssueTimeEntry(getFixtures().projectName(), getFixtures().issueId(), new TimeEntry()); + } +} Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineLogguedServiceAsAnonymousTest.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineLogguedServiceTest.java =================================================================== --- branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineLogguedServiceTest.java (rev 0) +++ branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineLogguedServiceTest.java 2012-10-03 22:54:20 UTC (rev 335) @@ -0,0 +1,235 @@ +package org.nuiton.jredmine; +/* + * #%L + * JRedmine :: Client + * $Id$ + * $HeadURL: http://svn.nuiton.org/svn/jredmine/branches/jredmine-1.x/jredmine-client/src... $ + * %% + * Copyright (C) 2009 - 2012 Tony Chemit, CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +import org.junit.Assert; +import org.junit.ClassRule; +import org.junit.Ignore; +import org.junit.Rule; +import org.junit.Test; +import org.nuiton.jredmine.model.Attachment; +import org.nuiton.jredmine.model.Issue; +import org.nuiton.jredmine.model.IssueCategory; +import org.nuiton.jredmine.model.IssuePriority; +import org.nuiton.jredmine.model.IssueStatus; +import org.nuiton.jredmine.model.News; +import org.nuiton.jredmine.model.Project; +import org.nuiton.jredmine.model.TimeEntry; +import org.nuiton.jredmine.model.Tracker; +import org.nuiton.jredmine.model.User; +import org.nuiton.jredmine.model.Version; + +import java.io.IOException; + +/** + * Tests the {@link RedmineService} service with loggued configuration. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.4 + */ +public class RedmineLogguedServiceTest { + + @ClassRule + public static final RedmineLogguedFixtureClassRule classRule = + new RedmineLogguedFixtureClassRule(); + + @Rule + public final RedmineServer<RedmineService> server = new RedmineServer<RedmineService>(classRule.getFixtures()) { + + @Override + protected RedmineService createService( + RedmineServiceConfiguration configuration) throws IOException, RedmineServiceException { + return fixtures.newRedmineService(configuration); + } + + @Override + protected RedmineServiceConfiguration createConfiguration() throws IOException { + RedmineServiceConfiguration conf = fixtures.newLogguedConfiguration(); + return conf; + } + }; + + protected RedmineFixtures getFixtures() { + return server.getFixtures(); + } + + protected RedmineService getService() { + return server.getService(); + } + + @Test + public void getProjects() throws Exception { + Project[] projects = getService().getProjects(); + Assert.assertNotNull(projects); + Assert.assertTrue(projects.length > 0); + } + + @Test + public void getProject() throws Exception { + Project project = getService().getProject(getFixtures().projectName()); + Assert.assertNotNull(project); + } + + @Test + public void getNews() throws Exception { + News[] news = getService().getNews(getFixtures().projectName()); + Assert.assertNotNull(news); + Assert.assertTrue(news.length > 0); + } + + @Test + public void getProjectIssues() throws Exception { + Issue[] issues = getService().getIssues(getFixtures().projectName()); + Assert.assertNotNull(issues); + Assert.assertTrue(issues.length > 0); + } + + @Test + public void getVersions() throws Exception { + Version[] versions = getService().getVersions(getFixtures().projectName()); + Assert.assertNotNull(versions); + Assert.assertTrue(versions.length > 0); + } + + @Test + public void getVersion() throws Exception { + Version version = getService().getVersion(getFixtures().projectName(), getFixtures().versionName()); + Assert.assertNotNull(version); + } + + @Test + public void getIssueCategories() throws Exception { + // Need to be loggued ? don't know why :( Need to report a bug + IssueCategory[] issueCategories = getService().getIssueCategories(getFixtures().projectName()); + Assert.assertNotNull(issueCategories); + Assert.assertTrue(issueCategories.length > 0); + } + + @Test + public void getProjectMembers() throws Exception { + // Need to be loggued ? don't know why :( Need to report a bug + User[] users = getService().getProjectMembers(getFixtures().projectName()); + Assert.assertNotNull(users); + Assert.assertTrue(users.length > 0); + } + + @Test + public void getOpenedIssues() throws Exception { + Issue[] issues = getService().getOpenedIssues(getFixtures().projectName()); + Assert.assertNotNull(issues); + Assert.assertTrue(issues.length > 0); + } + + @Test + public void getClosedIssues() throws Exception { + Issue[] issues = getService().getClosedIssues(getFixtures().projectName()); + Assert.assertNotNull(issues); + Assert.assertTrue(issues.length > 0); + } + + @Test + public void getIssueTimeEntries() throws Exception { + TimeEntry[] timeEntries = getService().getIssueTimeEntries(getFixtures().projectName(), getFixtures().issueId()); + Assert.assertNotNull(timeEntries); + Assert.assertTrue(timeEntries.length > 0); + } + + @Test + public void getIssuePriorities() throws Exception { + IssuePriority[] issuePriorities = getService().getIssuePriorities(); + Assert.assertNotNull(issuePriorities); + Assert.assertTrue(issuePriorities.length > 0); + } + + @Test + public void getIssueStatuses() throws Exception { + IssueStatus[] issueStatuses = getService().getIssueStatuses(); + Assert.assertNotNull(issueStatuses); + Assert.assertTrue(issueStatuses.length > 0); + } + + @Test + public void getTrackers() throws Exception { + Tracker[] trackers = getService().getTrackers(getFixtures().projectName()); + Assert.assertNotNull(trackers); + Assert.assertTrue(trackers.length > 0); + } + + @Test + public void getVersionIssues() throws Exception { + Issue[] issues = getService().getIssues(getFixtures().projectName(), getFixtures().versionName()); + Assert.assertNotNull(issues); + Assert.assertTrue(issues.length > 0); + } + + @Test + public void getAttachments() throws Exception { + Attachment[] attachments = getService().getAttachments(getFixtures().projectName(), getFixtures().versionName()); + Assert.assertNotNull(attachments); + Assert.assertTrue(attachments.length > 0); + } + + @Ignore + @Test + public void addVersion() throws Exception { + getService().addVersion(getFixtures().projectName(), getFixtures().versionToAdd()); + } + + @Ignore + @Test + public void addAttachment() throws Exception { + Version version = getFixtures().versionToUpdate(); + Attachment attachment = getFixtures().attachmentToAdd(); + Attachment updatedAttachment = getService().addAttachment( + getFixtures().projectName(), + version.getName(), + attachment + ); + Assert.assertNotNull(updatedAttachment); + } + + @Ignore + @Test + public void addNews() throws Exception { + getService().addNews(getFixtures().projectName(), getFixtures().newsToAdd()); + } + + @Ignore + @Test + public void updateVersion() throws Exception { + getService().updateVersion(getFixtures().projectName(), getFixtures().versionToUpdate()); + } + + @Ignore + @Test + public void nextVersion() throws Exception { + getService().nextVersion(getFixtures().projectName(), getFixtures().versionName(), getFixtures().versionToUpdate()); + } + + @Ignore + @Test + public void addIssueTime() throws Exception { + getService().addIssueTimeEntry(getFixtures().projectName(), getFixtures().issueId(), getFixtures().timeEntryToAdd()); + } +} Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineLogguedServiceTest.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineServer.java =================================================================== --- branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineServer.java (rev 0) +++ branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineServer.java 2012-10-03 22:54:20 UTC (rev 335) @@ -0,0 +1,109 @@ +package org.nuiton.jredmine; +/* + * #%L + * JRedmine :: Client + * $Id$ + * $HeadURL: http://svn.nuiton.org/svn/jredmine/branches/jredmine-1.x/jredmine-client/src... $ + * %% + * Copyright (C) 2009 - 2012 Tony Chemit, CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +import org.junit.rules.TestWatcher; +import org.junit.runner.Description; + +import java.io.IOException; + +/** + * A redmine server resource used by tests. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.4 + */ +public abstract class RedmineServer<S extends RedmineAnonymousService> extends TestWatcher { + + /** + * Fixtures. + * + * @since 1.4 + */ + protected final RedmineFixtures fixtures; + + /** + * Service configuration to use. + * + * @since 1.4 + */ + protected RedmineServiceConfiguration configuration; + + /** + * Redmine service to use. + * + * @since 1.4 + */ + protected S service; + + public RedmineServer(RedmineFixtures fixtures) { + this.fixtures = fixtures; + } + + protected abstract S createService(RedmineServiceConfiguration configuration) throws IOException, RedmineServiceException; + + protected abstract RedmineServiceConfiguration createConfiguration() throws IOException; + + public RedmineFixtures getFixtures() { + return fixtures; + } + + public RedmineServiceConfiguration getConfiguration() { + return configuration; + } + + public S getService() { + return service; + } + + @Override + protected void starting(Description description) { + + try { + configuration = createConfiguration(); + } catch (IOException e) { + + throw new IllegalStateException("Could not create configuration", e); + } + + try { + service = createService(configuration); + } catch (Exception e) { + throw new IllegalStateException("Could not create service", e); + } + } + + @Override + protected void finished(Description description) { + + if (service != null) { + try { + service.destroy(); + } catch (RedmineServiceException e) { + throw new IllegalStateException("Could not close service ", e); + } + } + } + +} \ No newline at end of file Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/java/org/nuiton/jredmine/RedmineServer.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/resources/log4j.properties =================================================================== --- branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/resources/log4j.properties (rev 0) +++ branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/resources/log4j.properties 2012-10-03 22:54:20 UTC (rev 335) @@ -0,0 +1,10 @@ +log4j.rootCategory=WARN, stdout + +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=[%p] (%c{1}:%L) - %m%n + +log4j.logger.org.nuiton.jredmine=INFO +log4j.logger.org.nuiton.io.rest=INFO +#log4j.logger.org.nuiton.io.xpp3.Xpp3Helper=DEBUG +log4j.logger.org.apache.commons.httpclient.HttpClient=INFO Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-test/src/main/resources/log4j.properties ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: branches/jredmine-1.x/jredmine-client/src/it/settings.xml =================================================================== --- branches/jredmine-1.x/jredmine-client/src/it/settings.xml (rev 0) +++ branches/jredmine-1.x/jredmine-client/src/it/settings.xml 2012-10-03 22:54:20 UTC (rev 335) @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<settings> + + <servers> + <!-- login to jredmine test its --> + <server> + <id>jredmine-test-it</id> + <username>admin</username> + <password>{UrtS0TkvEAMHUUe8h1DQCoL2/Mh5NeXFavzNjGAEW3I=}</password> + </server> + </servers> + <profiles> + <profile> + <id>it-repo</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + <repositories> + <repository> + <id>local.central</id> + <url>file:///@localRepository@</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>local.central</id> + <url>file:///@localRepository@</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </pluginRepository> + </pluginRepositories> + </profile> + </profiles> + + <pluginGroups> + <pluginGroup>org.nuiton.jredmine</pluginGroup> + </pluginGroups> +</settings> Property changes on: branches/jredmine-1.x/jredmine-client/src/it/settings.xml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: branches/jredmine-1.x/jredmine-client/src/test/resources/log4j.properties =================================================================== --- branches/jredmine-1.x/jredmine-client/src/test/resources/log4j.properties 2012-10-03 22:53:13 UTC (rev 334) +++ branches/jredmine-1.x/jredmine-client/src/test/resources/log4j.properties 2012-10-03 22:54:20 UTC (rev 335) @@ -21,23 +21,6 @@ # License along with this program. If not, see # <http://www.gnu.org/licenses/lgpl-3.0.html>. # #L% -### -# 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. log4j.rootCategory=WARN, stdout
participants (1)
-
tchemit@users.nuiton.org