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
r270 - in trunk/jredmine-domain: . src/main/java/org/nuiton/jredmine src/main/java/org/nuiton/jredmine/model src/main/java/org/nuiton/jredmine/model/io/xpp3 src/main/java/org/nuiton/jredmine/request src/site src/site/apt src/test/java/org/nuiton/jredmine src/test/java/org/nuiton/jredmine/model/io/xpp3 src/test/resources
by tchemit@users.nuiton.org 12 Jul '12
by tchemit@users.nuiton.org 12 Jul '12
12 Jul '12
Author: tchemit
Date: 2012-07-12 19:31:22 +0200 (Thu, 12 Jul 2012)
New Revision: 270
Url: http://nuiton.org/repositories/revision/jredmine/270
Log:
fix headers, svn properties + dependencies
Removed:
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/RedmineRequest.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/RedmineRequestBuilder.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/RedmineRequestFactory.java
Modified:
trunk/jredmine-domain/LICENSE.txt
trunk/jredmine-domain/README.txt
trunk/jredmine-domain/changelog.txt
trunk/jredmine-domain/pom.xml
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineAnonymousService.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineLogguedService.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineRestUnavailable.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineService.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceConfiguration.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceException.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceLoginException.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Attachment.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/CustomField.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/I18nAble.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IdAble.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Issue.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IssueCategory.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IssuePriority.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IssueStatus.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/ModelHelper.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/News.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Project.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/ProjectRef.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/TimeEntry.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Tracker.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/User.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/UserRef.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Version.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/VersionStatusEnum.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/AttachmentXpp3Reader.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/CustomFieldXpp3Reader.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/DefaultRedmineXpp3Helper.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueCategoryXpp3Reader.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssuePriorityXpp3Reader.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueStatusXpp3Reader.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueXpp3Reader.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/NewsXpp3Reader.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectRefXpp3Reader.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectXpp3Reader.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineDataConverter.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3Helper.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/TimeEntryXpp3Reader.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/TrackerXpp3Reader.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserRefXpp3Reader.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserXpp3Reader.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/VersionXpp3Reader.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/DefaultRedmineRequestBuilder.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/IssueScopeRedmineRequestBuilder.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/ProjectScopeRedmineRequestBuilder.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/VersionScopeRedmineRequestBuilder.java
trunk/jredmine-domain/src/site/apt/index.apt
trunk/jredmine-domain/src/site/site_fr.xml
trunk/jredmine-domain/src/test/java/org/nuiton/jredmine/RedmineFixtures.java
trunk/jredmine-domain/src/test/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3HelperTest.java
trunk/jredmine-domain/src/test/resources/log4j.properties
Property changes on: trunk/jredmine-domain/LICENSE.txt
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/jredmine-domain/README.txt
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/jredmine-domain/changelog.txt
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Modified: trunk/jredmine-domain/pom.xml
===================================================================
--- trunk/jredmine-domain/pom.xml 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/pom.xml 2012-07-12 17:31:22 UTC (rev 270)
@@ -3,7 +3,7 @@
#%L
JRedmine :: Client
- $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/pom.xml $
+ $HeadURL$
%%
Copyright (C) 2009 - 2010 Tony Chemit, CodeLutin
%%
@@ -50,16 +50,6 @@
</dependency>
<dependency>
- <groupId>com.sun.jersey.contribs</groupId>
- <artifactId>jersey-apache-client4</artifactId>
- </dependency>
-
- <dependency>
- <groupId>com.sun.jersey.contribs</groupId>
- <artifactId>jersey-multipart</artifactId>
- </dependency>
-
- <dependency>
<groupId>org.nuiton</groupId>
<artifactId>helper-maven-plugin</artifactId>
<scope>compile</scope>
@@ -83,18 +73,18 @@
</dependency>
<dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
</dependency>
<dependency>
Property changes on: trunk/jredmine-domain/pom.xml
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineAnonymousService.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineAnonymousService.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineAnonymousService.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,11 +1,11 @@
+package org.nuiton.jredmine;
/*
* #%L
- * JRedmine :: Client
- *
+ * JRedmine :: Client Api
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2009 - 2010 Tony Chemit, CodeLutin
+ * 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
@@ -22,7 +22,6 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L%
*/
-package org.nuiton.jredmine;
import org.nuiton.jredmine.model.Attachment;
import org.nuiton.jredmine.model.Issue;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineLogguedService.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineLogguedService.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineLogguedService.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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.nuiton.jredmine.model.Attachment;
import org.nuiton.jredmine.model.Issue;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineRestUnavailable.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineRestUnavailable.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineRestUnavailable.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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 java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
Property changes on: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineRestUnavailable.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineService.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineService.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineService.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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%
+ */
/**
* The full redmine service with anonymous and loggued methods.
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceConfiguration.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceConfiguration.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceConfiguration.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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.nuiton.io.rest.RestClientConfiguration;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceException.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceException.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceException.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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%
+ */
/**
* An exception to throw when something is wrong in a {@link RedmineService}.
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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.Preconditions;
import com.sun.jersey.api.client.UniformInterface;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceLoginException.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceLoginException.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceLoginException.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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%
+ */
/**
* An exception to be thrown when a problem with authentication state in a
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Attachment.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Attachment.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Attachment.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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 java.io.File;
import java.util.Date;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/CustomField.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/CustomField.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/CustomField.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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%
+ */
/**
* Represents a project custom field.
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/I18nAble.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/I18nAble.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/I18nAble.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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%
+ */
/**
* Alls object offers an name.
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IdAble.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IdAble.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IdAble.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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%
+ */
/**
* Alls object offers an id.
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Issue.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Issue.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Issue.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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 java.util.Date;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IssueCategory.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IssueCategory.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IssueCategory.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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%
+ */
/**
* @author tchemit <chemit(a)codelutin.com>
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IssuePriority.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IssuePriority.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IssuePriority.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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%
+ */
/**
* @author tchemit <chemit(a)codelutin.com>
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IssueStatus.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IssueStatus.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IssueStatus.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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%
+ */
/**
* @author tchemit <chemit(a)codelutin.com>
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/ModelHelper.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/ModelHelper.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/ModelHelper.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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 java.lang.reflect.Array;
import java.util.ArrayList;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/News.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/News.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/News.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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 java.util.Date;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Project.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Project.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Project.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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 java.util.Date;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/ProjectRef.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/ProjectRef.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/ProjectRef.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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%
+ */
/**
* TODO
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/TimeEntry.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/TimeEntry.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/TimeEntry.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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 java.util.Date;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Tracker.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Tracker.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Tracker.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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%
+ */
/**
* @author tchemit <chemit(a)codelutin.com>
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/User.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/User.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/User.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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 java.util.Date;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/UserRef.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/UserRef.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/UserRef.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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%
+ */
/**
* TODO
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Version.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Version.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Version.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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 java.util.Date;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/VersionStatusEnum.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/VersionStatusEnum.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/VersionStatusEnum.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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%
+ */
/**
* Possible values of a version status.
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/AttachmentXpp3Reader.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/AttachmentXpp3Reader.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/AttachmentXpp3Reader.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model.io.xpp3;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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.nuiton.io.xpp3.AbstractXpp3Reader;
import org.nuiton.jredmine.model.Attachment;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/CustomFieldXpp3Reader.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/CustomFieldXpp3Reader.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/CustomFieldXpp3Reader.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model.io.xpp3;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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.nuiton.io.xpp3.AbstractXpp3Reader;
import org.nuiton.jredmine.model.CustomField;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/DefaultRedmineXpp3Helper.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/DefaultRedmineXpp3Helper.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/DefaultRedmineXpp3Helper.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model.io.xpp3;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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.logging.Log;
import org.apache.commons.logging.LogFactory;
Property changes on: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/DefaultRedmineXpp3Helper.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueCategoryXpp3Reader.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueCategoryXpp3Reader.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueCategoryXpp3Reader.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model.io.xpp3;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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.nuiton.io.xpp3.AbstractXpp3Reader;
import org.nuiton.jredmine.model.Issue;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssuePriorityXpp3Reader.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssuePriorityXpp3Reader.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssuePriorityXpp3Reader.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model.io.xpp3;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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.nuiton.io.xpp3.AbstractXpp3Reader;
import org.nuiton.jredmine.model.Issue;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueStatusXpp3Reader.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueStatusXpp3Reader.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueStatusXpp3Reader.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model.io.xpp3;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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.nuiton.io.xpp3.AbstractXpp3Reader;
import org.nuiton.jredmine.model.Issue;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueXpp3Reader.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueXpp3Reader.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueXpp3Reader.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model.io.xpp3;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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.nuiton.io.xpp3.AbstractXpp3Reader;
import org.nuiton.jredmine.model.Issue;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/NewsXpp3Reader.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/NewsXpp3Reader.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/NewsXpp3Reader.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model.io.xpp3;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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.nuiton.io.xpp3.AbstractXpp3Reader;
import org.nuiton.jredmine.model.News;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectRefXpp3Reader.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectRefXpp3Reader.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectRefXpp3Reader.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model.io.xpp3;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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.nuiton.io.xpp3.AbstractXpp3Reader;
import org.nuiton.jredmine.model.Project;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectXpp3Reader.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectXpp3Reader.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectXpp3Reader.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model.io.xpp3;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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.nuiton.io.xpp3.AbstractXpp3Reader;
import org.nuiton.jredmine.model.CustomField;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineDataConverter.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineDataConverter.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineDataConverter.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model.io.xpp3;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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.nuiton.io.xpp3.DataConverter;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3Helper.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3Helper.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3Helper.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model.io.xpp3;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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.codehaus.plexus.util.xml.pull.XmlPullParserException;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/TimeEntryXpp3Reader.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/TimeEntryXpp3Reader.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/TimeEntryXpp3Reader.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model.io.xpp3;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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.nuiton.io.xpp3.AbstractXpp3Reader;
import org.nuiton.jredmine.model.TimeEntry;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/TrackerXpp3Reader.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/TrackerXpp3Reader.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/TrackerXpp3Reader.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model.io.xpp3;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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.nuiton.io.xpp3.AbstractXpp3Reader;
import org.nuiton.jredmine.model.Tracker;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserRefXpp3Reader.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserRefXpp3Reader.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserRefXpp3Reader.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model.io.xpp3;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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.nuiton.io.xpp3.AbstractXpp3Reader;
import org.nuiton.jredmine.model.Project;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserXpp3Reader.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserXpp3Reader.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserXpp3Reader.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model.io.xpp3;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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.nuiton.io.xpp3.AbstractXpp3Reader;
import org.nuiton.jredmine.model.User;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/VersionXpp3Reader.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/VersionXpp3Reader.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/VersionXpp3Reader.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.model.io.xpp3;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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.nuiton.io.xpp3.AbstractXpp3Reader;
import org.nuiton.jredmine.model.ProjectRef;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/DefaultRedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/DefaultRedmineRequestBuilder.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/DefaultRedmineRequestBuilder.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,7 +1,32 @@
package org.nuiton.jredmine.request;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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.Joiner;
-import org.apache.commons.lang.ArrayUtils;
+import org.apache.commons.lang3.ArrayUtils;
+import org.nuiton.io.rest.RestRequest;
+import org.nuiton.io.rest.RestRequestBuilder;
import java.io.File;
import java.net.URL;
@@ -11,11 +36,11 @@
* The default implementation of the redmine request builder.
*
* @author tchemit <chemit(a)codelutin.com>
- * @see RedmineRequestBuilder
- * @see RedmineRequest
+ * @see RestRequest
+ * @see RestRequestBuilder
* @since 1.4
*/
-public class DefaultRedmineRequestBuilder implements RedmineRequestBuilder {
+public class DefaultRedmineRequestBuilder implements RestRequestBuilder {
private static final long serialVersionUID = 1L;
@@ -62,9 +87,9 @@
}
@Override
- public RedmineRequest create(final Object... args) {
+ public RestRequest create(final Object... args) {
- return new RedmineRequest() {
+ return new RestRequest() {
@Override
public String[] getPath() {
Property changes on: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/DefaultRedmineRequestBuilder.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/IssueScopeRedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/IssueScopeRedmineRequestBuilder.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/IssueScopeRedmineRequestBuilder.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.request;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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%
+ */
/**
* To build request with a project and issue scope.
@@ -10,10 +33,6 @@
private static final long serialVersionUID = 1L;
- public IssueScopeRedmineRequestBuilder(String name, String action) {
- super(name, action);
- }
-
public IssueScopeRedmineRequestBuilder(String action) {
super(action);
}
Property changes on: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/IssueScopeRedmineRequestBuilder.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/ProjectScopeRedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/ProjectScopeRedmineRequestBuilder.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/ProjectScopeRedmineRequestBuilder.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.request;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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%
+ */
/**
* To build request with a project scope.
@@ -10,10 +33,6 @@
private static final long serialVersionUID = 1L;
- public ProjectScopeRedmineRequestBuilder(String name, String action) {
- super(name, action);
- }
-
public ProjectScopeRedmineRequestBuilder(String action) {
super(action);
}
Property changes on: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/ProjectScopeRedmineRequestBuilder.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/RedmineRequest.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/RedmineRequest.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/RedmineRequest.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,34 +0,0 @@
-package org.nuiton.jredmine.request;
-
-import java.io.File;
-import java.net.URL;
-import java.util.Map;
-
-/**
- * To define a redmine request.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.4
- */
-public interface RedmineRequest {
-
- /** @return the splitted path to add to url */
- String[] getPath();
-
- /**
- * @return an array of pair (parameter name - parameter value) to pass
- * to request
- */
- String[] getParameters();
-
- /** @return the map of attachment to pass to request */
- Map<String, File> getAttachments();
-
- /**
- * @return {@code true} if request has some attachments.
- * @since 1.4
- */
- boolean containsAttachments();
-
- String toPath(URL redmineUrl);
-}
Deleted: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/RedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/RedmineRequestBuilder.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/RedmineRequestBuilder.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,23 +0,0 @@
-package org.nuiton.jredmine.request;
-
-import java.io.Serializable;
-
-/**
- * The contract of a redmine request builder.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.4
- */
-public interface RedmineRequestBuilder extends Serializable {
-
- /** @return the unique name of the request builder */
- String getName();
-
- /**
- * Create the request given the {@code args}.
- *
- * @param args args to create the request
- * @return the created request
- */
- RedmineRequest create(Object... args);
-}
Deleted: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/RedmineRequestFactory.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/RedmineRequestFactory.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/RedmineRequestFactory.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,35 +0,0 @@
-package org.nuiton.jredmine.request;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-
-/**
- * Factory of {@link RedmineRequest}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.4
- */
-public interface RedmineRequestFactory {
-
- public static final DateFormat DATE_FORMAT =
- new SimpleDateFormat("yyyy-MM-dd");
-
- void addDefaultRequests();
-
- /**
- * Add a request into the factory.
- *
- * @param builder the new request to add
- */
- void addRequestBuilder(RedmineRequestBuilder builder);
-
- /**
- * Obtain a request given his id and the args given.
- *
- * @param id id of the request
- * @param args args passed to build the request
- * @return the new request
- */
- RedmineRequest getRequest(String id, Object... args);
-
-}
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/VersionScopeRedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/VersionScopeRedmineRequestBuilder.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/VersionScopeRedmineRequestBuilder.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,4 +1,27 @@
package org.nuiton.jredmine.request;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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%
+ */
/**
* To build request with a project and version scope.
@@ -10,10 +33,6 @@
private static final long serialVersionUID = 1L;
- public VersionScopeRedmineRequestBuilder(String name, String action) {
- super(name, action);
- }
-
public VersionScopeRedmineRequestBuilder(String action) {
super(action);
}
Property changes on: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/VersionScopeRedmineRequestBuilder.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/jredmine-domain/src/site/apt/index.apt
===================================================================
--- trunk/jredmine-domain/src/site/apt/index.apt 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/site/apt/index.apt 2012-07-12 17:31:22 UTC (rev 270)
@@ -3,7 +3,7 @@
~~ JRedmine :: Client
~~
~~ $Id$
-~~ $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/site/apt/index… $
+~~ $HeadURL$
~~ %%
~~ Copyright (C) 2009 - 2010 Tony Chemit, CodeLutin
~~ %%
Property changes on: trunk/jredmine-domain/src/site/apt/index.apt
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Modified: trunk/jredmine-domain/src/site/site_fr.xml
===================================================================
--- trunk/jredmine-domain/src/site/site_fr.xml 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/site/site_fr.xml 2012-07-12 17:31:22 UTC (rev 270)
@@ -4,7 +4,7 @@
JRedmine :: Client
$Id$
- $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/site/site_fr.x… $
+ $HeadURL$
%%
Copyright (C) 2009 - 2010 Tony Chemit, CodeLutin
%%
Property changes on: trunk/jredmine-domain/src/site/site_fr.xml
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Modified: trunk/jredmine-domain/src/test/java/org/nuiton/jredmine/RedmineFixtures.java
===================================================================
--- trunk/jredmine-domain/src/test/java/org/nuiton/jredmine/RedmineFixtures.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/test/java/org/nuiton/jredmine/RedmineFixtures.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -1,9 +1,30 @@
package org.nuiton.jredmine;
+/*
+ * #%L
+ * JRedmine :: Client Api
+ * $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.collect.ArrayListMultimap;
import org.apache.commons.io.FileUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.nuiton.jredmine.model.Attachment;
import org.nuiton.jredmine.model.Issue;
import org.nuiton.jredmine.model.IssueCategory;
@@ -30,9 +51,6 @@
*/
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";
Property changes on: trunk/jredmine-domain/src/test/java/org/nuiton/jredmine/RedmineFixtures.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Modified: trunk/jredmine-domain/src/test/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3HelperTest.java
===================================================================
--- trunk/jredmine-domain/src/test/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3HelperTest.java 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/test/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3HelperTest.java 2012-07-12 17:31:22 UTC (rev 270)
@@ -2,8 +2,8 @@
* #%L
* JRedmine :: Client
*
- * $Id: RedmineXpp3HelperTest.java 252 2012-03-25 14:37:37Z tchemit $
- * $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/test/java/org/… $
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2009 - 2010 Tony Chemit, CodeLutin
* %%
Property changes on: trunk/jredmine-domain/src/test/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3HelperTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/jredmine-domain/src/test/resources/log4j.properties
===================================================================
--- trunk/jredmine-domain/src/test/resources/log4j.properties 2012-07-12 14:04:57 UTC (rev 269)
+++ trunk/jredmine-domain/src/test/resources/log4j.properties 2012-07-12 17:31:22 UTC (rev 270)
@@ -2,8 +2,8 @@
# #%L
# JRedmine :: Client
#
-# $Id: log4j.properties 186 2011-05-20 12:32:08Z tchemit $
-# $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/test/resources… $
+# $Id$
+# $HeadURL$
# %%
# Copyright (C) 2009 - 2010 CodeLutin
# %%
Property changes on: trunk/jredmine-domain/src/test/resources/log4j.properties
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
1
0
r269 - in trunk/jredmine-client: . src/main/java/org/nuiton/jredmine src/main/java/org/nuiton/jredmine/request src/main/java/org/nuiton/jredmine/rest src/test/java/org/nuiton/jredmine src/test/java/org/nuiton/jredmine/rest src/test/resources
by tchemit@users.nuiton.org 12 Jul '12
by tchemit@users.nuiton.org 12 Jul '12
12 Jul '12
Author: tchemit
Date: 2012-07-12 16:04:57 +0200 (Thu, 12 Jul 2012)
New Revision: 269
Url: http://nuiton.org/repositories/revision/jredmine/269
Log:
commit old jredmine client to keep his implementation (but will be removed soon)
Added:
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/RedmineRequestFactoryImpl.java
trunk/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineFixtures.java
trunk/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineServiceJerseyTest.java
Modified:
trunk/jredmine-client/pom.xml
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineAnonymousService.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineService.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineServiceImplementor.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/rest/RedmineRestClient.java
trunk/jredmine-client/src/test/java/org/nuiton/jredmine/AbstractRedmineServiceTest.java
trunk/jredmine-client/src/test/java/org/nuiton/jredmine/DefaultRedmineServiceTest.java
trunk/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineAnonymousServiceJerseyTest.java
trunk/jredmine-client/src/test/java/org/nuiton/jredmine/TestHelper.java
trunk/jredmine-client/src/test/java/org/nuiton/jredmine/rest/RedmineRestClientTest.java
trunk/jredmine-client/src/test/resources/test-config.properties
Modified: trunk/jredmine-client/pom.xml
===================================================================
--- trunk/jredmine-client/pom.xml 2012-07-12 14:04:21 UTC (rev 268)
+++ trunk/jredmine-client/pom.xml 2012-07-12 14:04:57 UTC (rev 269)
@@ -23,7 +23,9 @@
#L%
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -43,11 +45,27 @@
<dependencies>
<dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>jredmine-domain</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
</dependency>
<dependency>
+ <groupId>com.sun.jersey.contribs</groupId>
+ <artifactId>jersey-apache-client4</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.sun.jersey.contribs</groupId>
+ <artifactId>jersey-multipart</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.nuiton</groupId>
<artifactId>helper-maven-plugin</artifactId>
<scope>compile</scope>
@@ -81,6 +99,11 @@
</dependency>
<dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</dependency>
@@ -98,19 +121,9 @@
</dependencies>
- <!-- ************************************************************* -->
- <!-- *** Project Information ************************************* -->
- <!-- ************************************************************* -->
<name>JRedmine :: Client</name>
-
<description>The JRedmine client</description>
- <!-- ************************************************************* -->
- <!-- *** Build Settings ****************************************** -->
- <!-- ************************************************************* -->
-
- <packaging>jar</packaging>
-
<properties>
<!-- extra files to include in release -->
<redmine.releaseFiles>
@@ -134,18 +147,6 @@
</execution>
</executions>
</plugin>
- <!-- expose tests -->
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-test</id>
- <goals>
- <goal>test-jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
@@ -153,58 +154,9 @@
<reporting>
<excludeDefaults>true</excludeDefaults>
</reporting>
- <!-- ************************************************************* -->
- <!-- *** Build Environment ************************************** -->
- <!-- ************************************************************* -->
- <!-- Build Environment : Environment Information -->
-
- <!-- Maven Environment : profiles -->
-
<profiles>
- <profile>
- <id>release-profile</id>
- <activation>
- <property>
- <name>performRelease</name>
- <value>true</value>
- </property>
- </activation>
- <build>
- <plugins>
- <!-- always compute tests-sources jar -->
- <plugin>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <goals>
- <!--<goal>jar</goal>-->
- <goal>test-jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <!-- always compute test-javadoc jar -->
- <plugin>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-javadocs</id>
- <goals>
- <!--<goal>jar</goal>-->
- <goal>test-jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
-
- </build>
- </profile>
-
<profile>
<id>reporting</id>
<activation>
@@ -219,18 +171,18 @@
<plugin>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-maven-plugin</artifactId>
- <version>1.3.8</version>
+ <version>${plexusPluginVersion}</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
- <version>2.3</version>
+ <version>${coberturaPluginVersion}</version>
</plugin>
</plugins>
</reporting>
-
+
</profile>
<profile>
<id>release-assembly-profile</id>
Modified: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineAnonymousService.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineAnonymousService.java 2012-07-12 14:04:21 UTC (rev 268)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineAnonymousService.java 2012-07-12 14:04:57 UTC (rev 269)
@@ -215,21 +215,22 @@
return result;
}
-// @Override
-// public RedmineServiceImplementor init(RestClient session) throws RedmineServiceException {
-// if (log.isDebugEnabled()) {
-// log.debug("init session for " + this);
-// }
-// checkNotLoggued(session);
-// return delegateImplementor.init(session);
-// }
-
@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 {
@@ -245,16 +246,18 @@
@Override
public <T> T sendData(String requestName,
- Class<T> klazz,
+ Class<T> type,
+ RestMethod method,
Object... args) throws RedmineServiceException {
- return delegateImplementor.sendData(requestName, klazz, args);
+ return delegateImplementor.sendData(requestName, type, method, args);
}
@Override
public <T> T[] sendDatas(String requestName,
- Class<T> klazz,
+ Class<T> type,
+ RestMethod method,
Object... args) throws RedmineServiceException {
- return delegateImplementor.sendDatas(requestName, klazz, args);
+ return delegateImplementor.sendDatas(requestName, type, method, args);
}
@Override
@@ -263,13 +266,13 @@
}
@Override
- public void destroy() throws RedmineServiceException {
- delegateImplementor.destroy();
+ public boolean isLoggued() {
+ return delegateImplementor.isLoggued();
}
@Override
- public void checkNotLoggued() throws IllegalStateException, RedmineServiceLoginException, NullPointerException {
- delegateImplementor.checkNotLoggued();
+ public void destroy() throws RedmineServiceException {
+ delegateImplementor.destroy();
}
@Override
Modified: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineService.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineService.java 2012-07-12 14:04:21 UTC (rev 268)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineService.java 2012-07-12 14:04:57 UTC (rev 269)
@@ -77,6 +77,7 @@
// send data and obtain created version
Version result = sendData(RedmineRestClient.ADD_VERSION,
Version.class,
+ RestMethod.POST,
projectName,
version
);
@@ -90,6 +91,7 @@
// send data and obtain updated version
Version result = sendData(RedmineRestClient.UPDATE_VERSION,
Version.class,
+ RestMethod.POST,
projectName,
version
);
@@ -104,6 +106,7 @@
// send data and obtain updated or created new version
Version result = sendData(RedmineRestClient.NEXT_VERSION,
Version.class,
+ RestMethod.POST,
projectName,
newVersion,
oldVersionName
@@ -119,6 +122,7 @@
// send data and obtain created attachment
Attachment result = sendData(RedmineRestClient.ADD_ATTACHMENT,
Attachment.class,
+ RestMethod.POST,
projectName,
versionName,
attachement
@@ -132,6 +136,7 @@
// send data and obtain created news
News result = sendData(RedmineRestClient.ADD_NEWS,
News.class,
+ RestMethod.POST,
projectName,
news
);
@@ -145,6 +150,7 @@
// send data and obtain updated version
TimeEntry result = sendData(RedmineRestClient.ADD_ISSUE_TIME_ENTRY,
TimeEntry.class,
+ RestMethod.POST,
projectName,
issueId,
entry
Modified: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineServiceImplementor.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineServiceImplementor.java 2012-07-12 14:04:21 UTC (rev 268)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineServiceImplementor.java 2012-07-12 14:04:57 UTC (rev 269)
@@ -32,6 +32,7 @@
import org.nuiton.jredmine.model.io.xpp3.RedmineXpp3Helper;
import org.nuiton.jredmine.rest.RedmineRestClient;
+import java.io.IOException;
import java.io.InputStream;
/**
@@ -55,16 +56,19 @@
*
* @plexus.requirement role="org.nuiton.io.rest.RestClient" role-hint="redmine"
*/
- protected RestClient session;
+ protected RedmineRestClient session;
- /** xpp3 xpp3Helper to transform xml stream to pojo */
- protected final RedmineXpp3Helper xpp3Helper;
+ /**
+ * 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;
public DefaultRedmineServiceImplementor() {
- xpp3Helper = new RedmineXpp3Helper();
if (log.isDebugEnabled()) {
log.debug("new " + this);
}
@@ -81,13 +85,18 @@
}
@Override
+ public boolean isLoggued() {
+ return session.isOpen();
+ }
+
+ @Override
public RedmineServiceImplementor init(RedmineServiceConfiguration configuration) throws RedmineServiceException {
session.setConfiguration(configuration);
RedmineServiceImplementor result = init(session);
return result;
}
- public RedmineServiceImplementor init(RestClient session) throws RedmineServiceException {
+ public RedmineServiceImplementor init(RedmineRestClient session) throws RedmineServiceException {
if (init) {
throw new IllegalStateException(
"the client " + this + " was already init!");
@@ -109,10 +118,26 @@
@Override
public int ping() {
- return 0;
+
+ 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 {
@@ -156,21 +181,23 @@
@Override
public <T> T sendData(String requestName,
- Class<T> klazz,
+ Class<T> type,
+ RestMethod method,
Object... args) throws RedmineServiceException {
checkLoggued();
InputStream stream = sendDataStream(requestName, args);
- T result = getDataFromStream(klazz, stream);
+ T result = getDataFromStream(type, stream);
return result;
}
@Override
public <T> T[] sendDatas(String requestName,
- Class<T> klazz,
+ Class<T> type,
+ RestMethod method,
Object... args) throws RedmineServiceException {
checkLoggued();
InputStream stream = sendDataStream(requestName, args);
- T[] result = getDatasFromStream(klazz, stream);
+ T[] result = getDatasFromStream(type, stream);
return result;
}
@@ -185,17 +212,6 @@
}
}
- @Override
- public void checkNotLoggued() throws RedmineServiceLoginException, NullPointerException {
-// checkInit();
- checkSessionNotNull(session);
- checkSessionConfigurationNotNull(session);
- if (!session.getConfiguration().isAnonymous()) {
- throw new RedmineServiceLoginException(
- "session must be anonymous in this service");
- }
- }
-
protected InputStream askDataStream(String requestName,
Object... args) throws RedmineServiceException {
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-12 14:04:21 UTC (rev 268)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineAnonymousServiceJersey.java 2012-07-12 14:04:57 UTC (rev 269)
@@ -40,7 +40,7 @@
import org.nuiton.jredmine.model.User;
import org.nuiton.jredmine.model.Version;
-import static org.nuiton.jredmine.request.RedmineRequestFactory.DEFAULT_REQUESTS;
+import static org.nuiton.jredmine.request.RedmineRequestFactoryImpl.DEFAULT_REQUESTS;
/**
* Implemntation of the {@link RedmineAnonymousService} using Jersey for REST
@@ -69,7 +69,7 @@
@Override
public IssueStatus[] getIssueStatuses() throws RedmineServiceException {
- return getDatas(DEFAULT_REQUESTS.GET_ISSUE_STATUS_LIST.requestName(),
+ return getDatas(DEFAULT_REQUESTS.GET_ISSUE_STATUS_LIST,
IssueStatus.class
);
}
@@ -204,6 +204,7 @@
///////////////////////////////////////////////////////////////////////////
/// RedmineServiceImplementor implementation
///////////////////////////////////////////////////////////////////////////
+
@Override
public RedmineServiceImplementor init(RedmineServiceConfiguration configuration) throws RedmineServiceException {
// Force to not be loggued
@@ -211,7 +212,8 @@
if (log.isDebugEnabled()) {
log.debug("init configuration for " + this);
}
- RedmineServiceImplementor result = delegateImplementor.init(configuration);
+ RedmineServiceImplementor result =
+ delegateImplementor.init(configuration);
return result;
}
@@ -222,6 +224,22 @@
}
@Override
+ public void login() throws RedmineServiceLoginException {
+ // no login in anonymous service
+ if (log.isWarnEnabled()) {
+ log.warn("Login skip in anonymous service.");
+ }
+ }
+
+ @Override
+ public void logout() throws RedmineServiceLoginException {
+ // no logout in anonymous service
+ if (log.isWarnEnabled()) {
+ log.warn("Logout skip in anonymous service.");
+ }
+ }
+
+ @Override
public <T> T getData(String requestName,
Class<T> type,
Object... args) throws RedmineServiceException {
@@ -237,16 +255,18 @@
@Override
public <T> T sendData(String requestName,
- Class<T> klazz,
+ Class<T> type,
+ RestMethod method,
Object... args) throws RedmineServiceException {
- return delegateImplementor.sendData(requestName, klazz, args);
+ return delegateImplementor.sendData(requestName, type, method, args);
}
@Override
public <T> T[] sendDatas(String requestName,
- Class<T> klazz,
+ Class<T> type,
+ RestMethod method,
Object... args) throws RedmineServiceException {
- return delegateImplementor.sendDatas(requestName, klazz, args);
+ return delegateImplementor.sendDatas(requestName, type, method, args);
}
@Override
@@ -255,13 +275,13 @@
}
@Override
- public void destroy() throws RedmineServiceException {
- delegateImplementor.destroy();
+ public boolean isLoggued() {
+ return delegateImplementor.isLoggued();
}
@Override
- public void checkNotLoggued() throws IllegalStateException, RedmineServiceLoginException, NullPointerException {
- delegateImplementor.checkNotLoggued();
+ public void destroy() throws RedmineServiceException {
+ delegateImplementor.destroy();
}
@Override
@@ -286,15 +306,25 @@
}
protected <T> T sendData(DEFAULT_REQUESTS request,
- Class<T> klazz,
+ Class<T> type,
+ RestMethod method,
Object... args) throws RedmineServiceException {
- return delegateImplementor.sendData(request.requestName(), klazz, args);
+ return delegateImplementor.sendData(request.requestName(),
+ type,
+ method,
+ args
+ );
}
protected <T> T[] sendDatas(DEFAULT_REQUESTS request,
- Class<T> klazz,
+ Class<T> type,
+ RestMethod method,
Object... args) throws RedmineServiceException {
- return delegateImplementor.sendDatas(request.requestName(), klazz, args);
+ return delegateImplementor.sendDatas(request.requestName(),
+ type,
+ method,
+ args
+ );
}
}
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-12 14:04:21 UTC (rev 268)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceImplementorJersey.java 2012-07-12 14:04:57 UTC (rev 269)
@@ -25,13 +25,28 @@
package org.nuiton.jredmine;
import com.google.common.base.Preconditions;
+import com.google.common.collect.Lists;
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.ClientHandlerException;
import com.sun.jersey.api.client.ClientResponse;
+import com.sun.jersey.api.client.UniformInterface;
+import com.sun.jersey.api.client.UniformInterfaceException;
import com.sun.jersey.api.client.WebResource;
+import com.sun.jersey.api.client.config.ClientConfig;
+import com.sun.jersey.api.representation.Form;
+import com.sun.jersey.client.apache4.ApacheHttpClient4;
+import com.sun.jersey.client.apache4.config.DefaultApacheHttpClient4Config;
import com.sun.jersey.core.util.MultivaluedMapImpl;
+import com.sun.jersey.multipart.FormDataMultiPart;
+import com.sun.jersey.multipart.MultiPartMediaTypes;
+import com.sun.jersey.multipart.file.FileDataBodyPart;
+import com.sun.jersey.multipart.impl.MultiPartWriter;
+import org.apache.commons.httpclient.methods.multipart.FilePart;
+import org.apache.commons.httpclient.methods.multipart.Part;
+import org.apache.commons.httpclient.methods.multipart.StringPart;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
import org.nuiton.io.rest.RestClientConfiguration;
import org.nuiton.jredmine.model.io.xpp3.RedmineXpp3Helper;
import org.nuiton.jredmine.request.RedmineRequest;
@@ -40,7 +55,9 @@
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import java.io.File;
+import java.io.FileNotFoundException;
import java.io.InputStream;
+import java.util.List;
import java.util.Map;
/**
@@ -57,24 +74,31 @@
private static final Log log =
LogFactory.getLog(RedmineServiceImplementorJersey.class);
+ /** Service configuration. */
protected RestClientConfiguration configuration;
- /** request factory. */
- protected final RedmineRequestFactory requestFactory;
+ /**
+ * Request factory.
+ *
+ * @plexus.requirement role="org.nuiton.jredmine.request.RedmineRequestFactory" role-hint="jersey"
+ */
+ protected RedmineRequestFactory requestFactory;
- /** xpp3Helper to transform xml stream to pojo */
- protected final RedmineXpp3Helper xpp3Helper;
+ /**
+ * xpp3Helper to transform xml stream to pojo.
+ *
+ * @plexus.requirement role="org.nuiton.jredmine.model.io.xpp3.RedmineXpp3Helper" role-hint="default"
+ */
+ protected RedmineXpp3Helper xpp3Helper;
+ /** Jersey REST client. */
protected Client client;
- /** internal state to known if service was init */
+ /** internal state to known if service was init. */
protected boolean init;
- public RedmineServiceImplementorJersey() {
- xpp3Helper = new RedmineXpp3Helper();
- requestFactory = new RedmineRequestFactory();
- requestFactory.addDefaultRequests();
- }
+ /** internal state to know if service is loggued. */
+ protected boolean auth;
///////////////////////////////////////////////////////////////////////////
/// RedmineServiceImplementor implementation
@@ -86,10 +110,42 @@
}
@Override
+ public boolean isLoggued() {
+ return auth;
+ }
+
+ @Override
public RedmineServiceImplementor init(RedmineServiceConfiguration configuration) throws RedmineServiceException {
Preconditions.checkNotNull(configuration);
this.configuration = configuration;
- client = Client.create();
+
+ Preconditions.checkNotNull(xpp3Helper);
+ Preconditions.checkNotNull(requestFactory);
+ requestFactory.addDefaultRequests();
+
+ if (configuration.isAnonymous()) {
+
+ // no need authentication
+
+ client = Client.create();
+ } else {
+
+ ClientConfig clientConfig = new DefaultApacheHttpClient4Config();
+ clientConfig.getClasses().add(MultiPartWriter.class);
+ //TODO Should use this when redmine plugin will accept it
+// BasicCredentialsProvider credentialsProvider = new BasicCredentialsProvider();
+// credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(
+// configuration.getRestUsername(), configuration.getRestPassword()
+// ));
+
+// clientConfig.getProperties().put(DefaultApacheHttpClient4Config.PROPERTY_CREDENTIALS_PROVIDER, credentialsProvider);
+ clientConfig.getProperties().put(DefaultApacheHttpClient4Config.PROPERTY_CONNECTION_MANAGER, new ThreadSafeClientConnManager());
+ client = ApacheHttpClient4.create(clientConfig);
+
+// ClientConfig clientConfig2 = new DefaultClientConfig();
+// clientConfig2.getClasses().add(MultiPartWriter.class);
+// client = Client.create(clientConfig2);
+ }
init = true;
return this;
}
@@ -98,9 +154,17 @@
public void destroy() throws RedmineServiceException {
checkInit();
init = false;
- configuration = null;
- client.destroy();
- client = null;
+ try {
+ logout();
+ } catch (RedmineServiceLoginException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Error while logut, still continue to destroy...", e);
+ }
+ } finally {
+ client.destroy();
+ configuration = null;
+ client = null;
+ }
}
@Override
@@ -108,7 +172,9 @@
Class<T> type,
Object... args) throws RedmineServiceException {
checkInit();
- InputStream stream = askDataStream(requestName, args);
+
+ RedmineRequest request = requestFactory.getRequest(requestName, args);
+ InputStream stream = askData(request, RestMethod.GET, InputStream.class);
T result = getDataFromStream(type, stream);
return result;
}
@@ -118,59 +184,134 @@
Class<T> type,
Object... args) throws RedmineServiceException {
checkInit();
- InputStream stream = askDataStream(requestName, args);
+ RedmineRequest request = requestFactory.getRequest(requestName, args);
+ InputStream stream = askData(request, RestMethod.GET, InputStream.class);
T[] result = getDatasFromStream(type, stream);
return result;
}
@Override
public <T> T sendData(String requestName,
- Class<T> klazz,
+ Class<T> type,
+ RestMethod method,
Object... args) throws RedmineServiceException {
checkLoggued();
- InputStream stream = sendDataStream(requestName, args);
- T result = getDataFromStream(klazz, stream);
+ InputStream stream = sendDataStream(requestName, method, args);
+ T result = getDataFromStream(type, stream);
return result;
}
@Override
public <T> T[] sendDatas(String requestName,
- Class<T> klazz,
+ Class<T> type,
+ RestMethod method,
Object... args) throws RedmineServiceException {
checkLoggued();
- InputStream stream = sendDataStream(requestName, args);
- T[] result = getDatasFromStream(klazz, stream);
+ InputStream stream = sendDataStream(requestName, method, args);
+ T[] result = getDatasFromStream(type, stream);
return result;
}
@Override
public void checkLoggued() throws IllegalStateException, RedmineServiceLoginException, NullPointerException {
checkInit();
- //TODO
- }
+ if (configuration.isAnonymous()) {
+ throw new RedmineServiceLoginException(
+ "can not access this service in anonymous mode");
+ }
- @Override
- public void checkNotLoggued() throws RedmineServiceLoginException, NullPointerException {
- checkInit();
- //TODO
+ if (!isLoggued()) {
+
+ // log in
+ login();
+ }
}
@Override
public int ping() {
- WebResource request = requestToWebResource("ping");
+ RedmineRequest redmineRequest = requestFactory.getRequest("ping");
+
int status;
try {
- ClientResponse clientResponse = request.head();
+ ClientResponse clientResponse = askData(redmineRequest,
+ RestMethod.HEAD,
+ ClientResponse.class);
status = clientResponse.getStatus();
} catch (ClientHandlerException e) {
if (log.isErrorEnabled()) {
- log.error("Could not ping " + request.toString(), e);
+ log.error("Could not ping " + redmineRequest.toString(), e);
}
status = -1;
}
return status;
}
+ @Override
+ public void login() throws RedmineServiceLoginException {
+
+ Form f = new Form();
+ RedmineRequest redmineRequest = requestFactory.getRequest(
+ "login",
+ configuration.getRestUsername(),
+ configuration.getRestPassword()
+ );
+ UniformInterface request = prepareRequest(redmineRequest, f);
+ try {
+ ClientResponse clientResponse = RestMethod.POST.execute(
+ request, ClientResponse.class, f);
+
+ int status = clientResponse.getStatus();
+
+ if (status == 200) {
+
+ // ok we are log in
+ if (log.isInfoEnabled()) {
+ log.info("User " + configuration.getRestUsername() + " " +
+ "sucessfull log in");
+ }
+ auth = true;
+ } else {
+ throw new RedmineServiceLoginException(
+ "Could not log in, return status was " + status
+ + "+, but a 200 was required.");
+ }
+ } catch (ClientHandlerException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Could not ping " + request.toString(), e);
+ }
+ throw new RedmineServiceLoginException(
+ "Error while trying to log you : " + e.getMessage(), e);
+ }
+ }
+
+ @Override
+ public void logout() throws RedmineServiceLoginException {
+
+ if (isLoggued()) {
+ RedmineRequest redmineRequest = requestFactory.getRequest("ping");
+
+ ClientResponse clientResponse = askData(redmineRequest, RestMethod.GET, ClientResponse.class);
+
+ int status = clientResponse.getStatus();
+ if (status == 200) {
+
+ // ok we are log out
+
+ if (log.isInfoEnabled()) {
+ log.info("User " + configuration.getRestUsername() + " " +
+ "sucessfull log out");
+ }
+ auth = false;
+
+ // TODO must remove all cookie from client ?
+ } else {
+ throw new RedmineServiceLoginException(
+ "Could not log out, return status was " + status
+ + "+, but a 200 was required.");
+ }
+ }
+ }
+
protected <T> T getDataFromStream(Class<T> type,
InputStream stream) throws RedmineServiceException {
if (stream == null) {
@@ -202,143 +343,254 @@
}
}
- protected InputStream askDataStream(String requestName,
- Object... args) throws RedmineServiceException {
+ protected <T> T askData(RedmineRequest request,
+ RestMethod method,
+ Class<T> type) {
- try {
+ if (request.containsAttachments()) {
+ throw new IllegalStateException(
+ "Can not accept attachments in this method");
+ }
- // get the webresource to grab
- WebResource webResource = requestToWebResource(requestName, args);
+ String url = request.toPath(configuration.getRestUrl());
- // transform it to a input stream
- InputStream result = webResource.accept(
- MediaType.APPLICATION_XML_TYPE).
- get(InputStream.class);
- return result;
- } catch (Exception e) {
- throw new RedmineServiceException(
- "could not obtain data stream for request " + requestName +
- " for reason " + e.getMessage(), e);
+ WebResource webResource = client.resource(url);
+ String[] parameters = request.getParameters();
+
+ if (parameters.length > 0) {
+
+ MultivaluedMap<String, String> params = new MultivaluedMapImpl();
+
+ // add parameters
+
+ int nbParams = parameters.length / 2;
+ for (int i = 0; i < nbParams; i++) {
+ String key = parameters[2 * i];
+ String value = parameters[2 * i + 1];
+ if (value == null) {
+ if (log.isDebugEnabled()) {
+ log.debug("skip null parameter " + key);
+ }
+ continue;
+ }
+ params.add(key, value);
+ }
+
+ // simple get request (put everything in url ?)
+ webResource = webResource.queryParams(params);
}
- }
- protected WebResource requestToWebResource(String requestName,
- Object... args) {
+ if (configuration.isVerbose()) {
+ log.info("request = " + webResource.toString());
+ }
- RedmineRequest request = requestFactory.getRequest(requestName, args);
+ // transform it to required type
- String url = configuration.getRestUrl().toString();
- for (String path : request.getPath()) {
- url += '/' + path;
+ UniformInterface resource;
+
+ if (InputStream.class.equals(type)) {
+
+ // will reduilb response from xml
+ resource = webResource.accept(MediaType.APPLICATION_XML_TYPE);
+ } else {
+
+ resource = webResource;
}
- WebResource result = client.resource(url);
- String[] parameters = request.getParameters();
- Map<String, File> attachments = request.getAttachments();
- if (attachments == null) {
+ T result = method.execute(resource, type);
+ return result;
+ }
- // not a multi-part request
+ protected UniformInterface prepareRequest(RedmineRequest request,
+ Form form) {
- if (parameters.length > 0) {
+ if (request.containsAttachments()) {
+ throw new IllegalStateException(
+ "Can not accept attachments in this method");
+ }
- MultivaluedMap<String, String> params = new MultivaluedMapImpl();
- // add parameters
+ String url = request.toPath(configuration.getRestUrl());
- int nbParams = parameters.length / 2;
- for (int i = 0; i < nbParams; i++) {
- String key = parameters[2 * i];
- String value = parameters[2 * i + 1];
- if (value == null) {
- if (log.isDebugEnabled()) {
- log.debug("skip null parameter " + key);
- }
- continue;
+ WebResource webResource = client.resource(url);
+ String[] parameters = request.getParameters();
+
+ if (parameters.length > 0) {
+
+ // add parameters
+
+ int nbParams = parameters.length / 2;
+ for (int i = 0; i < nbParams; i++) {
+ String key = parameters[2 * i];
+ String value = parameters[2 * i + 1];
+ if (value == null) {
+ if (log.isDebugEnabled()) {
+ log.debug("skip null parameter " + key);
}
- params.add(key, value);
+ continue;
}
- result = result.queryParams(params);
+ form.add(key, value);
}
- } else {
+ }
- // multi-part request
+ if (log.isInfoEnabled()) {
+ log.info("request = " + webResource.toString());
+ }
+ return webResource.accept(MediaType.APPLICATION_XML_TYPE);
+ }
-// List<Part> paramParts = new ArrayList<Part>();
+ protected UniformInterface prepareRequest(RedmineRequest request,
+ List<Part> paramParts,
+ FormDataMultiPart form) {
+
+ String url = request.toPath(configuration.getRestUrl());
+
+ WebResource webResource = client.resource(url);
+
+ // add parameters in a form
+
+ String[] parameters = request.getParameters();
+// if (parameters.length > 0) {
//
-// if (parameters.length > 0) {
-//
-// // add parameters as part of multi-part
-//
-// int nbParams = parameters.length / 2;
-// for (int i = 0; i < nbParams; i++) {
-// String key = parameters[2 * i];
-// String value = parameters[2 * i + 1];
-// if (value == null) {
-// if (log.isDebugEnabled()) {
-// log.debug("skip null parameter " + key);
-// }
-// continue;
-// }
-// paramParts.add(new StringPart(key, value));
+// int nbParams = parameters.length / 2;
+// for (int i = 0; i < nbParams; i++) {
+// String key = parameters[2 * i];
+// String value = parameters[2 * i + 1];
+// if (value == null) {
// if (log.isDebugEnabled()) {
-// log.debug("add parameter [" + key + "]=" + value);
+// log.debug("skip null parameter " + key);
// }
+// continue;
// }
-// }
//
-// // add file parts
-// for (Map.Entry<String, File> entry : attachments.entrySet()) {
-// String key = entry.getKey();
-// File file = entry.getValue();
-// if (log.isDebugEnabled()) {
-// log.debug("add attachment " + key + "=" + file);
+//// webResource = webResource.queryParam(key, value);
+// form = form.field(key, value);
+//
+// if (log.isInfoEnabled()) {
+// log.info("add parameter [" + key + "]=" + value);
// }
-// paramParts.add(new FilePart(
-// key,
-// file.getName(),
-// file,
-// FilePart.DEFAULT_CONTENT_TYPE,
-// configuration.getEncoding())
-// );
// }
-// if (attachments.isEmpty()) {
-// log.warn("no attachment in a multi-part request!");
-// }
-//
-// Part[] parts = paramParts.toArray(new Part[paramParts.size()]);
-//
-// MultipartRequestEntity entity =
-// new MultipartRequestEntity(parts, gm.getParams());
-// if (log.isDebugEnabled()) {
-// entity.writeRequest(System.out);
-// }
-// gm.setRequestEntity(entity);
-//// gm.addRequestHeader("content-type", "multipart/form-data");
-// gm.addRequestHeader("content-type", entity.getContentType());
-// gm.addRequestHeader("content-length", entity.getContentLength() +
-// "");
-// if (showRequest) {
-// log.info("content-type : " + entity.getContentType() +
-// ", content-length : " + entity.getContentLength());
-// }
+// }
+
+ // add file parts
+
+ Map<String, File> attachments = request.getAttachments();
+
+// List<Part> paramParts = new ArrayList<Part>();
+
+ if (parameters.length > 0) {
+
+ // add parameters as part of multi-part
+
+ int nbParams = parameters.length / 2;
+ for (int i = 0; i < nbParams; i++) {
+ String key = parameters[2 * i];
+ String value = parameters[2 * i + 1];
+ if (value == null) {
+ if (log.isDebugEnabled()) {
+ log.debug("skip null parameter " + key);
+ }
+ continue;
+ }
+ paramParts.add(new StringPart(key, value));
+ if (log.isDebugEnabled()) {
+ log.debug("add parameter [" + key + "]=" + value);
+ }
+ }
}
- if (log.isInfoEnabled()) {
- log.info("request = " + result.toString());
+
+ // add file parts
+ for (Map.Entry<String, File> entry : attachments.entrySet()) {
+ String key = entry.getKey();
+ File file = entry.getValue();
+ if (log.isDebugEnabled()) {
+ log.debug("add attachment " + key + "=" + file);
+ }
+ try {
+ FilePart filePart = new FilePart(
+ key,
+ file.getName(),
+ file,
+ FilePart.DEFAULT_CONTENT_TYPE,
+ configuration.getEncoding());
+ paramParts.add(filePart);
+ } catch (FileNotFoundException e) {
+ if (log.isErrorEnabled()) {
+ log.error("File not found " + file, e);
+ }
+ }
}
+ if (attachments.isEmpty()) {
+ log.warn("no attachment in a multi-part request!");
+ }
+
+ Part[] parts = paramParts.toArray(new Part[paramParts.size()]);
+
+// MultipartRequestEntity entity =
+// new MultipartRequestEntity(parts, webResource.getParams());
+// ByteArrayOutputStream bas = new ByteArrayOutputStream();
+
+ for (Map.Entry<String, File> entry : attachments.entrySet()) {
+ String key = entry.getKey();
+ File file = entry.getValue();
+ if (log.isInfoEnabled()) {
+ log.info("add attachment " + key + "=" + file);
+ }
+ form = (FormDataMultiPart) form.bodyPart(new FileDataBodyPart(key, file));
+ }
+
+ if (configuration.isVerbose()) {
+ log.info("request = " + webResource.toString());
+ }
+
+ UniformInterface result;
+ result = webResource.type(MultiPartMediaTypes.MULTIPART_MIXED_TYPE);
+// result = webResource.type(MultiPartMediaTypes.MULTIPART_MIXED_TYPE).accept(MediaType.APPLICATION_XML_TYPE);
+
return result;
}
protected InputStream sendDataStream(String requestName,
+ RestMethod method,
Object... args) throws RedmineServiceException {
-// RestRequest request = requestFactory.getRequest(requestName, args);
+ RedmineRequest redmineRequest =
+ requestFactory.getRequest(requestName, args);
+ UniformInterface request;
+ Object entity;
+
+ if (redmineRequest.containsAttachments()) {
+
+ // multi-part request
+
+ FormDataMultiPart form = new FormDataMultiPart();
+ List<Part> parts = Lists.newArrayList();
+ request = prepareRequest(redmineRequest, parts, form);
+ entity = parts;
+
+ } else {
+
+ // simple request
+
+ Form form = new Form();
+ request = prepareRequest(redmineRequest, form);
+ entity = form;
+ }
+
// obtain data from rest client
try {
-
-// InputStream stream = session.sendData(r);
- InputStream stream = null;
+ InputStream stream = method.execute(
+ request,
+// .accept(MediaType.APPLICATION_XML_TYPE),
+ InputStream.class,
+ entity);
return stream;
+ } catch (UniformInterfaceException e) {
+ throw new RedmineServiceException(
+ "could not send data stream for request " + requestName +
+ " for reason " + e.getResponse().getEntity(String.class) +
+ ", response from server was " + e.getMessage(), e);
} catch (Exception e) {
throw new RedmineServiceException(
"could not send data stream for request " + requestName +
@@ -346,6 +598,7 @@
}
}
+
protected void checkInit() throws IllegalStateException {
if (!init) {
throw new IllegalStateException(
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-12 14:04:21 UTC (rev 268)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceJersey.java 2012-07-12 14:04:57 UTC (rev 269)
@@ -32,9 +32,10 @@
import static org.nuiton.jredmine.request.RedmineRequestFactory.DEFAULT_REQUESTS;
/**
- * Implementation fo the {@link RedmineService} using Jersey REST layer.
+ * Implemantation fo the {@link RedmineService} using Jersey REST layer.
*
* @author tchemit <chemit(a)codelutin.com>
+ * @plexus.component role="org.nuiton.jredmine.RedmineService" role-hint="jersey"
* @since 1.4
*/
public class RedmineServiceJersey extends RedmineAnonymousServiceJersey implements RedmineService {
@@ -58,6 +59,7 @@
// send data and obtain created version
Version result = sendData(DEFAULT_REQUESTS.ADD_VERSION,
Version.class,
+ RestMethod.POST,
projectName,
version
);
@@ -71,6 +73,7 @@
// send data and obtain updated version
Version result = sendData(DEFAULT_REQUESTS.UPDATE_VERSION,
Version.class,
+ RestMethod.POST,
projectName,
version
);
@@ -85,6 +88,7 @@
// send data and obtain updated or created new version
Version result = sendData(DEFAULT_REQUESTS.NEXT_VERSION,
Version.class,
+ RestMethod.POST,
projectName,
newVersion,
oldVersionName
@@ -100,6 +104,7 @@
// send data and obtain created attachment
Attachment result = sendData(DEFAULT_REQUESTS.ADD_ATTACHMENT,
Attachment.class,
+ RestMethod.POST,
projectName,
versionName,
attachement
@@ -113,6 +118,7 @@
// send data and obtain created news
News result = sendData(DEFAULT_REQUESTS.ADD_NEWS,
News.class,
+ RestMethod.POST,
projectName,
news
);
@@ -126,10 +132,30 @@
// send data and obtain updated version
TimeEntry result = sendData(DEFAULT_REQUESTS.ADD_ISSUE_TIME_ENTRY,
TimeEntry.class,
+ RestMethod.POST,
projectName,
issueId,
entry
);
return result;
}
+
+ ///////////////////////////////////////////////////////////////////////////
+ /// RedmineServiceImplementor implementation
+ ///////////////////////////////////////////////////////////////////////////
+ @Override
+ public RedmineServiceImplementor init(RedmineServiceConfiguration configuration) throws RedmineServiceException {
+ RedmineServiceImplementor result = delegateImplementor.init(configuration);
+ return result;
+ }
+
+ @Override
+ public void login() throws RedmineServiceLoginException {
+ delegateImplementor.login();
+ }
+
+ @Override
+ public void logout() throws RedmineServiceLoginException {
+ delegateImplementor.logout();
+ }
}
Added: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/RedmineRequestFactoryImpl.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/RedmineRequestFactoryImpl.java (rev 0)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/RedmineRequestFactoryImpl.java 2012-07-12 14:04:57 UTC (rev 269)
@@ -0,0 +1,284 @@
+/*
+ * #%L
+ * JRedmine :: Client
+ *
+ * $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
+ * %%
+ * 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.request;
+
+import com.google.common.base.Strings;
+import com.google.common.collect.Maps;
+import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.News;
+import org.nuiton.jredmine.model.TimeEntry;
+import org.nuiton.jredmine.model.Version;
+import org.nuiton.jredmine.model.VersionStatusEnum;
+
+import java.io.File;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Factory of {@link RedmineRequest}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @plexus.component role="org.nuiton.jredmine.request.RedmineRequestFactory" role-hint="jersey"
+ * @since 1.4
+ */
+public class RedmineRequestFactoryImpl implements RedmineRequestFactory {
+
+ public static final DateFormat DATE_FORMAT =
+ new SimpleDateFormat("yyyy-MM-dd");
+
+ /** registred requests */
+ protected final Map<String, RedmineRequestBuilder> requestBuilders;
+
+ public RedmineRequestFactoryImpl() {
+ requestBuilders = Maps.newTreeMap();
+ }
+
+ @Override
+ public void addDefaultRequests() {
+ for (DEFAULT_REQUESTS request : DEFAULT_REQUESTS.values()) {
+ addRequestBuilder(request.requestBuilder);
+ }
+ }
+
+ @Override
+ public void addRequestBuilder(RedmineRequestBuilder builder) {
+ String name = builder.getName();
+ if (requestBuilders.containsKey(name)) {
+ throw new IllegalArgumentException("a request builder with name " +
+ name + " already exists.");
+ }
+ requestBuilders.put(name, builder);
+ }
+
+ @Override
+ public RedmineRequest getRequest(String id, Object... args) {
+
+ RedmineRequest r;
+ RedmineRequestBuilder builder = requestBuilders.get(id);
+ if (builder == null) {
+
+ throw new IllegalArgumentException(
+ "Could not find any request builder for request named '" +
+ id + "'");
+ }
+ r = builder.create(args);
+ if (r == null) {
+ throw new IllegalArgumentException(
+ "Could not find any request named '" + id +
+ "' using builder " + builder);
+ }
+ return r;
+ }
+
+ public enum DEFAULT_REQUESTS {
+
+ // misc requests
+
+ PING(new DefaultRedmineRequestBuilder("ping")),
+ LOGOUT(new DefaultRedmineRequestBuilder("logout")),
+ LOGIN(new DefaultRedmineRequestBuilder("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};
+ }
+ }),
+
+ // with no scope
+
+ GET_PROJECT_LIST(new DefaultRedmineRequestBuilder("get_projects.xml")),
+ GET_USER_PROJECTS(new DefaultRedmineRequestBuilder("get_user_projects.xml")),
+ GET_ISSUE_STATUS_LIST(new DefaultRedmineRequestBuilder("get_issue_statuses.xml")),
+ GET_ISSUE_PRIORITY_LIST(new DefaultRedmineRequestBuilder("get_issue_priorities.xml")),
+
+ // with project scope
+
+ GET_PROJECT(new ProjectScopeRedmineRequestBuilder("get_project.xml")),
+ GET_PROJECT_ISSUES(new ProjectScopeRedmineRequestBuilder("get_project_issues.xml")),
+ GET_PROJECT_OPENED_ISSUES(new ProjectScopeRedmineRequestBuilder("get_project_opened_issues.xml")),
+ GET_PROJECT_CLOSED_ISSUES(new ProjectScopeRedmineRequestBuilder("get_project_closed_issues.xml")),
+ GET_VERSION_LIST(new ProjectScopeRedmineRequestBuilder("get_project_versions.xml")),
+ GET_ISSUE_CATEGORY_LIST(new ProjectScopeRedmineRequestBuilder("get_issue_categories.xml")),
+ GET_TRACKER_LIST(new ProjectScopeRedmineRequestBuilder("get_project_trackers.xml")),
+ GET_USER_LIST(new ProjectScopeRedmineRequestBuilder("get_project_users.xml")),
+ GET_NEWS_LIST(new ProjectScopeRedmineRequestBuilder("get_project_news.xml")),
+
+ ADD_VERSION(new ProjectScopeRedmineRequestBuilder("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
+ };
+ }
+ }),
+ UPDATE_VERSION(new ProjectScopeRedmineRequestBuilder("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
+ };
+ }
+ }),
+ NEXT_VERSION(new ProjectScopeRedmineRequestBuilder("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
+ };
+ }
+ }),
+ ADD_NEWS(new ProjectScopeRedmineRequestBuilder("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
+ GET_VERSION(new VersionScopeRedmineRequestBuilder("get_version.xml")),
+ GET_ISSUE_LIST(new VersionScopeRedmineRequestBuilder("get_version_issues.xml")),
+ GET_ATTACHMENTS_LIST(new VersionScopeRedmineRequestBuilder("get_version_attachments.xml")),
+ ADD_ATTACHMENT(new VersionScopeRedmineRequestBuilder("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
+
+ GET_ISSUE_TIME_ENTRY_LIST(new IssueScopeRedmineRequestBuilder("get_issue_times.xml")),
+
+ ADD_ISSUE_TIME_ENTRY(new IssueScopeRedmineRequestBuilder("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()
+ };
+ }
+ });
+
+ private final RedmineRequestBuilder requestBuilder;
+
+ DEFAULT_REQUESTS(RedmineRequestBuilder requestBuilder) {
+ this.requestBuilder = requestBuilder;
+ }
+
+ public RedmineRequestBuilder getRequestBuilder() {
+ return requestBuilder;
+ }
+
+ public String requestName() {
+ return requestBuilder.getName();
+ }
+ }
+
+ 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());
+ }
+
+
+}
Modified: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/rest/RedmineRestClient.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/rest/RedmineRestClient.java 2012-07-12 14:04:21 UTC (rev 268)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/rest/RedmineRestClient.java 2012-07-12 14:04:57 UTC (rev 269)
@@ -307,7 +307,7 @@
}
}
- protected void ping(RestSession session) throws IOException {
+ public int ping(RestSession session) throws IOException {
try {
@@ -334,6 +334,7 @@
throw new IOException(
"can not connect to " + configuration.getRestUrl());
}
+ return statusCode;
} catch (IOException ex) {
throw ex;
} catch (Exception ex) {
@@ -343,7 +344,7 @@
}
}
- protected void login(RestSession session) throws IOException {
+ public void login(RestSession session) throws IOException {
RestRequest request = getRequest(LOGIN,
configuration.getRestUsername(),
Modified: trunk/jredmine-client/src/test/java/org/nuiton/jredmine/AbstractRedmineServiceTest.java
===================================================================
--- trunk/jredmine-client/src/test/java/org/nuiton/jredmine/AbstractRedmineServiceTest.java 2012-07-12 14:04:21 UTC (rev 268)
+++ trunk/jredmine-client/src/test/java/org/nuiton/jredmine/AbstractRedmineServiceTest.java 2012-07-12 14:04:57 UTC (rev 269)
@@ -47,8 +47,6 @@
import org.nuiton.jredmine.model.Version;
import org.nuiton.jredmine.rest.RedmineRestClient;
-import static org.nuiton.jredmine.TestHelper.getTestConfiguration;
-
/**
* Created: 2 janv. 2010
*
@@ -147,19 +145,21 @@
@Before
public void setUp() throws Exception {
- if (client == null) {
+ Assume.assumeTrue(false);
- RestClientConfiguration configuration = getTestConfiguration();
- try {
- client = newClient(configuration);
- } finally {
- Assume.assumeTrue(client != null && client.isOpen());
- }
- }
-
- service = newService();
-
- ((DefaultRedmineServiceImplementor) service).init(client);
+// if (client == null) {
+//
+// RestClientConfiguration configuration = getTestConfiguration();
+// try {
+// client = newClient(configuration);
+// } finally {
+// Assume.assumeTrue(client != null && client.isOpen());
+// }
+// }
+//
+// service = newService();
+//
+// ((DefaultRedmineServiceImplementor) service).init(client);
}
@After
Modified: trunk/jredmine-client/src/test/java/org/nuiton/jredmine/DefaultRedmineServiceTest.java
===================================================================
--- trunk/jredmine-client/src/test/java/org/nuiton/jredmine/DefaultRedmineServiceTest.java 2012-07-12 14:04:21 UTC (rev 268)
+++ trunk/jredmine-client/src/test/java/org/nuiton/jredmine/DefaultRedmineServiceTest.java 2012-07-12 14:04:57 UTC (rev 269)
@@ -24,53 +24,134 @@
*/
package org.nuiton.jredmine;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
import org.junit.Test;
+import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.Project;
+import org.nuiton.jredmine.model.Version;
/** @author tchemit <chemit(a)codelutin.com> */
-public class DefaultRedmineServiceTest extends AbstractRedmineServiceTest<DefaultRedmineService> {
+public class DefaultRedmineServiceTest {
+// extends AbstractRedmineServiceTest<DefaultRedmineService> {
- public DefaultRedmineServiceTest() {
- super(DefaultRedmineService.class);
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(DefaultRedmineServiceTest.class);
+
+ protected static RedmineFixtures fixtures;
+
+ protected RedmineService service;
+
+// public DefaultRedmineServiceTest() {
+// super(DefaultRedmineService.class);
+// }
+
+ @BeforeClass
+ public static void beforeClass() throws Exception {
+
+ fixtures = new RedmineFixtures();
+
+ // test if can access service
+ DefaultRedmineService service = fixtures.newLegacyRedmineService();
+
+ try {
+ int status = service.ping();
+
+ if (status != 200) {
+
+ // ping was not ok
+ if (log.isInfoEnabled()) {
+ log.info("Will skip test " +
+ RedmineAnonymousServiceJerseyTest.class.getName() +
+ ", since ping status is " + status +
+ " (should be 200 to pass tests...)");
+ }
+ }
+ Assume.assumeTrue(status == 200);
+
+ try {
+ service.login();
+ } catch (RedmineServiceLoginException e) {
+ // ping was not ok
+ if (log.isInfoEnabled()) {
+ log.info("Will skip test " +
+ RedmineAnonymousServiceJerseyTest.class.getName() +
+ ", since login was bad : " + e.getMessage(), e);
+ }
+
+ Assume.assumeTrue(false);
+ }
+ } finally {
+ service.destroy();
+ }
}
+ @AfterClass
+ public static void afterClass() {
+ fixtures = null;
+ }
+
+ @Before
+ public void setUp() throws Exception {
+ service = fixtures.newLegacyRedmineService();
+ }
+
@Test
- @Override
+// @Override
public void getUserProjects() throws Exception {
- projects = getService().getUserProjects();
+ Project[] projects = service.getUserProjects();
+ Assert.assertNotNull(projects);
}
@Test
- @Override
+// @Override
public void addVersion() throws Exception {
// TODO
}
@Test
- @Override
+// @Override
+ @Ignore
public void addAttachment() throws Exception {
// TODO
+
+ Version version = fixtures.getVersion();
+ Attachment attachment = fixtures.getAttachment();
+ Attachment updatedAttachment = service.addAttachment(
+ RedmineFixtures.PROJECT_NAME,
+ version.getName(),
+ attachment
+ );
+ Assert.assertNotNull(updatedAttachment);
}
@Test
- @Override
+// @Override
public void addNews() throws Exception {
// TODO
}
@Test
- @Override
+// @Override
public void updateVersion() throws Exception {
// TODO
}
@Test
- @Override
+// @Override
public void nextVersion() throws Exception {
// TODO
}
@Test
- @Override
+// @Override
public void addIssueTime() throws Exception {
// TimeEntry timeEntry = new TimeEntry();
// timeEntry.setActivityId(9);
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-12 14:04:21 UTC (rev 268)
+++ trunk/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineAnonymousServiceJerseyTest.java 2012-07-12 14:04:57 UTC (rev 269)
@@ -27,6 +27,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.After;
+import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Before;
@@ -44,8 +45,6 @@
import org.nuiton.jredmine.model.User;
import org.nuiton.jredmine.model.Version;
-import java.net.URL;
-
/**
* To test the {@link RedmineAnonymousServiceJersey}.
*
@@ -58,22 +57,23 @@
private static final Log log =
LogFactory.getLog(RedmineAnonymousServiceJerseyTest.class);
- protected static RedmineServiceConfiguration configuration;
+ public static final String PROJECT_NAME = "jredmine";
- protected RedmineAnonymousServiceJersey service;
+ public static final String VERSION_NAME = "1.4";
+ public static final String ISSUE_ID = "2030";
+
+ protected static RedmineFixtures fixtures;
+
+ protected RedmineAnonymousService service;
+
@BeforeClass
public static void beforeClass() throws Exception {
- configuration = new FakeRedmineServiceConfiguration();
- configuration.setAnonymous(true);
- configuration.setRestUrl(new URL("http://nuiton.org/jredmine"));
- configuration.setVerbose(true);
+ fixtures = new RedmineFixtures();
// test if can access service
RedmineAnonymousServiceJersey service =
- new RedmineAnonymousServiceJersey();
- service.delegateImplementor = new RedmineServiceImplementorJersey();
- service.init(configuration);
+ fixtures.newRedmineAnonymousService();
int status = service.ping();
@@ -90,17 +90,19 @@
Assume.assumeTrue(status == 200);
}
+ @AfterClass
+ public static void afterClass() {
+ fixtures = null;
+ }
+
@Before
public void setUp() throws Exception {
-
- service = new RedmineAnonymousServiceJersey();
- service.delegateImplementor = new RedmineServiceImplementorJersey();
- service.init(configuration);
+ service = fixtures.newRedmineAnonymousService();
}
@After
public void tearDown() throws Exception {
- service.destroy();
+ ((RedmineServiceImplementor) service).destroy();
}
@Test
@@ -122,26 +124,15 @@
Assert.assertNotNull(issueStatuses);
}
- public static final String PROJECT_NAME = "jredmine";
-
- public static final String VERSION_NAME = "1.4";
-
- public static final String ISSUE_ID = "2030";
-
@Test
public void getProject() throws Exception {
Project project = service.getProject(PROJECT_NAME);
Assert.assertNotNull(project);
- Assert.assertEquals(PROJECT_NAME, project.getName());
- Assert.assertEquals(PROJECT_NAME, project.getIdentifier());
- Assert.assertEquals(true, project.isIsPublic());
- Assert.assertEquals("http://maven-site.nuiton.org/jredmine",
- project.getHomepage());
- Assert.assertEquals("Permet de communiquer en java avec un serveur " +
- "redmine qui a installé le plugin rails jredmine",
- project.getDescription());
- Assert.assertEquals(36, project.getId());
- Assert.assertEquals(1, project.getStatus());
+ Project expected = fixtures.getJRedmineProject();
+ TestHelper.assertMyEquals(Project.class, expected, project,
+ "name", "identifier",
+ "homepage", "description",
+ "id", "isPublic", "status");
}
@Test
Added: trunk/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineFixtures.java
===================================================================
--- trunk/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineFixtures.java (rev 0)
+++ trunk/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineFixtures.java 2012-07-12 14:04:57 UTC (rev 269)
@@ -0,0 +1,683 @@
+package org.nuiton.jredmine;
+
+import com.google.common.base.Charsets;
+import com.google.common.collect.ArrayListMultimap;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+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 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;
+ }
+
+ public 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");
+ logguedConfiguration.setRestUsername(login);
+ logguedConfiguration.setRestPassword(password);
+ logguedConfiguration.setAnonymous(false);
+ }
+ }
+ return logguedConfiguration;
+ }
+
+ public void copyConfiguration(RedmineServiceConfiguration src,
+ RedmineServiceConfiguration dst) {
+ if (src.getRestUrl() != null) {
+ dst.setRestUrl(src.getRestUrl());
+ }
+ if (src.getRestUsername() != null) {
+ dst.setRestUsername(src.getRestUsername());
+ }
+ if (src.getRestPassword() != null) {
+ dst.setRestPassword(src.getRestPassword());
+ }
+ if (src.getEncoding() != null) {
+ dst.setEncoding(src.getEncoding());
+ }
+
+ dst.setVerbose(src.isVerbose());
+ dst.setAnonymous(src.isAnonymous());
+ }
+
+ public RedmineAnonymousServiceJersey newRedmineAnonymousService()
+ throws IOException, RedmineServiceException {
+ RedmineAnonymousServiceJersey service = new RedmineAnonymousServiceJersey();
+ service.delegateImplementor = new RedmineServiceImplementorJersey();
+ service.init(getAnonymousConfiguration());
+ return service;
+ }
+
+ public RedmineServiceJersey newRedmineService()
+ throws IOException, RedmineServiceException {
+ RedmineServiceJersey service = new RedmineServiceJersey();
+ service.delegateImplementor = new RedmineServiceImplementorJersey();
+ service.init(getLogguedConfiguration());
+ return service;
+ }
+
+ public DefaultRedmineService newLegacyRedmineService()
+ throws IOException, RedmineServiceException {
+ DefaultRedmineService service = new DefaultRedmineService();
+ service.delegateImplementor = new DefaultRedmineServiceImplementor();
+ service.init(getLogguedConfiguration());
+ return service;
+ }
+
+ 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);
+ }
+
+ }
+}
Added: trunk/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineServiceJerseyTest.java
===================================================================
--- trunk/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineServiceJerseyTest.java (rev 0)
+++ trunk/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineServiceJerseyTest.java 2012-07-12 14:04:57 UTC (rev 269)
@@ -0,0 +1,149 @@
+package org.nuiton.jredmine;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.Project;
+import org.nuiton.jredmine.model.Version;
+
+/**
+ * Test the {@link RedmineServiceJersey}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public class RedmineServiceJerseyTest {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(RedmineServiceJerseyTest.class);
+
+ protected static RedmineFixtures fixtures;
+
+ protected RedmineService service;
+
+ @BeforeClass
+ public static void beforeClass() throws Exception {
+
+ fixtures = new RedmineFixtures();
+
+ // test if can access service
+ RedmineServiceJersey service = fixtures.newRedmineService();
+
+ try {
+ int status = service.ping();
+
+ if (status != 200) {
+
+ // ping was not ok
+ if (log.isInfoEnabled()) {
+ log.info("Will skip test " +
+ RedmineAnonymousServiceJerseyTest.class.getName() +
+ ", since ping status is " + status +
+ " (should be 200 to pass tests...)");
+ }
+ }
+ Assume.assumeTrue(status == 200);
+
+ try {
+ service.login();
+ } catch (RedmineServiceLoginException e) {
+ // ping was not ok
+ if (log.isInfoEnabled()) {
+ log.info("Will skip test " +
+ RedmineAnonymousServiceJerseyTest.class.getName() +
+ ", since login was bad : " + e.getMessage(), e);
+ }
+
+ Assume.assumeTrue(false);
+ }
+ } finally {
+ service.destroy();
+ }
+ }
+
+ @AfterClass
+ public static void afterClass() {
+ fixtures = null;
+ }
+
+ @Before
+ public void setUp() throws Exception {
+ service = fixtures.newRedmineService();
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ ((RedmineServiceImplementor) service).destroy();
+ }
+
+ @Ignore
+ @Test
+ public void getUserProjects() throws Exception {
+ Project[] projects = service.getUserProjects();
+ Assert.assertNotNull(projects);
+ }
+
+ @Ignore
+ @Test
+ public void addVersion() throws Exception {
+
+ Version version = fixtures.getVersion();
+ Version createdVersion = service.addVersion(
+ RedmineFixtures.PROJECT_NAME,
+ version
+ );
+ Assert.assertNotNull(createdVersion);
+ }
+
+ @Ignore
+ @Test
+ public void updateVersion() throws Exception {
+ Version version = fixtures.getVersion();
+ version.setDescription(version.getDescription() + " updated");
+ Version updatedVersion = service.updateVersion(
+ RedmineFixtures.PROJECT_NAME,
+ version
+ );
+ Assert.assertNotNull(updatedVersion);
+ }
+
+ @Ignore
+ @Test
+ public void nextVersion() throws Exception {
+
+ }
+
+ @Test
+ public void addAttachment() throws Exception {
+
+ Version version = fixtures.getVersion();
+ Attachment attachment = fixtures.getAttachment();
+ Attachment updatedAttachment = service.addAttachment(
+ RedmineFixtures.PROJECT_NAME,
+ version.getName(),
+ attachment
+ );
+ Assert.assertNotNull(updatedAttachment);
+ }
+
+ @Ignore
+ @Test
+ public void addNews() throws Exception {
+
+ }
+
+ @Ignore
+ @Test
+ public void addIssueTimeEntry() throws Exception {
+
+ }
+}
Modified: trunk/jredmine-client/src/test/java/org/nuiton/jredmine/TestHelper.java
===================================================================
--- trunk/jredmine-client/src/test/java/org/nuiton/jredmine/TestHelper.java 2012-07-12 14:04:21 UTC (rev 268)
+++ trunk/jredmine-client/src/test/java/org/nuiton/jredmine/TestHelper.java 2012-07-12 14:04:57 UTC (rev 269)
@@ -24,36 +24,14 @@
*/
package org.nuiton.jredmine;
+import com.google.common.collect.Lists;
import junit.framework.Assert;
-import org.nuiton.io.rest.DefaultRestClientConfiguration;
-import org.nuiton.io.rest.RestClientConfiguration;
import org.nuiton.io.xpp3.AbstractXpp3Reader;
import org.nuiton.io.xpp3.PropertyMapper;
import org.nuiton.io.xpp3.Xpp3Helper;
-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.RedmineModelEnum;
-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.ArrayList;
-import java.util.Date;
-import java.util.EnumMap;
import java.util.List;
import java.util.Map;
-import java.util.Properties;
/**
* @author tchemit <chemit(a)codelutin.com>
@@ -61,208 +39,9 @@
*/
public abstract class TestHelper {
- protected static File basedir;
+ public static <T> void assertMyListEquals(Class<T> type, List<T> expecteds, T[] actuals)
+ throws Exception {
- protected static RestClientConfiguration DEFAULT_CONFIGURATION;
-
- protected static Properties defaultConfig;
-
- protected static Properties userConfig;
-
- protected static EnumMap<RedmineModelEnum, List<?>> memoryModel;
-
- public static void initDefaultConfiguration() throws IOException {
-
- if (DEFAULT_CONFIGURATION != null) {
- // deja execute
- return;
- }
-
- defaultConfig = new Properties();
- InputStream stream = TestHelper.class.getResourceAsStream(
- "/test-config.properties");
- try {
- defaultConfig.load(stream);
- } finally {
- stream.close();
- }
-
- userConfig = new Properties(defaultConfig);
- for (String key : System.getenv().keySet()) {
- String env = System.getenv(key);
- if (key.startsWith("test.") && env != null && !env.trim().isEmpty()) {
- userConfig.setProperty(key, env);
- }
- }
-
- RestClientConfiguration configuration = new DefaultRestClientConfiguration();
-
- String url = userConfig.getProperty("test.redmineUrl");
- configuration.setRestUrl(new URL(url));
-
- String username = userConfig.getProperty("test.redmineUsername");
- configuration.setRestUsername(username);
-
- String password = userConfig.getProperty("test.redminePassword");
- configuration.setRestPassword(password);
-
- String e = userConfig.getProperty("test.encoding");
- configuration.setEncoding(e);
-
- String v = userConfig.getProperty("test.verbose");
- configuration.setVerbose(Boolean.valueOf(v));
-
- if (configuration.isVerbose()) {
- System.out.println("default properties ==============================");
- defaultConfig.list(System.out);
-
- System.out.println("users properties ==============================");
- userConfig.list(System.out);
- }
- System.out.println("DEFAULT CONFIGURATION :\n" + configuration);
- DEFAULT_CONFIGURATION = configuration;
- }
-
- public static RestClientConfiguration getTestConfiguration() throws IOException {
-
- if (DEFAULT_CONFIGURATION == null) {
- initDefaultConfiguration();
- }
-
- RestClientConfiguration configuration = new DefaultRestClientConfiguration();
- copyConfiguration(DEFAULT_CONFIGURATION, configuration);
-
- if (isVerbose()) {
- System.out.println("will use configuration : " + configuration);
- }
- return configuration;
- }
-
- public static void copyConfiguration(RestClientConfiguration src, RestClientConfiguration dst) {
- if (src.getRestUrl() != null) {
- dst.setRestUrl(src.getRestUrl());
- }
- if (src.getRestUsername() != null) {
- dst.setRestUsername(src.getRestUsername());
- }
- if (src.getRestPassword() != null) {
- dst.setRestPassword(src.getRestPassword());
- }
- if (src.getEncoding() != null) {
- dst.setEncoding(src.getEncoding());
- }
-
- dst.setVerbose(src.isVerbose());
- }
-
- /** @return the basedir for all tests */
- public static File getBasedir() {
- if (basedir == null) {
- String path = System.getenv("basedir");
- basedir = new File(path == null ? new File("").getAbsolutePath() : path);
- if (isVerbose()) {
- System.out.println("basedir = " + basedir.getAbsolutePath());
- }
- }
- return basedir;
- }
-
- public static void setBasedir(File basedir) {
- TestHelper.basedir = basedir;
- }
-
- public static boolean isVerbose() {
- if (DEFAULT_CONFIGURATION == null) {
- try {
- initDefaultConfiguration();
- } catch (IOException ex) {
- throw new RuntimeException(ex);
- }
- }
- return DEFAULT_CONFIGURATION.isVerbose();
- }
-
- public static File getTestDir(String type, String prefix) {
- String rep = type;
- rep = rep.replaceAll("\\.", File.separator);
-
- File f = new File(getBasedir(), prefix);
- File testDir = new File(f, rep);
- return testDir;
- }
-
- public static File getFile(File base, String... paths) {
- StringBuilder buffer = new StringBuilder();
- for (String path : paths) {
- buffer.append(File.separator).append(path);
- }
- File f = new File(base, buffer.substring(1));
- return f;
- }
-
- public static String getRelativePath(File base, File file) {
- String result = file.getAbsolutePath().substring(base.getAbsolutePath().length() + 1);
- return result;
- }
-
- public static List<Attachment> getAttachments() {
- return getModel(Attachment.class);
- }
-
- public static List<Issue> getIssues() {
- return getModel(Issue.class);
- }
-
- public static List<Project> getProjects() {
- return getModel(Project.class);
- }
-
- public static List<Tracker> getTrackers() {
- return getModel(Tracker.class);
- }
-
- public static List<User> getUsers() {
- return getModel(User.class);
- }
-
- public static List<Version> getVersions() {
- return getModel(Version.class);
- }
-
- @SuppressWarnings("unchecked")
- public static <T> List<T> getModel(Class<T> type) {
- if (memoryModel == null) {
- try {
- loadMemoryModel();
- } catch (Exception ex) {
- throw new RuntimeException(ex);
- }
- }
- return (List<T>) memoryModel.get(RedmineModelEnum.valueOf(type));
- }
-
- public static <T> T getModel(Class<T> type, int pos) {
- if (memoryModel == null) {
- try {
- loadMemoryModel();
- } catch (Exception ex) {
- throw new RuntimeException(ex);
- }
- }
- List<T> ts = (List<T>) memoryModel.get(RedmineModelEnum.valueOf(type));
- return ts.get(pos);
- }
-
- public static void tearDownClass() throws Exception {
- //basedir = null;
- if (memoryModel != null) {
- memoryModel.clear();
- memoryModel = null;
- }
- }
-
- public static <T> void assertMyListEquals(Class<T> type, List<T> expecteds, T[] actuals) throws Exception {
-
Assert.assertNotNull(actuals);
Assert.assertEquals(expecteds.size(), actuals.length);
for (int i = 0, j = expecteds.size(); i < j; i++) {
@@ -273,491 +52,30 @@
}
- public static void assertMyEquals(Class<?> type, Object expected, Object actual) throws Exception {
+ public static void assertMyEquals(Class<?> type, Object expected, Object actual, String... mapperNames)
+ throws Exception {
Assert.assertNotNull(expected);
Assert.assertNotNull(actual);
AbstractXpp3Reader<?> reader = (AbstractXpp3Reader<?>) Xpp3Helper.getReader(type);
Map<String, PropertyMapper> mappers = reader.getMappers(type);
+ List<String> mappersIncludes;
+ if (mapperNames != null && mapperNames.length > 0) {
+ mappersIncludes = Lists.newArrayList(mapperNames);
+ } else {
+ mappersIncludes = null;
+ }
for (PropertyMapper m : mappers.values()) {
- Object expectedValue = m.getDescriptor().getReadMethod().invoke(expected);
- Object actualValue = m.getDescriptor().getReadMethod().invoke(actual);
+ if (mappersIncludes == null || mappersIncludes.contains(m.getPropertyName())) {
- Assert.assertEquals("error in attribute " + m.getPropertyName() + " for " + expected, expectedValue, actualValue);
+ Object expectedValue = m.getDescriptor().getReadMethod().invoke(expected);
+ Object actualValue = m.getDescriptor().getReadMethod().invoke(actual);
+
+ Assert.assertEquals("error in attribute " + m.getPropertyName() + " for " + expected, expectedValue,
+ actualValue);
+ }
}
}
- public static EnumMap<RedmineModelEnum, List<?>> getMemoryModel() {
- return memoryModel;
- }
-
- public static void loadMemoryModel() throws Exception {
-
- List<Object> list;
-
- memoryModel = new EnumMap<RedmineModelEnum, List<?>>(RedmineModelEnum.class);
-
- list = new ArrayList<Object>();
- 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"));
- list.add(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"));
- list.add(tempA);
-
- memoryModel.put(RedmineModelEnum.attachment, list);
-
-
- list = new ArrayList<Object>();
- 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!"));
- list.add(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"));
- list.add(tempI);
-
- memoryModel.put(RedmineModelEnum.issue, list);
-
-
- list = new ArrayList<Object>();
- 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"));
- list.add(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"));
- list.add(tempP);
-
-
- memoryModel.put(RedmineModelEnum.project, list);
-
-
- list = new ArrayList<Object>();
- 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"));
- list.add(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"));
- list.add(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"));
- list.add(tempT);
-
-
- memoryModel.put(RedmineModelEnum.tracker, list);
-
-
- list = new ArrayList<Object>();
- 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"));
- list.add(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"));
- list.add(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"));
- list.add(tempU);
-
- memoryModel.put(RedmineModelEnum.user, list);
-
-
- list = new ArrayList<Object>();
- 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"));
- list.add(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"));
- list.add(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"));
- list.add(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"));
- list.add(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"));
- list.add(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"));
- list.add(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"));
- list.add(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"));
- list.add(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"));
- list.add(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"));
- list.add(tempV);
-
- memoryModel.put(RedmineModelEnum.version, list);
-
-
- IssueStatus tempIS;
- list = new ArrayList<Object>();
- tempIS = new IssueStatus();
- tempIS.setId(1);
- tempIS.setName("Nouveau");
- tempIS.setPosition(1);
- tempIS.setDefaultDoneRatio(10);
- tempIS.setIsClosed(false);
- tempIS.setIsDefault(true);
- list.add(tempIS);
- tempIS = new IssueStatus();
- tempIS.setId(2);
- tempIS.setName("Assigné");
- tempIS.setPosition(2);
- tempIS.setIsClosed(false);
- tempIS.setIsDefault(false);
- list.add(tempIS);
- tempIS = new IssueStatus();
- tempIS.setId(3);
- tempIS.setName("Résolu");
- tempIS.setPosition(3);
- tempIS.setIsClosed(false);
- tempIS.setIsDefault(false);
- list.add(tempIS);
- tempIS = new IssueStatus();
- tempIS.setId(4);
- tempIS.setName("Commentaire");
- tempIS.setPosition(4);
- tempIS.setIsClosed(false);
- tempIS.setIsDefault(false);
- list.add(tempIS);
- tempIS = new IssueStatus();
- tempIS.setId(5);
- tempIS.setName("Fermé");
- tempIS.setPosition(5);
- tempIS.setIsClosed(true);
- tempIS.setIsDefault(false);
- list.add(tempIS);
- tempIS = new IssueStatus();
- tempIS.setId(6);
- tempIS.setPosition(6);
- tempIS.setName("Rejeté");
- tempIS.setIsClosed(true);
- tempIS.setIsDefault(false);
- list.add(tempIS);
-
- memoryModel.put(RedmineModelEnum.issueStatus, list);
-
-
- IssuePriority tempIP;
- list = new ArrayList<Object>();
- 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);
- list.add(tempIP);
- tempIP = new IssuePriority();
- tempIP.setId(4);
- tempIP.setName("Normal");
- tempIP.setPosition(2);
- tempIP.setOpt("IPRI");
- tempIP.setIsDefault(true);
- list.add(tempIP);
- tempIP = new IssuePriority();
- tempIP.setId(5);
- tempIP.setName("Haut");
- tempIP.setPosition(3);
- tempIP.setOpt("IPRI");
- tempIP.setIsDefault(false);
- list.add(tempIP);
- tempIP = new IssuePriority();
- tempIP.setId(6);
- tempIP.setName("Urgent");
- tempIP.setPosition(4);
- tempIP.setOpt("IPRI");
- tempIP.setIsDefault(false);
- list.add(tempIP);
- tempIP = new IssuePriority();
- tempIP.setId(7);
- tempIP.setName("Immédiat");
- tempIP.setPosition(5);
- tempIP.setOpt("IPRI");
- tempIP.setIsDefault(false);
- list.add(tempIP);
-
- memoryModel.put(RedmineModelEnum.issuePriority, list);
-
-
- IssueCategory tempIC;
- list = new ArrayList<Object>();
- tempIC = new IssueCategory();
- tempIC.setId(1);
- tempIC.setName("categorie one");
- tempIC.setProjectId(1);
- list.add(tempIC);
- tempIC = new IssueCategory();
- tempIC.setId(2);
- tempIC.setName("categorie two");
- tempIC.setProjectId(1);
- list.add(tempIC);
-
- memoryModel.put(RedmineModelEnum.issueCategory, list);
-
-
- News tempN;
- list = new ArrayList<Object>();
-
- 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");
- list.add(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");
- list.add(tempN);
-
- memoryModel.put(RedmineModelEnum.news, list);
-
- TimeEntry tempE;
- list = new ArrayList<Object>();
-
- 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");
- list.add(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");
- list.add(tempE);
-
- memoryModel.put(RedmineModelEnum.timeEntry, list);
-
-
- }
}
Modified: trunk/jredmine-client/src/test/java/org/nuiton/jredmine/rest/RedmineRestClientTest.java
===================================================================
--- trunk/jredmine-client/src/test/java/org/nuiton/jredmine/rest/RedmineRestClientTest.java 2012-07-12 14:04:21 UTC (rev 268)
+++ trunk/jredmine-client/src/test/java/org/nuiton/jredmine/rest/RedmineRestClientTest.java 2012-07-12 14:04:57 UTC (rev 269)
@@ -33,12 +33,12 @@
import org.junit.Assume;
import org.junit.Before;
import org.junit.BeforeClass;
+import org.junit.Ignore;
import org.junit.Test;
import org.nuiton.io.rest.RestClientConfiguration;
import org.nuiton.io.rest.RestException;
import org.nuiton.io.rest.RestRequest;
import org.nuiton.jredmine.RedmineTestContract;
-import org.nuiton.jredmine.TestHelper;
import java.io.IOException;
import java.io.InputStream;
@@ -47,6 +47,7 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 1.0.0
*/
+@Ignore
public class RedmineRestClientTest implements RedmineTestContract {
/** Logger. */
@@ -63,21 +64,23 @@
@BeforeClass
public static void setUpClass() throws Exception {
- configuration = TestHelper.getTestConfiguration();
+ Assume.assumeTrue(false);
- RedmineRestClient client = new RedmineRestClient(configuration);
- try {
-
- client.open();
- } catch (Exception e) {
-
- // could not log
- if (log.isWarnEnabled()) {
- log.warn("could not connect to server " + configuration.getRestUrl() + ", will skip test " + RedmineRestClientTest.class.getName());
- }
- } finally {
- Assume.assumeTrue(client.isOpen());
- }
+// configuration = TestHelper.getTestConfiguration();
+//
+// RedmineRestClient client = new RedmineRestClient(configuration);
+// try {
+//
+// client.open();
+// } catch (Exception e) {
+//
+// // could not log
+// if (log.isWarnEnabled()) {
+// log.warn("could not connect to server " + configuration.getRestUrl() + ", will skip test " + RedmineRestClientTest.class.getName());
+// }
+// } finally {
+// Assume.assumeTrue(client.isOpen());
+// }
}
@AfterClass
Modified: trunk/jredmine-client/src/test/resources/test-config.properties
===================================================================
--- trunk/jredmine-client/src/test/resources/test-config.properties 2012-07-12 14:04:21 UTC (rev 268)
+++ trunk/jredmine-client/src/test/resources/test-config.properties 2012-07-12 14:04:57 UTC (rev 269)
@@ -23,8 +23,6 @@
# #L%
###
# default values for test configuration (see org.nuiton.jredmine.TestHelper)
-test.verbose=false
-test.redmineUrl=http://www.mynuiton.org
-test.redmineUsername=chemit
-test.redminePassword=azer
+test.redmineUrl=http://nuiton.org/jredmine
test.encoding=UTF-8
+test.verbose=false
1
0
r268 - in trunk/jredmine-domain: . src/test/java/org/nuiton/jredmine/model/io/xpp3
by tchemit@users.nuiton.org 12 Jul '12
by tchemit@users.nuiton.org 12 Jul '12
12 Jul '12
Author: tchemit
Date: 2012-07-12 16:04:21 +0200 (Thu, 12 Jul 2012)
New Revision: 268
Url: http://nuiton.org/repositories/revision/jredmine/268
Log:
fix test + pom
Modified:
trunk/jredmine-domain/pom.xml
trunk/jredmine-domain/src/test/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3HelperTest.java
Modified: trunk/jredmine-domain/pom.xml
===================================================================
--- trunk/jredmine-domain/pom.xml 2012-07-12 13:46:30 UTC (rev 267)
+++ trunk/jredmine-domain/pom.xml 2012-07-12 14:04:21 UTC (rev 268)
@@ -115,13 +115,14 @@
</dependencies>
- <name>JRedmine :: Client</name>
- <description>The JRedmine client</description>
+ <name>JRedmine :: Client Api</name>
+ <description>
+ The JRedmine client Api (neutral to any redmine version)
+ </description>
<properties>
<!-- extra files to include in release -->
<redmine.releaseFiles>
- target/${project.artifactId}-${project.version}-jredmine_rails.zip,
${redmine.libReleaseFiles}
</redmine.releaseFiles>
</properties>
@@ -167,58 +168,11 @@
<artifactId>plexus-maven-plugin</artifactId>
<version>${plexusPluginVersion}</version>
</plugin>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>cobertura-maven-plugin</artifactId>
- <version>${coberturaPluginVersion}</version>
- </plugin>
-
</plugins>
</reporting>
</profile>
- <profile>
- <id>release-assembly-profile</id>
- <activation>
- <property>
- <name>performRelease</name>
- <value>true</value>
- </property>
- </activation>
- <build>
- <plugins>
- <!-- launch in a release the assembly, but not attach it to project -->
-
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>create-assemblies</id>
- <phase>verify</phase>
- <goals>
- <goal>single</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <attach>false</attach>
- <descriptorRefs>
- <descriptorRef>deps</descriptorRef>
- <descriptorRef>full</descriptorRef>
- </descriptorRefs>
- <descriptors>
- <descriptor>src/main/assembly/jredmine_rails.xml</descriptor>
- </descriptors>
- </configuration>
- </plugin>
-
- </plugins>
-
- </build>
- </profile>
-
</profiles>
</project>
Modified: trunk/jredmine-domain/src/test/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3HelperTest.java
===================================================================
--- trunk/jredmine-domain/src/test/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3HelperTest.java 2012-07-12 13:46:30 UTC (rev 267)
+++ trunk/jredmine-domain/src/test/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3HelperTest.java 2012-07-12 14:04:21 UTC (rev 268)
@@ -191,7 +191,7 @@
@BeforeClass
public static void setUpClass() throws Exception {
- builder = new RedmineXpp3Helper();
+ builder = new DefaultRedmineXpp3Helper();
// setup memory model
fixtures = new RedmineFixtures();
1
0
12 Jul '12
Author: tchemit
Date: 2012-07-12 15:46:30 +0200 (Thu, 12 Jul 2012)
New Revision: 267
Url: http://nuiton.org/repositories/revision/jredmine/267
Log:
improve mojo tests (to be continued...)
Added:
trunk/jredmine-maven-plugin/src/test/resources/test-config.properties
Copied: trunk/jredmine-maven-plugin/src/test/resources/test-config.properties (from rev 257, trunk/jredmine-client/src/test/resources/test-config.properties)
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/test-config.properties (rev 0)
+++ trunk/jredmine-maven-plugin/src/test/resources/test-config.properties 2012-07-12 13:46:30 UTC (rev 267)
@@ -0,0 +1,28 @@
+###
+# #%L
+# JRedmine :: Client
+#
+# $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%
+###
+# default values for test configuration (see org.nuiton.jredmine.TestHelper)
+test.redmineUrl=http://nuiton.org/jredmine
+test.encoding=UTF-8
+test.verbose=false
1
0
r266 - in trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin: . announcement report
by tchemit@users.nuiton.org 12 Jul '12
by tchemit@users.nuiton.org 12 Jul '12
12 Jul '12
Author: tchemit
Date: 2012-07-12 15:45:58 +0200 (Thu, 12 Jul 2012)
New Revision: 266
Url: http://nuiton.org/repositories/revision/jredmine/266
Log:
improve mojo tests (to be continued...)
Added:
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/DisplayDataMojoTest.java
trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/GenerateChangesMojoTest.java
trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/NextVersionMojoTest.java
trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojoTest.java
trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/PublishNewsMojoTest.java
trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/UpdateVersionMojoTest.java
trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojoTest.java
trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojoTest.java
trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/AbstractIssuesReportTest.java
trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByAssigneeTest.java
trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByCategoryTest.java
trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByPriorityTest.java
trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByReporterTest.java
trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByStatusTest.java
trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByTrackerTest.java
trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByVersionTest.java
trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportTest.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-12 13:35:20 UTC (rev 265)
+++ trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/AbstractRedmineMojoTest.java 2012-07-12 13:45:58 UTC (rev 266)
@@ -27,85 +27,136 @@
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;
+import org.junit.AfterClass;
import org.junit.Assert;
+import org.junit.Assume;
import org.junit.BeforeClass;
-import org.nuiton.jredmine.TestHelper;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.model.Project;
+import org.nuiton.jredmine.model.Version;
import org.nuiton.plugin.AbstractMojoTest;
import java.io.File;
-import java.io.IOException;
/**
- * @author chemit
+ * Abstract mojo test.
+ *
* @param <P> type of mojo to test
+ * @author tchemit <chemit(a)codelutin.com>
* @since 1.0.0
*/
-public abstract class AbstractRedmineMojoTest<P extends AbstractRedmineMojo> extends AbstractMojoTest<P> {
+public abstract class AbstractRedmineMojoTest<P extends AbstractRedmineMojo>
+ extends AbstractMojoTest<P> {
+ /** Logger */
+ private static final Log log =
+ LogFactory.getLog(AbstractRedmineMojoTest.class);
+
/**
- * Logger
+ * Fixtures for tests.
+ *
+ * @since 1.4
*/
- private static final Log log = LogFactory.getLog(AbstractRedmineMojoTest.class);
+ protected static JRedminePluginFixtures fixtures;
+ /**
+ * Flag to know which configuration is need (anonymous or loggued).
+ *
+ * @since 1.4
+ */
+ protected final boolean anonynous;
+
+ protected boolean canContinue;
+
@BeforeClass
- public static void atTheBegining() throws IOException {
+ public static void beforeClass() {
+ fixtures = new JRedminePluginFixtures();
+ }
- // load default configuration
- TestHelper.initDefaultConfiguration();
- // load basedir
- TestHelper.getBasedir();
+ @AfterClass
+ public static void afterClass() {
+ fixtures = null;
}
- protected boolean canContinue;
+ @After
+ public void tearDown() throws Exception {
+ P mojo = getMojo();
+ if (mojo != null) {
+ mojo.afterExecute();
+ }
+ }
- protected void beforeMojoInit(P mojo, File pomFile) throws Exception {
- // add a issue management
- IssueManagement i = new IssueManagement();
- i.setSystem(AbstractRedmineMojo.REDMINE_SYSTEM);
- i.setUrl(mojo.getRestUrl() + "/projects/one/issues");
- mojo.getProject().setIssueManagement(i);
+ protected AbstractRedmineMojoTest() {
+ this(true);
}
+ protected AbstractRedmineMojoTest(boolean anonynous) {
+ this.anonynous = anonynous;
+ }
+
@Override
- protected void setUpMojo(P mojo, File pomFile) throws Exception {
+ protected void setUpMojo(P mojo, File pomFile)
+ throws Exception {
super.setUpMojo(mojo, pomFile);
+ RedmineServiceConfiguration configuration;
+
+ if (anonynous) {
+ configuration = fixtures.getAnonymousConfiguration();
+ } else {
+ configuration = fixtures.getLogguedConfiguration();
+
+ if (StringUtils.isEmpty(configuration.getRestUsername()) ||
+ StringUtils.isEmpty(configuration.getRestPassword())) {
+
+ if (log.isWarnEnabled()) {
+ log.warn("Loggued configuration is required, but not found " +
+ "login nor password");
+ }
+ canContinue = false;
+ return;
+ }
+ }
+ mojo.setAnonymous(anonynous);
+
// copy redmine test server configuration
- TestHelper.copyConfiguration(TestHelper.getTestConfiguration(), mojo);
+ fixtures.copyConfiguration(configuration, mojo);
- beforeMojoInit(mojo, pomFile);
+ // copy issue management to project
+ IssueManagement i = fixtures.getIssumeManagement();
+ mojo.getProject().setIssueManagement(i);
+ Project project = fixtures.getProject();
+ mojo.setProjectId(project.getName());
+
+ Version version = fixtures.getVersion();
+ mojo.setVersionId(version.getName());
+
try {
mojo.init();
canContinue = mojo.checkSkip();
if (!canContinue) {
if (log.isInfoEnabled()) {
- log.info("The goal was marked as to be skip, the test is done.");
+ log.info("The goal was marked as to be skip, " +
+ "the test is done.");
}
return;
}
} catch (Exception e) {
- log.error(e);
+ log.warn("setup was not successfull, will skip this test [" +
+ getClass() + "]", e);
canContinue = false;
}
if (canContinue) {
if (mojo.isVerbose()) {
log.info("setup done for " + mojo.getProject().getFile().getName());
}
- } else {
- log.warn("setup was not successfull, will skip this test [" + getClass() + "]");
}
+ Assume.assumeTrue(canContinue);
}
- @After
- public void tearDown() throws Exception {
- P mojo = getMojo();
- if (mojo != null) {
- mojo.closeService();
- }
- }
-
protected void mojoDoAction() throws Exception {
if (!canContinue) {
return;
@@ -118,4 +169,5 @@
mojo.afterExecute();
}
}
+
}
Modified: trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/DisplayDataMojoTest.java
===================================================================
--- trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/DisplayDataMojoTest.java 2012-07-12 13:35:20 UTC (rev 265)
+++ trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/DisplayDataMojoTest.java 2012-07-12 13:45:58 UTC (rev 266)
@@ -27,7 +27,9 @@
import org.junit.Test;
/**
- * @author tchemit
+ * Tests the {@link DisplayDataMojo} mojo.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
* @since 1.0.0
*/
public class DisplayDataMojoTest extends AbstractRedmineMojoTest<DisplayDataMojo> {
Copied: trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/FakeRedmineServiceConfiguration.java (from rev 257, trunk/jredmine-client/src/test/java/org/nuiton/jredmine/FakeRedmineServiceConfiguration.java)
===================================================================
--- trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/FakeRedmineServiceConfiguration.java (rev 0)
+++ trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/FakeRedmineServiceConfiguration.java 2012-07-12 13:45:58 UTC (rev 266)
@@ -0,0 +1,105 @@
+package org.nuiton.jredmine.plugin;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.lang.builder.ToStringStyle;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+
+import java.net.URL;
+
+/**
+ * Configuration of a redmine service for test purposes.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public 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();
+ }
+}
Modified: trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/GenerateChangesMojoTest.java
===================================================================
--- trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/GenerateChangesMojoTest.java 2012-07-12 13:35:20 UTC (rev 265)
+++ trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/GenerateChangesMojoTest.java 2012-07-12 13:45:58 UTC (rev 266)
@@ -27,7 +27,9 @@
import org.junit.Test;
/**
- * @author tchemit
+ * Tests the {@link GenerateChangesMojo} mojo.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
* @since 1.0.0
*/
public class GenerateChangesMojoTest extends AbstractRedmineMojoTest<GenerateChangesMojo> {
@@ -37,10 +39,13 @@
return "generate-changes";
}
+ public GenerateChangesMojoTest() {
+ super(false);
+ }
+
@Test
public void generateChanges() throws Exception {
-
mojoDoAction();
//TODO check file is generated
}
Added: 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 (rev 0)
+++ trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/JRedminePluginFixtures.java 2012-07-12 13:45:58 UTC (rev 266)
@@ -0,0 +1,162 @@
+package org.nuiton.jredmine.plugin;
+
+import com.google.common.base.Charsets;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.maven.model.IssueManagement;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.model.Project;
+import org.nuiton.jredmine.model.Version;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Properties;
+
+/**
+ * Fixtures to test the goals of the jredmine-maven-plugin.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.5
+ */
+public class JRedminePluginFixtures {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(JRedminePluginFixtures.class);
+
+ private RedmineServiceConfiguration anonymousConfiguration;
+
+ private RedmineServiceConfiguration logguedConfiguration;
+
+ public 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);
+ }
+ return anonymousConfiguration;
+ }
+
+ public 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");
+ logguedConfiguration.setRestUsername(login);
+ logguedConfiguration.setRestPassword(password);
+ logguedConfiguration.setAnonymous(false);
+ }
+ }
+ return logguedConfiguration;
+ }
+
+ public Project getProject() {
+ Project project = new Project();
+ project.setName("jredmine");
+ project.setIdentifier("jredmine");
+ project.setIsPublic(true);
+ project.setHomepage("http://maven-site.nuiton.org/jredmine");
+ project.setDescription(
+ "Permet de communiquer en java avec un serveur " +
+ "redmine qui a installé le plugin rails jredmine");
+ project.setId(36);
+ project.setStatus(1);
+ return project;
+ }
+
+ public Version getVersion() {
+ Version version = new Version();
+ version.setName("1.3");
+ version.setId(295);
+ version.setProjectId(36);
+ return version;
+ }
+
+
+ public IssueManagement getIssumeManagement()
+ throws Exception {
+ // add a issue management
+ IssueManagement i = new IssueManagement();
+ i.setSystem(AbstractRedmineMojo.REDMINE_SYSTEM);
+ i.setUrl(getAnonymousConfiguration().getRestUrl() +
+ "/projects/jredmine/issues");
+ return i;
+ }
+
+ public void copyConfiguration(RedmineServiceConfiguration src,
+ RedmineServiceConfiguration dst) {
+ if (src.getRestUrl() != null) {
+ dst.setRestUrl(src.getRestUrl());
+ }
+ if (src.getRestUsername() != null) {
+ dst.setRestUsername(src.getRestUsername());
+ }
+ if (src.getRestPassword() != null) {
+ dst.setRestPassword(src.getRestPassword());
+ }
+ if (src.getEncoding() != null) {
+ dst.setEncoding(src.getEncoding());
+ }
+
+ dst.setVerbose(src.isVerbose());
+ dst.setAnonymous(src.isAnonymous());
+ }
+}
Modified: trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/NextVersionMojoTest.java
===================================================================
--- trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/NextVersionMojoTest.java 2012-07-12 13:35:20 UTC (rev 265)
+++ trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/NextVersionMojoTest.java 2012-07-12 13:45:58 UTC (rev 266)
@@ -24,14 +24,22 @@
*/
package org.nuiton.jredmine.plugin;
+import org.junit.Ignore;
import org.junit.Test;
/**
- * @author tchemit
+ * Tests the {@link NextVersionMojo} mojo.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
* @since 1.0.0
*/
+@Ignore
public class NextVersionMojoTest extends AbstractRedmineMojoTest<NextVersionMojo> {
+ public NextVersionMojoTest() {
+ super(false);
+ }
+
@Override
protected String getGoalName(String methodName) {
return "next-version";
@@ -40,12 +48,12 @@
@Test
public void nextVersion() throws Exception {
- mojoDoAction();
+ getMojo().doAction();
}
@Test
public void skipNextVersion() throws Exception {
- mojoDoAction();
+ getMojo().doAction();;
}
}
Modified: trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojoTest.java
===================================================================
--- trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojoTest.java 2012-07-12 13:35:20 UTC (rev 265)
+++ trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojoTest.java 2012-07-12 13:45:58 UTC (rev 266)
@@ -24,14 +24,22 @@
*/
package org.nuiton.jredmine.plugin;
+import org.junit.Ignore;
import org.junit.Test;
/**
- * @author tchemit
+ * Tests the {@link PublishAttachmentsMojo} mojo.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
* @since 1.0.0
*/
+@Ignore
public class PublishAttachmentsMojoTest extends AbstractRedmineMojoTest<PublishAttachmentsMojo> {
+ public PublishAttachmentsMojoTest() {
+ super(false);
+ }
+
@Override
protected String getGoalName(String methodName) {
return "publish-attachments";
@@ -40,12 +48,12 @@
@Test
public void publishAttachments() throws Exception {
- mojoDoAction();
+ getMojo().doAction();
}
@Test
public void skipPublishAttachments() throws Exception {
- mojoDoAction();
+ getMojo().doAction();
}
}
Modified: trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/PublishNewsMojoTest.java
===================================================================
--- trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/PublishNewsMojoTest.java 2012-07-12 13:35:20 UTC (rev 265)
+++ trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/PublishNewsMojoTest.java 2012-07-12 13:45:58 UTC (rev 266)
@@ -24,14 +24,22 @@
*/
package org.nuiton.jredmine.plugin;
+import org.junit.Ignore;
import org.junit.Test;
/**
- * @author tchemit
+ * Tests the {@link PublishNewsMojo} mojo.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
* @since 1.0.0
*/
+@Ignore
public class PublishNewsMojoTest extends AbstractRedmineMojoTest<PublishNewsMojo> {
+ public PublishNewsMojoTest() {
+ super(false);
+ }
+
@Override
protected String getGoalName(String methodName) {
return "publish-news";
@@ -40,12 +48,12 @@
@Test
public void publishNews() throws Exception {
- mojoDoAction();
+ getMojo().doAction();
}
@Test
public void skipPublishNews() throws Exception {
- mojoDoAction();
+ getMojo().doAction();
}
}
Modified: trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/UpdateVersionMojoTest.java
===================================================================
--- trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/UpdateVersionMojoTest.java 2012-07-12 13:35:20 UTC (rev 265)
+++ trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/UpdateVersionMojoTest.java 2012-07-12 13:45:58 UTC (rev 266)
@@ -24,14 +24,22 @@
*/
package org.nuiton.jredmine.plugin;
+import org.junit.Ignore;
import org.junit.Test;
/**
- * @author tchemit
+ * Tests the {@link UpdateVersionMojo} mojo.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
* @since 1.0.0
*/
+@Ignore
public class UpdateVersionMojoTest extends AbstractRedmineMojoTest<UpdateVersionMojo> {
+ public UpdateVersionMojoTest() {
+ super(false);
+ }
+
@Override
protected String getGoalName(String methodName) {
return "update-version";
@@ -40,12 +48,12 @@
@Test
public void updateVersion() throws Exception {
- mojoDoAction();
+ getMojo().doAction();
}
@Test
public void skipUpdateVersion() throws Exception {
- mojoDoAction();
+ getMojo().doAction();
}
}
Modified: trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojoTest.java
===================================================================
--- trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojoTest.java 2012-07-12 13:35:20 UTC (rev 265)
+++ trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojoTest.java 2012-07-12 13:45:58 UTC (rev 266)
@@ -28,8 +28,8 @@
import org.nuiton.jredmine.plugin.AbstractRedmineMojoTest;
/**
- *
- * @author chemit
+ * Tests the {@link GenerateEmailAnnouncementMojo} mojo.
+ * @author tchemit <chemit(a)codelutin.com>
* @since 1.0.0
*/
public class GenerateEmailAnnouncementMojoTest extends AbstractRedmineMojoTest<GenerateEmailAnnouncementMojo> {
@@ -39,6 +39,10 @@
return "generate-email-announcement";
}
+ public GenerateEmailAnnouncementMojoTest() {
+ super(false);
+ }
+
@Test
public void generateEmailAnnouncement() throws Exception {
Modified: trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojoTest.java
===================================================================
--- trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojoTest.java 2012-07-12 13:35:20 UTC (rev 265)
+++ trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojoTest.java 2012-07-12 13:45:58 UTC (rev 266)
@@ -28,8 +28,9 @@
import org.nuiton.jredmine.plugin.AbstractRedmineMojoTest;
/**
+ * Tests the {@link GenerateNewsAnnouncementMojo} mojo.
*
- * @author chemit
+ * @author tchemit <chemit(a)codelutin.com>
* @since 1.0.0
*/
public class GenerateNewsAnnouncementMojoTest extends AbstractRedmineMojoTest<GenerateNewsAnnouncementMojo> {
Modified: trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/AbstractIssuesReportTest.java
===================================================================
--- trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/AbstractIssuesReportTest.java 2012-07-12 13:35:20 UTC (rev 265)
+++ trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/AbstractIssuesReportTest.java 2012-07-12 13:45:58 UTC (rev 266)
@@ -24,13 +24,23 @@
*/
package org.nuiton.jredmine.plugin.report;
-import org.junit.Assume;
+import junit.framework.Assert;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
+import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
+import org.apache.maven.artifact.repository.DefaultArtifactRepositoryFactory;
+import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
import org.junit.Test;
import org.nuiton.jredmine.plugin.AbstractRedmineMojoTest;
+import org.nuiton.plugin.TestHelper;
+import java.io.File;
+
/**
+ * Abstract report test.
+ *
* @param <P> type of issue reports to test
- * @author tchemit
+ * @author tchemit <chemit(a)codelutin.com>
* @since 1.0.0
*/
public abstract class AbstractIssuesReportTest<P extends AbstractIssuesReport> extends AbstractRedmineMojoTest<P> {
@@ -38,20 +48,37 @@
@Test
public void issueReport() throws Exception {
- mojoDoreport();
+ mojoDoAction();
checkDoreport();
}
- protected void mojoDoreport() throws Exception {
+ protected void checkDoreport() throws Exception {
+ //TODO do some tests : file is generated
- Assume.assumeTrue(canContinue);
-
- //TODO make this possible
- //getMojo().executeReport(Locale.FRENCH);
+ String outputName = getMojo().getOutputName()+".html";
+ File reportFile = new File(getMojo().outputDirectory, outputName);
+ Assert.assertTrue(reportFile.exists());
}
- protected void checkDoreport() throws Exception {
- //TODO do some tests : file is generated
+ @Override
+ protected void setUpMojo(P mojo, File pomFile) throws Exception {
+ super.setUpMojo(mojo, pomFile);
+
+ mojo.outputDirectory = new File("target" + File.separator + "surefire-workdir" + File.separator + getClass().getName());
+
+ ArtifactRepositoryFactory f = (ArtifactRepositoryFactory) TestHelper.getDelegateMojoTest().getContainer().lookup(
+ DefaultArtifactRepositoryFactory.ROLE
+ );
+
+ ArtifactRepository local = f.createArtifactRepository(
+ "local",
+ "file://" + new File("target" + File.separator + "myRepo").getAbsolutePath(),
+ new DefaultRepositoryLayout(),
+ new ArtifactRepositoryPolicy(),
+ new ArtifactRepositoryPolicy());
+
+ getMojo().localRepository = local;
+
}
}
Modified: trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByAssigneeTest.java
===================================================================
--- trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByAssigneeTest.java 2012-07-12 13:35:20 UTC (rev 265)
+++ trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByAssigneeTest.java 2012-07-12 13:45:58 UTC (rev 266)
@@ -25,7 +25,9 @@
package org.nuiton.jredmine.plugin.report;
/**
- * @author tchemit
+ * Tests the {@link IssuesReportByAssignee} report.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
* @since 1.0.0
*/
public class IssuesReportByAssigneeTest extends AbstractIssuesReportTest<IssuesReportByAssignee> {
Modified: trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByCategoryTest.java
===================================================================
--- trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByCategoryTest.java 2012-07-12 13:35:20 UTC (rev 265)
+++ trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByCategoryTest.java 2012-07-12 13:45:58 UTC (rev 266)
@@ -25,7 +25,9 @@
package org.nuiton.jredmine.plugin.report;
/**
- * @author tchemit
+ * Tests the {@link IssuesReportByAssignee} report.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
* @since 1.0.0
*/
public class IssuesReportByCategoryTest extends AbstractIssuesReportTest<IssuesReportByAssignee> {
Modified: trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByPriorityTest.java
===================================================================
--- trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByPriorityTest.java 2012-07-12 13:35:20 UTC (rev 265)
+++ trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByPriorityTest.java 2012-07-12 13:45:58 UTC (rev 266)
@@ -25,7 +25,9 @@
package org.nuiton.jredmine.plugin.report;
/**
- * @author tchemit
+ * Tests the {@link IssuesReportByAssignee} report.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
* @since 1.0.0
*/
public class IssuesReportByPriorityTest extends AbstractIssuesReportTest<IssuesReportByAssignee> {
Modified: trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByReporterTest.java
===================================================================
--- trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByReporterTest.java 2012-07-12 13:35:20 UTC (rev 265)
+++ trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByReporterTest.java 2012-07-12 13:45:58 UTC (rev 266)
@@ -25,7 +25,9 @@
package org.nuiton.jredmine.plugin.report;
/**
- * @author tchemit
+ * Tests the {@link IssuesReportByAssignee} report.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
* @since 1.0.0
*/
public class IssuesReportByReporterTest extends AbstractIssuesReportTest<IssuesReportByAssignee> {
Modified: trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByStatusTest.java
===================================================================
--- trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByStatusTest.java 2012-07-12 13:35:20 UTC (rev 265)
+++ trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByStatusTest.java 2012-07-12 13:45:58 UTC (rev 266)
@@ -25,7 +25,9 @@
package org.nuiton.jredmine.plugin.report;
/**
- * @author tchemit
+ * Tests the {@link IssuesReportByAssignee} report.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
* @since 1.0.0
*/
public class IssuesReportByStatusTest extends AbstractIssuesReportTest<IssuesReportByAssignee> {
Modified: trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByTrackerTest.java
===================================================================
--- trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByTrackerTest.java 2012-07-12 13:35:20 UTC (rev 265)
+++ trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByTrackerTest.java 2012-07-12 13:45:58 UTC (rev 266)
@@ -25,7 +25,9 @@
package org.nuiton.jredmine.plugin.report;
/**
- * @author tchemit
+ * Tests the {@link IssuesReportByAssignee} report.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
* @since 1.0.0
*/
public class IssuesReportByTrackerTest extends AbstractIssuesReportTest<IssuesReportByAssignee> {
Modified: trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByVersionTest.java
===================================================================
--- trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByVersionTest.java 2012-07-12 13:35:20 UTC (rev 265)
+++ trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByVersionTest.java 2012-07-12 13:45:58 UTC (rev 266)
@@ -25,7 +25,9 @@
package org.nuiton.jredmine.plugin.report;
/**
- * @author tchemit
+ * Tests the {@link IssuesReportByAssignee} report.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
* @since 1.0.0
*/
public class IssuesReportByVersionTest extends AbstractIssuesReportTest<IssuesReportByAssignee> {
Modified: trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportTest.java
===================================================================
--- trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportTest.java 2012-07-12 13:35:20 UTC (rev 265)
+++ trunk/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportTest.java 2012-07-12 13:45:58 UTC (rev 266)
@@ -25,10 +25,12 @@
package org.nuiton.jredmine.plugin.report;
/**
- * @author tchemit
+ * Tests the {@link IssuesReport} report.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
* @since 1.0.0
*/
-public class IssuesReportTest extends AbstractIssuesReportTest<IssuesReportByAssignee> {
+public class IssuesReportTest extends AbstractIssuesReportTest<IssuesReport> {
@Override
protected String getGoalName(String methodName) {
1
0
Author: tchemit
Date: 2012-07-12 15:35:20 +0200 (Thu, 12 Jul 2012)
New Revision: 265
Url: http://nuiton.org/repositories/revision/jredmine/265
Log:
move some stuff from client to domain module
Added:
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineAnonymousService.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineLogguedService.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineRestUnavailable.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineService.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceConfiguration.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceException.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceLoginException.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/DefaultRedmineXpp3Helper.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/DefaultRedmineRequestBuilder.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/IssueScopeRedmineRequestBuilder.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/ProjectScopeRedmineRequestBuilder.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/RedmineRequest.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/RedmineRequestBuilder.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/RedmineRequestFactory.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/VersionScopeRedmineRequestBuilder.java
Removed:
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineAnonymousService.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineLogguedService.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineService.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceConfiguration.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceException.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceLoginException.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelScope.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/DefaultRedmineRequestBuilder.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/IssueScopeRedmineRequestBuilder.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/ProjectScopeRedmineRequestBuilder.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/RedmineRequest.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/RedmineRequestBuilder.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/RedmineRequestFactory.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/VersionScopeRedmineRequestBuilder.java
trunk/jredmine-client/src/test/java/org/nuiton/jredmine/model/io/
Modified:
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Attachment.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/CustomField.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/I18nAble.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IdAble.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Issue.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IssueCategory.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IssuePriority.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IssueStatus.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/ModelHelper.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/News.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Project.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/ProjectRef.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/TimeEntry.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Tracker.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/User.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/UserRef.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Version.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/VersionStatusEnum.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/AttachmentXpp3Reader.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/CustomFieldXpp3Reader.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueCategoryXpp3Reader.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssuePriorityXpp3Reader.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueStatusXpp3Reader.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueXpp3Reader.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/NewsXpp3Reader.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectRefXpp3Reader.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectXpp3Reader.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineDataConverter.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3Helper.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/TimeEntryXpp3Reader.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/TrackerXpp3Reader.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserRefXpp3Reader.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserXpp3Reader.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/VersionXpp3Reader.java
Deleted: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineAnonymousService.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineAnonymousService.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineAnonymousService.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,223 +0,0 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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;
-
-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;
-
-/**
- * Contract of all redmine operations which do not requires any login to server.
- * <p/>
- * A default implementation is {@link DefaultRedmineAnonymousService}.
- * <p/>
- * Created: 2 janv. 2010
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @see DefaultRedmineAnonymousService
- * @since 1.0.3
- */
-public interface RedmineAnonymousService {
-
- /**
- * Obtain all accessible projects.
- *
- * @return all the projects
- * @throws RedmineServiceException if any pb while retriving datas
- * @see Project
- */
- Project[] getProjects() throws RedmineServiceException;
-
- /**
- * Obtain all the priorities defined on a {@link Issue}.
- * <p/>
- * <b>Note : </b> The priorities are common for all projects.
- *
- * @return all the issue properties
- * @throws RedmineServiceException if any pb while retriving datas
- * @see IssuePriority
- */
- IssuePriority[] getIssuePriorities() throws RedmineServiceException;
-
- /**
- * Obtain all the statuses defined on a {@link Issue}.
- * <p/>
- * <b>Note : </b> The statuses are common for all projects.
- *
- * @return all the issue statuses
- * @throws RedmineServiceException if any pb while retriving datas
- * @see IssueStatus
- */
- IssueStatus[] getIssueStatuses() throws RedmineServiceException;
-
- /**
- * Obtain a project given his name.
- *
- * @param projectName the name of the project
- * @return the project
- * @throws RedmineServiceException if any pb while retriving datas
- * @see Project
- */
- Project getProject(String projectName) throws RedmineServiceException;
-
- /**
- * Obtain all categories defined on issues for a given project.
- *
- * @param projectName the name of the project
- * @return the categories of issues for the given project.
- * @throws RedmineServiceException if any pb while retriving datas
- * @see IssueCategory
- */
- IssueCategory[] getIssueCategories(String projectName) throws RedmineServiceException;
-
- /**
- * Obtain all trackers defined on a given project.
- *
- * @param projectName the name of the project
- * @return the trackers for the given project.
- * @throws RedmineServiceException if any pb while retriving datas
- * @see Tracker
- */
- Tracker[] getTrackers(String projectName) throws RedmineServiceException;
-
- /**
- * Obtain all news defined on a given project.
- *
- * @param projectName the name of the project
- * @return the news for the given project.
- * @throws RedmineServiceException if any pb while retriving datas
- * @see News
- */
- News[] getNews(String projectName) throws RedmineServiceException;
-
- /**
- * Obtain all users defined on a given project.
- *
- * @param projectName the name of the project
- * @return the users for the given project.
- * @throws RedmineServiceException if any pb while retriving datas
- * @see User
- */
- User[] getProjectMembers(String projectName) throws RedmineServiceException;
-
- /**
- * Obtain all versions defined on a given project.
- *
- * @param projectName the name of the project
- * @return the versions of the given project.
- * @throws RedmineServiceException if any pb while retriving datas
- * @see Version
- */
- Version[] getVersions(String projectName) throws RedmineServiceException;
-
- /**
- * Obtain a specific version for a given project.
- *
- * @param projectName the name of the project
- * @param versionName the name of the version
- * @return the version
- * @throws RedmineServiceException if any pb while retriving datas
- * @see Version
- */
- Version getVersion(String projectName,
- String versionName) throws RedmineServiceException;
-
- /**
- * Obtain all issues for a given project.
- *
- * @param projectName the name of the project
- * @return the issues
- * @throws RedmineServiceException if any pb while retriving datas
- * @see Issue
- * @since 1.0.3
- */
- Issue[] getIssues(String projectName) throws RedmineServiceException;
-
- /**
- * Obtain all opened issues for a given project.
- *
- * @param projectName the name of the project
- * @return the issues
- * @throws RedmineServiceException if any pb while retriving datas
- * @see Issue
- * @since 1.0.3
- */
- Issue[] getOpenedIssues(String projectName) throws RedmineServiceException;
-
- /**
- * Obtain all closed issues for a given project.
- *
- * @param projectName the name of the project
- * @return the issues
- * @throws RedmineServiceException if any pb while retriving datas
- * @see Issue
- * @since 1.0.3
- */
- Issue[] getClosedIssues(String projectName) throws RedmineServiceException;
-
- /**
- * Obtain all issues for a specific version on a given project.
- *
- * @param projectName the name of the project
- * @param versionName the name of the version
- * @return the issues
- * @throws RedmineServiceException if any pb while retriving datas
- * @see Issue
- */
- Issue[] getIssues(String projectName,
- String versionName) throws RedmineServiceException;
-
- /**
- * Obtain for a given issue of a given project all the time entries.
- *
- * @param projectName the name of the project
- * @param issueId the id of the issue
- * @return the time entries of the issue
- * @throws RedmineServiceException if any pb while retrieving time entries of the issue
- * @since 1.0.3
- */
- TimeEntry[] getIssueTimeEntries(String projectName,
- String issueId) throws RedmineServiceException;
-
- /**
- * Obtain all attachments for a specific version on a given project.
- *
- * @param projectName the name of the project
- * @param versionName the name of the version
- * @return the attachments
- * @throws RedmineServiceException if any pb while retriving datas
- * @see Attachment
- */
- Attachment[] getAttachments(String projectName,
- String versionName) throws RedmineServiceException;
-}
Deleted: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineLogguedService.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineLogguedService.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineLogguedService.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,161 +0,0 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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;
-
-import org.nuiton.jredmine.model.Attachment;
-import org.nuiton.jredmine.model.Issue;
-import org.nuiton.jredmine.model.News;
-import org.nuiton.jredmine.model.Project;
-import org.nuiton.jredmine.model.TimeEntry;
-import org.nuiton.jredmine.model.Version;
-
-
-/**
- * Contract of all redmine operations that needs a login to be performed.
- * <p/>
- * A default implementation is offered in {@link DefaultRedmineService}.
- * <p/>
- * Created: 2 janv. 2010
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @see RedmineAnonymousService
- * @see RedmineService
- * @since 1.0.3
- */
-public interface RedmineLogguedService {
-
- /**
- * Obtain for the loggued user, all projets where he belongs.
- * <p/>
- * <b>Note:</b> This method requires to be loggued on redmine server.
- *
- * @return all the projects belonged by the loggued user
- * @throws RedmineServiceException if any pb while retriving datas
- * @see Project
- * @since 1.0.3
- */
- Project[] getUserProjects() throws RedmineServiceException;
-
- /**
- * Add a version for a given project.
- * <p/>
- * b>Note:</b> This method requires to be loggued on redmine server.
- *
- * @param projectName the name of the project
- * @param version the version to add
- * @return the added version
- * @throws RedmineServiceException if any pb while sending and retriving
- * datas to redmine server
- * @see Version
- */
- Version addVersion(String projectName,
- Version version) throws RedmineServiceException;
-
- /**
- * Update a version for a given project.
- * <p/>
- * b>Note:</b> This method requires to be loggued on redmine server.
- *
- * @param projectName the name of the project
- * @param version the version to update
- * @return the updated version
- * @throws RedmineServiceException if any pb while sending and retriving
- * datas to redmine server
- * @see Version
- */
- Version updateVersion(String projectName,
- Version version) throws RedmineServiceException;
-
- /**
- * Prepare a new version (create it or update it).
- * <p/>
- * If the {@code oldVersionName} is given, then all issues unclosed from this
- * old version will be move to the new version.
- * <p/>
- * b>Note:</b> This method requires to be loggued on redmine server.
- *
- * @param projectName the name of the project
- * @param oldVersionName the name of the old version (optional)
- * @param newVersion the newVersion to create or update
- * @return the created version
- * @throws RedmineServiceException if any pb while sending and retriving
- * datas to redmine server
- * @see Version
- */
- Version nextVersion(String projectName,
- String oldVersionName,
- Version newVersion) throws RedmineServiceException;
-
- /**
- * Add a news for a given project.
- * <p/>
- * b>Note:</b> This method requires to be loggued on redmine server.
- *
- * @param projectName the name of the project
- * @param news the news to add
- * @return the added news.
- * @throws RedmineServiceException if any pb while sending and retriving
- * datas to redmine server
- * @see News
- */
- News addNews(String projectName, News news) throws RedmineServiceException;
-
- /**
- * Add a attachment for a given version of a given project.
- * <p/>
- * b>Note:</b> This method requires to be loggued on redmine server.
- *
- * @param projectName the name of the project
- * @param versionName the name of the version
- * @param attachement the attachment to add
- * @return the added attachment
- * @throws RedmineServiceException if any pb while sending and retriving
- * datas to redmine server
- * @see Attachment
- */
- Attachment addAttachment(String projectName,
- String versionName,
- Attachment attachement) throws RedmineServiceException;
-
- /**
- * Add a new time entry to the given issue for the given project and
- * return the updated time entry.
- * <p/>
- * b>Note:</b> This method requires to be loggued on redmine server.
- *
- * @param projectName the name of the project
- * @param issueId the id of the issue to update
- * @param entry time entry to add
- * @return the created time entry
- * @throws RedmineServiceException if any pb while sending or retrieving
- * datas to redmine server
- * @see Issue
- * @see TimeEntry
- * @since 1.0.3
- */
- TimeEntry addIssueTimeEntry(String projectName,
- String issueId,
- TimeEntry entry) throws RedmineServiceException;
-}
Deleted: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineService.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineService.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineService.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,42 +0,0 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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;
-
-/**
- * The full redmine service with anonymous and loggued methods.
- * <p/>
- * <b>Note:</b> A default implementation is offered :
- * {@link DefaultRedmineService}
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @see DefaultRedmineService
- * @since 1.0.0
- */
-public interface RedmineService extends RedmineAnonymousService, RedmineLogguedService {
-
- /** Plexus lookup name. */
- String ROLE = RedmineService.class.getName();
-
-}
Deleted: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceConfiguration.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceConfiguration.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceConfiguration.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,62 +0,0 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $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%
- */
-package org.nuiton.jredmine;
-
-import org.nuiton.io.rest.RestClientConfiguration;
-
-import java.net.URL;
-
-/**
- * Contract of a redmine service configuration.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.4
- */
-public interface RedmineServiceConfiguration extends RestClientConfiguration {
-
- String getEncoding();
-
- void setEncoding(String encoding);
-
- String getRestPassword();
-
- void setRestPassword(String restPassword);
-
- URL getRestUrl();
-
- void setRestUrl(URL restUrl);
-
- String getRestUsername();
-
- void setRestUsername(String restUsername);
-
- boolean isVerbose();
-
- void setVerbose(boolean verbose);
-
- boolean isAnonymous();
-
- void setAnonymous(boolean anonymous);
-}
Deleted: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceException.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceException.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceException.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,51 +0,0 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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;
-
-/**
- * An exception to throw when something is wrong in a {@link RedmineService}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0.0
- */
-public class RedmineServiceException extends Exception {
-
- private static final long serialVersionUID = 1L;
-
- public RedmineServiceException(Throwable cause) {
- super(cause);
- }
-
- public RedmineServiceException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public RedmineServiceException(String message) {
- super(message);
- }
-
- public RedmineServiceException() {
- }
-}
Deleted: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,142 +0,0 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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;
-
-import org.nuiton.jredmine.rest.RedmineRestClient;
-
-/**
- * Technical contract to implements a redmine service which wrap the
- * {@link RedmineRestClient}.
- * <p/>
- * A default implementation is offered in {@link DefaultRedmineServiceImplementor}.
- * <p/>
- * Any concrete implentation of a redmine service should implements this..
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @see DefaultRedmineServiceImplementor
- * @since 1.0.0
- */
-public interface RedmineServiceImplementor {
-
- /**
- * Tests if the service is loogued to the redmine service.
- *
- * @return {@code true} is service is init and loggued to Redmine service,
- * {@code false} otherwise.
- */
- boolean isInit();
-
- /**
- * Initialize the service given a client configuration.
- *
- * @param configuration the configuration to be used to init the internal redmine client
- * @return the initialized service
- * @throws RedmineServiceException if any pb
- */
- RedmineServiceImplementor init(RedmineServiceConfiguration configuration) throws RedmineServiceException;
-
- /**
- * Close the service and destroy any connexion to the redmine service.
- *
- * @throws RedmineServiceException if any pb
- */
- void destroy() throws RedmineServiceException;
-
- /**
- * Try to ping the redmine remote service and return his status.
- *
- * @return status code of the ping request, or {@code -1} if something was
- * wrong (unknown host,...).
- */
- int ping();
-
- /**
- * Generic method to obtain a single data from a redmine server.
- *
- * @param <T> the type of data to obtain
- * @param requestName the name of the request to use
- * @param type the type of data to obtain
- * @param args the parameters to obtain the data
- * @return the obtained data
- * @throws RedmineServiceException if any pb
- */
- <T> T getData(String requestName, Class<T> type, Object... args) throws RedmineServiceException;
-
- /**
- * Generic method to obtain a array of data from a redmine server.
- *
- * @param <T> the type of data to obtain
- * @param requestName the name of the request to use
- * @param type the type of data to obtain
- * @param args the parameters to obtain the datas
- * @return the obtained datas
- * @throws RedmineServiceException if any pb
- */
- <T> T[] getDatas(String requestName, Class<T> type, Object... args) throws RedmineServiceException;
-
- /**
- * Generic method to send a data to a redmine server and return the single
- * data updated from the redmine server.
- *
- * @param requestName the name of the request used
- * @param klazz the type of data to treate
- * @param args the parameters of the request
- * @param <T> the type of data to treate
- * @return the updated data
- * @throws RedmineServiceException if any pb
- */
- <T> T sendData(String requestName, Class<T> klazz, Object... args) throws RedmineServiceException;
-
-
- /**
- * Generic method to send a data (or more ) to a redmine server and
- * return the array of data from the redmine server.
- *
- * @param requestName the name of the request used
- * @param klazz the type of data to treate
- * @param args the parameters of the request
- * @param <T> the type of data to treate
- * @return the updated data
- * @throws RedmineServiceException if any pb
- */
- <T> T[] sendDatas(String requestName, Class<T> klazz, Object... args) throws RedmineServiceException;
-
- /**
- * Checks if the current session is not a anonymous one.
- *
- * @throws IllegalStateException if service not init
- * @throws RedmineServiceLoginException if not loggued
- * @throws NullPointerException if something is null
- */
- void checkLoggued() throws IllegalStateException, RedmineServiceLoginException, NullPointerException;
-
- /**
- * Checks if the current session is anonymous.
- *
- * @throws RedmineServiceLoginException if not anonymous
- * @throws NullPointerException if something is null
- */
- void checkNotLoggued() throws RedmineServiceLoginException, NullPointerException;
-}
Deleted: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceLoginException.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceLoginException.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceLoginException.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,54 +0,0 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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;
-
-/**
- * An exception to be thrown when a problem with authentication state in a
- * {@link RedmineService}.
- * <p/>
- * Created: 2 janv. 2010
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0.3
- */
-public class RedmineServiceLoginException extends RedmineServiceException {
-
- private static final long serialVersionUID = 1L;
-
- public RedmineServiceLoginException() {
- }
-
- public RedmineServiceLoginException(Throwable cause) {
- super(cause);
- }
-
- public RedmineServiceLoginException(String message) {
- super(message);
- }
-
- public RedmineServiceLoginException(String message, Throwable cause) {
- super(message, cause);
- }
-}
Deleted: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,97 +0,0 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-domain/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.model;
-
-import org.nuiton.jredmine.rest.RedmineRestClient;
-
-/**
- * Un énumération pour connaitre l'ensemble des classes du modèle.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0.0
- */
-public enum RedmineModelEnum {
-
- issueStatus(IssueStatus.class, RedmineModelScope.none, RedmineRestClient.GET_ISSUE_STATUS_LIST),
- issuePriority(IssuePriority.class, RedmineModelScope.none, RedmineRestClient.GET_ISSUE_PRIORITY_LIST),
- project(Project.class, RedmineModelScope.none, RedmineRestClient.GET_PROJECT_LIST),
- issueCategory(IssueCategory.class, RedmineModelScope.project, RedmineRestClient.GET_ISSUE_CATEGORY_LIST),
- tracker(Tracker.class, RedmineModelScope.project, RedmineRestClient.GET_TRACKER_LIST),
- user(User.class, RedmineModelScope.project, RedmineRestClient.GET_USER_LIST),
- news(News.class, RedmineModelScope.project, RedmineRestClient.GET_NEWS_LIST),
- version(Version.class, RedmineModelScope.project, RedmineRestClient.GET_VERSION_LIST),
- issue(Issue.class, RedmineModelScope.version, RedmineRestClient.GET_ISSUE_LIST),
- timeEntry(TimeEntry.class, RedmineModelScope.issue, RedmineRestClient.GET_ISSUE_TIME_ENTRY_LIST),
- attachment(Attachment.class, RedmineModelScope.version, RedmineRestClient.GET_ATTACHMENTS_LIST);
-
- private final Class<?> modelType;
-
- private final RedmineModelScope scope;
-
- private final String requestAll;
-
- RedmineModelEnum(Class<?> modelType, RedmineModelScope scope, String requestAll) {
- this.modelType = modelType;
- this.scope = scope;
- this.requestAll = requestAll;
- }
-
-
- public Class<?> getModelType() {
- return modelType;
- }
-
- public RedmineModelScope getScope() {
- return scope;
- }
-
- public String getRequestAll() {
- return requestAll;
- }
-
- public static RedmineModelEnum valueOf(Class<?> type) {
- for (RedmineModelEnum e : values()) {
- if (e.getModelType().equals(type)) {
- return e;
- }
- }
- return null;
- }
-
- public static RedmineModelEnum safeValueOf(Class<?> type) {
- if (type == null) {
- throw new NullPointerException("klass parameter can not be null");
- }
-
- // check dataType is authorized
-
- RedmineModelEnum r = valueOf(type);
- if (r == null) {
- throw new IllegalArgumentException("the type " + type.getName() + " is not allowed!");
- }
-
- return r;
- }
-}
Deleted: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelScope.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelScope.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelScope.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,56 +0,0 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-domain/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.model;
-
-/**
- * Une enumeration pour caracteriser le scope d'une donnée dans le modèle.
- * <p/>
- * <p/>
- * Pour une donnée qui ne dépend de rien, elle est en scope {@link #none}.
- * <p/>
- * Pour une donnée qui dépend d'un projet, elle est en scope {@link #project}.
- * <p/>
- * Pour une donnée qui dépend d'une version, elle est en scpoe {@link #version}.
- * <p/>
- * Pour une donnée qui dépend d'une issue, elle est en scpoe {@link #issue}.
- * <p/>
- * A savoir qu'une donnée de scope {@link #version} (resp. {@link #issue}),
- * elle est aussi de scope {@link #project} car la version (resp. l'issue)
- * dépend en dépend.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0.0
- */
-public enum RedmineModelScope {
-
- /** none scope, requires nothing. */
- none,
- /** project scope, requires a project. */
- project,
- /** version scope, requires a project and a version. */
- version,
- /** issue scope, requires a project and an issue. */
- issue
-}
Deleted: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/DefaultRedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/DefaultRedmineRequestBuilder.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/DefaultRedmineRequestBuilder.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,107 +0,0 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $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%
- */
-package org.nuiton.jredmine.request;
-
-import org.apache.commons.lang.ArrayUtils;
-
-import java.io.File;
-import java.util.Map;
-
-/**
- * The default implementation of the redmine request builder.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @see RedmineRequestBuilder
- * @see RedmineRequest
- * @since 1.4
- */
-public class DefaultRedmineRequestBuilder implements RedmineRequestBuilder {
-
- private static final long serialVersionUID = 1L;
-
- protected final String name;
-
- protected final String action;
-
- public DefaultRedmineRequestBuilder(String action) {
- this(action, action);
- }
-
- public DefaultRedmineRequestBuilder(String name, String action) {
- this.name = name;
- this.action = action;
- }
-
- @Override
- public String getName() {
- return name;
- }
-
- /**
- * Compute a array of pair (key-value) from the given arguments.
- * <p/>
- * Order is important to do this, define it.
- *
- * @param args the args of the request
- * @return parameters to use in request by pari of key-value
- * (key,value,key2, value2)
- */
- public String[] getParameters(Object... args) {
- // by default, no parameter
- return ArrayUtils.EMPTY_STRING_ARRAY;
- }
-
- public String[] getPath(Object... args) {
- // by default, path is action
- return new String[]{action};
- }
-
- public Map<String, File> getAttachments(Object... args) {
- // by default, no attachments
- return null;
- }
-
- @Override
- public RedmineRequest create(final Object... args) {
-
- return new RedmineRequest() {
-
- @Override
- public String[] getPath() {
- return DefaultRedmineRequestBuilder.this.getPath(args);
- }
-
- @Override
- public String[] getParameters() {
- return DefaultRedmineRequestBuilder.this.getParameters(args);
- }
-
- @Override
- public Map<String, File> getAttachments() {
- return DefaultRedmineRequestBuilder.this.getAttachments(args);
- }
- };
- }
-}
Deleted: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/IssueScopeRedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/IssueScopeRedmineRequestBuilder.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/IssueScopeRedmineRequestBuilder.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,57 +0,0 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $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%
- */
-package org.nuiton.jredmine.request;
-
-/**
- * To build request with a project and issue scope.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.4
- */
-public class IssueScopeRedmineRequestBuilder extends ProjectScopeRedmineRequestBuilder {
-
- private static final long serialVersionUID = 1L;
-
- public IssueScopeRedmineRequestBuilder(String name, String action) {
- super(name, action);
- }
-
- public IssueScopeRedmineRequestBuilder(String action) {
- super(action);
- }
-
- @Override
- public String[] getParameters(Object... args) {
-
- // args 1 = project id
- // args 2 = issue id
-
- String issueId = (String) args[1];
-
- return new String[]{
- "issue_id", issueId
- };
- }
-}
Deleted: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/ProjectScopeRedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/ProjectScopeRedmineRequestBuilder.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/ProjectScopeRedmineRequestBuilder.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,57 +0,0 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $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%
- */
-package org.nuiton.jredmine.request;
-
-/**
- * To build request with a project scope.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.4
- */
-public class ProjectScopeRedmineRequestBuilder extends DefaultRedmineRequestBuilder {
-
- private static final long serialVersionUID = 1L;
-
- public ProjectScopeRedmineRequestBuilder(String name, String action) {
- super(name, action);
- }
-
- public ProjectScopeRedmineRequestBuilder(String action) {
- super(action);
- }
-
- @Override
- public String[] getPath(Object... args) {
-
- // one args : projectName
-
- String projectName = (String) args[0];
-
- return new String[]{
- action,
- projectName
- };
- }
-}
Deleted: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/RedmineRequest.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/RedmineRequest.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/RedmineRequest.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,49 +0,0 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $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%
- */
-package org.nuiton.jredmine.request;
-
-import java.io.File;
-import java.util.Map;
-
-/**
- * To define a redmine request.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.4
- */
-public interface RedmineRequest {
-
- /** @return the splitted path to add to url */
- String[] getPath();
-
- /**
- * @return an array of pair (parameter name - parameter value) to pass
- * to request
- */
- String[] getParameters();
-
- /** @return the map of attachment to pass to request */
- Map<String, File> getAttachments();
-}
Deleted: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/RedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/RedmineRequestBuilder.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/RedmineRequestBuilder.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,47 +0,0 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $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%
- */
-package org.nuiton.jredmine.request;
-
-import java.io.Serializable;
-
-/**
- * The contract of a redmine request builder.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.4
- */
-public interface RedmineRequestBuilder extends Serializable {
-
- /** @return the unique name of the request builder */
- String getName();
-
- /**
- * Create the request given the {@code args}.
- *
- * @param args args to create the request
- * @return the created request
- */
- RedmineRequest create(Object... args);
-}
Deleted: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/RedmineRequestFactory.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/RedmineRequestFactory.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/RedmineRequestFactory.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,292 +0,0 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $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%
- */
-package org.nuiton.jredmine.request;
-
-import com.google.common.base.Strings;
-import com.google.common.collect.Maps;
-import org.nuiton.jredmine.model.Attachment;
-import org.nuiton.jredmine.model.News;
-import org.nuiton.jredmine.model.TimeEntry;
-import org.nuiton.jredmine.model.Version;
-import org.nuiton.jredmine.model.VersionStatusEnum;
-
-import java.io.File;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Factory of {@link RedmineRequest}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.4
- */
-public class RedmineRequestFactory {
-
- public static final DateFormat DATE_FORMAT =
- new SimpleDateFormat("yyyy-MM-dd");
-
- /** registred requests */
- protected final Map<String, RedmineRequestBuilder> requestBuilders;
-
- public RedmineRequestFactory() {
- requestBuilders = Maps.newTreeMap();
- }
-
- public void addDefaultRequests() {
- for (DEFAULT_REQUESTS request : DEFAULT_REQUESTS.values()) {
- addRequestBuilder(request.requestBuilder);
- }
- }
-
- /**
- * Add a request into the factory.
- *
- * @param builder the new request to add
- */
- public void addRequestBuilder(RedmineRequestBuilder builder) {
- String name = builder.getName();
- if (requestBuilders.containsKey(name)) {
- throw new IllegalArgumentException("a request builder with name " +
- name + " already exists.");
- }
- requestBuilders.put(name, builder);
- }
-
- /**
- * Obtain a request given his id and the args given.
- *
- * @param id id of the request
- * @param args args passed to build the request
- * @return the new request
- */
- public RedmineRequest getRequest(String id, Object... args) {
-
- RedmineRequest r;
- RedmineRequestBuilder builder = requestBuilders.get(id);
- if (builder == null) {
-
- throw new IllegalArgumentException(
- "Could not find any request builder for request named '" +
- id + "'");
- }
- r = builder.create(args);
- if (r == null) {
- throw new IllegalArgumentException(
- "Could not find any request named '" + id +
- "' using builder " + builder);
- }
- return r;
- }
-
- public enum DEFAULT_REQUESTS {
-
- // misc requests
-
- PING(new DefaultRedmineRequestBuilder("ping")),
- LOGOUT(new DefaultRedmineRequestBuilder("logout")),
- LOGIN(new DefaultRedmineRequestBuilder("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};
- }
- }),
-
- // with no scope
-
- GET_PROJECT_LIST(new DefaultRedmineRequestBuilder("get_projects.xml")),
- GET_USER_PROJECTS(new DefaultRedmineRequestBuilder("get_user_projects.xml")),
- GET_ISSUE_STATUS_LIST(new DefaultRedmineRequestBuilder("get_issue_statuses.xml")),
- GET_ISSUE_PRIORITY_LIST(new DefaultRedmineRequestBuilder("get_issue_priorities.xml")),
-
- // with project scope
-
- GET_PROJECT(new ProjectScopeRedmineRequestBuilder("get_project.xml")),
- GET_PROJECT_ISSUES(new ProjectScopeRedmineRequestBuilder("get_project_issues.xml")),
- GET_PROJECT_OPENED_ISSUES(new ProjectScopeRedmineRequestBuilder("get_project_opened_issues.xml")),
- GET_PROJECT_CLOSED_ISSUES(new ProjectScopeRedmineRequestBuilder("get_project_closed_issues.xml")),
- GET_VERSION_LIST(new ProjectScopeRedmineRequestBuilder("get_project_versions.xml")),
- GET_ISSUE_CATEGORY_LIST(new ProjectScopeRedmineRequestBuilder("get_issue_categories.xml")),
- GET_TRACKER_LIST(new ProjectScopeRedmineRequestBuilder("get_project_trackers.xml")),
- GET_USER_LIST(new ProjectScopeRedmineRequestBuilder("get_project_users.xml")),
- GET_NEWS_LIST(new ProjectScopeRedmineRequestBuilder("get_project_news.xml")),
-
- ADD_VERSION(new ProjectScopeRedmineRequestBuilder("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
- };
- }
- }),
- UPDATE_VERSION(new ProjectScopeRedmineRequestBuilder("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
- };
- }
- }),
- NEXT_VERSION(new ProjectScopeRedmineRequestBuilder("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
- };
- }
- }),
- ADD_NEWS(new ProjectScopeRedmineRequestBuilder("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
- GET_VERSION(new VersionScopeRedmineRequestBuilder("get_version.xml")),
- GET_ISSUE_LIST(new VersionScopeRedmineRequestBuilder("get_version_issues.xml")),
- GET_ATTACHMENTS_LIST(new VersionScopeRedmineRequestBuilder("get_version_attachments.xml")),
- ADD_ATTACHMENT(new VersionScopeRedmineRequestBuilder("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
-
- GET_ISSUE_TIME_ENTRY_LIST(new IssueScopeRedmineRequestBuilder("get_issue_times.xml")),
-
- ADD_ISSUE_TIME_ENTRY(new IssueScopeRedmineRequestBuilder("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()
- };
- }
- });
-
- private final RedmineRequestBuilder requestBuilder;
-
- DEFAULT_REQUESTS(RedmineRequestBuilder requestBuilder) {
- this.requestBuilder = requestBuilder;
- }
-
- public RedmineRequestBuilder getRequestBuilder() {
- return requestBuilder;
- }
-
- public String requestName() {
- return requestBuilder.getName();
- }
- }
-
- 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/src/main/java/org/nuiton/jredmine/request/VersionScopeRedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/VersionScopeRedmineRequestBuilder.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/request/VersionScopeRedmineRequestBuilder.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,57 +0,0 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $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%
- */
-package org.nuiton.jredmine.request;
-
-/**
- * To build request with a project and version scope.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.4
- */
-public class VersionScopeRedmineRequestBuilder extends ProjectScopeRedmineRequestBuilder {
-
- private static final long serialVersionUID = 1L;
-
- public VersionScopeRedmineRequestBuilder(String name, String action) {
- super(name, action);
- }
-
- public VersionScopeRedmineRequestBuilder(String action) {
- super(action);
- }
-
- @Override
- public String[] getParameters(Object... args) {
-
- // args 1 = project id
- // args 2 = version name
-
- String versionName = (String) args[1];
-
- return new String[]{
- "version_name", versionName
- };
- }
-}
Copied: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineAnonymousService.java (from rev 258, trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineAnonymousService.java)
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineAnonymousService.java (rev 0)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineAnonymousService.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -0,0 +1,220 @@
+/*
+ * #%L
+ * JRedmine :: Client
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * 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;
+
+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;
+
+/**
+ * Contract of all redmine operations which do not requires any login to server.
+ * <p/>
+ * Created: 2 janv. 2010
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0.3
+ */
+public interface RedmineAnonymousService {
+
+ /**
+ * Obtain all accessible projects.
+ *
+ * @return all the projects
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see Project
+ */
+ Project[] getProjects() throws RedmineServiceException;
+
+ /**
+ * Obtain all the priorities defined on a {@link Issue}.
+ * <p/>
+ * <b>Note : </b> The priorities are common for all projects.
+ *
+ * @return all the issue properties
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see IssuePriority
+ */
+ IssuePriority[] getIssuePriorities() throws RedmineServiceException;
+
+ /**
+ * Obtain all the statuses defined on a {@link Issue}.
+ * <p/>
+ * <b>Note : </b> The statuses are common for all projects.
+ *
+ * @return all the issue statuses
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see IssueStatus
+ */
+ IssueStatus[] getIssueStatuses() throws RedmineServiceException;
+
+ /**
+ * Obtain a project given his name.
+ *
+ * @param projectName the name of the project
+ * @return the project
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see Project
+ */
+ Project getProject(String projectName) throws RedmineServiceException;
+
+ /**
+ * Obtain all categories defined on issues for a given project.
+ *
+ * @param projectName the name of the project
+ * @return the categories of issues for the given project.
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see IssueCategory
+ */
+ IssueCategory[] getIssueCategories(String projectName) throws RedmineServiceException;
+
+ /**
+ * Obtain all trackers defined on a given project.
+ *
+ * @param projectName the name of the project
+ * @return the trackers for the given project.
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see Tracker
+ */
+ Tracker[] getTrackers(String projectName) throws RedmineServiceException;
+
+ /**
+ * Obtain all news defined on a given project.
+ *
+ * @param projectName the name of the project
+ * @return the news for the given project.
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see News
+ */
+ News[] getNews(String projectName) throws RedmineServiceException;
+
+ /**
+ * Obtain all users defined on a given project.
+ *
+ * @param projectName the name of the project
+ * @return the users for the given project.
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see User
+ */
+ User[] getProjectMembers(String projectName) throws RedmineServiceException;
+
+ /**
+ * Obtain all versions defined on a given project.
+ *
+ * @param projectName the name of the project
+ * @return the versions of the given project.
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see Version
+ */
+ Version[] getVersions(String projectName) throws RedmineServiceException;
+
+ /**
+ * Obtain a specific version for a given project.
+ *
+ * @param projectName the name of the project
+ * @param versionName the name of the version
+ * @return the version
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see Version
+ */
+ Version getVersion(String projectName,
+ String versionName) throws RedmineServiceException;
+
+ /**
+ * Obtain all issues for a given project.
+ *
+ * @param projectName the name of the project
+ * @return the issues
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see Issue
+ * @since 1.0.3
+ */
+ Issue[] getIssues(String projectName) throws RedmineServiceException;
+
+ /**
+ * Obtain all opened issues for a given project.
+ *
+ * @param projectName the name of the project
+ * @return the issues
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see Issue
+ * @since 1.0.3
+ */
+ Issue[] getOpenedIssues(String projectName) throws RedmineServiceException;
+
+ /**
+ * Obtain all closed issues for a given project.
+ *
+ * @param projectName the name of the project
+ * @return the issues
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see Issue
+ * @since 1.0.3
+ */
+ Issue[] getClosedIssues(String projectName) throws RedmineServiceException;
+
+ /**
+ * Obtain all issues for a specific version on a given project.
+ *
+ * @param projectName the name of the project
+ * @param versionName the name of the version
+ * @return the issues
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see Issue
+ */
+ Issue[] getIssues(String projectName,
+ String versionName) throws RedmineServiceException;
+
+ /**
+ * Obtain for a given issue of a given project all the time entries.
+ *
+ * @param projectName the name of the project
+ * @param issueId the id of the issue
+ * @return the time entries of the issue
+ * @throws RedmineServiceException if any pb while retrieving time entries of the issue
+ * @since 1.0.3
+ */
+ TimeEntry[] getIssueTimeEntries(String projectName,
+ String issueId) throws RedmineServiceException;
+
+ /**
+ * Obtain all attachments for a specific version on a given project.
+ *
+ * @param projectName the name of the project
+ * @param versionName the name of the version
+ * @return the attachments
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see Attachment
+ */
+ Attachment[] getAttachments(String projectName,
+ String versionName) throws RedmineServiceException;
+}
Property changes on: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineAnonymousService.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineLogguedService.java (from rev 258, trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineLogguedService.java)
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineLogguedService.java (rev 0)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineLogguedService.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -0,0 +1,135 @@
+package org.nuiton.jredmine;
+
+import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.Issue;
+import org.nuiton.jredmine.model.News;
+import org.nuiton.jredmine.model.Project;
+import org.nuiton.jredmine.model.TimeEntry;
+import org.nuiton.jredmine.model.Version;
+
+
+/**
+ * Contract of all redmine operations that needs a login to be performed.
+ * <p/>
+ * Created: 2 janv. 2010
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @see RedmineAnonymousService
+ * @see RedmineService
+ * @since 1.0.3
+ */
+public interface RedmineLogguedService {
+
+ /**
+ * Obtain for the loggued user, all projets where he belongs.
+ * <p/>
+ * <b>Note:</b> This method requires to be loggued on redmine server.
+ *
+ * @return all the projects belonged by the loggued user
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see Project
+ * @since 1.0.3
+ */
+ Project[] getUserProjects() throws RedmineServiceException;
+
+ /**
+ * Add a version for a given project.
+ * <p/>
+ * b>Note:</b> This method requires to be loggued on redmine server.
+ *
+ * @param projectName the name of the project
+ * @param version the version to add
+ * @return the added version
+ * @throws RedmineServiceException if any pb while sending and retriving
+ * datas to redmine server
+ * @see Version
+ */
+ Version addVersion(String projectName,
+ Version version) throws RedmineServiceException;
+
+ /**
+ * Update a version for a given project.
+ * <p/>
+ * b>Note:</b> This method requires to be loggued on redmine server.
+ *
+ * @param projectName the name of the project
+ * @param version the version to update
+ * @return the updated version
+ * @throws RedmineServiceException if any pb while sending and retriving
+ * datas to redmine server
+ * @see Version
+ */
+ Version updateVersion(String projectName,
+ Version version) throws RedmineServiceException;
+
+ /**
+ * Prepare a new version (create it or update it).
+ * <p/>
+ * If the {@code oldVersionName} is given, then all issues unclosed from this
+ * old version will be move to the new version.
+ * <p/>
+ * b>Note:</b> This method requires to be loggued on redmine server.
+ *
+ * @param projectName the name of the project
+ * @param oldVersionName the name of the old version (optional)
+ * @param newVersion the newVersion to create or update
+ * @return the created version
+ * @throws RedmineServiceException if any pb while sending and retriving
+ * datas to redmine server
+ * @see Version
+ */
+ Version nextVersion(String projectName,
+ String oldVersionName,
+ Version newVersion) throws RedmineServiceException;
+
+ /**
+ * Add a news for a given project.
+ * <p/>
+ * b>Note:</b> This method requires to be loggued on redmine server.
+ *
+ * @param projectName the name of the project
+ * @param news the news to add
+ * @return the added news.
+ * @throws RedmineServiceException if any pb while sending and retriving
+ * datas to redmine server
+ * @see News
+ */
+ News addNews(String projectName, News news) throws RedmineServiceException;
+
+ /**
+ * Add a attachment for a given version of a given project.
+ * <p/>
+ * b>Note:</b> This method requires to be loggued on redmine server.
+ *
+ * @param projectName the name of the project
+ * @param versionName the name of the version
+ * @param attachement the attachment to add
+ * @return the added attachment
+ * @throws RedmineServiceException if any pb while sending and retriving
+ * datas to redmine server
+ * @see Attachment
+ */
+ Attachment addAttachment(String projectName,
+ String versionName,
+ Attachment attachement) throws RedmineServiceException;
+
+ /**
+ * Add a new time entry to the given issue for the given project and
+ * return the updated time entry.
+ * <p/>
+ * b>Note:</b> This method requires to be loggued on redmine server.
+ *
+ * @param projectName the name of the project
+ * @param issueId the id of the issue to update
+ * @param entry time entry to add
+ * @return the created time entry
+ * @throws RedmineServiceException if any pb while sending or retrieving
+ * datas to redmine server
+ * @see Issue
+ * @see TimeEntry
+ * @since 1.0.3
+ */
+ TimeEntry addIssueTimeEntry(String projectName,
+ String issueId,
+ TimeEntry entry) throws RedmineServiceException;
+}
Property changes on: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineLogguedService.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineRestUnavailable.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineRestUnavailable.java (rev 0)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineRestUnavailable.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -0,0 +1,22 @@
+package org.nuiton.jredmine;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * To mark service that does not use the redmine rest api but still the
+ * jredmine rest api.
+ * <p/>
+ * Ath the end this will disappear if everything in available in redmine.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+@Documented
+(a)Retention(RetentionPolicy.CLASS)
+(a)Target(ElementType.METHOD)
+public @interface RedmineRestUnavailable {
+}
Copied: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineService.java (from rev 258, trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineService.java)
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineService.java (rev 0)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineService.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -0,0 +1,14 @@
+package org.nuiton.jredmine;
+
+/**
+ * The full redmine service with anonymous and loggued methods.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0.0
+ */
+public interface RedmineService extends RedmineAnonymousService, RedmineLogguedService {
+
+ /** Plexus lookup name. */
+ String ROLE = RedmineService.class.getName();
+
+}
Property changes on: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineService.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceConfiguration.java (from rev 258, trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceConfiguration.java)
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceConfiguration.java (rev 0)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceConfiguration.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -0,0 +1,38 @@
+package org.nuiton.jredmine;
+
+import org.nuiton.io.rest.RestClientConfiguration;
+
+import java.net.URL;
+
+/**
+ * Contract of a redmine service configuration.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public interface RedmineServiceConfiguration extends RestClientConfiguration {
+
+ String getEncoding();
+
+ void setEncoding(String encoding);
+
+ String getRestPassword();
+
+ void setRestPassword(String restPassword);
+
+ URL getRestUrl();
+
+ void setRestUrl(URL restUrl);
+
+ String getRestUsername();
+
+ void setRestUsername(String restUsername);
+
+ boolean isVerbose();
+
+ void setVerbose(boolean verbose);
+
+ boolean isAnonymous();
+
+ void setAnonymous(boolean anonymous);
+}
Property changes on: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceConfiguration.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceException.java (from rev 258, trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceException.java)
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceException.java (rev 0)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceException.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -0,0 +1,27 @@
+package org.nuiton.jredmine;
+
+/**
+ * An exception to throw when something is wrong in a {@link RedmineService}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0.0
+ */
+public class RedmineServiceException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+ public RedmineServiceException(Throwable cause) {
+ super(cause);
+ }
+
+ public RedmineServiceException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public RedmineServiceException(String message) {
+ super(message);
+ }
+
+ public RedmineServiceException() {
+ }
+}
Property changes on: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java (from rev 258, trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java)
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java (rev 0)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -0,0 +1,164 @@
+package org.nuiton.jredmine;
+
+import com.google.common.base.Preconditions;
+import com.sun.jersey.api.client.UniformInterface;
+
+/**
+ * Technical contract to implements a redmine service (will box the transport
+ * layer).
+ * <p/>
+ * Any concrete implentation of a redmine service should implements this..
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0.0
+ */
+public interface RedmineServiceImplementor {
+
+ /**
+ * Usable Rest methods.
+ *
+ * @since 1.4
+ */
+ enum RestMethod {
+ GET, POST, PUT, DELETE, HEAD;
+
+ public <T> T execute(UniformInterface request,
+ Class<T> type) {
+
+ Preconditions.checkNotNull(request);
+ Preconditions.checkNotNull(type);
+ T response = request.method(name(), type);
+
+ return response;
+ }
+
+ public <T> T execute(UniformInterface request,
+ Class<T> type,
+ Object o) {
+ Preconditions.checkNotNull(request);
+ Preconditions.checkNotNull(type);
+ Preconditions.checkNotNull(o);
+ T response;
+ response = request.method(name(), type, o);
+ return response;
+ }
+ }
+
+ /**
+ * Tests if the service is init (says method
+ * {@link #init(RedmineServiceConfiguration)} was invoked).
+ *
+ * @return {@code true} is service is init,
+ * {@code false} otherwise.
+ */
+ boolean isInit();
+
+ /**
+ * Tests if the service is loggued (says method {@link #login()} was
+ * invoked).
+ *
+ * @return {@code true} is service is loggued to Redmine service,
+ * {@code false} otherwise.
+ */
+ boolean isLoggued();
+
+ /**
+ * Initialize the service given a client configuration.
+ *
+ * @param configuration the configuration to be used to init the internal redmine client
+ * @return the initialized service
+ * @throws RedmineServiceException if any pb
+ */
+ RedmineServiceImplementor init(RedmineServiceConfiguration configuration) throws RedmineServiceException;
+
+ /**
+ * Close the service and destroy any connexion to the redmine service.
+ *
+ * @throws RedmineServiceException if any pb
+ */
+ void destroy() throws RedmineServiceException;
+
+ /**
+ * Try to ping the redmine remote service and return his status.
+ *
+ * @return status code of the ping request, or {@code -1} if something was
+ * wrong (unknown host,...).
+ */
+ int ping();
+
+ /**
+ * Log in using configuration authentication datas.
+ *
+ * @throws RedmineServiceLoginException if could not log in
+ */
+ void login() throws RedmineServiceLoginException;
+
+ /**
+ * Log out.
+ *
+ * @throws RedmineServiceLoginException if could not log out
+ */
+ void logout() throws RedmineServiceLoginException;
+
+ /**
+ * Generic method to obtain a single data from a redmine server.
+ *
+ * @param <T> the type of data to obtain
+ * @param requestName the name of the request to use
+ * @param type the type of data to obtain
+ * @param args the parameters to obtain the data
+ * @return the obtained data
+ * @throws RedmineServiceException if any pb
+ */
+ <T> T getData(String requestName, Class<T> type, Object... args) throws RedmineServiceException;
+
+ /**
+ * Generic method to obtain a array of data from a redmine server.
+ *
+ * @param <T> the type of data to obtain
+ * @param requestName the name of the request to use
+ * @param type the type of data to obtain
+ * @param args the parameters to obtain the datas
+ * @return the obtained datas
+ * @throws RedmineServiceException if any pb
+ */
+ <T> T[] getDatas(String requestName, Class<T> type, Object... args) throws RedmineServiceException;
+
+ /**
+ * Generic method to send a data to a redmine server and return the single
+ * data updated from the redmine server.
+ *
+ * @param requestName the name of the request used
+ * @param type the type of data to treate
+ * @param args the parameters of the request
+ * @param method method used to send data
+ * @param <T> the type of data to treate
+ * @return the updated data
+ * @throws RedmineServiceException if any pb
+ */
+ <T> T sendData(String requestName, Class<T> type, RestMethod method, Object... args) throws RedmineServiceException;
+
+
+ /**
+ * Generic method to send a data (or more ) to a redmine server and
+ * return the array of data from the redmine server.
+ *
+ * @param requestName the name of the request used
+ * @param type the type of data to treate
+ * @param method method used to send data
+ * @param args the parameters of the request
+ * @param <T> the type of data to treate
+ * @return the updated data
+ * @throws RedmineServiceException if any pb
+ */
+ <T> T[] sendDatas(String requestName, Class<T> type, RestMethod method, Object... args) throws RedmineServiceException;
+
+ /**
+ * Checks if the current session is not a anonymous one.
+ *
+ * @throws IllegalStateException if service not init
+ * @throws RedmineServiceLoginException if not loggued
+ * @throws NullPointerException if something is null
+ */
+ void checkLoggued() throws IllegalStateException, RedmineServiceLoginException, NullPointerException;
+}
Property changes on: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceLoginException.java (from rev 258, trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceLoginException.java)
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceLoginException.java (rev 0)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceLoginException.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -0,0 +1,30 @@
+package org.nuiton.jredmine;
+
+/**
+ * An exception to be thrown when a problem with authentication state in a
+ * {@link RedmineService}.
+ * <p/>
+ * Created: 2 janv. 2010
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0.3
+ */
+public class RedmineServiceLoginException extends RedmineServiceException {
+
+ private static final long serialVersionUID = 1L;
+
+ public RedmineServiceLoginException() {
+ }
+
+ public RedmineServiceLoginException(Throwable cause) {
+ super(cause);
+ }
+
+ public RedmineServiceLoginException(String message) {
+ super(message);
+ }
+
+ public RedmineServiceLoginException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
Property changes on: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceLoginException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Attachment.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Attachment.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Attachment.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model;
import java.io.File;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/CustomField.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/CustomField.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/CustomField.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $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%
- */
package org.nuiton.jredmine.model;
/**
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/I18nAble.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/I18nAble.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/I18nAble.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model;
/**
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IdAble.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IdAble.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IdAble.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model;
/**
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Issue.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Issue.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Issue.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model;
import java.util.Date;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IssueCategory.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IssueCategory.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IssueCategory.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model;
/**
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IssuePriority.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IssuePriority.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IssuePriority.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model;
/**
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IssueStatus.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IssueStatus.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/IssueStatus.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model;
/**
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/ModelHelper.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/ModelHelper.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/ModelHelper.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model;
import java.lang.reflect.Array;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/News.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/News.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/News.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model;
import java.util.Date;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Project.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Project.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Project.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model;
import java.util.Date;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/ProjectRef.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/ProjectRef.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/ProjectRef.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $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%
- */
package org.nuiton.jredmine.model;
/**
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/TimeEntry.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/TimeEntry.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/TimeEntry.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model;
import java.util.Date;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Tracker.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Tracker.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Tracker.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model;
/**
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/User.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/User.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/User.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model;
import java.util.Date;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/UserRef.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/UserRef.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/UserRef.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $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%
- */
package org.nuiton.jredmine.model;
/**
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Version.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Version.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/Version.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model;
import java.util.Date;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/VersionStatusEnum.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/VersionStatusEnum.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/VersionStatusEnum.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2009 - 2011 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.model;
/**
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/AttachmentXpp3Reader.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/AttachmentXpp3Reader.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/AttachmentXpp3Reader.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model.io.xpp3;
import org.nuiton.io.xpp3.AbstractXpp3Reader;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/CustomFieldXpp3Reader.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/CustomFieldXpp3Reader.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/CustomFieldXpp3Reader.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $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%
- */
package org.nuiton.jredmine.model.io.xpp3;
import org.nuiton.io.xpp3.AbstractXpp3Reader;
Added: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/DefaultRedmineXpp3Helper.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/DefaultRedmineXpp3Helper.java (rev 0)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/DefaultRedmineXpp3Helper.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -0,0 +1,210 @@
+package org.nuiton.jredmine.model.io.xpp3;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codehaus.plexus.util.IOUtil;
+import org.codehaus.plexus.util.ReaderFactory;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+import org.nuiton.io.xpp3.Xpp3Helper;
+import org.nuiton.io.xpp3.Xpp3Reader;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+import java.io.StringReader;
+import java.io.StringWriter;
+
+/**
+ * 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 {
+
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(DefaultRedmineXpp3Helper.class);
+
+ public <O> O readObject(Class<O> klass,
+ String txt,
+ boolean strict) throws IOException, XmlPullParserException {
+ O result = readObject(klass,
+ new ByteArrayInputStream(txt.getBytes()),
+ strict
+ );
+ return result;
+ }
+
+ public <O> O[] readObjects(Class<O> klass,
+ String txt,
+ boolean strict) throws IOException, XmlPullParserException {
+ O[] results = readObjects(klass,
+ new ByteArrayInputStream(txt.getBytes()),
+ strict
+ );
+ return results;
+ }
+
+ public <O> O readObject(Class<O> klass,
+ File file,
+ boolean strict) throws IOException, XmlPullParserException {
+ FileInputStream stream = new FileInputStream(file);
+ try {
+ O result = readObject(klass, stream, strict);
+ return result;
+ } finally {
+ stream.close();
+ }
+ }
+
+ public <O> O[] readObjects(Class<O> klass,
+ File file,
+ boolean strict) throws IOException, XmlPullParserException {
+ FileInputStream stream = new FileInputStream(file);
+ try {
+ O[] results = readObjects(klass, stream, strict);
+ return results;
+ } finally {
+ stream.close();
+ }
+ }
+
+ public <O> O readObject(Class<O> klass,
+ InputStream stream,
+ boolean strict) throws IOException, XmlPullParserException {
+
+// RedmineModelEnum.safeValueOf(klass);
+
+ O result = readObject(klass,
+ ReaderFactory.newXmlReader(stream),
+ strict
+ );
+
+ return result;
+ }
+
+ public <O> O[] readObjects(Class<O> klass,
+ InputStream stream,
+ boolean strict) throws IOException, XmlPullParserException {
+
+// RedmineModelEnum.safeValueOf(klass);
+
+ O[] results = readObjects(klass,
+ ReaderFactory.newXmlReader(stream),
+ strict
+ );
+ return results;
+ }
+
+ /**
+ * Read an array of objects from a xml stream.
+ *
+ * @param <O> the type of objects to return
+ * @param klass the type of object to read
+ * @param reader the reader where to parse the xml
+ * @param strict a flag to have a strict reading of input source
+ * @return the loaded objects
+ * @throws IOException if any io pb
+ * @throws XmlPullParserException if any parsing pb
+ */
+ public <O> O[] readObjects(Class<O> klass, Reader reader, boolean strict)
+ throws IOException, XmlPullParserException {
+
+ if (klass == null) {
+ throw new NullPointerException("klass parameter can not be null");
+ }
+
+ if (reader == null) {
+ throw new NullPointerException("reader parameter can not be null");
+ }
+
+ Xpp3Reader<O> modelReader = Xpp3Helper.getReader(klass);
+
+ if (modelReader == null) {
+ throw new IllegalArgumentException(
+ "could not find xpp3Reader for type " + klass);
+ }
+
+ O[] result = null;
+
+ try {
+
+
+ if (log.isDebugEnabled()) {
+
+ StringWriter sWriter = new StringWriter();
+
+ IOUtil.copy(reader, sWriter);
+
+ String rawInput = sWriter.toString();
+
+ log.debug("content to read : \n" + rawInput);
+ reader = new StringReader(rawInput);
+ }
+
+ result = modelReader.readArray(reader, strict);
+
+ } finally {
+ IOUtil.close(reader);
+ }
+
+ return result;
+ }
+
+ /**
+ * Read a single object from a xml stream.
+ *
+ * @param <O> the type of object to read
+ * @param klass the type of object to read
+ * @param reader the reader where to parse the xml
+ * @param strict a flag to have a strict reading of input source
+ * @return the loaded object
+ * @throws IOException if any io pb
+ * @throws XmlPullParserException if any parsing pb
+ */
+ public <O> O readObject(Class<O> klass, Reader reader, boolean strict)
+ throws IOException, XmlPullParserException {
+
+ if (klass == null) {
+ throw new NullPointerException("klass parameter can not be null");
+ }
+
+ if (reader == null) {
+ throw new NullPointerException("reader parameter can not be null");
+ }
+
+ Xpp3Reader<O> modelReader = Xpp3Helper.getReader(klass);
+
+ if (modelReader == null) {
+ throw new IllegalArgumentException(
+ "could not find xpp3Reader for type " + klass);
+ }
+
+ O result = null;
+
+ try {
+
+
+ if (log.isDebugEnabled()) {
+ StringWriter sWriter = new StringWriter();
+
+ IOUtil.copy(reader, sWriter);
+
+ String rawInput = sWriter.toString();
+ log.debug("content to read : \n" + rawInput);
+ reader = new StringReader(rawInput);
+ }
+
+ result = modelReader.read(reader, strict);
+
+ } finally {
+ IOUtil.close(reader);
+ }
+
+ return result;
+ }
+}
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueCategoryXpp3Reader.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueCategoryXpp3Reader.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueCategoryXpp3Reader.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model.io.xpp3;
import org.nuiton.io.xpp3.AbstractXpp3Reader;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssuePriorityXpp3Reader.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssuePriorityXpp3Reader.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssuePriorityXpp3Reader.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model.io.xpp3;
import org.nuiton.io.xpp3.AbstractXpp3Reader;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueStatusXpp3Reader.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueStatusXpp3Reader.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueStatusXpp3Reader.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model.io.xpp3;
import org.nuiton.io.xpp3.AbstractXpp3Reader;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueXpp3Reader.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueXpp3Reader.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueXpp3Reader.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model.io.xpp3;
import org.nuiton.io.xpp3.AbstractXpp3Reader;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/NewsXpp3Reader.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/NewsXpp3Reader.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/NewsXpp3Reader.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model.io.xpp3;
import org.nuiton.io.xpp3.AbstractXpp3Reader;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectRefXpp3Reader.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectRefXpp3Reader.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectRefXpp3Reader.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model.io.xpp3;
import org.nuiton.io.xpp3.AbstractXpp3Reader;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectXpp3Reader.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectXpp3Reader.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectXpp3Reader.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model.io.xpp3;
import org.nuiton.io.xpp3.AbstractXpp3Reader;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineDataConverter.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineDataConverter.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineDataConverter.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model.io.xpp3;
import org.nuiton.io.xpp3.DataConverter;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3Helper.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3Helper.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3Helper.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,45 +1,11 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model.io.xpp3;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codehaus.plexus.util.IOUtil;
-import org.codehaus.plexus.util.ReaderFactory;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
-import org.nuiton.io.xpp3.Xpp3Helper;
-import org.nuiton.io.xpp3.Xpp3Reader;
-import java.io.ByteArrayInputStream;
import java.io.File;
-import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
-import java.io.StringReader;
-import java.io.StringWriter;
/**
* Pour construire le modèle à partir de fichiers xml contenant les données.
@@ -47,82 +13,32 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 1.0.0
*/
-public class RedmineXpp3Helper {
+public interface RedmineXpp3Helper {
- /** Logger. */
- private static final Log log = LogFactory.getLog(RedmineXpp3Helper.class);
+ <O> O readObject(Class<O> klass,
+ String txt,
+ boolean strict) throws IOException, XmlPullParserException;
- public <O> O readObject(Class<O> klass,
- String txt,
- boolean strict) throws IOException, XmlPullParserException {
- O result = readObject(klass,
- new ByteArrayInputStream(txt.getBytes()),
- strict
- );
- return result;
- }
+ <O> O[] readObjects(Class<O> klass,
+ String txt,
+ boolean strict) throws IOException, XmlPullParserException;
- public <O> O[] readObjects(Class<O> klass,
- String txt,
- boolean strict) throws IOException, XmlPullParserException {
- O[] results = readObjects(klass,
- new ByteArrayInputStream(txt.getBytes()),
- strict
- );
- return results;
- }
+ <O> O readObject(Class<O> klass,
+ File file,
+ boolean strict) throws IOException, XmlPullParserException;
- public <O> O readObject(Class<O> klass,
- File file,
- boolean strict) throws IOException, XmlPullParserException {
- FileInputStream stream = new FileInputStream(file);
- try {
- O result = readObject(klass, stream, strict);
- return result;
- } finally {
- stream.close();
- }
- }
+ <O> O[] readObjects(Class<O> klass,
+ File file,
+ boolean strict) throws IOException, XmlPullParserException;
- public <O> O[] readObjects(Class<O> klass,
- File file,
- boolean strict) throws IOException, XmlPullParserException {
- FileInputStream stream = new FileInputStream(file);
- try {
- O[] results = readObjects(klass, stream, strict);
- return results;
- } finally {
- stream.close();
- }
- }
+ <O> O readObject(Class<O> klass,
+ InputStream stream,
+ boolean strict) throws IOException, XmlPullParserException;
- public <O> O readObject(Class<O> klass,
- InputStream stream,
- boolean strict) throws IOException, XmlPullParserException {
+ <O> O[] readObjects(Class<O> klass,
+ InputStream stream,
+ boolean strict) throws IOException, XmlPullParserException;
-// RedmineModelEnum.safeValueOf(klass);
-
- O result = readObject(klass,
- ReaderFactory.newXmlReader(stream),
- strict
- );
-
- return result;
- }
-
- public <O> O[] readObjects(Class<O> klass,
- InputStream stream,
- boolean strict) throws IOException, XmlPullParserException {
-
-// RedmineModelEnum.safeValueOf(klass);
-
- O[] results = readObjects(klass,
- ReaderFactory.newXmlReader(stream),
- strict
- );
- return results;
- }
-
/**
* Read an array of objects from a xml stream.
*
@@ -134,50 +50,9 @@
* @throws IOException if any io pb
* @throws XmlPullParserException if any parsing pb
*/
- public <O> O[] readObjects(Class<O> klass, Reader reader, boolean strict)
- throws IOException, XmlPullParserException {
+ <O> O[] readObjects(Class<O> klass, Reader reader, boolean strict)
+ throws IOException, XmlPullParserException;
- if (klass == null) {
- throw new NullPointerException("klass parameter can not be null");
- }
-
- if (reader == null) {
- throw new NullPointerException("reader parameter can not be null");
- }
-
- Xpp3Reader<O> modelReader = Xpp3Helper.getReader(klass);
-
- if (modelReader == null) {
- throw new IllegalArgumentException(
- "could not find xpp3Reader for type " + klass);
- }
-
- O[] result = null;
-
- try {
-
-
- if (log.isDebugEnabled()) {
-
- StringWriter sWriter = new StringWriter();
-
- IOUtil.copy(reader, sWriter);
-
- String rawInput = sWriter.toString();
-
- log.debug("content to read : \n" + rawInput);
- reader = new StringReader(rawInput);
- }
-
- result = modelReader.readArray(reader, strict);
-
- } finally {
- IOUtil.close(reader);
- }
-
- return result;
- }
-
/**
* Read a single object from a xml stream.
*
@@ -189,45 +64,6 @@
* @throws IOException if any io pb
* @throws XmlPullParserException if any parsing pb
*/
- public <O> O readObject(Class<O> klass, Reader reader, boolean strict)
- throws IOException, XmlPullParserException {
-
- if (klass == null) {
- throw new NullPointerException("klass parameter can not be null");
- }
-
- if (reader == null) {
- throw new NullPointerException("reader parameter can not be null");
- }
-
- Xpp3Reader<O> modelReader = Xpp3Helper.getReader(klass);
-
- if (modelReader == null) {
- throw new IllegalArgumentException(
- "could not find xpp3Reader for type " + klass);
- }
-
- O result = null;
-
- try {
-
-
- if (log.isDebugEnabled()) {
- StringWriter sWriter = new StringWriter();
-
- IOUtil.copy(reader, sWriter);
-
- String rawInput = sWriter.toString();
- log.debug("content to read : \n" + rawInput);
- reader = new StringReader(rawInput);
- }
-
- result = modelReader.read(reader, strict);
-
- } finally {
- IOUtil.close(reader);
- }
-
- return result;
- }
+ <O> O readObject(Class<O> klass, Reader reader, boolean strict)
+ throws IOException, XmlPullParserException;
}
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/TimeEntryXpp3Reader.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/TimeEntryXpp3Reader.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/TimeEntryXpp3Reader.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model.io.xpp3;
import org.nuiton.io.xpp3.AbstractXpp3Reader;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/TrackerXpp3Reader.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/TrackerXpp3Reader.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/TrackerXpp3Reader.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model.io.xpp3;
import org.nuiton.io.xpp3.AbstractXpp3Reader;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserRefXpp3Reader.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserRefXpp3Reader.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserRefXpp3Reader.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model.io.xpp3;
import org.nuiton.io.xpp3.AbstractXpp3Reader;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserXpp3Reader.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserXpp3Reader.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserXpp3Reader.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model.io.xpp3;
import org.nuiton.io.xpp3.AbstractXpp3Reader;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/VersionXpp3Reader.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/VersionXpp3Reader.java 2012-07-12 13:33:21 UTC (rev 264)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/io/xpp3/VersionXpp3Reader.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -1,27 +1,3 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model.io.xpp3;
import org.nuiton.io.xpp3.AbstractXpp3Reader;
Added: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/DefaultRedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/DefaultRedmineRequestBuilder.java (rev 0)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/DefaultRedmineRequestBuilder.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -0,0 +1,98 @@
+package org.nuiton.jredmine.request;
+
+import com.google.common.base.Joiner;
+import org.apache.commons.lang.ArrayUtils;
+
+import java.io.File;
+import java.net.URL;
+import java.util.Map;
+
+/**
+ * The default implementation of the redmine request builder.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @see RedmineRequestBuilder
+ * @see RedmineRequest
+ * @since 1.4
+ */
+public class DefaultRedmineRequestBuilder implements RedmineRequestBuilder {
+
+ private static final long serialVersionUID = 1L;
+
+ protected final String name;
+
+ protected final String action;
+
+ public DefaultRedmineRequestBuilder(String action) {
+ this(action, action);
+ }
+
+ public DefaultRedmineRequestBuilder(String name, String action) {
+ this.name = name;
+ this.action = action;
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Compute a array of pair (key-value) from the given arguments.
+ * <p/>
+ * Order is important to do this, define it.
+ *
+ * @param args the args of the request
+ * @return parameters to use in request by pari of key-value
+ * (key,value,key2, value2)
+ */
+ public String[] getParameters(Object... args) {
+ // by default, no parameter
+ return ArrayUtils.EMPTY_STRING_ARRAY;
+ }
+
+ public String[] getPath(Object... args) {
+ // by default, path is action
+ return new String[]{action};
+ }
+
+ public Map<String, File> getAttachments(Object... args) {
+ // by default, no attachments
+ return null;
+ }
+
+ @Override
+ public RedmineRequest create(final Object... args) {
+
+ return new RedmineRequest() {
+
+ @Override
+ public String[] getPath() {
+ return DefaultRedmineRequestBuilder.this.getPath(args);
+ }
+
+ @Override
+ public String[] getParameters() {
+ return DefaultRedmineRequestBuilder.this.getParameters(args);
+ }
+
+ @Override
+ public Map<String, File> getAttachments() {
+ return DefaultRedmineRequestBuilder.this.getAttachments(args);
+ }
+
+ @Override
+ public boolean containsAttachments() {
+ Map<String, File> attachments = getAttachments();
+ return attachments != null && !attachments.isEmpty();
+ }
+
+ @Override
+ public String toPath(URL redmineUrl) {
+ String result = redmineUrl + "/" +
+ Joiner.on('/').join(getPath());
+ return result;
+ }
+ };
+ }
+}
Added: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/IssueScopeRedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/IssueScopeRedmineRequestBuilder.java (rev 0)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/IssueScopeRedmineRequestBuilder.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -0,0 +1,33 @@
+package org.nuiton.jredmine.request;
+
+/**
+ * To build request with a project and issue scope.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public class IssueScopeRedmineRequestBuilder extends ProjectScopeRedmineRequestBuilder {
+
+ private static final long serialVersionUID = 1L;
+
+ public IssueScopeRedmineRequestBuilder(String name, String action) {
+ super(name, action);
+ }
+
+ public IssueScopeRedmineRequestBuilder(String action) {
+ super(action);
+ }
+
+ @Override
+ public String[] getParameters(Object... args) {
+
+ // args 1 = project id
+ // args 2 = issue id
+
+ String issueId = (String) args[1];
+
+ return new String[]{
+ "issue_id", issueId
+ };
+ }
+}
Added: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/ProjectScopeRedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/ProjectScopeRedmineRequestBuilder.java (rev 0)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/ProjectScopeRedmineRequestBuilder.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -0,0 +1,33 @@
+package org.nuiton.jredmine.request;
+
+/**
+ * To build request with a project scope.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public class ProjectScopeRedmineRequestBuilder extends DefaultRedmineRequestBuilder {
+
+ private static final long serialVersionUID = 1L;
+
+ public ProjectScopeRedmineRequestBuilder(String name, String action) {
+ super(name, action);
+ }
+
+ public ProjectScopeRedmineRequestBuilder(String action) {
+ super(action);
+ }
+
+ @Override
+ public String[] getPath(Object... args) {
+
+ // one args : projectName
+
+ String projectName = (String) args[0];
+
+ return new String[]{
+ action,
+ projectName
+ };
+ }
+}
Added: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/RedmineRequest.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/RedmineRequest.java (rev 0)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/RedmineRequest.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -0,0 +1,34 @@
+package org.nuiton.jredmine.request;
+
+import java.io.File;
+import java.net.URL;
+import java.util.Map;
+
+/**
+ * To define a redmine request.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public interface RedmineRequest {
+
+ /** @return the splitted path to add to url */
+ String[] getPath();
+
+ /**
+ * @return an array of pair (parameter name - parameter value) to pass
+ * to request
+ */
+ String[] getParameters();
+
+ /** @return the map of attachment to pass to request */
+ Map<String, File> getAttachments();
+
+ /**
+ * @return {@code true} if request has some attachments.
+ * @since 1.4
+ */
+ boolean containsAttachments();
+
+ String toPath(URL redmineUrl);
+}
Added: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/RedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/RedmineRequestBuilder.java (rev 0)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/RedmineRequestBuilder.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -0,0 +1,23 @@
+package org.nuiton.jredmine.request;
+
+import java.io.Serializable;
+
+/**
+ * The contract of a redmine request builder.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public interface RedmineRequestBuilder extends Serializable {
+
+ /** @return the unique name of the request builder */
+ String getName();
+
+ /**
+ * Create the request given the {@code args}.
+ *
+ * @param args args to create the request
+ * @return the created request
+ */
+ RedmineRequest create(Object... args);
+}
Added: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/RedmineRequestFactory.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/RedmineRequestFactory.java (rev 0)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/RedmineRequestFactory.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -0,0 +1,35 @@
+package org.nuiton.jredmine.request;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
+/**
+ * Factory of {@link RedmineRequest}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public interface RedmineRequestFactory {
+
+ public static final DateFormat DATE_FORMAT =
+ new SimpleDateFormat("yyyy-MM-dd");
+
+ void addDefaultRequests();
+
+ /**
+ * Add a request into the factory.
+ *
+ * @param builder the new request to add
+ */
+ void addRequestBuilder(RedmineRequestBuilder builder);
+
+ /**
+ * Obtain a request given his id and the args given.
+ *
+ * @param id id of the request
+ * @param args args passed to build the request
+ * @return the new request
+ */
+ RedmineRequest getRequest(String id, Object... args);
+
+}
Added: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/VersionScopeRedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/VersionScopeRedmineRequestBuilder.java (rev 0)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/VersionScopeRedmineRequestBuilder.java 2012-07-12 13:35:20 UTC (rev 265)
@@ -0,0 +1,33 @@
+package org.nuiton.jredmine.request;
+
+/**
+ * To build request with a project and version scope.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public class VersionScopeRedmineRequestBuilder extends ProjectScopeRedmineRequestBuilder {
+
+ private static final long serialVersionUID = 1L;
+
+ public VersionScopeRedmineRequestBuilder(String name, String action) {
+ super(name, action);
+ }
+
+ public VersionScopeRedmineRequestBuilder(String action) {
+ super(action);
+ }
+
+ @Override
+ public String[] getParameters(Object... args) {
+
+ // args 1 = project id
+ // args 2 = version name
+
+ String versionName = (String) args[1];
+
+ return new String[]{
+ "version_name", versionName
+ };
+ }
+}
1
0
r264 - trunk/jredmine-client/src/main/redmine/jredmine/app/controllers
by tchemit@users.nuiton.org 12 Jul '12
by tchemit@users.nuiton.org 12 Jul '12
12 Jul '12
Author: tchemit
Date: 2012-07-12 15:33:21 +0200 (Thu, 12 Jul 2012)
New Revision: 264
Url: http://nuiton.org/repositories/revision/jredmine/264
Log:
add more check method (to be continued)
Modified:
trunk/jredmine-client/src/main/redmine/jredmine/app/controllers/jredmine_controller.rb
Modified: trunk/jredmine-client/src/main/redmine/jredmine/app/controllers/jredmine_controller.rb
===================================================================
--- trunk/jredmine-client/src/main/redmine/jredmine/app/controllers/jredmine_controller.rb 2012-07-12 13:31:01 UTC (rev 263)
+++ trunk/jredmine-client/src/main/redmine/jredmine/app/controllers/jredmine_controller.rb 2012-07-12 13:33:21 UTC (rev 264)
@@ -25,8 +25,12 @@
class JredmineController < ActionController::Base
# post request
- before_filter :check_post, :only => [:add_version, :update_version, :next_version, :add_news, :add_attachment, :add_version_attachment, :add_issue_time, :update_issue_time]
-
+ #before_filter :check_post, :only => [:add_version, :update_version, :next_version, :add_news, :add_attachment, :add_version_attachment, :add_issue_time, :update_issue_time]
+ before_filter :check_post, :only => [:add_version, :add_news, :add_attachment, :add_version_attachment, :add_issue_time]
+
+ # put request
+ before_filter :check_post, :only => [:update_version, :next_version, :update_issue_time]
+
# find user (after login)
before_filter :find_user, :only => [:get_user_projects, :add_version, :update_version, :next_version, :add_news, :add_attachment, :add_version_attachment, :add_issue_time, :update_issue_time]
@@ -430,6 +434,20 @@
end
end
+ # Checks that action is using put method
+ def check_put
+ if !request.put?
+ render_status 405, "PUT method required for action #{params[:action]}"
+ end
+ end
+
+ # Checks that action is using delete method
+ def check_delete
+ if !request.delete?
+ render_status 405, "DELETE method required for action #{params[:action]}"
+ end
+ end
+
# Checks that request has a version[name] attribute
def check_version_definition(version = params[:version])
if version.nil?
1
0
Author: tchemit
Date: 2012-07-12 15:31:01 +0200 (Thu, 12 Jul 2012)
New Revision: 263
Url: http://nuiton.org/repositories/revision/jredmine/263
Log:
reformat test poms
Modified:
trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/changes.xml
trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateEmailAnnouncementMojoTest/generateEmailAnnouncement.xml
trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateEmailAnnouncementMojoTest/skipGenerateEmailAnnouncement.xml
trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateNewsAnnouncementMojoTest/generateNewsAnnouncement.xml
trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateNewsAnnouncementMojoTest/skipGenerateNewsAnnouncement.xml
trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayAll.xml
trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayIssuePriorities.xml
trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayIssueStatuses.xml
trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjectIssueCategories.xml
trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjectTrackers.xml
trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjectUsers.xml
trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjects.xml
trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayVersions.xml
trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/generateChangesMojoTest/generateChanges.xml
trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/nextVersionMojoTest/nextVersion.xml
trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/nextVersionMojoTest/skipNextVersion.xml
trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishAttachmentsMojoTest/publishAttachments.xml
trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishAttachmentsMojoTest/skipPublishAttachments.xml
trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishNewsMojoTest/publishNews.xml
trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishNewsMojoTest/skipPublishNews.xml
trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByAssigneeTest/issueReport.xml
trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByCategoryTest/issueReport.xml
trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByPriorityTest/issueReport.xml
trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByReporterTest/issueReport.xml
trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByStatusTest/issueReport.xml
trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByTrackerTest/issueReport.xml
trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByVersionTest/issueReport.xml
trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportTest/issueReport.xml
trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/updateVersionMojoTest/skipUpdateVersion.xml
trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/updateVersionMojoTest/updateVersion.xml
Modified: trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/changes.xml
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/changes.xml 2012-07-12 13:26:19 UTC (rev 262)
+++ trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/changes.xml 2012-07-12 13:31:01 UTC (rev 263)
@@ -30,18 +30,29 @@
<author email="perso(a)noway.fr">Tony Chemit</author>
</properties>
<body>
- <release version="aab" date="2009-09-13" description="COCO" />
- <release version="1.0.0" date="2009-09-13" description="The version 1.0.0 description">
- <action dev="chemit" due-to="Tony Chemit" due-to-email="perso(a)noway.fr" issue="2" type="add" system="redmine">test evol</action>
- <action dev="chemit" due-to="Tony Chemit" due-to-email="perso(a)noway.fr" issue="4" type="fix" system="redmine">test anomalie</action>
- <action dev="chemit" due-to="Tony Chemit" due-to-email="perso(a)noway.fr" issue="5" type="add" system="redmine">test evolution</action>
+ <release version="aab" date="2009-09-13" description="COCO"/>
+ <release version="1.0.0" date="2009-09-13"
+ description="The version 1.0.0 description">
+ <action dev="chemit" due-to="Tony Chemit" due-to-email="perso(a)noway.fr"
+ issue="2" type="add" system="redmine">test evol
+ </action>
+ <action dev="chemit" due-to="Tony Chemit" due-to-email="perso(a)noway.fr"
+ issue="4" type="fix" system="redmine">test anomalie
+ </action>
+ <action dev="chemit" due-to="Tony Chemit" due-to-email="perso(a)noway.fr"
+ issue="5" type="add" system="redmine">test evolution
+ </action>
</release>
- <release version="1.0.3" date="2009-09-12" description="new versions">
- <action dev="chemit" due-to="Tony Chemit" due-to-email="perso(a)noway.fr" issue="4" type="fix" system="redmine">test anomalie</action>
- <action dev="chemit" due-to="Tony Chemit" due-to-email="perso(a)noway.fr" issue="5" type="add" system="redmine">test evolution</action>
+ <release version="1.3" date="2009-09-12" description="new versions">
+ <action dev="chemit" due-to="Tony Chemit" due-to-email="perso(a)noway.fr"
+ issue="4" type="fix" system="redmine">test anomalie
+ </action>
+ <action dev="chemit" due-to="Tony Chemit" due-to-email="perso(a)noway.fr"
+ issue="5" type="add" system="redmine">test evolution
+ </action>
</release>
- <release version="yaouuuuuua" date="2009-09-06" description="yoye" />
- <release version="ya" date="2009-09-06" description="yoye" />
- <release version="ouuuuuua" date="2009-09-06" description="ysssoye" />
+ <release version="yaouuuuuua" date="2009-09-06" description="yoye"/>
+ <release version="ya" date="2009-09-06" description="yoye"/>
+ <release version="ouuuuuua" date="2009-09-06" description="ysssoye"/>
</body>
</document>
Modified: trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateEmailAnnouncementMojoTest/generateEmailAnnouncement.xml
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateEmailAnnouncementMojoTest/generateEmailAnnouncement.xml 2012-07-12 13:26:19 UTC (rev 262)
+++ trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateEmailAnnouncementMojoTest/generateEmailAnnouncement.xml 2012-07-12 13:31:01 UTC (rev 263)
@@ -28,46 +28,37 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <groupId>org.nuiton.maven-redmine-plugin</groupId>
- <artifactId>test-generate-changes</artifactId>
- <version>0</version>
- <modelVersion>4.0.0</modelVersion>
+ <groupId>org.nuiton.jredmine-maven-plugin</groupId>
+ <artifactId>test-generate-email-announcement</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <name>generate-changes</name>
+ <name>generate-email-announcement</name>
+ <description>Test for generate email announcement.</description>
+ <url>http://nuiton.org/jredmine</url>
- <build>
+ <build>
- <plugins>
- <plugin>
- <groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-maven-plugin</artifactId>
- <configuration>
- <finalName>One-1.0.0.jar</finalName>
- <url>http://mynuiton.org</url>
- <!--<url>http://mynuiton.org/projects/one</url>-->
- <packaging>jar</packaging>
- <projectId>one</projectId>
- <versionId>1.0.0</versionId>
- <templateOutputDirectory>target/announcement</templateOutputDirectory>
- <xmlPath>target/test-classes/org/nuiton/jredmine/plugin/announcement/changes.xml</xmlPath>
- <templateDirectory>org/nuiton/jredmine/plugin/announcement</templateDirectory>
- <attachmentLinkTemplate>%URL%/attachments/download/%FILE%</attachmentLinkTemplate>
- <emailAnnouncementTemplate>release-email-announcement.vm</emailAnnouncementTemplate>
- <skipGenerateEmailAnnouncement>false</skipGenerateEmailAnnouncement>
- <developmentTeam>One team</developmentTeam>
- <urlDownload>http://mynuiton.org/projects/list_files/one</urlDownload>
- <introduction>The release 1.0.0 is the first release of this plugin...</introduction>
- <templateEncoding>UTF-8</templateEncoding>
- <!--<attachmentLinkTemplate>http://mynuiton.org/attachments/download/%FILE%</attachmentLinkTemplate>-->
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>generate-email-announcement</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-maven-plugin</artifactId>
+ <configuration>
+ <templateOutputDirectory>target/surefire-workdir/announcement-email</templateOutputDirectory>
+ <xmlPath>
+ target/test-classes/org/nuiton/jredmine/plugin/announcement/changes.xml
+ </xmlPath>
+ <urlDownload>http://nuion.org/projects/list_files/jredmine</urlDownload>
+ <templateEncoding>UTF-8</templateEncoding>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate-email-announcement</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateEmailAnnouncementMojoTest/skipGenerateEmailAnnouncement.xml
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateEmailAnnouncementMojoTest/skipGenerateEmailAnnouncement.xml 2012-07-12 13:26:19 UTC (rev 262)
+++ trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateEmailAnnouncementMojoTest/skipGenerateEmailAnnouncement.xml 2012-07-12 13:31:01 UTC (rev 263)
@@ -28,45 +28,35 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <groupId>org.nuiton.maven-redmine-plugin</groupId>
- <artifactId>test-generate-changes</artifactId>
- <version>0</version>
- <modelVersion>4.0.0</modelVersion>
+ <groupId>org.nuiton.jredmine-maven-plugin</groupId>
+ <artifactId>test-generate-email-announcement</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <name>generate-changes</name>
+ <name>generate-email-announcement</name>
+ <description>Test for generate email announcement.</description>
+ <url>http://nuiton.org/jredmine</url>
- <build>
+ <build>
- <plugins>
- <plugin>
- <groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-maven-plugin</artifactId>
- <configuration>
- <finalName>One-1.0.0.jar</finalName>
- <url>http://mynuiton.org</url>
- <packaging>jar</packaging>
- <projectId>one</projectId>
- <versionId>1.0.0</versionId>
- <templateOutputDirectory>target/announcement</templateOutputDirectory>
- <xmlPath>target/test-classes/org/nuiton/jredmine/plugin/announcement/changes.xml</xmlPath>
- <templateDirectory>org/nuiton/jredmine/plugin/announcement</templateDirectory>
- <emailAnnouncementTemplate>release-email-announcement.vm</emailAnnouncementTemplate>
- <attachmentLinkTemplate>%URL%/attachments/download/%FILE%</attachmentLinkTemplate>
- <skipGenerateEmailAnnouncement>true</skipGenerateEmailAnnouncement>
- <developmentTeam>One team</developmentTeam>
- <urlDownload>http://mynuiton.org/projects/list_files/one</urlDownload>
- <introduction>The release 1.0.0 is the first release of this plugin...</introduction>
- <templateEncoding>UTF-8</templateEncoding>
- <!--<attachmentLinkTemplate>http://mynuiton.org/attachments/download/%FILE%</attachmentLinkTemplate>-->
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>generate-email-announcement</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-maven-plugin</artifactId>
+ <configuration>
+ <skipGenerateEmailAnnouncement>true</skipGenerateEmailAnnouncement>
+ <xmlPath>
+ target/test-classes/org/nuiton/jredmine/plugin/announcement/changes.xml
+ </xmlPath>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate-email-announcement</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateNewsAnnouncementMojoTest/generateNewsAnnouncement.xml
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateNewsAnnouncementMojoTest/generateNewsAnnouncement.xml 2012-07-12 13:26:19 UTC (rev 262)
+++ trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateNewsAnnouncementMojoTest/generateNewsAnnouncement.xml 2012-07-12 13:31:01 UTC (rev 263)
@@ -28,45 +28,37 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <groupId>org.nuiton.maven-redmine-plugin</groupId>
- <artifactId>test-generate-changes</artifactId>
- <version>0</version>
- <modelVersion>4.0.0</modelVersion>
+ <groupId>org.nuiton.jredmine-maven-plugin</groupId>
+ <artifactId>test-generate-news-announcement</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <name>generate-changes</name>
+ <name>generate-news-announcement</name>
+ <description>Test for generate news announcement.</description>
+ <url>http://nuiton.org/jredmine</url>
- <build>
+ <build>
- <plugins>
- <plugin>
- <groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-maven-plugin</artifactId>
- <configuration>
- <finalName>One-1.0.0.jar</finalName>
- <url>http://mynuiton.org</url>
- <packaging>jar</packaging>
- <projectId>one</projectId>
- <versionId>1.0.0</versionId>
- <templateOutputDirectory>target/announcement</templateOutputDirectory>
- <xmlPath>target/test-classes/org/nuiton/jredmine/plugin/announcement/changes.xml</xmlPath>
- <templateDirectory>org/nuiton/jredmine/plugin/announcement</templateDirectory>
- <attachmentLinkTemplate>%URL%/attachments/download/%FILE%</attachmentLinkTemplate>
- <newsAnnouncementTemplate>release-news-announcement.vm</newsAnnouncementTemplate>
- <skipGenerateNewsAnnouncement>false</skipGenerateNewsAnnouncement>
- <developmentTeam>One team</developmentTeam>
- <urlDownload>http://mynuiton.org/projects/list_files/one</urlDownload>
- <introduction>The release 1.0.0 is the first release of this plugin...</introduction>
- <templateEncoding>UTF-8</templateEncoding>
- <!--<attachmentLinkTemplate>http://mynuiton.org/attachments/download/%FILE%</attachmentLinkTemplate>-->
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>generate-news-announcement</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-maven-plugin</artifactId>
+ <configuration>
+ <templateOutputDirectory>target/surefire-workdir/announcement-news</templateOutputDirectory>
+ <xmlPath>
+ target/test-classes/org/nuiton/jredmine/plugin/announcement/changes.xml
+ </xmlPath>
+ <urlDownload>http://nuion.org/projects/list_files/jredmine</urlDownload>
+ <templateEncoding>UTF-8</templateEncoding>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate-news-announcement</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateNewsAnnouncementMojoTest/skipGenerateNewsAnnouncement.xml
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateNewsAnnouncementMojoTest/skipGenerateNewsAnnouncement.xml 2012-07-12 13:26:19 UTC (rev 262)
+++ trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateNewsAnnouncementMojoTest/skipGenerateNewsAnnouncement.xml 2012-07-12 13:31:01 UTC (rev 263)
@@ -28,45 +28,35 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <groupId>org.nuiton.maven-redmine-plugin</groupId>
- <artifactId>test-generate-changes</artifactId>
- <version>0</version>
- <modelVersion>4.0.0</modelVersion>
+ <groupId>org.nuiton.jredmine-maven-plugin</groupId>
+ <artifactId>test-generate-news-announcement</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <name>generate-changes</name>
+ <name>generate-news-announcement</name>
+ <description>Test for generate news announcement.</description>
+ <url>http://nuiton.org/jredmine</url>
- <build>
+ <build>
- <plugins>
- <plugin>
- <groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-maven-plugin</artifactId>
- <configuration>
- <finalName>One-1.0.0.jar</finalName>
- <url>http://mynuiton.org</url>
- <packaging>jar</packaging>
- <projectId>one</projectId>
- <versionId>1.0.0</versionId>
- <templateOutputDirectory>target/announcement</templateOutputDirectory>
- <xmlPath>target/test-classes/org/nuiton/jredmine/plugin/announcement/changes.xml</xmlPath>
- <templateDirectory>org/nuiton/jredmine/plugin/announcement</templateDirectory>
- <attachmentLinkTemplate>%URL%/attachments/download/%FILE%</attachmentLinkTemplate>
- <newsAnnouncementTemplate>release-news-announcement.vm</newsAnnouncementTemplate>
- <skipGenerateNewsAnnouncement>true</skipGenerateNewsAnnouncement>
- <developmentTeam>One team</developmentTeam>
- <urlDownload>http://mynuiton.org/projects/list_files/one</urlDownload>
- <introduction>The release 1.0.0 is the first release of this plugin...</introduction>
- <templateEncoding>UTF-8</templateEncoding>
- <!--<attachmentLinkTemplate>http://mynuiton.org/attachments/download/%FILE%</attachmentLinkTemplate>-->
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>generate-news-announcement</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-maven-plugin</artifactId>
+ <configuration>
+ <skipGenerateNewsAnnouncement>true</skipGenerateNewsAnnouncement>
+ <xmlPath>
+ target/test-classes/org/nuiton/jredmine/plugin/announcement/changes.xml
+ </xmlPath>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate-news-announcement</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayAll.xml
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayAll.xml 2012-07-12 13:26:19 UTC (rev 262)
+++ trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayAll.xml 2012-07-12 13:31:01 UTC (rev 263)
@@ -27,33 +27,35 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <groupId>org.nuiton.maven-redmine-plugin</groupId>
- <artifactId>test-generate-changes</artifactId>
- <version>0</version>
- <modelVersion>4.0.0</modelVersion>
- <name>generate-changes</name>
+ <groupId>org.nuiton.jredmine-maven-plugin</groupId>
+ <artifactId>test-display-data</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <build>
+ <name>display-data</name>
+ <description>Test for display data.</description>
+ <url>http://nuiton.org/jredmine</url>
- <plugins>
- <plugin>
- <groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-maven-plugin</artifactId>
- <configuration>
- <projectId>one</projectId>
- <versionId>1.0.0</versionId>
- <types>project,version,tracker,user,issueStatus,issueCategory,issuePriority,tracker</types>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>display-data</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <build>
+
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-maven-plugin</artifactId>
+ <configuration>
+ <types>
+ project,version,tracker,user,issueStatus,issueCategory,issuePriority,tracker
+ </types>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>display-data</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayIssuePriorities.xml
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayIssuePriorities.xml 2012-07-12 13:26:19 UTC (rev 262)
+++ trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayIssuePriorities.xml 2012-07-12 13:31:01 UTC (rev 263)
@@ -27,31 +27,33 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <groupId>org.nuiton.maven-redmine-plugin</groupId>
- <artifactId>test-generate-changes</artifactId>
- <version>0</version>
- <modelVersion>4.0.0</modelVersion>
- <name>generate-changes</name>
+ <groupId>org.nuiton.jredmine-maven-plugin</groupId>
+ <artifactId>test-display-data</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <build>
+ <name>display-data</name>
+ <description>Test for display data.</description>
+ <url>http://nuiton.org/jredmine</url>
- <plugins>
- <plugin>
- <groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-maven-plugin</artifactId>
- <configuration>
- <types>issuePriority</types>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>display-data</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <build>
+
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-maven-plugin</artifactId>
+ <configuration>
+ <types>issuePriority</types>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>display-data</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayIssueStatuses.xml
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayIssueStatuses.xml 2012-07-12 13:26:19 UTC (rev 262)
+++ trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayIssueStatuses.xml 2012-07-12 13:31:01 UTC (rev 263)
@@ -27,31 +27,33 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <groupId>org.nuiton.maven-redmine-plugin</groupId>
- <artifactId>test-generate-changes</artifactId>
- <version>0</version>
- <modelVersion>4.0.0</modelVersion>
- <name>generate-changes</name>
+ <groupId>org.nuiton.jredmine-maven-plugin</groupId>
+ <artifactId>test-display-data</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <build>
+ <name>display-data</name>
+ <description>Test for display data.</description>
+ <url>http://nuiton.org/jredmine</url>
- <plugins>
- <plugin>
- <groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-maven-plugin</artifactId>
- <configuration>
- <types>issueStatus</types>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>display-data</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <build>
+
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-maven-plugin</artifactId>
+ <configuration>
+ <types>issueStatus</types>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>display-data</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjectIssueCategories.xml
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjectIssueCategories.xml 2012-07-12 13:26:19 UTC (rev 262)
+++ trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjectIssueCategories.xml 2012-07-12 13:31:01 UTC (rev 263)
@@ -27,32 +27,33 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <groupId>org.nuiton.maven-redmine-plugin</groupId>
- <artifactId>test-generate-changes</artifactId>
- <version>0</version>
- <modelVersion>4.0.0</modelVersion>
- <name>generate-changes</name>
+ <groupId>org.nuiton.jredmine-maven-plugin</groupId>
+ <artifactId>test-display-data</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <build>
+ <name>display-data</name>
+ <description>Test for display data.</description>
+ <url>http://nuiton.org/jredmine</url>
- <plugins>
- <plugin>
- <groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-maven-plugin</artifactId>
- <configuration>
- <projectId>one</projectId>
- <types>issueCategory</types>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>display-data</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <build>
+
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-maven-plugin</artifactId>
+ <configuration>
+ <types>issueCategory</types>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>display-data</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjectTrackers.xml
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjectTrackers.xml 2012-07-12 13:26:19 UTC (rev 262)
+++ trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjectTrackers.xml 2012-07-12 13:31:01 UTC (rev 263)
@@ -27,32 +27,33 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <groupId>org.nuiton.maven-redmine-plugin</groupId>
- <artifactId>test-generate-changes</artifactId>
- <version>0</version>
- <modelVersion>4.0.0</modelVersion>
- <name>generate-changes</name>
+ <groupId>org.nuiton.jredmine-maven-plugin</groupId>
+ <artifactId>test-display-data</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <build>
+ <name>display-data</name>
+ <description>Test for display data.</description>
+ <url>http://nuiton.org/jredmine</url>
- <plugins>
- <plugin>
- <groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-maven-plugin</artifactId>
- <configuration>
- <projectId>one</projectId>
- <types>tracker</types>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>display-data</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <build>
+
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-maven-plugin</artifactId>
+ <configuration>
+ <types>tracker</types>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>display-data</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjectUsers.xml
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjectUsers.xml 2012-07-12 13:26:19 UTC (rev 262)
+++ trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjectUsers.xml 2012-07-12 13:31:01 UTC (rev 263)
@@ -27,32 +27,33 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <groupId>org.nuiton.maven-redmine-plugin</groupId>
- <artifactId>test-generate-changes</artifactId>
- <version>0</version>
- <modelVersion>4.0.0</modelVersion>
- <name>generate-changes</name>
+ <groupId>org.nuiton.jredmine-maven-plugin</groupId>
+ <artifactId>test-display-data</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <build>
+ <name>display-data</name>
+ <description>Test for display data.</description>
+ <url>http://nuiton.org/jredmine</url>
- <plugins>
- <plugin>
- <groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-maven-plugin</artifactId>
- <configuration>
- <projectId>one</projectId>
- <types>user</types>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>display-data</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <build>
+
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-maven-plugin</artifactId>
+ <configuration>
+ <types>user</types>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>display-data</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjects.xml
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjects.xml 2012-07-12 13:26:19 UTC (rev 262)
+++ trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjects.xml 2012-07-12 13:31:01 UTC (rev 263)
@@ -28,32 +28,32 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <groupId>org.nuiton.maven-redmine-plugin</groupId>
- <artifactId>test-generate-changes</artifactId>
- <version>0</version>
- <modelVersion>4.0.0</modelVersion>
+ <groupId>org.nuiton.jredmine-maven-plugin</groupId>
+ <artifactId>test-display-data</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <name>generate-changes</name>
+ <name>display-data</name>
+ <description>Test for display data.</description>
+ <url>http://nuiton.org/jredmine</url>
- <build>
+ <build>
- <plugins>
- <plugin>
- <groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-maven-plugin</artifactId>
- <configuration>
- <!--<projectId>one</projectId>-->
- <!--<versionId>1.0.0</versionId>-->
- <types>project</types>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>display-data</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-maven-plugin</artifactId>
+ <configuration>
+ <types>project</types>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>display-data</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayVersions.xml
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayVersions.xml 2012-07-12 13:26:19 UTC (rev 262)
+++ trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayVersions.xml 2012-07-12 13:31:01 UTC (rev 263)
@@ -28,32 +28,32 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <groupId>org.nuiton.maven-redmine-plugin</groupId>
- <artifactId>test-generate-changes</artifactId>
- <version>0</version>
- <modelVersion>4.0.0</modelVersion>
+ <groupId>org.nuiton.jredmine-maven-plugin</groupId>
+ <artifactId>test-display-data</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <name>generate-changes</name>
+ <name>display-data</name>
+ <description>Test for display data.</description>
+ <url>http://nuiton.org/jredmine</url>
- <build>
+ <build>
- <plugins>
- <plugin>
- <groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-maven-plugin</artifactId>
- <configuration>
- <projectId>one</projectId>
- <!--<versionId>1.0.0</versionId>-->
- <types>version</types>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>display-data</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-maven-plugin</artifactId>
+ <configuration>
+ <types>version</types>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>display-data</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/generateChangesMojoTest/generateChanges.xml
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/generateChangesMojoTest/generateChanges.xml 2012-07-12 13:26:19 UTC (rev 262)
+++ trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/generateChangesMojoTest/generateChanges.xml 2012-07-12 13:31:01 UTC (rev 263)
@@ -28,37 +28,36 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <groupId>org.nuiton.maven-redmine-plugin</groupId>
- <artifactId>test-generate-changes</artifactId>
- <version>0</version>
- <modelVersion>4.0.0</modelVersion>
+ <groupId>org.nuiton.jredmine-maven-plugin</groupId>
+ <artifactId>test-generate-changes</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <name>generate-changes</name>
+ <name>generate-changes</name>
+ <description>Test for generate changes.</description>
+ <url>http://nuiton.org/jredmine</url>
- <build>
+ <build>
- <plugins>
- <plugin>
- <groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-maven-plugin</artifactId>
- <configuration>
- <xmlPath>target/GenerateChangesMojoTest-generate-changes.xml</xmlPath>
- <projectId>one</projectId>
- <versionId>1.0.0</versionId>
- <actionMapping>fix:1, add:2</actionMapping>
- <statusIds>3,4,5</statusIds>
- <categoryIds>1</categoryIds>
- <changesTitle>Title of the first release</changesTitle>
- <!--<releaseDescription>Description of first release</releaseDescription>-->
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>generate-changes</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-maven-plugin</artifactId>
+ <configuration>
+ <xmlPath>target/GenerateChangesMojoTest-generate-changes.xml</xmlPath>
+ <actionMapping>fix:1, add:2</actionMapping>
+ <statusIds>3</statusIds>
+ <!--<categoryIds>1</categoryIds>-->
+ <changesTitle>Title of the first release</changesTitle>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate-changes</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/nextVersionMojoTest/nextVersion.xml
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/nextVersionMojoTest/nextVersion.xml 2012-07-12 13:26:19 UTC (rev 262)
+++ trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/nextVersionMojoTest/nextVersion.xml 2012-07-12 13:31:01 UTC (rev 263)
@@ -28,35 +28,35 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <groupId>org.nuiton.maven-redmine-plugin</groupId>
- <artifactId>test-generate-changes</artifactId>
- <version>0</version>
- <modelVersion>4.0.0</modelVersion>
+ <groupId>org.nuiton.maven-redmine-plugin</groupId>
+ <artifactId>test-generate-changes</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <name>generate-changes</name>
+ <name>generate-changes</name>
- <build>
+ <build>
- <plugins>
- <plugin>
- <groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-maven-plugin</artifactId>
- <configuration>
- <projectId>one</projectId>
- <versionId>1.0.33</versionId>
- <versionDescription>The next version description</versionDescription>
- <previousVersionName>1.0.3</previousVersionName>
- <skipNextVersion>false</skipNextVersion>
- <dryRun>true</dryRun>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>next-version</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-maven-plugin</artifactId>
+ <configuration>
+ <projectId>jredmine</projectId>
+ <versionId>1.4</versionId>
+ <versionDescription>The next version description</versionDescription>
+ <previousVersionName>1.0.3</previousVersionName>
+ <skipNextVersion>false</skipNextVersion>
+ <dryRun>true</dryRun>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>next-version</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/nextVersionMojoTest/skipNextVersion.xml
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/nextVersionMojoTest/skipNextVersion.xml 2012-07-12 13:26:19 UTC (rev 262)
+++ trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/nextVersionMojoTest/skipNextVersion.xml 2012-07-12 13:31:01 UTC (rev 263)
@@ -28,35 +28,35 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <groupId>org.nuiton.maven-redmine-plugin</groupId>
- <artifactId>test-generate-changes</artifactId>
- <version>0</version>
- <modelVersion>4.0.0</modelVersion>
+ <groupId>org.nuiton.maven-redmine-plugin</groupId>
+ <artifactId>test-generate-changes</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <name>generate-changes</name>
+ <name>generate-changes</name>
- <build>
+ <build>
- <plugins>
- <plugin>
- <groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-maven-plugin</artifactId>
- <configuration>
- <projectId>one</projectId>
- <versionId>1.0.33</versionId>
- <versionDescription>The next version description</versionDescription>
- <previousVersionName>1.0.3</previousVersionName>
- <skipNextVersion>true</skipNextVersion>
- <!--<dryRun>true</dryRun>-->
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>next-version</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-maven-plugin</artifactId>
+ <configuration>
+ <projectId>jredmine</projectId>
+ <versionId>1.4</versionId>
+ <versionDescription>The next version description</versionDescription>
+ <previousVersionName>1.0.3</previousVersionName>
+ <skipNextVersion>true</skipNextVersion>
+ <!--<dryRun>true</dryRun>-->
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>next-version</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishAttachmentsMojoTest/publishAttachments.xml
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishAttachmentsMojoTest/publishAttachments.xml 2012-07-12 13:26:19 UTC (rev 262)
+++ trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishAttachmentsMojoTest/publishAttachments.xml 2012-07-12 13:31:01 UTC (rev 263)
@@ -28,36 +28,36 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <groupId>org.nuiton.maven-redmine-plugin</groupId>
- <artifactId>test-generate-changes</artifactId>
- <version>0</version>
- <modelVersion>4.0.0</modelVersion>
+ <groupId>org.nuiton.maven-redmine-plugin</groupId>
+ <artifactId>test-generate-changes</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <name>generate-changes</name>
+ <name>generate-changes</name>
- <build>
+ <build>
- <plugins>
- <plugin>
- <groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-maven-plugin</artifactId>
- <configuration>
- <projectId>one</projectId>
- <versionId>1.0.0</versionId>
- <files>
- <file>${basedir}/pom.xml</file>
- </files>
- <skipPublishAttachments>false</skipPublishAttachments>
- <dryRun>true</dryRun>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>publish-attachments</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-maven-plugin</artifactId>
+ <configuration>
+ <projectId>jredmine</projectId>
+ <versionId>1.4</versionId>
+ <files>
+ <file>${basedir}/pom.xml</file>
+ </files>
+ <skipPublishAttachments>false</skipPublishAttachments>
+ <dryRun>true</dryRun>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>publish-attachments</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishAttachmentsMojoTest/skipPublishAttachments.xml
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishAttachmentsMojoTest/skipPublishAttachments.xml 2012-07-12 13:26:19 UTC (rev 262)
+++ trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishAttachmentsMojoTest/skipPublishAttachments.xml 2012-07-12 13:31:01 UTC (rev 263)
@@ -28,35 +28,35 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <groupId>org.nuiton.maven-redmine-plugin</groupId>
- <artifactId>test-generate-changes</artifactId>
- <version>0</version>
- <modelVersion>4.0.0</modelVersion>
+ <groupId>org.nuiton.maven-redmine-plugin</groupId>
+ <artifactId>test-generate-changes</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <name>generate-changes</name>
+ <name>generate-changes</name>
- <build>
+ <build>
- <plugins>
- <plugin>
- <groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-maven-plugin</artifactId>
- <configuration>
- <projectId>one</projectId>
- <versionId>1.0.0</versionId>
- <files>
- <file>pom.xml</file>
- </files>
- <skipPublishAttachments>true</skipPublishAttachments>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>publish-attachments</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-maven-plugin</artifactId>
+ <configuration>
+ <projectId>jredmine</projectId>
+ <versionId>1.4</versionId>
+ <files>
+ <file>pom.xml</file>
+ </files>
+ <skipPublishAttachments>true</skipPublishAttachments>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>publish-attachments</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishNewsMojoTest/publishNews.xml
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishNewsMojoTest/publishNews.xml 2012-07-12 13:26:19 UTC (rev 262)
+++ trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishNewsMojoTest/publishNews.xml 2012-07-12 13:31:01 UTC (rev 263)
@@ -28,36 +28,40 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <groupId>org.nuiton.maven-redmine-plugin</groupId>
- <artifactId>test-generate-changes</artifactId>
- <version>0</version>
- <modelVersion>4.0.0</modelVersion>
+ <groupId>org.nuiton.maven-redmine-plugin</groupId>
+ <artifactId>test-generate-changes</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <name>generate-changes</name>
+ <name>generate-changes</name>
- <build>
+ <build>
- <plugins>
- <plugin>
- <groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-maven-plugin</artifactId>
- <configuration>
- <projectId>one</projectId>
- <versionId>1.0.0</versionId>
- <newsContentFile>target/test-classes/org/nuiton/jredmine/plugin/publishNewsMojoTest/newsContentFile.txt</newsContentFile>
- <newsTitle>[ANNOUNCEMENT] - One 1.0.0 released</newsTitle>
- <newsSummary>The release 1.0.0 is the first release of this plugin...</newsSummary>
- <skipPublishNews>false</skipPublishNews>
- <dryRun>true</dryRun>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>publish-news</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-maven-plugin</artifactId>
+ <configuration>
+ <projectId>jredmine</projectId>
+ <versionId>1.4</versionId>
+ <newsContentFile>
+ target/test-classes/org/nuiton/jredmine/plugin/publishNewsMojoTest/newsContentFile.txt
+ </newsContentFile>
+ <newsTitle>[ANNOUNCEMENT] - One 1.0.0 released</newsTitle>
+ <newsSummary>The release 1.0.0 is the first release of this
+ plugin...
+ </newsSummary>
+ <skipPublishNews>false</skipPublishNews>
+ <dryRun>true</dryRun>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>publish-news</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishNewsMojoTest/skipPublishNews.xml
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishNewsMojoTest/skipPublishNews.xml 2012-07-12 13:26:19 UTC (rev 262)
+++ trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishNewsMojoTest/skipPublishNews.xml 2012-07-12 13:31:01 UTC (rev 263)
@@ -28,35 +28,39 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <groupId>org.nuiton.maven-redmine-plugin</groupId>
- <artifactId>test-generate-changes</artifactId>
- <version>0</version>
- <modelVersion>4.0.0</modelVersion>
+ <groupId>org.nuiton.maven-redmine-plugin</groupId>
+ <artifactId>test-generate-changes</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <name>generate-changes</name>
+ <name>generate-changes</name>
- <build>
+ <build>
- <plugins>
- <plugin>
- <groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-maven-plugin</artifactId>
- <configuration>
- <projectId>one</projectId>
- <versionId>1.0.0</versionId>
- <newsContentFile>target/test-classes/org/nuiton/jredmine/plugin/publishNewsMojoTest/newsContentFile.txt</newsContentFile>
- <newsTitle>[ANNOUNCEMENT] - One 1.0.0 released</newsTitle>
- <newsSummary>The release 1.0.0 is the first release of this plugin...</newsSummary>
- <skipPublishNews>true</skipPublishNews>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>publish-news</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-maven-plugin</artifactId>
+ <configuration>
+ <projectId>jredmine</projectId>
+ <versionId>1.4</versionId>
+ <newsContentFile>
+ target/test-classes/org/nuiton/jredmine/plugin/publishNewsMojoTest/newsContentFile.txt
+ </newsContentFile>
+ <newsTitle>[ANNOUNCEMENT] - One 1.0.0 released</newsTitle>
+ <newsSummary>The release 1.0.0 is the first release of this
+ plugin...
+ </newsSummary>
+ <skipPublishNews>true</skipPublishNews>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>publish-news</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByAssigneeTest/issueReport.xml
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByAssigneeTest/issueReport.xml 2012-07-12 13:26:19 UTC (rev 262)
+++ trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByAssigneeTest/issueReport.xml 2012-07-12 13:31:01 UTC (rev 263)
@@ -28,31 +28,32 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <groupId>org.nuiton.maven-redmine-plugin</groupId>
- <artifactId>test-redmine-report</artifactId>
- <version>0</version>
- <modelVersion>4.0.0</modelVersion>
+ <groupId>org.nuiton.maven-redmine-plugin</groupId>
+ <artifactId>test-redmine-report</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <name>redmine-report</name>
+ <name>redmine-report</name>
- <build>
+ <build>
- <plugins>
- <plugin>
- <groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-maven-plugin</artifactId>
- <configuration>
- <projectId>one</projectId>
- <versionId>1.0.0</versionId>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>issues-report-by-assignee</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-maven-plugin</artifactId>
+ <configuration>
+ <columnNamesByAssignee>
+ Tracker,Category,Key,Summary,Status,Assignee,Version
+ </columnNamesByAssignee>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>issues-report-by-assignee</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByCategoryTest/issueReport.xml
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByCategoryTest/issueReport.xml 2012-07-12 13:26:19 UTC (rev 262)
+++ trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByCategoryTest/issueReport.xml 2012-07-12 13:31:01 UTC (rev 263)
@@ -28,31 +28,32 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <groupId>org.nuiton.maven-redmine-plugin</groupId>
- <artifactId>test-redmine-report</artifactId>
- <version>0</version>
- <modelVersion>4.0.0</modelVersion>
+ <groupId>org.nuiton.maven-redmine-plugin</groupId>
+ <artifactId>test-redmine-report</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <name>redmine-report</name>
+ <name>redmine-report</name>
- <build>
+ <build>
- <plugins>
- <plugin>
- <groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-maven-plugin</artifactId>
- <configuration>
- <projectId>one</projectId>
- <versionId>1.0.0</versionId>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>issues-report-by-category</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-maven-plugin</artifactId>
+ <configuration>
+ <columnNamesByCategory>
+ Tracker,Category,Key,Summary,Status,Assignee,Version
+ </columnNamesByCategory>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>issues-report-by-category</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByPriorityTest/issueReport.xml
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByPriorityTest/issueReport.xml 2012-07-12 13:26:19 UTC (rev 262)
+++ trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByPriorityTest/issueReport.xml 2012-07-12 13:31:01 UTC (rev 263)
@@ -28,31 +28,32 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <groupId>org.nuiton.maven-redmine-plugin</groupId>
- <artifactId>test-redmine-report</artifactId>
- <version>0</version>
- <modelVersion>4.0.0</modelVersion>
+ <groupId>org.nuiton.maven-redmine-plugin</groupId>
+ <artifactId>test-redmine-report</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <name>redmine-report</name>
+ <name>redmine-report</name>
- <build>
+ <build>
- <plugins>
- <plugin>
- <groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-maven-plugin</artifactId>
- <configuration>
- <projectId>one</projectId>
- <versionId>1.0.0</versionId>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>issues-report-by-priority</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-maven-plugin</artifactId>
+ <configuration>
+ <columnNamesByPriority>
+ Tracker,Category,Key,Summary,Status,Assignee,Version
+ </columnNamesByPriority>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>issues-report-by-priority</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByReporterTest/issueReport.xml
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByReporterTest/issueReport.xml 2012-07-12 13:26:19 UTC (rev 262)
+++ trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByReporterTest/issueReport.xml 2012-07-12 13:31:01 UTC (rev 263)
@@ -28,31 +28,32 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <groupId>org.nuiton.maven-redmine-plugin</groupId>
- <artifactId>test-redmine-report</artifactId>
- <version>0</version>
- <modelVersion>4.0.0</modelVersion>
+ <groupId>org.nuiton.maven-redmine-plugin</groupId>
+ <artifactId>test-redmine-report</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <name>redmine-report</name>
+ <name>redmine-report</name>
- <build>
+ <build>
- <plugins>
- <plugin>
- <groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-maven-plugin</artifactId>
- <configuration>
- <projectId>one</projectId>
- <versionId>1.0.0</versionId>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>issues-report-by-reporter</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-maven-plugin</artifactId>
+ <configuration>
+ <columnNamesByReporter>
+ Tracker,Category,Key,Summary,Status,Assignee,Version
+ </columnNamesByReporter>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>issues-report-by-reporter</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByStatusTest/issueReport.xml
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByStatusTest/issueReport.xml 2012-07-12 13:26:19 UTC (rev 262)
+++ trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByStatusTest/issueReport.xml 2012-07-12 13:31:01 UTC (rev 263)
@@ -28,31 +28,32 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <groupId>org.nuiton.maven-redmine-plugin</groupId>
- <artifactId>test-redmine-report</artifactId>
- <version>0</version>
- <modelVersion>4.0.0</modelVersion>
+ <groupId>org.nuiton.maven-redmine-plugin</groupId>
+ <artifactId>test-redmine-report</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <name>redmine-report</name>
+ <name>redmine-report</name>
- <build>
+ <build>
- <plugins>
- <plugin>
- <groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-maven-plugin</artifactId>
- <configuration>
- <projectId>one</projectId>
- <versionId>1.0.0</versionId>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>issues-report-by-status</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-maven-plugin</artifactId>
+ <configuration>
+ <columnNamesByStatus>
+ Tracker,Category,Key,Summary,Status,Assignee,Version
+ </columnNamesByStatus>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>issues-report-by-status</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByTrackerTest/issueReport.xml
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByTrackerTest/issueReport.xml 2012-07-12 13:26:19 UTC (rev 262)
+++ trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByTrackerTest/issueReport.xml 2012-07-12 13:31:01 UTC (rev 263)
@@ -28,31 +28,32 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <groupId>org.nuiton.maven-redmine-plugin</groupId>
- <artifactId>test-redmine-report</artifactId>
- <version>0</version>
- <modelVersion>4.0.0</modelVersion>
+ <groupId>org.nuiton.maven-redmine-plugin</groupId>
+ <artifactId>test-redmine-report</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <name>redmine-report</name>
+ <name>redmine-report</name>
- <build>
+ <build>
- <plugins>
- <plugin>
- <groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-maven-plugin</artifactId>
- <configuration>
- <projectId>one</projectId>
- <versionId>1.0.0</versionId>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>issues-report-by-tracker</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-maven-plugin</artifactId>
+ <configuration>
+ <columnNamesByTracker>
+ Tracker,Category,Key,Summary,Status,Assignee,Version
+ </columnNamesByTracker>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>issues-report-by-tracker</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByVersionTest/issueReport.xml
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByVersionTest/issueReport.xml 2012-07-12 13:26:19 UTC (rev 262)
+++ trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByVersionTest/issueReport.xml 2012-07-12 13:31:01 UTC (rev 263)
@@ -28,31 +28,32 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <groupId>org.nuiton.maven-redmine-plugin</groupId>
- <artifactId>test-redmine-report</artifactId>
- <version>0</version>
- <modelVersion>4.0.0</modelVersion>
+ <groupId>org.nuiton.maven-redmine-plugin</groupId>
+ <artifactId>test-redmine-report</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <name>redmine-report</name>
+ <name>redmine-report</name>
- <build>
+ <build>
- <plugins>
- <plugin>
- <groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-maven-plugin</artifactId>
- <configuration>
- <projectId>one</projectId>
- <versionId>1.0.0</versionId>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>issues-report-by-version</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-maven-plugin</artifactId>
+ <configuration>
+ <columnNamesByVersion>
+ Tracker,Category,Key,Summary,Status,Assignee,Version
+ </columnNamesByVersion>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>issues-report-by-version</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportTest/issueReport.xml
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportTest/issueReport.xml 2012-07-12 13:26:19 UTC (rev 262)
+++ trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportTest/issueReport.xml 2012-07-12 13:31:01 UTC (rev 263)
@@ -28,31 +28,32 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <groupId>org.nuiton.maven-redmine-plugin</groupId>
- <artifactId>test-redmine-report</artifactId>
- <version>0</version>
- <modelVersion>4.0.0</modelVersion>
+ <groupId>org.nuiton.maven-redmine-plugin</groupId>
+ <artifactId>test-redmine-report</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <name>redmine-report</name>
+ <name>redmine-report</name>
- <build>
+ <build>
- <plugins>
- <plugin>
- <groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-maven-plugin</artifactId>
- <configuration>
- <projectId>one</projectId>
- <versionId>1.0.0</versionId>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>issues-report</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-maven-plugin</artifactId>
+ <configuration>
+ <columnNames>
+ Tracker,Category,Key,Summary,Status,Assignee,Version
+ </columnNames>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>issues-report</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/updateVersionMojoTest/skipUpdateVersion.xml
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/updateVersionMojoTest/skipUpdateVersion.xml 2012-07-12 13:26:19 UTC (rev 262)
+++ trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/updateVersionMojoTest/skipUpdateVersion.xml 2012-07-12 13:31:01 UTC (rev 263)
@@ -28,33 +28,33 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <groupId>org.nuiton.maven-redmine-plugin</groupId>
- <artifactId>test-generate-changes</artifactId>
- <version>0</version>
- <modelVersion>4.0.0</modelVersion>
+ <groupId>org.nuiton.maven-redmine-plugin</groupId>
+ <artifactId>test-generate-changes</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <name>generate-changes</name>
+ <name>generate-changes</name>
- <build>
+ <build>
- <plugins>
- <plugin>
- <groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-maven-plugin</artifactId>
- <configuration>
- <projectId>one</projectId>
- <versionId>1.0.0</versionId>
- <versionDescription>The version description</versionDescription>
- <skipUpdateVersion>true</skipUpdateVersion>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>update-version</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-maven-plugin</artifactId>
+ <configuration>
+ <projectId>jredmine</projectId>
+ <versionId>1.4</versionId>
+ <versionDescription>The version description</versionDescription>
+ <skipUpdateVersion>true</skipUpdateVersion>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>update-version</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/updateVersionMojoTest/updateVersion.xml
===================================================================
--- trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/updateVersionMojoTest/updateVersion.xml 2012-07-12 13:26:19 UTC (rev 262)
+++ trunk/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/updateVersionMojoTest/updateVersion.xml 2012-07-12 13:31:01 UTC (rev 263)
@@ -28,36 +28,36 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <groupId>org.nuiton.maven-redmine-plugin</groupId>
- <artifactId>test-generate-changes</artifactId>
- <version>0</version>
- <modelVersion>4.0.0</modelVersion>
+ <groupId>org.nuiton.maven-redmine-plugin</groupId>
+ <artifactId>test-generate-changes</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <name>generate-changes</name>
+ <name>generate-changes</name>
- <build>
+ <build>
- <plugins>
- <plugin>
- <groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-maven-plugin</artifactId>
- <configuration>
- <projectId>one</projectId>
- <versionId>1.0.0</versionId>
- <versionDescription>The version description</versionDescription>
- <closeVersion>true</closeVersion>
- <effectiveDate>2009-09-19</effectiveDate>
- <skipUpdateVersion>false</skipUpdateVersion>
- <dryRun>true</dryRun>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>update-version</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-maven-plugin</artifactId>
+ <configuration>
+ <projectId>jredmine</projectId>
+ <versionId>1.4</versionId>
+ <versionDescription>The version description</versionDescription>
+ <closeVersion>true</closeVersion>
+ <effectiveDate>2009-09-19</effectiveDate>
+ <skipUpdateVersion>false</skipUpdateVersion>
+ <dryRun>true</dryRun>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>update-version</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
1
0
r262 - in trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine: . model plugin plugin/announcement plugin/report
by tchemit@users.nuiton.org 12 Jul '12
by tchemit@users.nuiton.org 12 Jul '12
12 Jul '12
Author: tchemit
Date: 2012-07-12 15:26:19 +0200 (Thu, 12 Jul 2012)
New Revision: 262
Url: http://nuiton.org/repositories/revision/jredmine/262
Log:
fix author javadoc annotation + move enums to plugin (not used anywhere else and will be remove soon...)
Added:
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/model/
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/model/RedmineModelScope.java
Modified:
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojo.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/GenerateChangesMojo.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/IssueCollectorConfiguration.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/IssuesCollector.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/NextVersionMojo.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojo.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishNewsMojo.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/UpdateVersionMojo.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/AbstractAnnouncementMojo.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/AnnouncementGenerator.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojo.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojo.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractIssuesReport.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractRedmineReport.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssueReportGenerator.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReport.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByAssignee.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByCategory.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByPriority.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByReporter.java
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/IssuesReportByTracker.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByVersion.java
Added: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java (rev 0)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java 2012-07-12 13:26:19 UTC (rev 262)
@@ -0,0 +1,73 @@
+package org.nuiton.jredmine.model;
+
+import org.nuiton.jredmine.rest.RedmineRestClient;
+
+/**
+ * Un énumération pour connaitre l'ensemble des classes du modèle.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0.0
+ */
+public enum RedmineModelEnum {
+
+ issueStatus(IssueStatus.class, RedmineModelScope.none, RedmineRestClient.GET_ISSUE_STATUS_LIST),
+ issuePriority(IssuePriority.class, RedmineModelScope.none, RedmineRestClient.GET_ISSUE_PRIORITY_LIST),
+ project(Project.class, RedmineModelScope.none, RedmineRestClient.GET_PROJECT_LIST),
+ issueCategory(IssueCategory.class, RedmineModelScope.project, RedmineRestClient.GET_ISSUE_CATEGORY_LIST),
+ tracker(Tracker.class, RedmineModelScope.project, RedmineRestClient.GET_TRACKER_LIST),
+ user(User.class, RedmineModelScope.project, RedmineRestClient.GET_USER_LIST),
+ news(News.class, RedmineModelScope.project, RedmineRestClient.GET_NEWS_LIST),
+ version(Version.class, RedmineModelScope.project, RedmineRestClient.GET_VERSION_LIST),
+ issue(Issue.class, RedmineModelScope.version, RedmineRestClient.GET_ISSUE_LIST),
+ timeEntry(TimeEntry.class, RedmineModelScope.issue, RedmineRestClient.GET_ISSUE_TIME_ENTRY_LIST),
+ attachment(Attachment.class, RedmineModelScope.version, RedmineRestClient.GET_ATTACHMENTS_LIST);
+
+ private final Class<?> modelType;
+
+ private final RedmineModelScope scope;
+
+ private final String requestAll;
+
+ RedmineModelEnum(Class<?> modelType, RedmineModelScope scope, String requestAll) {
+ this.modelType = modelType;
+ this.scope = scope;
+ this.requestAll = requestAll;
+ }
+
+
+ public Class<?> getModelType() {
+ return modelType;
+ }
+
+ public RedmineModelScope getScope() {
+ return scope;
+ }
+
+ public String getRequestAll() {
+ return requestAll;
+ }
+
+ public static RedmineModelEnum valueOf(Class<?> type) {
+ for (RedmineModelEnum e : values()) {
+ if (e.getModelType().equals(type)) {
+ return e;
+ }
+ }
+ return null;
+ }
+
+ public static RedmineModelEnum safeValueOf(Class<?> type) {
+ if (type == null) {
+ throw new NullPointerException("klass parameter can not be null");
+ }
+
+ // check dataType is authorized
+
+ RedmineModelEnum r = valueOf(type);
+ if (r == null) {
+ throw new IllegalArgumentException("the type " + type.getName() + " is not allowed!");
+ }
+
+ return r;
+ }
+}
Added: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/model/RedmineModelScope.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/model/RedmineModelScope.java (rev 0)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/model/RedmineModelScope.java 2012-07-12 13:26:19 UTC (rev 262)
@@ -0,0 +1,32 @@
+package org.nuiton.jredmine.model;
+
+/**
+ * Une enumeration pour caracteriser le scope d'une donnée dans le modèle.
+ * <p/>
+ * <p/>
+ * Pour une donnée qui ne dépend de rien, elle est en scope {@link #none}.
+ * <p/>
+ * Pour une donnée qui dépend d'un projet, elle est en scope {@link #project}.
+ * <p/>
+ * Pour une donnée qui dépend d'une version, elle est en scpoe {@link #version}.
+ * <p/>
+ * Pour une donnée qui dépend d'une issue, elle est en scpoe {@link #issue}.
+ * <p/>
+ * A savoir qu'une donnée de scope {@link #version} (resp. {@link #issue}),
+ * elle est aussi de scope {@link #project} car la version (resp. l'issue)
+ * dépend en dépend.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0.0
+ */
+public enum RedmineModelScope {
+
+ /** none scope, requires nothing. */
+ none,
+ /** project scope, requires a project. */
+ project,
+ /** version scope, requires a project and a version. */
+ version,
+ /** issue scope, requires a project and an issue. */
+ issue
+}
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojo.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojo.java 2012-07-12 10:18:02 UTC (rev 261)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojo.java 2012-07-12 13:26:19 UTC (rev 262)
@@ -43,9 +43,9 @@
import java.text.SimpleDateFormat;
/**
- * Abstract redmine mojo.
+ * Abstract jredmine mojo.
*
- * @author tchemit
+ * @author tchemit <chemit(a)codelutin.com>
* @requiresOnline true
* @requiresProject true
* @since 1.0.0
@@ -498,12 +498,12 @@
if (i.isInit()) {
try {
if (verbose) {
- getLog().info("<<< Close redmine rest client...");
+ getLog().info("<<< Close redmine service...");
}
i.destroy();
} catch (Exception ex) {
getLog().error(
- "could not close redmine client for reason " +
+ "could not close redmine service for reason " +
ex.getMessage(), ex);
}
}
@@ -529,4 +529,12 @@
public String getVersionId() {
return versionId;
}
+
+ public void setVersionId(String versionId) {
+ this.versionId = versionId;
+ }
+
+ public void setProjectId(String projectId) {
+ this.projectId = projectId;
+ }
}
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-12 10:18:02 UTC (rev 261)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java 2012-07-12 13:26:19 UTC (rev 262)
@@ -43,7 +43,7 @@
* <p/>
* This goals requires no authentication to the server.
*
- * @author tchemit
+ * @author tchemit <chemit(a)codelutin.com>
* @goal display-data
* @since 1.0.0
*/
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/GenerateChangesMojo.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/GenerateChangesMojo.java 2012-07-12 10:18:02 UTC (rev 261)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/GenerateChangesMojo.java 2012-07-12 13:26:19 UTC (rev 262)
@@ -58,7 +58,7 @@
* by the maven-changes-plugin to generates the release report and send
* the annoncement mail at a release time.
*
- * @author tchemit
+ * @author tchemit <chemit(a)codelutin.com>
* @goal generate-changes
* @since 1.0.0
*/
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/IssueCollectorConfiguration.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/IssueCollectorConfiguration.java 2012-07-12 10:18:02 UTC (rev 261)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/IssueCollectorConfiguration.java 2012-07-12 13:26:19 UTC (rev 262)
@@ -29,7 +29,7 @@
* <p/>
* TODO javadoc
*
- * @author chemit
+ * @author tchemit <chemit(a)codelutin.com>
* @since 1.0.0
*/
public interface IssueCollectorConfiguration {
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/IssuesCollector.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/IssuesCollector.java 2012-07-12 10:18:02 UTC (rev 261)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/IssuesCollector.java 2012-07-12 13:26:19 UTC (rev 262)
@@ -42,7 +42,7 @@
/**
* A class to collect some issues due to given filters.
*
- * @author chemit
+ * @author tchemit <chemit(a)codelutin.com>
* @since 1.0.0
*/
public class IssuesCollector {
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/NextVersionMojo.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/NextVersionMojo.java 2012-07-12 10:18:02 UTC (rev 261)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/NextVersionMojo.java 2012-07-12 13:26:19 UTC (rev 262)
@@ -39,7 +39,7 @@
* previous version to the new one.
* <p/>
*
- * @author tchemit
+ * @author tchemit <chemit(a)codelutin.com>
* @goal next-version
* @since 1.0.0
*/
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojo.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojo.java 2012-07-12 10:18:02 UTC (rev 261)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojo.java 2012-07-12 13:26:19 UTC (rev 262)
@@ -40,7 +40,7 @@
/**
* Publish files for a given project and version on redmine server.
*
- * @author tchemit
+ * @author tchemit <chemit(a)codelutin.com>
* @goal publish-attachments
* @since 1.0.0
*/
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishNewsMojo.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishNewsMojo.java 2012-07-12 10:18:02 UTC (rev 261)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishNewsMojo.java 2012-07-12 13:26:19 UTC (rev 262)
@@ -33,7 +33,7 @@
/**
* Publish a news on redmine server.
*
- * @author tchemit
+ * @author tchemit <chemit(a)codelutin.com>
* @goal publish-news
* @since 1.0.0
*/
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/UpdateVersionMojo.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/UpdateVersionMojo.java 2012-07-12 10:18:02 UTC (rev 261)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/UpdateVersionMojo.java 2012-07-12 13:26:19 UTC (rev 262)
@@ -40,7 +40,7 @@
* <p/>
* Will add a the version if not existing, otherwise, will update the version.
*
- * @author tchemit
+ * @author tchemit <chemit(a)codelutin.com>
* @goal update-version
* @since 1.0.0
*/
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/AbstractAnnouncementMojo.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/AbstractAnnouncementMojo.java 2012-07-12 10:18:02 UTC (rev 261)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/AbstractAnnouncementMojo.java 2012-07-12 13:26:19 UTC (rev 262)
@@ -41,13 +41,13 @@
import java.util.Map;
/**
- * @author chemit
+ * @author tchemit <chemit(a)codelutin.com>
* @requiresOnline true
*/
public abstract class AbstractAnnouncementMojo extends AbstractRedmineMojo implements AnnouncementGeneratorConfiguration {
/**
- * Flag to know if anonymùous connexion to redmine server is required.
+ * Flag to know if anonymous connexion to redmine server is required.
* <p/>
* For this goal, the default value is {@code true}
* <p/>
@@ -88,7 +88,7 @@
* @required
* @since 1.0.0
*/
- protected String templateDirectory;
+ protected String templateDirectory = "org/nuiton/jredmine/plugin/announcement";
/**
* The template encoding.
@@ -118,7 +118,7 @@
* @parameter expression="${redmine.attachmentLinkTemplate}" default-value="%URL%/attachments/download/%FILE%"
* @since 1.0.0
*/
- protected String attachmentLinkTemplate;
+ protected String attachmentLinkTemplate ="%URL%/attachments/download/%FILE%";
/**
* @parameter expression="${project.groupId}"
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/AnnouncementGenerator.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/AnnouncementGenerator.java 2012-07-12 10:18:02 UTC (rev 261)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/AnnouncementGenerator.java 2012-07-12 13:26:19 UTC (rev 262)
@@ -52,7 +52,7 @@
import java.util.regex.Pattern;
/**
- * @author chemit
+ * @author tchemit <chemit(a)codelutin.com>
* @since 1.0.0
*/
public class AnnouncementGenerator {
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojo.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojo.java 2012-07-12 10:18:02 UTC (rev 261)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojo.java 2012-07-12 13:26:19 UTC (rev 262)
@@ -27,7 +27,7 @@
/**
* Generate the content of the release email announcement.
*
- * @author tchemit
+ * @author tchemit <chemit(a)codelutin.com>
* @goal generate-email-announcement
* @since 1.0.0
*/
@@ -40,7 +40,7 @@
* @required
* @since 1.0.0
*/
- protected String emailAnnouncementTemplate;
+ protected String emailAnnouncementTemplate = "release-email-announcement.vm";
/**
* A flag to enable or disable the goal.
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojo.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojo.java 2012-07-12 10:18:02 UTC (rev 261)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojo.java 2012-07-12 13:26:19 UTC (rev 262)
@@ -27,7 +27,7 @@
/**
* Generate the content of the release announcement news for Redmine.
*
- * @author tchemit
+ * @author tchemit <chemit(a)codelutin.com>
* @goal generate-news-announcement
* @since 1.0.0
*/
@@ -40,7 +40,7 @@
* @required
* @since 1.0.0
*/
- protected String newsAnnouncementTemplate;
+ protected String newsAnnouncementTemplate = "release-news-announcement.vm";
/**
* A flag to enable or disable the goal.
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractIssuesReport.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractIssuesReport.java 2012-07-12 10:18:02 UTC (rev 261)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractIssuesReport.java 2012-07-12 13:26:19 UTC (rev 262)
@@ -38,7 +38,7 @@
/**
* Abstract Generates a report for issues from Redmine's server
*
- * @author tchemit
+ * @author tchemit <chemit(a)codelutin.com>
* @since 1.0.0
*/
public abstract class AbstractIssuesReport extends AbstractRedmineReport implements IssueCollectorConfiguration {
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractRedmineReport.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractRedmineReport.java 2012-07-12 10:18:02 UTC (rev 261)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractRedmineReport.java 2012-07-12 13:26:19 UTC (rev 262)
@@ -59,7 +59,7 @@
/**
* Abstract redmine report mojo.
*
- * @author chemit
+ * @author tchemit <chemit(a)codelutin.com>
* @requiresReports true
* @since 1.0.0
*/
@@ -90,7 +90,7 @@
* @parameter expression="${redmine.issueLinkTemplate}" default-value="%URL%/issues/show/%ISSUE%"
* @since 1.0.0
*/
- protected String issueLinkTemplate;
+ protected String issueLinkTemplate = "%URL%/issues/show/%ISSUE%";
/**
* Template strings per system that is used to discover the URL to use to display an issue report. Each key in this
@@ -104,7 +104,7 @@
* @parameter expression="${redmine.versionLinkTemplate}" default-value="%URL%/versions/show/%VERSION%"
* @since 1.0.0
*/
- protected String versionLinkTemplate;
+ protected String versionLinkTemplate = "%URL%/versions/show/%VERSION%";
/**
* Local Repository.
@@ -356,7 +356,7 @@
null,
null);
- resolver.resolve(artifact,
+ resolver.resolveAlways(artifact,
project.getRemoteArtifactRepositories(),
localRepository);
} catch (InvalidVersionSpecificationException e) {
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssueReportGenerator.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssueReportGenerator.java 2012-07-12 10:18:02 UTC (rev 261)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssueReportGenerator.java 2012-07-12 13:26:19 UTC (rev 262)
@@ -52,7 +52,7 @@
/**
* Generates a Redmine report.
*
- * @author tchemit
+ * @author tchemit <chemit(a)codelutin.com>
* @since 1.0.0
*/
public class IssueReportGenerator {
@@ -360,7 +360,7 @@
"maven-redmine-plugin: None of the configured " +
"columnNames '" + columnNames + "' are valid.");
}
- if (groupBy != null && !groupBy.trim().isEmpty()) {
+ if (StringUtils.isNotEmpty(groupBy)) {
try {
groupColumn = ReportColumn.valueOf(
groupBy.trim().toLowerCase());
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReport.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReport.java 2012-07-12 10:18:02 UTC (rev 261)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReport.java 2012-07-12 13:26:19 UTC (rev 262)
@@ -29,7 +29,7 @@
/**
* Generates a report for issues from Redmine's server
*
- * @author tchemit
+ * @author tchemit <chemit(a)codelutin.com>
* @goal issues-report
* @since 1.0.0
*/
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByAssignee.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByAssignee.java 2012-07-12 10:18:02 UTC (rev 261)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByAssignee.java 2012-07-12 13:26:19 UTC (rev 262)
@@ -29,7 +29,7 @@
/**
* Generates a report for issues from Redmine's server group by assignee.
*
- * @author tchemit
+ * @author tchemit <chemit(a)codelutin.com>
* @goal issues-report-by-assignee
* @since 1.0.0
*/
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByCategory.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByCategory.java 2012-07-12 10:18:02 UTC (rev 261)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByCategory.java 2012-07-12 13:26:19 UTC (rev 262)
@@ -29,7 +29,7 @@
/**
* Generates a report for issues from Redmine's server group by category.
*
- * @author tchemit
+ * @author tchemit <chemit(a)codelutin.com>
* @goal issues-report-by-category
* @since 1.0.0
*/
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByPriority.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByPriority.java 2012-07-12 10:18:02 UTC (rev 261)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByPriority.java 2012-07-12 13:26:19 UTC (rev 262)
@@ -29,7 +29,7 @@
/**
* Generates a report for issues from Redmine's server group by priority.
*
- * @author tchemit
+ * @author tchemit <chemit(a)codelutin.com>
* @goal issues-report-by-priority
* @since 1.0.0
*/
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByReporter.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByReporter.java 2012-07-12 10:18:02 UTC (rev 261)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByReporter.java 2012-07-12 13:26:19 UTC (rev 262)
@@ -29,7 +29,7 @@
/**
* Generates a report for issues from Redmine's server group by reporter.
*
- * @author tchemit
+ * @author tchemit <chemit(a)codelutin.com>
* @goal issues-report-by-reporter
* @since 1.0.0
*/
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-12 10:18:02 UTC (rev 261)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByStatus.java 2012-07-12 13:26:19 UTC (rev 262)
@@ -29,7 +29,7 @@
/**
* Generates a report for issues from Redmine's server group by status.
*
- * @author tchemit
+ * @author tchemit <chemit(a)codelutin.com>
* @goal issues-report-by-status
* @since 1.0.0
*/
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByTracker.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByTracker.java 2012-07-12 10:18:02 UTC (rev 261)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByTracker.java 2012-07-12 13:26:19 UTC (rev 262)
@@ -29,7 +29,7 @@
/**
* Generates a report for issues from Redmine's server group by tracker.
*
- * @author tchemit
+ * @author tchemit <chemit(a)codelutin.com>
* @goal issues-report-by-tracker
* @since 1.0.0
*/
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByVersion.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByVersion.java 2012-07-12 10:18:02 UTC (rev 261)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByVersion.java 2012-07-12 13:26:19 UTC (rev 262)
@@ -29,7 +29,7 @@
/**
* Generates a report for issues from Redmine's server group by version.
*
- * @author tchemit
+ * @author tchemit <chemit(a)codelutin.com>
* @goal issues-report-by-version
* @since 1.0.0
*/
1
0
r261 - in trunk: jredmine-client/src/main/java/org/nuiton/jredmine jredmine-client/src/main/java/org/nuiton/jredmine/model jredmine-domain/src/main/java/org/nuiton/jredmine/model
by tchemit@users.nuiton.org 12 Jul '12
by tchemit@users.nuiton.org 12 Jul '12
12 Jul '12
Author: tchemit
Date: 2012-07-12 12:18:02 +0200 (Thu, 12 Jul 2012)
New Revision: 261
Url: http://nuiton.org/repositories/revision/jredmine/261
Log:
ove back some stuff to client (but will be removed soon)
Added:
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelScope.java
Removed:
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/RedmineModelScope.java
Added: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java (rev 0)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java 2012-07-12 10:18:02 UTC (rev 261)
@@ -0,0 +1,97 @@
+/*
+ * #%L
+ * JRedmine :: Client
+ *
+ * $Id$
+ * $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-domain/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.model;
+
+import org.nuiton.jredmine.rest.RedmineRestClient;
+
+/**
+ * Un énumération pour connaitre l'ensemble des classes du modèle.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0.0
+ */
+public enum RedmineModelEnum {
+
+ issueStatus(IssueStatus.class, RedmineModelScope.none, RedmineRestClient.GET_ISSUE_STATUS_LIST),
+ issuePriority(IssuePriority.class, RedmineModelScope.none, RedmineRestClient.GET_ISSUE_PRIORITY_LIST),
+ project(Project.class, RedmineModelScope.none, RedmineRestClient.GET_PROJECT_LIST),
+ issueCategory(IssueCategory.class, RedmineModelScope.project, RedmineRestClient.GET_ISSUE_CATEGORY_LIST),
+ tracker(Tracker.class, RedmineModelScope.project, RedmineRestClient.GET_TRACKER_LIST),
+ user(User.class, RedmineModelScope.project, RedmineRestClient.GET_USER_LIST),
+ news(News.class, RedmineModelScope.project, RedmineRestClient.GET_NEWS_LIST),
+ version(Version.class, RedmineModelScope.project, RedmineRestClient.GET_VERSION_LIST),
+ issue(Issue.class, RedmineModelScope.version, RedmineRestClient.GET_ISSUE_LIST),
+ timeEntry(TimeEntry.class, RedmineModelScope.issue, RedmineRestClient.GET_ISSUE_TIME_ENTRY_LIST),
+ attachment(Attachment.class, RedmineModelScope.version, RedmineRestClient.GET_ATTACHMENTS_LIST);
+
+ private final Class<?> modelType;
+
+ private final RedmineModelScope scope;
+
+ private final String requestAll;
+
+ RedmineModelEnum(Class<?> modelType, RedmineModelScope scope, String requestAll) {
+ this.modelType = modelType;
+ this.scope = scope;
+ this.requestAll = requestAll;
+ }
+
+
+ public Class<?> getModelType() {
+ return modelType;
+ }
+
+ public RedmineModelScope getScope() {
+ return scope;
+ }
+
+ public String getRequestAll() {
+ return requestAll;
+ }
+
+ public static RedmineModelEnum valueOf(Class<?> type) {
+ for (RedmineModelEnum e : values()) {
+ if (e.getModelType().equals(type)) {
+ return e;
+ }
+ }
+ return null;
+ }
+
+ public static RedmineModelEnum safeValueOf(Class<?> type) {
+ if (type == null) {
+ throw new NullPointerException("klass parameter can not be null");
+ }
+
+ // check dataType is authorized
+
+ RedmineModelEnum r = valueOf(type);
+ if (r == null) {
+ throw new IllegalArgumentException("the type " + type.getName() + " is not allowed!");
+ }
+
+ return r;
+ }
+}
Property changes on: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelScope.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelScope.java (rev 0)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelScope.java 2012-07-12 10:18:02 UTC (rev 261)
@@ -0,0 +1,56 @@
+/*
+ * #%L
+ * JRedmine :: Client
+ *
+ * $Id$
+ * $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-domain/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.model;
+
+/**
+ * Une enumeration pour caracteriser le scope d'une donnée dans le modèle.
+ * <p/>
+ * <p/>
+ * Pour une donnée qui ne dépend de rien, elle est en scope {@link #none}.
+ * <p/>
+ * Pour une donnée qui dépend d'un projet, elle est en scope {@link #project}.
+ * <p/>
+ * Pour une donnée qui dépend d'une version, elle est en scpoe {@link #version}.
+ * <p/>
+ * Pour une donnée qui dépend d'une issue, elle est en scpoe {@link #issue}.
+ * <p/>
+ * A savoir qu'une donnée de scope {@link #version} (resp. {@link #issue}),
+ * elle est aussi de scope {@link #project} car la version (resp. l'issue)
+ * dépend en dépend.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0.0
+ */
+public enum RedmineModelScope {
+
+ /** none scope, requires nothing. */
+ none,
+ /** project scope, requires a project. */
+ project,
+ /** version scope, requires a project and a version. */
+ version,
+ /** issue scope, requires a project and an issue. */
+ issue
+}
Property changes on: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelScope.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Deleted: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java 2012-07-12 10:16:06 UTC (rev 260)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java 2012-07-12 10:18:02 UTC (rev 261)
@@ -1,97 +0,0 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model;
-
-import org.nuiton.jredmine.rest.RedmineRestClient;
-
-/**
- * Un énumération pour connaitre l'ensemble des classes du modèle.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0.0
- */
-public enum RedmineModelEnum {
-
- issueStatus(IssueStatus.class, RedmineModelScope.none, RedmineRestClient.GET_ISSUE_STATUS_LIST),
- issuePriority(IssuePriority.class, RedmineModelScope.none, RedmineRestClient.GET_ISSUE_PRIORITY_LIST),
- project(Project.class, RedmineModelScope.none, RedmineRestClient.GET_PROJECT_LIST),
- issueCategory(IssueCategory.class, RedmineModelScope.project, RedmineRestClient.GET_ISSUE_CATEGORY_LIST),
- tracker(Tracker.class, RedmineModelScope.project, RedmineRestClient.GET_TRACKER_LIST),
- user(User.class, RedmineModelScope.project, RedmineRestClient.GET_USER_LIST),
- news(News.class, RedmineModelScope.project, RedmineRestClient.GET_NEWS_LIST),
- version(Version.class, RedmineModelScope.project, RedmineRestClient.GET_VERSION_LIST),
- issue(Issue.class, RedmineModelScope.version, RedmineRestClient.GET_ISSUE_LIST),
- timeEntry(TimeEntry.class, RedmineModelScope.issue, RedmineRestClient.GET_ISSUE_TIME_ENTRY_LIST),
- attachment(Attachment.class, RedmineModelScope.version, RedmineRestClient.GET_ATTACHMENTS_LIST);
-
- private final Class<?> modelType;
-
- private final RedmineModelScope scope;
-
- private final String requestAll;
-
- RedmineModelEnum(Class<?> modelType, RedmineModelScope scope, String requestAll) {
- this.modelType = modelType;
- this.scope = scope;
- this.requestAll = requestAll;
- }
-
-
- public Class<?> getModelType() {
- return modelType;
- }
-
- public RedmineModelScope getScope() {
- return scope;
- }
-
- public String getRequestAll() {
- return requestAll;
- }
-
- public static RedmineModelEnum valueOf(Class<?> type) {
- for (RedmineModelEnum e : values()) {
- if (e.getModelType().equals(type)) {
- return e;
- }
- }
- return null;
- }
-
- public static RedmineModelEnum safeValueOf(Class<?> type) {
- if (type == null) {
- throw new NullPointerException("klass parameter can not be null");
- }
-
- // check dataType is authorized
-
- RedmineModelEnum r = valueOf(type);
- if (r == null) {
- throw new IllegalArgumentException("the type " + type.getName() + " is not allowed!");
- }
-
- return r;
- }
-}
Deleted: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/RedmineModelScope.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/RedmineModelScope.java 2012-07-12 10:16:06 UTC (rev 260)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/model/RedmineModelScope.java 2012-07-12 10:18:02 UTC (rev 261)
@@ -1,56 +0,0 @@
-/*
- * #%L
- * JRedmine :: Client
- *
- * $Id$
- * $HeadURL$
- * %%
- * 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.model;
-
-/**
- * Une enumeration pour caracteriser le scope d'une donnée dans le modèle.
- * <p/>
- * <p/>
- * Pour une donnée qui ne dépend de rien, elle est en scope {@link #none}.
- * <p/>
- * Pour une donnée qui dépend d'un projet, elle est en scope {@link #project}.
- * <p/>
- * Pour une donnée qui dépend d'une version, elle est en scpoe {@link #version}.
- * <p/>
- * Pour une donnée qui dépend d'une issue, elle est en scpoe {@link #issue}.
- * <p/>
- * A savoir qu'une donnée de scope {@link #version} (resp. {@link #issue}),
- * elle est aussi de scope {@link #project} car la version (resp. l'issue)
- * dépend en dépend.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0.0
- */
-public enum RedmineModelScope {
-
- /** none scope, requires nothing. */
- none,
- /** project scope, requires a project. */
- project,
- /** version scope, requires a project and a version. */
- version,
- /** issue scope, requires a project and an issue. */
- issue
-}
1
0