Jredmine-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
October 2012
- 2 participants
- 66 discussions
r342 - branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test
by tchemit@users.nuiton.org 04 Oct '12
by tchemit@users.nuiton.org 04 Oct '12
04 Oct '12
Author: tchemit
Date: 2012-10-04 11:42:55 +0200 (Thu, 04 Oct 2012)
New Revision: 342
Url: http://nuiton.org/repositories/revision/jredmine/342
Log:
fix build
Modified:
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/RedmineAnonymousFixtureClassRule.java
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/RedmineFixtureClassRule.java
Modified: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/RedmineAnonymousFixtureClassRule.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/RedmineAnonymousFixtureClassRule.java 2012-10-04 09:39:09 UTC (rev 341)
+++ branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/RedmineAnonymousFixtureClassRule.java 2012-10-04 09:42:55 UTC (rev 342)
@@ -29,13 +29,12 @@
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
-import org.nuiton.jredmine.RedmineFixtures;
import org.nuiton.jredmine.RedmineServiceConfiguration;
import java.io.IOException;
/**
- * A class rule that provider the {@link RedmineFixtures} and check that the
+ * A class rule that provider the {@link AbstractRedmineFixtures} and check that the
* valid anonymous configuration is found.
*
* @author tchemit <chemit(a)codelutin.com>
Modified: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/RedmineFixtureClassRule.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/RedmineFixtureClassRule.java 2012-10-04 09:39:09 UTC (rev 341)
+++ branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/RedmineFixtureClassRule.java 2012-10-04 09:42:55 UTC (rev 342)
@@ -29,13 +29,12 @@
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
-import org.nuiton.jredmine.RedmineFixtures;
import org.nuiton.jredmine.RedmineServiceConfiguration;
import java.io.IOException;
/**
- * A class rule that provider the {@link RedmineFixtures} and check that the
+ * A class rule that provider the {@link AbstractRedmineFixtures} and check that the
* valid loggued configuration is found.
*
* @author tchemit <chemit(a)codelutin.com>
1
0
r341 - in branches/jredmine-1.x/jredmine-client/src/it: redmine-1.4.x/src/test/resources redmine-2.0.x/src/test/resources redmine-2.1.x/src/test/resources
by tchemit@users.nuiton.org 04 Oct '12
by tchemit@users.nuiton.org 04 Oct '12
04 Oct '12
Author: tchemit
Date: 2012-10-04 11:39:09 +0200 (Thu, 04 Oct 2012)
New Revision: 341
Url: http://nuiton.org/repositories/revision/jredmine/341
Log:
fix build
Added:
branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/src/test/resources/log4j.properties
branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/src/test/resources/log4j.properties
branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/src/test/resources/log4j.properties
Added: branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/src/test/resources/log4j.properties
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/src/test/resources/log4j.properties (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/src/test/resources/log4j.properties 2012-10-04 09:39:09 UTC (rev 341)
@@ -0,0 +1,34 @@
+###
+# #%L
+# JRedmine :: Client
+#
+# $Id$
+# $HeadURL: http://svn.nuiton.org/svn/jredmine/branches/jredmine-1.x/jredmine-client/sr… $
+# %%
+# Copyright (C) 2009 - 2010 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%
+
+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-1.4.x/src/test/resources/log4j.properties
___________________________________________________________________
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/log4j.properties
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/src/test/resources/log4j.properties (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/src/test/resources/log4j.properties 2012-10-04 09:39:09 UTC (rev 341)
@@ -0,0 +1,34 @@
+###
+# #%L
+# JRedmine :: Client
+#
+# $Id$
+# $HeadURL: http://svn.nuiton.org/svn/jredmine/branches/jredmine-1.x/jredmine-client/sr… $
+# %%
+# Copyright (C) 2009 - 2010 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%
+
+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-2.0.x/src/test/resources/log4j.properties
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/src/test/resources/log4j.properties
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/src/test/resources/log4j.properties (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/src/test/resources/log4j.properties 2012-10-04 09:39:09 UTC (rev 341)
@@ -0,0 +1,34 @@
+###
+# #%L
+# JRedmine :: Client
+#
+# $Id$
+# $HeadURL: http://svn.nuiton.org/svn/jredmine/branches/jredmine-1.x/jredmine-client/sr… $
+# %%
+# Copyright (C) 2009 - 2010 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%
+
+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-2.1.x/src/test/resources/log4j.properties
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
1
0
r340 - in branches/jredmine-1.x/jredmine-client/src/it: redmine-1.4.x redmine-1.4.x/src/test/java/org/nuiton/jredmine redmine-2.0.x redmine-2.0.x/src/test/java/org/nuiton/jredmine redmine-2.1.x redmine-2.1.x/src/test/java/org/nuiton/jredmine
by tchemit@users.nuiton.org 04 Oct '12
by tchemit@users.nuiton.org 04 Oct '12
04 Oct '12
Author: tchemit
Date: 2012-10-04 11:36:40 +0200 (Thu, 04 Oct 2012)
New Revision: 340
Url: http://nuiton.org/repositories/revision/jredmine/340
Log:
fix test build
Modified:
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/src/test/java/org/nuiton/jredmine/
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/src/test/java/org/nuiton/jredmine/
branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/pom.xml
branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/src/test/java/org/nuiton/jredmine/
Modified: 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 2012-10-04 09:28:43 UTC (rev 339)
+++ branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/pom.xml 2012-10-04 09:36:40 UTC (rev 340)
@@ -44,7 +44,7 @@
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>jredmine-client-test</artifactId>
+ <artifactId>jredmine-client</artifactId>
<version>${project.version}</version>
</dependency>
Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/src/test/java/org/nuiton/jredmine
___________________________________________________________________
Added: svn:externals
+ test http://svn.nuiton.org/svn/jredmine/branches/jredmine-1.x/jredmine-client/sr…
Modified: 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 2012-10-04 09:28:43 UTC (rev 339)
+++ branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/pom.xml 2012-10-04 09:36:40 UTC (rev 340)
@@ -44,7 +44,7 @@
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>jredmine-client-test</artifactId>
+ <artifactId>jredmine-client</artifactId>
<version>${project.version}</version>
</dependency>
Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/src/test/java/org/nuiton/jredmine
___________________________________________________________________
Added: svn:externals
+ test http://svn.nuiton.org/svn/jredmine/branches/jredmine-1.x/jredmine-client/sr…
Modified: branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/pom.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/pom.xml 2012-10-04 09:28:43 UTC (rev 339)
+++ branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/pom.xml 2012-10-04 09:36:40 UTC (rev 340)
@@ -44,7 +44,7 @@
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>jredmine-client-test</artifactId>
+ <artifactId>jredmine-client</artifactId>
<version>${project.version}</version>
</dependency>
Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/src/test/java/org/nuiton/jredmine
___________________________________________________________________
Added: svn:externals
+ test http://svn.nuiton.org/svn/jredmine/branches/jredmine-1.x/jredmine-client/sr…
1
0
Author: tchemit
Date: 2012-10-04 11:28:43 +0200 (Thu, 04 Oct 2012)
New Revision: 339
Url: http://nuiton.org/repositories/revision/jredmine/339
Log:
improve tests
Added:
branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/
branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/LICENSE.txt
branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/README.txt
branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/changelog.txt
branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/goals.txt
branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/pom.xml
branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/postbuild.groovy
branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/src/
branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/src/test/
branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/src/test/java/
branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/src/test/java/org/
branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/src/test/java/org/nuiton/
branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/src/test/java/org/nuiton/jredmine/
branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/src/test/resources/
branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/src/test/resources/test-config.properties
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/model/io/xpp3/RedmineModelFixtures.java
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/AbstractRedmineFixtures.java
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/RedmineAnonymousFixtureClassRule.java
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/RedmineFixtureClassRule.java
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/RedmineServer.java
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/tck/
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/tck/RedmineAnonymousServiceTCK.java
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/tck/RedmineServiceAsAnonymousTCK.java
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/tck/RedmineServiceTCK.java
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/tck/RedmineTCKFixtures.java
Removed:
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-2.0.x/src/test/java/org/nuiton/jredmine/JRedmineTCKTest.java
branches/jredmine-1.x/jredmine-client/src/it/redmine-test/
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineAnonymousFixtureClassRule.java
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineLogguedFixtureClassRule.java
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineServer.java
Modified:
branches/jredmine-1.x/jredmine-client/pom.xml
branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/pom.xml
branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/pom.xml
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineAnonymousServiceTest.java
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineFixtures.java
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineServiceAsAnonymousTest.java
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineServiceTest.java
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3HelperTest.java
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/rest/RedmineRestClientTest.java
Modified: branches/jredmine-1.x/jredmine-client/pom.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/pom.xml 2012-10-03 23:21:54 UTC (rev 338)
+++ branches/jredmine-1.x/jredmine-client/pom.xml 2012-10-04 09:28:43 UTC (rev 339)
@@ -260,6 +260,7 @@
<pomIncludes>
<pomInclude>redmine-1.4.x/pom.xml</pomInclude>
<pomInclude>redmine-2.0.x/pom.xml</pomInclude>
+ <pomInclude>redmine-2.1.x/pom.xml</pomInclude>
</pomIncludes>
</configuration>
</execution>
Modified: 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 2012-10-03 23:21:54 UTC (rev 338)
+++ branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/pom.xml 2012-10-04 09:28:43 UTC (rev 339)
@@ -96,6 +96,15 @@
</executions>
</plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>**/*TCK.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+
</plugins>
</build>
Deleted: 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 2012-10-03 23:21:54 UTC (rev 338)
+++ branches/jredmine-1.x/jredmine-client/src/it/redmine-1.4.x/src/test/java/org/nuiton/jredmine/JRedmineTCKTest.java 2012-10-04 09:28:43 UTC (rev 339)
@@ -1,20 +0,0 @@
-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(a)codelutin.com>
- * @since 1.4
- */
-(a)Suite.SuiteClasses(
- {
- RedmineAnonymousServiceTest.class,
- RedmineLogguedServiceAsAnonymousTest.class,
- RedmineLogguedServiceTest.class
- }
-)
-(a)RunWith(Suite.class)
-public class JRedmineTCKTest { }
Modified: 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 2012-10-03 23:21:54 UTC (rev 338)
+++ branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/pom.xml 2012-10-04 09:28:43 UTC (rev 339)
@@ -96,6 +96,15 @@
</executions>
</plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>**/*TCK.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+
</plugins>
</build>
Deleted: 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 2012-10-03 23:21:54 UTC (rev 338)
+++ branches/jredmine-1.x/jredmine-client/src/it/redmine-2.0.x/src/test/java/org/nuiton/jredmine/JRedmineTCKTest.java 2012-10-04 09:28:43 UTC (rev 339)
@@ -1,21 +0,0 @@
-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(a)codelutin.com>
- * @since 1.4
- */
-(a)Suite.SuiteClasses(
- {
- RedmineAnonymousServiceTest.class,
- RedmineLogguedServiceAsAnonymousTest.class,
- RedmineLogguedServiceTest.class
- }
-)
-(a)RunWith(Suite.class)
-public class JRedmineTCKTest {
-}
Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x
___________________________________________________________________
Added: svn:ignore
+ target
*.ipr
*.iws
*.iml
.idea
*.log
Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.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.1.x/README.txt
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/README.txt (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/README.txt 2012-10-04 09:28:43 UTC (rev 339)
@@ -0,0 +1 @@
+Module dans lequel on lance la baterrie de tests sur un redmine 2.1.x
\ No newline at end of file
Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.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.1.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.1.x/goals.txt
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/goals.txt (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/goals.txt 2012-10-04 09:28:43 UTC (rev 339)
@@ -0,0 +1 @@
+clean test
\ No newline at end of file
Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.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.1.x/pom.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/pom.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/pom.xml 2012-10-04 09:28:43 UTC (rev 339)
@@ -0,0 +1,111 @@
+<?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.1.x</artifactId>
+ <name>JRedmine :: Client Test (redmine 2.1.x)</name>
+ <description>
+ JRedmine Test for redmine 2.1.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>
+
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>**/*TCK.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+
+</project>
Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.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.1.x/postbuild.groovy
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/postbuild.groovy (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/postbuild.groovy 2012-10-04 09:28:43 UTC (rev 339)
@@ -0,0 +1 @@
+return true;
Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.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.1.x/src/test/resources/test-config.properties
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/src/test/resources/test-config.properties (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/it/redmine-2.1.x/src/test/resources/test-config.properties 2012-10-04 09:28:43 UTC (rev 339)
@@ -0,0 +1,3 @@
+jredmine-test.url=http://r2.1.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.1.x/src/test/resources/test-config.properties
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineAnonymousFixtureClassRule.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineAnonymousFixtureClassRule.java 2012-10-03 23:21:54 UTC (rev 338)
+++ branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineAnonymousFixtureClassRule.java 2012-10-04 09:28:43 UTC (rev 339)
@@ -1,86 +0,0 @@
-package org.nuiton.jredmine;
-/*
- * #%L
- * JRedmine :: Client
- * $Id$
- * $HeadURL$
- * %%
- * 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(a)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 = fixtures.obtainRedmineConfiguration();
-
- 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;
- }
-}
Modified: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineAnonymousServiceTest.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineAnonymousServiceTest.java 2012-10-03 23:21:54 UTC (rev 338)
+++ branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineAnonymousServiceTest.java 2012-10-04 09:28:43 UTC (rev 339)
@@ -38,9 +38,9 @@
import org.nuiton.jredmine.model.Tracker;
import org.nuiton.jredmine.model.User;
import org.nuiton.jredmine.model.Version;
+import org.nuiton.jredmine.test.RedmineAnonymousFixtureClassRule;
+import org.nuiton.jredmine.test.RedmineServer;
-import java.io.IOException;
-
/**
* Tests the {@link RedmineAnonymousService} service.
*
@@ -50,26 +50,13 @@
public class RedmineAnonymousServiceTest {
@ClassRule
- public static final RedmineAnonymousFixtureClassRule classRule =
- new RedmineAnonymousFixtureClassRule();
+ public static final RedmineAnonymousFixtureClassRule<RedmineFixtures> classRule =
+ RedmineAnonymousFixtureClassRule.newFixtures(RedmineFixtures.class);
@Rule
- public final RedmineServer<RedmineAnonymousService> server = new RedmineServer<RedmineAnonymousService>(classRule.getFixtures()) {
+ public final RedmineServer<RedmineAnonymousService, RedmineFixtures> server =
+ RedmineServer.newAnonymousServer(classRule);
- @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();
}
Modified: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineFixtures.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineFixtures.java 2012-10-03 23:21:54 UTC (rev 338)
+++ branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineFixtures.java 2012-10-04 09:28:43 UTC (rev 339)
@@ -23,28 +23,19 @@
* #L%
*/
-import com.google.common.collect.ArrayListMultimap;
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.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 org.nuiton.jredmine.model.io.xpp3.RedmineDataConverter;
+import org.nuiton.jredmine.test.AbstractRedmineFixtures;
import java.io.File;
import java.io.IOException;
import java.util.Date;
-import java.util.List;
/**
* TODO
@@ -52,19 +43,13 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 1.4
*/
-public class RedmineFixtures {
+public class RedmineFixtures extends AbstractRedmineFixtures {
/** Logger. */
private static final Log log = LogFactory.getLog(RedmineFixtures.class);
- private ArrayListMultimap<Class<?>, Object> model;
+// private ArrayListMultimap<Class<?>, Object> model;
- private RedmineServiceConfiguration anonymousConfiguration;
-
- private RedmineServiceConfiguration logguedConfiguration;
-
- public static final int TIMESTAMP = Math.abs((int) System.nanoTime());
-
public String projectName() {
return "jredmine";
}
@@ -81,523 +66,469 @@
return "1925";
}
- public RedmineServiceConfiguration obtainRedmineConfiguration() throws IOException {
+// public List<Attachment> getAttachments() {
+// return get(Attachment.class);
+// }
+//
+// public List<Issue> getIssues() {
+// return get(Issue.class);
+// }
+//
+// public List<Project> getProjects() {
+// return get(Project.class);
+// }
+//
+// public List<Tracker> getTrackers() {
+// return get(Tracker.class);
+// }
+//
+// public List<User> getUsers() {
+// return get(User.class);
+// }
+//
+// public List<Version> getVersions() {
+// return get(Version.class);
+// }
+//
+// public <T> List<T> get(Class<T> modelType) {
+// if (model == null) {
+// try {
+// loadModel();
+// } catch (Exception ex) {
+// throw new RuntimeException(ex);
+// }
+// }
+// return (List<T>) model.get(modelType);
+// }
+//
+// public <T> T get(Class<T> type, int pos) {
+// List<T> ts = get(type);
+// return ts.get(pos);
+// }
+//
+// private void loadModel()
+// throws Exception {
+// model = ArrayListMultimap.create();
+//
+// Attachment tempA;
+// tempA = new Attachment();
+// tempA.setAuthorId((Integer) RedmineDataConverter.Integer.convert("4"));
+// tempA.setContainerId((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempA.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempA.setFilesize((Integer) RedmineDataConverter.Integer.convert("411"));
+// tempA.setDownloads((Integer) RedmineDataConverter.Integer.convert("0"));
+// tempA.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T12:56:41+02:00"));
+// tempA.setContainerType((String) RedmineDataConverter.Text.convert("Version"));
+// tempA.setContentType((String) RedmineDataConverter.Text.convert("application/json"));
+// tempA.setDigest((String) RedmineDataConverter.Text.convert("6ea84342c7475c05fb077b4aca832f9a"));
+// tempA.setDiskFilename((String) RedmineDataConverter.Text.convert("090905125641_get_issue.json"));
+// tempA.setFilename((String) RedmineDataConverter.Text.convert("get_issue.json"));
+// model.put(Attachment.class, tempA);
+// tempA = new Attachment();
+// tempA.setAuthorId((Integer) RedmineDataConverter.Integer.convert("4"));
+// tempA.setContainerId((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempA.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempA.setFilesize((Integer) RedmineDataConverter.Integer.convert("411"));
+// tempA.setDownloads((Integer) RedmineDataConverter.Integer.convert("0"));
+// tempA.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T12:56:41+02:00"));
+// tempA.setContainerType((String) RedmineDataConverter.Text.convert("Version"));
+// tempA.setContentType((String) RedmineDataConverter.Text.convert("application/json"));
+// tempA.setDigest((String) RedmineDataConverter.Text.convert("6ea84342c7475c05fb077b4aca832f9a"));
+// tempA.setDiskFilename((String) RedmineDataConverter.Text.convert("090905125641_get_issue.json2"));
+// tempA.setFilename((String) RedmineDataConverter.Text.convert("get_issue.json2"));
+// model.put(Attachment.class, tempA);
+//
+// Issue tempI;
+// tempI = new Issue();
+// tempI.setAuthorId((Integer) RedmineDataConverter.Integer.convert("5"));
+// tempI.setCategoryId((Integer) RedmineDataConverter.Integer.convert("2"));
+// tempI.setDoneRatio((Integer) RedmineDataConverter.Integer.convert("0"));
+// tempI.setLockVersion((Integer) RedmineDataConverter.Integer.convert("7"));
+// tempI.setPriorityId((Integer) RedmineDataConverter.Integer.convert("4"));
+// tempI.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempI.setStatusId((Integer) RedmineDataConverter.Integer.convert("3"));
+// tempI.setTrackerId((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempI.setFixedVersionId((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempI.setId((Integer) RedmineDataConverter.Integer.convert("3"));
+// tempI.setParentId((Integer) RedmineDataConverter.Integer.convert("3"));
+// tempI.setRootId((Integer) RedmineDataConverter.Integer.convert("3"));
+// tempI.setLft((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempI.setRgt((Integer) RedmineDataConverter.Integer.convert("2"));
+// tempI.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T20:11:52+02:00"));
+// tempI.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T00:37:40+02:00"));
+// tempI.setStartDate((Date) RedmineDataConverter.Date.convert("2009-09-04"));
+// tempI.setDescription((String) RedmineDataConverter.Text.convert("avec une description !"));
+// tempI.setSubject((String) RedmineDataConverter.Text.convert("yes!"));
+// model.put(Issue.class, tempI);
+// tempI = new Issue();
+// tempI.setAuthorId((Integer) RedmineDataConverter.Integer.convert("5"));
+// tempI.setCategoryId((Integer) RedmineDataConverter.Integer.convert("2"));
+// tempI.setDoneRatio((Integer) RedmineDataConverter.Integer.convert("0"));
+// tempI.setLockVersion((Integer) RedmineDataConverter.Integer.convert("7"));
+// tempI.setPriorityId((Integer) RedmineDataConverter.Integer.convert("4"));
+// tempI.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempI.setStatusId((Integer) RedmineDataConverter.Integer.convert("3"));
+// tempI.setTrackerId((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempI.setFixedVersionId((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempI.setId((Integer) RedmineDataConverter.Integer.convert("4"));
+// tempI.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T20:11:52+02:00"));
+// tempI.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T00:37:40+02:00"));
+// tempI.setStartDate((Date) RedmineDataConverter.Date.convert("2009-09-04"));
+// tempI.setDescription((String) RedmineDataConverter.Text.convert("avec une description !2"));
+// tempI.setSubject((String) RedmineDataConverter.Text.convert("yes!2"));
+// model.put(Issue.class, tempI);
+//
+// Project tempP;
+// tempP = new Project();
+// tempP.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:11:54+02:00"));
+// tempP.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:11:54+02:00"));
+// tempP.setIdentifier((String) RedmineDataConverter.Text.convert("one"));
+// tempP.setName((String) RedmineDataConverter.Text.convert("one"));
+// tempP.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempP.setLft((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempP.setRgt((Integer) RedmineDataConverter.Integer.convert("2"));
+// tempP.setProjectsCount((Integer) RedmineDataConverter.Integer.convert("0"));
+// tempP.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempP.setIsPublic((Boolean) RedmineDataConverter.Boolean.convert("true"));
+// model.put(Project.class, tempP);
+// tempP = new Project();
+// tempP.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T16:22:14+02:00"));
+// tempP.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T16:22:29+02:00"));
+// tempP.setIdentifier((String) RedmineDataConverter.Text.convert("two"));
+// tempP.setName((String) RedmineDataConverter.Text.convert("two"));
+// tempP.setId((Integer) RedmineDataConverter.Integer.convert("2"));
+// tempP.setProjectsCount((Integer) RedmineDataConverter.Integer.convert("0"));
+// tempP.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempP.setIsPublic((Boolean) RedmineDataConverter.Boolean.convert("false"));
+// model.put(Project.class, tempP);
+//
+// Tracker tempT;
+// tempT = new Tracker();
+// tempT.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempT.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempT.setTrackerId((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempT.setPosition((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempT.setIsInChlog((Boolean) RedmineDataConverter.Boolean.convert("true"));
+// tempT.setIsInRoadmap((Boolean) RedmineDataConverter.Boolean.convert("false"));
+// tempT.setName((String) RedmineDataConverter.Text.convert("Anomalie"));
+// model.put(Tracker.class, tempT);
+// tempT = new Tracker();
+// tempT.setId((Integer) RedmineDataConverter.Integer.convert("2"));
+// tempT.setIsInChlog((Boolean) RedmineDataConverter.Boolean.convert("true"));
+// tempT.setIsInRoadmap((Boolean) RedmineDataConverter.Boolean.convert("true"));
+// tempT.setName((String) RedmineDataConverter.Text.convert("Evolution"));
+// tempT.setPosition((Integer) RedmineDataConverter.Integer.convert("2"));
+// tempT.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempT.setTrackerId((Integer) RedmineDataConverter.Integer.convert("2"));
+// model.put(Tracker.class, tempT);
+// tempT = new Tracker();
+// tempT.setId((Integer) RedmineDataConverter.Integer.convert("3"));
+// tempT.setIsInChlog((Boolean) RedmineDataConverter.Boolean.convert("false"));
+// tempT.setIsInRoadmap((Boolean) RedmineDataConverter.Boolean.convert("false"));
+// tempT.setName((String) RedmineDataConverter.Text.convert("Assistance"));
+// tempT.setPosition((Integer) RedmineDataConverter.Integer.convert("3"));
+// tempT.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempT.setTrackerId((Integer) RedmineDataConverter.Integer.convert("3"));
+// model.put(Tracker.class, tempT);
+//
+// User tempU;
+// tempU = new User();
+// tempU.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T17:24:46+02:00"));
+// tempU.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T01:23:59+02:00"));
+// tempU.setLastLoginOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T01:23:59+02:00"));
+// tempU.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempU.setMemberId((Integer) RedmineDataConverter.Integer.convert("5"));
+// tempU.setRoleId((Integer) RedmineDataConverter.Integer.convert("3"));
+// tempU.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempU.setAdmin((Boolean) RedmineDataConverter.Boolean.convert("true"));
+// tempU.setMailNotification((Boolean) RedmineDataConverter.Boolean.convert("true"));
+// tempU.setFirstname((String) RedmineDataConverter.Text.convert("Redmine"));
+// tempU.setHashedPassword(
+// (String) RedmineDataConverter.Text.convert("70c881d4a26984ddce795f6f71817c9cf4480e79"));
+// tempU.setLanguage((String) RedmineDataConverter.Text.convert("fr"));
+// tempU.setLastname((String) RedmineDataConverter.Text.convert("Admin"));
+// tempU.setLogin((String) RedmineDataConverter.Text.convert("admin"));
+// tempU.setMail((String) RedmineDataConverter.Text.convert("dummy(a)codelutin.com"));
+// tempU.setIdentityUrl((String) RedmineDataConverter.Text.convert("yo"));
+// model.put(User.class, tempU);
+// tempU = new User();
+// tempU.setAdmin((Boolean) RedmineDataConverter.Boolean.convert("true"));
+// tempU.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T19:49:02+02:00"));
+// tempU.setFirstname((String) RedmineDataConverter.Text.convert("tony"));
+// tempU.setHashedPassword(
+// (String) RedmineDataConverter.Text.convert("8aed1322e5450badb078e1fb60a817a1df25a2ca"));
+// tempU.setId((Integer) RedmineDataConverter.Integer.convert("5"));
+// tempU.setLanguage((String) RedmineDataConverter.Text.convert("fr"));
+// tempU.setLastLoginOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T19:49:38+02:00"));
+// tempU.setLastname((String) RedmineDataConverter.Text.convert("chemit2"));
+// tempU.setLogin((String) RedmineDataConverter.Text.convert("tchemit2"));
+// tempU.setMail((String) RedmineDataConverter.Text.convert("chemit(a)codelutin.com"));
+// tempU.setMailNotification((Boolean) RedmineDataConverter.Boolean.convert("false"));
+// tempU.setMemberId((Integer) RedmineDataConverter.Integer.convert("4"));
+// tempU.setRoleId((Integer) RedmineDataConverter.Integer.convert("3"));
+// tempU.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempU.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T19:49:38+02:00"));
+// model.put(User.class, tempU);
+// tempU = new User();
+// tempU.setAdmin((Boolean) RedmineDataConverter.Boolean.convert("false"));
+// tempU.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T16:24:11+02:00"));
+// tempU.setFirstname((String) RedmineDataConverter.Text.convert("dev"));
+// tempU.setHashedPassword(
+// (String) RedmineDataConverter.Text.convert("70c881d4a26984ddce795f6f71817c9cf4480e79"));
+// tempU.setId((Integer) RedmineDataConverter.Integer.convert("7"));
+// tempU.setLanguage((String) RedmineDataConverter.Text.convert("fr"));
+// tempU.setLastLoginOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T16:34:39+02:00"));
+// tempU.setLastname((String) RedmineDataConverter.Text.convert("dev"));
+// tempU.setLogin((String) RedmineDataConverter.Text.convert("dev"));
+// tempU.setMail((String) RedmineDataConverter.Text.convert("dev3(a)ynot-home.info"));
+// tempU.setMailNotification((Boolean) RedmineDataConverter.Boolean.convert("false"));
+// tempU.setMemberId((Integer) RedmineDataConverter.Integer.convert("9"));
+// tempU.setRoleId((Integer) RedmineDataConverter.Integer.convert("4"));
+// tempU.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempU.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T16:34:39+02:00"));
+// model.put(User.class, tempU);
+//
+// Version tempV;
+// tempV = new Version();
+// tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:47:39+02:00"));
+// tempV.setDescription((String) RedmineDataConverter.Text.convert("yo"));
+// tempV.setId((Integer) RedmineDataConverter.Integer.convert("9"));
+// tempV.setName((String) RedmineDataConverter.Text.convert("yor"));
+// tempV.setSharing((String) RedmineDataConverter.Text.convert("none"));
+// tempV.setStatus((String) RedmineDataConverter.Text.convert("open"));
+// tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:50:49+02:00"));
+// model.put(Version.class, tempV);
+// tempV = new Version();
+// tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:09+02:00"));
+// tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
+// tempV.setId((Integer) RedmineDataConverter.Integer.convert("13"));
+// tempV.setName((String) RedmineDataConverter.Text.convert("rrrrrrrrrouuuuuua"));
+// tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:09+02:00"));
+// model.put(Version.class, tempV);
+// tempV = new Version();
+// tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:07:58+02:00"));
+// tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
+// tempV.setId((Integer) RedmineDataConverter.Integer.convert("15"));
+// tempV.setName((String) RedmineDataConverter.Text.convert("aaaauuuuuua"));
+// tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:07:58+02:00"));
+// model.put(Version.class, tempV);
+// tempV = new Version();
+// tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T04:12:25+02:00"));
+// tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoyeppppppppppppppppp"));
+// tempV.setId((Integer) RedmineDataConverter.Integer.convert("16"));
+// tempV.setName((String) RedmineDataConverter.Text.convert("aaaau"));
+// tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T04:13:20+02:00"));
+// model.put(Version.class, tempV);
+// tempV = new Version();
+// tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:40+02:00"));
+// tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
+// tempV.setId((Integer) RedmineDataConverter.Integer.convert("14"));
+// tempV.setName((String) RedmineDataConverter.Text.convert("aaaaaaaaaarrrrrrrrrouuuuuua"));
+// tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:40+02:00"));
+// model.put(Version.class, tempV);
+// tempV = new Version();
+// tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T00:39:15+02:00"));
+// tempV.setId((Integer) RedmineDataConverter.Integer.convert("5"));
+// tempV.setName((String) RedmineDataConverter.Text.convert("2"));
+// tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T00:39:15+02:00"));
+// model.put(Version.class, tempV);
+// tempV = new Version();
+// tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:13:05+02:00"));
+// tempV.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempV.setName((String) RedmineDataConverter.Text.convert("1.0.0"));
+// tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:13:05+02:00"));
+// model.put(Version.class, tempV);
+// tempV = new Version();
+// tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:12+02:00"));
+// tempV.setDescription((String) RedmineDataConverter.Text.convert("yoye"));
+// tempV.setEffectiveDate((Date) RedmineDataConverter.Date.convert("2009-09-06"));
+// tempV.setId((Integer) RedmineDataConverter.Integer.convert("11"));
+// tempV.setName((String) RedmineDataConverter.Text.convert("yaouuuuuua"));
+// tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:12+02:00"));
+// model.put(Version.class, tempV);
+// tempV = new Version();
+// tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:50:59+02:00"));
+// tempV.setDescription((String) RedmineDataConverter.Text.convert("yoye"));
+// tempV.setEffectiveDate((Date) RedmineDataConverter.Date.convert("2009-09-06"));
+// tempV.setId((Integer) RedmineDataConverter.Integer.convert("10"));
+// tempV.setName((String) RedmineDataConverter.Text.convert("ya"));
+// tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:54:16+02:00"));
+// model.put(Version.class, tempV);
+// tempV = new Version();
+// tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:37+02:00"));
+// tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
+// tempV.setEffectiveDate((Date) RedmineDataConverter.Date.convert("2009-09-06"));
+// tempV.setId((Integer) RedmineDataConverter.Integer.convert("12"));
+// tempV.setName((String) RedmineDataConverter.Text.convert("ouuuuuua"));
+// tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+// tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:42+02:00"));
+// model.put(Version.class, tempV);
+//
+// IssueStatus tempIS;
+// tempIS = new IssueStatus();
+// tempIS.setId(1);
+// tempIS.setName("Nouveau");
+// tempIS.setPosition(1);
+// tempIS.setDefaultDoneRatio(10);
+// tempIS.setIsClosed(false);
+// tempIS.setIsDefault(true);
+// model.put(IssueStatus.class, tempIS);
+// tempIS = new IssueStatus();
+// tempIS.setId(2);
+// tempIS.setName("Assigné");
+// tempIS.setPosition(2);
+// tempIS.setIsClosed(false);
+// tempIS.setIsDefault(false);
+// model.put(IssueStatus.class, tempIS);
+// tempIS = new IssueStatus();
+// tempIS.setId(3);
+// tempIS.setName("Résolu");
+// tempIS.setPosition(3);
+// tempIS.setIsClosed(false);
+// tempIS.setIsDefault(false);
+// model.put(IssueStatus.class, tempIS);
+// tempIS = new IssueStatus();
+// tempIS.setId(4);
+// tempIS.setName("Commentaire");
+// tempIS.setPosition(4);
+// tempIS.setIsClosed(false);
+// tempIS.setIsDefault(false);
+// model.put(IssueStatus.class, tempIS);
+// tempIS = new IssueStatus();
+// tempIS.setId(5);
+// tempIS.setName("Fermé");
+// tempIS.setPosition(5);
+// tempIS.setIsClosed(true);
+// tempIS.setIsDefault(false);
+// model.put(IssueStatus.class, tempIS);
+// tempIS = new IssueStatus();
+// tempIS.setId(6);
+// tempIS.setPosition(6);
+// tempIS.setName("Rejeté");
+// tempIS.setIsClosed(true);
+// tempIS.setIsDefault(false);
+// model.put(IssueStatus.class, tempIS);
+//
+// IssuePriority tempIP;
+// tempIP = new IssuePriority();
+// tempIP.setId(3);
+// tempIP.setParentId(1);
+// tempIP.setProjectId(2);
+// tempIP.setName("Bas");
+// tempIP.setPosition(1);
+// tempIP.setOpt("IPRI");
+// tempIP.setIsDefault(false);
+// tempIP.setActive(true);
+// model.put(IssuePriority.class, tempIP);
+// tempIP = new IssuePriority();
+// tempIP.setId(4);
+// tempIP.setName("Normal");
+// tempIP.setPosition(2);
+// tempIP.setOpt("IPRI");
+// tempIP.setIsDefault(true);
+// model.put(IssuePriority.class, tempIP);
+// tempIP = new IssuePriority();
+// tempIP.setId(5);
+// tempIP.setName("Haut");
+// tempIP.setPosition(3);
+// tempIP.setOpt("IPRI");
+// tempIP.setIsDefault(false);
+// model.put(IssuePriority.class, tempIP);
+// tempIP = new IssuePriority();
+// tempIP.setId(6);
+// tempIP.setName("Urgent");
+// tempIP.setPosition(4);
+// tempIP.setOpt("IPRI");
+// tempIP.setIsDefault(false);
+// model.put(IssuePriority.class, tempIP);
+// tempIP = new IssuePriority();
+// tempIP.setId(7);
+// tempIP.setName("Immédiat");
+// tempIP.setPosition(5);
+// tempIP.setOpt("IPRI");
+// tempIP.setIsDefault(false);
+// model.put(IssuePriority.class, tempIP);
+//
+// IssueCategory tempIC;
+// tempIC = new IssueCategory();
+// tempIC.setId(1);
+// tempIC.setName("categorie one");
+// tempIC.setProjectId(1);
+// model.put(IssueCategory.class, tempIC);
+// tempIC = new IssueCategory();
+// tempIC.setId(2);
+// tempIC.setName("categorie two");
+// tempIC.setProjectId(1);
+// model.put(IssueCategory.class, tempIC);
+//
+// News tempN;
+// tempN = new News();
+// tempN.setId(85);
+// tempN.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-17T21:50:26+02:00"));
+// tempN.setProjectId(1);
+// tempN.setAuthorId(4);
+// tempN.setCommentsCount(0);
+// tempN.setDescription("description");
+// tempN.setSummary("summary");
+// tempN.setTitle("title");
+// model.put(News.class, tempN);
+// tempN = new News();
+// tempN.setId(86);
+// tempN.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-17T21:55:26+02:00"));
+// tempN.setProjectId(1);
+// tempN.setAuthorId(4);
+// tempN.setCommentsCount(0);
+// tempN.setDescription("description2");
+// tempN.setSummary("summary2");
+// tempN.setTitle("title2");
+// model.put(News.class, tempN);
+//
+// TimeEntry tempE;
+//
+// tempE = new TimeEntry();
+// tempE.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:02:02+01:00"));
+// tempE.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:02:02+01:00"));
+// tempE.setSpentOn((Date) RedmineDataConverter.Date.convert("2009-12-31"));
+// tempE.setId(1);
+// tempE.setProjectId(1);
+// tempE.setUserId(4);
+// tempE.setIssueId(6);
+// tempE.setActivityId(8);
+//
+// tempE.setHours(1);
+// tempE.setTmonth(12);
+// tempE.setTyear(2009);
+// tempE.setTweek(53);
+// tempE.setComments("Test");
+// model.put(TimeEntry.class, tempE);
+//
+// tempE = new TimeEntry();
+// tempE.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:10:01+01:00"));
+// tempE.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:10:01+01:00"));
+// tempE.setSpentOn((Date) RedmineDataConverter.Date.convert("2009-12-31"));
+// tempE.setId(2);
+// tempE.setProjectId(1);
+// tempE.setUserId(4);
+// tempE.setIssueId(6);
+// tempE.setActivityId(9);
+//
+// tempE.setHours(2);
+// tempE.setTmonth(12);
+// tempE.setTyear(2009);
+// tempE.setTweek(53);
+// tempE.setComments("deuxième temps");
+// model.put(TimeEntry.class, tempE);
+// }
- return RedmineConfigurationUtil.obtainRedmineConfiguration(
- newAnonymousConfiguration());
- }
-
- 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 List<Attachment> getAttachments() {
- return get(Attachment.class);
- }
-
- public List<Issue> getIssues() {
- return get(Issue.class);
- }
-
- public List<Project> getProjects() {
- return get(Project.class);
- }
-
- public List<Tracker> getTrackers() {
- return get(Tracker.class);
- }
-
- public List<User> getUsers() {
- return get(User.class);
- }
-
- public List<Version> getVersions() {
- return get(Version.class);
- }
-
- public <T> List<T> get(Class<T> modelType) {
- if (model == null) {
- try {
- loadModel();
- } catch (Exception ex) {
- throw new RuntimeException(ex);
- }
- }
- return (List<T>) model.get(modelType);
- }
-
- public <T> T get(Class<T> type, int pos) {
- List<T> ts = get(type);
- return ts.get(pos);
- }
-
- private void loadModel()
- throws Exception {
- model = ArrayListMultimap.create();
-
- Attachment tempA;
- tempA = new Attachment();
- tempA.setAuthorId((Integer) RedmineDataConverter.Integer.convert("4"));
- tempA.setContainerId((Integer) RedmineDataConverter.Integer.convert("1"));
- tempA.setId((Integer) RedmineDataConverter.Integer.convert("1"));
- tempA.setFilesize((Integer) RedmineDataConverter.Integer.convert("411"));
- tempA.setDownloads((Integer) RedmineDataConverter.Integer.convert("0"));
- tempA.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T12:56:41+02:00"));
- tempA.setContainerType((String) RedmineDataConverter.Text.convert("Version"));
- tempA.setContentType((String) RedmineDataConverter.Text.convert("application/json"));
- tempA.setDigest((String) RedmineDataConverter.Text.convert("6ea84342c7475c05fb077b4aca832f9a"));
- tempA.setDiskFilename((String) RedmineDataConverter.Text.convert("090905125641_get_issue.json"));
- tempA.setFilename((String) RedmineDataConverter.Text.convert("get_issue.json"));
- model.put(Attachment.class, tempA);
- tempA = new Attachment();
- tempA.setAuthorId((Integer) RedmineDataConverter.Integer.convert("4"));
- tempA.setContainerId((Integer) RedmineDataConverter.Integer.convert("1"));
- tempA.setId((Integer) RedmineDataConverter.Integer.convert("1"));
- tempA.setFilesize((Integer) RedmineDataConverter.Integer.convert("411"));
- tempA.setDownloads((Integer) RedmineDataConverter.Integer.convert("0"));
- tempA.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T12:56:41+02:00"));
- tempA.setContainerType((String) RedmineDataConverter.Text.convert("Version"));
- tempA.setContentType((String) RedmineDataConverter.Text.convert("application/json"));
- tempA.setDigest((String) RedmineDataConverter.Text.convert("6ea84342c7475c05fb077b4aca832f9a"));
- tempA.setDiskFilename((String) RedmineDataConverter.Text.convert("090905125641_get_issue.json2"));
- tempA.setFilename((String) RedmineDataConverter.Text.convert("get_issue.json2"));
- model.put(Attachment.class, tempA);
-
- Issue tempI;
- tempI = new Issue();
- tempI.setAuthorId((Integer) RedmineDataConverter.Integer.convert("5"));
- tempI.setCategoryId((Integer) RedmineDataConverter.Integer.convert("2"));
- tempI.setDoneRatio((Integer) RedmineDataConverter.Integer.convert("0"));
- tempI.setLockVersion((Integer) RedmineDataConverter.Integer.convert("7"));
- tempI.setPriorityId((Integer) RedmineDataConverter.Integer.convert("4"));
- tempI.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
- tempI.setStatusId((Integer) RedmineDataConverter.Integer.convert("3"));
- tempI.setTrackerId((Integer) RedmineDataConverter.Integer.convert("1"));
- tempI.setFixedVersionId((Integer) RedmineDataConverter.Integer.convert("1"));
- tempI.setId((Integer) RedmineDataConverter.Integer.convert("3"));
- tempI.setParentId((Integer) RedmineDataConverter.Integer.convert("3"));
- tempI.setRootId((Integer) RedmineDataConverter.Integer.convert("3"));
- tempI.setLft((Integer) RedmineDataConverter.Integer.convert("1"));
- tempI.setRgt((Integer) RedmineDataConverter.Integer.convert("2"));
- tempI.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T20:11:52+02:00"));
- tempI.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T00:37:40+02:00"));
- tempI.setStartDate((Date) RedmineDataConverter.Date.convert("2009-09-04"));
- tempI.setDescription((String) RedmineDataConverter.Text.convert("avec une description !"));
- tempI.setSubject((String) RedmineDataConverter.Text.convert("yes!"));
- model.put(Issue.class, tempI);
- tempI = new Issue();
- tempI.setAuthorId((Integer) RedmineDataConverter.Integer.convert("5"));
- tempI.setCategoryId((Integer) RedmineDataConverter.Integer.convert("2"));
- tempI.setDoneRatio((Integer) RedmineDataConverter.Integer.convert("0"));
- tempI.setLockVersion((Integer) RedmineDataConverter.Integer.convert("7"));
- tempI.setPriorityId((Integer) RedmineDataConverter.Integer.convert("4"));
- tempI.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
- tempI.setStatusId((Integer) RedmineDataConverter.Integer.convert("3"));
- tempI.setTrackerId((Integer) RedmineDataConverter.Integer.convert("1"));
- tempI.setFixedVersionId((Integer) RedmineDataConverter.Integer.convert("1"));
- tempI.setId((Integer) RedmineDataConverter.Integer.convert("4"));
- tempI.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T20:11:52+02:00"));
- tempI.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T00:37:40+02:00"));
- tempI.setStartDate((Date) RedmineDataConverter.Date.convert("2009-09-04"));
- tempI.setDescription((String) RedmineDataConverter.Text.convert("avec une description !2"));
- tempI.setSubject((String) RedmineDataConverter.Text.convert("yes!2"));
- model.put(Issue.class, tempI);
-
- Project tempP;
- tempP = new Project();
- tempP.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:11:54+02:00"));
- tempP.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:11:54+02:00"));
- tempP.setIdentifier((String) RedmineDataConverter.Text.convert("one"));
- tempP.setName((String) RedmineDataConverter.Text.convert("one"));
- tempP.setId((Integer) RedmineDataConverter.Integer.convert("1"));
- tempP.setLft((Integer) RedmineDataConverter.Integer.convert("1"));
- tempP.setRgt((Integer) RedmineDataConverter.Integer.convert("2"));
- tempP.setProjectsCount((Integer) RedmineDataConverter.Integer.convert("0"));
- tempP.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
- tempP.setIsPublic((Boolean) RedmineDataConverter.Boolean.convert("true"));
- model.put(Project.class, tempP);
- tempP = new Project();
- tempP.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T16:22:14+02:00"));
- tempP.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T16:22:29+02:00"));
- tempP.setIdentifier((String) RedmineDataConverter.Text.convert("two"));
- tempP.setName((String) RedmineDataConverter.Text.convert("two"));
- tempP.setId((Integer) RedmineDataConverter.Integer.convert("2"));
- tempP.setProjectsCount((Integer) RedmineDataConverter.Integer.convert("0"));
- tempP.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
- tempP.setIsPublic((Boolean) RedmineDataConverter.Boolean.convert("false"));
- model.put(Project.class, tempP);
-
- Tracker tempT;
- tempT = new Tracker();
- tempT.setId((Integer) RedmineDataConverter.Integer.convert("1"));
- tempT.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
- tempT.setTrackerId((Integer) RedmineDataConverter.Integer.convert("1"));
- tempT.setPosition((Integer) RedmineDataConverter.Integer.convert("1"));
- tempT.setIsInChlog((Boolean) RedmineDataConverter.Boolean.convert("true"));
- tempT.setIsInRoadmap((Boolean) RedmineDataConverter.Boolean.convert("false"));
- tempT.setName((String) RedmineDataConverter.Text.convert("Anomalie"));
- model.put(Tracker.class, tempT);
- tempT = new Tracker();
- tempT.setId((Integer) RedmineDataConverter.Integer.convert("2"));
- tempT.setIsInChlog((Boolean) RedmineDataConverter.Boolean.convert("true"));
- tempT.setIsInRoadmap((Boolean) RedmineDataConverter.Boolean.convert("true"));
- tempT.setName((String) RedmineDataConverter.Text.convert("Evolution"));
- tempT.setPosition((Integer) RedmineDataConverter.Integer.convert("2"));
- tempT.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
- tempT.setTrackerId((Integer) RedmineDataConverter.Integer.convert("2"));
- model.put(Tracker.class, tempT);
- tempT = new Tracker();
- tempT.setId((Integer) RedmineDataConverter.Integer.convert("3"));
- tempT.setIsInChlog((Boolean) RedmineDataConverter.Boolean.convert("false"));
- tempT.setIsInRoadmap((Boolean) RedmineDataConverter.Boolean.convert("false"));
- tempT.setName((String) RedmineDataConverter.Text.convert("Assistance"));
- tempT.setPosition((Integer) RedmineDataConverter.Integer.convert("3"));
- tempT.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
- tempT.setTrackerId((Integer) RedmineDataConverter.Integer.convert("3"));
- model.put(Tracker.class, tempT);
-
- User tempU;
- tempU = new User();
- tempU.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T17:24:46+02:00"));
- tempU.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T01:23:59+02:00"));
- tempU.setLastLoginOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T01:23:59+02:00"));
- tempU.setId((Integer) RedmineDataConverter.Integer.convert("1"));
- tempU.setMemberId((Integer) RedmineDataConverter.Integer.convert("5"));
- tempU.setRoleId((Integer) RedmineDataConverter.Integer.convert("3"));
- tempU.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
- tempU.setAdmin((Boolean) RedmineDataConverter.Boolean.convert("true"));
- tempU.setMailNotification((Boolean) RedmineDataConverter.Boolean.convert("true"));
- tempU.setFirstname((String) RedmineDataConverter.Text.convert("Redmine"));
- tempU.setHashedPassword(
- (String) RedmineDataConverter.Text.convert("70c881d4a26984ddce795f6f71817c9cf4480e79"));
- tempU.setLanguage((String) RedmineDataConverter.Text.convert("fr"));
- tempU.setLastname((String) RedmineDataConverter.Text.convert("Admin"));
- tempU.setLogin((String) RedmineDataConverter.Text.convert("admin"));
- tempU.setMail((String) RedmineDataConverter.Text.convert("dummy(a)codelutin.com"));
- tempU.setIdentityUrl((String) RedmineDataConverter.Text.convert("yo"));
- model.put(User.class, tempU);
- tempU = new User();
- tempU.setAdmin((Boolean) RedmineDataConverter.Boolean.convert("true"));
- tempU.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T19:49:02+02:00"));
- tempU.setFirstname((String) RedmineDataConverter.Text.convert("tony"));
- tempU.setHashedPassword(
- (String) RedmineDataConverter.Text.convert("8aed1322e5450badb078e1fb60a817a1df25a2ca"));
- tempU.setId((Integer) RedmineDataConverter.Integer.convert("5"));
- tempU.setLanguage((String) RedmineDataConverter.Text.convert("fr"));
- tempU.setLastLoginOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T19:49:38+02:00"));
- tempU.setLastname((String) RedmineDataConverter.Text.convert("chemit2"));
- tempU.setLogin((String) RedmineDataConverter.Text.convert("tchemit2"));
- tempU.setMail((String) RedmineDataConverter.Text.convert("chemit(a)codelutin.com"));
- tempU.setMailNotification((Boolean) RedmineDataConverter.Boolean.convert("false"));
- tempU.setMemberId((Integer) RedmineDataConverter.Integer.convert("4"));
- tempU.setRoleId((Integer) RedmineDataConverter.Integer.convert("3"));
- tempU.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
- tempU.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T19:49:38+02:00"));
- model.put(User.class, tempU);
- tempU = new User();
- tempU.setAdmin((Boolean) RedmineDataConverter.Boolean.convert("false"));
- tempU.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T16:24:11+02:00"));
- tempU.setFirstname((String) RedmineDataConverter.Text.convert("dev"));
- tempU.setHashedPassword(
- (String) RedmineDataConverter.Text.convert("70c881d4a26984ddce795f6f71817c9cf4480e79"));
- tempU.setId((Integer) RedmineDataConverter.Integer.convert("7"));
- tempU.setLanguage((String) RedmineDataConverter.Text.convert("fr"));
- tempU.setLastLoginOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T16:34:39+02:00"));
- tempU.setLastname((String) RedmineDataConverter.Text.convert("dev"));
- tempU.setLogin((String) RedmineDataConverter.Text.convert("dev"));
- tempU.setMail((String) RedmineDataConverter.Text.convert("dev3(a)ynot-home.info"));
- tempU.setMailNotification((Boolean) RedmineDataConverter.Boolean.convert("false"));
- tempU.setMemberId((Integer) RedmineDataConverter.Integer.convert("9"));
- tempU.setRoleId((Integer) RedmineDataConverter.Integer.convert("4"));
- tempU.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
- tempU.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T16:34:39+02:00"));
- model.put(User.class, tempU);
-
- Version tempV;
- tempV = new Version();
- tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:47:39+02:00"));
- tempV.setDescription((String) RedmineDataConverter.Text.convert("yo"));
- tempV.setId((Integer) RedmineDataConverter.Integer.convert("9"));
- tempV.setName((String) RedmineDataConverter.Text.convert("yor"));
- tempV.setSharing((String) RedmineDataConverter.Text.convert("none"));
- tempV.setStatus((String) RedmineDataConverter.Text.convert("open"));
- tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
- tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:50:49+02:00"));
- model.put(Version.class, tempV);
- tempV = new Version();
- tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:09+02:00"));
- tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
- tempV.setId((Integer) RedmineDataConverter.Integer.convert("13"));
- tempV.setName((String) RedmineDataConverter.Text.convert("rrrrrrrrrouuuuuua"));
- tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
- tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:09+02:00"));
- model.put(Version.class, tempV);
- tempV = new Version();
- tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:07:58+02:00"));
- tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
- tempV.setId((Integer) RedmineDataConverter.Integer.convert("15"));
- tempV.setName((String) RedmineDataConverter.Text.convert("aaaauuuuuua"));
- tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
- tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:07:58+02:00"));
- model.put(Version.class, tempV);
- tempV = new Version();
- tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T04:12:25+02:00"));
- tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoyeppppppppppppppppp"));
- tempV.setId((Integer) RedmineDataConverter.Integer.convert("16"));
- tempV.setName((String) RedmineDataConverter.Text.convert("aaaau"));
- tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
- tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T04:13:20+02:00"));
- model.put(Version.class, tempV);
- tempV = new Version();
- tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:40+02:00"));
- tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
- tempV.setId((Integer) RedmineDataConverter.Integer.convert("14"));
- tempV.setName((String) RedmineDataConverter.Text.convert("aaaaaaaaaarrrrrrrrrouuuuuua"));
- tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
- tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:40+02:00"));
- model.put(Version.class, tempV);
- tempV = new Version();
- tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T00:39:15+02:00"));
- tempV.setId((Integer) RedmineDataConverter.Integer.convert("5"));
- tempV.setName((String) RedmineDataConverter.Text.convert("2"));
- tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
- tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T00:39:15+02:00"));
- model.put(Version.class, tempV);
- tempV = new Version();
- tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:13:05+02:00"));
- tempV.setId((Integer) RedmineDataConverter.Integer.convert("1"));
- tempV.setName((String) RedmineDataConverter.Text.convert("1.0.0"));
- tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
- tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:13:05+02:00"));
- model.put(Version.class, tempV);
- tempV = new Version();
- tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:12+02:00"));
- tempV.setDescription((String) RedmineDataConverter.Text.convert("yoye"));
- tempV.setEffectiveDate((Date) RedmineDataConverter.Date.convert("2009-09-06"));
- tempV.setId((Integer) RedmineDataConverter.Integer.convert("11"));
- tempV.setName((String) RedmineDataConverter.Text.convert("yaouuuuuua"));
- tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
- tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:12+02:00"));
- model.put(Version.class, tempV);
- tempV = new Version();
- tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:50:59+02:00"));
- tempV.setDescription((String) RedmineDataConverter.Text.convert("yoye"));
- tempV.setEffectiveDate((Date) RedmineDataConverter.Date.convert("2009-09-06"));
- tempV.setId((Integer) RedmineDataConverter.Integer.convert("10"));
- tempV.setName((String) RedmineDataConverter.Text.convert("ya"));
- tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
- tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:54:16+02:00"));
- model.put(Version.class, tempV);
- tempV = new Version();
- tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:37+02:00"));
- tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
- tempV.setEffectiveDate((Date) RedmineDataConverter.Date.convert("2009-09-06"));
- tempV.setId((Integer) RedmineDataConverter.Integer.convert("12"));
- tempV.setName((String) RedmineDataConverter.Text.convert("ouuuuuua"));
- tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
- tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:42+02:00"));
- model.put(Version.class, tempV);
-
- IssueStatus tempIS;
- tempIS = new IssueStatus();
- tempIS.setId(1);
- tempIS.setName("Nouveau");
- tempIS.setPosition(1);
- tempIS.setDefaultDoneRatio(10);
- tempIS.setIsClosed(false);
- tempIS.setIsDefault(true);
- model.put(IssueStatus.class, tempIS);
- tempIS = new IssueStatus();
- tempIS.setId(2);
- tempIS.setName("Assigné");
- tempIS.setPosition(2);
- tempIS.setIsClosed(false);
- tempIS.setIsDefault(false);
- model.put(IssueStatus.class, tempIS);
- tempIS = new IssueStatus();
- tempIS.setId(3);
- tempIS.setName("Résolu");
- tempIS.setPosition(3);
- tempIS.setIsClosed(false);
- tempIS.setIsDefault(false);
- model.put(IssueStatus.class, tempIS);
- tempIS = new IssueStatus();
- tempIS.setId(4);
- tempIS.setName("Commentaire");
- tempIS.setPosition(4);
- tempIS.setIsClosed(false);
- tempIS.setIsDefault(false);
- model.put(IssueStatus.class, tempIS);
- tempIS = new IssueStatus();
- tempIS.setId(5);
- tempIS.setName("Fermé");
- tempIS.setPosition(5);
- tempIS.setIsClosed(true);
- tempIS.setIsDefault(false);
- model.put(IssueStatus.class, tempIS);
- tempIS = new IssueStatus();
- tempIS.setId(6);
- tempIS.setPosition(6);
- tempIS.setName("Rejeté");
- tempIS.setIsClosed(true);
- tempIS.setIsDefault(false);
- model.put(IssueStatus.class, tempIS);
-
- IssuePriority tempIP;
- tempIP = new IssuePriority();
- tempIP.setId(3);
- tempIP.setParentId(1);
- tempIP.setProjectId(2);
- tempIP.setName("Bas");
- tempIP.setPosition(1);
- tempIP.setOpt("IPRI");
- tempIP.setIsDefault(false);
- tempIP.setActive(true);
- model.put(IssuePriority.class, tempIP);
- tempIP = new IssuePriority();
- tempIP.setId(4);
- tempIP.setName("Normal");
- tempIP.setPosition(2);
- tempIP.setOpt("IPRI");
- tempIP.setIsDefault(true);
- model.put(IssuePriority.class, tempIP);
- tempIP = new IssuePriority();
- tempIP.setId(5);
- tempIP.setName("Haut");
- tempIP.setPosition(3);
- tempIP.setOpt("IPRI");
- tempIP.setIsDefault(false);
- model.put(IssuePriority.class, tempIP);
- tempIP = new IssuePriority();
- tempIP.setId(6);
- tempIP.setName("Urgent");
- tempIP.setPosition(4);
- tempIP.setOpt("IPRI");
- tempIP.setIsDefault(false);
- model.put(IssuePriority.class, tempIP);
- tempIP = new IssuePriority();
- tempIP.setId(7);
- tempIP.setName("Immédiat");
- tempIP.setPosition(5);
- tempIP.setOpt("IPRI");
- tempIP.setIsDefault(false);
- model.put(IssuePriority.class, tempIP);
-
- IssueCategory tempIC;
- tempIC = new IssueCategory();
- tempIC.setId(1);
- tempIC.setName("categorie one");
- tempIC.setProjectId(1);
- model.put(IssueCategory.class, tempIC);
- tempIC = new IssueCategory();
- tempIC.setId(2);
- tempIC.setName("categorie two");
- tempIC.setProjectId(1);
- model.put(IssueCategory.class, tempIC);
-
- News tempN;
- tempN = new News();
- tempN.setId(85);
- tempN.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-17T21:50:26+02:00"));
- tempN.setProjectId(1);
- tempN.setAuthorId(4);
- tempN.setCommentsCount(0);
- tempN.setDescription("description");
- tempN.setSummary("summary");
- tempN.setTitle("title");
- model.put(News.class, tempN);
- tempN = new News();
- tempN.setId(86);
- tempN.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-17T21:55:26+02:00"));
- tempN.setProjectId(1);
- tempN.setAuthorId(4);
- tempN.setCommentsCount(0);
- tempN.setDescription("description2");
- tempN.setSummary("summary2");
- tempN.setTitle("title2");
- model.put(News.class, tempN);
-
- TimeEntry tempE;
-
- tempE = new TimeEntry();
- tempE.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:02:02+01:00"));
- tempE.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:02:02+01:00"));
- tempE.setSpentOn((Date) RedmineDataConverter.Date.convert("2009-12-31"));
- tempE.setId(1);
- tempE.setProjectId(1);
- tempE.setUserId(4);
- tempE.setIssueId(6);
- tempE.setActivityId(8);
-
- tempE.setHours(1);
- tempE.setTmonth(12);
- tempE.setTyear(2009);
- tempE.setTweek(53);
- tempE.setComments("Test");
- model.put(TimeEntry.class, tempE);
-
- tempE = new TimeEntry();
- tempE.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:10:01+01:00"));
- tempE.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:10:01+01:00"));
- tempE.setSpentOn((Date) RedmineDataConverter.Date.convert("2009-12-31"));
- tempE.setId(2);
- tempE.setProjectId(1);
- tempE.setUserId(4);
- tempE.setIssueId(6);
- tempE.setActivityId(9);
-
- tempE.setHours(2);
- tempE.setTmonth(12);
- tempE.setTyear(2009);
- tempE.setTweek(53);
- tempE.setComments("deuxième temps");
- model.put(TimeEntry.class, tempE);
- }
-
public Version versionToAdd() {
Version version = new Version();
version.setId(TIMESTAMP);
Deleted: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineLogguedFixtureClassRule.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineLogguedFixtureClassRule.java 2012-10-03 23:21:54 UTC (rev 338)
+++ branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineLogguedFixtureClassRule.java 2012-10-04 09:28:43 UTC (rev 339)
@@ -1,97 +0,0 @@
-package org.nuiton.jredmine;
-/*
- * #%L
- * JRedmine :: Client
- * $Id$
- * $HeadURL$
- * %%
- * 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(a)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 = fixtures.obtainRedmineConfiguration();
-
- 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;
- }
-}
Deleted: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineServer.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineServer.java 2012-10-03 23:21:54 UTC (rev 338)
+++ branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineServer.java 2012-10-04 09:28:43 UTC (rev 339)
@@ -1,109 +0,0 @@
-package org.nuiton.jredmine;
-/*
- * #%L
- * JRedmine :: Client
- * $Id$
- * $HeadURL$
- * %%
- * 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(a)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
Modified: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineServiceAsAnonymousTest.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineServiceAsAnonymousTest.java 2012-10-03 23:21:54 UTC (rev 338)
+++ branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineServiceAsAnonymousTest.java 2012-10-04 09:28:43 UTC (rev 339)
@@ -38,9 +38,9 @@
import org.nuiton.jredmine.model.Tracker;
import org.nuiton.jredmine.model.User;
import org.nuiton.jredmine.model.Version;
+import org.nuiton.jredmine.test.RedmineAnonymousFixtureClassRule;
+import org.nuiton.jredmine.test.RedmineServer;
-import java.io.IOException;
-
/**
* Tests the {@link RedmineService} service with anonymous configuration.
*
@@ -50,8 +50,8 @@
public class RedmineServiceAsAnonymousTest {
@ClassRule
- public static final RedmineAnonymousFixtureClassRule classRule =
- new RedmineAnonymousFixtureClassRule();
+ public static final RedmineAnonymousFixtureClassRule<RedmineFixtures> classRule =
+ RedmineAnonymousFixtureClassRule.newFixtures(RedmineFixtures.class);
protected RedmineFixtures getFixtures() {
@@ -59,22 +59,9 @@
}
@Rule
- public final RedmineServer<RedmineService> server = new RedmineServer<RedmineService>(classRule.getFixtures()) {
+ public final RedmineServer<RedmineService, RedmineFixtures> server =
+ RedmineServer.newLogguedServerAsAnonymous(classRule);
- @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();
}
Modified: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineServiceTest.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineServiceTest.java 2012-10-03 23:21:54 UTC (rev 338)
+++ branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineServiceTest.java 2012-10-04 09:28:43 UTC (rev 339)
@@ -39,9 +39,9 @@
import org.nuiton.jredmine.model.Tracker;
import org.nuiton.jredmine.model.User;
import org.nuiton.jredmine.model.Version;
+import org.nuiton.jredmine.test.RedmineFixtureClassRule;
+import org.nuiton.jredmine.test.RedmineServer;
-import java.io.IOException;
-
/**
* Tests the {@link RedmineService} service with loggued configuration.
*
@@ -51,25 +51,13 @@
public class RedmineServiceTest {
@ClassRule
- public static final RedmineLogguedFixtureClassRule classRule =
- new RedmineLogguedFixtureClassRule();
+ public static final RedmineFixtureClassRule<RedmineFixtures> classRule =
+ RedmineFixtureClassRule.newFixtures(RedmineFixtures.class);
@Rule
- public final RedmineServer<RedmineService> server = new RedmineServer<RedmineService>(classRule.getFixtures()) {
+ public final RedmineServer<RedmineService, RedmineFixtures> server =
+ RedmineServer.newLogguedServer(classRule);
- @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();
}
Added: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/model/io/xpp3/RedmineModelFixtures.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/model/io/xpp3/RedmineModelFixtures.java (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/model/io/xpp3/RedmineModelFixtures.java 2012-10-04 09:28:43 UTC (rev 339)
@@ -0,0 +1,492 @@
+package org.nuiton.jredmine.model.io.xpp3;
+/*
+ * #%L
+ * JRedmine :: Client
+ * $Id$
+ * $HeadURL: http://svn.nuiton.org/svn/jredmine/branches/jredmine-1.x/jredmine-client/sr… $
+ * %%
+ * 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 com.google.common.collect.ArrayListMultimap;
+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 org.nuiton.jredmine.test.AbstractRedmineFixtures;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * TODO
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public class RedmineModelFixtures extends AbstractRedmineFixtures {
+
+ private ArrayListMultimap<Class<?>, Object> model;
+
+ public <T> List<T> get(Class<T> modelType) {
+ if (model == null) {
+ try {
+ loadModel();
+ } catch (Exception ex) {
+ throw new RuntimeException(ex);
+ }
+ }
+ return (List<T>) model.get(modelType);
+ }
+
+ public <T> T get(Class<T> type, int pos) {
+ List<T> ts = get(type);
+ return ts.get(pos);
+ }
+
+ private void loadModel()
+ throws Exception {
+ model = ArrayListMultimap.create();
+
+ Attachment tempA;
+ tempA = new Attachment();
+ tempA.setAuthorId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempA.setContainerId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempA.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempA.setFilesize((Integer) RedmineDataConverter.Integer.convert("411"));
+ tempA.setDownloads((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempA.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T12:56:41+02:00"));
+ tempA.setContainerType((String) RedmineDataConverter.Text.convert("Version"));
+ tempA.setContentType((String) RedmineDataConverter.Text.convert("application/json"));
+ tempA.setDigest((String) RedmineDataConverter.Text.convert("6ea84342c7475c05fb077b4aca832f9a"));
+ tempA.setDiskFilename((String) RedmineDataConverter.Text.convert("090905125641_get_issue.json"));
+ tempA.setFilename((String) RedmineDataConverter.Text.convert("get_issue.json"));
+ model.put(Attachment.class, tempA);
+ tempA = new Attachment();
+ tempA.setAuthorId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempA.setContainerId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempA.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempA.setFilesize((Integer) RedmineDataConverter.Integer.convert("411"));
+ tempA.setDownloads((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempA.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T12:56:41+02:00"));
+ tempA.setContainerType((String) RedmineDataConverter.Text.convert("Version"));
+ tempA.setContentType((String) RedmineDataConverter.Text.convert("application/json"));
+ tempA.setDigest((String) RedmineDataConverter.Text.convert("6ea84342c7475c05fb077b4aca832f9a"));
+ tempA.setDiskFilename((String) RedmineDataConverter.Text.convert("090905125641_get_issue.json2"));
+ tempA.setFilename((String) RedmineDataConverter.Text.convert("get_issue.json2"));
+ model.put(Attachment.class, tempA);
+
+ Issue tempI;
+ tempI = new Issue();
+ tempI.setAuthorId((Integer) RedmineDataConverter.Integer.convert("5"));
+ tempI.setCategoryId((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempI.setDoneRatio((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempI.setLockVersion((Integer) RedmineDataConverter.Integer.convert("7"));
+ tempI.setPriorityId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempI.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setStatusId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempI.setTrackerId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setFixedVersionId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempI.setParentId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempI.setRootId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempI.setLft((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setRgt((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempI.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T20:11:52+02:00"));
+ tempI.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T00:37:40+02:00"));
+ tempI.setStartDate((Date) RedmineDataConverter.Date.convert("2009-09-04"));
+ tempI.setDescription((String) RedmineDataConverter.Text.convert("avec une description !"));
+ tempI.setSubject((String) RedmineDataConverter.Text.convert("yes!"));
+ model.put(Issue.class, tempI);
+ tempI = new Issue();
+ tempI.setAuthorId((Integer) RedmineDataConverter.Integer.convert("5"));
+ tempI.setCategoryId((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempI.setDoneRatio((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempI.setLockVersion((Integer) RedmineDataConverter.Integer.convert("7"));
+ tempI.setPriorityId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempI.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setStatusId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempI.setTrackerId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setFixedVersionId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempI.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T20:11:52+02:00"));
+ tempI.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T00:37:40+02:00"));
+ tempI.setStartDate((Date) RedmineDataConverter.Date.convert("2009-09-04"));
+ tempI.setDescription((String) RedmineDataConverter.Text.convert("avec une description !2"));
+ tempI.setSubject((String) RedmineDataConverter.Text.convert("yes!2"));
+ model.put(Issue.class, tempI);
+
+ Project tempP;
+ tempP = new Project();
+ tempP.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:11:54+02:00"));
+ tempP.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:11:54+02:00"));
+ tempP.setIdentifier((String) RedmineDataConverter.Text.convert("one"));
+ tempP.setName((String) RedmineDataConverter.Text.convert("one"));
+ tempP.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempP.setLft((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempP.setRgt((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempP.setProjectsCount((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempP.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempP.setIsPublic((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ model.put(Project.class, tempP);
+ tempP = new Project();
+ tempP.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T16:22:14+02:00"));
+ tempP.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T16:22:29+02:00"));
+ tempP.setIdentifier((String) RedmineDataConverter.Text.convert("two"));
+ tempP.setName((String) RedmineDataConverter.Text.convert("two"));
+ tempP.setId((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempP.setProjectsCount((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempP.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempP.setIsPublic((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ model.put(Project.class, tempP);
+
+ Tracker tempT;
+ tempT = new Tracker();
+ tempT.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setTrackerId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setPosition((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setIsInChlog((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempT.setIsInRoadmap((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempT.setName((String) RedmineDataConverter.Text.convert("Anomalie"));
+ model.put(Tracker.class, tempT);
+ tempT = new Tracker();
+ tempT.setId((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempT.setIsInChlog((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempT.setIsInRoadmap((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempT.setName((String) RedmineDataConverter.Text.convert("Evolution"));
+ tempT.setPosition((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempT.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setTrackerId((Integer) RedmineDataConverter.Integer.convert("2"));
+ model.put(Tracker.class, tempT);
+ tempT = new Tracker();
+ tempT.setId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempT.setIsInChlog((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempT.setIsInRoadmap((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempT.setName((String) RedmineDataConverter.Text.convert("Assistance"));
+ tempT.setPosition((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempT.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setTrackerId((Integer) RedmineDataConverter.Integer.convert("3"));
+ model.put(Tracker.class, tempT);
+
+ User tempU;
+ tempU = new User();
+ tempU.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T17:24:46+02:00"));
+ tempU.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T01:23:59+02:00"));
+ tempU.setLastLoginOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T01:23:59+02:00"));
+ tempU.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempU.setMemberId((Integer) RedmineDataConverter.Integer.convert("5"));
+ tempU.setRoleId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempU.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempU.setAdmin((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempU.setMailNotification((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempU.setFirstname((String) RedmineDataConverter.Text.convert("Redmine"));
+ tempU.setHashedPassword(
+ (String) RedmineDataConverter.Text.convert("70c881d4a26984ddce795f6f71817c9cf4480e79"));
+ tempU.setLanguage((String) RedmineDataConverter.Text.convert("fr"));
+ tempU.setLastname((String) RedmineDataConverter.Text.convert("Admin"));
+ tempU.setLogin((String) RedmineDataConverter.Text.convert("admin"));
+ tempU.setMail((String) RedmineDataConverter.Text.convert("dummy(a)codelutin.com"));
+ tempU.setIdentityUrl((String) RedmineDataConverter.Text.convert("yo"));
+ model.put(User.class, tempU);
+ tempU = new User();
+ tempU.setAdmin((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempU.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T19:49:02+02:00"));
+ tempU.setFirstname((String) RedmineDataConverter.Text.convert("tony"));
+ tempU.setHashedPassword(
+ (String) RedmineDataConverter.Text.convert("8aed1322e5450badb078e1fb60a817a1df25a2ca"));
+ tempU.setId((Integer) RedmineDataConverter.Integer.convert("5"));
+ tempU.setLanguage((String) RedmineDataConverter.Text.convert("fr"));
+ tempU.setLastLoginOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T19:49:38+02:00"));
+ tempU.setLastname((String) RedmineDataConverter.Text.convert("chemit2"));
+ tempU.setLogin((String) RedmineDataConverter.Text.convert("tchemit2"));
+ tempU.setMail((String) RedmineDataConverter.Text.convert("chemit(a)codelutin.com"));
+ tempU.setMailNotification((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempU.setMemberId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempU.setRoleId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempU.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempU.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T19:49:38+02:00"));
+ model.put(User.class, tempU);
+ tempU = new User();
+ tempU.setAdmin((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempU.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T16:24:11+02:00"));
+ tempU.setFirstname((String) RedmineDataConverter.Text.convert("dev"));
+ tempU.setHashedPassword(
+ (String) RedmineDataConverter.Text.convert("70c881d4a26984ddce795f6f71817c9cf4480e79"));
+ tempU.setId((Integer) RedmineDataConverter.Integer.convert("7"));
+ tempU.setLanguage((String) RedmineDataConverter.Text.convert("fr"));
+ tempU.setLastLoginOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T16:34:39+02:00"));
+ tempU.setLastname((String) RedmineDataConverter.Text.convert("dev"));
+ tempU.setLogin((String) RedmineDataConverter.Text.convert("dev"));
+ tempU.setMail((String) RedmineDataConverter.Text.convert("dev3(a)ynot-home.info"));
+ tempU.setMailNotification((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempU.setMemberId((Integer) RedmineDataConverter.Integer.convert("9"));
+ tempU.setRoleId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempU.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempU.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T16:34:39+02:00"));
+ model.put(User.class, tempU);
+
+ Version tempV;
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:47:39+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("yo"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("9"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("yor"));
+ tempV.setSharing((String) RedmineDataConverter.Text.convert("none"));
+ tempV.setStatus((String) RedmineDataConverter.Text.convert("open"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:50:49+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:09+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("13"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("rrrrrrrrrouuuuuua"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:09+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:07:58+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("15"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("aaaauuuuuua"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:07:58+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T04:12:25+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoyeppppppppppppppppp"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("16"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("aaaau"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T04:13:20+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:40+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("14"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("aaaaaaaaaarrrrrrrrrouuuuuua"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:40+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T00:39:15+02:00"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("5"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("2"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T00:39:15+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:13:05+02:00"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("1.0.0"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:13:05+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:12+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("yoye"));
+ tempV.setEffectiveDate((Date) RedmineDataConverter.Date.convert("2009-09-06"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("11"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("yaouuuuuua"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:12+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:50:59+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("yoye"));
+ tempV.setEffectiveDate((Date) RedmineDataConverter.Date.convert("2009-09-06"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("10"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("ya"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:54:16+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:37+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
+ tempV.setEffectiveDate((Date) RedmineDataConverter.Date.convert("2009-09-06"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("12"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("ouuuuuua"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:42+02:00"));
+ model.put(Version.class, tempV);
+
+ IssueStatus tempIS;
+ tempIS = new IssueStatus();
+ tempIS.setId(1);
+ tempIS.setName("Nouveau");
+ tempIS.setPosition(1);
+ tempIS.setDefaultDoneRatio(10);
+ tempIS.setIsClosed(false);
+ tempIS.setIsDefault(true);
+ model.put(IssueStatus.class, tempIS);
+ tempIS = new IssueStatus();
+ tempIS.setId(2);
+ tempIS.setName("Assigné");
+ tempIS.setPosition(2);
+ tempIS.setIsClosed(false);
+ tempIS.setIsDefault(false);
+ model.put(IssueStatus.class, tempIS);
+ tempIS = new IssueStatus();
+ tempIS.setId(3);
+ tempIS.setName("Résolu");
+ tempIS.setPosition(3);
+ tempIS.setIsClosed(false);
+ tempIS.setIsDefault(false);
+ model.put(IssueStatus.class, tempIS);
+ tempIS = new IssueStatus();
+ tempIS.setId(4);
+ tempIS.setName("Commentaire");
+ tempIS.setPosition(4);
+ tempIS.setIsClosed(false);
+ tempIS.setIsDefault(false);
+ model.put(IssueStatus.class, tempIS);
+ tempIS = new IssueStatus();
+ tempIS.setId(5);
+ tempIS.setName("Fermé");
+ tempIS.setPosition(5);
+ tempIS.setIsClosed(true);
+ tempIS.setIsDefault(false);
+ model.put(IssueStatus.class, tempIS);
+ tempIS = new IssueStatus();
+ tempIS.setId(6);
+ tempIS.setPosition(6);
+ tempIS.setName("Rejeté");
+ tempIS.setIsClosed(true);
+ tempIS.setIsDefault(false);
+ model.put(IssueStatus.class, tempIS);
+
+ IssuePriority tempIP;
+ tempIP = new IssuePriority();
+ tempIP.setId(3);
+ tempIP.setParentId(1);
+ tempIP.setProjectId(2);
+ tempIP.setName("Bas");
+ tempIP.setPosition(1);
+ tempIP.setOpt("IPRI");
+ tempIP.setIsDefault(false);
+ tempIP.setActive(true);
+ model.put(IssuePriority.class, tempIP);
+ tempIP = new IssuePriority();
+ tempIP.setId(4);
+ tempIP.setName("Normal");
+ tempIP.setPosition(2);
+ tempIP.setOpt("IPRI");
+ tempIP.setIsDefault(true);
+ model.put(IssuePriority.class, tempIP);
+ tempIP = new IssuePriority();
+ tempIP.setId(5);
+ tempIP.setName("Haut");
+ tempIP.setPosition(3);
+ tempIP.setOpt("IPRI");
+ tempIP.setIsDefault(false);
+ model.put(IssuePriority.class, tempIP);
+ tempIP = new IssuePriority();
+ tempIP.setId(6);
+ tempIP.setName("Urgent");
+ tempIP.setPosition(4);
+ tempIP.setOpt("IPRI");
+ tempIP.setIsDefault(false);
+ model.put(IssuePriority.class, tempIP);
+ tempIP = new IssuePriority();
+ tempIP.setId(7);
+ tempIP.setName("Immédiat");
+ tempIP.setPosition(5);
+ tempIP.setOpt("IPRI");
+ tempIP.setIsDefault(false);
+ model.put(IssuePriority.class, tempIP);
+
+ IssueCategory tempIC;
+ tempIC = new IssueCategory();
+ tempIC.setId(1);
+ tempIC.setName("categorie one");
+ tempIC.setProjectId(1);
+ model.put(IssueCategory.class, tempIC);
+ tempIC = new IssueCategory();
+ tempIC.setId(2);
+ tempIC.setName("categorie two");
+ tempIC.setProjectId(1);
+ model.put(IssueCategory.class, tempIC);
+
+ News tempN;
+ tempN = new News();
+ tempN.setId(85);
+ tempN.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-17T21:50:26+02:00"));
+ tempN.setProjectId(1);
+ tempN.setAuthorId(4);
+ tempN.setCommentsCount(0);
+ tempN.setDescription("description");
+ tempN.setSummary("summary");
+ tempN.setTitle("title");
+ model.put(News.class, tempN);
+ tempN = new News();
+ tempN.setId(86);
+ tempN.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-17T21:55:26+02:00"));
+ tempN.setProjectId(1);
+ tempN.setAuthorId(4);
+ tempN.setCommentsCount(0);
+ tempN.setDescription("description2");
+ tempN.setSummary("summary2");
+ tempN.setTitle("title2");
+ model.put(News.class, tempN);
+
+ TimeEntry tempE;
+
+ tempE = new TimeEntry();
+ tempE.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:02:02+01:00"));
+ tempE.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:02:02+01:00"));
+ tempE.setSpentOn((Date) RedmineDataConverter.Date.convert("2009-12-31"));
+ tempE.setId(1);
+ tempE.setProjectId(1);
+ tempE.setUserId(4);
+ tempE.setIssueId(6);
+ tempE.setActivityId(8);
+
+ tempE.setHours(1);
+ tempE.setTmonth(12);
+ tempE.setTyear(2009);
+ tempE.setTweek(53);
+ tempE.setComments("Test");
+ model.put(TimeEntry.class, tempE);
+
+ tempE = new TimeEntry();
+ tempE.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:10:01+01:00"));
+ tempE.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:10:01+01:00"));
+ tempE.setSpentOn((Date) RedmineDataConverter.Date.convert("2009-12-31"));
+ tempE.setId(2);
+ tempE.setProjectId(1);
+ tempE.setUserId(4);
+ tempE.setIssueId(6);
+ tempE.setActivityId(9);
+
+ tempE.setHours(2);
+ tempE.setTmonth(12);
+ tempE.setTyear(2009);
+ tempE.setTweek(53);
+ tempE.setComments("deuxième temps");
+ model.put(TimeEntry.class, tempE);
+ }
+
+}
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/model/io/xpp3/RedmineModelFixtures.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Modified: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3HelperTest.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3HelperTest.java 2012-10-03 23:21:54 UTC (rev 338)
+++ branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3HelperTest.java 2012-10-04 09:28:43 UTC (rev 339)
@@ -29,6 +29,7 @@
import com.google.common.collect.Lists;
import org.junit.After;
import org.junit.AfterClass;
+import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -36,7 +37,6 @@
import org.nuiton.io.xpp3.AbstractXpp3Reader;
import org.nuiton.io.xpp3.PropertyMapper;
import org.nuiton.io.xpp3.Xpp3Helper;
-import org.nuiton.jredmine.RedmineFixtures;
import org.nuiton.jredmine.model.Attachment;
import org.nuiton.jredmine.model.Issue;
import org.nuiton.jredmine.model.IssueCategory;
@@ -165,7 +165,7 @@
private static RedmineXpp3Helper builder;
- private static RedmineFixtures fixtures;
+ private static RedmineModelFixtures fixtures;
private final Class<T> type;
@@ -193,7 +193,7 @@
builder = new RedmineXpp3Helper();
// setup memory model
- fixtures = new RedmineFixtures();
+ fixtures = new RedmineModelFixtures();
}
@AfterClass
@@ -339,8 +339,8 @@
<T> void assertMyListEquals(Class<T> type, List<T> expecteds, T... actuals)
throws Exception {
- junit.framework.Assert.assertNotNull(actuals);
- junit.framework.Assert.assertEquals(expecteds.size(), actuals.length);
+ Assert.assertNotNull(actuals);
+ Assert.assertEquals(expecteds.size(), actuals.length);
for (int i = 0, j = expecteds.size(); i < j; i++) {
T actual = actuals[i];
T expected = expecteds.get(i);
@@ -352,8 +352,8 @@
public void assertMyEquals(Class<?> type, Object expected, Object actual, String... mapperNames)
throws Exception {
- junit.framework.Assert.assertNotNull(expected);
- junit.framework.Assert.assertNotNull(actual);
+ Assert.assertNotNull(expected);
+ Assert.assertNotNull(actual);
AbstractXpp3Reader<?> reader = (AbstractXpp3Reader<?>) Xpp3Helper.getReader(type);
Map<String, PropertyMapper> mappers = reader.getMappers(type);
List<String> mappersIncludes;
@@ -369,8 +369,8 @@
Object expectedValue = m.getDescriptor().getReadMethod().invoke(expected);
Object actualValue = m.getDescriptor().getReadMethod().invoke(actual);
- junit.framework.Assert.assertEquals("error in attribute " + m.getPropertyName() + " for " + expected, expectedValue,
- actualValue);
+ Assert.assertEquals("error in attribute " + m.getPropertyName() + " for " + expected, expectedValue,
+ actualValue);
}
}
}
Modified: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/rest/RedmineRestClientTest.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/rest/RedmineRestClientTest.java 2012-10-03 23:21:54 UTC (rev 338)
+++ branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/rest/RedmineRestClientTest.java 2012-10-04 09:28:43 UTC (rev 339)
@@ -35,10 +35,10 @@
import org.junit.ClassRule;
import org.junit.Test;
import org.nuiton.io.rest.RestRequest;
-import org.nuiton.jredmine.RedmineAnonymousFixtureClassRule;
import org.nuiton.jredmine.RedmineFixtures;
import org.nuiton.jredmine.RedmineServiceConfiguration;
import org.nuiton.jredmine.model.ModelHelper;
+import org.nuiton.jredmine.test.RedmineAnonymousFixtureClassRule;
import java.io.InputStream;
@@ -53,8 +53,8 @@
LogFactory.getLog(RedmineRestClientTest.class);
@ClassRule
- public static final RedmineAnonymousFixtureClassRule checkConfigRule =
- new RedmineAnonymousFixtureClassRule();
+ public static final RedmineAnonymousFixtureClassRule<RedmineFixtures> checkConfigRule =
+ RedmineAnonymousFixtureClassRule.newFixtures(RedmineFixtures.class);
protected RedmineFixtures getFixtures() {
return checkConfigRule.getFixtures();
Added: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/AbstractRedmineFixtures.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/AbstractRedmineFixtures.java (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/AbstractRedmineFixtures.java 2012-10-04 09:28:43 UTC (rev 339)
@@ -0,0 +1,105 @@
+package org.nuiton.jredmine.test;
+/*
+ * #%L
+ * JRedmine :: Client
+ * $Id$
+ * $HeadURL: http://svn.nuiton.org/svn/jredmine/branches/jredmine-1.x/jredmine-client/sr… $
+ * %%
+ * 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.nuiton.jredmine.DefaultRedmineAnonymousService;
+import org.nuiton.jredmine.DefaultRedmineService;
+import org.nuiton.jredmine.RedmineAnonymousService;
+import org.nuiton.jredmine.RedmineConfigurationUtil;
+import org.nuiton.jredmine.RedmineService;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+
+import java.io.IOException;
+
+/**
+ * TODO
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public abstract class AbstractRedmineFixtures {
+
+ private RedmineServiceConfiguration anonymousConfiguration;
+
+ private RedmineServiceConfiguration logguedConfiguration;
+
+ public static final int TIMESTAMP = Math.abs((int) System.nanoTime());
+
+ public RedmineServiceConfiguration obtainRedmineConfiguration() throws IOException {
+
+ return RedmineConfigurationUtil.obtainRedmineConfiguration(
+ newAnonymousConfiguration());
+ }
+
+ 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;
+ }
+
+}
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/AbstractRedmineFixtures.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/RedmineAnonymousFixtureClassRule.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/RedmineAnonymousFixtureClassRule.java (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/RedmineAnonymousFixtureClassRule.java 2012-10-04 09:28:43 UTC (rev 339)
@@ -0,0 +1,101 @@
+package org.nuiton.jredmine.test;
+/*
+ * #%L
+ * JRedmine :: Client
+ * $Id$
+ * $HeadURL: http://svn.nuiton.org/svn/jredmine/branches/jredmine-1.x/jredmine-client/sr… $
+ * %%
+ * 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 org.nuiton.jredmine.RedmineFixtures;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+
+import java.io.IOException;
+
+/**
+ * A class rule that provider the {@link RedmineFixtures} and check that the
+ * valid anonymous configuration is found.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public class RedmineAnonymousFixtureClassRule<F extends AbstractRedmineFixtures> implements TestRule {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(RedmineAnonymousFixtureClassRule.class);
+
+ public static <F extends AbstractRedmineFixtures> RedmineAnonymousFixtureClassRule<F> newFixtures(Class<F> fixtureType) {
+ try {
+ F fixture = fixtureType.newInstance();
+ return new RedmineAnonymousFixtureClassRule<F>(fixture);
+ } catch (Exception e) {
+ throw new IllegalArgumentException("Could not instanciate fixtures", e);
+ }
+ }
+
+ protected final F fixtures;
+
+ protected RedmineServiceConfiguration conf;
+
+ private RedmineAnonymousFixtureClassRule(F fixtures) {
+ this.fixtures = fixtures;
+ }
+
+ @Override
+ public Statement apply(Statement base, Description description) {
+
+ Class<?> testClass = description.getTestClass();
+
+ try {
+ conf = fixtures.obtainRedmineConfiguration();
+
+ 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 F getFixtures() {
+ return fixtures;
+ }
+
+ public RedmineServiceConfiguration getConf() {
+ return conf;
+ }
+}
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/RedmineAnonymousFixtureClassRule.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/RedmineFixtureClassRule.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/RedmineFixtureClassRule.java (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/RedmineFixtureClassRule.java 2012-10-04 09:28:43 UTC (rev 339)
@@ -0,0 +1,112 @@
+package org.nuiton.jredmine.test;
+/*
+ * #%L
+ * JRedmine :: Client
+ * $Id$
+ * $HeadURL: http://svn.nuiton.org/svn/jredmine/branches/jredmine-1.x/jredmine-client/sr… $
+ * %%
+ * 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 org.nuiton.jredmine.RedmineFixtures;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+
+import java.io.IOException;
+
+/**
+ * A class rule that provider the {@link RedmineFixtures} and check that the
+ * valid loggued configuration is found.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public class RedmineFixtureClassRule<F extends AbstractRedmineFixtures> implements TestRule {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(RedmineFixtureClassRule.class);
+
+ public static <F extends AbstractRedmineFixtures> RedmineFixtureClassRule<F> newFixtures(Class<F> fixtureType) {
+ try {
+ F fixture = fixtureType.newInstance();
+ return new RedmineFixtureClassRule<F>(fixture);
+ } catch (Exception e) {
+ throw new IllegalArgumentException("Could not instanciate fixtures", e);
+ }
+ }
+
+ protected final F fixtures;
+
+ protected RedmineServiceConfiguration conf;
+
+ private RedmineFixtureClassRule(F fixtures) {
+ this.fixtures = fixtures;
+ }
+
+ @Override
+ public Statement apply(Statement base, Description description) {
+
+ Class<?> testClass = description.getTestClass();
+
+ try {
+ conf = fixtures.obtainRedmineConfiguration();
+
+ 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 F getFixtures() {
+ return fixtures;
+ }
+
+ public RedmineServiceConfiguration getConf() {
+ return conf;
+ }
+}
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/RedmineFixtureClassRule.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/RedmineServer.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/RedmineServer.java (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/RedmineServer.java 2012-10-04 09:28:43 UTC (rev 339)
@@ -0,0 +1,161 @@
+package org.nuiton.jredmine.test;
+/*
+ * #%L
+ * JRedmine :: Client
+ * $Id$
+ * $HeadURL: http://svn.nuiton.org/svn/jredmine/branches/jredmine-1.x/jredmine-client/sr… $
+ * %%
+ * 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 org.nuiton.jredmine.RedmineAnonymousService;
+import org.nuiton.jredmine.RedmineService;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+
+import java.io.IOException;
+
+/**
+ * A redmine server resource used by tests.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public abstract class RedmineServer<S extends RedmineAnonymousService, F> extends TestWatcher {
+
+ public static <F extends AbstractRedmineFixtures> RedmineServer<RedmineAnonymousService, F> newAnonymousServer(RedmineAnonymousFixtureClassRule<F> rule) {
+ return new RedmineServer<RedmineAnonymousService, F>(rule.getFixtures()) {
+
+ @Override
+ protected RedmineAnonymousService createService(
+ RedmineServiceConfiguration configuration) throws IOException, RedmineServiceException {
+ return fixtures.newRedmineAnonymousService(configuration);
+ }
+
+ @Override
+ protected RedmineServiceConfiguration createConfiguration() throws IOException {
+ return fixtures.newAnonymousConfiguration();
+ }
+ };
+ }
+
+ public static <F extends AbstractRedmineFixtures> RedmineServer<RedmineService, F> newLogguedServerAsAnonymous(RedmineAnonymousFixtureClassRule<F> rule) {
+ return new RedmineServer<RedmineService, F>(rule.getFixtures()) {
+
+ @Override
+ protected RedmineService createService(
+ RedmineServiceConfiguration configuration) throws IOException, RedmineServiceException {
+ return fixtures.newRedmineService(configuration);
+ }
+
+ @Override
+ protected RedmineServiceConfiguration createConfiguration() throws IOException {
+ return fixtures.newAnonymousConfiguration();
+ }
+ };
+ }
+
+ public static <F extends AbstractRedmineFixtures> RedmineServer<RedmineService, F> newLogguedServer(RedmineFixtureClassRule<F> rule) {
+ return new RedmineServer<RedmineService, F>(rule.getFixtures()) {
+
+ @Override
+ protected RedmineService createService(
+ RedmineServiceConfiguration configuration) throws IOException, RedmineServiceException {
+ return fixtures.newRedmineService(configuration);
+ }
+
+ @Override
+ protected RedmineServiceConfiguration createConfiguration() throws IOException {
+ return fixtures.newLogguedConfiguration();
+ }
+ };
+ }
+
+ /**
+ * Fixtures.
+ *
+ * @since 1.4
+ */
+ protected final F fixtures;
+
+ /**
+ * Service configuration to use.
+ *
+ * @since 1.4
+ */
+ protected RedmineServiceConfiguration configuration;
+
+ /**
+ * Redmine service to use.
+ *
+ * @since 1.4
+ */
+ protected S service;
+
+ public RedmineServer(F fixtures) {
+ this.fixtures = fixtures;
+ }
+
+ protected abstract S createService(RedmineServiceConfiguration configuration) throws IOException, RedmineServiceException;
+
+ protected abstract RedmineServiceConfiguration createConfiguration() throws IOException;
+
+ public F 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/test/java/org/nuiton/jredmine/test/RedmineServer.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/tck/RedmineAnonymousServiceTCK.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/tck/RedmineAnonymousServiceTCK.java (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/tck/RedmineAnonymousServiceTCK.java 2012-10-04 09:28:43 UTC (rev 339)
@@ -0,0 +1,182 @@
+package org.nuiton.jredmine.test.tck;
+/*
+ * #%L
+ * JRedmine :: Client
+ * $Id$
+ * $HeadURL: http://svn.nuiton.org/svn/jredmine/branches/jredmine-1.x/jredmine-client/sr… $
+ * %%
+ * 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.RedmineAnonymousService;
+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 org.nuiton.jredmine.test.RedmineAnonymousFixtureClassRule;
+import org.nuiton.jredmine.test.RedmineServer;
+
+/**
+ * Tests the {@link RedmineAnonymousService} service.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public class RedmineAnonymousServiceTCK {
+
+ @ClassRule
+ public static final RedmineAnonymousFixtureClassRule<RedmineTCKFixtures> classRule =
+ RedmineAnonymousFixtureClassRule.newFixtures(RedmineTCKFixtures.class);
+
+ @Rule
+ public final RedmineServer<RedmineAnonymousService, RedmineTCKFixtures> server =
+ RedmineServer.newAnonymousServer(classRule);
+
+ protected RedmineTCKFixtures 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/test/java/org/nuiton/jredmine/test/tck/RedmineAnonymousServiceTCK.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/tck/RedmineServiceAsAnonymousTCK.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/tck/RedmineServiceAsAnonymousTCK.java (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/tck/RedmineServiceAsAnonymousTCK.java 2012-10-04 09:28:43 UTC (rev 339)
@@ -0,0 +1,216 @@
+package org.nuiton.jredmine.test.tck;
+/*
+ * #%L
+ * JRedmine :: Client
+ * $Id$
+ * $HeadURL: http://svn.nuiton.org/svn/jredmine/branches/jredmine-1.x/jredmine-client/sr… $
+ * %%
+ * 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.RedmineService;
+import org.nuiton.jredmine.RedmineServiceLoginException;
+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 org.nuiton.jredmine.test.RedmineAnonymousFixtureClassRule;
+import org.nuiton.jredmine.test.RedmineServer;
+
+/**
+ * Tests the {@link RedmineService} service with anonymous configuration.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public class RedmineServiceAsAnonymousTCK {
+
+ @ClassRule
+ public static final RedmineAnonymousFixtureClassRule<RedmineTCKFixtures> classRule =
+ RedmineAnonymousFixtureClassRule.newFixtures(RedmineTCKFixtures.class);
+
+ @Rule
+ public final RedmineServer<RedmineService, RedmineTCKFixtures> server =
+ RedmineServer.newLogguedServerAsAnonymous(classRule);
+
+ @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());
+ }
+
+ protected RedmineTCKFixtures getFixtures() {
+ return server.getFixtures();
+ }
+
+ protected RedmineService getService() {
+ return server.getService();
+ }
+}
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/tck/RedmineServiceAsAnonymousTCK.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/tck/RedmineServiceTCK.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/tck/RedmineServiceTCK.java (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/tck/RedmineServiceTCK.java 2012-10-04 09:28:43 UTC (rev 339)
@@ -0,0 +1,224 @@
+package org.nuiton.jredmine.test.tck;
+/*
+ * #%L
+ * JRedmine :: Client
+ * $Id$
+ * $HeadURL: http://svn.nuiton.org/svn/jredmine/branches/jredmine-1.x/jredmine-client/sr… $
+ * %%
+ * 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.RedmineService;
+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 org.nuiton.jredmine.test.RedmineFixtureClassRule;
+import org.nuiton.jredmine.test.RedmineServer;
+
+/**
+ * Tests the {@link RedmineService} service with loggued configuration.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public class RedmineServiceTCK {
+
+ @ClassRule
+ public static final RedmineFixtureClassRule<RedmineTCKFixtures> classRule =
+ RedmineFixtureClassRule.newFixtures(RedmineTCKFixtures.class);
+
+ @Rule
+ public final RedmineServer<RedmineService, RedmineTCKFixtures> server =
+ RedmineServer.newLogguedServer(classRule);
+
+ protected RedmineTCKFixtures 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/test/java/org/nuiton/jredmine/test/tck/RedmineServiceTCK.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/tck/RedmineTCKFixtures.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/tck/RedmineTCKFixtures.java (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/test/tck/RedmineTCKFixtures.java 2012-10-04 09:28:43 UTC (rev 339)
@@ -0,0 +1,122 @@
+package org.nuiton.jredmine.test.tck;
+/*
+ * #%L
+ * JRedmine :: Client
+ * $Id$
+ * $HeadURL: http://svn.nuiton.org/svn/jredmine/branches/jredmine-1.x/jredmine-client/sr… $
+ * %%
+ * 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 org.nuiton.jredmine.test.AbstractRedmineFixtures;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Date;
+
+/**
+ * TODO
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public class RedmineTCKFixtures extends AbstractRedmineFixtures {
+
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(RedmineTCKFixtures.class);
+
+ public String projectName() {
+ return "project1";
+ }
+
+ public String versionName() {
+ return "1.0";
+ }
+
+ public String versionId() {
+ return "1";
+ }
+
+ public String issueId() {
+ return "1";
+ }
+
+ 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/test/java/org/nuiton/jredmine/test/tck/RedmineTCKFixtures.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
1
0
Author: tchemit
Date: 2012-10-04 01:21:54 +0200 (Thu, 04 Oct 2012)
New Revision: 338
Url: http://nuiton.org/repositories/revision/jredmine/338
Log:
still can't use its if server not reacheable :(
Modified:
branches/jredmine-1.x/jredmine-client/pom.xml
Modified: branches/jredmine-1.x/jredmine-client/pom.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/pom.xml 2012-10-03 23:15:57 UTC (rev 337)
+++ branches/jredmine-1.x/jredmine-client/pom.xml 2012-10-03 23:21:54 UTC (rev 338)
@@ -229,12 +229,12 @@
<profile>
<id>run-its</id>
- <activation>
+ <!--activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
- </activation>
+ </activation-->
<build>
<defaultGoal>integration-test</defaultGoal>
<plugins>
1
0
03 Oct '12
Author: tchemit
Date: 2012-10-04 01:15:57 +0200 (Thu, 04 Oct 2012)
New Revision: 337
Url: http://nuiton.org/repositories/revision/jredmine/337
Log:
improve invoker configuration
Modified:
branches/jredmine-1.x/jredmine-client/pom.xml
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/pom.xml 2012-10-03 23:04:42 UTC (rev 336)
+++ branches/jredmine-1.x/jredmine-client/pom.xml 2012-10-03 23:15:57 UTC (rev 337)
@@ -229,52 +229,38 @@
<profile>
<id>run-its</id>
- <!--activation>
+ <activation>
<property>
- <name>maven.test.skip</name>
- <value>!true</value>
+ <name>performRelease</name>
+ <value>true</value>
</property>
- </activation-->
+ </activation>
<build>
<defaultGoal>integration-test</defaultGoal>
<plugins>
<plugin>
<artifactId>maven-invoker-plugin</artifactId>
<configuration>
+ <mergeUserSettings>true</mergeUserSettings>
<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>
+ <id>integration-test</id>
<goals>
<goal>install</goal>
<goal>run</goal>
</goals>
<configuration>
+ <setupIncludes>
+ <setupInclude>redmine-test/pom.xml</setupInclude>
+ </setupIncludes>
<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>
Modified: branches/jredmine-1.x/jredmine-client/src/it/settings.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/it/settings.xml 2012-10-03 23:04:42 UTC (rev 336)
+++ branches/jredmine-1.x/jredmine-client/src/it/settings.xml 2012-10-03 23:15:57 UTC (rev 337)
@@ -2,14 +2,6 @@
<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>
1
0
r336 - branches/jredmine-1.x/jredmine-client/src/it/redmine-test
by tchemit@users.nuiton.org 03 Oct '12
by tchemit@users.nuiton.org 03 Oct '12
03 Oct '12
Author: tchemit
Date: 2012-10-04 01:04:42 +0200 (Thu, 04 Oct 2012)
New Revision: 336
Url: http://nuiton.org/repositories/revision/jredmine/336
Log:
add missing goals.txt file
Added:
branches/jredmine-1.x/jredmine-client/src/it/redmine-test/goals.txt
Added: branches/jredmine-1.x/jredmine-client/src/it/redmine-test/goals.txt
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/it/redmine-test/goals.txt (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/it/redmine-test/goals.txt 2012-10-03 23:04:42 UTC (rev 336)
@@ -0,0 +1 @@
+clean install
\ No newline at end of file
Property changes on: branches/jredmine-1.x/jredmine-client/src/it/redmine-test/goals.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
1
0
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(a)codelutin.com>
+ * @since 1.4
+ */
+(a)Suite.SuiteClasses(
+ {
+ RedmineAnonymousServiceTest.class,
+ RedmineLogguedServiceAsAnonymousTest.class,
+ RedmineLogguedServiceTest.class
+ }
+)
+(a)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(a)codelutin.com>
+ * @since 1.4
+ */
+(a)Suite.SuiteClasses(
+ {
+ RedmineAnonymousServiceTest.class,
+ RedmineLogguedServiceAsAnonymousTest.class,
+ RedmineLogguedServiceTest.class
+ }
+)
+(a)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/sr… $
+ * %%
+ * 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(a)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/sr… $
+ * %%
+ * 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(a)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/sr… $
+ * %%
+ * 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(a)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/sr… $
+ * %%
+ * 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(a)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/sr… $
+ * %%
+ * 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(a)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/sr… $
+ * %%
+ * 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(a)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/sr… $
+ * %%
+ * 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(a)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
1
0
r334 - branches/jredmine-1.x/jredmine-client/src/main/redmine/jredmine-2.x/config
by tchemit@users.nuiton.org 03 Oct '12
by tchemit@users.nuiton.org 03 Oct '12
03 Oct '12
Author: tchemit
Date: 2012-10-04 00:53:13 +0200 (Thu, 04 Oct 2012)
New Revision: 334
Url: http://nuiton.org/repositories/revision/jredmine/334
Log:
fix login route for jremdine plugin
Modified:
branches/jredmine-1.x/jredmine-client/src/main/redmine/jredmine-2.x/config/routes.rb
Modified: branches/jredmine-1.x/jredmine-client/src/main/redmine/jredmine-2.x/config/routes.rb
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/main/redmine/jredmine-2.x/config/routes.rb 2012-10-03 07:29:40 UTC (rev 333)
+++ branches/jredmine-1.x/jredmine-client/src/main/redmine/jredmine-2.x/config/routes.rb 2012-10-03 22:53:13 UTC (rev 334)
@@ -25,9 +25,10 @@
RedmineApp::Application.routes.draw do
# jredmine : actions with no project context
- match 'jredmine/:action.xml', :to => 'jredmine#:action', :action => ['get_projects', 'get_user_projects', 'get_issue_statuses', 'get_issue_priorities', 'get_enumeration'], :format => 'xml', :via => ['get']
- match 'jredmine/:action.json', :to => 'jredmine#:action', :action => ['get_projects', 'get_user_projects', 'get_issue_statuses', 'get_issue_priorities', 'get_enumeration'], :format => 'json', :via => ['get']
- match 'jredmine/:action', :to => 'jredmine#:action', :action => ['ping', 'login', 'logout', 'get_projects', 'get_user_projects', 'get_issue_statuses', 'get_issue_priorities', 'get_enumeration'], :format => 'xml', :via => ['get']
+ match 'jredmine/:action.xml', :to => 'jredmine#:action', :action => ['get_projects', 'get_user_projects', 'get_issue_statuses', 'get_issue_priorities', 'get_enumeration'], :format => 'xml', :via => ['get']
+ match 'jredmine/:action.json', :to => 'jredmine#:action', :action => ['get_projects', 'get_user_projects', 'get_issue_statuses', 'get_issue_priorities', 'get_enumeration'], :format => 'json', :via => ['get']
+ match 'jredmine/:action', :to => 'jredmine#:action', :action => ['login'], :format => 'xml', :via => ['post']
+ match 'jredmine/:action', :to => 'jredmine#:action', :action => ['ping', 'logout', 'get_projects', 'get_user_projects', 'get_issue_statuses', 'get_issue_priorities', 'get_enumeration'], :format => 'xml', :via => ['get']
# jredmine/action/:pid : actions with project context
match 'jredmine/:action.xml/:pid', :to=> 'jredmine#:action', :pid => /.+/, :format => 'xml', :via => ['get', 'post']
1
0
r333 - branches/jredmine-1.x/jredmine-client/src/main/assembly
by tchemit@users.nuiton.org 03 Oct '12
by tchemit@users.nuiton.org 03 Oct '12
03 Oct '12
Author: tchemit
Date: 2012-10-03 09:29:40 +0200 (Wed, 03 Oct 2012)
New Revision: 333
Url: http://nuiton.org/repositories/revision/jredmine/333
Log:
fix assembly
Modified:
branches/jredmine-1.x/jredmine-client/src/main/assembly/jredmine_rails-1.x.xml
Modified: branches/jredmine-1.x/jredmine-client/src/main/assembly/jredmine_rails-1.x.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/main/assembly/jredmine_rails-1.x.xml 2012-10-02 21:51:46 UTC (rev 332)
+++ branches/jredmine-1.x/jredmine-client/src/main/assembly/jredmine_rails-1.x.xml 2012-10-03 07:29:40 UTC (rev 333)
@@ -30,7 +30,7 @@
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
- <directory>src/main/redmine/jredmine-1.X</directory>
+ <directory>src/main/redmine/jredmine-1.x</directory>
<outputDirectory>jredmine</outputDirectory>
<includes>
<include>**/*</include>
1
0