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
July 2012
- 1 participants
- 62 discussions
Author: tchemit
Date: 2012-07-13 19:12:48 +0200 (Fri, 13 Jul 2012)
New Revision: 290
Url: http://nuiton.org/repositories/revision/jredmine/290
Log:
fix headers
Modified:
trunk/jredmine-client-1.x/pom.xml
trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceImpl.java
trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRequestFactoryImpl.java
trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRestClient.java
trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImpl.java
trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImplementorImpl.java
trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceProviderImpl.java
trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceTest.java
trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineFixtures.java
trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServer.java
trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceAsAnonymousTest.java
trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceTest.java
trunk/jredmine-client-1.x/src/test/resources/log4j.properties
trunk/jredmine-client-1.x/src/test/resources/test-config.properties
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineAnonymousService.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineLogguedService.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineRestUnavailable.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineService.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineServiceConfiguration.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineServiceException.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineServiceLoginException.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineServiceProvider.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/Attachment.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/CustomField.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/I18nAble.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/IdAble.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/Issue.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/IssueCategory.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/IssuePriority.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/IssueStatus.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/ModelHelper.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/News.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/Project.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/ProjectRef.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/TimeEntry.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/Tracker.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/User.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/UserRef.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/Version.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/VersionStatusEnum.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/AttachmentXpp3Reader.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/CustomFieldXpp3Reader.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/DefaultRedmineXpp3Helper.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueCategoryXpp3Reader.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssuePriorityXpp3Reader.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueStatusXpp3Reader.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueXpp3Reader.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/NewsXpp3Reader.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectRefXpp3Reader.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectXpp3Reader.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineDataConverter.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3Helper.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/TimeEntryXpp3Reader.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/TrackerXpp3Reader.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserRefXpp3Reader.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserXpp3Reader.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/VersionXpp3Reader.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/DefaultRedmineRequestBuilder.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/IssueScopeRedmineRequestBuilder.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/ProjectScopeRedmineRequestBuilder.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/VersionScopeRedmineRequestBuilder.java
trunk/jredmine-client-api/src/test/java/org/nuiton/jredmine/RedmineFixtures.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineAnonymousServiceJersey.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceImplementorJersey.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceJersey.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/RedmineRequestFactoryImpl.java
trunk/jredmine-client/src/test/java/org/nuiton/jredmine/FakeRedmineServiceConfiguration.java
trunk/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineAnonymousServiceJerseyTest.java
trunk/jredmine-maven-plugin/pom.xml
trunk/jredmine-maven-plugin/src/license/THIRD-PARTY.properties
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java
trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/FakeRedmineServiceConfiguration.java
trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/JRedminePluginFixtures.java
Modified: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineAnonymousServiceJersey.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineAnonymousServiceJersey.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineAnonymousServiceJersey.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceImplementorJersey.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceImplementorJersey.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceImplementorJersey.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceJersey.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceJersey.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceJersey.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -4,7 +4,7 @@
* $Id:$
* $HeadURL:$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/RedmineRequestFactoryImpl.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/RedmineRequestFactoryImpl.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/RedmineRequestFactoryImpl.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id: RedmineRequestFactory.java 256 2012-03-25 15:37:26Z tchemit $
* $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/main/java/org/… $
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client/src/test/java/org/nuiton/jredmine/FakeRedmineServiceConfiguration.java
===================================================================
--- trunk/jredmine-client/src/test/java/org/nuiton/jredmine/FakeRedmineServiceConfiguration.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client/src/test/java/org/nuiton/jredmine/FakeRedmineServiceConfiguration.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineAnonymousServiceJerseyTest.java
===================================================================
--- trunk/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineAnonymousServiceJerseyTest.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineAnonymousServiceJerseyTest.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-1.x/pom.xml
===================================================================
--- trunk/jredmine-client-1.x/pom.xml 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-1.x/pom.xml 2012-07-13 17:12:48 UTC (rev 290)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
#%L
- JRedmine :: Client 1.3.x
+ JRedmine :: Client 1.x
%%
Copyright (C) 2009 - 2010 Tony Chemit, CodeLutin
%%
@@ -38,7 +38,7 @@
</parent>
<groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-client-1.3.x</artifactId>
+ <artifactId>jredmine-client-1.x</artifactId>
<dependencies>
@@ -109,13 +109,13 @@
</dependencies>
- <name>JRedmine :: Client 1.3.x</name>
- <description>The JRedmine client for redmine 1.3.x series</description>
+ <name>JRedmine :: Client 1.x</name>
+ <description>The JRedmine client for redmine 1.x series</description>
<properties>
<!-- extra files to include in release -->
<redmine.releaseFiles>
- target/${project.artifactId}-${project.version}-jredmine_rails-1.3.x.zip,
+ target/${project.artifactId}-${project.version}-jredmine_rails-1.x.zip,
${redmine.libReleaseFiles}
</redmine.releaseFiles>
</properties>
Modified: trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceImpl.java
===================================================================
--- trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceImpl.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceImpl.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -1,11 +1,11 @@
+package org.nuiton.jredmine.v1_3_x;
/*
* #%L
- * JRedmine :: Client
- *
- * $Id: DefaultRedmineAnonymousService.java 257 2012-03-25 15:48:53Z tchemit $
- * $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/main/java/org/… $
+ * JRedmine :: Client 1.x
+ * $Id:$
+ * $HeadURL:$
* %%
- * Copyright (C) 2009 - 2010 Tony Chemit, CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
@@ -22,7 +22,6 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L%
*/
-package org.nuiton.jredmine.v1_3_x;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Modified: trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRequestFactoryImpl.java
===================================================================
--- trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRequestFactoryImpl.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRequestFactoryImpl.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.v1_3_x;
+/*
+ * #%L
+ * JRedmine :: Client 1.x
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ * %%
+ * 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.base.Strings;
import org.nuiton.io.rest.AbstractRequestFactory;
Modified: trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRestClient.java
===================================================================
--- trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRestClient.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRestClient.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -1,11 +1,11 @@
+package org.nuiton.jredmine.v1_3_x;
/*
* #%L
- * JRedmine :: Client
- *
- * $Id: RedmineRestClient.java 211 2011-06-04 17:01:31Z tchemit $
- * $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/main/java/org/… $
+ * JRedmine :: Client 1.x
+ * $Id:$
+ * $HeadURL:$
* %%
- * Copyright (C) 2009 - 2010 Tony Chemit, CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
@@ -22,7 +22,6 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L%
*/
-package org.nuiton.jredmine.v1_3_x;
import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.HttpStatus;
Modified: trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImpl.java
===================================================================
--- trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImpl.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImpl.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -1,11 +1,11 @@
+package org.nuiton.jredmine.v1_3_x;
/*
* #%L
- * JRedmine :: Client
- *
- * $Id: DefaultRedmineService.java 257 2012-03-25 15:48:53Z tchemit $
- * $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/main/java/org/… $
+ * JRedmine :: Client 1.x
+ * $Id:$
+ * $HeadURL:$
* %%
- * Copyright (C) 2009 - 2010 Tony Chemit, CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
@@ -22,7 +22,6 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L%
*/
-package org.nuiton.jredmine.v1_3_x;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Modified: trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImplementorImpl.java
===================================================================
--- trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImplementorImpl.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImplementorImpl.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -1,11 +1,11 @@
+package org.nuiton.jredmine.v1_3_x;
/*
* #%L
- * JRedmine :: Client
- *
- * $Id: DefaultRedmineServiceImplementor.java 257 2012-03-25 15:48:53Z tchemit $
- * $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/main/java/org/… $
+ * JRedmine :: Client 1.x
+ * $Id:$
+ * $HeadURL:$
* %%
- * Copyright (C) 2009 - 2010 Tony Chemit, CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
@@ -22,7 +22,6 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L%
*/
-package org.nuiton.jredmine.v1_3_x;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Modified: trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceProviderImpl.java
===================================================================
--- trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceProviderImpl.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceProviderImpl.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.v1_3_x;
+/*
+ * #%L
+ * JRedmine :: Client 1.x
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ * %%
+ * 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.RedmineAnonymousService;
import org.nuiton.jredmine.RedmineService;
Modified: trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceTest.java
===================================================================
--- trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceTest.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceTest.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.v1_3_x;
+/*
+ * #%L
+ * JRedmine :: Client 1.x
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ * %%
+ * 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.BeforeClass;
Modified: trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineFixtures.java
===================================================================
--- trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineFixtures.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineFixtures.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.v1_3_x;
+/*
+ * #%L
+ * JRedmine :: Client 1.x
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ * %%
+ * 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.base.Charsets;
import com.google.common.collect.ArrayListMultimap;
Modified: trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServer.java
===================================================================
--- trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServer.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServer.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.v1_3_x;
+/*
+ * #%L
+ * JRedmine :: Client 1.x
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ * %%
+ * 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;
Modified: trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceAsAnonymousTest.java
===================================================================
--- trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceAsAnonymousTest.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceAsAnonymousTest.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.v1_3_x;
+/*
+ * #%L
+ * JRedmine :: Client 1.x
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ * %%
+ * 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.BeforeClass;
Modified: trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceTest.java
===================================================================
--- trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceTest.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceTest.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.v1_3_x;
+/*
+ * #%L
+ * JRedmine :: Client 1.x
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ * %%
+ * 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.BeforeClass;
Modified: trunk/jredmine-client-1.x/src/test/resources/log4j.properties
===================================================================
--- trunk/jredmine-client-1.x/src/test/resources/log4j.properties 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-1.x/src/test/resources/log4j.properties 2012-07-13 17:12:48 UTC (rev 290)
@@ -1,11 +1,10 @@
###
# #%L
-# JRedmine :: Client
-#
+# JRedmine :: Client 1.x
# $Id$
-# $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/test/resources… $
+# $HeadURL:$
# %%
-# Copyright (C) 2009 - 2010 CodeLutin
+# Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
# %%
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
@@ -22,23 +21,6 @@
# <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
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
Modified: trunk/jredmine-client-1.x/src/test/resources/test-config.properties
===================================================================
--- trunk/jredmine-client-1.x/src/test/resources/test-config.properties 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-1.x/src/test/resources/test-config.properties 2012-07-13 17:12:48 UTC (rev 290)
@@ -1,11 +1,10 @@
###
# #%L
-# JRedmine :: Client
-#
+# JRedmine :: Client 1.x
# $Id$
-# $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/test/resources… $
+# $HeadURL:$
# %%
-# Copyright (C) 2009 - 2010 CodeLutin
+# Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
# %%
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineAnonymousService.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineAnonymousService.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineAnonymousService.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineLogguedService.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineLogguedService.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineLogguedService.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineRestUnavailable.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineRestUnavailable.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineRestUnavailable.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineService.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineService.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineService.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineServiceConfiguration.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineServiceConfiguration.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineServiceConfiguration.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineServiceException.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineServiceException.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineServiceException.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineServiceLoginException.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineServiceLoginException.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineServiceLoginException.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineServiceProvider.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineServiceProvider.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineServiceProvider.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ * %%
+ * 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%
+ */
/**
* Define a provider of redmine client.
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/Attachment.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/Attachment.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/Attachment.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/CustomField.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/CustomField.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/CustomField.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/I18nAble.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/I18nAble.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/I18nAble.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/IdAble.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/IdAble.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/IdAble.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/Issue.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/Issue.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/Issue.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/IssueCategory.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/IssueCategory.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/IssueCategory.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/IssuePriority.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/IssuePriority.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/IssuePriority.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/IssueStatus.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/IssueStatus.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/IssueStatus.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/ModelHelper.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/ModelHelper.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/ModelHelper.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
@@ -40,57 +40,57 @@
*/
public class ModelHelper {
- public static final String GET_ALL_ISSUES_REQUEST_NAME = Issue.class.getName() + "/all";
+ public static final String GET_ALL_ISSUES_REQUEST_NAME = "Project/Version/Issue/all";
- public static final String GET_ALL_ISSUE_STATUS_REQUEST_NAME = IssueStatus.class.getName() + "/all";
+ public static final String GET_ALL_ISSUE_STATUS_REQUEST_NAME = "IssueStatus/all";
- public static final String GET_ALL_ISSUE_PRIORITY_REQUEST_NAME = IssuePriority.class.getName() + "/all";
+ public static final String GET_ALL_ISSUE_PRIORITY_REQUEST_NAME = "IssuePriority/all";
- public static final String GET_ALL_ISSUE_CATEGORY_REQUEST_NAME = IssueCategory.class.getName() + "/all";
+ public static final String GET_ALL_ISSUE_CATEGORY_REQUEST_NAME = "IssueCategory/all";
- public static final String GET_ALL_ISSUE_TIME_ENTRY_REQUEST_NAME = TimeEntry.class.getName() + "/all";
+ public static final String GET_ALL_ISSUE_TIME_ENTRY_REQUEST_NAME = "TimeEntry/all";
- public static final String GET_ALL_PROJECT_REQUEST_NAME = Project.class.getName() + "/all";
+ public static final String GET_ALL_PROJECT_REQUEST_NAME = "Project/all";
- public static final String GET_ALL_PROJECT_ISSUES_REQUEST_NAME = Project.class.getName() + "/all";
+ public static final String GET_ALL_PROJECT_ISSUES_REQUEST_NAME = "Project/Issue/all";
- public static final String GET_ALL_PROJECT_OPENED_ISSUES_REQUEST_NAME = Project.class.getName() + "/opened-issues";
+ public static final String GET_ALL_PROJECT_OPENED_ISSUES_REQUEST_NAME = "Project/Issue/opened";
- public static final String GET_ALL_PROJECT_CLOSED_ISSUES_REQUEST_NAME = Project.class.getName() + "/closed-issues";
+ public static final String GET_ALL_PROJECT_CLOSED_ISSUES_REQUEST_NAME = "Project/Issue//closed";
- public static final String GET_USER_PROJECTS_REQUEST_NAME = Project.class.getName() + "/forUser";
+ public static final String GET_USER_PROJECTS_REQUEST_NAME = "User/Project/all";
- public static final String GET_PROJECT_REQUEST_NAME = Project.class.getName() + "/detail";
+ public static final String GET_PROJECT_REQUEST_NAME = "Project/detail";
- public static final String GET_ALL_VERSION_REQUEST_NAME = Version.class.getName() + "/all";
+ public static final String GET_ALL_VERSION_REQUEST_NAME = "Project/Version/all";
- public static final String GET_ALL_TRACKER_REQUEST_NAME = Tracker.class.getName() + "/all";
+ public static final String GET_ALL_TRACKER_REQUEST_NAME = "Project/Tracker/all";
- public static final String GET_ALL_ATTACHMENTS_REQUEST_NAME = Attachment.class.getName() + "/all";
+ public static final String GET_ALL_ATTACHMENTS_REQUEST_NAME = "Project/Version/Attachment/all";
- public static final String GET_ALL_USER_REQUEST_NAME = User.class.getName() + "/all";
+ public static final String GET_ALL_USER_REQUEST_NAME = "Project/User/all";
- public static final String GET_ALL_NEWS_REQUEST_NAME = News.class.getName() + "/all";
+ public static final String GET_ALL_NEWS_REQUEST_NAME = "Project/News/all";
- public static final String GET_VERSION_REQUEST_NAME = Version.class.getName() + "/detail";
+ public static final String GET_VERSION_REQUEST_NAME = "Project/Version/detail";
- public static final String ADD_VERSION_REQUEST_NAME = Version.class.getName() + "/add";
+ public static final String ADD_VERSION_REQUEST_NAME = "Project/Version/add";
- public static final String UPDATE_VERSION_REQUEST_NAME = Version.class.getName() + "/update";
+ public static final String UPDATE_VERSION_REQUEST_NAME = "Project/Version/update";
- public static final String NEXT_VERSION_REQUEST_NAME = Version.class.getName() + "/next";
+ public static final String NEXT_VERSION_REQUEST_NAME = "Project/Version/next";
- public static final String ADD_NEWS_REQUEST_NAME = News.class.getName() + "/add";
+ public static final String ADD_NEWS_REQUEST_NAME = "Project/News/add";
- public static final String ADD_ATTACHMENT_REQUEST_NAME = Attachment.class.getName() + "/add";
+ public static final String ADD_ATTACHMENT_REQUEST_NAME = "Project/Version/Attachment/add";
- public static final String ADD_ISSUE_TIME_ENTRY_REQUEST_NAME = TimeEntry.class.getName() + "/add";
+ public static final String ADD_ISSUE_TIME_ENTRY_REQUEST_NAME = "Project/Issue/TimeEntry/add";
- public static final String LOGIN_REQUEST_NAME = "login";
+ public static final String LOGIN_REQUEST_NAME = "Login";
- public static final String LOGOUT_REQUEST_NAME = "logout";
+ public static final String LOGOUT_REQUEST_NAME = "Logout";
- public static final String PING_REQUEST_NAME = "ping";
+ public static final String PING_REQUEST_NAME = "Ping";
public static final String VERSION_SCOPE = "version";
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/News.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/News.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/News.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/Project.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/Project.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/Project.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/ProjectRef.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/ProjectRef.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/ProjectRef.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/TimeEntry.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/TimeEntry.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/TimeEntry.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/Tracker.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/Tracker.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/Tracker.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/User.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/User.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/User.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/UserRef.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/UserRef.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/UserRef.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/Version.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/Version.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/Version.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/VersionStatusEnum.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/VersionStatusEnum.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/VersionStatusEnum.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/AttachmentXpp3Reader.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/AttachmentXpp3Reader.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/AttachmentXpp3Reader.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/CustomFieldXpp3Reader.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/CustomFieldXpp3Reader.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/CustomFieldXpp3Reader.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/DefaultRedmineXpp3Helper.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/DefaultRedmineXpp3Helper.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/DefaultRedmineXpp3Helper.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueCategoryXpp3Reader.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueCategoryXpp3Reader.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueCategoryXpp3Reader.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssuePriorityXpp3Reader.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssuePriorityXpp3Reader.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssuePriorityXpp3Reader.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueStatusXpp3Reader.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueStatusXpp3Reader.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueStatusXpp3Reader.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueXpp3Reader.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueXpp3Reader.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueXpp3Reader.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/NewsXpp3Reader.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/NewsXpp3Reader.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/NewsXpp3Reader.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectRefXpp3Reader.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectRefXpp3Reader.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectRefXpp3Reader.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectXpp3Reader.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectXpp3Reader.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectXpp3Reader.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineDataConverter.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineDataConverter.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineDataConverter.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3Helper.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3Helper.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3Helper.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/TimeEntryXpp3Reader.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/TimeEntryXpp3Reader.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/TimeEntryXpp3Reader.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/TrackerXpp3Reader.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/TrackerXpp3Reader.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/TrackerXpp3Reader.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserRefXpp3Reader.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserRefXpp3Reader.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserRefXpp3Reader.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserXpp3Reader.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserXpp3Reader.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserXpp3Reader.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/VersionXpp3Reader.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/VersionXpp3Reader.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/VersionXpp3Reader.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/DefaultRedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/DefaultRedmineRequestBuilder.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/DefaultRedmineRequestBuilder.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/IssueScopeRedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/IssueScopeRedmineRequestBuilder.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/IssueScopeRedmineRequestBuilder.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/ProjectScopeRedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/ProjectScopeRedmineRequestBuilder.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/ProjectScopeRedmineRequestBuilder.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/VersionScopeRedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/VersionScopeRedmineRequestBuilder.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/VersionScopeRedmineRequestBuilder.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-client-api/src/test/java/org/nuiton/jredmine/RedmineFixtures.java
===================================================================
--- trunk/jredmine-client-api/src/test/java/org/nuiton/jredmine/RedmineFixtures.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-client-api/src/test/java/org/nuiton/jredmine/RedmineFixtures.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2012 CodeLutin
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Modified: trunk/jredmine-maven-plugin/pom.xml
===================================================================
--- trunk/jredmine-maven-plugin/pom.xml 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-maven-plugin/pom.xml 2012-07-13 17:12:48 UTC (rev 290)
@@ -161,6 +161,12 @@
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-site-renderer</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.velocity</groupId>
+ <artifactId>velocity-tools</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
Modified: trunk/jredmine-maven-plugin/src/license/THIRD-PARTY.properties
===================================================================
--- trunk/jredmine-maven-plugin/src/license/THIRD-PARTY.properties 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-maven-plugin/src/license/THIRD-PARTY.properties 2012-07-13 17:12:48 UTC (rev 290)
@@ -14,12 +14,13 @@
# - MIT License
# - Public Domain
# - The Apache Software License, Version 2.0
+# - The MIT License
# - http://classworlds.codehaus.org/license.html
#-------------------------------------------------------------------------------
# Please fill the missing licenses for dependencies :
#
#
-#Tue Mar 20 23:45:15 CET 2012
+#Fri Jul 13 19:05:22 CEST 2012
classworlds--classworlds--1.1=http\://classworlds.codehaus.org/license.html
commons-digester--commons-digester--1.6=The Apache Software License, Version 2.0
org.codehaus.plexus--plexus-container-default--1.0-alpha-9-stable-1=The Apache Software License, Version 2.0
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -279,9 +279,6 @@
RequestFactory requestFactory =
((RedmineServiceImplementor) service).getSession().getRequestFactory();
-
- String scope;
-
String requestName = typesToRequestName.get(type);
RestRequestBuilder requestBuilder =
requestFactory.getRequestBuilder(requestName);
Modified: trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/FakeRedmineServiceConfiguration.java
===================================================================
--- trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/FakeRedmineServiceConfiguration.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/FakeRedmineServiceConfiguration.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.plugin;
+/*
+ * #%L
+ * JRedmine :: Maven plugin
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2012 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.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
Modified: trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/JRedminePluginFixtures.java
===================================================================
--- trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/JRedminePluginFixtures.java 2012-07-13 16:49:39 UTC (rev 289)
+++ trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/JRedminePluginFixtures.java 2012-07-13 17:12:48 UTC (rev 290)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.plugin;
+/*
+ * #%L
+ * JRedmine :: Maven plugin
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 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.base.Charsets;
import org.apache.commons.io.FileUtils;
1
0
r289 - in trunk: . jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x jredmine-maven-plugin
by tchemit@users.nuiton.org 13 Jul '12
by tchemit@users.nuiton.org 13 Jul '12
13 Jul '12
Author: tchemit
Date: 2012-07-13 18:49:39 +0200 (Fri, 13 Jul 2012)
New Revision: 289
Url: http://nuiton.org/repositories/revision/jredmine/289
Log:
rename module
Added:
trunk/jredmine-client-1.x/
trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceImpl.java
trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRequestFactoryImpl.java
trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRestClient.java
trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImpl.java
trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImplementorImpl.java
trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceProviderImpl.java
trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineFixtures.java
trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceAsAnonymousTest.java
Removed:
trunk/jredmine-client-1.3.x/
trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceImpl.java
trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRequestFactoryImpl.java
trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRestClient.java
trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImpl.java
trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImplementorImpl.java
trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineFixtures.java
trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceAsAnonymousTest.java
Modified:
trunk/jredmine-maven-plugin/pom.xml
trunk/pom.xml
Deleted: trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceImpl.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceImpl.java 2012-07-13 16:27:10 UTC (rev 281)
+++ trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceImpl.java 2012-07-13 16:49:39 UTC (rev 289)
@@ -1,284 +0,0 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id: DefaultRedmineAnonymousService.java 257 2012-03-25 15:48:53Z tchemit $
- * $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/main/java/org/… $
- * %%
- * Copyright (C) 2009 - 2010 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%
- */
-package org.nuiton.jredmine.v1_3_x;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.nuiton.jredmine.RedmineAnonymousService;
-import org.nuiton.jredmine.RedmineServiceConfiguration;
-import org.nuiton.jredmine.RedmineServiceException;
-import org.nuiton.jredmine.RedmineServiceImplementor;
-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;
-
-/**
- * Default implementation of {@link RedmineAnonymousService}.
- * <p/>
- * This implementation just make sure that the rest client is anonnymous.
- * <p/>
- * Created: 2 janv. 2010
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @plexus.component role="org.nuiton.jredmine.RedmineAnonymousService" role-hint="1.3.x"
- * @see RedmineServiceConfiguration#isAnonymous()
- * @since 1.0.3
- */
-public class RedmineAnonymousServiceImpl implements RedmineServiceImplementor, RedmineAnonymousService {
-
- /** Logger. */
- private static final Log log =
- LogFactory.getLog(RedmineAnonymousServiceImpl.class);
-
- /** @plexus.requirement role="org.nuiton.jredmine.RedmineServiceImplementor" role-hint="1.3.x" */
- protected RedmineServiceImplementor delegateImplementor;
-
- public RedmineAnonymousServiceImpl() {
- }
-
- ///////////////////////////////////////////////////////////////////////////
- /// RedmineAnonymousService implementation
- ///////////////////////////////////////////////////////////////////////////
-
- @Override
- public IssueStatus[] getIssueStatuses() throws RedmineServiceException {
- return getDatas(RedmineRequestFactoryImpl.GET_ISSUE_STATUS_LIST,
- IssueStatus.class
- );
- }
-
- @Override
- public IssuePriority[] getIssuePriorities() throws RedmineServiceException {
- return getDatas(RedmineRequestFactoryImpl.GET_ISSUE_PRIORITY_LIST,
- IssuePriority.class
- );
- }
-
- @Override
- public Project[] getProjects() throws RedmineServiceException {
- return getDatas(RedmineRequestFactoryImpl.GET_PROJECT_LIST, Project.class);
- }
-
- @Override
- public IssueCategory[] getIssueCategories(String projectName) throws RedmineServiceException {
- return getDatas(RedmineRequestFactoryImpl.GET_ISSUE_CATEGORY_LIST,
- IssueCategory.class,
- projectName
- );
- }
-
- @Override
- public Project getProject(String projectName) throws RedmineServiceException {
- return getData(RedmineRequestFactoryImpl.GET_PROJECT,
- Project.class,
- projectName
- );
- }
-
- @Override
- public Tracker[] getTrackers(String projectName) throws RedmineServiceException {
- return getDatas(RedmineRequestFactoryImpl.GET_TRACKER_LIST,
- Tracker.class,
- projectName
- );
- }
-
- @Override
- public News[] getNews(String projectName) throws RedmineServiceException {
- return getDatas(RedmineRequestFactoryImpl.GET_NEWS_LIST,
- News.class,
- projectName
- );
- }
-
- @Override
- public User[] getProjectMembers(String projectName) throws RedmineServiceException {
- return getDatas(RedmineRequestFactoryImpl.GET_USER_LIST,
- User.class,
- projectName
- );
- }
-
- @Override
- public Version[] getVersions(String projectName) throws RedmineServiceException {
- return getDatas(RedmineRequestFactoryImpl.GET_VERSION_LIST,
- Version.class,
- projectName
- );
- }
-
- @Override
- public Version getVersion(String projectName,
- String versionName) throws RedmineServiceException {
- return getData(RedmineRequestFactoryImpl.GET_VERSION,
- Version.class,
- projectName,
- versionName
- );
- }
-
- @Override
- public Attachment[] getAttachments(String projectName,
- String versionName) throws RedmineServiceException {
- return getDatas(RedmineRequestFactoryImpl.GET_ATTACHMENTS_LIST,
- Attachment.class,
- projectName,
- versionName
- );
- }
-
- @Override
- public Issue[] getIssues(String projectName,
- String versionName) throws RedmineServiceException {
- return getDatas(RedmineRequestFactoryImpl.GET_ISSUE_LIST,
- Issue.class,
- projectName,
- versionName
- );
- }
-
- @Override
- public TimeEntry[] getIssueTimeEntries(String projectName,
- String issueId) throws RedmineServiceException {
- return getDatas(RedmineRequestFactoryImpl.GET_ISSUE_TIME_ENTRY_LIST,
- TimeEntry.class,
- projectName,
- issueId
- );
- }
-
- @Override
- public Issue[] getIssues(String projectName) throws RedmineServiceException {
- Issue[] result = getDatas(RedmineRequestFactoryImpl.GET_PROJECT_ISSUES,
- Issue.class,
- projectName
- );
- return result;
- }
-
- @Override
- public Issue[] getOpenedIssues(String projectName) throws RedmineServiceException {
- Issue[] result = getDatas(RedmineRequestFactoryImpl.GET_PROJECT_OPENED_ISSUES,
- Issue.class,
- projectName
- );
- return result;
- }
-
- @Override
- public Issue[] getClosedIssues(String projectName) throws RedmineServiceException {
- Issue[] result = getDatas(RedmineRequestFactoryImpl.GET_PROJECT_CLOSED_ISSUES,
- Issue.class,
- projectName
- );
- return result;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- /// RedmineServiceImplementor implementation
- ///////////////////////////////////////////////////////////////////////////
- @Override
- public RedmineServiceImplementor init(RedmineServiceConfiguration configuration) throws RedmineServiceException {
- // Force to not be loggued
- configuration.setAnonymous(true);
- if (log.isDebugEnabled()) {
- log.debug("init configuration for " + this);
- }
- return delegateImplementor.init(configuration);
- }
-
- @Override
- public int ping() {
- return delegateImplementor.ping();
- }
-
- @Override
- public void login() throws RedmineServiceLoginException {
- delegateImplementor.login();
- }
-
- @Override
- public void logout() throws RedmineServiceLoginException {
- delegateImplementor.logout();
- }
-
- @Override
- public <T> T getData(String requestName,
- Class<T> type,
- Object... args) throws RedmineServiceException {
- return delegateImplementor.getData(requestName, type, args);
- }
-
- @Override
- public <T> T[] getDatas(String requestName,
- Class<T> type,
- Object... args) throws RedmineServiceException {
- return delegateImplementor.getDatas(requestName, type, args);
- }
-
- @Override
- public <T> T sendData(String requestName,
- Class<T> type,
- Object... args) throws RedmineServiceException {
- return delegateImplementor.sendData(requestName, type, args);
- }
-
- @Override
- public <T> T[] sendDatas(String requestName,
- Class<T> type,
- Object... args) throws RedmineServiceException {
- return delegateImplementor.sendDatas(requestName, type, args);
- }
-
- @Override
- public boolean isInit() {
- return delegateImplementor.isInit();
- }
-
- @Override
- public boolean isLoggued() {
- return delegateImplementor.isLoggued();
- }
-
- @Override
- public void destroy() throws RedmineServiceException {
- delegateImplementor.destroy();
- }
-
- @Override
- public void checkLoggued() throws IllegalStateException, RedmineServiceLoginException, NullPointerException {
- delegateImplementor.checkLoggued();
- }
-
-}
Copied: trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceImpl.java (from rev 288, trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceImpl.java)
===================================================================
--- trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceImpl.java (rev 0)
+++ trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceImpl.java 2012-07-13 16:49:39 UTC (rev 289)
@@ -0,0 +1,290 @@
+/*
+ * #%L
+ * JRedmine :: Client
+ *
+ * $Id: DefaultRedmineAnonymousService.java 257 2012-03-25 15:48:53Z tchemit $
+ * $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/main/java/org/… $
+ * %%
+ * Copyright (C) 2009 - 2010 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%
+ */
+package org.nuiton.jredmine.v1_3_x;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.io.rest.RestClient;
+import org.nuiton.jredmine.RedmineAnonymousService;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+import org.nuiton.jredmine.RedmineServiceImplementor;
+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.ModelHelper;
+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;
+
+/**
+ * Default implementation of {@link RedmineAnonymousService}.
+ * <p/>
+ * This implementation just make sure that the rest client is anonnymous.
+ * <p/>
+ * Created: 2 janv. 2010
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @see RedmineServiceConfiguration#isAnonymous()
+ * @since 1.0.3
+ */
+public class RedmineAnonymousServiceImpl implements RedmineServiceImplementor, RedmineAnonymousService {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(RedmineAnonymousServiceImpl.class);
+
+ protected RedmineServiceImplementor delegateImplementor;
+
+ public RedmineAnonymousServiceImpl() {
+ delegateImplementor = new RedmineServiceImplementorImpl();
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ /// RedmineAnonymousService implementation
+ ///////////////////////////////////////////////////////////////////////////
+
+ @Override
+ public IssueStatus[] getIssueStatuses() throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_ISSUE_STATUS_REQUEST_NAME,
+ IssueStatus.class
+ );
+ }
+
+ @Override
+ public IssuePriority[] getIssuePriorities() throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_ISSUE_PRIORITY_REQUEST_NAME,
+ IssuePriority.class
+ );
+ }
+
+ @Override
+ public Project[] getProjects() throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_PROJECT_REQUEST_NAME, Project.class);
+ }
+
+ @Override
+ public IssueCategory[] getIssueCategories(String projectName) throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_ISSUE_CATEGORY_REQUEST_NAME,
+ IssueCategory.class,
+ projectName
+ );
+ }
+
+ @Override
+ public Project getProject(String projectName) throws RedmineServiceException {
+ return getData(ModelHelper.GET_PROJECT_REQUEST_NAME,
+ Project.class,
+ projectName
+ );
+ }
+
+ @Override
+ public Tracker[] getTrackers(String projectName) throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_TRACKER_REQUEST_NAME,
+ Tracker.class,
+ projectName
+ );
+ }
+
+ @Override
+ public News[] getNews(String projectName) throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_NEWS_REQUEST_NAME,
+ News.class,
+ projectName
+ );
+ }
+
+ @Override
+ public User[] getProjectMembers(String projectName) throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_USER_REQUEST_NAME,
+ User.class,
+ projectName
+ );
+ }
+
+ @Override
+ public Version[] getVersions(String projectName) throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_VERSION_REQUEST_NAME,
+ Version.class,
+ projectName
+ );
+ }
+
+ @Override
+ public Version getVersion(String projectName,
+ String versionName) throws RedmineServiceException {
+ return getData(ModelHelper.GET_VERSION_REQUEST_NAME,
+ Version.class,
+ projectName,
+ versionName
+ );
+ }
+
+ @Override
+ public Attachment[] getAttachments(String projectName,
+ String versionName) throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_ATTACHMENTS_REQUEST_NAME,
+ Attachment.class,
+ projectName,
+ versionName
+ );
+ }
+
+ @Override
+ public Issue[] getIssues(String projectName,
+ String versionName) throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_ISSUES_REQUEST_NAME,
+ Issue.class,
+ projectName,
+ versionName
+ );
+ }
+
+ @Override
+ public TimeEntry[] getIssueTimeEntries(String projectName,
+ String issueId) throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_ISSUE_TIME_ENTRY_REQUEST_NAME,
+ TimeEntry.class,
+ projectName,
+ issueId
+ );
+ }
+
+ @Override
+ public Issue[] getIssues(String projectName) throws RedmineServiceException {
+ Issue[] result = getDatas(ModelHelper.GET_ALL_PROJECT_ISSUES_REQUEST_NAME,
+ Issue.class,
+ projectName
+ );
+ return result;
+ }
+
+ @Override
+ public Issue[] getOpenedIssues(String projectName) throws RedmineServiceException {
+ Issue[] result = getDatas(ModelHelper.GET_ALL_PROJECT_OPENED_ISSUES_REQUEST_NAME,
+ Issue.class,
+ projectName
+ );
+ return result;
+ }
+
+ @Override
+ public Issue[] getClosedIssues(String projectName) throws RedmineServiceException {
+ Issue[] result = getDatas(ModelHelper.GET_ALL_PROJECT_CLOSED_ISSUES_REQUEST_NAME,
+ Issue.class,
+ projectName
+ );
+ return result;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ /// RedmineServiceImplementor implementation
+ ///////////////////////////////////////////////////////////////////////////
+ @Override
+ public RedmineServiceImplementor init(RedmineServiceConfiguration configuration) throws RedmineServiceException {
+ // Force to not be loggued
+ configuration.setAnonymous(true);
+ if (log.isDebugEnabled()) {
+ log.debug("init configuration for " + this);
+ }
+ return delegateImplementor.init(configuration);
+ }
+
+ @Override
+ public RestClient getSession() {
+ return delegateImplementor.getSession();
+ }
+
+ @Override
+ public int ping() {
+ return delegateImplementor.ping();
+ }
+
+ @Override
+ public void login() throws RedmineServiceLoginException {
+ delegateImplementor.login();
+ }
+
+ @Override
+ public void logout() throws RedmineServiceLoginException {
+ delegateImplementor.logout();
+ }
+
+ @Override
+ public <T> T getData(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ return delegateImplementor.getData(requestName, type, args);
+ }
+
+ @Override
+ public <T> T[] getDatas(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ return delegateImplementor.getDatas(requestName, type, args);
+ }
+
+ @Override
+ public <T> T sendData(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ return delegateImplementor.sendData(requestName, type, args);
+ }
+
+ @Override
+ public <T> T[] sendDatas(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ return delegateImplementor.sendDatas(requestName, type, args);
+ }
+
+ @Override
+ public boolean isInit() {
+ return delegateImplementor.isInit();
+ }
+
+ @Override
+ public boolean isLoggued() {
+ return delegateImplementor.isLoggued();
+ }
+
+ @Override
+ public void destroy() throws RedmineServiceException {
+ delegateImplementor.destroy();
+ }
+
+ @Override
+ public void checkLoggued() throws IllegalStateException, RedmineServiceLoginException, NullPointerException {
+ delegateImplementor.checkLoggued();
+ }
+
+}
Deleted: trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRequestFactoryImpl.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRequestFactoryImpl.java 2012-07-13 16:27:10 UTC (rev 281)
+++ trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRequestFactoryImpl.java 2012-07-13 16:49:39 UTC (rev 289)
@@ -1,271 +0,0 @@
-package org.nuiton.jredmine.v1_3_x;
-
-import com.google.common.base.Strings;
-import org.nuiton.io.rest.AbstractRequestFactory;
-import org.nuiton.io.rest.RestMethod;
-import org.nuiton.io.rest.RestRequest;
-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.VersionStatusEnum;
-import org.nuiton.jredmine.request.DefaultRedmineRequestBuilder;
-import org.nuiton.jredmine.request.IssueScopeRedmineRequestBuilder;
-import org.nuiton.jredmine.request.ProjectScopeRedmineRequestBuilder;
-import org.nuiton.jredmine.request.VersionScopeRedmineRequestBuilder;
-
-import java.io.File;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Factory of {@link RestRequest}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @plexus.component role="org.nuiton.io.rest.RequestFactory" role-hint="1.3.x"
- * @since 1.4
- */
-public class RedmineRequestFactoryImpl extends AbstractRequestFactory {
-
- public static final String GET_ISSUE_LIST = Issue.class.getName() + "list";
-
- public static final String GET_ISSUE_STATUS_LIST = IssueStatus.class.getName() + "list";
-
- public static final String GET_ISSUE_PRIORITY_LIST = IssuePriority.class.getName() + "list";
-
- public static final String GET_ISSUE_CATEGORY_LIST = IssueCategory.class.getName() + "list";
-
- public static final String GET_ISSUE_TIME_ENTRY_LIST = TimeEntry.class.getName() + "list";
-
- public static final String GET_PROJECT_LIST = Project.class.getName() + "list";
-
- public static final String GET_PROJECT_ISSUES = Project.class.getName() + "issues";
-
- public static final String GET_PROJECT_OPENED_ISSUES = Project.class.getName() + "opened-issues";
-
- public static final String GET_PROJECT_CLOSED_ISSUES = Project.class.getName() + "closed-issues";
-
- public static final String GET_USER_PROJECTS = Project.class.getName() + "forUser";
-
- public static final String GET_PROJECT = Project.class.getName() + "detail";
-
- public static final String GET_VERSION_LIST = Version.class.getName() + "list";
-
- public static final String GET_TRACKER_LIST = Tracker.class.getName() + "list";
-
- public static final String GET_ATTACHMENTS_LIST = Attachment.class.getName() + "list";
-
- public static final String GET_USER_LIST = User.class.getName() + "list";
-
- public static final String GET_NEWS_LIST = News.class.getName() + "list";
-
- public static final String GET_VERSION = Version.class.getName() + "detail";
-
- public static final String ADD_VERSION = Version.class.getName() + "add";
-
- public static final String UPDATE_VERSION = Version.class.getName() + "update";
-
- public static final String NEXT_VERSION = Version.class.getName() + "next";
-
- public static final String ADD_NEWS = News.class.getName() + "add";
-
- public static final String ADD_ATTACHMENT = Attachment.class.getName() + "add";
-
- public static final String ADD_ISSUE_TIME_ENTRY = TimeEntry.class.getName() + "add";
-
- public static final String LOGIN = "login";
-
- public static final String LOGOUT = "logout";
-
- public static final String PING = "ping";
-
- @Override
- public void addDefaultRequests() {
-
- // misc requests
-
-// addRequestBuilder(new DefaultRedmineRequestBuilder(PING, RestMethod.GET, "jredmine", "ping"));
- addRequestBuilder(new DefaultRedmineRequestBuilder(PING, RestMethod.GET, "projects"));
- addRequestBuilder(new DefaultRedmineRequestBuilder(LOGOUT, RestMethod.GET, "jredmine", "logout"));
- addRequestBuilder(new DefaultRedmineRequestBuilder(LOGIN, RestMethod.POST, "login") {
-// addRequestBuilder(new DefaultRedmineRequestBuilder(LOGIN, RestMethod.POST, "jredmine", "login") {
-
- private static final long serialVersionUID = 1L;
-
- @Override
- public String[] getParameters(Object... args) {
- String login = (String) args[0];
- String password = (String) args[1];
- return new String[]{"username", login, "password", password};
- }
- });
-
- // data with no scope requests
-
-// addRequestBuilder(new DefaultRedmineRequestBuilder(GET_PROJECT_LIST, "jredmine", "get_projects.xml"));
- addRequestBuilder(new DefaultRedmineRequestBuilder(GET_PROJECT_LIST, RestMethod.GET, "projects.xml"));
- addRequestBuilder(new DefaultRedmineRequestBuilder(GET_USER_PROJECTS, RestMethod.GET, "jredmine", "get_user_projects.xml"));
- addRequestBuilder(new DefaultRedmineRequestBuilder(GET_ISSUE_STATUS_LIST, RestMethod.GET, "jredmine", "get_issue_statuses.xml"));
- addRequestBuilder(new DefaultRedmineRequestBuilder(GET_ISSUE_PRIORITY_LIST, RestMethod.GET, "jredmine", "get_issue_priorities.xml"));
-
- // data with project scope requests
-
- addRequestBuilder(new ProjectScopeRedmineRequestBuilder(GET_PROJECT, RestMethod.GET, "jredmine", "get_project.xml"));
- addRequestBuilder(new ProjectScopeRedmineRequestBuilder(GET_PROJECT_ISSUES, RestMethod.GET, "jredmine", "get_project_issues.xml"));
- addRequestBuilder(new ProjectScopeRedmineRequestBuilder(GET_PROJECT_OPENED_ISSUES, RestMethod.GET, "jredmine", "get_project_opened_issues.xml"));
- addRequestBuilder(new ProjectScopeRedmineRequestBuilder(GET_PROJECT_CLOSED_ISSUES, RestMethod.GET, "jredmine", "get_project_closed_issues.xml"));
- addRequestBuilder(new ProjectScopeRedmineRequestBuilder(GET_VERSION_LIST, RestMethod.GET, "jredmine", "get_project_versions.xml"));
- addRequestBuilder(new ProjectScopeRedmineRequestBuilder(GET_ISSUE_CATEGORY_LIST, RestMethod.GET, "jredmine", "get_issue_categories.xml"));
- addRequestBuilder(new ProjectScopeRedmineRequestBuilder(GET_TRACKER_LIST, RestMethod.GET, "jredmine", "get_project_trackers.xml"));
- addRequestBuilder(new ProjectScopeRedmineRequestBuilder(GET_USER_LIST, RestMethod.GET, "jredmine", "get_project_users.xml"));
- addRequestBuilder(new ProjectScopeRedmineRequestBuilder(GET_NEWS_LIST, RestMethod.GET, "jredmine", "get_project_news.xml"));
-
- addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ADD_VERSION, RestMethod.POST, "jredmine", "add_version.xml") {
- private static final long serialVersionUID = 1L;
-
- @Override
- public String[] getParameters(Object... args) {
- Version version = (Version) args[1];
- String date = getVersionEffectiveDate(version);
- String status = getVersionStatus(version);
- return new String[]{
- "version[name]", version.getName(),
- "version[description]", version.getDescription(),
- "version[effective_date]", date,
- "version[status]", status
- };
- }
- });
-
- addRequestBuilder(new ProjectScopeRedmineRequestBuilder(UPDATE_VERSION, RestMethod.POST, "jredmine", "update_version.xml") {
- private static final long serialVersionUID = 1L;
-
- @Override
- public String[] getParameters(Object... args) {
- Version version = (Version) args[1];
- String date = getVersionEffectiveDate(version);
- String status = getVersionStatus(version);
- return new String[]{
- "version[name]", version.getName(),
- "version[description]", version.getDescription(),
- "version[effective_date]", date,
- "version[status]", status
- };
- }
- });
-
- addRequestBuilder(new ProjectScopeRedmineRequestBuilder(NEXT_VERSION, RestMethod.POST, "jredmine", "next_version.xml") {
- private static final long serialVersionUID = 1L;
-
- @Override
- public String[] getParameters(Object... args) {
-
-
- Version version = (Version) args[1];
- String date = getVersionEffectiveDate(version);
- String status = getVersionStatus(version);
- String oldVersionName = (String) args[2];
- return new String[]{
- "oldVersionName", oldVersionName,
- "version[name]", version.getName(),
- "version[description]", version.getDescription(),
- "version[effective_date]", date,
- "version[status]", status
- };
- }
- });
-
- addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ADD_NEWS, RestMethod.POST, "jredmine", "add_news.xml") {
- private static final long serialVersionUID = 1L;
-
- @Override
- public String[] getParameters(Object... args) {
- News news = (News) args[1];
- return new String[]{
- "news[title]", news.getTitle(),
- "news[summary]", news.getSummary(),
- "news[description]", news.getDescription()
- };
- }
- });
-
- // version scope requests
-
- addRequestBuilder(new VersionScopeRedmineRequestBuilder(GET_VERSION, RestMethod.GET, "jredmine", "get_version.xml"));
- addRequestBuilder(new VersionScopeRedmineRequestBuilder(GET_ISSUE_LIST, RestMethod.GET, "jredmine", "get_version_issues.xml"));
- addRequestBuilder(new VersionScopeRedmineRequestBuilder(GET_ATTACHMENTS_LIST, RestMethod.GET, "jredmine", "get_version_attachments.xml"));
- addRequestBuilder(new VersionScopeRedmineRequestBuilder(ADD_ATTACHMENT, RestMethod.POST, "jredmine", "add_version_attachment.xml") {
- private static final long serialVersionUID = 1L;
-
- @Override
- public String[] getParameters(Object... args) {
- String versionId = (String) args[1];
- Attachment attachment = (Attachment) args[2];
- return new String[]{
- "version_name", versionId,
- "attachment[description]", attachment.getDescription()
- };
- }
-
- @Override
- public Map<String, File> getAttachments(Object... args) {
- Map<String, File> upload = new HashMap<String, File>();
- Attachment attachment = (Attachment) args[2];
- upload.put("attachment[file]", attachment.getToUpload());
- return upload;
- }
- });
-
- // issue scope requests
-
- addRequestBuilder(new IssueScopeRedmineRequestBuilder(GET_ISSUE_TIME_ENTRY_LIST, RestMethod.GET, "jredmine", "get_issue_times.xml"));
-
- addRequestBuilder(new IssueScopeRedmineRequestBuilder(ADD_ISSUE_TIME_ENTRY, RestMethod.POST, "jredmine", "add_issue_time.xml") {
- private static final long serialVersionUID = 1L;
-
- @Override
- public String[] getParameters(Object... args) {
- String issueId = (String) args[1];
- TimeEntry timeEntry = (TimeEntry) args[2];
- Date d = timeEntry.getSpentOn();
- if (d == null) {
- d = new Date();
- }
- String date = DATE_FORMAT.format(d);
- return new String[]{
- "issue_id", issueId,
- //"timeEntry[issue_id]", issueId,
- "time_entry[activity_id]", timeEntry.getActivityId() + "",
- "time_entry[spent_on]", date,
- "time_entry[hours]", timeEntry.getHours() + "",
- "time_entry[comments]", timeEntry.getComments() == null ? "" : timeEntry.getComments()
- };
- }
- });
- }
-
- protected static String getVersionStatus(Version version) {
- String status = version.getStatus();
- if (Strings.isNullOrEmpty(status)) {
-
- // use default open status
- status = VersionStatusEnum.open.name();
- }
- return status;
- }
-
- protected static String getVersionEffectiveDate(Version version) {
- return version.getEffectiveDate() == null ? "" :
- DATE_FORMAT.format(version.getEffectiveDate());
- }
-
-
-}
Copied: trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRequestFactoryImpl.java (from rev 288, trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRequestFactoryImpl.java)
===================================================================
--- trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRequestFactoryImpl.java (rev 0)
+++ trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRequestFactoryImpl.java 2012-07-13 16:49:39 UTC (rev 289)
@@ -0,0 +1,212 @@
+package org.nuiton.jredmine.v1_3_x;
+
+import com.google.common.base.Strings;
+import org.nuiton.io.rest.AbstractRequestFactory;
+import org.nuiton.io.rest.RestMethod;
+import org.nuiton.io.rest.RestRequest;
+import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.ModelHelper;
+import org.nuiton.jredmine.model.News;
+import org.nuiton.jredmine.model.TimeEntry;
+import org.nuiton.jredmine.model.Version;
+import org.nuiton.jredmine.model.VersionStatusEnum;
+import org.nuiton.jredmine.request.DefaultRedmineRequestBuilder;
+import org.nuiton.jredmine.request.IssueScopeRedmineRequestBuilder;
+import org.nuiton.jredmine.request.ProjectScopeRedmineRequestBuilder;
+import org.nuiton.jredmine.request.VersionScopeRedmineRequestBuilder;
+
+import java.io.File;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Factory of {@link RestRequest}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public class RedmineRequestFactoryImpl extends AbstractRequestFactory {
+
+ @Override
+ public void addDefaultRequests() {
+
+ // misc requests
+
+ addRequestBuilder(new DefaultRedmineRequestBuilder(ModelHelper.PING_REQUEST_NAME, RestMethod.GET, "jredmine", "ping"));
+// addRequestBuilder(new DefaultRedmineRequestBuilder(PING_REQUEST_NAME, RestMethod.GET, "projects"));
+ addRequestBuilder(new DefaultRedmineRequestBuilder(ModelHelper.LOGOUT_REQUEST_NAME, RestMethod.GET, "jredmine", "logout"));
+// addRequestBuilder(new DefaultRedmineRequestBuilder(LOGIN_REQUEST_NAME, RestMethod.POST, "login") {
+ addRequestBuilder(new DefaultRedmineRequestBuilder(ModelHelper.LOGIN_REQUEST_NAME, RestMethod.POST, "jredmine", "login") {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+ String login = (String) args[0];
+ String password = (String) args[1];
+ return new String[]{"username", login, "password", password};
+ }
+ });
+
+ // data with no scope requests
+
+ addRequestBuilder(new DefaultRedmineRequestBuilder(ModelHelper.GET_ALL_PROJECT_REQUEST_NAME, RestMethod.GET, "jredmine", "get_projects.xml"));
+// addRequestBuilder(new DefaultRedmineRequestBuilder(GET_ALL_PROJECT_REQUEST_NAME, RestMethod.GET, "projects.xml"));
+ addRequestBuilder(new DefaultRedmineRequestBuilder(ModelHelper.GET_USER_PROJECTS_REQUEST_NAME, RestMethod.GET, "jredmine", "get_user_projects.xml"));
+ addRequestBuilder(new DefaultRedmineRequestBuilder(ModelHelper.GET_ALL_ISSUE_STATUS_REQUEST_NAME, RestMethod.GET, "jredmine", "get_issue_statuses.xml"));
+ addRequestBuilder(new DefaultRedmineRequestBuilder(ModelHelper.GET_ALL_ISSUE_PRIORITY_REQUEST_NAME, RestMethod.GET, "jredmine", "get_issue_priorities.xml"));
+
+ // data with project scope requests
+
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_PROJECT_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_PROJECT_ISSUES_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_issues.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_PROJECT_OPENED_ISSUES_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_opened_issues.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_PROJECT_CLOSED_ISSUES_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_closed_issues.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_VERSION_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_versions.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_ISSUE_CATEGORY_REQUEST_NAME, RestMethod.GET, "jredmine", "get_issue_categories.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_TRACKER_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_trackers.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_USER_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_users.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_NEWS_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_news.xml"));
+
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.ADD_VERSION_REQUEST_NAME, RestMethod.POST, "jredmine", "add_version.xml") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+ Version version = (Version) args[1];
+ String date = getVersionEffectiveDate(version);
+ String status = getVersionStatus(version);
+ return new String[]{
+ "version[name]", version.getName(),
+ "version[description]", version.getDescription(),
+ "version[effective_date]", date,
+ "version[status]", status
+ };
+ }
+ });
+
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.UPDATE_VERSION_REQUEST_NAME, RestMethod.POST, "jredmine", "update_version.xml") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+ Version version = (Version) args[1];
+ String date = getVersionEffectiveDate(version);
+ String status = getVersionStatus(version);
+ return new String[]{
+ "version[name]", version.getName(),
+ "version[description]", version.getDescription(),
+ "version[effective_date]", date,
+ "version[status]", status
+ };
+ }
+ });
+
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.NEXT_VERSION_REQUEST_NAME, RestMethod.POST, "jredmine", "next_version.xml") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+
+
+ Version version = (Version) args[1];
+ String date = getVersionEffectiveDate(version);
+ String status = getVersionStatus(version);
+ String oldVersionName = (String) args[2];
+ return new String[]{
+ "oldVersionName", oldVersionName,
+ "version[name]", version.getName(),
+ "version[description]", version.getDescription(),
+ "version[effective_date]", date,
+ "version[status]", status
+ };
+ }
+ });
+
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.ADD_NEWS_REQUEST_NAME, RestMethod.POST, "jredmine", "add_news.xml") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+ News news = (News) args[1];
+ return new String[]{
+ "news[title]", news.getTitle(),
+ "news[summary]", news.getSummary(),
+ "news[description]", news.getDescription()
+ };
+ }
+ });
+
+ // version scope requests
+
+ addRequestBuilder(new VersionScopeRedmineRequestBuilder(ModelHelper.GET_VERSION_REQUEST_NAME, RestMethod.GET, "jredmine", "get_version.xml"));
+ addRequestBuilder(new VersionScopeRedmineRequestBuilder(ModelHelper.GET_ALL_ISSUES_REQUEST_NAME, RestMethod.GET, "jredmine", "get_version_issues.xml"));
+ addRequestBuilder(new VersionScopeRedmineRequestBuilder(ModelHelper.GET_ALL_ATTACHMENTS_REQUEST_NAME, RestMethod.GET, "jredmine", "get_version_attachments.xml"));
+ addRequestBuilder(new VersionScopeRedmineRequestBuilder(ModelHelper.ADD_ATTACHMENT_REQUEST_NAME, RestMethod.POST, "jredmine", "add_version_attachment.xml") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+ String versionId = (String) args[1];
+ Attachment attachment = (Attachment) args[2];
+ return new String[]{
+ "version_name", versionId,
+ "attachment[description]", attachment.getDescription()
+ };
+ }
+
+ @Override
+ public Map<String, File> getAttachments(Object... args) {
+ Map<String, File> upload = new HashMap<String, File>();
+ Attachment attachment = (Attachment) args[2];
+ upload.put("attachment[file]", attachment.getToUpload());
+ return upload;
+ }
+ });
+
+ // issue scope requests
+
+ addRequestBuilder(new IssueScopeRedmineRequestBuilder(ModelHelper.GET_ALL_ISSUE_TIME_ENTRY_REQUEST_NAME, RestMethod.GET, "jredmine", "get_issue_times.xml"));
+
+ addRequestBuilder(new IssueScopeRedmineRequestBuilder(ModelHelper.ADD_ISSUE_TIME_ENTRY_REQUEST_NAME, RestMethod.POST, "jredmine", "add_issue_time.xml") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+ String issueId = (String) args[1];
+ TimeEntry timeEntry = (TimeEntry) args[2];
+ Date d = timeEntry.getSpentOn();
+ if (d == null) {
+ d = new Date();
+ }
+ String date = DATE_FORMAT.format(d);
+ return new String[]{
+ "issue_id", issueId,
+ //"timeEntry[issue_id]", issueId,
+ "time_entry[activity_id]", timeEntry.getActivityId() + "",
+ "time_entry[spent_on]", date,
+ "time_entry[hours]", timeEntry.getHours() + "",
+ "time_entry[comments]", timeEntry.getComments() == null ? "" : timeEntry.getComments()
+ };
+ }
+ });
+ }
+
+ protected static String getVersionStatus(Version version) {
+ String status = version.getStatus();
+ if (Strings.isNullOrEmpty(status)) {
+
+ // use default open status
+ status = VersionStatusEnum.open.name();
+ }
+ return status;
+ }
+
+ protected static String getVersionEffectiveDate(Version version) {
+ return version.getEffectiveDate() == null ? "" :
+ DATE_FORMAT.format(version.getEffectiveDate());
+ }
+
+
+}
Deleted: trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRestClient.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRestClient.java 2012-07-13 16:27:10 UTC (rev 281)
+++ trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRestClient.java 2012-07-13 16:49:39 UTC (rev 289)
@@ -1,181 +0,0 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id: RedmineRestClient.java 211 2011-06-04 17:01:31Z tchemit $
- * $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/main/java/org/… $
- * %%
- * Copyright (C) 2009 - 2010 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%
- */
-package org.nuiton.jredmine.v1_3_x;
-
-import org.apache.commons.httpclient.HttpMethod;
-import org.apache.commons.httpclient.HttpStatus;
-import org.apache.commons.httpclient.StatusLine;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codehaus.plexus.util.StringUtils;
-import org.nuiton.io.rest.RequestFactory;
-import org.nuiton.io.rest.RestClient;
-import org.nuiton.io.rest.RestClientConfiguration;
-import org.nuiton.io.rest.RestRequest;
-import org.nuiton.io.rest.RestSession;
-import org.nuiton.jredmine.model.Version;
-import org.nuiton.jredmine.model.VersionStatusEnum;
-
-import java.io.IOException;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-
-/**
- * Implementation of a {@link RestClient} to access a Redmine server via the
- * {@code redmine_rest} rails plugin.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @plexus.component role="org.nuiton.io.rest.RestClient" role-hint="1.3.x"
- * @since 1.0.0
- */
-public class RedmineRestClient extends RestClient {
-
- private static final Log log = LogFactory.getLog(RedmineRestClient.class);
-
- /**
- * To obtain redmine requests.
- *
- * @plexus.requirement role="org.nuiton.io.rest.RequestFactory" role-hint="1.3.x"
- * @since 1.4
- */
- protected RequestFactory requestFactory;
-
- public final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd");
-
- public RedmineRestClient() {
- }
-
- public RedmineRestClient(RestClientConfiguration configuration) {
- super(configuration);
- }
-
- @Override
- public RequestFactory getRequestFactory() {
- return requestFactory;
- }
-
- @Override
- protected void open(RestSession session) throws IOException {
-
- ping(session);
-
- if (!configuration.isAnonymous()) {
- login(session);
- }
- }
-
- @Override
- protected void close(RestSession session) throws IOException {
-
- if (session != null) {
-
- try {
- RestRequest request = getRequest(RedmineRequestFactoryImpl.LOGOUT);
- session.setOpen(false);
- session.doRequest(request);
- } finally {
- session.close();
- }
- }
- }
-
- public int ping(RestSession session) throws IOException {
-
- try {
-
- RestRequest request = getRequest(RedmineRequestFactoryImpl.PING);
- HttpMethod gm = session.doRequest(request);
-
- StatusLine sl = gm.getStatusLine();
- int statusCode = sl.getStatusCode();
- if (log.isDebugEnabled()) {
- log.debug("status code " + statusCode + " for " + gm.getPath());
- }
-
- if (statusCode != HttpStatus.SC_OK) {
- gm.releaseConnection();
- throw new IOException(
- "Got error code <" + statusCode + ":" +
- sl.getReasonPhrase() + "> on " + gm.getPath());
- }
-
-// String content = gm.getResponseBodyAsString();
-//
-// boolean ok = "ping".equals(content);
-// if (!ok) {
-// throw new IOException(
-// "can not connect to " + configuration.getRestUrl());
-// }
- return statusCode;
- } catch (IOException ex) {
- throw ex;
- } catch (Exception ex) {
- throw new IOException(
- "could not ping " + configuration.getRestUrl() +
- " for reason " + ex.getMessage(), ex);
- }
- }
-
- public void login(RestSession session) throws IOException {
-
- RestRequest request = getRequest(RedmineRequestFactoryImpl.LOGIN,
- configuration.getRestUsername(),
- configuration.getRestPassword());
-
- HttpMethod gm = session.doRequest(request);
-
- StatusLine sl = gm.getStatusLine();
- int statusCode = sl.getStatusCode();
- if (log.isDebugEnabled()) {
- log.debug("status code " + statusCode + " for " + gm.getPath());
- }
-
- if (statusCode != HttpStatus.SC_OK &&
- statusCode!= HttpStatus.SC_MOVED_TEMPORARILY) {
- gm.releaseConnection();
- throw new IOException(
- "Got error code <" + statusCode + ":" +
- sl.getReasonPhrase() + "> on " + gm.getPath());
- }
-
- // ok session is logged in
-
- }
-
- protected String getVersionStatus(Version version) {
- String status = version.getStatus();
- if (StringUtils.isEmpty(status)) {
-
- // use default open status
- status = VersionStatusEnum.open.name();
- }
- return status;
- }
-
- protected String getVersionEffectiveDate(Version version) {
- return version.getEffectiveDate() == null ? "" :
- DATE_FORMAT.format(version.getEffectiveDate());
- }
-}
Copied: trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRestClient.java (from rev 288, trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRestClient.java)
===================================================================
--- trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRestClient.java (rev 0)
+++ trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRestClient.java 2012-07-13 16:49:39 UTC (rev 289)
@@ -0,0 +1,176 @@
+/*
+ * #%L
+ * JRedmine :: Client
+ *
+ * $Id: RedmineRestClient.java 211 2011-06-04 17:01:31Z tchemit $
+ * $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/main/java/org/… $
+ * %%
+ * Copyright (C) 2009 - 2010 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%
+ */
+package org.nuiton.jredmine.v1_3_x;
+
+import org.apache.commons.httpclient.HttpMethod;
+import org.apache.commons.httpclient.HttpStatus;
+import org.apache.commons.httpclient.StatusLine;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codehaus.plexus.util.StringUtils;
+import org.nuiton.io.rest.RequestFactory;
+import org.nuiton.io.rest.RestClient;
+import org.nuiton.io.rest.RestRequest;
+import org.nuiton.io.rest.RestSession;
+import org.nuiton.jredmine.model.ModelHelper;
+import org.nuiton.jredmine.model.Version;
+import org.nuiton.jredmine.model.VersionStatusEnum;
+
+import java.io.IOException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
+/**
+ * Implementation of a {@link RestClient} to access a Redmine server via the
+ * {@code redmine_rest} rails plugin.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0.0
+ */
+public class RedmineRestClient extends RestClient {
+
+ private static final Log log = LogFactory.getLog(RedmineRestClient.class);
+
+ /**
+ * To obtain redmine requests.
+ *
+ * @since 1.4
+ */
+ protected RequestFactory requestFactory;
+
+ public final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd");
+
+ public RedmineRestClient() {
+ requestFactory = new RedmineRequestFactoryImpl();
+ }
+
+ @Override
+ public RequestFactory getRequestFactory() {
+ return requestFactory;
+ }
+
+ @Override
+ protected void open(RestSession session) throws IOException {
+
+ ping(session);
+
+ if (!configuration.isAnonymous()) {
+ login(session);
+ }
+ }
+
+ @Override
+ protected void close(RestSession session) throws IOException {
+
+ if (session != null) {
+
+ try {
+ RestRequest request = getRequest(ModelHelper.LOGOUT_REQUEST_NAME);
+ session.setOpen(false);
+ session.doRequest(request);
+ } finally {
+ session.close();
+ }
+ }
+ }
+
+ public int ping(RestSession session) throws IOException {
+
+ try {
+
+ RestRequest request = getRequest(ModelHelper.PING_REQUEST_NAME);
+ HttpMethod gm = session.doRequest(request);
+
+ StatusLine sl = gm.getStatusLine();
+ int statusCode = sl.getStatusCode();
+ if (log.isDebugEnabled()) {
+ log.debug("status code " + statusCode + " for " + gm.getPath());
+ }
+
+ if (statusCode != HttpStatus.SC_OK) {
+ gm.releaseConnection();
+ throw new IOException(
+ "Got error code <" + statusCode + ":" +
+ sl.getReasonPhrase() + "> on " + gm.getPath());
+ }
+
+// String content = gm.getResponseBodyAsString();
+//
+// boolean ok = "ping".equals(content);
+// if (!ok) {
+// throw new IOException(
+// "can not connect to " + configuration.getRestUrl());
+// }
+ return statusCode;
+ } catch (IOException ex) {
+ throw ex;
+ } catch (Exception ex) {
+ throw new IOException(
+ "could not ping " + configuration.getRestUrl() +
+ " for reason " + ex.getMessage(), ex);
+ }
+ }
+
+ public void login(RestSession session) throws IOException {
+
+ RestRequest request = getRequest(ModelHelper.LOGIN_REQUEST_NAME,
+ configuration.getRestUsername(),
+ configuration.getRestPassword());
+
+ HttpMethod gm = session.doRequest(request);
+
+ StatusLine sl = gm.getStatusLine();
+ int statusCode = sl.getStatusCode();
+ if (log.isDebugEnabled()) {
+ log.debug("status code " + statusCode + " for " + gm.getPath());
+ }
+
+ if (statusCode != HttpStatus.SC_OK &&
+ statusCode != HttpStatus.SC_MOVED_TEMPORARILY) {
+ gm.releaseConnection();
+ throw new IOException(
+ "Got error code <" + statusCode + ":" +
+ sl.getReasonPhrase() + "> on " + gm.getPath());
+ }
+
+ // ok session is logged in
+
+ }
+
+ protected String getVersionStatus(Version version) {
+ String status = version.getStatus();
+ if (StringUtils.isEmpty(status)) {
+
+ // use default open status
+ status = VersionStatusEnum.open.name();
+ }
+ return status;
+ }
+
+ protected String getVersionEffectiveDate(Version version) {
+ return version.getEffectiveDate() == null ? "" :
+ DATE_FORMAT.format(version.getEffectiveDate());
+ }
+}
Deleted: trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImpl.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImpl.java 2012-07-13 16:27:10 UTC (rev 281)
+++ trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImpl.java 2012-07-13 16:49:39 UTC (rev 289)
@@ -1,152 +0,0 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id: DefaultRedmineService.java 257 2012-03-25 15:48:53Z tchemit $
- * $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/main/java/org/… $
- * %%
- * Copyright (C) 2009 - 2010 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%
- */
-package org.nuiton.jredmine.v1_3_x;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.nuiton.io.rest.RestClient;
-import org.nuiton.jredmine.RedmineService;
-import org.nuiton.jredmine.RedmineServiceConfiguration;
-import org.nuiton.jredmine.RedmineServiceException;
-import org.nuiton.jredmine.RedmineServiceImplementor;
-import org.nuiton.jredmine.model.Attachment;
-import org.nuiton.jredmine.model.News;
-import org.nuiton.jredmine.model.Project;
-import org.nuiton.jredmine.model.TimeEntry;
-import org.nuiton.jredmine.model.Version;
-
-/**
- * Default {@link RedmineService} implementation based on a {@link RestClient}
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @plexus.component role="org.nuiton.jredmine.RedmineService" role-hint="1.3.x"
- * @since 1.0.0
- */
-public class RedmineServiceImpl extends RedmineAnonymousServiceImpl implements RedmineService {
-
- protected static final Log log = LogFactory.getLog(RedmineServiceImpl.class);
-
- ///////////////////////////////////////////////////////////////////////////
- /// RedmineServiceImplementor implementation
- ///////////////////////////////////////////////////////////////////////////
-
- @Override
- public RedmineServiceImplementor init(RedmineServiceConfiguration configuration) throws RedmineServiceException {
- return delegateImplementor.init(configuration);
- }
-
- ///////////////////////////////////////////////////////////////////////////
- /// RedmineLogguedService implementation
- ///////////////////////////////////////////////////////////////////////////
-
- @Override
- public Project[] getUserProjects() throws RedmineServiceException {
- checkLoggued();
- Project[] result = getDatas(RedmineRequestFactoryImpl.GET_USER_PROJECTS, Project.class);
- return result;
- }
-
- @Override
- public Version addVersion(String projectName,
- Version version) throws RedmineServiceException {
-
- // send data and obtain created version
- Version result = sendData(RedmineRequestFactoryImpl.ADD_VERSION,
- Version.class,
- projectName,
- version
- );
- return result;
- }
-
- @Override
- public Version updateVersion(String projectName,
- Version version) throws RedmineServiceException {
-
- // send data and obtain updated version
- Version result = sendData(RedmineRequestFactoryImpl.UPDATE_VERSION,
- Version.class,
- projectName,
- version
- );
- return result;
- }
-
- @Override
- public Version nextVersion(String projectName,
- String oldVersionName,
- Version newVersion) throws RedmineServiceException {
-
- // send data and obtain updated or created new version
- Version result = sendData(RedmineRequestFactoryImpl.NEXT_VERSION,
- Version.class,
- projectName,
- newVersion,
- oldVersionName
- );
- return result;
- }
-
- @Override
- public Attachment addAttachment(String projectName,
- String versionName,
- Attachment attachement) throws RedmineServiceException {
-
- // send data and obtain created attachment
- Attachment result = sendData(RedmineRequestFactoryImpl.ADD_ATTACHMENT,
- Attachment.class,
- projectName,
- versionName,
- attachement
- );
- return result;
- }
-
- @Override
- public News addNews(String projectName,
- News news) throws RedmineServiceException {
- // send data and obtain created news
- News result = sendData(RedmineRequestFactoryImpl.ADD_NEWS,
- News.class,
- projectName,
- news
- );
- return result;
- }
-
- @Override
- public TimeEntry addIssueTimeEntry(String projectName,
- String issueId,
- TimeEntry entry) throws RedmineServiceException {
- // send data and obtain updated version
- TimeEntry result = sendData(RedmineRequestFactoryImpl.ADD_ISSUE_TIME_ENTRY,
- TimeEntry.class,
- projectName,
- issueId,
- entry
- );
- return result;
- }
-}
Copied: trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImpl.java (from rev 288, trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImpl.java)
===================================================================
--- trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImpl.java (rev 0)
+++ trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImpl.java 2012-07-13 16:49:39 UTC (rev 289)
@@ -0,0 +1,152 @@
+/*
+ * #%L
+ * JRedmine :: Client
+ *
+ * $Id: DefaultRedmineService.java 257 2012-03-25 15:48:53Z tchemit $
+ * $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/main/java/org/… $
+ * %%
+ * Copyright (C) 2009 - 2010 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%
+ */
+package org.nuiton.jredmine.v1_3_x;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.io.rest.RestClient;
+import org.nuiton.jredmine.RedmineService;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+import org.nuiton.jredmine.RedmineServiceImplementor;
+import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.ModelHelper;
+import org.nuiton.jredmine.model.News;
+import org.nuiton.jredmine.model.Project;
+import org.nuiton.jredmine.model.TimeEntry;
+import org.nuiton.jredmine.model.Version;
+
+/**
+ * Default {@link RedmineService} implementation based on a {@link RestClient}
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0.0
+ */
+public class RedmineServiceImpl extends RedmineAnonymousServiceImpl implements RedmineService {
+
+ protected static final Log log = LogFactory.getLog(RedmineServiceImpl.class);
+
+ ///////////////////////////////////////////////////////////////////////////
+ /// RedmineServiceImplementor implementation
+ ///////////////////////////////////////////////////////////////////////////
+
+ @Override
+ public RedmineServiceImplementor init(RedmineServiceConfiguration configuration) throws RedmineServiceException {
+ return delegateImplementor.init(configuration);
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ /// RedmineLogguedService implementation
+ ///////////////////////////////////////////////////////////////////////////
+
+ @Override
+ public Project[] getUserProjects() throws RedmineServiceException {
+ checkLoggued();
+ Project[] result = getDatas(ModelHelper.GET_USER_PROJECTS_REQUEST_NAME, Project.class);
+ return result;
+ }
+
+ @Override
+ public Version addVersion(String projectName,
+ Version version) throws RedmineServiceException {
+
+ // send data and obtain created version
+ Version result = sendData(ModelHelper.ADD_VERSION_REQUEST_NAME,
+ Version.class,
+ projectName,
+ version
+ );
+ return result;
+ }
+
+ @Override
+ public Version updateVersion(String projectName,
+ Version version) throws RedmineServiceException {
+
+ // send data and obtain updated version
+ Version result = sendData(ModelHelper.UPDATE_VERSION_REQUEST_NAME,
+ Version.class,
+ projectName,
+ version
+ );
+ return result;
+ }
+
+ @Override
+ public Version nextVersion(String projectName,
+ String oldVersionName,
+ Version newVersion) throws RedmineServiceException {
+
+ // send data and obtain updated or created new version
+ Version result = sendData(ModelHelper.NEXT_VERSION_REQUEST_NAME,
+ Version.class,
+ projectName,
+ newVersion,
+ oldVersionName
+ );
+ return result;
+ }
+
+ @Override
+ public Attachment addAttachment(String projectName,
+ String versionName,
+ Attachment attachement) throws RedmineServiceException {
+
+ // send data and obtain created attachment
+ Attachment result = sendData(ModelHelper.ADD_ATTACHMENT_REQUEST_NAME,
+ Attachment.class,
+ projectName,
+ versionName,
+ attachement
+ );
+ return result;
+ }
+
+ @Override
+ public News addNews(String projectName,
+ News news) throws RedmineServiceException {
+ // send data and obtain created news
+ News result = sendData(ModelHelper.ADD_NEWS_REQUEST_NAME,
+ News.class,
+ projectName,
+ news
+ );
+ return result;
+ }
+
+ @Override
+ public TimeEntry addIssueTimeEntry(String projectName,
+ String issueId,
+ TimeEntry entry) throws RedmineServiceException {
+ // send data and obtain updated version
+ TimeEntry result = sendData(ModelHelper.ADD_ISSUE_TIME_ENTRY_REQUEST_NAME,
+ TimeEntry.class,
+ projectName,
+ issueId,
+ entry
+ );
+ return result;
+ }
+}
Deleted: trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImplementorImpl.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImplementorImpl.java 2012-07-13 16:27:10 UTC (rev 281)
+++ trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImplementorImpl.java 2012-07-13 16:49:39 UTC (rev 289)
@@ -1,321 +0,0 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id: DefaultRedmineServiceImplementor.java 257 2012-03-25 15:48:53Z tchemit $
- * $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/main/java/org/… $
- * %%
- * Copyright (C) 2009 - 2010 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%
- */
-package org.nuiton.jredmine.v1_3_x;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.nuiton.io.rest.RestClient;
-import org.nuiton.io.rest.RestException;
-import org.nuiton.io.rest.RestRequest;
-import org.nuiton.jredmine.RedmineServiceConfiguration;
-import org.nuiton.jredmine.RedmineServiceException;
-import org.nuiton.jredmine.RedmineServiceImplementor;
-import org.nuiton.jredmine.RedmineServiceLoginException;
-import org.nuiton.jredmine.model.io.xpp3.RedmineXpp3Helper;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * Default Redmine technical service implementation.
- * <p/>
- * Created: 2 janv. 2010
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @plexus.component role="org.nuiton.jredmine.RedmineServiceImplementor" role-hint="1.3.x"
- * @see RedmineServiceImplementor
- * @since 1.0.3
- */
-public class RedmineServiceImplementorImpl implements RedmineServiceImplementor {
-
- /** Logger */
- private static final Log log =
- LogFactory.getLog(RedmineServiceImplementorImpl.class);
-
- /**
- * Client Rest.
- *
- * @plexus.requirement role="org.nuiton.io.rest.RestClient" role-hint="1.3.x"
- */
- protected RedmineRestClient session;
-
- /**
- * xpp3 xpp3Helper to transform xml stream to pojo.
- *
- * @plexus.requirement role="org.nuiton.jredmine.model.io.xpp3.RedmineXpp3Helper" role-hint="default"
- */
- protected RedmineXpp3Helper xpp3Helper;
-
- /** internal state to known if service was init */
- protected boolean init;
-
- /** internal state to known if service was opened */
- protected boolean open;
-
- public RedmineServiceImplementorImpl() {
- if (log.isDebugEnabled()) {
- log.debug("new " + this);
- }
- session = new RedmineRestClient();
- }
-
- ///////////////////////////////////////////////////////////////////////////
- /// RedmineServiceImplementor implementation
- ///////////////////////////////////////////////////////////////////////////
-
- @Override
- public boolean isInit() {
- return init;
- }
-
- @Override
- public boolean isLoggued() {
- return session.isOpen();
- }
-
- @Override
- public RedmineServiceImplementor init(RedmineServiceConfiguration configuration) throws RedmineServiceException {
- session.setConfiguration(configuration);
- session.requestFactory.addDefaultRequests();
- RedmineServiceImplementor result = init(session);
- return result;
- }
-
- public RedmineServiceImplementor init(RedmineRestClient session) throws RedmineServiceException {
- if (open) {
- throw new IllegalStateException(
- "the client " + this + " was already opened!");
- }
- try {
- this.session = session;
-
- if (!session.isOpen()) {
- session.open();
- }
-
- init = true;
- } catch (Exception e) {
- throw new RedmineServiceException(
- "could not init service for reason " + e.getMessage(), e);
- }
- return this;
- }
-
- @Override
- public int ping() {
-
- try {
- return session.ping(session.getSession());
- } catch (IOException e) {
- if (log.isErrorEnabled()) {
- log.error("Could not ping ", e);
- }
- return -1;
- }
- }
-
- @Override
- public void login() {
- }
-
- @Override
- public void logout() {
- }
-
- @Override
- public void destroy() throws RedmineServiceException {
- checkInit();
- try {
- if (session.isOpen()) {
- try {
- session.close();
- } catch (RestException ex) {
- throw new RedmineServiceException(
- "has problem while closing Rest client " +
- ex.getMessage(), ex);
- }
- }
- } finally {
- // can't remove the reference since plexus injects it
-// if (session != null) {
-// session = null;
-// }
- init = false;
- }
- }
-
- @Override
- public <T> T getData(String requestName,
- Class<T> type,
- Object... args) throws RedmineServiceException {
- checkInit();
- InputStream stream = askDataStream(requestName, args);
- T result = getDataFromStream(type, stream);
- return result;
- }
-
- @Override
- public <T> T[] getDatas(String requestName,
- Class<T> type,
- Object... args) throws RedmineServiceException {
- checkInit();
- InputStream stream = askDataStream(requestName, args);
- T[] result = getDatasFromStream(type, stream);
- return result;
- }
-
- @Override
- public <T> T sendData(String requestName,
- Class<T> type,
- Object... args) throws RedmineServiceException {
- checkLoggued();
- InputStream stream = sendDataStream(requestName, args);
- T result = getDataFromStream(type, stream);
- return result;
- }
-
- @Override
- public <T> T[] sendDatas(String requestName,
- Class<T> type,
- Object... args) throws RedmineServiceException {
- checkLoggued();
- InputStream stream = sendDataStream(requestName, args);
- T[] result = getDatasFromStream(type, stream);
- return result;
- }
-
- @Override
- public void checkLoggued() throws IllegalStateException, RedmineServiceLoginException, NullPointerException {
- checkInit();
- checkSessionNotNull(session);
- checkSessionConfigurationNotNull(session);
- if (session.getConfiguration().isAnonymous()) {
- throw new RedmineServiceLoginException(
- "can not access this service in anonymous mode");
- }
- }
-
- protected InputStream askDataStream(String requestName,
- Object... args) throws RedmineServiceException {
-
- RestRequest r = getRequest(requestName, args);
-
- // obtain data from rest client
- try {
-
- InputStream stream = session.askData(r);
- return stream;
- } catch (Exception e) {
- throw new RedmineServiceException(
- "could not obtain data stream for request " + requestName +
- " for reason " + e.getMessage(), e);
- }
- }
-
- protected InputStream sendDataStream(String requestName,
- Object... args) throws RedmineServiceException {
-
- RestRequest r = getRequest(requestName, args);
-
- // obtain data from rest client
- try {
-
- InputStream stream = session.sendData(r);
- return stream;
- } catch (Exception e) {
- throw new RedmineServiceException(
- "could not send data stream for request " + requestName +
- " for reason " + e.getMessage(), e);
- }
- }
-
- protected RestRequest getRequest(String requestName,
- Object... args) throws RedmineServiceException {
- RestRequest r;
- try {
- r = session.getRequest(requestName, args);
- } catch (Exception e) {
- throw new RedmineServiceException(
- "could not find the request named " + requestName +
- " for reason " + e.getMessage(), e);
- }
- if (r == null) {
- throw new RedmineServiceException(
- "could not find the request named " + requestName);
- }
- return r;
- }
-
- protected <T> T getDataFromStream(Class<T> type,
- InputStream stream) throws RedmineServiceException {
- if (stream == null) {
- return null;
- }
-
- try {
- T result = xpp3Helper.readObject(type, stream, true);
- return result;
- } catch (Exception ex) {
- throw new RedmineServiceException(
- "could not obtain datas of type " + type + " for reason " +
- ex.getMessage(), ex);
- }
- }
-
- protected <T> T[] getDatasFromStream(Class<T> type,
- InputStream stream) throws RedmineServiceException {
- if (stream == null) {
- return null;
- }
- try {
- T[] result = xpp3Helper.readObjects(type, stream, true);
- return result;
- } catch (Exception ex) {
- throw new RedmineServiceException(
- "could not obtain datas of type " + type + " for reason " +
- ex.getMessage(), ex);
- }
- }
-
- protected void checkInit() throws IllegalStateException {
- if (!init) {
- throw new IllegalStateException(
- "the client " + this + " is not init!");
- }
- }
-
- protected void checkSessionNotNull(RestClient session) {
- if (session == null) {
- throw new NullPointerException("session can not be null");
- }
- }
-
- protected void checkSessionConfigurationNotNull(RestClient session) {
- if (session.getConfiguration() == null) {
- throw new NullPointerException(
- "session configuration can not be null");
- }
- }
-}
Copied: trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImplementorImpl.java (from rev 282, trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImplementorImpl.java)
===================================================================
--- trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImplementorImpl.java (rev 0)
+++ trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImplementorImpl.java 2012-07-13 16:49:39 UTC (rev 289)
@@ -0,0 +1,318 @@
+/*
+ * #%L
+ * JRedmine :: Client
+ *
+ * $Id: DefaultRedmineServiceImplementor.java 257 2012-03-25 15:48:53Z tchemit $
+ * $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/main/java/org/… $
+ * %%
+ * Copyright (C) 2009 - 2010 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%
+ */
+package org.nuiton.jredmine.v1_3_x;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.io.rest.RestClient;
+import org.nuiton.io.rest.RestException;
+import org.nuiton.io.rest.RestRequest;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+import org.nuiton.jredmine.RedmineServiceImplementor;
+import org.nuiton.jredmine.RedmineServiceLoginException;
+import org.nuiton.jredmine.model.io.xpp3.DefaultRedmineXpp3Helper;
+import org.nuiton.jredmine.model.io.xpp3.RedmineXpp3Helper;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * Default Redmine technical service implementation.
+ * <p/>
+ * Created: 2 janv. 2010
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @see RedmineServiceImplementor
+ * @since 1.0.3
+ */
+public class RedmineServiceImplementorImpl implements RedmineServiceImplementor {
+
+ /** Logger */
+ private static final Log log =
+ LogFactory.getLog(RedmineServiceImplementorImpl.class);
+
+ /** Client Rest. */
+ protected final RedmineRestClient session;
+
+ /** xpp3 xpp3Helper to transform xml stream to pojo. */
+ protected final RedmineXpp3Helper xpp3Helper;
+
+ /** internal state to known if service was init */
+ protected boolean init;
+
+ /** internal state to known if service was opened */
+ protected boolean open;
+
+ public RedmineServiceImplementorImpl() {
+ if (log.isDebugEnabled()) {
+ log.debug("new " + this);
+ }
+ session = new RedmineRestClient();
+ xpp3Helper = new DefaultRedmineXpp3Helper();
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ /// RedmineServiceImplementor implementation
+ ///////////////////////////////////////////////////////////////////////////
+
+
+ public RedmineRestClient getSession() {
+ return session;
+ }
+
+ @Override
+ public boolean isInit() {
+ return init;
+ }
+
+ @Override
+ public boolean isLoggued() {
+ return session.isOpen();
+ }
+
+ @Override
+ public RedmineServiceImplementor init(RedmineServiceConfiguration configuration) throws RedmineServiceException {
+ session.setConfiguration(configuration);
+ session.requestFactory.addDefaultRequests();
+ RedmineServiceImplementor result = init(session);
+ return result;
+ }
+
+ public RedmineServiceImplementor init(RedmineRestClient session) throws RedmineServiceException {
+ if (open) {
+ throw new IllegalStateException(
+ "the client " + this + " was already opened!");
+ }
+ try {
+
+ if (!session.isOpen()) {
+ session.open();
+ }
+
+ init = true;
+ } catch (Exception e) {
+ throw new RedmineServiceException(
+ "could not init service for reason " + e.getMessage(), e);
+ }
+ return this;
+ }
+
+ @Override
+ public int ping() {
+
+ try {
+ return session.ping(session.getSession());
+ } catch (IOException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Could not ping ", e);
+ }
+ return -1;
+ }
+ }
+
+ @Override
+ public void login() {
+ }
+
+ @Override
+ public void logout() {
+ }
+
+ @Override
+ public void destroy() throws RedmineServiceException {
+ checkInit();
+ try {
+ if (session.isOpen()) {
+ try {
+ session.close();
+ } catch (RestException ex) {
+ throw new RedmineServiceException(
+ "has problem while closing Rest client " +
+ ex.getMessage(), ex);
+ }
+ }
+ } finally {
+ // can't remove the reference since plexus injects it
+// if (session != null) {
+// session = null;
+// }
+ init = false;
+ }
+ }
+
+ @Override
+ public <T> T getData(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ checkInit();
+ InputStream stream = askDataStream(requestName, args);
+ T result = getDataFromStream(type, stream);
+ return result;
+ }
+
+ @Override
+ public <T> T[] getDatas(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ checkInit();
+ InputStream stream = askDataStream(requestName, args);
+ T[] result = getDatasFromStream(type, stream);
+ return result;
+ }
+
+ @Override
+ public <T> T sendData(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ checkLoggued();
+ InputStream stream = sendDataStream(requestName, args);
+ T result = getDataFromStream(type, stream);
+ return result;
+ }
+
+ @Override
+ public <T> T[] sendDatas(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ checkLoggued();
+ InputStream stream = sendDataStream(requestName, args);
+ T[] result = getDatasFromStream(type, stream);
+ return result;
+ }
+
+ @Override
+ public void checkLoggued() throws IllegalStateException, RedmineServiceLoginException, NullPointerException {
+ checkInit();
+ checkSessionNotNull(session);
+ checkSessionConfigurationNotNull(session);
+ if (session.getConfiguration().isAnonymous()) {
+ throw new RedmineServiceLoginException(
+ "can not access this service in anonymous mode");
+ }
+ }
+
+ protected InputStream askDataStream(String requestName,
+ Object... args) throws RedmineServiceException {
+
+ RestRequest r = getRequest(requestName, args);
+
+ // obtain data from rest client
+ try {
+
+ InputStream stream = session.askData(r);
+ return stream;
+ } catch (Exception e) {
+ throw new RedmineServiceException(
+ "could not obtain data stream for request " + requestName +
+ " for reason " + e.getMessage(), e);
+ }
+ }
+
+ protected InputStream sendDataStream(String requestName,
+ Object... args) throws RedmineServiceException {
+
+ RestRequest r = getRequest(requestName, args);
+
+ // obtain data from rest client
+ try {
+
+ InputStream stream = session.sendData(r);
+ return stream;
+ } catch (Exception e) {
+ throw new RedmineServiceException(
+ "could not send data stream for request " + requestName +
+ " for reason " + e.getMessage(), e);
+ }
+ }
+
+ protected RestRequest getRequest(String requestName,
+ Object... args) throws RedmineServiceException {
+ RestRequest r;
+ try {
+ r = session.getRequest(requestName, args);
+ } catch (Exception e) {
+ throw new RedmineServiceException(
+ "could not find the request named " + requestName +
+ " for reason " + e.getMessage(), e);
+ }
+ if (r == null) {
+ throw new RedmineServiceException(
+ "could not find the request named " + requestName);
+ }
+ return r;
+ }
+
+ protected <T> T getDataFromStream(Class<T> type,
+ InputStream stream) throws RedmineServiceException {
+ if (stream == null) {
+ return null;
+ }
+
+ try {
+ T result = xpp3Helper.readObject(type, stream, true);
+ return result;
+ } catch (Exception ex) {
+ throw new RedmineServiceException(
+ "could not obtain datas of type " + type + " for reason " +
+ ex.getMessage(), ex);
+ }
+ }
+
+ protected <T> T[] getDatasFromStream(Class<T> type,
+ InputStream stream) throws RedmineServiceException {
+ if (stream == null) {
+ return null;
+ }
+ try {
+ T[] result = xpp3Helper.readObjects(type, stream, true);
+ return result;
+ } catch (Exception ex) {
+ throw new RedmineServiceException(
+ "could not obtain datas of type " + type + " for reason " +
+ ex.getMessage(), ex);
+ }
+ }
+
+ protected void checkInit() throws IllegalStateException {
+ if (!init) {
+ throw new IllegalStateException(
+ "the client " + this + " is not init!");
+ }
+ }
+
+ protected void checkSessionNotNull(RestClient session) {
+ if (session == null) {
+ throw new NullPointerException("session can not be null");
+ }
+ }
+
+ protected void checkSessionConfigurationNotNull(RestClient session) {
+ if (session.getConfiguration() == null) {
+ throw new NullPointerException(
+ "session configuration can not be null");
+ }
+ }
+}
Copied: trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceProviderImpl.java (from rev 288, trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceProviderImpl.java)
===================================================================
--- trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceProviderImpl.java (rev 0)
+++ trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceProviderImpl.java 2012-07-13 16:49:39 UTC (rev 289)
@@ -0,0 +1,36 @@
+package org.nuiton.jredmine.v1_3_x;
+
+import org.nuiton.jredmine.RedmineAnonymousService;
+import org.nuiton.jredmine.RedmineService;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceProvider;
+
+/**
+ * Implmentation of {@link RedmineServiceProvider} for this module.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @plexus.component role="org.nuiton.jredmine.RedmineServiceProvider" role-hint="1.3.x"
+ * @since 1.4
+ */
+public class RedmineServiceProviderImpl implements RedmineServiceProvider {
+
+ @Override
+ public String getRedmineVersion() {
+ return "1.3.x";
+ }
+
+ @Override
+ public boolean isRequireJRedminePlugin() {
+ return true;
+ }
+
+ @Override
+ public RedmineService newRedmineService(RedmineServiceConfiguration configuration) {
+ return new RedmineServiceImpl();
+ }
+
+ @Override
+ public RedmineAnonymousService newRedmineAnonymousService(RedmineServiceConfiguration configuration) {
+ return new RedmineAnonymousServiceImpl();
+ }
+}
Deleted: trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineFixtures.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineFixtures.java 2012-07-13 16:27:10 UTC (rev 281)
+++ trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineFixtures.java 2012-07-13 16:49:39 UTC (rev 289)
@@ -1,811 +0,0 @@
-package org.nuiton.jredmine.v1_3_x;
-
-import com.google.common.base.Charsets;
-import com.google.common.collect.ArrayListMultimap;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.nuiton.jredmine.RedmineAnonymousService;
-import org.nuiton.jredmine.RedmineService;
-import org.nuiton.jredmine.RedmineServiceConfiguration;
-import org.nuiton.jredmine.RedmineServiceException;
-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.DefaultRedmineXpp3Helper;
-import org.nuiton.jredmine.model.io.xpp3.RedmineDataConverter;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Date;
-import java.util.List;
-import java.util.Properties;
-
-/**
- * fixtures of redmine model.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.4
- */
-public class RedmineFixtures {
-
- /** Logger. */
- private static final Log log = LogFactory.getLog(RedmineFixtures.class);
-
- public static final String FILE_TO_UPLOAD_CONTENT = "Fichier à uploader";
-
- public static final String PROJECT_NAME = "jredmine";
-
- public static final String VERSION_NAME = "1.3";
-
- public static final String ISSUE_ID = "2030";
-
- private Project JRedmineProject;
-
- private ArrayListMultimap<Class<?>, Object> model;
-
- private RedmineServiceConfiguration anonymousConfiguration;
-
- private RedmineServiceConfiguration logguedConfiguration;
-
- public String projectName() {
- return PROJECT_NAME;
- }
-
- public String versionName() {
- return VERSION_NAME;
- }
-
- public String issueId() {
- return ISSUE_ID;
- }
-
- public RedmineServiceConfiguration newAnonymousConfiguration()
- throws IOException {
- RedmineServiceConfiguration conf = new FakeRedmineServiceConfiguration();
- copyConfiguration(getAnonymousConfiguration(), conf);
- return conf;
- }
-
- public RedmineServiceConfiguration newLogguedConfiguration()
- throws IOException {
- RedmineServiceConfiguration conf = new FakeRedmineServiceConfiguration();
- copyConfiguration(getLogguedConfiguration(), conf);
- return conf;
- }
-
- public RedmineAnonymousService newRedmineAnonymousService(RedmineServiceConfiguration configuration)
- throws IOException, RedmineServiceException {
- RedmineAnonymousServiceImpl service = new RedmineAnonymousServiceImpl();
- RedmineServiceImplementorImpl implementor = new RedmineServiceImplementorImpl();
- RedmineRestClient restClient = new RedmineRestClient();
- restClient.requestFactory = new RedmineRequestFactoryImpl();
- implementor.xpp3Helper = new DefaultRedmineXpp3Helper();
- implementor.session = restClient;
- service.delegateImplementor = implementor;
- service.init(configuration);
- return service;
- }
-
- public RedmineService newRedmineService(RedmineServiceConfiguration configuration)
- throws IOException, RedmineServiceException {
- RedmineServiceImpl service = new RedmineServiceImpl();
- RedmineServiceImplementorImpl implementor = new RedmineServiceImplementorImpl();
- RedmineRestClient restClient = new RedmineRestClient();
- restClient.requestFactory = new RedmineRequestFactoryImpl();
- implementor.session = restClient;
- implementor.xpp3Helper = new DefaultRedmineXpp3Helper();
- service.delegateImplementor = implementor;
- service.init(configuration);
- return service;
- }
-
- protected RedmineServiceConfiguration getAnonymousConfiguration()
- throws IOException {
- if (anonymousConfiguration == null) {
-
- Properties props = new Properties();
-
- InputStream inputStream = null;
- try {
- String jredmineConfiguration = System.getenv("jredmine-test.properties");
- if (jredmineConfiguration == null) {
- if (log.isWarnEnabled()) {
- log.warn("Could not find environement variable " +
- "'jredmine-test.properties' will use " +
- "default test configuration");
- }
-
- inputStream = getClass().getResourceAsStream("/test-config.properties");
- } else {
-
- File file = new File(jredmineConfiguration);
-
- if (!file.exists()) {
- throw new IllegalStateException("Could not find " + jredmineConfiguration +
- " file");
- }
- inputStream = FileUtils.openInputStream(file);
- }
- props.load(inputStream);
- } finally {
- if (inputStream != null) {
- inputStream.close();
- }
- }
- anonymousConfiguration = new FakeRedmineServiceConfiguration();
-
- String url = props.getProperty("test.redmineUrl");
- anonymousConfiguration.setRestUrl(new URL(url));
-
- String e = props.getProperty("test.encoding");
- anonymousConfiguration.setEncoding(e);
-
- String verbose = props.getProperty("test.verbose");
- if (StringUtils.isNotEmpty(verbose)) {
- anonymousConfiguration.setVerbose(Boolean.valueOf(verbose));
- }
- anonymousConfiguration.setEncoding(Charsets.UTF_8.name());
- anonymousConfiguration.setAnonymous(true);
-
- verbose = System.getenv("jredmine-test.verbose");
- if (StringUtils.isNotEmpty(verbose)) {
- anonymousConfiguration.setVerbose(Boolean.valueOf(verbose));
- }
-
- }
- return anonymousConfiguration;
- }
-
- protected RedmineServiceConfiguration getLogguedConfiguration()
- throws IOException {
- if (logguedConfiguration == null) {
-
- // use anonymous configuration
-
- RedmineServiceConfiguration anoConf = getAnonymousConfiguration();
- if (anoConf != null) {
- logguedConfiguration = new FakeRedmineServiceConfiguration();
- copyConfiguration(anoConf, logguedConfiguration);
-
- // get system login password from env
- String login = System.getenv("jredmine-test.login");
- String password = System.getenv("jredmine-test.password");
- if (!"null".equals(login)) {
- logguedConfiguration.setRestUsername(login);
- }
- if (!"null".equals(password)) {
- logguedConfiguration.setRestPassword(password);
- }
- logguedConfiguration.setAnonymous(false);
- }
- }
- return logguedConfiguration;
- }
-
- protected void copyConfiguration(RedmineServiceConfiguration src,
- RedmineServiceConfiguration dst) {
- dst.setRestUrl(src.getRestUrl());
- dst.setRestUsername(src.getRestUsername());
- dst.setRestPassword(src.getRestPassword());
- dst.setEncoding(src.getEncoding());
- dst.setVerbose(src.isVerbose());
- dst.setAnonymous(src.isAnonymous());
- }
-
- 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);
- }
-
- public Project getJRedmineProject() {
- if (JRedmineProject == null) {
- JRedmineProject = new Project();
- JRedmineProject.setName("jredmine");
- JRedmineProject.setIdentifier("jredmine");
- JRedmineProject.setIsPublic(true);
- JRedmineProject.setHomepage("http://maven-site.nuiton.org/jredmine");
- JRedmineProject.setDescription(
- "Permet de communiquer en java avec un serveur " + "redmine qui a installé le plugin rails jredmine");
- JRedmineProject.setId(36);
- JRedmineProject.setStatus(1);
- }
- return JRedmineProject;
- }
-
-
- public static final String VERSION_TO_CREATE_NAME = "do_not_use_me";
-
- public Version getVersion() {
- Version version = new Version();
- version.setName(VERSION_TO_CREATE_NAME);
- version.setDescription("Une version créée par les tests de jredmine," +
- " ne pas utiliser,et modifiée");
- return version;
- }
-
- 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 Attachment getAttachment() {
- Attachment result = new Attachment();
- File fileToUpload = null;
- try {
- fileToUpload = File.createTempFile("toupload", ".txt");
- FileUtils.write(fileToUpload, FILE_TO_UPLOAD_CONTENT);
- result.setToUpload(fileToUpload);
- result.setDescription("attachment description...");
- return result;
- } catch (IOException e) {
- throw new RuntimeException("Could not create temp file", e);
- }
-
- }
-
- /**
- * Configuration of a redmine service for test purposes.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.4
- */
- public static class FakeRedmineServiceConfiguration implements RedmineServiceConfiguration {
-
- URL restUrl;
-
- String restUsername;
-
- String restPassword;
-
- boolean verbose;
-
- boolean anonymous;
-
- String encoding;
-
- @Override
- public String getEncoding() {
- return encoding;
- }
-
- @Override
- public void setEncoding(String encoding) {
- this.encoding = encoding;
- }
-
- @Override
- public String getRestPassword() {
- return restPassword;
- }
-
- @Override
- public void setRestPassword(String restPassword) {
- this.restPassword = restPassword;
- }
-
- @Override
- public URL getRestUrl() {
- return restUrl;
- }
-
- @Override
- public void setRestUrl(URL restUrl) {
- this.restUrl = restUrl;
- }
-
- @Override
- public String getRestUsername() {
- return restUsername;
- }
-
- @Override
- public void setRestUsername(String restUsername) {
- this.restUsername = restUsername;
- }
-
- @Override
- public boolean isVerbose() {
- return verbose;
- }
-
- @Override
- public void setVerbose(boolean verbose) {
- this.verbose = verbose;
- }
-
- @Override
- public boolean isAnonymous() {
- return anonymous;
- }
-
- @Override
- public void setAnonymous(boolean anonymous) {
- this.anonymous = anonymous;
- }
-
- @Override
- public String toString() {
- ToStringBuilder b = new ToStringBuilder(this,
- ToStringStyle.MULTI_LINE_STYLE
- );
- b.append("redmineUrl", restUrl);
- if (anonymous) {
- b.append("anonymous", true);
- } else {
- b.append("redmineUsername", restUsername);
- b.append("redminePassword", "***");
- }
- b.append("encoding", encoding);
- b.append("verbose", verbose);
- return b.toString();
- }
- }
-}
Copied: trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineFixtures.java (from rev 282, trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineFixtures.java)
===================================================================
--- trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineFixtures.java (rev 0)
+++ trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineFixtures.java 2012-07-13 16:49:39 UTC (rev 289)
@@ -0,0 +1,798 @@
+package org.nuiton.jredmine.v1_3_x;
+
+import com.google.common.base.Charsets;
+import com.google.common.collect.ArrayListMultimap;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.jredmine.RedmineAnonymousService;
+import org.nuiton.jredmine.RedmineService;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+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 java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Date;
+import java.util.List;
+import java.util.Properties;
+
+/**
+ * fixtures of redmine model.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public class RedmineFixtures {
+
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(RedmineFixtures.class);
+
+ public static final String FILE_TO_UPLOAD_CONTENT = "Fichier à uploader";
+
+ public static final String PROJECT_NAME = "jredmine";
+
+ public static final String VERSION_NAME = "1.3";
+
+ public static final String ISSUE_ID = "2030";
+
+ private Project JRedmineProject;
+
+ private ArrayListMultimap<Class<?>, Object> model;
+
+ private RedmineServiceConfiguration anonymousConfiguration;
+
+ private RedmineServiceConfiguration logguedConfiguration;
+
+ public String projectName() {
+ return PROJECT_NAME;
+ }
+
+ public String versionName() {
+ return VERSION_NAME;
+ }
+
+ public String issueId() {
+ return ISSUE_ID;
+ }
+
+ public RedmineServiceConfiguration newAnonymousConfiguration()
+ throws IOException {
+ RedmineServiceConfiguration conf = new FakeRedmineServiceConfiguration();
+ copyConfiguration(getAnonymousConfiguration(), conf);
+ return conf;
+ }
+
+ public RedmineServiceConfiguration newLogguedConfiguration()
+ throws IOException {
+ RedmineServiceConfiguration conf = new FakeRedmineServiceConfiguration();
+ copyConfiguration(getLogguedConfiguration(), conf);
+ return conf;
+ }
+
+ public RedmineAnonymousService newRedmineAnonymousService(RedmineServiceConfiguration configuration)
+ throws IOException, RedmineServiceException {
+ RedmineAnonymousServiceImpl service = new RedmineAnonymousServiceImpl();
+ service.init(configuration);
+ return service;
+ }
+
+ public RedmineService newRedmineService(RedmineServiceConfiguration configuration)
+ throws IOException, RedmineServiceException {
+ RedmineServiceImpl service = new RedmineServiceImpl();
+ service.init(configuration);
+ return service;
+ }
+
+ protected RedmineServiceConfiguration getAnonymousConfiguration()
+ throws IOException {
+ if (anonymousConfiguration == null) {
+
+ Properties props = new Properties();
+
+ InputStream inputStream = null;
+ try {
+ String jredmineConfiguration = System.getenv("jredmine-test.properties");
+ if (jredmineConfiguration == null) {
+ if (log.isWarnEnabled()) {
+ log.warn("Could not find environement variable " +
+ "'jredmine-test.properties' will use " +
+ "default test configuration");
+ }
+
+ inputStream = getClass().getResourceAsStream("/test-config.properties");
+ } else {
+
+ File file = new File(jredmineConfiguration);
+
+ if (!file.exists()) {
+ throw new IllegalStateException("Could not find " + jredmineConfiguration +
+ " file");
+ }
+ inputStream = FileUtils.openInputStream(file);
+ }
+ props.load(inputStream);
+ } finally {
+ if (inputStream != null) {
+ inputStream.close();
+ }
+ }
+ anonymousConfiguration = new FakeRedmineServiceConfiguration();
+
+ String url = props.getProperty("test.redmineUrl");
+ anonymousConfiguration.setRestUrl(new URL(url));
+
+ String e = props.getProperty("test.encoding");
+ anonymousConfiguration.setEncoding(e);
+
+ String verbose = props.getProperty("test.verbose");
+ if (StringUtils.isNotEmpty(verbose)) {
+ anonymousConfiguration.setVerbose(Boolean.valueOf(verbose));
+ }
+ anonymousConfiguration.setEncoding(Charsets.UTF_8.name());
+ anonymousConfiguration.setAnonymous(true);
+
+ verbose = System.getenv("jredmine-test.verbose");
+ if (StringUtils.isNotEmpty(verbose)) {
+ anonymousConfiguration.setVerbose(Boolean.valueOf(verbose));
+ }
+
+ }
+ return anonymousConfiguration;
+ }
+
+ protected RedmineServiceConfiguration getLogguedConfiguration()
+ throws IOException {
+ if (logguedConfiguration == null) {
+
+ // use anonymous configuration
+
+ RedmineServiceConfiguration anoConf = getAnonymousConfiguration();
+ if (anoConf != null) {
+ logguedConfiguration = new FakeRedmineServiceConfiguration();
+ copyConfiguration(anoConf, logguedConfiguration);
+
+ // get system login password from env
+ String login = System.getenv("jredmine-test.login");
+ String password = System.getenv("jredmine-test.password");
+ if (!"null".equals(login)) {
+ logguedConfiguration.setRestUsername(login);
+ }
+ if (!"null".equals(password)) {
+ logguedConfiguration.setRestPassword(password);
+ }
+ logguedConfiguration.setAnonymous(false);
+ }
+ }
+ return logguedConfiguration;
+ }
+
+ protected void copyConfiguration(RedmineServiceConfiguration src,
+ RedmineServiceConfiguration dst) {
+ dst.setRestUrl(src.getRestUrl());
+ dst.setRestUsername(src.getRestUsername());
+ dst.setRestPassword(src.getRestPassword());
+ dst.setEncoding(src.getEncoding());
+ dst.setVerbose(src.isVerbose());
+ dst.setAnonymous(src.isAnonymous());
+ }
+
+ 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);
+ }
+
+ public Project getJRedmineProject() {
+ if (JRedmineProject == null) {
+ JRedmineProject = new Project();
+ JRedmineProject.setName("jredmine");
+ JRedmineProject.setIdentifier("jredmine");
+ JRedmineProject.setIsPublic(true);
+ JRedmineProject.setHomepage("http://maven-site.nuiton.org/jredmine");
+ JRedmineProject.setDescription(
+ "Permet de communiquer en java avec un serveur " + "redmine qui a installé le plugin rails jredmine");
+ JRedmineProject.setId(36);
+ JRedmineProject.setStatus(1);
+ }
+ return JRedmineProject;
+ }
+
+
+ public static final String VERSION_TO_CREATE_NAME = "do_not_use_me";
+
+ public Version getVersion() {
+ Version version = new Version();
+ version.setName(VERSION_TO_CREATE_NAME);
+ version.setDescription("Une version créée par les tests de jredmine," +
+ " ne pas utiliser,et modifiée");
+ return version;
+ }
+
+ 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 Attachment getAttachment() {
+ Attachment result = new Attachment();
+ File fileToUpload = null;
+ try {
+ fileToUpload = File.createTempFile("toupload", ".txt");
+ FileUtils.write(fileToUpload, FILE_TO_UPLOAD_CONTENT);
+ result.setToUpload(fileToUpload);
+ result.setDescription("attachment description...");
+ return result;
+ } catch (IOException e) {
+ throw new RuntimeException("Could not create temp file", e);
+ }
+
+ }
+
+ /**
+ * Configuration of a redmine service for test purposes.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+ public static class FakeRedmineServiceConfiguration implements RedmineServiceConfiguration {
+
+ URL restUrl;
+
+ String restUsername;
+
+ String restPassword;
+
+ boolean verbose;
+
+ boolean anonymous;
+
+ String encoding;
+
+ @Override
+ public String getEncoding() {
+ return encoding;
+ }
+
+ @Override
+ public void setEncoding(String encoding) {
+ this.encoding = encoding;
+ }
+
+ @Override
+ public String getRestPassword() {
+ return restPassword;
+ }
+
+ @Override
+ public void setRestPassword(String restPassword) {
+ this.restPassword = restPassword;
+ }
+
+ @Override
+ public URL getRestUrl() {
+ return restUrl;
+ }
+
+ @Override
+ public void setRestUrl(URL restUrl) {
+ this.restUrl = restUrl;
+ }
+
+ @Override
+ public String getRestUsername() {
+ return restUsername;
+ }
+
+ @Override
+ public void setRestUsername(String restUsername) {
+ this.restUsername = restUsername;
+ }
+
+ @Override
+ public boolean isVerbose() {
+ return verbose;
+ }
+
+ @Override
+ public void setVerbose(boolean verbose) {
+ this.verbose = verbose;
+ }
+
+ @Override
+ public boolean isAnonymous() {
+ return anonymous;
+ }
+
+ @Override
+ public void setAnonymous(boolean anonymous) {
+ this.anonymous = anonymous;
+ }
+
+ @Override
+ public String toString() {
+ ToStringBuilder b = new ToStringBuilder(this,
+ ToStringStyle.MULTI_LINE_STYLE
+ );
+ b.append("redmineUrl", restUrl);
+ if (anonymous) {
+ b.append("anonymous", true);
+ } else {
+ b.append("redmineUsername", restUsername);
+ b.append("redminePassword", "***");
+ }
+ b.append("encoding", encoding);
+ b.append("verbose", verbose);
+ return b.toString();
+ }
+ }
+}
Deleted: trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceAsAnonymousTest.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceAsAnonymousTest.java 2012-07-13 16:27:10 UTC (rev 281)
+++ trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceAsAnonymousTest.java 2012-07-13 16:49:39 UTC (rev 289)
@@ -1,200 +0,0 @@
-package org.nuiton.jredmine.v1_3_x;
-
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.Test;
-import org.nuiton.jredmine.RedmineService;
-import org.nuiton.jredmine.RedmineServiceConfiguration;
-import org.nuiton.jredmine.RedmineServiceException;
-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 java.io.IOException;
-
-/**
- * Tests the {@link RedmineAnonymousServiceImpl}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.5
- */
-public class RedmineServiceAsAnonymousTest {
-
- protected static final RedmineFixtures fixtures = new RedmineFixtures();
-
- @Rule
- public final RedmineServer<RedmineService> server = createNewServer(fixtures);
-
- protected RedmineService getService() {
- return server.getService();
- }
-
- protected RedmineServer<RedmineService> createNewServer(RedmineFixtures fixtures) {
- return new RedmineServer<RedmineService>(fixtures) {
-
- @Override
- protected RedmineService createService(
- RedmineFixtures fixture,
- RedmineServiceConfiguration configuration) throws IOException, RedmineServiceException {
-
- return fixture.newRedmineService(configuration);
- }
-
- @Override
- protected RedmineServiceConfiguration createConfiguration(RedmineFixtures fixture) throws IOException {
- RedmineServiceConfiguration conf = fixture.newAnonymousConfiguration();
- return conf;
- }
- };
- }
-
-
- @BeforeClass
- public static void beforeClass() {
- RedmineServer<RedmineService> newServer =
- new RedmineServiceAsAnonymousTest().createNewServer(fixtures);
- newServer.checkService();
- }
-
- @Test
- public void getProjects() throws Exception {
- Project[] projects = getService().getProjects();
- Assert.assertNotNull(projects);
- }
-
- @Test
- public void getIssuePriorities() throws Exception {
- IssuePriority[] issuePriorities = getService().getIssuePriorities();
- Assert.assertNotNull(issuePriorities);
- }
-
- @Test
- public void getIssueStatuses() throws Exception {
- IssueStatus[] issueStatuses = getService().getIssueStatuses();
- Assert.assertNotNull(issueStatuses);
- }
-
- @Test
- public void getProject() throws Exception {
- Project project = getService().getProject(fixtures.projectName());
- Assert.assertNotNull(project);
- }
-
- @Test
- public void getIssueCategories() throws Exception {
- IssueCategory[] issueCategories = getService().getIssueCategories(fixtures.projectName());
- Assert.assertNotNull(issueCategories);
- }
-
- @Test
- public void getTrackers() throws Exception {
- Tracker[] trackers = getService().getTrackers(fixtures.projectName());
- Assert.assertNotNull(trackers);
- }
-
- @Test
- public void getNews() throws Exception {
- News[] news = getService().getNews(fixtures.projectName());
- Assert.assertNotNull(news);
- }
-
- @Test
- public void getProjectMembers() throws Exception {
- User[] users = getService().getProjectMembers(fixtures.projectName());
- Assert.assertNotNull(users);
- }
-
- @Test
- public void getProjectIssues() throws Exception {
- Issue[] issues = getService().getIssues(fixtures.projectName());
- Assert.assertNotNull(issues);
- }
-
- @Test
- public void getVersions() throws Exception {
- Version[] versions = getService().getVersions(fixtures.projectName());
- Assert.assertNotNull(versions);
- }
-
- @Test
- public void getVersion() throws Exception {
- Version version = getService().getVersion(fixtures.projectName(), fixtures.versionName());
- Assert.assertNotNull(version);
- }
-
- @Test
- public void getVersionIssues() throws Exception {
- Issue[] issues = getService().getIssues(fixtures.projectName(), fixtures.versionName());
- Assert.assertNotNull(issues);
- }
-
- @Test
- public void getOpenedIssues() throws Exception {
- Issue[] issues = getService().getOpenedIssues(fixtures.projectName());
- Assert.assertNotNull(issues);
- }
-
- @Test
- public void getClosedIssues() throws Exception {
- Issue[] issues = getService().getClosedIssues(fixtures.projectName());
- Assert.assertNotNull(issues);
- }
-
- @Test
- public void getIssueTimeEntries() throws Exception {
- TimeEntry[] timeEntries = getService().getIssueTimeEntries(fixtures.projectName(), fixtures.issueId());
- Assert.assertNotNull(timeEntries);
- }
-
- @Test
- public void getAttachments() throws Exception {
- Attachment[] attachments = getService().getAttachments(fixtures.projectName(), fixtures.versionName());
- Assert.assertNotNull(attachments);
- }
-
- @Test(expected = RedmineServiceLoginException.class)
- public void getUserProjects() throws Exception {
- getService().getUserProjects();
- }
-
- @Test(expected = RedmineServiceLoginException.class)
- public void addVersion() throws Exception {
- getService().addVersion(fixtures.projectName(), new Version());
- }
-
- @Test(expected = RedmineServiceLoginException.class)
- public void addAttachment() throws Exception {
- getService().addAttachment(fixtures.projectName(), fixtures.versionName(), new Attachment());
- }
-
- @Test(expected = RedmineServiceLoginException.class)
- public void addNews() throws Exception {
- getService().addNews(fixtures.projectName(), new News());
- }
-
- @Test(expected = RedmineServiceLoginException.class)
- public void updateVersion() throws Exception {
- getService().updateVersion(fixtures.projectName(), new Version());
- }
-
- @Test(expected = RedmineServiceLoginException.class)
- public void nextVersion() throws Exception {
- getService().nextVersion(fixtures.projectName(), fixtures.versionName(), new Version());
- }
-
- @Test(expected = RedmineServiceLoginException.class)
- public void addIssueTime() throws Exception {
- getService().addIssueTimeEntry(fixtures.projectName(), fixtures.issueId(), new TimeEntry());
- }
-
-}
Copied: trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceAsAnonymousTest.java (from rev 288, trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceAsAnonymousTest.java)
===================================================================
--- trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceAsAnonymousTest.java (rev 0)
+++ trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceAsAnonymousTest.java 2012-07-13 16:49:39 UTC (rev 289)
@@ -0,0 +1,200 @@
+package org.nuiton.jredmine.v1_3_x;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.Test;
+import org.nuiton.jredmine.RedmineService;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+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 java.io.IOException;
+
+/**
+ * Tests the {@link RedmineAnonymousServiceImpl}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.5
+ */
+public class RedmineServiceAsAnonymousTest {
+
+ protected static final RedmineFixtures fixtures = new RedmineFixtures();
+
+ @Rule
+ public final RedmineServer<RedmineService> server = createNewServer(fixtures);
+
+ protected RedmineService getService() {
+ return server.getService();
+ }
+
+ protected RedmineServer<RedmineService> createNewServer(RedmineFixtures fixtures) {
+ return new RedmineServer<RedmineService>(fixtures) {
+
+ @Override
+ protected RedmineService createService(
+ RedmineFixtures fixture,
+ RedmineServiceConfiguration configuration) throws IOException, RedmineServiceException {
+
+ return fixture.newRedmineService(configuration);
+ }
+
+ @Override
+ protected RedmineServiceConfiguration createConfiguration(RedmineFixtures fixture) throws IOException {
+ RedmineServiceConfiguration conf = fixture.newAnonymousConfiguration();
+ return conf;
+ }
+ };
+ }
+
+
+ @BeforeClass
+ public static void beforeClass() {
+ RedmineServer<RedmineService> newServer =
+ new RedmineServiceAsAnonymousTest().createNewServer(fixtures);
+ newServer.checkService();
+ }
+
+ @Test
+ public void getProjects() throws Exception {
+ Project[] projects = getService().getProjects();
+ Assert.assertNotNull(projects);
+ }
+
+ @Test
+ public void getIssuePriorities() throws Exception {
+ IssuePriority[] issuePriorities = getService().getIssuePriorities();
+ Assert.assertNotNull(issuePriorities);
+ }
+
+ @Test
+ public void getIssueStatuses() throws Exception {
+ IssueStatus[] issueStatuses = getService().getIssueStatuses();
+ Assert.assertNotNull(issueStatuses);
+ }
+
+ @Test
+ public void getProject() throws Exception {
+ Project project = getService().getProject(fixtures.projectName());
+ Assert.assertNotNull(project);
+ }
+
+ @Test
+ public void getIssueCategories() throws Exception {
+ IssueCategory[] issueCategories = getService().getIssueCategories(fixtures.projectName());
+ Assert.assertNotNull(issueCategories);
+ }
+
+ @Test
+ public void getTrackers() throws Exception {
+ Tracker[] trackers = getService().getTrackers(fixtures.projectName());
+ Assert.assertNotNull(trackers);
+ }
+
+ @Test
+ public void getNews() throws Exception {
+ News[] news = getService().getNews(fixtures.projectName());
+ Assert.assertNotNull(news);
+ }
+
+ @Test
+ public void getProjectMembers() throws Exception {
+ User[] users = getService().getProjectMembers(fixtures.projectName());
+ Assert.assertNotNull(users);
+ }
+
+ @Test
+ public void getProjectIssues() throws Exception {
+ Issue[] issues = getService().getIssues(fixtures.projectName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getVersions() throws Exception {
+ Version[] versions = getService().getVersions(fixtures.projectName());
+ Assert.assertNotNull(versions);
+ }
+
+ @Test
+ public void getVersion() throws Exception {
+ Version version = getService().getVersion(fixtures.projectName(), fixtures.versionName());
+ Assert.assertNotNull(version);
+ }
+
+ @Test
+ public void getVersionIssues() throws Exception {
+ Issue[] issues = getService().getIssues(fixtures.projectName(), fixtures.versionName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getOpenedIssues() throws Exception {
+ Issue[] issues = getService().getOpenedIssues(fixtures.projectName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getClosedIssues() throws Exception {
+ Issue[] issues = getService().getClosedIssues(fixtures.projectName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getIssueTimeEntries() throws Exception {
+ TimeEntry[] timeEntries = getService().getIssueTimeEntries(fixtures.projectName(), fixtures.issueId());
+ Assert.assertNotNull(timeEntries);
+ }
+
+ @Test
+ public void getAttachments() throws Exception {
+ Attachment[] attachments = getService().getAttachments(fixtures.projectName(), fixtures.versionName());
+ Assert.assertNotNull(attachments);
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ public void getUserProjects() throws Exception {
+ getService().getUserProjects();
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ public void addVersion() throws Exception {
+ getService().addVersion(fixtures.projectName(), new Version());
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ public void addAttachment() throws Exception {
+ getService().addAttachment(fixtures.projectName(), fixtures.versionName(), new Attachment());
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ public void addNews() throws Exception {
+ getService().addNews(fixtures.projectName(), new News());
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ public void updateVersion() throws Exception {
+ getService().updateVersion(fixtures.projectName(), new Version());
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ public void nextVersion() throws Exception {
+ getService().nextVersion(fixtures.projectName(), fixtures.versionName(), new Version());
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ public void addIssueTime() throws Exception {
+ getService().addIssueTimeEntry(fixtures.projectName(), fixtures.issueId(), new TimeEntry());
+ }
+
+}
Modified: trunk/jredmine-maven-plugin/pom.xml
===================================================================
--- trunk/jredmine-maven-plugin/pom.xml 2012-07-13 16:48:19 UTC (rev 288)
+++ trunk/jredmine-maven-plugin/pom.xml 2012-07-13 16:49:39 UTC (rev 289)
@@ -47,7 +47,7 @@
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>jredmine-client-1.3.x</artifactId>
+ <artifactId>jredmine-client-1.x</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-07-13 16:48:19 UTC (rev 288)
+++ trunk/pom.xml 2012-07-13 16:49:39 UTC (rev 289)
@@ -41,7 +41,7 @@
<modules>
<module>jredmine-client-api</module>
- <module>jredmine-client-1.3.x</module>
+ <module>jredmine-client-1.x</module>
<module>jredmine-maven-plugin</module>
</modules>
1
0
r288 - in trunk: jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x jredmine-client-api/src/main/java/org/nuiton/jredmine/model jredmine-client-api/src/main/java/org/nuiton/jredmine/request jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin
by tchemit@users.nuiton.org 13 Jul '12
by tchemit@users.nuiton.org 13 Jul '12
13 Jul '12
Author: tchemit
Date: 2012-07-13 18:48:19 +0200 (Fri, 13 Jul 2012)
New Revision: 288
Url: http://nuiton.org/repositories/revision/jredmine/288
Log:
improve some misc stuff (constants, and al.)
Modified:
trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceImpl.java
trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRequestFactoryImpl.java
trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRestClient.java
trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImpl.java
trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceProviderImpl.java
trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceAsAnonymousTest.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/ModelHelper.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/DefaultRedmineRequestBuilder.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/IssueScopeRedmineRequestBuilder.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/ProjectScopeRedmineRequestBuilder.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/VersionScopeRedmineRequestBuilder.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java
Modified: trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceImpl.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceImpl.java 2012-07-13 16:30:51 UTC (rev 287)
+++ trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceImpl.java 2012-07-13 16:48:19 UTC (rev 288)
@@ -37,6 +37,7 @@
import org.nuiton.jredmine.model.IssueCategory;
import org.nuiton.jredmine.model.IssuePriority;
import org.nuiton.jredmine.model.IssueStatus;
+import org.nuiton.jredmine.model.ModelHelper;
import org.nuiton.jredmine.model.News;
import org.nuiton.jredmine.model.Project;
import org.nuiton.jredmine.model.TimeEntry;
@@ -73,26 +74,26 @@
@Override
public IssueStatus[] getIssueStatuses() throws RedmineServiceException {
- return getDatas(RedmineRequestFactoryImpl.GET_ISSUE_STATUS_LIST,
+ return getDatas(ModelHelper.GET_ALL_ISSUE_STATUS_REQUEST_NAME,
IssueStatus.class
);
}
@Override
public IssuePriority[] getIssuePriorities() throws RedmineServiceException {
- return getDatas(RedmineRequestFactoryImpl.GET_ISSUE_PRIORITY_LIST,
+ return getDatas(ModelHelper.GET_ALL_ISSUE_PRIORITY_REQUEST_NAME,
IssuePriority.class
);
}
@Override
public Project[] getProjects() throws RedmineServiceException {
- return getDatas(RedmineRequestFactoryImpl.GET_PROJECT_LIST, Project.class);
+ return getDatas(ModelHelper.GET_ALL_PROJECT_REQUEST_NAME, Project.class);
}
@Override
public IssueCategory[] getIssueCategories(String projectName) throws RedmineServiceException {
- return getDatas(RedmineRequestFactoryImpl.GET_ISSUE_CATEGORY_LIST,
+ return getDatas(ModelHelper.GET_ALL_ISSUE_CATEGORY_REQUEST_NAME,
IssueCategory.class,
projectName
);
@@ -100,7 +101,7 @@
@Override
public Project getProject(String projectName) throws RedmineServiceException {
- return getData(RedmineRequestFactoryImpl.GET_PROJECT,
+ return getData(ModelHelper.GET_PROJECT_REQUEST_NAME,
Project.class,
projectName
);
@@ -108,7 +109,7 @@
@Override
public Tracker[] getTrackers(String projectName) throws RedmineServiceException {
- return getDatas(RedmineRequestFactoryImpl.GET_TRACKER_LIST,
+ return getDatas(ModelHelper.GET_ALL_TRACKER_REQUEST_NAME,
Tracker.class,
projectName
);
@@ -116,7 +117,7 @@
@Override
public News[] getNews(String projectName) throws RedmineServiceException {
- return getDatas(RedmineRequestFactoryImpl.GET_NEWS_LIST,
+ return getDatas(ModelHelper.GET_ALL_NEWS_REQUEST_NAME,
News.class,
projectName
);
@@ -124,7 +125,7 @@
@Override
public User[] getProjectMembers(String projectName) throws RedmineServiceException {
- return getDatas(RedmineRequestFactoryImpl.GET_USER_LIST,
+ return getDatas(ModelHelper.GET_ALL_USER_REQUEST_NAME,
User.class,
projectName
);
@@ -132,7 +133,7 @@
@Override
public Version[] getVersions(String projectName) throws RedmineServiceException {
- return getDatas(RedmineRequestFactoryImpl.GET_VERSION_LIST,
+ return getDatas(ModelHelper.GET_ALL_VERSION_REQUEST_NAME,
Version.class,
projectName
);
@@ -141,7 +142,7 @@
@Override
public Version getVersion(String projectName,
String versionName) throws RedmineServiceException {
- return getData(RedmineRequestFactoryImpl.GET_VERSION,
+ return getData(ModelHelper.GET_VERSION_REQUEST_NAME,
Version.class,
projectName,
versionName
@@ -151,7 +152,7 @@
@Override
public Attachment[] getAttachments(String projectName,
String versionName) throws RedmineServiceException {
- return getDatas(RedmineRequestFactoryImpl.GET_ATTACHMENTS_LIST,
+ return getDatas(ModelHelper.GET_ALL_ATTACHMENTS_REQUEST_NAME,
Attachment.class,
projectName,
versionName
@@ -161,7 +162,7 @@
@Override
public Issue[] getIssues(String projectName,
String versionName) throws RedmineServiceException {
- return getDatas(RedmineRequestFactoryImpl.GET_ISSUE_LIST,
+ return getDatas(ModelHelper.GET_ALL_ISSUES_REQUEST_NAME,
Issue.class,
projectName,
versionName
@@ -171,7 +172,7 @@
@Override
public TimeEntry[] getIssueTimeEntries(String projectName,
String issueId) throws RedmineServiceException {
- return getDatas(RedmineRequestFactoryImpl.GET_ISSUE_TIME_ENTRY_LIST,
+ return getDatas(ModelHelper.GET_ALL_ISSUE_TIME_ENTRY_REQUEST_NAME,
TimeEntry.class,
projectName,
issueId
@@ -180,7 +181,7 @@
@Override
public Issue[] getIssues(String projectName) throws RedmineServiceException {
- Issue[] result = getDatas(RedmineRequestFactoryImpl.GET_PROJECT_ISSUES,
+ Issue[] result = getDatas(ModelHelper.GET_ALL_PROJECT_ISSUES_REQUEST_NAME,
Issue.class,
projectName
);
@@ -189,7 +190,7 @@
@Override
public Issue[] getOpenedIssues(String projectName) throws RedmineServiceException {
- Issue[] result = getDatas(RedmineRequestFactoryImpl.GET_PROJECT_OPENED_ISSUES,
+ Issue[] result = getDatas(ModelHelper.GET_ALL_PROJECT_OPENED_ISSUES_REQUEST_NAME,
Issue.class,
projectName
);
@@ -198,7 +199,7 @@
@Override
public Issue[] getClosedIssues(String projectName) throws RedmineServiceException {
- Issue[] result = getDatas(RedmineRequestFactoryImpl.GET_PROJECT_CLOSED_ISSUES,
+ Issue[] result = getDatas(ModelHelper.GET_ALL_PROJECT_CLOSED_ISSUES_REQUEST_NAME,
Issue.class,
projectName
);
Modified: trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRequestFactoryImpl.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRequestFactoryImpl.java 2012-07-13 16:30:51 UTC (rev 287)
+++ trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRequestFactoryImpl.java 2012-07-13 16:48:19 UTC (rev 288)
@@ -5,15 +5,9 @@
import org.nuiton.io.rest.RestMethod;
import org.nuiton.io.rest.RestRequest;
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.ModelHelper;
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.VersionStatusEnum;
import org.nuiton.jredmine.request.DefaultRedmineRequestBuilder;
@@ -34,68 +28,16 @@
*/
public class RedmineRequestFactoryImpl extends AbstractRequestFactory {
- public static final String GET_ISSUE_LIST = Issue.class.getName() + "list";
-
- public static final String GET_ISSUE_STATUS_LIST = IssueStatus.class.getName() + "list";
-
- public static final String GET_ISSUE_PRIORITY_LIST = IssuePriority.class.getName() + "list";
-
- public static final String GET_ISSUE_CATEGORY_LIST = IssueCategory.class.getName() + "list";
-
- public static final String GET_ISSUE_TIME_ENTRY_LIST = TimeEntry.class.getName() + "list";
-
- public static final String GET_PROJECT_LIST = Project.class.getName() + "list";
-
- public static final String GET_PROJECT_ISSUES = Project.class.getName() + "issues";
-
- public static final String GET_PROJECT_OPENED_ISSUES = Project.class.getName() + "opened-issues";
-
- public static final String GET_PROJECT_CLOSED_ISSUES = Project.class.getName() + "closed-issues";
-
- public static final String GET_USER_PROJECTS = Project.class.getName() + "forUser";
-
- public static final String GET_PROJECT = Project.class.getName() + "detail";
-
- public static final String GET_VERSION_LIST = Version.class.getName() + "list";
-
- public static final String GET_TRACKER_LIST = Tracker.class.getName() + "list";
-
- public static final String GET_ATTACHMENTS_LIST = Attachment.class.getName() + "list";
-
- public static final String GET_USER_LIST = User.class.getName() + "list";
-
- public static final String GET_NEWS_LIST = News.class.getName() + "list";
-
- public static final String GET_VERSION = Version.class.getName() + "detail";
-
- public static final String ADD_VERSION = Version.class.getName() + "add";
-
- public static final String UPDATE_VERSION = Version.class.getName() + "update";
-
- public static final String NEXT_VERSION = Version.class.getName() + "next";
-
- public static final String ADD_NEWS = News.class.getName() + "add";
-
- public static final String ADD_ATTACHMENT = Attachment.class.getName() + "add";
-
- public static final String ADD_ISSUE_TIME_ENTRY = TimeEntry.class.getName() + "add";
-
- public static final String LOGIN = "login";
-
- public static final String LOGOUT = "logout";
-
- public static final String PING = "ping";
-
@Override
public void addDefaultRequests() {
// misc requests
- addRequestBuilder(new DefaultRedmineRequestBuilder(PING, RestMethod.GET, "jredmine", "ping"));
-// addRequestBuilder(new DefaultRedmineRequestBuilder(PING, RestMethod.GET, "projects"));
- addRequestBuilder(new DefaultRedmineRequestBuilder(LOGOUT, RestMethod.GET, "jredmine", "logout"));
-// addRequestBuilder(new DefaultRedmineRequestBuilder(LOGIN, RestMethod.POST, "login") {
- addRequestBuilder(new DefaultRedmineRequestBuilder(LOGIN, RestMethod.POST, "jredmine", "login") {
+ addRequestBuilder(new DefaultRedmineRequestBuilder(ModelHelper.PING_REQUEST_NAME, RestMethod.GET, "jredmine", "ping"));
+// addRequestBuilder(new DefaultRedmineRequestBuilder(PING_REQUEST_NAME, RestMethod.GET, "projects"));
+ addRequestBuilder(new DefaultRedmineRequestBuilder(ModelHelper.LOGOUT_REQUEST_NAME, RestMethod.GET, "jredmine", "logout"));
+// addRequestBuilder(new DefaultRedmineRequestBuilder(LOGIN_REQUEST_NAME, RestMethod.POST, "login") {
+ addRequestBuilder(new DefaultRedmineRequestBuilder(ModelHelper.LOGIN_REQUEST_NAME, RestMethod.POST, "jredmine", "login") {
private static final long serialVersionUID = 1L;
@@ -109,25 +51,25 @@
// data with no scope requests
- addRequestBuilder(new DefaultRedmineRequestBuilder(GET_PROJECT_LIST, RestMethod.GET, "jredmine", "get_projects.xml"));
-// addRequestBuilder(new DefaultRedmineRequestBuilder(GET_PROJECT_LIST, RestMethod.GET, "projects.xml"));
- addRequestBuilder(new DefaultRedmineRequestBuilder(GET_USER_PROJECTS, RestMethod.GET, "jredmine", "get_user_projects.xml"));
- addRequestBuilder(new DefaultRedmineRequestBuilder(GET_ISSUE_STATUS_LIST, RestMethod.GET, "jredmine", "get_issue_statuses.xml"));
- addRequestBuilder(new DefaultRedmineRequestBuilder(GET_ISSUE_PRIORITY_LIST, RestMethod.GET, "jredmine", "get_issue_priorities.xml"));
+ addRequestBuilder(new DefaultRedmineRequestBuilder(ModelHelper.GET_ALL_PROJECT_REQUEST_NAME, RestMethod.GET, "jredmine", "get_projects.xml"));
+// addRequestBuilder(new DefaultRedmineRequestBuilder(GET_ALL_PROJECT_REQUEST_NAME, RestMethod.GET, "projects.xml"));
+ addRequestBuilder(new DefaultRedmineRequestBuilder(ModelHelper.GET_USER_PROJECTS_REQUEST_NAME, RestMethod.GET, "jredmine", "get_user_projects.xml"));
+ addRequestBuilder(new DefaultRedmineRequestBuilder(ModelHelper.GET_ALL_ISSUE_STATUS_REQUEST_NAME, RestMethod.GET, "jredmine", "get_issue_statuses.xml"));
+ addRequestBuilder(new DefaultRedmineRequestBuilder(ModelHelper.GET_ALL_ISSUE_PRIORITY_REQUEST_NAME, RestMethod.GET, "jredmine", "get_issue_priorities.xml"));
// data with project scope requests
- addRequestBuilder(new ProjectScopeRedmineRequestBuilder(GET_PROJECT, RestMethod.GET, "jredmine", "get_project.xml"));
- addRequestBuilder(new ProjectScopeRedmineRequestBuilder(GET_PROJECT_ISSUES, RestMethod.GET, "jredmine", "get_project_issues.xml"));
- addRequestBuilder(new ProjectScopeRedmineRequestBuilder(GET_PROJECT_OPENED_ISSUES, RestMethod.GET, "jredmine", "get_project_opened_issues.xml"));
- addRequestBuilder(new ProjectScopeRedmineRequestBuilder(GET_PROJECT_CLOSED_ISSUES, RestMethod.GET, "jredmine", "get_project_closed_issues.xml"));
- addRequestBuilder(new ProjectScopeRedmineRequestBuilder(GET_VERSION_LIST, RestMethod.GET, "jredmine", "get_project_versions.xml"));
- addRequestBuilder(new ProjectScopeRedmineRequestBuilder(GET_ISSUE_CATEGORY_LIST, RestMethod.GET, "jredmine", "get_issue_categories.xml"));
- addRequestBuilder(new ProjectScopeRedmineRequestBuilder(GET_TRACKER_LIST, RestMethod.GET, "jredmine", "get_project_trackers.xml"));
- addRequestBuilder(new ProjectScopeRedmineRequestBuilder(GET_USER_LIST, RestMethod.GET, "jredmine", "get_project_users.xml"));
- addRequestBuilder(new ProjectScopeRedmineRequestBuilder(GET_NEWS_LIST, RestMethod.GET, "jredmine", "get_project_news.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_PROJECT_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_PROJECT_ISSUES_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_issues.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_PROJECT_OPENED_ISSUES_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_opened_issues.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_PROJECT_CLOSED_ISSUES_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_closed_issues.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_VERSION_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_versions.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_ISSUE_CATEGORY_REQUEST_NAME, RestMethod.GET, "jredmine", "get_issue_categories.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_TRACKER_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_trackers.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_USER_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_users.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_NEWS_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_news.xml"));
- addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ADD_VERSION, RestMethod.POST, "jredmine", "add_version.xml") {
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.ADD_VERSION_REQUEST_NAME, RestMethod.POST, "jredmine", "add_version.xml") {
private static final long serialVersionUID = 1L;
@Override
@@ -144,7 +86,7 @@
}
});
- addRequestBuilder(new ProjectScopeRedmineRequestBuilder(UPDATE_VERSION, RestMethod.POST, "jredmine", "update_version.xml") {
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.UPDATE_VERSION_REQUEST_NAME, RestMethod.POST, "jredmine", "update_version.xml") {
private static final long serialVersionUID = 1L;
@Override
@@ -161,7 +103,7 @@
}
});
- addRequestBuilder(new ProjectScopeRedmineRequestBuilder(NEXT_VERSION, RestMethod.POST, "jredmine", "next_version.xml") {
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.NEXT_VERSION_REQUEST_NAME, RestMethod.POST, "jredmine", "next_version.xml") {
private static final long serialVersionUID = 1L;
@Override
@@ -182,7 +124,7 @@
}
});
- addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ADD_NEWS, RestMethod.POST, "jredmine", "add_news.xml") {
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.ADD_NEWS_REQUEST_NAME, RestMethod.POST, "jredmine", "add_news.xml") {
private static final long serialVersionUID = 1L;
@Override
@@ -198,10 +140,10 @@
// version scope requests
- addRequestBuilder(new VersionScopeRedmineRequestBuilder(GET_VERSION, RestMethod.GET, "jredmine", "get_version.xml"));
- addRequestBuilder(new VersionScopeRedmineRequestBuilder(GET_ISSUE_LIST, RestMethod.GET, "jredmine", "get_version_issues.xml"));
- addRequestBuilder(new VersionScopeRedmineRequestBuilder(GET_ATTACHMENTS_LIST, RestMethod.GET, "jredmine", "get_version_attachments.xml"));
- addRequestBuilder(new VersionScopeRedmineRequestBuilder(ADD_ATTACHMENT, RestMethod.POST, "jredmine", "add_version_attachment.xml") {
+ addRequestBuilder(new VersionScopeRedmineRequestBuilder(ModelHelper.GET_VERSION_REQUEST_NAME, RestMethod.GET, "jredmine", "get_version.xml"));
+ addRequestBuilder(new VersionScopeRedmineRequestBuilder(ModelHelper.GET_ALL_ISSUES_REQUEST_NAME, RestMethod.GET, "jredmine", "get_version_issues.xml"));
+ addRequestBuilder(new VersionScopeRedmineRequestBuilder(ModelHelper.GET_ALL_ATTACHMENTS_REQUEST_NAME, RestMethod.GET, "jredmine", "get_version_attachments.xml"));
+ addRequestBuilder(new VersionScopeRedmineRequestBuilder(ModelHelper.ADD_ATTACHMENT_REQUEST_NAME, RestMethod.POST, "jredmine", "add_version_attachment.xml") {
private static final long serialVersionUID = 1L;
@Override
@@ -225,9 +167,9 @@
// issue scope requests
- addRequestBuilder(new IssueScopeRedmineRequestBuilder(GET_ISSUE_TIME_ENTRY_LIST, RestMethod.GET, "jredmine", "get_issue_times.xml"));
+ addRequestBuilder(new IssueScopeRedmineRequestBuilder(ModelHelper.GET_ALL_ISSUE_TIME_ENTRY_REQUEST_NAME, RestMethod.GET, "jredmine", "get_issue_times.xml"));
- addRequestBuilder(new IssueScopeRedmineRequestBuilder(ADD_ISSUE_TIME_ENTRY, RestMethod.POST, "jredmine", "add_issue_time.xml") {
+ addRequestBuilder(new IssueScopeRedmineRequestBuilder(ModelHelper.ADD_ISSUE_TIME_ENTRY_REQUEST_NAME, RestMethod.POST, "jredmine", "add_issue_time.xml") {
private static final long serialVersionUID = 1L;
@Override
Modified: trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRestClient.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRestClient.java 2012-07-13 16:30:51 UTC (rev 287)
+++ trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRestClient.java 2012-07-13 16:48:19 UTC (rev 288)
@@ -34,6 +34,7 @@
import org.nuiton.io.rest.RestClient;
import org.nuiton.io.rest.RestRequest;
import org.nuiton.io.rest.RestSession;
+import org.nuiton.jredmine.model.ModelHelper;
import org.nuiton.jredmine.model.Version;
import org.nuiton.jredmine.model.VersionStatusEnum;
@@ -86,7 +87,7 @@
if (session != null) {
try {
- RestRequest request = getRequest(RedmineRequestFactoryImpl.LOGOUT);
+ RestRequest request = getRequest(ModelHelper.LOGOUT_REQUEST_NAME);
session.setOpen(false);
session.doRequest(request);
} finally {
@@ -99,7 +100,7 @@
try {
- RestRequest request = getRequest(RedmineRequestFactoryImpl.PING);
+ RestRequest request = getRequest(ModelHelper.PING_REQUEST_NAME);
HttpMethod gm = session.doRequest(request);
StatusLine sl = gm.getStatusLine();
@@ -134,7 +135,7 @@
public void login(RestSession session) throws IOException {
- RestRequest request = getRequest(RedmineRequestFactoryImpl.LOGIN,
+ RestRequest request = getRequest(ModelHelper.LOGIN_REQUEST_NAME,
configuration.getRestUsername(),
configuration.getRestPassword());
@@ -147,7 +148,7 @@
}
if (statusCode != HttpStatus.SC_OK &&
- statusCode!= HttpStatus.SC_MOVED_TEMPORARILY) {
+ statusCode != HttpStatus.SC_MOVED_TEMPORARILY) {
gm.releaseConnection();
throw new IOException(
"Got error code <" + statusCode + ":" +
Modified: trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImpl.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImpl.java 2012-07-13 16:30:51 UTC (rev 287)
+++ trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImpl.java 2012-07-13 16:48:19 UTC (rev 288)
@@ -32,6 +32,7 @@
import org.nuiton.jredmine.RedmineServiceException;
import org.nuiton.jredmine.RedmineServiceImplementor;
import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.ModelHelper;
import org.nuiton.jredmine.model.News;
import org.nuiton.jredmine.model.Project;
import org.nuiton.jredmine.model.TimeEntry;
@@ -63,7 +64,7 @@
@Override
public Project[] getUserProjects() throws RedmineServiceException {
checkLoggued();
- Project[] result = getDatas(RedmineRequestFactoryImpl.GET_USER_PROJECTS, Project.class);
+ Project[] result = getDatas(ModelHelper.GET_USER_PROJECTS_REQUEST_NAME, Project.class);
return result;
}
@@ -72,7 +73,7 @@
Version version) throws RedmineServiceException {
// send data and obtain created version
- Version result = sendData(RedmineRequestFactoryImpl.ADD_VERSION,
+ Version result = sendData(ModelHelper.ADD_VERSION_REQUEST_NAME,
Version.class,
projectName,
version
@@ -85,7 +86,7 @@
Version version) throws RedmineServiceException {
// send data and obtain updated version
- Version result = sendData(RedmineRequestFactoryImpl.UPDATE_VERSION,
+ Version result = sendData(ModelHelper.UPDATE_VERSION_REQUEST_NAME,
Version.class,
projectName,
version
@@ -99,7 +100,7 @@
Version newVersion) throws RedmineServiceException {
// send data and obtain updated or created new version
- Version result = sendData(RedmineRequestFactoryImpl.NEXT_VERSION,
+ Version result = sendData(ModelHelper.NEXT_VERSION_REQUEST_NAME,
Version.class,
projectName,
newVersion,
@@ -114,7 +115,7 @@
Attachment attachement) throws RedmineServiceException {
// send data and obtain created attachment
- Attachment result = sendData(RedmineRequestFactoryImpl.ADD_ATTACHMENT,
+ Attachment result = sendData(ModelHelper.ADD_ATTACHMENT_REQUEST_NAME,
Attachment.class,
projectName,
versionName,
@@ -127,7 +128,7 @@
public News addNews(String projectName,
News news) throws RedmineServiceException {
// send data and obtain created news
- News result = sendData(RedmineRequestFactoryImpl.ADD_NEWS,
+ News result = sendData(ModelHelper.ADD_NEWS_REQUEST_NAME,
News.class,
projectName,
news
@@ -140,7 +141,7 @@
String issueId,
TimeEntry entry) throws RedmineServiceException {
// send data and obtain updated version
- TimeEntry result = sendData(RedmineRequestFactoryImpl.ADD_ISSUE_TIME_ENTRY,
+ TimeEntry result = sendData(ModelHelper.ADD_ISSUE_TIME_ENTRY_REQUEST_NAME,
TimeEntry.class,
projectName,
issueId,
Modified: trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceProviderImpl.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceProviderImpl.java 2012-07-13 16:30:51 UTC (rev 287)
+++ trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceProviderImpl.java 2012-07-13 16:48:19 UTC (rev 288)
@@ -9,8 +9,8 @@
* Implmentation of {@link RedmineServiceProvider} for this module.
*
* @author tchemit <chemit(a)codelutin.com>
+ * @plexus.component role="org.nuiton.jredmine.RedmineServiceProvider" role-hint="1.3.x"
* @since 1.4
- @plexus.component role="org.nuiton.jredmine.RedmineServiceProvider" role-hint="1.3.x"
*/
public class RedmineServiceProviderImpl implements RedmineServiceProvider {
Modified: trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceAsAnonymousTest.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceAsAnonymousTest.java 2012-07-13 16:30:51 UTC (rev 287)
+++ trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceAsAnonymousTest.java 2012-07-13 16:48:19 UTC (rev 288)
@@ -28,7 +28,7 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 1.5
*/
-public class RedmineServiceAsAnonymousTest {
+public class RedmineServiceAsAnonymousTest {
protected static final RedmineFixtures fixtures = new RedmineFixtures();
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/ModelHelper.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/ModelHelper.java 2012-07-13 16:30:51 UTC (rev 287)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/ModelHelper.java 2012-07-13 16:48:19 UTC (rev 288)
@@ -23,6 +23,9 @@
* #L%
*/
+import org.nuiton.io.rest.RestRequestBuilder;
+import org.nuiton.jredmine.request.DefaultRedmineRequestBuilder;
+
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
@@ -37,6 +40,75 @@
*/
public class ModelHelper {
+ public static final String GET_ALL_ISSUES_REQUEST_NAME = Issue.class.getName() + "/all";
+
+ public static final String GET_ALL_ISSUE_STATUS_REQUEST_NAME = IssueStatus.class.getName() + "/all";
+
+ public static final String GET_ALL_ISSUE_PRIORITY_REQUEST_NAME = IssuePriority.class.getName() + "/all";
+
+ public static final String GET_ALL_ISSUE_CATEGORY_REQUEST_NAME = IssueCategory.class.getName() + "/all";
+
+ public static final String GET_ALL_ISSUE_TIME_ENTRY_REQUEST_NAME = TimeEntry.class.getName() + "/all";
+
+ public static final String GET_ALL_PROJECT_REQUEST_NAME = Project.class.getName() + "/all";
+
+ public static final String GET_ALL_PROJECT_ISSUES_REQUEST_NAME = Project.class.getName() + "/all";
+
+ public static final String GET_ALL_PROJECT_OPENED_ISSUES_REQUEST_NAME = Project.class.getName() + "/opened-issues";
+
+ public static final String GET_ALL_PROJECT_CLOSED_ISSUES_REQUEST_NAME = Project.class.getName() + "/closed-issues";
+
+ public static final String GET_USER_PROJECTS_REQUEST_NAME = Project.class.getName() + "/forUser";
+
+ public static final String GET_PROJECT_REQUEST_NAME = Project.class.getName() + "/detail";
+
+ public static final String GET_ALL_VERSION_REQUEST_NAME = Version.class.getName() + "/all";
+
+ public static final String GET_ALL_TRACKER_REQUEST_NAME = Tracker.class.getName() + "/all";
+
+ public static final String GET_ALL_ATTACHMENTS_REQUEST_NAME = Attachment.class.getName() + "/all";
+
+ public static final String GET_ALL_USER_REQUEST_NAME = User.class.getName() + "/all";
+
+ public static final String GET_ALL_NEWS_REQUEST_NAME = News.class.getName() + "/all";
+
+ public static final String GET_VERSION_REQUEST_NAME = Version.class.getName() + "/detail";
+
+ public static final String ADD_VERSION_REQUEST_NAME = Version.class.getName() + "/add";
+
+ public static final String UPDATE_VERSION_REQUEST_NAME = Version.class.getName() + "/update";
+
+ public static final String NEXT_VERSION_REQUEST_NAME = Version.class.getName() + "/next";
+
+ public static final String ADD_NEWS_REQUEST_NAME = News.class.getName() + "/add";
+
+ public static final String ADD_ATTACHMENT_REQUEST_NAME = Attachment.class.getName() + "/add";
+
+ public static final String ADD_ISSUE_TIME_ENTRY_REQUEST_NAME = TimeEntry.class.getName() + "/add";
+
+ public static final String LOGIN_REQUEST_NAME = "login";
+
+ public static final String LOGOUT_REQUEST_NAME = "logout";
+
+ public static final String PING_REQUEST_NAME = "ping";
+
+ public static final String VERSION_SCOPE = "version";
+
+ public static final String PROJECT_SCOPE = "project";
+
+ public static final String ISSUE_SCOPE = "issue";
+
+ public static String getRequestScope(RestRequestBuilder requestBuilder) {
+ String scope;
+ if (requestBuilder instanceof DefaultRedmineRequestBuilder) {
+
+ scope = ((DefaultRedmineRequestBuilder) requestBuilder).getScope();
+ } else {
+ scope = null;
+ }
+ return scope;
+ }
+
public static <T extends IdAble> T byId(int id, T... datas) {
for (T data : datas) {
if (data.getId() == id) {
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/DefaultRedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/DefaultRedmineRequestBuilder.java 2012-07-13 16:30:51 UTC (rev 287)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/DefaultRedmineRequestBuilder.java 2012-07-13 16:48:19 UTC (rev 288)
@@ -50,7 +50,9 @@
protected final RestMethod method;
- public DefaultRedmineRequestBuilder(String name, RestMethod method, String... action) {
+ public DefaultRedmineRequestBuilder(String name,
+ RestMethod method,
+ String... action) {
this.name = name;
this.action = action;
this.method = method;
@@ -61,6 +63,10 @@
return name;
}
+ public String getScope() {
+ return null;
+ }
+
/**
* Compute a array of pair (key-value) from the given arguments.
* <p/>
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/IssueScopeRedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/IssueScopeRedmineRequestBuilder.java 2012-07-13 16:30:51 UTC (rev 287)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/IssueScopeRedmineRequestBuilder.java 2012-07-13 16:48:19 UTC (rev 288)
@@ -24,6 +24,7 @@
*/
import org.nuiton.io.rest.RestMethod;
+import org.nuiton.jredmine.model.ModelHelper;
/**
* To build request with a project and issue scope.
@@ -35,10 +36,16 @@
private static final long serialVersionUID = 1L;
- public IssueScopeRedmineRequestBuilder(String name, RestMethod method, String... action) {
+ public IssueScopeRedmineRequestBuilder(String name,
+ RestMethod method,
+ String... action) {
super(name, method, action);
}
+ public String getScope() {
+ return ModelHelper.ISSUE_SCOPE;
+ }
+
@Override
public String[] getParameters(Object... args) {
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/ProjectScopeRedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/ProjectScopeRedmineRequestBuilder.java 2012-07-13 16:30:51 UTC (rev 287)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/ProjectScopeRedmineRequestBuilder.java 2012-07-13 16:48:19 UTC (rev 288)
@@ -24,6 +24,7 @@
*/
import org.nuiton.io.rest.RestMethod;
+import org.nuiton.jredmine.model.ModelHelper;
/**
* To build request with a project scope.
@@ -35,10 +36,16 @@
private static final long serialVersionUID = 1L;
- public ProjectScopeRedmineRequestBuilder(String name,RestMethod method, String... action) {
- super(name,method, action);
+ public ProjectScopeRedmineRequestBuilder(String name,
+ RestMethod method,
+ String... action) {
+ super(name, method, action);
}
+ public String getScope() {
+ return ModelHelper.PROJECT_SCOPE;
+ }
+
@Override
public String[] getPath(Object... args) {
@@ -46,7 +53,7 @@
String projectName = (String) args[0];
- String[] result = new String[action.length+1];
+ String[] result = new String[action.length + 1];
System.arraycopy(action, 0, result, 0, action.length);
result[action.length] = projectName;
return result;
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/VersionScopeRedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/VersionScopeRedmineRequestBuilder.java 2012-07-13 16:30:51 UTC (rev 287)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/request/VersionScopeRedmineRequestBuilder.java 2012-07-13 16:48:19 UTC (rev 288)
@@ -24,6 +24,7 @@
*/
import org.nuiton.io.rest.RestMethod;
+import org.nuiton.jredmine.model.ModelHelper;
/**
* To build request with a project and version scope.
@@ -35,10 +36,16 @@
private static final long serialVersionUID = 1L;
- public VersionScopeRedmineRequestBuilder(String name,RestMethod method, String... action) {
- super(name, method,action);
+ public VersionScopeRedmineRequestBuilder(String name,
+ RestMethod method,
+ String... action) {
+ super(name, method, action);
}
+ public String getScope() {
+ return ModelHelper.VERSION_SCOPE;
+ }
+
@Override
public String[] getParameters(Object... args) {
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java 2012-07-13 16:30:51 UTC (rev 287)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java 2012-07-13 16:48:19 UTC (rev 288)
@@ -26,6 +26,7 @@
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
+import org.apache.commons.collections.CollectionUtils;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
@@ -44,9 +45,6 @@
import org.nuiton.jredmine.model.Tracker;
import org.nuiton.jredmine.model.User;
import org.nuiton.jredmine.model.Version;
-import org.nuiton.jredmine.request.ProjectScopeRedmineRequestBuilder;
-import org.nuiton.jredmine.request.VersionScopeRedmineRequestBuilder;
-import org.nuiton.jredmine.v1_3_x.RedmineRequestFactoryImpl;
import org.nuiton.plugin.PluginHelper;
import java.util.Arrays;
@@ -66,10 +64,6 @@
@Mojo(name = "display-data", requiresOnline = true, requiresProject = true)
public class DisplayDataMojo extends AbstractRedmineMojo {
- public static final String VERSION_SCOPE = "version";
-
- public static final String PROJECT_SCOPE = "project";
-
/**
* The data types to display : {@code issueSatus}, {@code issuePriority},
* {@code issueCategory}, {@code tracker} and {@code user}.
@@ -119,15 +113,15 @@
public DisplayDataMojo() {
super(false, false, false);
typesToRequestName = Maps.newHashMap();
- typesToRequestName.put(Project.class, RedmineRequestFactoryImpl.GET_PROJECT_LIST);
- typesToRequestName.put(Version.class, RedmineRequestFactoryImpl.GET_VERSION_LIST);
- typesToRequestName.put(Issue.class, RedmineRequestFactoryImpl.GET_ISSUE_LIST);
- typesToRequestName.put(News.class, RedmineRequestFactoryImpl.GET_NEWS_LIST);
- typesToRequestName.put(IssueStatus.class, RedmineRequestFactoryImpl.GET_ISSUE_STATUS_LIST);
- typesToRequestName.put(IssuePriority.class, RedmineRequestFactoryImpl.GET_ISSUE_PRIORITY_LIST);
- typesToRequestName.put(IssueCategory.class, RedmineRequestFactoryImpl.GET_ISSUE_CATEGORY_LIST);
- typesToRequestName.put(Tracker.class, RedmineRequestFactoryImpl.GET_TRACKER_LIST);
- typesToRequestName.put(User.class, RedmineRequestFactoryImpl.GET_USER_LIST);
+ typesToRequestName.put(Project.class, ModelHelper.GET_ALL_PROJECT_REQUEST_NAME);
+ typesToRequestName.put(Version.class, ModelHelper.GET_ALL_VERSION_REQUEST_NAME);
+ typesToRequestName.put(Issue.class, ModelHelper.GET_ALL_ISSUES_REQUEST_NAME);
+ typesToRequestName.put(News.class, ModelHelper.GET_ALL_NEWS_REQUEST_NAME);
+ typesToRequestName.put(IssueStatus.class, ModelHelper.GET_ALL_ISSUE_STATUS_REQUEST_NAME);
+ typesToRequestName.put(IssuePriority.class, ModelHelper.GET_ALL_ISSUE_PRIORITY_REQUEST_NAME);
+ typesToRequestName.put(IssueCategory.class, ModelHelper.GET_ALL_ISSUE_CATEGORY_REQUEST_NAME);
+ typesToRequestName.put(Tracker.class, ModelHelper.GET_ALL_TRACKER_REQUEST_NAME);
+ typesToRequestName.put(User.class, ModelHelper.GET_ALL_USER_REQUEST_NAME);
namesToType = Maps.newHashMap();
namesToType.put("project", Project.class);
@@ -184,7 +178,7 @@
@Override
protected boolean checkSkip() {
- if (actions == null || actions.isEmpty()) {
+ if (CollectionUtils.isEmpty(actions)) {
// no data to treate
getLog().warn("No data types detected, you must fill the required parameter types, will skip goal");
return false;
@@ -197,18 +191,16 @@
protected void doAction() throws Exception {
StringBuilder buffer = new StringBuilder("\n");
- RequestFactory requestFactory =
- ((RedmineServiceImplementor) service).getSession().getRequestFactory();
for (Class<?> type : actions) {
- String scope = getScope(requestFactory, type);
+ String scope = getDataScope(type);
String requestName = typesToRequestName.get(type);
IdAble[] datas;
- if (VERSION_SCOPE.equals(scope)) {
+ if (ModelHelper.VERSION_SCOPE.equals(scope)) {
datas = (IdAble[]) ((RedmineServiceImplementor) service).getDatas(requestName, type, projectId, versionId);
- } else if (PROJECT_SCOPE.equals(scope)) {
+ } else if (ModelHelper.PROJECT_SCOPE.equals(scope)) {
datas = (IdAble[]) ((RedmineServiceImplementor) service).getDatas(requestName, type, projectId);
} else {
datas = (IdAble[]) ((RedmineServiceImplementor) service).getDatas(requestName, type);
@@ -218,46 +210,30 @@
Collections.sort(list, ModelHelper.ID_ABLE_COMPARATOR);
}
buffer.append("\nValues of '").append(requestName).append('\'');
- if (VERSION_SCOPE.equals(scope) || PROJECT_SCOPE.equals(scope)) {
+ if (ModelHelper.VERSION_SCOPE.equals(scope) || ModelHelper.PROJECT_SCOPE.equals(scope)) {
buffer.append(" for project '").append(projectId).append("'");
}
- if (VERSION_SCOPE.equals(scope)) {
+ if (ModelHelper.VERSION_SCOPE.equals(scope)) {
buffer.append(" and version '").append(versionId).append("'");
}
buffer.append('\n');
for (IdAble data : list) {
- buffer.append(" - ").append(data.getId()).append(" = ").append(((I18nAble) data).getName()).append('\n');
+ buffer.append(" - ");
+ buffer.append(data.getId());
+ buffer.append(" = ");
+ buffer.append(((I18nAble) data).getName());
+ buffer.append('\n');
}
}
System.out.println(buffer.toString());
}
- protected String getScope(RequestFactory requestFactory, Class<?> type) {
- String scope;
-
- String requestName = typesToRequestName.get(type);
- RestRequestBuilder requestBuilder =
- requestFactory.getRequestBuilder(requestName);
-
- if (requestBuilder instanceof VersionScopeRedmineRequestBuilder) {
- scope = VERSION_SCOPE;
- } else if (requestBuilder instanceof ProjectScopeRedmineRequestBuilder) {
- scope = PROJECT_SCOPE;
- } else {
- scope = null;
- }
- return scope;
- }
-
protected List<Class<?>> getDownloadActions() throws MojoFailureException {
List<Class<?>> results = Lists.newArrayList();
List<Class<?>> universeList = Lists.newArrayList(typesToRequestName.keySet());
- RequestFactory requestFactory =
- ((RedmineServiceImplementor) service).getSession().getRequestFactory();
-
for (String dataType : types.split(",")) {
dataType = dataType.toLowerCase(Locale.ENGLISH);
@@ -266,22 +242,31 @@
if (result == null || !universeList.contains(result)) {
// can not accept these value
- throw new MojoFailureException("The data type '" + result + "' can not be used, Accepted types are : " + universeList);
+ throw new MojoFailureException(
+ "The data type '" + result +
+ "' can not be used, Accepted types are : " +
+ universeList);
}
- String scope = getScope(requestFactory, result);
+ String scope = getDataScope(result);
- if (VERSION_SCOPE.equals(scope) || PROJECT_SCOPE.equals(scope)) {
+ if (ModelHelper.VERSION_SCOPE.equals(scope) || ModelHelper.PROJECT_SCOPE.equals(scope)) {
// check projectId used
if (projectId == null || projectId.isEmpty()) {
- throw new MojoFailureException("The data type '" + result + "', depends on a project, but the 'projectId' was not filled.");
+ throw new MojoFailureException(
+ "The data type '" + result +
+ "', depends on a project, but the 'projectId' was " +
+ "not filled.");
}
}
- if (VERSION_SCOPE.equals(scope)) {
+ if (ModelHelper.VERSION_SCOPE.equals(scope)) {
// check versionId use
if (versionId == null || versionId.isEmpty()) {
- throw new MojoFailureException("The data type '" + result + "', depends on a version, but the 'versionId' was not filled.");
+ throw new MojoFailureException(
+ "The data type '" + result +
+ "', depends on a version, but the 'versionId' was " +
+ "not filled.");
}
}
results.add(result);
@@ -289,46 +274,20 @@
return results;
}
-// protected List<RedmineModelEnum> getDownloadActions(String dataTypes, RedmineModelEnum... universe) throws MojoFailureException {
-//
-// if (universe.length == 0) {
-// throw new MojoFailureException("List of accepted data types is empty!");
-// }
-//
-// List<RedmineModelEnum> results = new ArrayList<RedmineModelEnum>();
-//
-// List<RedmineModelEnum> universeList = new ArrayList<RedmineModelEnum>(Arrays.asList(universe));
-//
-// for (String dataType : dataTypes.split(",")) {
-//
-// RedmineModelEnum result;
-// try {
-// result = RedmineModelEnum.valueOf(dataType.trim());
-// } catch (Exception e) {
-// throw new MojoFailureException("Unkown data type '" + dataType + "', Accepted types are : " + universeList);
-// }
-// if (!universeList.contains(result)) {
-// // can not accept these value
-// throw new MojoFailureException("The data type '" + result + "' can not be used, Accepted types are : " + universeList);
-// }
-//
-// RedmineModelScope scope = result.getScope();
-//
-// if (scope == RedmineModelScope.project || scope == RedmineModelScope.version) {
-//
-// // check projectId used
-// if (projectId == null || projectId.isEmpty()) {
-// throw new MojoFailureException("The data type '" + result + "', depends on a project, but the 'projectId' was not filled.");
-// }
-// }
-// if (scope == RedmineModelScope.version) {
-// // check versionId use
-// if (versionId == null || versionId.isEmpty()) {
-// throw new MojoFailureException("The data type '" + result + "', depends on a version, but the 'versionId' was not filled.");
-// }
-// }
-// results.add(result);
-// }
-// return results;
-// }
+ protected String getDataScope(Class<?> type) {
+
+ RequestFactory requestFactory =
+ ((RedmineServiceImplementor) service).getSession().getRequestFactory();
+
+
+ String scope;
+
+ String requestName = typesToRequestName.get(type);
+ RestRequestBuilder requestBuilder =
+ requestFactory.getRequestBuilder(requestName);
+
+ return ModelHelper.getRequestScope(requestBuilder);
+ }
+
+
}
1
0
r287 - trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin
by tchemit@users.nuiton.org 13 Jul '12
by tchemit@users.nuiton.org 13 Jul '12
13 Jul '12
Author: tchemit
Date: 2012-07-13 18:30:51 +0200 (Fri, 13 Jul 2012)
New Revision: 287
Url: http://nuiton.org/repositories/revision/jredmine/287
Log:
misc
Modified:
trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/AbstractRedmineMojoTest.java
trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/FakeRedmineServiceConfiguration.java
trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/JRedminePluginFixtures.java
Modified: trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/AbstractRedmineMojoTest.java
===================================================================
--- trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/AbstractRedmineMojoTest.java 2012-07-13 16:30:43 UTC (rev 286)
+++ trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/AbstractRedmineMojoTest.java 2012-07-13 16:30:51 UTC (rev 287)
@@ -24,8 +24,6 @@
*/
package org.nuiton.jredmine.plugin;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.maven.model.IssueManagement;
import org.codehaus.plexus.util.StringUtils;
import org.junit.After;
@@ -50,10 +48,6 @@
public abstract class AbstractRedmineMojoTest<P extends AbstractRedmineMojo>
extends AbstractMojoTest<P> {
- /** Logger */
- private static final Log log =
- LogFactory.getLog(AbstractRedmineMojoTest.class);
-
/**
* Fixtures for tests.
*
Modified: trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/FakeRedmineServiceConfiguration.java
===================================================================
--- trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/FakeRedmineServiceConfiguration.java 2012-07-13 16:30:43 UTC (rev 286)
+++ trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/FakeRedmineServiceConfiguration.java 2012-07-13 16:30:51 UTC (rev 287)
@@ -1,7 +1,7 @@
package org.nuiton.jredmine.plugin;
-import org.apache.commons.lang.builder.ToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
import org.nuiton.jredmine.RedmineServiceConfiguration;
import java.net.URL;
Modified: trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/JRedminePluginFixtures.java
===================================================================
--- trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/JRedminePluginFixtures.java 2012-07-13 16:30:43 UTC (rev 286)
+++ trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/JRedminePluginFixtures.java 2012-07-13 16:30:51 UTC (rev 287)
@@ -2,7 +2,7 @@
import com.google.common.base.Charsets;
import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.maven.model.IssueManagement;
1
0
Author: tchemit
Date: 2012-07-13 18:30:43 +0200 (Fri, 13 Jul 2012)
New Revision: 286
Url: http://nuiton.org/repositories/revision/jredmine/286
Log:
refs #926: Use m-plugin-p 3 api (fix dependency to annotations)
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-07-13 16:30:03 UTC (rev 285)
+++ trunk/pom.xml 2012-07-13 16:30:43 UTC (rev 286)
@@ -262,7 +262,15 @@
<scope>provided</scope>
</dependency>
+ <!-- dependencies to mojo annotations -->
<dependency>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-annotations</artifactId>
+ <version>${pluginPluginVersion}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-api</artifactId>
<version>3.0</version>
1
0
r285 - trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report
by tchemit@users.nuiton.org 13 Jul '12
by tchemit@users.nuiton.org 13 Jul '12
13 Jul '12
Author: tchemit
Date: 2012-07-13 18:30:03 +0200 (Fri, 13 Jul 2012)
New Revision: 285
Url: http://nuiton.org/repositories/revision/jredmine/285
Log:
refs #926: Use m-plugin-p 3 api (fix for one report)
Modified:
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByStatus.java
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByStatus.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByStatus.java 2012-07-13 16:29:42 UTC (rev 284)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByStatus.java 2012-07-13 16:30:03 UTC (rev 285)
@@ -33,7 +33,6 @@
* Generates a report for issues from Redmine's server group by status.
*
* @author tchemit <chemit(a)codelutin.com>
- * @goal issues-report-by-status
* @since 1.0.0
*/
@Mojo(name = "issues-report-by-status", requiresOnline = true, requiresProject = true, requiresReports = true)
1
0
r284 - in trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine: . plugin
by tchemit@users.nuiton.org 13 Jul '12
by tchemit@users.nuiton.org 13 Jul '12
13 Jul '12
Author: tchemit
Date: 2012-07-13 18:29:42 +0200 (Fri, 13 Jul 2012)
New Revision: 284
Url: http://nuiton.org/repositories/revision/jredmine/284
Log:
remove usage of dummy enums
Removed:
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/model/
Modified:
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java 2012-07-13 16:29:20 UTC (rev 283)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java 2012-07-13 16:29:42 UTC (rev 284)
@@ -24,21 +24,36 @@
*/
package org.nuiton.jredmine.plugin;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
+import org.nuiton.io.rest.RequestFactory;
+import org.nuiton.io.rest.RestRequestBuilder;
import org.nuiton.jredmine.RedmineServiceImplementor;
import org.nuiton.jredmine.model.I18nAble;
import org.nuiton.jredmine.model.IdAble;
+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.ModelHelper;
-import org.nuiton.jredmine.model.RedmineModelEnum;
-import org.nuiton.jredmine.model.RedmineModelScope;
+import org.nuiton.jredmine.model.News;
+import org.nuiton.jredmine.model.Project;
+import org.nuiton.jredmine.model.Tracker;
+import org.nuiton.jredmine.model.User;
+import org.nuiton.jredmine.model.Version;
+import org.nuiton.jredmine.request.ProjectScopeRedmineRequestBuilder;
+import org.nuiton.jredmine.request.VersionScopeRedmineRequestBuilder;
+import org.nuiton.jredmine.v1_3_x.RedmineRequestFactoryImpl;
import org.nuiton.plugin.PluginHelper;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+import java.util.Locale;
+import java.util.Map;
/**
* Display in console some data from redmine's server.
@@ -51,6 +66,10 @@
@Mojo(name = "display-data", requiresOnline = true, requiresProject = true)
public class DisplayDataMojo extends AbstractRedmineMojo {
+ public static final String VERSION_SCOPE = "version";
+
+ public static final String PROJECT_SCOPE = "project";
+
/**
* The data types to display : {@code issueSatus}, {@code issuePriority},
* {@code issueCategory}, {@code tracker} and {@code user}.
@@ -91,10 +110,35 @@
protected boolean anonymous;
/** list of actions to perform */
- protected List<RedmineModelEnum> actions;
+ protected List<Class<?>> actions;
+ private final Map<Class<?>, String> typesToRequestName;
+
+ private final Map<String, Class<?>> namesToType;
+
public DisplayDataMojo() {
super(false, false, false);
+ typesToRequestName = Maps.newHashMap();
+ typesToRequestName.put(Project.class, RedmineRequestFactoryImpl.GET_PROJECT_LIST);
+ typesToRequestName.put(Version.class, RedmineRequestFactoryImpl.GET_VERSION_LIST);
+ typesToRequestName.put(Issue.class, RedmineRequestFactoryImpl.GET_ISSUE_LIST);
+ typesToRequestName.put(News.class, RedmineRequestFactoryImpl.GET_NEWS_LIST);
+ typesToRequestName.put(IssueStatus.class, RedmineRequestFactoryImpl.GET_ISSUE_STATUS_LIST);
+ typesToRequestName.put(IssuePriority.class, RedmineRequestFactoryImpl.GET_ISSUE_PRIORITY_LIST);
+ typesToRequestName.put(IssueCategory.class, RedmineRequestFactoryImpl.GET_ISSUE_CATEGORY_LIST);
+ typesToRequestName.put(Tracker.class, RedmineRequestFactoryImpl.GET_TRACKER_LIST);
+ typesToRequestName.put(User.class, RedmineRequestFactoryImpl.GET_USER_LIST);
+
+ namesToType = Maps.newHashMap();
+ namesToType.put("project", Project.class);
+ namesToType.put("version", Version.class);
+ namesToType.put("issue", Issue.class);
+ namesToType.put("news", News.class);
+ namesToType.put("issuestatus", IssueStatus.class);
+ namesToType.put("issuepriority", IssuePriority.class);
+ namesToType.put("issuecategory", IssueCategory.class);
+ namesToType.put("tracker", Tracker.class);
+ namesToType.put("user", User.class);
}
@Override
@@ -120,16 +164,7 @@
versionId = PluginHelper.removeSnapshotSuffix(versionId);
}
- actions = getDownloadActions(types,
- RedmineModelEnum.project,
- RedmineModelEnum.version,
- RedmineModelEnum.issue,
- RedmineModelEnum.news,
- RedmineModelEnum.issueStatus,
- RedmineModelEnum.issuePriority,
- RedmineModelEnum.issueCategory,
- RedmineModelEnum.tracker,
- RedmineModelEnum.user);
+ actions = getDownloadActions();
if (actions == null || actions.isEmpty()) {
// no need to connect, nothing to do...
return;
@@ -162,21 +197,31 @@
protected void doAction() throws Exception {
StringBuilder buffer = new StringBuilder("\n");
- for (RedmineModelEnum entry : actions) {
+ RequestFactory requestFactory =
+ ((RedmineServiceImplementor) service).getSession().getRequestFactory();
+ for (Class<?> type : actions) {
- RedmineModelScope scope = entry.getScope();
+ String scope = getScope(requestFactory, type);
+ String requestName = typesToRequestName.get(type);
- String requestName = entry.getRequestAll();
- IdAble[] datas = (IdAble[]) ((RedmineServiceImplementor) service).getDatas(requestName, entry.getModelType(), projectId, versionId);
+ IdAble[] datas;
+
+ if (VERSION_SCOPE.equals(scope)) {
+ datas = (IdAble[]) ((RedmineServiceImplementor) service).getDatas(requestName, type, projectId, versionId);
+ } else if (PROJECT_SCOPE.equals(scope)) {
+ datas = (IdAble[]) ((RedmineServiceImplementor) service).getDatas(requestName, type, projectId);
+ } else {
+ datas = (IdAble[]) ((RedmineServiceImplementor) service).getDatas(requestName, type);
+ }
List<IdAble> list = Arrays.asList(datas);
if (sortById) {
Collections.sort(list, ModelHelper.ID_ABLE_COMPARATOR);
}
- buffer.append("\nValues of '").append(entry).append('\'');
- if (scope == RedmineModelScope.project || scope == RedmineModelScope.version) {
+ buffer.append("\nValues of '").append(requestName).append('\'');
+ if (VERSION_SCOPE.equals(scope) || PROJECT_SCOPE.equals(scope)) {
buffer.append(" for project '").append(projectId).append("'");
}
- if (scope == RedmineModelScope.version) {
+ if (VERSION_SCOPE.equals(scope)) {
buffer.append(" and version '").append(versionId).append("'");
}
buffer.append('\n');
@@ -187,39 +232,53 @@
System.out.println(buffer.toString());
}
- protected List<RedmineModelEnum> getDownloadActions(String dataTypes, RedmineModelEnum... universe) throws MojoFailureException {
+ protected String getScope(RequestFactory requestFactory, Class<?> type) {
+ String scope;
- if (universe.length == 0) {
- throw new MojoFailureException("List of accepted data types is empty!");
+ String requestName = typesToRequestName.get(type);
+ RestRequestBuilder requestBuilder =
+ requestFactory.getRequestBuilder(requestName);
+
+ if (requestBuilder instanceof VersionScopeRedmineRequestBuilder) {
+ scope = VERSION_SCOPE;
+ } else if (requestBuilder instanceof ProjectScopeRedmineRequestBuilder) {
+ scope = PROJECT_SCOPE;
+ } else {
+ scope = null;
}
+ return scope;
+ }
- List<RedmineModelEnum> results = new ArrayList<RedmineModelEnum>();
+ protected List<Class<?>> getDownloadActions() throws MojoFailureException {
- List<RedmineModelEnum> universeList = new ArrayList<RedmineModelEnum>(Arrays.asList(universe));
+ List<Class<?>> results = Lists.newArrayList();
- for (String dataType : dataTypes.split(",")) {
+ List<Class<?>> universeList = Lists.newArrayList(typesToRequestName.keySet());
- RedmineModelEnum result;
- try {
- result = RedmineModelEnum.valueOf(dataType.trim());
- } catch (Exception e) {
- throw new MojoFailureException("Unkown data type '" + dataType + "', Accepted types are : " + universeList);
- }
- if (!universeList.contains(result)) {
+ RequestFactory requestFactory =
+ ((RedmineServiceImplementor) service).getSession().getRequestFactory();
+
+ for (String dataType : types.split(",")) {
+
+ dataType = dataType.toLowerCase(Locale.ENGLISH);
+
+ Class<?> result = namesToType.get(dataType);
+
+ if (result == null || !universeList.contains(result)) {
// can not accept these value
throw new MojoFailureException("The data type '" + result + "' can not be used, Accepted types are : " + universeList);
}
- RedmineModelScope scope = result.getScope();
+ String scope = getScope(requestFactory, result);
- if (scope == RedmineModelScope.project || scope == RedmineModelScope.version) {
+ if (VERSION_SCOPE.equals(scope) || PROJECT_SCOPE.equals(scope)) {
// check projectId used
if (projectId == null || projectId.isEmpty()) {
throw new MojoFailureException("The data type '" + result + "', depends on a project, but the 'projectId' was not filled.");
}
}
- if (scope == RedmineModelScope.version) {
+ if (VERSION_SCOPE.equals(scope)) {
// check versionId use
if (versionId == null || versionId.isEmpty()) {
throw new MojoFailureException("The data type '" + result + "', depends on a version, but the 'versionId' was not filled.");
@@ -229,4 +288,47 @@
}
return results;
}
+
+// protected List<RedmineModelEnum> getDownloadActions(String dataTypes, RedmineModelEnum... universe) throws MojoFailureException {
+//
+// if (universe.length == 0) {
+// throw new MojoFailureException("List of accepted data types is empty!");
+// }
+//
+// List<RedmineModelEnum> results = new ArrayList<RedmineModelEnum>();
+//
+// List<RedmineModelEnum> universeList = new ArrayList<RedmineModelEnum>(Arrays.asList(universe));
+//
+// for (String dataType : dataTypes.split(",")) {
+//
+// RedmineModelEnum result;
+// try {
+// result = RedmineModelEnum.valueOf(dataType.trim());
+// } catch (Exception e) {
+// throw new MojoFailureException("Unkown data type '" + dataType + "', Accepted types are : " + universeList);
+// }
+// if (!universeList.contains(result)) {
+// // can not accept these value
+// throw new MojoFailureException("The data type '" + result + "' can not be used, Accepted types are : " + universeList);
+// }
+//
+// RedmineModelScope scope = result.getScope();
+//
+// if (scope == RedmineModelScope.project || scope == RedmineModelScope.version) {
+//
+// // check projectId used
+// if (projectId == null || projectId.isEmpty()) {
+// throw new MojoFailureException("The data type '" + result + "', depends on a project, but the 'projectId' was not filled.");
+// }
+// }
+// if (scope == RedmineModelScope.version) {
+// // check versionId use
+// if (versionId == null || versionId.isEmpty()) {
+// throw new MojoFailureException("The data type '" + result + "', depends on a version, but the 'versionId' was not filled.");
+// }
+// }
+// results.add(result);
+// }
+// return results;
+// }
}
1
0
r283 - in trunk/jredmine-maven-plugin/src/it: multi report single skip-report
by tchemit@users.nuiton.org 13 Jul '12
by tchemit@users.nuiton.org 13 Jul '12
13 Jul '12
Author: tchemit
Date: 2012-07-13 18:29:20 +0200 (Fri, 13 Jul 2012)
New Revision: 283
Url: http://nuiton.org/repositories/revision/jredmine/283
Log:
remove invokers.properties when possible
Added:
trunk/jredmine-maven-plugin/src/it/multi/goals.txt
trunk/jredmine-maven-plugin/src/it/report/goals.txt
trunk/jredmine-maven-plugin/src/it/single/goals.txt
trunk/jredmine-maven-plugin/src/it/skip-report/goals.txt
Removed:
trunk/jredmine-maven-plugin/src/it/multi/invoker.properties
trunk/jredmine-maven-plugin/src/it/report/invoker.properties
trunk/jredmine-maven-plugin/src/it/single/invoker.properties
trunk/jredmine-maven-plugin/src/it/skip-report/invoker.properties
Added: trunk/jredmine-maven-plugin/src/it/multi/goals.txt
===================================================================
--- trunk/jredmine-maven-plugin/src/it/multi/goals.txt (rev 0)
+++ trunk/jredmine-maven-plugin/src/it/multi/goals.txt 2012-07-13 16:29:20 UTC (rev 283)
@@ -0,0 +1 @@
+clean install
\ No newline at end of file
Deleted: trunk/jredmine-maven-plugin/src/it/multi/invoker.properties
===================================================================
--- trunk/jredmine-maven-plugin/src/it/multi/invoker.properties 2012-07-13 16:28:57 UTC (rev 282)
+++ trunk/jredmine-maven-plugin/src/it/multi/invoker.properties 2012-07-13 16:29:20 UTC (rev 283)
@@ -1,45 +0,0 @@
-###
-# #%L
-# JRedmine :: Maven plugin
-#
-# $Id$
-# $HeadURL$
-# %%
-# 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%
-###
-# A comma or space separated list of goals/phases to execute, may
-# specify an empty list to execute the default goal of the IT project
-invoker.goals=clean install
-
-# Optionally, a list of goals to run during further invocations of Maven
-#invoker.goals.2=${project.groupId}:${project.artifactId}:${project.version}:run
-
-# A comma or space separated list of profiles to activate
-#invoker.profiles=run-all run-once
-
-# The value for the environment variable MAVEN_OPTS
-#invoker.mavenOpts=-Dfile.encoding=UTF-16 -Xms32m -Xmx256m
-
-# Possible values are "fail-fast" (default), "fail-at-end" and "fail-never"
-invoker.failureBehavior=fail-at-end
-
-# The expected result of the build, possible values are "success" (default) and "failure"
-#invoker.buildResult=success
-
-# A boolean value controlling the -N flag, defaults to "false"
-#invoker.nonRecursive=false
Added: trunk/jredmine-maven-plugin/src/it/report/goals.txt
===================================================================
--- trunk/jredmine-maven-plugin/src/it/report/goals.txt (rev 0)
+++ trunk/jredmine-maven-plugin/src/it/report/goals.txt 2012-07-13 16:29:20 UTC (rev 283)
@@ -0,0 +1 @@
+clean initialize site
\ No newline at end of file
Deleted: trunk/jredmine-maven-plugin/src/it/report/invoker.properties
===================================================================
--- trunk/jredmine-maven-plugin/src/it/report/invoker.properties 2012-07-13 16:28:57 UTC (rev 282)
+++ trunk/jredmine-maven-plugin/src/it/report/invoker.properties 2012-07-13 16:29:20 UTC (rev 283)
@@ -1,45 +0,0 @@
-###
-# #%L
-# JRedmine :: Maven plugin
-#
-# $Id$
-# $HeadURL$
-# %%
-# 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%
-###
-# A comma or space separated list of goals/phases to execute, may
-# specify an empty list to execute the default goal of the IT project
-invoker.goals=clean initialize site
-
-# Optionally, a list of goals to run during further invocations of Maven
-#invoker.goals.2=${project.groupId}:${project.artifactId}:${project.version}:run
-
-# A comma or space separated list of profiles to activate
-#invoker.profiles=its,jdk15
-
-# The value for the environment variable MAVEN_OPTS
-#invoker.mavenOpts=-Dfile.encoding=UTF-16 -Xms32m -Xmx256m
-
-# Possible values are "fail-fast" (default), "fail-at-end" and "fail-never"
-invoker.failureBehavior=fail-at-end
-
-# The expected result of the build, possible values are "success" (default) and "failure"
-#invoker.buildResult=success
-
-# A boolean value controlling the -N flag, defaults to "false"
-#invoker.nonRecursive=false
Added: trunk/jredmine-maven-plugin/src/it/single/goals.txt
===================================================================
--- trunk/jredmine-maven-plugin/src/it/single/goals.txt (rev 0)
+++ trunk/jredmine-maven-plugin/src/it/single/goals.txt 2012-07-13 16:29:20 UTC (rev 283)
@@ -0,0 +1 @@
+clean verify
\ No newline at end of file
Deleted: trunk/jredmine-maven-plugin/src/it/single/invoker.properties
===================================================================
--- trunk/jredmine-maven-plugin/src/it/single/invoker.properties 2012-07-13 16:28:57 UTC (rev 282)
+++ trunk/jredmine-maven-plugin/src/it/single/invoker.properties 2012-07-13 16:29:20 UTC (rev 283)
@@ -1,45 +0,0 @@
-###
-# #%L
-# JRedmine :: Maven plugin
-#
-# $Id$
-# $HeadURL$
-# %%
-# 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%
-###
-# A comma or space separated list of goals/phases to execute, may
-# specify an empty list to execute the default goal of the IT project
-invoker.goals=clean verify
-
-# Optionally, a list of goals to run during further invocations of Maven
-#invoker.goals.2=${project.groupId}:${project.artifactId}:${project.version}:run
-
-# A comma or space separated list of profiles to activate
-#invoker.profiles=its,jdk15
-
-# The value for the environment variable MAVEN_OPTS
-#invoker.mavenOpts=-Dfile.encoding=UTF-16 -Xms32m -Xmx256m
-
-# Possible values are "fail-fast" (default), "fail-at-end" and "fail-never"
-invoker.failureBehavior=fail-at-end
-
-# The expected result of the build, possible values are "success" (default) and "failure"
-#invoker.buildResult=success
-
-# A boolean value controlling the -N flag, defaults to "false"
-#invoker.nonRecursive=false
Added: trunk/jredmine-maven-plugin/src/it/skip-report/goals.txt
===================================================================
--- trunk/jredmine-maven-plugin/src/it/skip-report/goals.txt (rev 0)
+++ trunk/jredmine-maven-plugin/src/it/skip-report/goals.txt 2012-07-13 16:29:20 UTC (rev 283)
@@ -0,0 +1 @@
+clean initialize site
\ No newline at end of file
Deleted: trunk/jredmine-maven-plugin/src/it/skip-report/invoker.properties
===================================================================
--- trunk/jredmine-maven-plugin/src/it/skip-report/invoker.properties 2012-07-13 16:28:57 UTC (rev 282)
+++ trunk/jredmine-maven-plugin/src/it/skip-report/invoker.properties 2012-07-13 16:29:20 UTC (rev 283)
@@ -1,45 +0,0 @@
-###
-# #%L
-# JRedmine :: Maven plugin
-#
-# $Id$
-# $HeadURL$
-# %%
-# 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%
-###
-# A comma or space separated list of goals/phases to execute, may
-# specify an empty list to execute the default goal of the IT project
-invoker.goals=clean initialize site
-
-# Optionally, a list of goals to run during further invocations of Maven
-#invoker.goals.2=${project.groupId}:${project.artifactId}:${project.version}:run
-
-# A comma or space separated list of profiles to activate
-#invoker.profiles=its,jdk15
-
-# The value for the environment variable MAVEN_OPTS
-#invoker.mavenOpts=-Dfile.encoding=UTF-16 -Xms32m -Xmx256m
-
-# Possible values are "fail-fast" (default), "fail-at-end" and "fail-never"
-invoker.failureBehavior=fail-at-end
-
-# The expected result of the build, possible values are "success" (default) and "failure"
-#invoker.buildResult=success
-
-# A boolean value controlling the -N flag, defaults to "false"
-#invoker.nonRecursive=false
1
0
r282 - in trunk/jredmine-client-1.3.x/src: main/java/org/nuiton/jredmine/v1_3_x test/java/org/nuiton/jredmine/v1_3_x
by tchemit@users.nuiton.org 13 Jul '12
by tchemit@users.nuiton.org 13 Jul '12
13 Jul '12
Author: tchemit
Date: 2012-07-13 18:28:57 +0200 (Fri, 13 Jul 2012)
New Revision: 282
Url: http://nuiton.org/repositories/revision/jredmine/282
Log:
remove plexus usage + open api
Added:
trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceProviderImpl.java
Modified:
trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceImpl.java
trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRequestFactoryImpl.java
trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRestClient.java
trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImpl.java
trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImplementorImpl.java
trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineFixtures.java
Modified: trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceImpl.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceImpl.java 2012-07-13 16:27:10 UTC (rev 281)
+++ trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceImpl.java 2012-07-13 16:28:57 UTC (rev 282)
@@ -26,6 +26,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.nuiton.io.rest.RestClient;
import org.nuiton.jredmine.RedmineAnonymousService;
import org.nuiton.jredmine.RedmineServiceConfiguration;
import org.nuiton.jredmine.RedmineServiceException;
@@ -51,7 +52,6 @@
* Created: 2 janv. 2010
*
* @author tchemit <chemit(a)codelutin.com>
- * @plexus.component role="org.nuiton.jredmine.RedmineAnonymousService" role-hint="1.3.x"
* @see RedmineServiceConfiguration#isAnonymous()
* @since 1.0.3
*/
@@ -61,10 +61,10 @@
private static final Log log =
LogFactory.getLog(RedmineAnonymousServiceImpl.class);
- /** @plexus.requirement role="org.nuiton.jredmine.RedmineServiceImplementor" role-hint="1.3.x" */
protected RedmineServiceImplementor delegateImplementor;
public RedmineAnonymousServiceImpl() {
+ delegateImplementor = new RedmineServiceImplementorImpl();
}
///////////////////////////////////////////////////////////////////////////
@@ -219,6 +219,11 @@
}
@Override
+ public RestClient getSession() {
+ return delegateImplementor.getSession();
+ }
+
+ @Override
public int ping() {
return delegateImplementor.ping();
}
Modified: trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRequestFactoryImpl.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRequestFactoryImpl.java 2012-07-13 16:27:10 UTC (rev 281)
+++ trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRequestFactoryImpl.java 2012-07-13 16:28:57 UTC (rev 282)
@@ -30,7 +30,6 @@
* Factory of {@link RestRequest}.
*
* @author tchemit <chemit(a)codelutin.com>
- * @plexus.component role="org.nuiton.io.rest.RequestFactory" role-hint="1.3.x"
* @since 1.4
*/
public class RedmineRequestFactoryImpl extends AbstractRequestFactory {
@@ -92,11 +91,11 @@
// misc requests
-// addRequestBuilder(new DefaultRedmineRequestBuilder(PING, RestMethod.GET, "jredmine", "ping"));
- addRequestBuilder(new DefaultRedmineRequestBuilder(PING, RestMethod.GET, "projects"));
+ addRequestBuilder(new DefaultRedmineRequestBuilder(PING, RestMethod.GET, "jredmine", "ping"));
+// addRequestBuilder(new DefaultRedmineRequestBuilder(PING, RestMethod.GET, "projects"));
addRequestBuilder(new DefaultRedmineRequestBuilder(LOGOUT, RestMethod.GET, "jredmine", "logout"));
- addRequestBuilder(new DefaultRedmineRequestBuilder(LOGIN, RestMethod.POST, "login") {
-// addRequestBuilder(new DefaultRedmineRequestBuilder(LOGIN, RestMethod.POST, "jredmine", "login") {
+// addRequestBuilder(new DefaultRedmineRequestBuilder(LOGIN, RestMethod.POST, "login") {
+ addRequestBuilder(new DefaultRedmineRequestBuilder(LOGIN, RestMethod.POST, "jredmine", "login") {
private static final long serialVersionUID = 1L;
@@ -110,8 +109,8 @@
// data with no scope requests
-// addRequestBuilder(new DefaultRedmineRequestBuilder(GET_PROJECT_LIST, "jredmine", "get_projects.xml"));
- addRequestBuilder(new DefaultRedmineRequestBuilder(GET_PROJECT_LIST, RestMethod.GET, "projects.xml"));
+ addRequestBuilder(new DefaultRedmineRequestBuilder(GET_PROJECT_LIST, RestMethod.GET, "jredmine", "get_projects.xml"));
+// addRequestBuilder(new DefaultRedmineRequestBuilder(GET_PROJECT_LIST, RestMethod.GET, "projects.xml"));
addRequestBuilder(new DefaultRedmineRequestBuilder(GET_USER_PROJECTS, RestMethod.GET, "jredmine", "get_user_projects.xml"));
addRequestBuilder(new DefaultRedmineRequestBuilder(GET_ISSUE_STATUS_LIST, RestMethod.GET, "jredmine", "get_issue_statuses.xml"));
addRequestBuilder(new DefaultRedmineRequestBuilder(GET_ISSUE_PRIORITY_LIST, RestMethod.GET, "jredmine", "get_issue_priorities.xml"));
Modified: trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRestClient.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRestClient.java 2012-07-13 16:27:10 UTC (rev 281)
+++ trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRestClient.java 2012-07-13 16:28:57 UTC (rev 282)
@@ -32,7 +32,6 @@
import org.codehaus.plexus.util.StringUtils;
import org.nuiton.io.rest.RequestFactory;
import org.nuiton.io.rest.RestClient;
-import org.nuiton.io.rest.RestClientConfiguration;
import org.nuiton.io.rest.RestRequest;
import org.nuiton.io.rest.RestSession;
import org.nuiton.jredmine.model.Version;
@@ -47,7 +46,6 @@
* {@code redmine_rest} rails plugin.
*
* @author tchemit <chemit(a)codelutin.com>
- * @plexus.component role="org.nuiton.io.rest.RestClient" role-hint="1.3.x"
* @since 1.0.0
*/
public class RedmineRestClient extends RestClient {
@@ -57,7 +55,6 @@
/**
* To obtain redmine requests.
*
- * @plexus.requirement role="org.nuiton.io.rest.RequestFactory" role-hint="1.3.x"
* @since 1.4
*/
protected RequestFactory requestFactory;
@@ -65,12 +62,9 @@
public final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd");
public RedmineRestClient() {
+ requestFactory = new RedmineRequestFactoryImpl();
}
- public RedmineRestClient(RestClientConfiguration configuration) {
- super(configuration);
- }
-
@Override
public RequestFactory getRequestFactory() {
return requestFactory;
Modified: trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImpl.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImpl.java 2012-07-13 16:27:10 UTC (rev 281)
+++ trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImpl.java 2012-07-13 16:28:57 UTC (rev 282)
@@ -41,7 +41,6 @@
* Default {@link RedmineService} implementation based on a {@link RestClient}
*
* @author tchemit <chemit(a)codelutin.com>
- * @plexus.component role="org.nuiton.jredmine.RedmineService" role-hint="1.3.x"
* @since 1.0.0
*/
public class RedmineServiceImpl extends RedmineAnonymousServiceImpl implements RedmineService {
Modified: trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImplementorImpl.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImplementorImpl.java 2012-07-13 16:27:10 UTC (rev 281)
+++ trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImplementorImpl.java 2012-07-13 16:28:57 UTC (rev 282)
@@ -33,6 +33,7 @@
import org.nuiton.jredmine.RedmineServiceException;
import org.nuiton.jredmine.RedmineServiceImplementor;
import org.nuiton.jredmine.RedmineServiceLoginException;
+import org.nuiton.jredmine.model.io.xpp3.DefaultRedmineXpp3Helper;
import org.nuiton.jredmine.model.io.xpp3.RedmineXpp3Helper;
import java.io.IOException;
@@ -44,7 +45,6 @@
* Created: 2 janv. 2010
*
* @author tchemit <chemit(a)codelutin.com>
- * @plexus.component role="org.nuiton.jredmine.RedmineServiceImplementor" role-hint="1.3.x"
* @see RedmineServiceImplementor
* @since 1.0.3
*/
@@ -54,19 +54,11 @@
private static final Log log =
LogFactory.getLog(RedmineServiceImplementorImpl.class);
- /**
- * Client Rest.
- *
- * @plexus.requirement role="org.nuiton.io.rest.RestClient" role-hint="1.3.x"
- */
- protected RedmineRestClient session;
+ /** Client Rest. */
+ protected final RedmineRestClient session;
- /**
- * xpp3 xpp3Helper to transform xml stream to pojo.
- *
- * @plexus.requirement role="org.nuiton.jredmine.model.io.xpp3.RedmineXpp3Helper" role-hint="default"
- */
- protected RedmineXpp3Helper xpp3Helper;
+ /** xpp3 xpp3Helper to transform xml stream to pojo. */
+ protected final RedmineXpp3Helper xpp3Helper;
/** internal state to known if service was init */
protected boolean init;
@@ -79,12 +71,18 @@
log.debug("new " + this);
}
session = new RedmineRestClient();
+ xpp3Helper = new DefaultRedmineXpp3Helper();
}
///////////////////////////////////////////////////////////////////////////
/// RedmineServiceImplementor implementation
///////////////////////////////////////////////////////////////////////////
+
+ public RedmineRestClient getSession() {
+ return session;
+ }
+
@Override
public boolean isInit() {
return init;
@@ -109,7 +107,6 @@
"the client " + this + " was already opened!");
}
try {
- this.session = session;
if (!session.isOpen()) {
session.open();
Added: trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceProviderImpl.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceProviderImpl.java (rev 0)
+++ trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceProviderImpl.java 2012-07-13 16:28:57 UTC (rev 282)
@@ -0,0 +1,36 @@
+package org.nuiton.jredmine.v1_3_x;
+
+import org.nuiton.jredmine.RedmineAnonymousService;
+import org.nuiton.jredmine.RedmineService;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceProvider;
+
+/**
+ * Implmentation of {@link RedmineServiceProvider} for this module.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ @plexus.component role="org.nuiton.jredmine.RedmineServiceProvider" role-hint="1.3.x"
+ */
+public class RedmineServiceProviderImpl implements RedmineServiceProvider {
+
+ @Override
+ public String getRedmineVersion() {
+ return "1.3.x";
+ }
+
+ @Override
+ public boolean isRequireJRedminePlugin() {
+ return true;
+ }
+
+ @Override
+ public RedmineService newRedmineService(RedmineServiceConfiguration configuration) {
+ return new RedmineServiceImpl();
+ }
+
+ @Override
+ public RedmineAnonymousService newRedmineAnonymousService(RedmineServiceConfiguration configuration) {
+ return new RedmineAnonymousServiceImpl();
+ }
+}
Modified: trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineFixtures.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineFixtures.java 2012-07-13 16:27:10 UTC (rev 281)
+++ trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineFixtures.java 2012-07-13 16:28:57 UTC (rev 282)
@@ -23,7 +23,6 @@
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.DefaultRedmineXpp3Helper;
import org.nuiton.jredmine.model.io.xpp3.RedmineDataConverter;
import java.io.File;
@@ -90,12 +89,6 @@
public RedmineAnonymousService newRedmineAnonymousService(RedmineServiceConfiguration configuration)
throws IOException, RedmineServiceException {
RedmineAnonymousServiceImpl service = new RedmineAnonymousServiceImpl();
- RedmineServiceImplementorImpl implementor = new RedmineServiceImplementorImpl();
- RedmineRestClient restClient = new RedmineRestClient();
- restClient.requestFactory = new RedmineRequestFactoryImpl();
- implementor.xpp3Helper = new DefaultRedmineXpp3Helper();
- implementor.session = restClient;
- service.delegateImplementor = implementor;
service.init(configuration);
return service;
}
@@ -103,12 +96,6 @@
public RedmineService newRedmineService(RedmineServiceConfiguration configuration)
throws IOException, RedmineServiceException {
RedmineServiceImpl service = new RedmineServiceImpl();
- RedmineServiceImplementorImpl implementor = new RedmineServiceImplementorImpl();
- RedmineRestClient restClient = new RedmineRestClient();
- restClient.requestFactory = new RedmineRequestFactoryImpl();
- implementor.session = restClient;
- implementor.xpp3Helper = new DefaultRedmineXpp3Helper();
- service.delegateImplementor = implementor;
service.init(configuration);
return service;
}
1
0
r281 - in trunk/jredmine-client-api: . src/main/java/org/nuiton/jredmine src/main/java/org/nuiton/jredmine/model/io/xpp3
by tchemit@users.nuiton.org 13 Jul '12
by tchemit@users.nuiton.org 13 Jul '12
13 Jul '12
Author: tchemit
Date: 2012-07-13 18:27:10 +0200 (Fri, 13 Jul 2012)
New Revision: 281
Url: http://nuiton.org/repositories/revision/jredmine/281
Log:
remove plexus usage + open api
Added:
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineServiceProvider.java
Modified:
trunk/jredmine-client-api/pom.xml
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java
trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/DefaultRedmineXpp3Helper.java
Modified: trunk/jredmine-client-api/pom.xml
===================================================================
--- trunk/jredmine-client-api/pom.xml 2012-07-13 15:35:17 UTC (rev 280)
+++ trunk/jredmine-client-api/pom.xml 2012-07-13 16:27:10 UTC (rev 281)
@@ -110,25 +110,6 @@
</redmine.releaseFiles>
</properties>
- <build>
-
- <plugins>
- <!-- expose new plexus components -->
- <plugin>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-component-metadata</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>generate-metadata</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
-
- </build>
-
<reporting>
<excludeDefaults>true</excludeDefaults>
</reporting>
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java 2012-07-13 15:35:17 UTC (rev 280)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java 2012-07-13 16:27:10 UTC (rev 281)
@@ -23,6 +23,8 @@
* #L%
*/
+import org.nuiton.io.rest.RestClient;
+
/**
* Technical contract to implements a redmine service (will box the transport
* layer).
@@ -35,6 +37,8 @@
public interface RedmineServiceImplementor {
+ RestClient getSession();
+
/**
* Tests if the service is init (says method
* {@link #init(RedmineServiceConfiguration)} was invoked).
Added: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineServiceProvider.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineServiceProvider.java (rev 0)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/RedmineServiceProvider.java 2012-07-13 16:27:10 UTC (rev 281)
@@ -0,0 +1,43 @@
+package org.nuiton.jredmine;
+
+/**
+ * Define a provider of redmine client.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public interface RedmineServiceProvider {
+
+ /**
+ * @return the compatible version of redmine usable for this provider.
+ * @since 1.4
+ */
+ String getRedmineVersion();
+
+ /**
+ * Tells if the jredmine (redmine) plugin is required.
+ *
+ * @return {@code true} if the jredmine pluign is required.
+ * @since 1.4
+ */
+ boolean isRequireJRedminePlugin();
+
+ /**
+ * Instanciate a new redmine service.
+ *
+ * @param configuration the configuration use in redmine service
+ * @return a fresh redmine service
+ * @since 1.4
+ */
+ RedmineService newRedmineService(RedmineServiceConfiguration configuration);
+
+ /**
+ * Instanciate a new redmine anonymous service.
+ *
+ * @param configuration the configuration use in redmine service
+ * @return a fresh anonymous redmine service
+ * @since 1.4
+ */
+ RedmineAnonymousService newRedmineAnonymousService(RedmineServiceConfiguration configuration);
+
+}
Modified: trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/DefaultRedmineXpp3Helper.java
===================================================================
--- trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/DefaultRedmineXpp3Helper.java 2012-07-13 15:35:17 UTC (rev 280)
+++ trunk/jredmine-client-api/src/main/java/org/nuiton/jredmine/model/io/xpp3/DefaultRedmineXpp3Helper.java 2012-07-13 16:27:10 UTC (rev 281)
@@ -44,7 +44,6 @@
* Pour construire le modèle à partir de fichiers xml contenant les données.
*
* @author tchemit <chemit(a)codelutin.com>
- * @plexus.component role="org.nuiton.jredmine.model.io.xpp3.RedmineXpp3Helper" role-hint="default"
* @since 1.0.0
*/
public class DefaultRedmineXpp3Helper implements RedmineXpp3Helper {
1
0