Jredmine-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
July 2012
- 1 participants
- 62 discussions
Author: tchemit
Date: 2012-07-14 19:28:17 +0200 (Sat, 14 Jul 2012)
New Revision: 300
Url: http://nuiton.org/repositories/revision/jredmine/300
Log:
fix scm urls
Modified:
branches/jredmine-1.x/pom.xml
Modified: branches/jredmine-1.x/pom.xml
===================================================================
--- branches/jredmine-1.x/pom.xml 2012-07-14 17:27:07 UTC (rev 299)
+++ branches/jredmine-1.x/pom.xml 2012-07-14 17:28:17 UTC (rev 300)
@@ -46,11 +46,15 @@
<!-- Source control management. -->
<scm>
- <connection>scm:svn:http://svn.nuiton.org/svn/jredmine/tags/jredmine-1.3</connection>
+ <connection>
+ scm:svn:http://svn.nuiton.org/svn/jredmine/branches/jredmine-1.x
+ </connection>
<developerConnection>
- scm:svn:http://svn.nuiton.org/svn/jredmine/tags/jredmine-1.3
+ scm:svn:http://svn.nuiton.org/svn/jredmine/branches/jredmine-1.x
</developerConnection>
- <url>http://www.nuiton.org/repositories/browse/jredmine/tags/jredmine-1.3</url>
+ <url>
+ http://www.nuiton.org/repositories/browse/jredmine/branches/jredmine-1.x
+ </url>
</scm>
<distributionManagement>
1
0
Author: tchemit
Date: 2012-07-14 19:27:07 +0200 (Sat, 14 Jul 2012)
New Revision: 299
Url: http://nuiton.org/repositories/revision/jredmine/299
Log:
refs #937: Maven test utilise les properties de test de la distribution
Improve mojo design (to be continued soon...)
Improve tests configurations
Added:
branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojoWithProject.java
branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojoWithProjectAndVersion.java
branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/DryRunAware.java
branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/RedmineProjectAware.java
branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/RedmineVersionAware.java
branches/jredmine-1.x/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/RedmineFixtures.java
branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/test-config.properties
Modified:
branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojo.java
branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java
branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/GenerateChangesMojo.java
branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/NextVersionMojo.java
branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojo.java
branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishNewsMojo.java
branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/UpdateVersionMojo.java
branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/AbstractAnnouncementMojo.java
branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractIssuesReport.java
branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractRedmineReport.java
branches/jredmine-1.x/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/AbstractRedmineMojoTest.java
branches/jredmine-1.x/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/GenerateChangesMojoTest.java
branches/jredmine-1.x/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/NextVersionMojoTest.java
branches/jredmine-1.x/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojoTest.java
branches/jredmine-1.x/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/PublishNewsMojoTest.java
branches/jredmine-1.x/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/UpdateVersionMojoTest.java
branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateEmailAnnouncementMojoTest/generateEmailAnnouncement.xml
branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateEmailAnnouncementMojoTest/skipGenerateEmailAnnouncement.xml
branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateNewsAnnouncementMojoTest/generateNewsAnnouncement.xml
branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateNewsAnnouncementMojoTest/skipGenerateNewsAnnouncement.xml
branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayAll.xml
branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayIssuePriorities.xml
branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayIssueStatuses.xml
branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjectIssueCategories.xml
branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjectTrackers.xml
branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjectUsers.xml
branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjects.xml
branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayVersions.xml
branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/generateChangesMojoTest/generateChanges.xml
branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/nextVersionMojoTest/nextVersion.xml
branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/nextVersionMojoTest/skipNextVersion.xml
branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishAttachmentsMojoTest/publishAttachments.xml
branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishAttachmentsMojoTest/skipPublishAttachments.xml
branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishNewsMojoTest/publishNews.xml
branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishNewsMojoTest/skipPublishNews.xml
branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByAssigneeTest/issueReport.xml
branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByCategoryTest/issueReport.xml
branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByPriorityTest/issueReport.xml
branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByReporterTest/issueReport.xml
branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByStatusTest/issueReport.xml
branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByTrackerTest/issueReport.xml
branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByVersionTest/issueReport.xml
branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportTest/issueReport.xml
branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/updateVersionMojoTest/skipUpdateVersion.xml
branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/updateVersionMojoTest/updateVersion.xml
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojo.java
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojo.java 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojo.java 2012-07-14 17:27:07 UTC (rev 299)
@@ -30,12 +30,7 @@
import org.apache.maven.project.MavenProject;
import org.nuiton.io.rest.RestClientConfiguration;
import org.nuiton.jredmine.RedmineService;
-import org.nuiton.jredmine.RedmineServiceException;
import org.nuiton.jredmine.RedmineServiceImplementor;
-import org.nuiton.jredmine.model.ModelHelper;
-import org.nuiton.jredmine.model.Project;
-import org.nuiton.jredmine.model.User;
-import org.nuiton.jredmine.model.Version;
import org.nuiton.plugin.AbstractPlugin;
import java.net.URL;
@@ -107,24 +102,24 @@
*/
protected String encoding;
- /**
- * Redmine project name.
- *
- * @parameter expression="${redmine.projectId}" default-value="${project.artifactId}"
- * @required
- * @since 1.0.0
- */
- protected String projectId;
+// /**
+// * Redmine project name.
+// *
+// * @parameter expression="${redmine.projectId}" default-value="${project.artifactId}"
+// * @required
+// * @since 1.0.0
+// */
+// protected String projectId;
+//
+// /**
+// * redmine version name.
+// *
+// * @parameter expression="${redmine.versionId}" default-value="${project.version}"
+// * @since 1.0.0
+// */
+// protected String versionId;
/**
- * redmine version name.
- *
- * @parameter expression="${redmine.versionId}" default-value="${project.version}"
- * @since 1.0.0
- */
- protected String versionId;
-
- /**
* Un flag pour activer le mode verbeux.
*
* @parameter expression="${redmine.verbose}" default-value="${maven.verbose}"
@@ -154,27 +149,27 @@
*/
protected RedmineService service;
- /** flag to load in init a required project using the {@link #projectId} name */
- private final boolean requireProject;
+// /** flag to load in init a required project using the {@link #projectId} name */
+// private final boolean requireProject;
+//
+// /** flag to load in init a required version using the {@link #versionId} name. */
+// private final boolean requireVersion;
+//
+// /** flag to load in init a required user using the user loggued to redmine server. */
+// private final boolean requireUser;
- /** flag to load in init a required version using the {@link #versionId} name. */
- private final boolean requireVersion;
+// /** the project loaded in init if {@link #requireProject} flag is on */
+// protected Project releaseProject;
+//
+// /** the version loaded in init if {@link #requireVersion} flag is on */
+// protected Version releaseVersion;
+//
+// /** the user loaded in init if {@link #requireUser} flag is on */
+// protected User releaseUser;
+//
+// /** cache of users of a given project loaded in int if {@link #requireUser} flag is on */
+// protected User[] users;
- /** flag to load in init a required user using the user loggued to redmine server. */
- private final boolean requireUser;
-
- /** the project loaded in init if {@link #requireProject} flag is on */
- protected Project releaseProject;
-
- /** the version loaded in init if {@link #requireVersion} flag is on */
- protected Version releaseVersion;
-
- /** the user loaded in init if {@link #requireUser} flag is on */
- protected User releaseUser;
-
- /** cache of users of a given project loaded in int if {@link #requireUser} flag is on */
- protected User[] users;
-
/** the date format used to write a date */
protected DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
@@ -186,11 +181,13 @@
protected boolean initOk = true;
- public AbstractRedmineMojo(boolean requireProject, boolean requireVersion, boolean requireUser) {
- this.requireProject = requireProject;
- this.requireVersion = requireVersion;
- this.requireUser = requireUser;
- }
+// public AbstractRedmineMojo(boolean requireProject,
+// boolean requireVersion,
+// boolean requireUser) {
+// this.requireProject = requireProject;
+// this.requireVersion = requireVersion;
+// this.requireUser = requireUser;
+// }
///////////////////////////////////////////////////////////////////////////
/// AbstractPlugin
@@ -255,43 +252,43 @@
getLog().error("could not init Redmine service [" + getRestUrl() + "] with user '" + getRestUsername() + "'", e);
}
- // check project exists
-
- if (requireProject) {
- boolean r = initReleaseProject();
- if (!r) {
- if (isSafe()) {
- throw new MojoExecutionException("the project '" + projectId + "' could not be retrieve from redmine server.");
- }
- initOk = false;
- return;
- }
- }
-
- // check user exists
-
- if (requireUser) {
- boolean r = initReleaseUser();
- if (!r) {
- if (isSafe()) {
- throw new MojoExecutionException("the user '" + username + "' could not be retrieve from redmine server.");
- }
- initOk = false;
- return;
- }
- }
-
- // check version exists
-
- if (requireVersion) {
- boolean r = initReleaseVersion();
- if (!r) {
- if (isSafe()) {
- throw new MojoExecutionException("the version '" + versionId + "' could not be retrieve from redmine server.");
- }
- initOk = false;
- }
- }
+// // check project exists
+//
+// if (requireProject) {
+// boolean r = initReleaseProject();
+// if (!r) {
+// if (isSafe()) {
+// throw new MojoExecutionException("the project '" + projectId + "' could not be retrieve from redmine server.");
+// }
+// initOk = false;
+// return;
+// }
+// }
+//
+// // check user exists
+//
+// if (requireUser) {
+// boolean r = initReleaseUser();
+// if (!r) {
+// if (isSafe()) {
+// throw new MojoExecutionException("the user '" + username + "' could not be retrieve from redmine server.");
+// }
+// initOk = false;
+// return;
+// }
+// }
+//
+// // check version exists
+//
+// if (requireVersion) {
+// boolean r = initReleaseVersion();
+// if (!r) {
+// if (isSafe()) {
+// throw new MojoExecutionException("the version '" + versionId + "' could not be retrieve from redmine server.");
+// }
+// initOk = false;
+// }
+// }
}
@Override
@@ -310,22 +307,22 @@
getLog().error("could not init Redmine service [" + getRestUrl() + "] with user '" + getRestUsername() + "'");
return false;
}
+//
+// if (requireProject && releaseProject == null) {
+//
+// getLog().error("the project '" + projectId + "' could not be retrieve from redmine server, goal is skip");
+// return false;
+// }
+// if (requireUser && releaseUser == null) {
+// getLog().error("the user '" + username + "' could not be retrieve from redmine server, goal is skip");
+// return false;
+// }
+//
+// if (requireVersion && releaseVersion == null) {
+// getLog().error("the version '" + versionId + "' could not be retrieve from redmine server, goal is skip");
+// return false;
+// }
- if (requireProject && releaseProject == null) {
-
- getLog().error("the project '" + projectId + "' could not be retrieve from redmine server, goal is skip");
- return false;
- }
- if (requireUser && releaseUser == null) {
- getLog().error("the user '" + username + "' could not be retrieve from redmine server, goal is skip");
- return false;
- }
-
- if (requireVersion && releaseVersion == null) {
- getLog().error("the version '" + versionId + "' could not be retrieve from redmine server, goal is skip");
- return false;
- }
-
return true;
}
@@ -347,6 +344,7 @@
protected abstract boolean isRunOnce();
protected abstract boolean checkRunOnceDone();
+
///////////////////////////////////////////////////////////////////////////
/// Plugin
///////////////////////////////////////////////////////////////////////////
@@ -423,70 +421,70 @@
/// Others
///////////////////////////////////////////////////////////////////////////
- protected boolean initReleaseProject() throws MojoExecutionException {
+// protected boolean initReleaseProject() throws MojoExecutionException {
+//
+// if (projectId == null || projectId.trim().isEmpty()) {
+// throw new MojoExecutionException("required a projectId parameter");
+// }
+// try {
+// Project p = service.getProject(projectId);
+//
+// if (p == null) {
+//
+// return false;
+// }
+//
+// releaseProject = p;
+// return true;
+// } catch (RedmineServiceException e) {
+// getLog().warn("could not retreave project '" + projectId + "', for reason " + e.getMessage(), e);
+// return false;
+// }
+// }
+//
+// protected boolean initReleaseVersion() throws MojoExecutionException {
+//
+// if (versionId == null || versionId.trim().isEmpty()) {
+// throw new MojoExecutionException("required a versionId parameter");
+// }
+//
+// try {
+//
+// Version v = service.getVersion(projectId, versionId);
+//
+// if (v == null) {
+//
+// return false;
+// }
+//
+// releaseVersion = v;
+// return true;
+// } catch (RedmineServiceException e) {
+// getLog().warn("could not retreave version '" + versionId + "', for reason " + e.getMessage(), e);
+// return false;
+// }
+// }
+//
+// protected boolean initReleaseUser() {
+//
+// try {
+// users = service.getProjectMembers(projectId);
+//
+// User user = ModelHelper.byLogin(username, users);
+//
+// if (user == null) {
+//
+// return false;
+// }
+//
+// releaseUser = user;
+// return true;
+// } catch (RedmineServiceException e) {
+// getLog().warn("could not retreave user '" + username + "', for reason " + e.getMessage(), e);
+// return false;
+// }
+// }
- if (projectId == null || projectId.trim().isEmpty()) {
- throw new MojoExecutionException("required a projectId parameter");
- }
- try {
- Project p = service.getProject(projectId);
-
- if (p == null) {
-
- return false;
- }
-
- releaseProject = p;
- return true;
- } catch (RedmineServiceException e) {
- getLog().warn("could not retreave project '" + projectId + "', for reason " + e.getMessage(), e);
- return false;
- }
- }
-
- protected boolean initReleaseVersion() throws MojoExecutionException {
-
- if (versionId == null || versionId.trim().isEmpty()) {
- throw new MojoExecutionException("required a versionId parameter");
- }
-
- try {
-
- Version v = service.getVersion(projectId, versionId);
-
- if (v == null) {
-
- return false;
- }
-
- releaseVersion = v;
- return true;
- } catch (RedmineServiceException e) {
- getLog().warn("could not retreave version '" + versionId + "', for reason " + e.getMessage(), e);
- return false;
- }
- }
-
- protected boolean initReleaseUser() {
-
- try {
- users = service.getProjectMembers(projectId);
-
- User user = ModelHelper.byLogin(username, users);
-
- if (user == null) {
-
- return false;
- }
-
- releaseUser = user;
- return true;
- } catch (RedmineServiceException e) {
- getLog().warn("could not retreave user '" + username + "', for reason " + e.getMessage(), e);
- return false;
- }
- }
-
protected void closeService() {
if (service != null) {
RedmineServiceImplementor i;
@@ -517,11 +515,11 @@
this.safe = safe;
}
- public String getProjectId() {
- return projectId;
- }
-
- public String getVersionId() {
- return versionId;
- }
+// public String getProjectId() {
+// return projectId;
+// }
+//
+// public String getVersionId() {
+// return versionId;
+// }
}
Added: branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojoWithProject.java
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojoWithProject.java (rev 0)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojoWithProject.java 2012-07-14 17:27:07 UTC (rev 299)
@@ -0,0 +1,150 @@
+package org.nuiton.jredmine.plugin;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.codehaus.plexus.util.StringUtils;
+import org.nuiton.jredmine.RedmineServiceException;
+import org.nuiton.jredmine.model.ModelHelper;
+import org.nuiton.jredmine.model.Project;
+import org.nuiton.jredmine.model.User;
+
+/**
+ * Abstract redmine mojo whihc need a redmine project context.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public abstract class AbstractRedmineMojoWithProject extends AbstractRedmineMojo implements RedmineProjectAware {
+
+ /**
+ * Redmine project name.
+ *
+ * @parameter expression="${redmine.projectId}" default-value="${project.artifactId}"
+ * @required
+ * @since 1.0.0
+ */
+ protected String projectId;
+
+ /** the project loaded in init. */
+ protected Project releaseProject;
+
+ /** the user loaded in init if {@link #requireUser} flag is on */
+ protected User releaseUser;
+
+ /** cache of users of a given project loaded in int if {@link #requireUser} flag is on */
+ protected User[] users;
+
+ /** flag to load in init a required user using the user loggued to redmine server. */
+ private final boolean requireUser;
+
+ public AbstractRedmineMojoWithProject(boolean requireUser) {
+ this.requireUser = requireUser;
+ }
+
+ @Override
+ protected void init() throws Exception {
+
+ super.init();
+
+ if (initOk) {
+
+ // check project exists
+
+ boolean r = initReleaseProject();
+ if (!r) {
+ if (isSafe()) {
+ throw new MojoExecutionException("the project '" + projectId + "' could not be retrieve from redmine server.");
+ }
+ initOk = false;
+ }
+ }
+
+ if (initOk) {
+
+ // check user exists
+
+ if (requireUser) {
+ boolean r = initReleaseUser();
+ if (!r) {
+ if (isSafe()) {
+ throw new MojoExecutionException("the user '" + username + "' could not be retrieve from redmine server.");
+ }
+ initOk = false;
+ }
+ }
+ }
+ }
+
+ @Override
+ protected boolean checkSkip() {
+
+ boolean canContinue = super.checkSkip();
+
+ if (canContinue) {
+
+ if (releaseProject == null) {
+
+ getLog().error("the project '" + projectId + "' could not be retrieve from redmine server, goal is skip");
+ canContinue = false;
+ }
+ if (canContinue && requireUser && releaseUser == null) {
+ getLog().error("the user '" + username + "' could not be retrieve from redmine server, goal is skip");
+ canContinue = false;
+ }
+ }
+ return canContinue;
+ }
+
+
+ protected boolean initReleaseProject() throws MojoExecutionException {
+
+ if (StringUtils.isBlank(projectId)) {
+ throw new MojoExecutionException("required a projectId parameter");
+ }
+ try {
+ Project p = service.getProject(projectId);
+
+ if (p == null) {
+
+ return false;
+ }
+
+ releaseProject = p;
+ return true;
+ } catch (RedmineServiceException e) {
+ getLog().warn("could not retreave project '" + projectId + "', for reason " + e.getMessage(), e);
+ return false;
+ }
+ }
+
+ protected boolean initReleaseUser() throws MojoExecutionException {
+
+ if (StringUtils.isBlank(username)) {
+ throw new MojoExecutionException("required a username parameter");
+ }
+
+ try {
+ users = service.getProjectMembers(projectId);
+
+ User user = ModelHelper.byLogin(username, users);
+
+ if (user == null) {
+
+ return false;
+ }
+
+ releaseUser = user;
+ return true;
+ } catch (RedmineServiceException e) {
+ getLog().warn("could not retreave user '" + username + "', for reason " + e.getMessage(), e);
+ return false;
+ }
+ }
+
+ public final String getProjectId() {
+ return projectId;
+ }
+
+ public final void setProjectId(String projectId) {
+ this.projectId = projectId;
+ }
+}
Added: branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojoWithProjectAndVersion.java
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojoWithProjectAndVersion.java (rev 0)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojoWithProjectAndVersion.java 2012-07-14 17:27:07 UTC (rev 299)
@@ -0,0 +1,96 @@
+package org.nuiton.jredmine.plugin;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.nuiton.jredmine.RedmineServiceException;
+import org.nuiton.jredmine.model.Version;
+
+/**
+ * Abstract redmine mojo which needs a redmine project and version context.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public abstract class AbstractRedmineMojoWithProjectAndVersion extends AbstractRedmineMojoWithProject implements RedmineVersionAware {
+
+ /**
+ * redmine version name.
+ *
+ * @parameter expression="${redmine.versionId}" default-value="${project.version}"
+ * @since 1.0.0
+ */
+ protected String versionId;
+
+ /** the version loaded in init. */
+ protected Version releaseVersion;
+
+ public AbstractRedmineMojoWithProjectAndVersion(boolean requireUser) {
+ super(requireUser);
+ }
+
+ @Override
+ protected boolean checkSkip() {
+
+ boolean canContinue = super.checkSkip();
+
+ if (canContinue) {
+
+ if (releaseVersion == null) {
+ getLog().error("the version '" + versionId + "' could not be retrieve from redmine server, goal is skip");
+ canContinue = false;
+ }
+ }
+ return canContinue;
+ }
+
+ @Override
+ protected void init() throws Exception {
+
+ super.init();
+
+ if (initOk) {
+
+ // check project exists
+
+ boolean r = initReleaseVersion();
+ if (!r) {
+ if (isSafe()) {
+ throw new MojoExecutionException("the version '" + versionId + "' could not be retrieve from redmine server.");
+ }
+ initOk = false;
+ }
+ }
+ }
+
+ protected boolean initReleaseVersion() throws MojoExecutionException {
+
+ if (versionId == null || versionId.trim().isEmpty()) {
+ throw new MojoExecutionException("required a versionId parameter");
+ }
+
+ try {
+
+ Version v = service.getVersion(projectId, versionId);
+
+ if (v == null) {
+
+ return false;
+ }
+
+ releaseVersion = v;
+ return true;
+ } catch (RedmineServiceException e) {
+ getLog().warn("could not retreave version '" + versionId + "', for reason " + e.getMessage(), e);
+ return false;
+ }
+ }
+
+ @Override
+ public final String getVersionId() {
+ return versionId;
+ }
+
+ @Override
+ public final void setVersionId(String versionId) {
+ this.versionId = versionId;
+ }
+}
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java 2012-07-14 17:27:07 UTC (rev 299)
@@ -47,9 +47,26 @@
* @goal display-data
* @since 1.0.0
*/
-public class DisplayDataMojo extends AbstractRedmineMojo {
+public class DisplayDataMojo extends AbstractRedmineMojo implements RedmineProjectAware, RedmineVersionAware {
/**
+ * Redmine project name.
+ *
+ * @parameter expression="${redmine.projectId}" default-value="${project.artifactId}"
+ * @required
+ * @since 1.0.0
+ */
+ protected String projectId;
+
+ /**
+ * redmine version name.
+ *
+ * @parameter expression="${redmine.versionId}" default-value="${project.version}"
+ * @since 1.0.0
+ */
+ protected String versionId;
+
+ /**
* The data types to display : {@code issueSatus}, {@code issuePriority},
* {@code issueCategory}, {@code tracker} and {@code user}.
* <p/>
@@ -93,10 +110,6 @@
/** list of actions to perform */
protected List<RedmineModelEnum> actions;
- public DisplayDataMojo() {
- super(false, false, false);
- }
-
@Override
protected boolean checkRunOnceDone() {
return false;
@@ -148,6 +161,26 @@
}
@Override
+ public String getProjectId() {
+ return projectId;
+ }
+
+ @Override
+ public void setProjectId(String projectId) {
+ this.projectId = projectId;
+ }
+
+ @Override
+ public String getVersionId() {
+ return versionId;
+ }
+
+ @Override
+ public void setVersionId(String versionId) {
+ this.versionId = versionId;
+ }
+
+ @Override
protected boolean checkSkip() {
if (actions == null || actions.isEmpty()) {
// no data to treate
Added: branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/DryRunAware.java
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/DryRunAware.java (rev 0)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/DryRunAware.java 2012-07-14 17:27:07 UTC (rev 299)
@@ -0,0 +1,14 @@
+package org.nuiton.jredmine.plugin;
+
+/**
+ * TODO
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public interface DryRunAware {
+
+ boolean isDryRun();
+
+ void setDryRun(boolean dryRun);
+}
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/GenerateChangesMojo.java
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/GenerateChangesMojo.java 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/GenerateChangesMojo.java 2012-07-14 17:27:07 UTC (rev 299)
@@ -62,7 +62,7 @@
* @goal generate-changes
* @since 1.0.0
*/
-public class GenerateChangesMojo extends AbstractRedmineMojo implements IssueCollectorConfiguration {
+public class GenerateChangesMojo extends AbstractRedmineMojoWithProjectAndVersion implements IssueCollectorConfiguration {
/** The actions understood by the changes.xml format. */
enum Actions {
@@ -74,7 +74,7 @@
}
/**
- * 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/>
@@ -197,7 +197,7 @@
private Version[] versions;
public GenerateChangesMojo() {
- super(true, false, true);
+ super(true);
}
@Override
@@ -639,17 +639,17 @@
/// IssueCollectionConfiguration
///////////////////////////////////////////////////////////////////////////
- @Override
- public String getProjectId() {
- return projectId;
- }
+// @Override
+// public String getProjectId() {
+// return projectId;
+// }
+//
+// @Override
+// public String getVersionId() {
+// return versionId;
+// }
@Override
- public String getVersionId() {
- return versionId;
- }
-
- @Override
public boolean isOnlyCurrentVersion() {
return onlyCurrentVersion;
}
@@ -666,10 +666,10 @@
return null;
}
- @Override
- public void setVersionId(String versionId) {
- this.versionId = versionId;
- }
+// @Override
+// public void setVersionId(String versionId) {
+// this.versionId = versionId;
+// }
@Override
public String getCategoryIds() {
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/NextVersionMojo.java
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/NextVersionMojo.java 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/NextVersionMojo.java 2012-07-14 17:27:07 UTC (rev 299)
@@ -43,7 +43,7 @@
* @goal next-version
* @since 1.0.0
*/
-public class NextVersionMojo extends AbstractRedmineMojo {
+public class NextVersionMojo extends AbstractRedmineMojoWithProjectAndVersion implements DryRunAware {
/**
* Flag to know if anonymous connexion to redmine server is required.
@@ -117,7 +117,7 @@
private Date date;
public NextVersionMojo() {
- super(true, false, true);
+ super(true);
}
@Override
@@ -131,6 +131,16 @@
}
@Override
+ public boolean isDryRun() {
+ return dryRun;
+ }
+
+ @Override
+ public void setDryRun(boolean dryRun) {
+ this.dryRun = dryRun;
+ }
+
+ @Override
protected boolean isGoalSkip() {
return skipNextVersion;
}
@@ -219,6 +229,5 @@
service.nextVersion(projectId, usePreviousVersion ? previousVersionName : null, releaseVersion);
}
-
}
}
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojo.java
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojo.java 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojo.java 2012-07-14 17:27:07 UTC (rev 299)
@@ -44,9 +44,9 @@
* @goal publish-attachments
* @since 1.0.0
*/
-public class PublishAttachmentsMojo extends AbstractRedmineMojo {
+public class PublishAttachmentsMojo extends AbstractRedmineMojoWithProjectAndVersion implements DryRunAware {
/**
- * Flag to know if anonymùous connexion to redmine server is required.
+ * Flag to know if anonymous connexion to redmine server is required.
* <p/>
* <b>Note:</b> If set to {@code false}, you should fill {@link #username}
* and {@link #password} properties.
@@ -108,7 +108,7 @@
protected List<File> allFiles;
public PublishAttachmentsMojo() {
- super(true, true, true);
+ super(true);
}
@Override
@@ -137,6 +137,16 @@
}
@Override
+ public boolean isDryRun() {
+ return dryRun;
+ }
+
+ @Override
+ public void setDryRun(boolean dryRun) {
+ this.dryRun = dryRun;
+ }
+
+ @Override
protected void init() throws Exception {
versionId = PluginHelper.removeSnapshotSuffix(versionId);
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishNewsMojo.java
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishNewsMojo.java 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishNewsMojo.java 2012-07-14 17:27:07 UTC (rev 299)
@@ -37,9 +37,9 @@
* @goal publish-news
* @since 1.0.0
*/
-public class PublishNewsMojo extends AbstractRedmineMojo {
+public class PublishNewsMojo extends AbstractRedmineMojoWithProject implements DryRunAware{
/**
- * Flag to know if anonymùous connexion to redmine server is required.
+ * Flag to know if anonymous connexion to redmine server is required.
* <p/>
* <b>Note:</b> If set to {@code false}, you should fill {@link #username}
* and {@link #password} properties.
@@ -103,7 +103,7 @@
protected boolean runOnce;
public PublishNewsMojo() {
- super(true, false, true);
+ super(true);
}
@Override
@@ -132,6 +132,16 @@
}
@Override
+ public boolean isDryRun() {
+ return dryRun;
+ }
+
+ @Override
+ public void setDryRun(boolean dryRun) {
+ this.dryRun = dryRun;
+ }
+
+ @Override
protected void init() throws Exception {
runOnceDone = false;
Added: branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/RedmineProjectAware.java
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/RedmineProjectAware.java (rev 0)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/RedmineProjectAware.java 2012-07-14 17:27:07 UTC (rev 299)
@@ -0,0 +1,14 @@
+package org.nuiton.jredmine.plugin;
+
+/**
+ * TODO
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public interface RedmineProjectAware {
+
+ String getProjectId();
+
+ void setProjectId(String projectId);
+}
Added: branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/RedmineVersionAware.java
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/RedmineVersionAware.java (rev 0)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/RedmineVersionAware.java 2012-07-14 17:27:07 UTC (rev 299)
@@ -0,0 +1,14 @@
+package org.nuiton.jredmine.plugin;
+
+/**
+ * TODO
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public interface RedmineVersionAware {
+
+ String getVersionId();
+
+ void setVersionId(String versionId);
+}
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/UpdateVersionMojo.java
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/UpdateVersionMojo.java 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/UpdateVersionMojo.java 2012-07-14 17:27:07 UTC (rev 299)
@@ -44,9 +44,9 @@
* @goal update-version
* @since 1.0.0
*/
-public class UpdateVersionMojo extends AbstractRedmineMojo {
+public class UpdateVersionMojo extends AbstractRedmineMojoWithProjectAndVersion implements DryRunAware{
/**
- * Flag to know if anonymùous connexion to redmine server is required.
+ * Flag to know if anonymous connexion to redmine server is required.
* <p/>
* <b>Note:</b> If set to {@code false}, you should fill {@link #username}
* and {@link #password} properties.
@@ -136,7 +136,7 @@
private VersionStatusEnum newVersionStatus;
public UpdateVersionMojo() {
- super(true, false, true);
+ super(true);
}
@Override
@@ -150,6 +150,16 @@
}
@Override
+ public boolean isDryRun() {
+ return dryRun;
+ }
+
+ @Override
+ public void setDryRun(boolean dryRun) {
+ this.dryRun = dryRun;
+ }
+
+ @Override
protected boolean isGoalSkip() {
return skipUpdateVersion;
}
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/AbstractAnnouncementMojo.java
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/AbstractAnnouncementMojo.java 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/AbstractAnnouncementMojo.java 2012-07-14 17:27:07 UTC (rev 299)
@@ -32,7 +32,7 @@
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.velocity.VelocityComponent;
import org.nuiton.jredmine.model.Attachment;
-import org.nuiton.jredmine.plugin.AbstractRedmineMojo;
+import org.nuiton.jredmine.plugin.AbstractRedmineMojoWithProjectAndVersion;
import org.nuiton.plugin.PluginHelper;
import java.io.File;
@@ -44,10 +44,10 @@
* @author chemit
* @requiresOnline true
*/
-public abstract class AbstractAnnouncementMojo extends AbstractRedmineMojo implements AnnouncementGeneratorConfiguration {
+public abstract class AbstractAnnouncementMojo extends AbstractRedmineMojoWithProjectAndVersion 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/>
@@ -237,7 +237,7 @@
protected abstract String getAnnouncementTemplate();
protected AbstractAnnouncementMojo() {
- super(true, false, true);
+ super(true);
}
///////////////////////////////////////////////////////////////////////////
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractIssuesReport.java
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractIssuesReport.java 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractIssuesReport.java 2012-07-14 17:27:07 UTC (rev 299)
@@ -57,7 +57,6 @@
protected Issue[] issues;
protected AbstractIssuesReport(String group) {
- super(true, false, false);
this.group = group;
}
@@ -194,10 +193,10 @@
/// IssueCollectionConfiguration
///////////////////////////////////////////////////////////////////////////
- @Override
- public final String getProjectId() {
- return projectId;
- }
+// @Override
+// public final String getProjectId() {
+// return projectId;
+// }
@Override
public final String getVersionId() {
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractRedmineReport.java
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractRedmineReport.java 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractRedmineReport.java 2012-07-14 17:27:07 UTC (rev 299)
@@ -45,7 +45,8 @@
import org.apache.maven.reporting.MavenReport;
import org.apache.maven.reporting.MavenReportException;
import org.codehaus.plexus.i18n.I18N;
-import org.nuiton.jredmine.plugin.AbstractRedmineMojo;
+import org.nuiton.jredmine.plugin.AbstractRedmineMojoWithProject;
+import org.nuiton.jredmine.plugin.RedmineVersionAware;
import java.io.File;
import java.io.FileWriter;
@@ -63,10 +64,18 @@
* @requiresReports true
* @since 1.0.0
*/
-public abstract class AbstractRedmineReport extends AbstractRedmineMojo implements MavenReport {
+public abstract class AbstractRedmineReport extends AbstractRedmineMojoWithProject implements MavenReport, RedmineVersionAware {
/**
- * Flag to know if anonymùous connexion to redmine server is required.
+ * redmine version name.
+ *
+ * @parameter expression="${redmine.versionId}" default-value="${project.version}"
+ * @since 1.0.0
+ */
+ protected String versionId;
+
+ /**
+ * Flag to know if anonymous connexion to redmine server is required.
* <p/>
* For this goal, the default value is {@code true}
* <p/>
@@ -153,8 +162,8 @@
/** @return {@code true} if report should be skip */
protected abstract boolean skipReport();
- public AbstractRedmineReport(boolean requireProject, boolean requireVersion, boolean requireUser) {
- super(requireProject, requireVersion, requireUser);
+ public AbstractRedmineReport() {
+ super(false);
}
@Override
Added: branches/jredmine-1.x/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/RedmineFixtures.java
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/RedmineFixtures.java (rev 0)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/RedmineFixtures.java 2012-07-14 17:27:07 UTC (rev 299)
@@ -0,0 +1,799 @@
+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.lang3.StringUtils;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.io.rest.RestClientConfiguration;
+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;
+
+/**
+ * TODO
+ *
+ * @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 = "1925";
+
+ private Project JRedmineProject;
+
+ private ArrayListMultimap<Class<?>, Object> model;
+
+ private RestClientConfiguration anonymousConfiguration;
+
+ private RestClientConfiguration logguedConfiguration;
+
+ public String projectName() {
+ return "jredmine";
+ }
+
+ public String versionName() {
+ return "1.3";
+ }
+
+ public String versionId() {
+ return "295";
+ }
+
+ public String issueId() {
+ return "1925";
+ }
+
+ public RestClientConfiguration newAnonymousConfiguration()
+ throws IOException {
+ RestClientConfiguration conf = new FakeRedmineServiceConfiguration();
+ copyConfiguration(getAnonymousConfiguration(), conf);
+ return conf;
+ }
+
+ public RestClientConfiguration newLogguedConfiguration()
+ throws IOException {
+ RestClientConfiguration conf = new FakeRedmineServiceConfiguration();
+ copyConfiguration(getLogguedConfiguration(), conf);
+ return conf;
+ }
+
+ public RedmineAnonymousService newRedmineAnonymousService(RestClientConfiguration configuration)
+ throws IOException, RedmineServiceException {
+ DefaultRedmineAnonymousService service = new DefaultRedmineAnonymousService();
+ service.init(configuration);
+ return service;
+ }
+
+ public RedmineService newRedmineService(RestClientConfiguration configuration)
+ throws IOException, RedmineServiceException {
+ DefaultRedmineService service = new DefaultRedmineService();
+ service.init(configuration);
+ return service;
+ }
+
+ protected RestClientConfiguration getAnonymousConfiguration()
+ throws IOException {
+ if (anonymousConfiguration == null) {
+
+ Properties props = new Properties();
+
+ InputStream inputStream = null;
+ try {
+ String jredmineConfiguration = System.getenv("jredmine-test.properties");
+ if (jredmineConfiguration == null) {
+ if (log.isWarnEnabled()) {
+ log.warn("Could not find environement variable " +
+ "'jredmine-test.properties' will use " +
+ "default test configuration");
+ }
+
+ inputStream = getClass().getResourceAsStream("/test-config.properties");
+ } else {
+
+ File file = new File(jredmineConfiguration);
+
+ if (!file.exists()) {
+ throw new IllegalStateException("Could not find " + jredmineConfiguration +
+ " file");
+ }
+ inputStream = FileUtils.openInputStream(file);
+ }
+ props.load(inputStream);
+ } finally {
+ if (inputStream != null) {
+ inputStream.close();
+ }
+ }
+ anonymousConfiguration = new FakeRedmineServiceConfiguration();
+
+ String url = props.getProperty("test.redmineUrl");
+ anonymousConfiguration.setRestUrl(new URL(url));
+
+ String e = props.getProperty("test.encoding");
+ anonymousConfiguration.setEncoding(e);
+
+ String verbose = props.getProperty("test.verbose");
+ if (StringUtils.isNotEmpty(verbose)) {
+ anonymousConfiguration.setVerbose(Boolean.valueOf(verbose));
+ }
+ anonymousConfiguration.setEncoding(Charsets.UTF_8.name());
+ anonymousConfiguration.setAnonymous(true);
+
+ verbose = System.getenv("jredmine-test.verbose");
+ if (StringUtils.isNotEmpty(verbose)) {
+ anonymousConfiguration.setVerbose(Boolean.valueOf(verbose));
+ }
+
+ }
+ return anonymousConfiguration;
+ }
+
+ protected RestClientConfiguration getLogguedConfiguration()
+ throws IOException {
+ if (logguedConfiguration == null) {
+
+ // use anonymous configuration
+
+ RestClientConfiguration anoConf = getAnonymousConfiguration();
+ if (anoConf != null) {
+ logguedConfiguration = new FakeRedmineServiceConfiguration();
+ copyConfiguration(anoConf, logguedConfiguration);
+
+ // get system login password from env
+ String login = System.getenv("jredmine-test.login");
+ String password = System.getenv("jredmine-test.password");
+ if (!"null".equals(login)) {
+ logguedConfiguration.setRestUsername(login);
+ }
+ if (!"null".equals(password)) {
+ logguedConfiguration.setRestPassword(password);
+ }
+ logguedConfiguration.setAnonymous(false);
+ }
+ }
+ return logguedConfiguration;
+ }
+
+ public void copyConfiguration(RestClientConfiguration src,
+ RestClientConfiguration dst) {
+ dst.setRestUrl(src.getRestUrl());
+ dst.setRestUsername(src.getRestUsername());
+ dst.setRestPassword(src.getRestPassword());
+ dst.setEncoding(src.getEncoding());
+ dst.setVerbose(src.isVerbose());
+ dst.setAnonymous(src.isAnonymous());
+ }
+
+ public List<Attachment> getAttachments() {
+ return get(Attachment.class);
+ }
+
+ public List<Issue> getIssues() {
+ return get(Issue.class);
+ }
+
+ public List<Project> getProjects() {
+ return get(Project.class);
+ }
+
+ public List<Tracker> getTrackers() {
+ return get(Tracker.class);
+ }
+
+ public List<User> getUsers() {
+ return get(User.class);
+ }
+
+ public List<Version> getVersions() {
+ return get(Version.class);
+ }
+
+ public <T> List<T> get(Class<T> modelType) {
+ if (model == null) {
+ try {
+ loadModel();
+ } catch (Exception ex) {
+ throw new RuntimeException(ex);
+ }
+ }
+ return (List<T>) model.get(modelType);
+ }
+
+ public <T> T get(Class<T> type, int pos) {
+ List<T> ts = get(type);
+ return ts.get(pos);
+ }
+
+ public Project getJRedmineProject() {
+ if (JRedmineProject == null) {
+ JRedmineProject = new Project();
+ JRedmineProject.setName("jredmine");
+ JRedmineProject.setIdentifier("jredmine");
+ JRedmineProject.setIsPublic(true);
+ JRedmineProject.setHomepage("http://maven-site.nuiton.org/jredmine");
+ JRedmineProject.setDescription(
+ "Permet de communiquer en java avec un serveur " + "redmine qui a installé le plugin rails jredmine");
+ JRedmineProject.setId(36);
+ JRedmineProject.setStatus(1);
+ }
+ return JRedmineProject;
+ }
+
+
+ public static final String VERSION_TO_CREATE_NAME = "do_not_use_me";
+
+ public Version getVersion() {
+ Version version = new Version();
+ version.setName(VERSION_TO_CREATE_NAME);
+ version.setDescription("Une version créée par les tests de jredmine," +
+ " ne pas utiliser,et modifiée");
+ return version;
+ }
+
+ private void loadModel()
+ throws Exception {
+ model = ArrayListMultimap.create();
+
+ Attachment tempA;
+ tempA = new Attachment();
+ tempA.setAuthorId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempA.setContainerId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempA.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempA.setFilesize((Integer) RedmineDataConverter.Integer.convert("411"));
+ tempA.setDownloads((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempA.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T12:56:41+02:00"));
+ tempA.setContainerType((String) RedmineDataConverter.Text.convert("Version"));
+ tempA.setContentType((String) RedmineDataConverter.Text.convert("application/json"));
+ tempA.setDigest((String) RedmineDataConverter.Text.convert("6ea84342c7475c05fb077b4aca832f9a"));
+ tempA.setDiskFilename((String) RedmineDataConverter.Text.convert("090905125641_get_issue.json"));
+ tempA.setFilename((String) RedmineDataConverter.Text.convert("get_issue.json"));
+ model.put(Attachment.class, tempA);
+ tempA = new Attachment();
+ tempA.setAuthorId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempA.setContainerId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempA.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempA.setFilesize((Integer) RedmineDataConverter.Integer.convert("411"));
+ tempA.setDownloads((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempA.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T12:56:41+02:00"));
+ tempA.setContainerType((String) RedmineDataConverter.Text.convert("Version"));
+ tempA.setContentType((String) RedmineDataConverter.Text.convert("application/json"));
+ tempA.setDigest((String) RedmineDataConverter.Text.convert("6ea84342c7475c05fb077b4aca832f9a"));
+ tempA.setDiskFilename((String) RedmineDataConverter.Text.convert("090905125641_get_issue.json2"));
+ tempA.setFilename((String) RedmineDataConverter.Text.convert("get_issue.json2"));
+ model.put(Attachment.class, tempA);
+
+ Issue tempI;
+ tempI = new Issue();
+ tempI.setAuthorId((Integer) RedmineDataConverter.Integer.convert("5"));
+ tempI.setCategoryId((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempI.setDoneRatio((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempI.setLockVersion((Integer) RedmineDataConverter.Integer.convert("7"));
+ tempI.setPriorityId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempI.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setStatusId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempI.setTrackerId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setFixedVersionId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempI.setParentId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempI.setRootId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempI.setLft((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setRgt((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempI.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T20:11:52+02:00"));
+ tempI.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T00:37:40+02:00"));
+ tempI.setStartDate((Date) RedmineDataConverter.Date.convert("2009-09-04"));
+ tempI.setDescription((String) RedmineDataConverter.Text.convert("avec une description !"));
+ tempI.setSubject((String) RedmineDataConverter.Text.convert("yes!"));
+ model.put(Issue.class, tempI);
+ tempI = new Issue();
+ tempI.setAuthorId((Integer) RedmineDataConverter.Integer.convert("5"));
+ tempI.setCategoryId((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempI.setDoneRatio((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempI.setLockVersion((Integer) RedmineDataConverter.Integer.convert("7"));
+ tempI.setPriorityId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempI.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setStatusId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempI.setTrackerId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setFixedVersionId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempI.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T20:11:52+02:00"));
+ tempI.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T00:37:40+02:00"));
+ tempI.setStartDate((Date) RedmineDataConverter.Date.convert("2009-09-04"));
+ tempI.setDescription((String) RedmineDataConverter.Text.convert("avec une description !2"));
+ tempI.setSubject((String) RedmineDataConverter.Text.convert("yes!2"));
+ model.put(Issue.class, tempI);
+
+ Project tempP;
+ tempP = new Project();
+ tempP.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:11:54+02:00"));
+ tempP.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:11:54+02:00"));
+ tempP.setIdentifier((String) RedmineDataConverter.Text.convert("one"));
+ tempP.setName((String) RedmineDataConverter.Text.convert("one"));
+ tempP.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempP.setLft((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempP.setRgt((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempP.setProjectsCount((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempP.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempP.setIsPublic((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ model.put(Project.class, tempP);
+ tempP = new Project();
+ tempP.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T16:22:14+02:00"));
+ tempP.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T16:22:29+02:00"));
+ tempP.setIdentifier((String) RedmineDataConverter.Text.convert("two"));
+ tempP.setName((String) RedmineDataConverter.Text.convert("two"));
+ tempP.setId((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempP.setProjectsCount((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempP.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempP.setIsPublic((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ model.put(Project.class, tempP);
+
+ Tracker tempT;
+ tempT = new Tracker();
+ tempT.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setTrackerId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setPosition((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setIsInChlog((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempT.setIsInRoadmap((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempT.setName((String) RedmineDataConverter.Text.convert("Anomalie"));
+ model.put(Tracker.class, tempT);
+ tempT = new Tracker();
+ tempT.setId((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempT.setIsInChlog((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempT.setIsInRoadmap((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempT.setName((String) RedmineDataConverter.Text.convert("Evolution"));
+ tempT.setPosition((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempT.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setTrackerId((Integer) RedmineDataConverter.Integer.convert("2"));
+ model.put(Tracker.class, tempT);
+ tempT = new Tracker();
+ tempT.setId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempT.setIsInChlog((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempT.setIsInRoadmap((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempT.setName((String) RedmineDataConverter.Text.convert("Assistance"));
+ tempT.setPosition((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempT.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setTrackerId((Integer) RedmineDataConverter.Integer.convert("3"));
+ model.put(Tracker.class, tempT);
+
+ User tempU;
+ tempU = new User();
+ tempU.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T17:24:46+02:00"));
+ tempU.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T01:23:59+02:00"));
+ tempU.setLastLoginOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T01:23:59+02:00"));
+ tempU.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempU.setMemberId((Integer) RedmineDataConverter.Integer.convert("5"));
+ tempU.setRoleId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempU.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempU.setAdmin((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempU.setMailNotification((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempU.setFirstname((String) RedmineDataConverter.Text.convert("Redmine"));
+ tempU.setHashedPassword(
+ (String) RedmineDataConverter.Text.convert("70c881d4a26984ddce795f6f71817c9cf4480e79"));
+ tempU.setLanguage((String) RedmineDataConverter.Text.convert("fr"));
+ tempU.setLastname((String) RedmineDataConverter.Text.convert("Admin"));
+ tempU.setLogin((String) RedmineDataConverter.Text.convert("admin"));
+ tempU.setMail((String) RedmineDataConverter.Text.convert("dummy(a)codelutin.com"));
+ tempU.setIdentityUrl((String) RedmineDataConverter.Text.convert("yo"));
+ model.put(User.class, tempU);
+ tempU = new User();
+ tempU.setAdmin((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempU.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T19:49:02+02:00"));
+ tempU.setFirstname((String) RedmineDataConverter.Text.convert("tony"));
+ tempU.setHashedPassword(
+ (String) RedmineDataConverter.Text.convert("8aed1322e5450badb078e1fb60a817a1df25a2ca"));
+ tempU.setId((Integer) RedmineDataConverter.Integer.convert("5"));
+ tempU.setLanguage((String) RedmineDataConverter.Text.convert("fr"));
+ tempU.setLastLoginOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T19:49:38+02:00"));
+ tempU.setLastname((String) RedmineDataConverter.Text.convert("chemit2"));
+ tempU.setLogin((String) RedmineDataConverter.Text.convert("tchemit2"));
+ tempU.setMail((String) RedmineDataConverter.Text.convert("chemit(a)codelutin.com"));
+ tempU.setMailNotification((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempU.setMemberId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempU.setRoleId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempU.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempU.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T19:49:38+02:00"));
+ model.put(User.class, tempU);
+ tempU = new User();
+ tempU.setAdmin((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempU.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T16:24:11+02:00"));
+ tempU.setFirstname((String) RedmineDataConverter.Text.convert("dev"));
+ tempU.setHashedPassword(
+ (String) RedmineDataConverter.Text.convert("70c881d4a26984ddce795f6f71817c9cf4480e79"));
+ tempU.setId((Integer) RedmineDataConverter.Integer.convert("7"));
+ tempU.setLanguage((String) RedmineDataConverter.Text.convert("fr"));
+ tempU.setLastLoginOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T16:34:39+02:00"));
+ tempU.setLastname((String) RedmineDataConverter.Text.convert("dev"));
+ tempU.setLogin((String) RedmineDataConverter.Text.convert("dev"));
+ tempU.setMail((String) RedmineDataConverter.Text.convert("dev3(a)ynot-home.info"));
+ tempU.setMailNotification((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempU.setMemberId((Integer) RedmineDataConverter.Integer.convert("9"));
+ tempU.setRoleId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempU.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempU.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T16:34:39+02:00"));
+ model.put(User.class, tempU);
+
+ Version tempV;
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:47:39+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("yo"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("9"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("yor"));
+ tempV.setSharing((String) RedmineDataConverter.Text.convert("none"));
+ tempV.setStatus((String) RedmineDataConverter.Text.convert("open"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:50:49+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:09+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("13"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("rrrrrrrrrouuuuuua"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:09+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:07:58+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("15"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("aaaauuuuuua"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:07:58+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T04:12:25+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoyeppppppppppppppppp"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("16"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("aaaau"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T04:13:20+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:40+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("14"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("aaaaaaaaaarrrrrrrrrouuuuuua"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:40+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T00:39:15+02:00"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("5"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("2"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T00:39:15+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:13:05+02:00"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("1.0.0"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:13:05+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:12+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("yoye"));
+ tempV.setEffectiveDate((Date) RedmineDataConverter.Date.convert("2009-09-06"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("11"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("yaouuuuuua"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:12+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:50:59+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("yoye"));
+ tempV.setEffectiveDate((Date) RedmineDataConverter.Date.convert("2009-09-06"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("10"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("ya"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:54:16+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:37+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
+ tempV.setEffectiveDate((Date) RedmineDataConverter.Date.convert("2009-09-06"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("12"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("ouuuuuua"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:42+02:00"));
+ model.put(Version.class, tempV);
+
+ IssueStatus tempIS;
+ tempIS = new IssueStatus();
+ tempIS.setId(1);
+ tempIS.setName("Nouveau");
+ tempIS.setPosition(1);
+ tempIS.setDefaultDoneRatio(10);
+ tempIS.setIsClosed(false);
+ tempIS.setIsDefault(true);
+ model.put(IssueStatus.class, tempIS);
+ tempIS = new IssueStatus();
+ tempIS.setId(2);
+ tempIS.setName("Assigné");
+ tempIS.setPosition(2);
+ tempIS.setIsClosed(false);
+ tempIS.setIsDefault(false);
+ model.put(IssueStatus.class, tempIS);
+ tempIS = new IssueStatus();
+ tempIS.setId(3);
+ tempIS.setName("Résolu");
+ tempIS.setPosition(3);
+ tempIS.setIsClosed(false);
+ tempIS.setIsDefault(false);
+ model.put(IssueStatus.class, tempIS);
+ tempIS = new IssueStatus();
+ tempIS.setId(4);
+ tempIS.setName("Commentaire");
+ tempIS.setPosition(4);
+ tempIS.setIsClosed(false);
+ tempIS.setIsDefault(false);
+ model.put(IssueStatus.class, tempIS);
+ tempIS = new IssueStatus();
+ tempIS.setId(5);
+ tempIS.setName("Fermé");
+ tempIS.setPosition(5);
+ tempIS.setIsClosed(true);
+ tempIS.setIsDefault(false);
+ model.put(IssueStatus.class, tempIS);
+ tempIS = new IssueStatus();
+ tempIS.setId(6);
+ tempIS.setPosition(6);
+ tempIS.setName("Rejeté");
+ tempIS.setIsClosed(true);
+ tempIS.setIsDefault(false);
+ model.put(IssueStatus.class, tempIS);
+
+ IssuePriority tempIP;
+ tempIP = new IssuePriority();
+ tempIP.setId(3);
+ tempIP.setParentId(1);
+ tempIP.setProjectId(2);
+ tempIP.setName("Bas");
+ tempIP.setPosition(1);
+ tempIP.setOpt("IPRI");
+ tempIP.setIsDefault(false);
+ tempIP.setActive(true);
+ model.put(IssuePriority.class, tempIP);
+ tempIP = new IssuePriority();
+ tempIP.setId(4);
+ tempIP.setName("Normal");
+ tempIP.setPosition(2);
+ tempIP.setOpt("IPRI");
+ tempIP.setIsDefault(true);
+ model.put(IssuePriority.class, tempIP);
+ tempIP = new IssuePriority();
+ tempIP.setId(5);
+ tempIP.setName("Haut");
+ tempIP.setPosition(3);
+ tempIP.setOpt("IPRI");
+ tempIP.setIsDefault(false);
+ model.put(IssuePriority.class, tempIP);
+ tempIP = new IssuePriority();
+ tempIP.setId(6);
+ tempIP.setName("Urgent");
+ tempIP.setPosition(4);
+ tempIP.setOpt("IPRI");
+ tempIP.setIsDefault(false);
+ model.put(IssuePriority.class, tempIP);
+ tempIP = new IssuePriority();
+ tempIP.setId(7);
+ tempIP.setName("Immédiat");
+ tempIP.setPosition(5);
+ tempIP.setOpt("IPRI");
+ tempIP.setIsDefault(false);
+ model.put(IssuePriority.class, tempIP);
+
+ IssueCategory tempIC;
+ tempIC = new IssueCategory();
+ tempIC.setId(1);
+ tempIC.setName("categorie one");
+ tempIC.setProjectId(1);
+ model.put(IssueCategory.class, tempIC);
+ tempIC = new IssueCategory();
+ tempIC.setId(2);
+ tempIC.setName("categorie two");
+ tempIC.setProjectId(1);
+ model.put(IssueCategory.class, tempIC);
+
+ News tempN;
+ tempN = new News();
+ tempN.setId(85);
+ tempN.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-17T21:50:26+02:00"));
+ tempN.setProjectId(1);
+ tempN.setAuthorId(4);
+ tempN.setCommentsCount(0);
+ tempN.setDescription("description");
+ tempN.setSummary("summary");
+ tempN.setTitle("title");
+ model.put(News.class, tempN);
+ tempN = new News();
+ tempN.setId(86);
+ tempN.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-17T21:55:26+02:00"));
+ tempN.setProjectId(1);
+ tempN.setAuthorId(4);
+ tempN.setCommentsCount(0);
+ tempN.setDescription("description2");
+ tempN.setSummary("summary2");
+ tempN.setTitle("title2");
+ model.put(News.class, tempN);
+
+ TimeEntry tempE;
+
+ tempE = new TimeEntry();
+ tempE.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:02:02+01:00"));
+ tempE.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:02:02+01:00"));
+ tempE.setSpentOn((Date) RedmineDataConverter.Date.convert("2009-12-31"));
+ tempE.setId(1);
+ tempE.setProjectId(1);
+ tempE.setUserId(4);
+ tempE.setIssueId(6);
+ tempE.setActivityId(8);
+
+ tempE.setHours(1);
+ tempE.setTmonth(12);
+ tempE.setTyear(2009);
+ tempE.setTweek(53);
+ tempE.setComments("Test");
+ model.put(TimeEntry.class, tempE);
+
+ tempE = new TimeEntry();
+ tempE.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:10:01+01:00"));
+ tempE.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:10:01+01:00"));
+ tempE.setSpentOn((Date) RedmineDataConverter.Date.convert("2009-12-31"));
+ tempE.setId(2);
+ tempE.setProjectId(1);
+ tempE.setUserId(4);
+ tempE.setIssueId(6);
+ tempE.setActivityId(9);
+
+ tempE.setHours(2);
+ tempE.setTmonth(12);
+ tempE.setTyear(2009);
+ tempE.setTweek(53);
+ tempE.setComments("deuxième temps");
+ model.put(TimeEntry.class, tempE);
+ }
+
+
+ public Attachment getAttachment() {
+ Attachment result = new Attachment();
+ File fileToUpload = null;
+ try {
+ fileToUpload = File.createTempFile("toupload", ".txt");
+ FileUtils.write(fileToUpload, FILE_TO_UPLOAD_CONTENT);
+ result.setToUpload(fileToUpload);
+ result.setDescription("attachment description...");
+ return result;
+ } catch (IOException e) {
+ throw new RuntimeException("Could not create temp file", e);
+ }
+
+ }
+
+ /**
+ * Configuration of a redmine service for test purposes.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+ public static class FakeRedmineServiceConfiguration implements RestClientConfiguration {
+
+ 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: branches/jredmine-1.x/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/AbstractRedmineMojoTest.java
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/AbstractRedmineMojoTest.java 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/AbstractRedmineMojoTest.java 2012-07-14 17:27:07 UTC (rev 299)
@@ -24,55 +24,87 @@
*/
package org.nuiton.jredmine.plugin;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.maven.model.IssueManagement;
+import org.codehaus.plexus.util.StringUtils;
import org.junit.After;
import org.junit.Assert;
import org.junit.BeforeClass;
-import org.nuiton.jredmine.TestHelper;
+import org.nuiton.io.rest.RestClientConfiguration;
+import org.nuiton.jredmine.RedmineFixtures;
import org.nuiton.plugin.AbstractMojoTest;
import java.io.File;
import java.io.IOException;
/**
+ * @param <P> type of mojo to test
* @author chemit
- * @param <P> type of mojo to test
* @since 1.0.0
*/
public abstract class AbstractRedmineMojoTest<P extends AbstractRedmineMojo> extends AbstractMojoTest<P> {
- /**
- * Logger
- */
- private static final Log log = LogFactory.getLog(AbstractRedmineMojoTest.class);
-
@BeforeClass
public static void atTheBegining() throws IOException {
- // load default configuration
- TestHelper.initDefaultConfiguration();
- // load basedir
- TestHelper.getBasedir();
+ fixtures = new RedmineFixtures();
}
protected boolean canContinue;
+ protected static RedmineFixtures fixtures;
+
+ protected RestClientConfiguration getConfiguration() throws IOException {
+ // by default use a anonymous configuration
+ RestClientConfiguration conf = fixtures.newAnonymousConfiguration();
+ return conf;
+ }
+
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");
+ i.setUrl(mojo.getRestUrl().toString());
mojo.getProject().setIssueManagement(i);
+
+ if (mojo instanceof RedmineProjectAware) {
+
+ // fill projectId if none is given from pom.xml
+ RedmineProjectAware redmineMojoWithProject = (RedmineProjectAware) mojo;
+
+ String projectId = redmineMojoWithProject.getProjectId();
+ if (StringUtils.isBlank(projectId)) {
+
+ redmineMojoWithProject.setProjectId(fixtures.projectName());
+ }
+ }
+
+ if (mojo instanceof RedmineVersionAware) {
+
+ // fill versionId if none is given from pom.xml
+ RedmineVersionAware redmineMojoWithProjectAndVersion = (RedmineVersionAware) mojo;
+
+ String versionId = redmineMojoWithProjectAndVersion.getVersionId();
+ if (StringUtils.isBlank(versionId)) {
+
+ redmineMojoWithProjectAndVersion.setVersionId(fixtures.versionName());
+ }
+ }
+
+ if (mojo instanceof DryRunAware) {
+
+ // never authorize to modify any content...
+ ((DryRunAware) mojo).setDryRun(true);
+ }
}
@Override
protected void setUpMojo(P mojo, File pomFile) throws Exception {
super.setUpMojo(mojo, pomFile);
+ RestClientConfiguration configuration = getConfiguration();
+
// copy redmine test server configuration
- TestHelper.copyConfiguration(TestHelper.getTestConfiguration(), mojo);
+ fixtures.copyConfiguration(configuration, mojo);
beforeMojoInit(mojo, pomFile);
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/GenerateChangesMojoTest.java
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/GenerateChangesMojoTest.java 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/GenerateChangesMojoTest.java 2012-07-14 17:27:07 UTC (rev 299)
@@ -25,7 +25,10 @@
package org.nuiton.jredmine.plugin;
import org.junit.Test;
+import org.nuiton.io.rest.RestClientConfiguration;
+import java.io.IOException;
+
/**
* @author tchemit
* @since 1.0.0
@@ -37,6 +40,12 @@
return "generate-changes";
}
+ @Override
+ protected RestClientConfiguration getConfiguration() throws IOException {
+ RestClientConfiguration conf = fixtures.newLogguedConfiguration();
+ return conf;
+ }
+
@Test
public void generateChanges() throws Exception {
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/NextVersionMojoTest.java
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/NextVersionMojoTest.java 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/NextVersionMojoTest.java 2012-07-14 17:27:07 UTC (rev 299)
@@ -25,7 +25,10 @@
package org.nuiton.jredmine.plugin;
import org.junit.Test;
+import org.nuiton.io.rest.RestClientConfiguration;
+import java.io.IOException;
+
/**
* @author tchemit
* @since 1.0.0
@@ -37,6 +40,12 @@
return "next-version";
}
+ @Override
+ protected RestClientConfiguration getConfiguration() throws IOException {
+ RestClientConfiguration conf = fixtures.newLogguedConfiguration();
+ return conf;
+ }
+
@Test
public void nextVersion() throws Exception {
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojoTest.java
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojoTest.java 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojoTest.java 2012-07-14 17:27:07 UTC (rev 299)
@@ -25,7 +25,10 @@
package org.nuiton.jredmine.plugin;
import org.junit.Test;
+import org.nuiton.io.rest.RestClientConfiguration;
+import java.io.IOException;
+
/**
* @author tchemit
* @since 1.0.0
@@ -37,6 +40,13 @@
return "publish-attachments";
}
+
+ @Override
+ protected RestClientConfiguration getConfiguration() throws IOException {
+ RestClientConfiguration conf = fixtures.newLogguedConfiguration();
+ return conf;
+ }
+
@Test
public void publishAttachments() throws Exception {
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/PublishNewsMojoTest.java
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/PublishNewsMojoTest.java 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/PublishNewsMojoTest.java 2012-07-14 17:27:07 UTC (rev 299)
@@ -25,7 +25,10 @@
package org.nuiton.jredmine.plugin;
import org.junit.Test;
+import org.nuiton.io.rest.RestClientConfiguration;
+import java.io.IOException;
+
/**
* @author tchemit
* @since 1.0.0
@@ -37,6 +40,13 @@
return "publish-news";
}
+
+ @Override
+ protected RestClientConfiguration getConfiguration() throws IOException {
+ RestClientConfiguration conf = fixtures.newLogguedConfiguration();
+ return conf;
+ }
+
@Test
public void publishNews() throws Exception {
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/UpdateVersionMojoTest.java
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/UpdateVersionMojoTest.java 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/java/org/nuiton/jredmine/plugin/UpdateVersionMojoTest.java 2012-07-14 17:27:07 UTC (rev 299)
@@ -25,7 +25,10 @@
package org.nuiton.jredmine.plugin;
import org.junit.Test;
+import org.nuiton.io.rest.RestClientConfiguration;
+import java.io.IOException;
+
/**
* @author tchemit
* @since 1.0.0
@@ -37,6 +40,12 @@
return "update-version";
}
+ @Override
+ protected RestClientConfiguration getConfiguration() throws IOException {
+ RestClientConfiguration conf = fixtures.newLogguedConfiguration();
+ return conf;
+ }
+
@Test
public void updateVersion() throws Exception {
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateEmailAnnouncementMojoTest/generateEmailAnnouncement.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateEmailAnnouncementMojoTest/generateEmailAnnouncement.xml 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateEmailAnnouncementMojoTest/generateEmailAnnouncement.xml 2012-07-14 17:27:07 UTC (rev 299)
@@ -28,46 +28,47 @@
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>
+ <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/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>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate-email-announcement</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateEmailAnnouncementMojoTest/skipGenerateEmailAnnouncement.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateEmailAnnouncementMojoTest/skipGenerateEmailAnnouncement.xml 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateEmailAnnouncementMojoTest/skipGenerateEmailAnnouncement.xml 2012-07-14 17:27:07 UTC (rev 299)
@@ -28,45 +28,47 @@
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>
+ <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>
+ <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>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate-email-announcement</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateNewsAnnouncementMojoTest/generateNewsAnnouncement.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateNewsAnnouncementMojoTest/generateNewsAnnouncement.xml 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateNewsAnnouncementMojoTest/generateNewsAnnouncement.xml 2012-07-14 17:27:07 UTC (rev 299)
@@ -28,45 +28,47 @@
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>
+ <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/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>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate-news-announcement</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateNewsAnnouncementMojoTest/skipGenerateNewsAnnouncement.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateNewsAnnouncementMojoTest/skipGenerateNewsAnnouncement.xml 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/generateNewsAnnouncementMojoTest/skipGenerateNewsAnnouncement.xml 2012-07-14 17:27:07 UTC (rev 299)
@@ -28,45 +28,47 @@
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>
+ <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>
+ <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>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate-news-announcement</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayAll.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayAll.xml 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayAll.xml 2012-07-14 17:27:07 UTC (rev 299)
@@ -27,33 +27,31 @@
<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.maven-redmine-plugin</groupId>
+ <artifactId>test-generate-changes</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <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,version,tracker,user,issueStatus,issueCategory,issuePriority,tracker</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,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: branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayIssuePriorities.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayIssuePriorities.xml 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayIssuePriorities.xml 2012-07-14 17:27:07 UTC (rev 299)
@@ -27,31 +27,29 @@
<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.maven-redmine-plugin</groupId>
+ <artifactId>test-generate-changes</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <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>
+ <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: branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayIssueStatuses.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayIssueStatuses.xml 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayIssueStatuses.xml 2012-07-14 17:27:07 UTC (rev 299)
@@ -27,31 +27,29 @@
<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.maven-redmine-plugin</groupId>
+ <artifactId>test-generate-changes</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <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>
+ <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: branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjectIssueCategories.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjectIssueCategories.xml 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjectIssueCategories.xml 2012-07-14 17:27:07 UTC (rev 299)
@@ -27,32 +27,29 @@
<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.maven-redmine-plugin</groupId>
+ <artifactId>test-generate-changes</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <build>
+ <build>
- <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>
+ <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: branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjectTrackers.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjectTrackers.xml 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjectTrackers.xml 2012-07-14 17:27:07 UTC (rev 299)
@@ -27,32 +27,29 @@
<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.maven-redmine-plugin</groupId>
+ <artifactId>test-generate-changes</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <build>
+ <build>
- <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>
+ <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: branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjectUsers.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjectUsers.xml 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjectUsers.xml 2012-07-14 17:27:07 UTC (rev 299)
@@ -27,32 +27,29 @@
<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.maven-redmine-plugin</groupId>
+ <artifactId>test-generate-changes</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <build>
+ <build>
- <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>
+ <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: branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjects.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjects.xml 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjects.xml 2012-07-14 17:27:07 UTC (rev 299)
@@ -28,32 +28,28 @@
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>
+ <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: branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayVersions.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayVersions.xml 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayVersions.xml 2012-07-14 17:27:07 UTC (rev 299)
@@ -28,32 +28,28 @@
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>
+ <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: branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/generateChangesMojoTest/generateChanges.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/generateChangesMojoTest/generateChanges.xml 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/generateChangesMojoTest/generateChanges.xml 2012-07-14 17:27:07 UTC (rev 299)
@@ -28,37 +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.maven-redmine-plugin</groupId>
+ <artifactId>test-generate-changes</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
- <name>generate-changes</name>
+ <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,4,5</statusIds>
+ <categoryIds>41</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: branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/nextVersionMojoTest/nextVersion.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/nextVersionMojoTest/nextVersion.xml 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/nextVersionMojoTest/nextVersion.xml 2012-07-14 17:27:07 UTC (rev 299)
@@ -28,35 +28,30 @@
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>
+ <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>
+ <versionDescription>The next version description</versionDescription>
+ <previousVersionName>1.2</previousVersionName>
+ <skipNextVersion>false</skipNextVersion>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>next-version</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/nextVersionMojoTest/skipNextVersion.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/nextVersionMojoTest/skipNextVersion.xml 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/nextVersionMojoTest/skipNextVersion.xml 2012-07-14 17:27:07 UTC (rev 299)
@@ -28,35 +28,30 @@
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>
+ <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>
+ <versionDescription>The next version description</versionDescription>
+ <previousVersionName>1.2</previousVersionName>
+ <skipNextVersion>true</skipNextVersion>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>next-version</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishAttachmentsMojoTest/publishAttachments.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishAttachmentsMojoTest/publishAttachments.xml 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishAttachmentsMojoTest/publishAttachments.xml 2012-07-14 17:27:07 UTC (rev 299)
@@ -28,36 +28,31 @@
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>
+ <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>
+ <files>
+ <file>${basedir}/pom.xml</file>
+ </files>
+ <skipPublishAttachments>false</skipPublishAttachments>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>publish-attachments</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishAttachmentsMojoTest/skipPublishAttachments.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishAttachmentsMojoTest/skipPublishAttachments.xml 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishAttachmentsMojoTest/skipPublishAttachments.xml 2012-07-14 17:27:07 UTC (rev 299)
@@ -28,35 +28,31 @@
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>
+ <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>
+ <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: branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishNewsMojoTest/publishNews.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishNewsMojoTest/publishNews.xml 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishNewsMojoTest/publishNews.xml 2012-07-14 17:27:07 UTC (rev 299)
@@ -28,36 +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>
+ <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>
+ <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>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>publish-news</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishNewsMojoTest/skipPublishNews.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishNewsMojoTest/skipPublishNews.xml 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/publishNewsMojoTest/skipPublishNews.xml 2012-07-14 17:27:07 UTC (rev 299)
@@ -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>
+ <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>
+ <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: branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByAssigneeTest/issueReport.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByAssigneeTest/issueReport.xml 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByAssigneeTest/issueReport.xml 2012-07-14 17:27:07 UTC (rev 299)
@@ -28,31 +28,26 @@
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>
+ <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/>
+ <executions>
+ <execution>
+ <goals>
+ <goal>issues-report-by-assignee</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByCategoryTest/issueReport.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByCategoryTest/issueReport.xml 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByCategoryTest/issueReport.xml 2012-07-14 17:27:07 UTC (rev 299)
@@ -28,31 +28,26 @@
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>
+ <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/>
+ <executions>
+ <execution>
+ <goals>
+ <goal>issues-report-by-category</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByPriorityTest/issueReport.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByPriorityTest/issueReport.xml 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByPriorityTest/issueReport.xml 2012-07-14 17:27:07 UTC (rev 299)
@@ -28,31 +28,26 @@
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>
+ <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/>
+ <executions>
+ <execution>
+ <goals>
+ <goal>issues-report-by-priority</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByReporterTest/issueReport.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByReporterTest/issueReport.xml 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByReporterTest/issueReport.xml 2012-07-14 17:27:07 UTC (rev 299)
@@ -28,31 +28,26 @@
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>
+ <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/>
+ <executions>
+ <execution>
+ <goals>
+ <goal>issues-report-by-reporter</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByStatusTest/issueReport.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByStatusTest/issueReport.xml 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByStatusTest/issueReport.xml 2012-07-14 17:27:07 UTC (rev 299)
@@ -28,31 +28,26 @@
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>
+ <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/>
+ <executions>
+ <execution>
+ <goals>
+ <goal>issues-report-by-status</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByTrackerTest/issueReport.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByTrackerTest/issueReport.xml 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByTrackerTest/issueReport.xml 2012-07-14 17:27:07 UTC (rev 299)
@@ -28,31 +28,26 @@
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>
+ <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/>
+ <executions>
+ <execution>
+ <goals>
+ <goal>issues-report-by-tracker</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByVersionTest/issueReport.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByVersionTest/issueReport.xml 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportByVersionTest/issueReport.xml 2012-07-14 17:27:07 UTC (rev 299)
@@ -28,31 +28,26 @@
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>
+ <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/>
+ <executions>
+ <execution>
+ <goals>
+ <goal>issues-report-by-version</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportTest/issueReport.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportTest/issueReport.xml 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/issuesReportTest/issueReport.xml 2012-07-14 17:27:07 UTC (rev 299)
@@ -28,31 +28,26 @@
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>
+ <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/>
+ <executions>
+ <execution>
+ <goals>
+ <goal>issues-report</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/updateVersionMojoTest/skipUpdateVersion.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/updateVersionMojoTest/skipUpdateVersion.xml 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/updateVersionMojoTest/skipUpdateVersion.xml 2012-07-14 17:27:07 UTC (rev 299)
@@ -28,33 +28,29 @@
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>
+ <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>
+ <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: branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/updateVersionMojoTest/updateVersion.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/updateVersionMojoTest/updateVersion.xml 2012-07-14 17:08:23 UTC (rev 298)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/org/nuiton/jredmine/plugin/updateVersionMojoTest/updateVersion.xml 2012-07-14 17:27:07 UTC (rev 299)
@@ -28,36 +28,31 @@
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>
+ <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>
+ <versionDescription>The version description</versionDescription>
+ <closeVersion>true</closeVersion>
+ <effectiveDate>2009-09-19</effectiveDate>
+ <skipUpdateVersion>false</skipUpdateVersion>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>update-version</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Added: branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/test-config.properties
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/test-config.properties (rev 0)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/test/resources/test-config.properties 2012-07-14 17:27:07 UTC (rev 299)
@@ -0,0 +1,28 @@
+###
+# #%L
+# JRedmine :: Client
+#
+# $Id: test-config.properties 186 2011-05-20 12:32:08Z tchemit $
+# $HeadURL: http://svn.nuiton.org/svn/jredmine/branches/jredmine-1.x/jredmine-client/sr… $
+# %%
+# Copyright (C) 2009 - 2010 CodeLutin
+# %%
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Lesser Public License for more details.
+#
+# You should have received a copy of the GNU General Lesser Public
+# License along with this program. If not, see
+# <http://www.gnu.org/licenses/lgpl-3.0.html>.
+# #L%
+###
+# default values for test configuration (see org.nuiton.jredmine.TestHelper)
+test.redmineUrl=http://nuiton.org
+test.encoding=UTF-8
+test.verbose=false
\ No newline at end of file
1
0
14 Jul '12
Author: tchemit
Date: 2012-07-14 19:08:23 +0200 (Sat, 14 Jul 2012)
New Revision: 298
Url: http://nuiton.org/repositories/revision/jredmine/298
Log:
refs #937: Maven test utilise les properties de test de la distribution
improve xpp3 test
improve rest client and service tests
Added:
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineFixtures.java
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/attachment.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issue.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issueCategory.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issuePriority.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issueStatus.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/news.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/project.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/timeEntry.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/tracker.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/user.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/version.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/attachment.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/issue.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/issueCategory.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/issuePriority.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/issueStatus.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/news.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/project.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/timeEntry.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/tracker.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/user.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/version.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/attachment.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issue.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issueCategory.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issuePriority.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issueStatus.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/news.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/project.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/timeEntry.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/tracker.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/user.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/version.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/attachment.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issue.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issueCategory.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issuePriority.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issueStatus.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/news.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/project.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/timeEntry.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/tracker.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/user.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/version.xml
Removed:
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/TestHelper.java
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/attachments.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issueCategorys.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issuePrioritys.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issueStatuss.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issues.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/newss.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/projects.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/timeEntrys.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/trackers.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/users.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/versions.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/attachments.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issueCategorys.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issuePrioritys.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issueStatuss.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issues.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/newss.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/projects.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/timeEntrys.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/trackers.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/users.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/versions.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/attachments.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issueCategorys.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issuePrioritys.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issueStatuss.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issues.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/newss.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/projects.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/timeEntrys.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/trackers.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/users.xml
branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/versions.xml
Modified:
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/AbstractRedmineServiceTest.java
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/DefaultRedmineAnonymousServiceTest.java
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/DefaultRedmineServiceAsAnonymousTest.java
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/DefaultRedmineServiceTest.java
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineTestContract.java
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3HelperTest.java
branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/rest/RedmineRestClientTest.java
branches/jredmine-1.x/jredmine-client/src/test/resources/test-config.properties
Modified: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/AbstractRedmineServiceTest.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/AbstractRedmineServiceTest.java 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/AbstractRedmineServiceTest.java 2012-07-14 17:08:23 UTC (rev 298)
@@ -47,13 +47,15 @@
import org.nuiton.jredmine.model.Version;
import org.nuiton.jredmine.rest.RedmineRestClient;
-import static org.nuiton.jredmine.TestHelper.getTestConfiguration;
+import java.io.IOException;
/**
* Created: 2 janv. 2010
*
* @author tchemit <chemit(a)codelutin.com>
+ * @deprecated since 1.4, will be rethink in version 2.0 (avoid inheritance on tests).
*/
+@Deprecated
public abstract class AbstractRedmineServiceTest<S extends RedmineAnonymousService> implements RedmineTestContract {
/** Logger. */
@@ -65,6 +67,8 @@
/** service to test. */
private S service;
+ protected static RedmineFixtures fixtures;
+
protected Project[] projects;
protected Project project;
@@ -112,10 +116,12 @@
// make sure client is null before starting the test
client = null;
+ fixtures = new RedmineFixtures();
}
@AfterClass
public static void tearDownClass() throws Exception {
+ fixtures = null;
if (client != null) {
client.close();
client = null;
@@ -123,35 +129,29 @@
}
protected final S newService() throws Exception {
- return serviceType.newInstance();
+ S s = serviceType.newInstance();
+ ((DefaultRedmineAnonymousService) s).delegateImplementor = new DefaultRedmineServiceImplementor();
+ return s;
}
- protected RedmineRestClient newClient(RestClientConfiguration configuration) {
- RedmineRestClient client;
- try {
- client = new RedmineRestClient(configuration);
-
- client.open();
- } catch (Exception e) {
-
- // could not log
- if (log.isErrorEnabled()) {
- log.error("can not connect to server " + configuration.getRestUrl() + ", will skip test " + DefaultRedmineServiceTest.class.getName());
- }
-// System.out.println("can not connect to server " + configuration.getRestUrl() + ", will skip test " + DefaultRedmineServiceTest.class.getName());
- client = null;
- }
- return client;
- }
-
@Before
public void setUp() throws Exception {
if (client == null) {
- RestClientConfiguration configuration = getTestConfiguration();
+ RestClientConfiguration configuration = getConfiguration();
try {
- client = newClient(configuration);
+ client = new RedmineRestClient(configuration);
+
+ client.open();
+ } catch (Exception e) {
+
+ // could not log
+ if (log.isErrorEnabled()) {
+ log.error("can not connect to server " + configuration.getRestUrl() + ", will skip test " + DefaultRedmineServiceTest.class.getName());
+ }
+// System.out.println("can not connect to server " + configuration.getRestUrl() + ", will skip test " + DefaultRedmineServiceTest.class.getName());
+ client = null;
} finally {
Assume.assumeTrue(client != null && client.isOpen());
}
@@ -162,6 +162,8 @@
((RedmineServiceImplementor) service).init(client);
}
+ protected abstract RestClientConfiguration getConfiguration() throws IOException;
+
@After
public void tearDown() throws Exception {
service = null;
Modified: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/DefaultRedmineAnonymousServiceTest.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/DefaultRedmineAnonymousServiceTest.java 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/DefaultRedmineAnonymousServiceTest.java 2012-07-14 17:08:23 UTC (rev 298)
@@ -26,13 +26,16 @@
import org.junit.Test;
import org.nuiton.io.rest.RestClientConfiguration;
-import org.nuiton.jredmine.rest.RedmineRestClient;
+import java.io.IOException;
+
/**
* Created: 2 janv. 2010
*
* @author tchemit <chemit(a)codelutin.com>
+ * @deprecated since 1.4, will be rethink in version 2.0 (avoid inheritance on tests).
*/
+@Deprecated
public class DefaultRedmineAnonymousServiceTest extends AbstractRedmineServiceTest<DefaultRedmineAnonymousService> {
public DefaultRedmineAnonymousServiceTest() {
@@ -40,9 +43,8 @@
}
@Override
- protected RedmineRestClient newClient(RestClientConfiguration configuration) {
- configuration.setAnonymous(true);
- return super.newClient(configuration);
+ protected RestClientConfiguration getConfiguration() throws IOException {
+ return fixtures.newAnonymousConfiguration();
}
@Test
Modified: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/DefaultRedmineServiceAsAnonymousTest.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/DefaultRedmineServiceAsAnonymousTest.java 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/DefaultRedmineServiceAsAnonymousTest.java 2012-07-14 17:08:23 UTC (rev 298)
@@ -30,13 +30,16 @@
import org.nuiton.jredmine.model.News;
import org.nuiton.jredmine.model.TimeEntry;
import org.nuiton.jredmine.model.Version;
-import org.nuiton.jredmine.rest.RedmineRestClient;
+import java.io.IOException;
+
/**
* Created: 2 janv. 2010
*
- * @author tchemit <chemit(a)codelutin.com> *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @deprecated since 1.4, will be rethink in version 2.0 (avoid inheritance on tests).
*/
+@Deprecated
public class DefaultRedmineServiceAsAnonymousTest extends AbstractRedmineServiceTest<DefaultRedmineService> {
public DefaultRedmineServiceAsAnonymousTest() {
@@ -44,9 +47,10 @@
}
@Override
- protected RedmineRestClient newClient(RestClientConfiguration configuration) {
+ protected RestClientConfiguration getConfiguration() throws IOException {
+ RestClientConfiguration configuration = fixtures.newLogguedConfiguration();
configuration.setAnonymous(true);
- return super.newClient(configuration);
+ return configuration;
}
@Test(expected = RedmineServiceLoginException.class)
Modified: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/DefaultRedmineServiceTest.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/DefaultRedmineServiceTest.java 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/DefaultRedmineServiceTest.java 2012-07-14 17:08:23 UTC (rev 298)
@@ -25,14 +25,27 @@
package org.nuiton.jredmine;
import org.junit.Test;
+import org.nuiton.io.rest.RestClientConfiguration;
-/** @author tchemit <chemit(a)codelutin.com> */
+import java.io.IOException;
+
+/**
+ * @author tchemit <chemit(a)codelutin.com>
+ * @deprecated since 1.4, will be rethink in version 2.0 (avoid inheritance on tests).
+ */
+
+@Deprecated
public class DefaultRedmineServiceTest extends AbstractRedmineServiceTest<DefaultRedmineService> {
public DefaultRedmineServiceTest() {
super(DefaultRedmineService.class);
}
+ @Override
+ protected RestClientConfiguration getConfiguration() throws IOException {
+ return fixtures.newLogguedConfiguration();
+ }
+
@Test
@Override
public void getUserProjects() throws Exception {
Added: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineFixtures.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineFixtures.java (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineFixtures.java 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,800 @@
+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.lang3.StringUtils;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.io.rest.RestClientConfiguration;
+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;
+
+/**
+ * TODO
+ *
+ * @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 = "1925";
+
+ private Project JRedmineProject;
+
+ private ArrayListMultimap<Class<?>, Object> model;
+
+ private RestClientConfiguration anonymousConfiguration;
+
+ private RestClientConfiguration logguedConfiguration;
+
+ public String projectName() {
+ return "jredmine";
+ }
+
+ public String versionName() {
+ return "1.3";
+ }
+
+ public String versionId() {
+ return "295";
+ }
+
+ public String issueId() {
+ return "1925";
+ }
+
+ public RestClientConfiguration newAnonymousConfiguration()
+ throws IOException {
+ RestClientConfiguration conf = new FakeRedmineServiceConfiguration();
+ copyConfiguration(getAnonymousConfiguration(), conf);
+ return conf;
+ }
+
+ public RestClientConfiguration newLogguedConfiguration()
+ throws IOException {
+ RestClientConfiguration conf = new FakeRedmineServiceConfiguration();
+ copyConfiguration(getLogguedConfiguration(), conf);
+ return conf;
+ }
+
+ public RedmineAnonymousService newRedmineAnonymousService(RestClientConfiguration configuration)
+ throws IOException, RedmineServiceException {
+ DefaultRedmineAnonymousService service = new DefaultRedmineAnonymousService();
+ service.init(configuration);
+ return service;
+ }
+
+ public RedmineService newRedmineService(RestClientConfiguration configuration)
+ throws IOException, RedmineServiceException {
+ DefaultRedmineService service = new DefaultRedmineService();
+ service.init(configuration);
+ return service;
+ }
+
+ protected RestClientConfiguration getAnonymousConfiguration()
+ throws IOException {
+ if (anonymousConfiguration == null) {
+
+ Properties props = new Properties();
+
+ InputStream inputStream = null;
+ try {
+ String jredmineConfiguration = System.getenv("jredmine-test.properties");
+ if (jredmineConfiguration == null) {
+ if (log.isWarnEnabled()) {
+ log.warn("Could not find environement variable " +
+ "'jredmine-test.properties' will use " +
+ "default test configuration");
+ }
+
+ inputStream = getClass().getResourceAsStream("/test-config.properties");
+ } else {
+
+ File file = new File(jredmineConfiguration);
+
+ if (!file.exists()) {
+ throw new IllegalStateException("Could not find " + jredmineConfiguration +
+ " file");
+ }
+ inputStream = FileUtils.openInputStream(file);
+ }
+ props.load(inputStream);
+ } finally {
+ if (inputStream != null) {
+ inputStream.close();
+ }
+ }
+ anonymousConfiguration = new FakeRedmineServiceConfiguration();
+
+ String url = props.getProperty("test.redmineUrl");
+ anonymousConfiguration.setRestUrl(new URL(url));
+
+ String e = props.getProperty("test.encoding");
+ anonymousConfiguration.setEncoding(e);
+
+ String verbose = props.getProperty("test.verbose");
+ if (StringUtils.isNotEmpty(verbose)) {
+ anonymousConfiguration.setVerbose(Boolean.valueOf(verbose));
+ }
+ anonymousConfiguration.setEncoding(Charsets.UTF_8.name());
+ anonymousConfiguration.setAnonymous(true);
+
+ verbose = System.getenv("jredmine-test.verbose");
+ if (StringUtils.isNotEmpty(verbose)) {
+ anonymousConfiguration.setVerbose(Boolean.valueOf(verbose));
+ }
+
+ }
+ return anonymousConfiguration;
+ }
+
+ protected RestClientConfiguration getLogguedConfiguration()
+ throws IOException {
+ if (logguedConfiguration == null) {
+
+ // use anonymous configuration
+
+ RestClientConfiguration anoConf = getAnonymousConfiguration();
+ if (anoConf != null) {
+ logguedConfiguration = new FakeRedmineServiceConfiguration();
+ copyConfiguration(anoConf, logguedConfiguration);
+
+ // get system login password from env
+ String login = System.getenv("jredmine-test.login");
+ String password = System.getenv("jredmine-test.password");
+ if (!"null".equals(login)) {
+ logguedConfiguration.setRestUsername(login);
+ }
+ if (!"null".equals(password)) {
+ logguedConfiguration.setRestPassword(password);
+ }
+ logguedConfiguration.setAnonymous(false);
+ }
+ }
+ return logguedConfiguration;
+ }
+
+ protected void copyConfiguration(RestClientConfiguration src,
+ RestClientConfiguration dst) {
+ dst.setRestUrl(src.getRestUrl());
+ dst.setRestUsername(src.getRestUsername());
+ dst.setRestPassword(src.getRestPassword());
+ dst.setEncoding(src.getEncoding());
+ dst.setVerbose(src.isVerbose());
+ dst.setAnonymous(src.isAnonymous());
+ }
+
+ public List<Attachment> getAttachments() {
+ return get(Attachment.class);
+ }
+
+ public List<Issue> getIssues() {
+ return get(Issue.class);
+ }
+
+ public List<Project> getProjects() {
+ return get(Project.class);
+ }
+
+ public List<Tracker> getTrackers() {
+ return get(Tracker.class);
+ }
+
+ public List<User> getUsers() {
+ return get(User.class);
+ }
+
+ public List<Version> getVersions() {
+ return get(Version.class);
+ }
+
+ public <T> List<T> get(Class<T> modelType) {
+ if (model == null) {
+ try {
+ loadModel();
+ } catch (Exception ex) {
+ throw new RuntimeException(ex);
+ }
+ }
+ return (List<T>) model.get(modelType);
+ }
+
+ public <T> T get(Class<T> type, int pos) {
+ List<T> ts = get(type);
+ return ts.get(pos);
+ }
+
+ public Project getJRedmineProject() {
+ if (JRedmineProject == null) {
+ JRedmineProject = new Project();
+ JRedmineProject.setName("jredmine");
+ JRedmineProject.setIdentifier("jredmine");
+ JRedmineProject.setIsPublic(true);
+ JRedmineProject.setHomepage("http://maven-site.nuiton.org/jredmine");
+ JRedmineProject.setDescription(
+ "Permet de communiquer en java avec un serveur " + "redmine qui a installé le plugin rails jredmine");
+ JRedmineProject.setId(36);
+ JRedmineProject.setStatus(1);
+ }
+ return JRedmineProject;
+ }
+
+
+ public static final String VERSION_TO_CREATE_NAME = "do_not_use_me";
+
+ public Version getVersion() {
+ Version version = new Version();
+ version.setName(VERSION_TO_CREATE_NAME);
+ version.setDescription("Une version créée par les tests de jredmine," +
+ " ne pas utiliser,et modifiée");
+ return version;
+ }
+
+ private void loadModel()
+ throws Exception {
+ model = ArrayListMultimap.create();
+
+ Attachment tempA;
+ tempA = new Attachment();
+ tempA.setAuthorId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempA.setContainerId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempA.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempA.setFilesize((Integer) RedmineDataConverter.Integer.convert("411"));
+ tempA.setDownloads((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempA.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T12:56:41+02:00"));
+ tempA.setContainerType((String) RedmineDataConverter.Text.convert("Version"));
+ tempA.setContentType((String) RedmineDataConverter.Text.convert("application/json"));
+ tempA.setDigest((String) RedmineDataConverter.Text.convert("6ea84342c7475c05fb077b4aca832f9a"));
+ tempA.setDiskFilename((String) RedmineDataConverter.Text.convert("090905125641_get_issue.json"));
+ tempA.setFilename((String) RedmineDataConverter.Text.convert("get_issue.json"));
+ model.put(Attachment.class, tempA);
+ tempA = new Attachment();
+ tempA.setAuthorId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempA.setContainerId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempA.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempA.setFilesize((Integer) RedmineDataConverter.Integer.convert("411"));
+ tempA.setDownloads((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempA.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T12:56:41+02:00"));
+ tempA.setContainerType((String) RedmineDataConverter.Text.convert("Version"));
+ tempA.setContentType((String) RedmineDataConverter.Text.convert("application/json"));
+ tempA.setDigest((String) RedmineDataConverter.Text.convert("6ea84342c7475c05fb077b4aca832f9a"));
+ tempA.setDiskFilename((String) RedmineDataConverter.Text.convert("090905125641_get_issue.json2"));
+ tempA.setFilename((String) RedmineDataConverter.Text.convert("get_issue.json2"));
+ model.put(Attachment.class, tempA);
+
+ Issue tempI;
+ tempI = new Issue();
+ tempI.setAuthorId((Integer) RedmineDataConverter.Integer.convert("5"));
+ tempI.setCategoryId((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempI.setDoneRatio((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempI.setLockVersion((Integer) RedmineDataConverter.Integer.convert("7"));
+ tempI.setPriorityId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempI.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setStatusId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempI.setTrackerId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setFixedVersionId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempI.setParentId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempI.setRootId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempI.setLft((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setRgt((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempI.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T20:11:52+02:00"));
+ tempI.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T00:37:40+02:00"));
+ tempI.setStartDate((Date) RedmineDataConverter.Date.convert("2009-09-04"));
+ tempI.setDescription((String) RedmineDataConverter.Text.convert("avec une description !"));
+ tempI.setSubject((String) RedmineDataConverter.Text.convert("yes!"));
+ model.put(Issue.class, tempI);
+ tempI = new Issue();
+ tempI.setAuthorId((Integer) RedmineDataConverter.Integer.convert("5"));
+ tempI.setCategoryId((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempI.setDoneRatio((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempI.setLockVersion((Integer) RedmineDataConverter.Integer.convert("7"));
+ tempI.setPriorityId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempI.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setStatusId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempI.setTrackerId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setFixedVersionId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempI.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T20:11:52+02:00"));
+ tempI.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T00:37:40+02:00"));
+ tempI.setStartDate((Date) RedmineDataConverter.Date.convert("2009-09-04"));
+ tempI.setDescription((String) RedmineDataConverter.Text.convert("avec une description !2"));
+ tempI.setSubject((String) RedmineDataConverter.Text.convert("yes!2"));
+ model.put(Issue.class, tempI);
+
+ Project tempP;
+ tempP = new Project();
+ tempP.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:11:54+02:00"));
+ tempP.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:11:54+02:00"));
+ tempP.setIdentifier((String) RedmineDataConverter.Text.convert("one"));
+ tempP.setName((String) RedmineDataConverter.Text.convert("one"));
+ tempP.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempP.setLft((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempP.setRgt((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempP.setProjectsCount((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempP.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempP.setIsPublic((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ model.put(Project.class, tempP);
+ tempP = new Project();
+ tempP.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T16:22:14+02:00"));
+ tempP.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T16:22:29+02:00"));
+ tempP.setIdentifier((String) RedmineDataConverter.Text.convert("two"));
+ tempP.setName((String) RedmineDataConverter.Text.convert("two"));
+ tempP.setId((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempP.setProjectsCount((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempP.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempP.setIsPublic((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ model.put(Project.class, tempP);
+
+ Tracker tempT;
+ tempT = new Tracker();
+ tempT.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setTrackerId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setPosition((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setIsInChlog((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempT.setIsInRoadmap((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempT.setName((String) RedmineDataConverter.Text.convert("Anomalie"));
+ model.put(Tracker.class, tempT);
+ tempT = new Tracker();
+ tempT.setId((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempT.setIsInChlog((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempT.setIsInRoadmap((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempT.setName((String) RedmineDataConverter.Text.convert("Evolution"));
+ tempT.setPosition((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempT.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setTrackerId((Integer) RedmineDataConverter.Integer.convert("2"));
+ model.put(Tracker.class, tempT);
+ tempT = new Tracker();
+ tempT.setId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempT.setIsInChlog((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempT.setIsInRoadmap((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempT.setName((String) RedmineDataConverter.Text.convert("Assistance"));
+ tempT.setPosition((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempT.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setTrackerId((Integer) RedmineDataConverter.Integer.convert("3"));
+ model.put(Tracker.class, tempT);
+
+ User tempU;
+ tempU = new User();
+ tempU.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T17:24:46+02:00"));
+ tempU.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T01:23:59+02:00"));
+ tempU.setLastLoginOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T01:23:59+02:00"));
+ tempU.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempU.setMemberId((Integer) RedmineDataConverter.Integer.convert("5"));
+ tempU.setRoleId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempU.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempU.setAdmin((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempU.setMailNotification((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempU.setFirstname((String) RedmineDataConverter.Text.convert("Redmine"));
+ tempU.setHashedPassword(
+ (String) RedmineDataConverter.Text.convert("70c881d4a26984ddce795f6f71817c9cf4480e79"));
+ tempU.setLanguage((String) RedmineDataConverter.Text.convert("fr"));
+ tempU.setLastname((String) RedmineDataConverter.Text.convert("Admin"));
+ tempU.setLogin((String) RedmineDataConverter.Text.convert("admin"));
+ tempU.setMail((String) RedmineDataConverter.Text.convert("dummy(a)codelutin.com"));
+ tempU.setIdentityUrl((String) RedmineDataConverter.Text.convert("yo"));
+ model.put(User.class, tempU);
+ tempU = new User();
+ tempU.setAdmin((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempU.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T19:49:02+02:00"));
+ tempU.setFirstname((String) RedmineDataConverter.Text.convert("tony"));
+ tempU.setHashedPassword(
+ (String) RedmineDataConverter.Text.convert("8aed1322e5450badb078e1fb60a817a1df25a2ca"));
+ tempU.setId((Integer) RedmineDataConverter.Integer.convert("5"));
+ tempU.setLanguage((String) RedmineDataConverter.Text.convert("fr"));
+ tempU.setLastLoginOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T19:49:38+02:00"));
+ tempU.setLastname((String) RedmineDataConverter.Text.convert("chemit2"));
+ tempU.setLogin((String) RedmineDataConverter.Text.convert("tchemit2"));
+ tempU.setMail((String) RedmineDataConverter.Text.convert("chemit(a)codelutin.com"));
+ tempU.setMailNotification((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempU.setMemberId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempU.setRoleId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempU.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempU.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T19:49:38+02:00"));
+ model.put(User.class, tempU);
+ tempU = new User();
+ tempU.setAdmin((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempU.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T16:24:11+02:00"));
+ tempU.setFirstname((String) RedmineDataConverter.Text.convert("dev"));
+ tempU.setHashedPassword(
+ (String) RedmineDataConverter.Text.convert("70c881d4a26984ddce795f6f71817c9cf4480e79"));
+ tempU.setId((Integer) RedmineDataConverter.Integer.convert("7"));
+ tempU.setLanguage((String) RedmineDataConverter.Text.convert("fr"));
+ tempU.setLastLoginOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T16:34:39+02:00"));
+ tempU.setLastname((String) RedmineDataConverter.Text.convert("dev"));
+ tempU.setLogin((String) RedmineDataConverter.Text.convert("dev"));
+ tempU.setMail((String) RedmineDataConverter.Text.convert("dev3(a)ynot-home.info"));
+ tempU.setMailNotification((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempU.setMemberId((Integer) RedmineDataConverter.Integer.convert("9"));
+ tempU.setRoleId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempU.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempU.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T16:34:39+02:00"));
+ model.put(User.class, tempU);
+
+ Version tempV;
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:47:39+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("yo"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("9"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("yor"));
+ tempV.setSharing((String) RedmineDataConverter.Text.convert("none"));
+ tempV.setStatus((String) RedmineDataConverter.Text.convert("open"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:50:49+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:09+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("13"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("rrrrrrrrrouuuuuua"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:09+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:07:58+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("15"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("aaaauuuuuua"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:07:58+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T04:12:25+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoyeppppppppppppppppp"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("16"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("aaaau"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T04:13:20+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:40+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("14"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("aaaaaaaaaarrrrrrrrrouuuuuua"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:40+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T00:39:15+02:00"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("5"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("2"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T00:39:15+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:13:05+02:00"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("1.0.0"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:13:05+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:12+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("yoye"));
+ tempV.setEffectiveDate((Date) RedmineDataConverter.Date.convert("2009-09-06"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("11"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("yaouuuuuua"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:12+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:50:59+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("yoye"));
+ tempV.setEffectiveDate((Date) RedmineDataConverter.Date.convert("2009-09-06"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("10"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("ya"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:54:16+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:37+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
+ tempV.setEffectiveDate((Date) RedmineDataConverter.Date.convert("2009-09-06"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("12"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("ouuuuuua"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:42+02:00"));
+ model.put(Version.class, tempV);
+
+ IssueStatus tempIS;
+ tempIS = new IssueStatus();
+ tempIS.setId(1);
+ tempIS.setName("Nouveau");
+ tempIS.setPosition(1);
+ tempIS.setDefaultDoneRatio(10);
+ tempIS.setIsClosed(false);
+ tempIS.setIsDefault(true);
+ model.put(IssueStatus.class, tempIS);
+ tempIS = new IssueStatus();
+ tempIS.setId(2);
+ tempIS.setName("Assigné");
+ tempIS.setPosition(2);
+ tempIS.setIsClosed(false);
+ tempIS.setIsDefault(false);
+ model.put(IssueStatus.class, tempIS);
+ tempIS = new IssueStatus();
+ tempIS.setId(3);
+ tempIS.setName("Résolu");
+ tempIS.setPosition(3);
+ tempIS.setIsClosed(false);
+ tempIS.setIsDefault(false);
+ model.put(IssueStatus.class, tempIS);
+ tempIS = new IssueStatus();
+ tempIS.setId(4);
+ tempIS.setName("Commentaire");
+ tempIS.setPosition(4);
+ tempIS.setIsClosed(false);
+ tempIS.setIsDefault(false);
+ model.put(IssueStatus.class, tempIS);
+ tempIS = new IssueStatus();
+ tempIS.setId(5);
+ tempIS.setName("Fermé");
+ tempIS.setPosition(5);
+ tempIS.setIsClosed(true);
+ tempIS.setIsDefault(false);
+ model.put(IssueStatus.class, tempIS);
+ tempIS = new IssueStatus();
+ tempIS.setId(6);
+ tempIS.setPosition(6);
+ tempIS.setName("Rejeté");
+ tempIS.setIsClosed(true);
+ tempIS.setIsDefault(false);
+ model.put(IssueStatus.class, tempIS);
+
+ IssuePriority tempIP;
+ tempIP = new IssuePriority();
+ tempIP.setId(3);
+ tempIP.setParentId(1);
+ tempIP.setProjectId(2);
+ tempIP.setName("Bas");
+ tempIP.setPosition(1);
+ tempIP.setOpt("IPRI");
+ tempIP.setIsDefault(false);
+ tempIP.setActive(true);
+ model.put(IssuePriority.class, tempIP);
+ tempIP = new IssuePriority();
+ tempIP.setId(4);
+ tempIP.setName("Normal");
+ tempIP.setPosition(2);
+ tempIP.setOpt("IPRI");
+ tempIP.setIsDefault(true);
+ model.put(IssuePriority.class, tempIP);
+ tempIP = new IssuePriority();
+ tempIP.setId(5);
+ tempIP.setName("Haut");
+ tempIP.setPosition(3);
+ tempIP.setOpt("IPRI");
+ tempIP.setIsDefault(false);
+ model.put(IssuePriority.class, tempIP);
+ tempIP = new IssuePriority();
+ tempIP.setId(6);
+ tempIP.setName("Urgent");
+ tempIP.setPosition(4);
+ tempIP.setOpt("IPRI");
+ tempIP.setIsDefault(false);
+ model.put(IssuePriority.class, tempIP);
+ tempIP = new IssuePriority();
+ tempIP.setId(7);
+ tempIP.setName("Immédiat");
+ tempIP.setPosition(5);
+ tempIP.setOpt("IPRI");
+ tempIP.setIsDefault(false);
+ model.put(IssuePriority.class, tempIP);
+
+ IssueCategory tempIC;
+ tempIC = new IssueCategory();
+ tempIC.setId(1);
+ tempIC.setName("categorie one");
+ tempIC.setProjectId(1);
+ model.put(IssueCategory.class, tempIC);
+ tempIC = new IssueCategory();
+ tempIC.setId(2);
+ tempIC.setName("categorie two");
+ tempIC.setProjectId(1);
+ model.put(IssueCategory.class, tempIC);
+
+ News tempN;
+ tempN = new News();
+ tempN.setId(85);
+ tempN.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-17T21:50:26+02:00"));
+ tempN.setProjectId(1);
+ tempN.setAuthorId(4);
+ tempN.setCommentsCount(0);
+ tempN.setDescription("description");
+ tempN.setSummary("summary");
+ tempN.setTitle("title");
+ model.put(News.class, tempN);
+ tempN = new News();
+ tempN.setId(86);
+ tempN.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-17T21:55:26+02:00"));
+ tempN.setProjectId(1);
+ tempN.setAuthorId(4);
+ tempN.setCommentsCount(0);
+ tempN.setDescription("description2");
+ tempN.setSummary("summary2");
+ tempN.setTitle("title2");
+ model.put(News.class, tempN);
+
+ TimeEntry tempE;
+
+ tempE = new TimeEntry();
+ tempE.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:02:02+01:00"));
+ tempE.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:02:02+01:00"));
+ tempE.setSpentOn((Date) RedmineDataConverter.Date.convert("2009-12-31"));
+ tempE.setId(1);
+ tempE.setProjectId(1);
+ tempE.setUserId(4);
+ tempE.setIssueId(6);
+ tempE.setActivityId(8);
+
+ tempE.setHours(1);
+ tempE.setTmonth(12);
+ tempE.setTyear(2009);
+ tempE.setTweek(53);
+ tempE.setComments("Test");
+ model.put(TimeEntry.class, tempE);
+
+ tempE = new TimeEntry();
+ tempE.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:10:01+01:00"));
+ tempE.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:10:01+01:00"));
+ tempE.setSpentOn((Date) RedmineDataConverter.Date.convert("2009-12-31"));
+ tempE.setId(2);
+ tempE.setProjectId(1);
+ tempE.setUserId(4);
+ tempE.setIssueId(6);
+ tempE.setActivityId(9);
+
+ tempE.setHours(2);
+ tempE.setTmonth(12);
+ tempE.setTyear(2009);
+ tempE.setTweek(53);
+ tempE.setComments("deuxième temps");
+ model.put(TimeEntry.class, tempE);
+ }
+
+
+ public Attachment getAttachment() {
+ Attachment result = new Attachment();
+ File fileToUpload = null;
+ try {
+ fileToUpload = File.createTempFile("toupload", ".txt");
+ FileUtils.write(fileToUpload, FILE_TO_UPLOAD_CONTENT);
+ result.setToUpload(fileToUpload);
+ result.setDescription("attachment description...");
+ return result;
+ } catch (IOException e) {
+ throw new RuntimeException("Could not create temp file", e);
+ }
+
+ }
+
+ /**
+ * Configuration of a redmine service for test purposes.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+ public static class FakeRedmineServiceConfiguration implements RestClientConfiguration {
+
+ 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: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineTestContract.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineTestContract.java 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineTestContract.java 2012-07-14 17:08:23 UTC (rev 298)
@@ -31,14 +31,16 @@
*
* @author tchemit <chemit(a)codelutin.com>
* @since 1.0.3
+ * @deprecated will be removed in version 2.0
*/
+@Deprecated
public interface RedmineTestContract {
- String PROJECT_NAME = "one";
+ String PROJECT_NAME = "jredmine";
- String VERSION_NAME = "1.0.0";
+ String VERSION_NAME = "1.3";
- String ISSUE_ID = "6";
+ String ISSUE_ID = "1925";
void getProjects() throws Exception;
Deleted: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/TestHelper.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/TestHelper.java 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/TestHelper.java 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,747 +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 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>
- * @since 1.0.0
- */
-public abstract class TestHelper {
-
- protected static File basedir;
-
- 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;
- }
-
- InputStream stream = TestHelper.class.getResourceAsStream("/test-config.properties");
-
- defaultConfig = new Properties();
- defaultConfig.load(stream);
-
- 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 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++) {
- T actual = actuals[i];
- T expected = expecteds.get(i);
- assertMyEquals(type, expected, actual);
- }
-
- }
-
- public static void assertMyEquals(Class<?> type, Object expected, Object actual) throws Exception {
-
- Assert.assertNotNull(expected);
- Assert.assertNotNull(actual);
- AbstractXpp3Reader<?> reader = (AbstractXpp3Reader<?>) Xpp3Helper.getReader(type);
- Map<String, PropertyMapper> mappers = reader.getMappers(type);
- for (PropertyMapper m : mappers.values()) {
-
- 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: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3HelperTest.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3HelperTest.java 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3HelperTest.java 2012-07-14 17:08:23 UTC (rev 298)
@@ -24,16 +24,19 @@
*/
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 com.google.common.base.Preconditions;
+import com.google.common.base.Supplier;
+import com.google.common.collect.Lists;
import org.junit.After;
import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.nuiton.jredmine.TestHelper;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.nuiton.io.xpp3.AbstractXpp3Reader;
+import org.nuiton.io.xpp3.PropertyMapper;
+import org.nuiton.io.xpp3.Xpp3Helper;
+import org.nuiton.jredmine.RedmineFixtures;
import org.nuiton.jredmine.model.Attachment;
import org.nuiton.jredmine.model.Issue;
import org.nuiton.jredmine.model.IssueCategory;
@@ -41,94 +44,169 @@
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 java.beans.Introspector;
-import java.io.File;
-import java.io.FileInputStream;
+import java.io.Closeable;
+import java.io.IOException;
+import java.io.InputStream;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
-import java.util.Set;
+import java.util.Map;
/**
* @author tchemit <chemit(a)codelutin.com>
* @since 1.0.0
*/
-public class RedmineXpp3HelperTest {
+(a)RunWith(Parameterized.class)
+public class RedmineXpp3HelperTest<T> {
- protected static final Log log =
- LogFactory.getLog(RedmineXpp3HelperTest.class);
+ @Parameterized.Parameters
+ public static List<Object[]> data() {
+ return Arrays.asList(new Object[][]{
+ {"single", Attachment.class, newSingleData(Attachment.class)},
+ {"single", Issue.class, newSingleData(Issue.class)},
+ {"single", IssueCategory.class, newSingleData(IssueCategory.class)},
+ {"single", IssuePriority.class, newSingleData(IssuePriority.class)},
+ {"single", IssueStatus.class, newSingleData(IssueStatus.class)},
+ {"single", News.class, newSingleData(News.class)},
+ {"single", Project.class, newSingleData(Project.class)},
+ {"single", TimeEntry.class, newSingleData(TimeEntry.class)},
+ {"single", Tracker.class, newSingleData(Tracker.class)},
+ {"single", User.class, newSingleData(User.class)},
+ {"single", Version.class, newSingleData(Version.class)},
+ {"single2", Issue.class, new SingleDataSupplier<Issue>(Issue.class) {
- //TODO use the RedmineModelEnum and finish the model mock (miss some types)
- private static final RedmineModelEnum[] TYPE_ORDER = new RedmineModelEnum[]{
- RedmineModelEnum.attachment,
- RedmineModelEnum.issue,
- RedmineModelEnum.project,
- RedmineModelEnum.tracker,
- RedmineModelEnum.user,
- RedmineModelEnum.version,
- RedmineModelEnum.issueStatus,
- RedmineModelEnum.issuePriority,
- RedmineModelEnum.issueCategory,
- RedmineModelEnum.news,
- RedmineModelEnum.timeEntry
- };
+ @Override
+ public List<Issue> get() {
+ List<Issue> issues = super.get();
+ issues.get(0).setIsPrivate(true);
+ return issues;
+ }
- protected static File testDir;
+ @Override
+ public void close() throws IOException {
+ super.close();
+ List<Issue> issues = super.get();
+ issues.get(0).setIsPrivate(false);
+ }
+ }},
+ {"single2", User.class, new SingleDataSupplier<User>(User.class) {
- protected static RedmineXpp3Helper builder;
+ @Override
+ public List<User> get() {
+ List<User> users = super.get();
+ users.get(0).setSalt("38006729a049cd820aafd6c2bb3b193f");
+ return users;
+ }
- File file;
+ @Override
+ public void close() throws IOException {
+ super.close();
+ List<User> users = get();
+ users.get(0).setSalt(null);
+ }
+ }},
- protected boolean verbose;
+ {"array-empty", Attachment.class, newEmptyListData(Attachment.class)},
+ {"array-empty", Issue.class, newEmptyListData(Issue.class)},
+ {"array-empty", IssueCategory.class, newEmptyListData(Attachment.class)},
+ {"array-empty", IssuePriority.class, newEmptyListData(IssuePriority.class)},
+ {"array-empty", IssueStatus.class, newEmptyListData(IssueStatus.class)},
+ {"array-empty", News.class, newEmptyListData(News.class)},
+ {"array-empty", Project.class, newEmptyListData(Project.class)},
+ {"array-empty", TimeEntry.class, newEmptyListData(TimeEntry.class)},
+ {"array-empty", Tracker.class, newEmptyListData(Tracker.class)},
+ {"array-empty", User.class, newEmptyListData(User.class)},
+ {"array-empty", Version.class, newEmptyListData(Version.class)},
- protected static int universeSize;
+ {"array-empty2", Attachment.class, newEmptyListData(Attachment.class)},
+ {"array-empty2", Issue.class, newEmptyListData(Issue.class)},
+ {"array-empty2", IssueCategory.class, newEmptyListData(IssueCategory.class)},
+ {"array-empty2", IssuePriority.class, newEmptyListData(IssuePriority.class)},
+ {"array-empty2", IssueStatus.class, newEmptyListData(IssueStatus.class)},
+ {"array-empty2", News.class, newEmptyListData(News.class)},
+ {"array-empty2", Project.class, newEmptyListData(Project.class)},
+ {"array-empty2", TimeEntry.class, newEmptyListData(TimeEntry.class)},
+ {"array-empty2", Tracker.class, newEmptyListData(Tracker.class)},
+ {"array-empty2", User.class, newEmptyListData(User.class)},
+ {"array-empty2", Version.class, newEmptyListData(Version.class)},
- @BeforeClass
- public static void setUpClass() throws Exception {
- testDir = TestHelper.getTestDir(RedmineXpp3HelperTest.class.getPackage().getName(), "target" + File.separator + "test-classes");
+ {"array-singleton", Attachment.class, newSingletonListData(Attachment.class)},
+ {"array-singleton", Issue.class, newSingletonListData(Issue.class)},
+ {"array-singleton", IssueCategory.class, newSingletonListData(IssueCategory.class)},
+ {"array-singleton", IssuePriority.class, newSingletonListData(IssuePriority.class)},
+ {"array-singleton", IssueStatus.class, newSingletonListData(IssueStatus.class)},
+ {"array-singleton", News.class, newSingletonListData(News.class)},
+ {"array-singleton", Project.class, newSingletonListData(Project.class)},
+ {"array-singleton", TimeEntry.class, newSingletonListData(TimeEntry.class)},
+ {"array-singleton", Tracker.class, newSingletonListData(Tracker.class)},
+ {"array-singleton", User.class, newSingletonListData(User.class)},
+ {"array-singleton", Version.class, newSingletonListData(Version.class)},
- builder = new RedmineXpp3Helper();
+ {"array-multi", Attachment.class, newMultiListData(Attachment.class)},
+ {"array-multi", Issue.class, newMultiListData(Issue.class)},
+ {"array-multi", IssueCategory.class, newMultiListData(IssueCategory.class)},
+ {"array-multi", IssuePriority.class, newMultiListData(IssuePriority.class)},
+ {"array-multi", IssueStatus.class, newMultiListData(IssueStatus.class)},
+ {"array-multi", News.class, newMultiListData(News.class)},
+ {"array-multi", Project.class, newMultiListData(Project.class)},
+ {"array-multi", TimeEntry.class, newMultiListData(TimeEntry.class)},
+ {"array-multi", Tracker.class, newMultiListData(Tracker.class)},
+ {"array-multi", User.class, newMultiListData(User.class)},
+ {"array-multi", Version.class, newMultiListData(Version.class)},
+ });
+ }
- log.info("test dir : " + TestHelper.getRelativePath(TestHelper.getBasedir(), testDir));
+ private static RedmineXpp3Helper builder;
- // setup memory model
- TestHelper.loadMemoryModel();
+ private static RedmineFixtures fixtures;
- universeSize = TYPE_ORDER.length;
+ private final Class<T> type;
- if (universeSize < RedmineModelEnum.values().length) {
- log.warn("There is some types of the model which are not tested :");
- Set<RedmineModelEnum> keySet = TestHelper.getMemoryModel().keySet();
- for (RedmineModelEnum t : RedmineModelEnum.values()) {
- if (!keySet.contains(t)) {
- log.warn(t);
- }
- }
- }
+ private final Supplier<List<T>> result;
+ private final String resourcePath;
+
+ public RedmineXpp3HelperTest(String path,
+ Class<T> type,
+ Supplier<List<T>> result) {
+ Preconditions.checkNotNull(path);
+ Preconditions.checkNotNull(type);
+ Preconditions.checkNotNull(result);
+ this.type = type;
+ this.result = result;
+ String dotPath = "." + getClass().getPackage().getName() +
+ "." + path +
+ "." + Introspector.decapitalize(type.getSimpleName());
+ resourcePath = dotPath.replaceAll("\\.", "/") + ".xml";
}
+ @BeforeClass
+ public static void setUpClass() throws Exception {
+
+ builder = new RedmineXpp3Helper();
+
+ // setup memory model
+ fixtures = new RedmineFixtures();
+ }
+
@AfterClass
public static void tearDownClass() throws Exception {
- testDir = null;
builder = null;
+ fixtures = null;
}
- @Before
- public void setUp() {
- verbose = TestHelper.isVerbose();
- }
-
@After
- public void tearDown() {
- file = null;
+ public void tearDown() throws IOException {
+ if (result instanceof Closeable) {
+ ((Closeable) result).close();
+ }
}
/**
@@ -139,187 +217,161 @@
@Test
public void testRead() throws Exception {
- TestAction action = new TestAction() {
+ List<T> expected = result.get();
- @Override
- protected <T> void runForType(File rootDir, Class<T> type, List<?> expected) throws Exception {
+ InputStream stream = getClass().getResourceAsStream(resourcePath);
+ try {
- File file = new File(rootDir, Introspector.decapitalize(type.getSimpleName()) + ".xml");
+ if (result instanceof SingleDataSupplier<?>) {
- if (verbose) {
- log.info("will test " + TestHelper.getRelativePath(TestHelper.getBasedir(), file));
- }
+ T actual = builder.readObject(type, stream, true);
+ assertMyEquals(type, expected.get(0), actual);
- // test from file
+ } else {
- T actual = builder.readObject(type, file, true);
+ T[] actual = builder.readObjects(type, stream, true);
+ assertMyListEquals(type, expected, actual);
+ }
+ } catch (Exception e) {
+ throw new IllegalStateException(
+ "Could not read from resource " + resourcePath, e);
+ } finally {
+ if (stream != null) {
+ stream.close();
+ }
+ }
+ }
- TestHelper.assertMyEquals(type, expected.get(0), actual);
+ static class SingleDataSupplier<T> implements Supplier<List<T>>, Closeable {
- // test from string
+ protected final Class<T> type;
- FileInputStream input = new FileInputStream(file);
- try {
- String txt = IOUtil.toString(input);
+ SingleDataSupplier(Class<T> type) {
+ this.type = type;
+ }
- actual = builder.readObject(type, txt, true);
+ @Override
+ public List<T> get() {
+ T t = fixtures.get(type, 0);
+ List<T> result = Lists.newArrayList();
+ result.add(t);
+ return result;
+ }
- TestHelper.assertMyEquals(type, expected.get(0), actual);
- } finally {
- input.close();
- }
- }
- };
+ @Override
+ public void close() throws IOException {
+ }
+ }
- action.run("single",
- Arrays.asList(TestHelper.getModel(Attachment.class).get(0)),
- Arrays.asList(TestHelper.getModel(Issue.class).get(0)),
- Arrays.asList(TestHelper.getModel(Project.class).get(0)),
- Arrays.asList(TestHelper.getModel(Tracker.class).get(0)),
- Arrays.asList(TestHelper.getModel(User.class).get(0)),
- Arrays.asList(TestHelper.getModel(Version.class).get(0)),
- Arrays.asList(TestHelper.getModel(IssueStatus.class).get(0)),
- Arrays.asList(TestHelper.getModel(IssuePriority.class).get(0)),
- Arrays.asList(TestHelper.getModel(IssueCategory.class).get(0)),
- Arrays.asList(TestHelper.getModel(News.class).get(0)),
- Arrays.asList(TestHelper.getModel(TimeEntry.class).get(0))
- );
+ static class EmptyListDataSupplier<T> implements Supplier<List<T>>, Closeable {
- Issue issue = TestHelper.getModel(Issue.class).get(0);
- User user = TestHelper.getModel(User.class).get(0);
- issue.setIsPrivate(true);
- user.setSalt("38006729a049cd820aafd6c2bb3b193f");
- try {
- action.run("single2",
- null,
- Arrays.asList(issue),
- null,
- null,
- Arrays.asList(user),
- null,
- null,
- null,
- null,
- null,
- null
- );
- } finally {
- issue.setIsPrivate(false);
- user.setSalt(null);
+ protected final Class<T> type;
+
+ EmptyListDataSupplier(Class<T> type) {
+ this.type = type;
}
+
+ @Override
+ public List<T> get() {
+ return Collections.emptyList();
+ }
+
+ @Override
+ public void close() throws IOException {
+ }
}
- /**
- * Test the method {@code readArray} of class ModelBuilder.
- *
- * @throws Exception for any exceptions
- */
- @Test
- @SuppressWarnings("unchecked")
- public void testReadArray() throws Exception {
+ static class SingletonListDataSupplier<T> implements Supplier<List<T>>, Closeable {
- TestAction action = new TestAction() {
+ protected final Class<T> type;
- @Override
- protected <T> void runForType(File rootDir, Class<T> type, List<?> expected) throws Exception {
+ SingletonListDataSupplier(Class<T> type) {
+ this.type = type;
+ }
- File file = new File(rootDir, Introspector.decapitalize(type.getSimpleName()) + "s.xml");
+ @Override
+ public List<T> get() {
+ T model = fixtures.get(type, 0);
+ List<T> result = Lists.newArrayList();
+ result.add(model);
+ return result;
+ }
- if (verbose) {
- log.info("will test " + TestHelper.getRelativePath(TestHelper.getBasedir(), file));
- }
+ @Override
+ public void close() throws IOException {
+ }
+ }
- // test from file
+ static class MultiListDataSupplier<T> implements Supplier<List<T>>, Closeable {
- T[] actual = builder.readObjects(type, file, true);
+ protected final Class<T> type;
- TestHelper.assertMyListEquals(type, (List<T>) expected, actual);
+ MultiListDataSupplier(Class<T> type) {
+ this.type = type;
+ }
- FileInputStream input = new FileInputStream(file);
- try {
- // test from text
- String txt = IOUtil.toString(input);
+ @Override
+ public List<T> get() {
+ return fixtures.get(type);
+ }
- actual = builder.readObjects(type, txt, true);
+ @Override
+ public void close() throws IOException {
+ }
+ }
- TestHelper.assertMyListEquals(type, (List<T>) expected, actual);
- } finally {
- input.close();
- }
- }
- };
+ public static <T> SingleDataSupplier<T> newSingleData(Class<T> type) {
+ return new SingleDataSupplier<T>(type);
+ }
- action.run("array-empty",
- Collections.emptyList(),
- Collections.emptyList(),
- Collections.emptyList(),
- Collections.emptyList(),
- Collections.emptyList(),
- Collections.emptyList(),
- Collections.emptyList(),
- Collections.emptyList(),
- Collections.emptyList(),
- Collections.emptyList(),
- Collections.emptyList());
+ public static <T> EmptyListDataSupplier<T> newEmptyListData(Class<T> type) {
+ return new EmptyListDataSupplier<T>(type);
+ }
+ public static <T> SingletonListDataSupplier<T> newSingletonListData(Class<T> type) {
+ return new SingletonListDataSupplier<T>(type);
+ }
- action.run("array-singleton",
- Arrays.asList(TestHelper.getModel(Attachment.class).get(0)),
- Arrays.asList(TestHelper.getModel(Issue.class).get(0)),
- Arrays.asList(TestHelper.getModel(Project.class).get(0)),
- Arrays.asList(TestHelper.getModel(Tracker.class).get(0)),
- Arrays.asList(TestHelper.getModel(User.class).get(0)),
- Arrays.asList(TestHelper.getModel(Version.class).get(0)),
- Arrays.asList(TestHelper.getModel(IssueStatus.class).get(0)),
- Arrays.asList(TestHelper.getModel(IssuePriority.class).get(0)),
- Arrays.asList(TestHelper.getModel(IssueCategory.class).get(0)),
- Arrays.asList(TestHelper.getModel(News.class).get(0)),
- Arrays.asList(TestHelper.getModel(TimeEntry.class).get(0))
- );
+ public static <T> MultiListDataSupplier<T> newMultiListData(Class<T> type) {
+ return new MultiListDataSupplier<T>(type);
+ }
- action.run("array-multi",
- TestHelper.getModel(Attachment.class),
- TestHelper.getModel(Issue.class),
- TestHelper.getModel(Project.class),
- TestHelper.getModel(Tracker.class),
- TestHelper.getModel(User.class),
- TestHelper.getModel(Version.class),
- TestHelper.getModel(IssueStatus.class),
- TestHelper.getModel(IssuePriority.class),
- TestHelper.getModel(IssueCategory.class),
- TestHelper.getModel(News.class),
- TestHelper.getModel(TimeEntry.class)
- );
+ public <T> void assertMyListEquals(Class<T> type, List<T> expecteds, T[] actuals)
+ throws Exception {
+ junit.framework.Assert.assertNotNull(actuals);
+ junit.framework.Assert.assertEquals(expecteds.size(), actuals.length);
+ for (int i = 0, j = expecteds.size(); i < j; i++) {
+ T actual = actuals[i];
+ T expected = expecteds.get(i);
+ assertMyEquals(type, expected, actual);
+ }
+
}
- /** A little action wrapper to simplify this test class :) */
- public static abstract class TestAction {
+ public void assertMyEquals(Class<?> type, Object expected, Object actual, String... mapperNames)
+ throws Exception {
- /**
- * Implements the logic of action for the given {@code type} and
- * the {@code expected} datas.
- *
- * @param <T> the type of data used
- * @param rootDir the rootdir file of the local cache
- * @param type the type of data used
- * @param expected the list of expected datas
- * @throws Exception if any pb
- */
- protected abstract <T> void runForType(File rootDir, Class<T> type, List<?> expected) throws Exception;
+ junit.framework.Assert.assertNotNull(expected);
+ junit.framework.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()) {
- public void run(String name, List<?>... expected) throws Exception {
- Assert.assertEquals(universeSize, expected.length);
- File rootDir = new File(testDir, name);
+ if (mappersIncludes == null || mappersIncludes.contains(m.getPropertyName())) {
- for (int i = 0; i < universeSize; i++) {
+ Object expectedValue = m.getDescriptor().getReadMethod().invoke(expected);
+ Object actualValue = m.getDescriptor().getReadMethod().invoke(actual);
- RedmineModelEnum next = TYPE_ORDER[i];
-
- if (expected[i] != null) {
- runForType(rootDir, next.getModelType(), expected[i]);
- }
+ junit.framework.Assert.assertEquals("error in attribute " + m.getPropertyName() + " for " + expected, expectedValue,
+ actualValue);
}
}
}
-}
+}
\ No newline at end of file
Modified: branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/rest/RedmineRestClientTest.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/rest/RedmineRestClientTest.java 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/java/org/nuiton/jredmine/rest/RedmineRestClientTest.java 2012-07-14 17:08:23 UTC (rev 298)
@@ -37,8 +37,9 @@
import org.nuiton.io.rest.RestClientConfiguration;
import org.nuiton.io.rest.RestException;
import org.nuiton.io.rest.RestRequest;
+import org.nuiton.jredmine.RedmineFixtures;
import org.nuiton.jredmine.RedmineTestContract;
-import org.nuiton.jredmine.TestHelper;
+import org.nuiton.jredmine.model.ModelHelper;
import java.io.IOException;
import java.io.InputStream;
@@ -46,13 +47,18 @@
/**
* @author tchemit <chemit(a)codelutin.com>
* @since 1.0.0
+ * @deprecated since 1.4, will be rethink in version 2.0 (avoid inheritance on tests).
*/
+@Deprecated
public class RedmineRestClientTest implements RedmineTestContract {
/** Logger. */
private static final Log log =
LogFactory.getLog(RedmineRestClientTest.class);
+
+ private static final RedmineFixtures fixtures = new RedmineFixtures();
+
static RestClientConfiguration configuration;
RedmineRestClient client;
@@ -63,7 +69,7 @@
@BeforeClass
public static void setUpClass() throws Exception {
- configuration = TestHelper.getTestConfiguration();
+ configuration = fixtures.newAnonymousConfiguration();
RedmineRestClient client = new RedmineRestClient(configuration);
try {
@@ -115,110 +121,110 @@
@Test
public void getProjects() throws Exception {
- doRequest(RedmineRestClient.GET_PROJECT_LIST);
+ doRequest(ModelHelper.GET_ALL_PROJECT_REQUEST_NAME);
}
@Override
@Test
public void getIssuePriorities() throws Exception {
- doRequest(RedmineRestClient.GET_ISSUE_PRIORITY_LIST);
+ doRequest(ModelHelper.GET_ALL_ISSUE_PRIORITY_REQUEST_NAME);
}
@Override
@Test
public void getIssueStatuses() throws Exception {
- doRequest(RedmineRestClient.GET_ISSUE_STATUS_LIST);
+ doRequest(ModelHelper.GET_ALL_ISSUE_STATUS_REQUEST_NAME);
}
@Override
@Test
public void getProject() throws Exception {
- doRequest(RedmineRestClient.GET_PROJECT, PROJECT_NAME);
+ doRequest(ModelHelper.GET_PROJECT_REQUEST_NAME, PROJECT_NAME);
}
@Override
@Test
public void getIssueCategories() throws Exception {
- doRequest(RedmineRestClient.GET_ISSUE_CATEGORY_LIST, PROJECT_NAME);
+ doRequest(ModelHelper.GET_ALL_ISSUE_CATEGORY_REQUEST_NAME, PROJECT_NAME);
}
@Override
@Test
public void getTrackers() throws Exception {
- doRequest(RedmineRestClient.GET_TRACKER_LIST, PROJECT_NAME);
+ doRequest(ModelHelper.GET_ALL_TRACKER_REQUEST_NAME, PROJECT_NAME);
}
@Override
@Test
public void getNews() throws Exception {
- doRequest(RedmineRestClient.GET_NEWS_LIST, PROJECT_NAME);
+ doRequest(ModelHelper.GET_ALL_NEWS_REQUEST_NAME, PROJECT_NAME);
}
@Override
public void getUserProjects() throws Exception {
- doRequest(RedmineRestClient.GET_USER_PROJECTS, PROJECT_NAME);
+ doRequest(ModelHelper.GET_USER_PROJECTS_REQUEST_NAME, PROJECT_NAME);
}
@Override
public void getProjectMembers() throws Exception {
- doRequest(RedmineRestClient.GET_USER_LIST, PROJECT_NAME);
+ doRequest(ModelHelper.GET_ALL_USER_REQUEST_NAME, PROJECT_NAME);
}
@Override
@Test
public void getProjectIssues() throws Exception {
- doRequest(RedmineRestClient.GET_PROJECT_ISSUES, PROJECT_NAME);
+ doRequest(ModelHelper.GET_ALL_PROJECT_ISSUES_REQUEST_NAME, PROJECT_NAME);
}
@Override
@Test
public void getVersions() throws Exception {
- doRequest(RedmineRestClient.GET_VERSION_LIST, PROJECT_NAME);
+ doRequest(ModelHelper.GET_ALL_VERSION_REQUEST_NAME, PROJECT_NAME);
}
@Override
@Test
public void getVersion() throws Exception {
- doRequest(RedmineRestClient.GET_VERSION, PROJECT_NAME, VERSION_NAME);
+ doRequest(ModelHelper.GET_VERSION_REQUEST_NAME, PROJECT_NAME, VERSION_NAME);
}
@Override
@Test
public void getVersionIssues() throws Exception {
- doRequest(RedmineRestClient.GET_ISSUE_LIST, PROJECT_NAME, VERSION_NAME);
+ doRequest(ModelHelper.GET_ALL_ISSUES_REQUEST_NAME, PROJECT_NAME, VERSION_NAME);
}
@Override
@Test
public void getOpenedIssues() throws Exception {
- doRequest(RedmineRestClient.GET_PROJECT_OPENED_ISSUES, PROJECT_NAME);
+ doRequest(ModelHelper.GET_ALL_PROJECT_OPENED_ISSUES_REQUEST_NAME, PROJECT_NAME);
}
@Override
@Test
public void getClosedIssues() throws Exception {
- doRequest(RedmineRestClient.GET_PROJECT_CLOSED_ISSUES, PROJECT_NAME);
+ doRequest(ModelHelper.GET_ALL_PROJECT_CLOSED_ISSUES_REQUEST_NAME, PROJECT_NAME);
}
@Override
@Test
public void getIssueTimeEntries() throws Exception {
- doRequest(RedmineRestClient.GET_ISSUE_TIME_ENTRY_LIST, PROJECT_NAME, ISSUE_ID);
+ doRequest(ModelHelper.GET_ALL_ISSUE_TIME_ENTRY_REQUEST_NAME, PROJECT_NAME, ISSUE_ID);
}
@@ -226,7 +232,7 @@
@Test
public void getAttachments() throws Exception {
- doRequest(RedmineRestClient.GET_ATTACHMENTS_LIST, PROJECT_NAME, VERSION_NAME);
+ doRequest(ModelHelper.GET_ALL_ATTACHMENTS_REQUEST_NAME, PROJECT_NAME, VERSION_NAME);
}
@Override
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/attachment.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/attachments.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/attachment.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/attachment.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<attachments type="array">
+</attachments>
\ No newline at end of file
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/attachment.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/attachments.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/attachments.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/attachments.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<attachments type="array">
-</attachments>
\ No newline at end of file
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issue.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issues.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issue.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issue.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<issues type="array">
+</issues>
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issue.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issueCategory.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issueCategorys.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issueCategory.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issueCategory.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<issue-categories type="array">
+</issue-categories>
\ No newline at end of file
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issueCategory.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issueCategorys.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issueCategorys.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issueCategorys.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<issue-categories type="array">
-</issue-categories>
\ No newline at end of file
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issuePriority.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issuePrioritys.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issuePriority.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issuePriority.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<issue-priorities type="array"/>
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issuePriority.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issuePrioritys.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issuePrioritys.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issuePrioritys.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<issue-priorities type="array"/>
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issueStatus.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issueStatuss.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issueStatus.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issueStatus.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<issue-statuses type="array"/>
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issueStatus.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issueStatuss.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issueStatuss.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issueStatuss.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<issue-statuses type="array"/>
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issues.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issues.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issues.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<issues type="array">
-</issues>
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/news.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/newss.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/news.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/news.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<news type="array"/>
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/news.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/newss.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/newss.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/newss.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<news type="array"/>
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/project.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/projects.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/project.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/project.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<projects type="array">
+</projects>
\ No newline at end of file
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/project.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/projects.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/projects.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/projects.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<projects type="array">
-</projects>
\ No newline at end of file
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/timeEntry.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/timeEntrys.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/timeEntry.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/timeEntry.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<time-entries type="array">
+</time-entries>
\ No newline at end of file
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/timeEntry.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/timeEntrys.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/timeEntrys.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/timeEntrys.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<time-entries type="array">
-</time-entries>
\ No newline at end of file
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/tracker.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/trackers.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/tracker.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/tracker.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<trackers type="array">
+</trackers>
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/tracker.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/trackers.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/trackers.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/trackers.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<trackers type="array">
-</trackers>
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/user.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/users.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/user.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/user.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<users type="array">
+</users>
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/user.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/users.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/users.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/users.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<users type="array">
-</users>
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/version.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/versions.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/version.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/version.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<versions type="array">
+</versions>
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/version.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/versions.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/versions.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/versions.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<versions type="array">
-</versions>
Added: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/attachment.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/attachment.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/attachment.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ JRedmine :: Client
+
+ $Id: attachment.xml 277 2012-07-13 10:21:59Z tchemit $
+ $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client-api/src/test/resou… $
+ %%
+ 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%
+ -->
+
+<attachments type="array"/>
\ No newline at end of file
Added: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/issue.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/issue.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/issue.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ JRedmine :: Client
+
+ $Id: issue.xml 277 2012-07-13 10:21:59Z tchemit $
+ $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client-api/src/test/resou… $
+ %%
+ 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%
+ -->
+
+<issues type="array"/>
Added: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/issueCategory.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/issueCategory.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/issueCategory.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ JRedmine :: Client
+
+ $Id: issueCategory.xml 277 2012-07-13 10:21:59Z tchemit $
+ $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client-api/src/test/resou… $
+ %%
+ 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%
+ -->
+
+<issue-categories type="array"/>
\ No newline at end of file
Added: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/issuePriority.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/issuePriority.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/issuePriority.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ JRedmine :: Client
+
+ $Id: issuePriority.xml 277 2012-07-13 10:21:59Z tchemit $
+ $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client-api/src/test/resou… $
+ %%
+ 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%
+ -->
+
+<issue-priorities type="array"/>
Added: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/issueStatus.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/issueStatus.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/issueStatus.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ JRedmine :: Client
+
+ $Id: issueStatus.xml 277 2012-07-13 10:21:59Z tchemit $
+ $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client-api/src/test/resou… $
+ %%
+ 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%
+ -->
+
+<issue-statuses type="array"/>
Added: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/news.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/news.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/news.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ JRedmine :: Client
+
+ $Id: news.xml 277 2012-07-13 10:21:59Z tchemit $
+ $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client-api/src/test/resou… $
+ %%
+ 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%
+ -->
+
+<news type="array"/>
Added: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/project.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/project.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/project.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ JRedmine :: Client
+
+ $Id: project.xml 277 2012-07-13 10:21:59Z tchemit $
+ $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client-api/src/test/resou… $
+ %%
+ 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%
+ -->
+
+<projects type="array"/>
\ No newline at end of file
Added: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/timeEntry.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/timeEntry.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/timeEntry.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ JRedmine :: Client
+
+ $Id: timeEntry.xml 277 2012-07-13 10:21:59Z tchemit $
+ $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client-api/src/test/resou… $
+ %%
+ 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%
+ -->
+
+<time-entries type="array"/>
\ No newline at end of file
Added: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/tracker.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/tracker.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/tracker.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ JRedmine :: Client
+
+ $Id: tracker.xml 277 2012-07-13 10:21:59Z tchemit $
+ $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client-api/src/test/resou… $
+ %%
+ 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%
+ -->
+
+<trackers type="array"/>
Added: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/user.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/user.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/user.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ JRedmine :: Client
+
+ $Id: user.xml 277 2012-07-13 10:21:59Z tchemit $
+ $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client-api/src/test/resou… $
+ %%
+ 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%
+ -->
+
+<users type="array"/>
Added: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/version.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/version.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty2/version.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ JRedmine :: Client
+
+ $Id: version.xml 277 2012-07-13 10:21:59Z tchemit $
+ $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client-api/src/test/resou… $
+ %%
+ 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%
+ -->
+
+<versions type="array"/>
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/attachment.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/attachments.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/attachment.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/attachment.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<attachments type="array">
+ <attachment>
+ <author-id type="integer">4</author-id>
+ <container-id type="integer">1</container-id>
+ <id type="integer">1</id>
+ <filesize type="integer">411</filesize>
+ <downloads type="integer">0</downloads>
+
+ <created-on type="datetime">2009-09-05T12:56:41+02:00</created-on>
+
+ <container-type>Version</container-type>
+ <content-type>application/json</content-type>
+ <description></description>
+ <digest>6ea84342c7475c05fb077b4aca832f9a</digest>
+ <disk-filename>090905125641_get_issue.json</disk-filename>
+ <filename>get_issue.json</filename>
+ </attachment>
+ <attachment>
+ <author-id type="integer">4</author-id>
+ <container-id type="integer">1</container-id>
+ <id type="integer">1</id>
+ <filesize type="integer">411</filesize>
+ <downloads type="integer">0</downloads>
+
+ <created-on type="datetime">2009-09-05T12:56:41+02:00</created-on>
+
+ <container-type>Version</container-type>
+ <content-type>application/json</content-type>
+ <description></description>
+ <digest>6ea84342c7475c05fb077b4aca832f9a</digest>
+ <disk-filename>090905125641_get_issue.json2</disk-filename>
+ <filename>get_issue.json2</filename>
+ </attachment>
+</attachments>
\ No newline at end of file
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/attachment.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/attachments.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/attachments.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/attachments.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<attachments type="array">
- <attachment>
- <author-id type="integer">4</author-id>
- <container-id type="integer">1</container-id>
- <id type="integer">1</id>
- <filesize type="integer">411</filesize>
- <downloads type="integer">0</downloads>
-
- <created-on type="datetime">2009-09-05T12:56:41+02:00</created-on>
-
- <container-type>Version</container-type>
- <content-type>application/json</content-type>
- <description></description>
- <digest>6ea84342c7475c05fb077b4aca832f9a</digest>
- <disk-filename>090905125641_get_issue.json</disk-filename>
- <filename>get_issue.json</filename>
- </attachment>
- <attachment>
- <author-id type="integer">4</author-id>
- <container-id type="integer">1</container-id>
- <id type="integer">1</id>
- <filesize type="integer">411</filesize>
- <downloads type="integer">0</downloads>
-
- <created-on type="datetime">2009-09-05T12:56:41+02:00</created-on>
-
- <container-type>Version</container-type>
- <content-type>application/json</content-type>
- <description></description>
- <digest>6ea84342c7475c05fb077b4aca832f9a</digest>
- <disk-filename>090905125641_get_issue.json2</disk-filename>
- <filename>get_issue.json2</filename>
- </attachment>
-</attachments>
\ No newline at end of file
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issue.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issues.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issue.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issue.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<issues type="array">
+ <issue>
+ <assigned-to-id type="integer" nil="true"></assigned-to-id>
+ <author-id type="integer">5</author-id>
+ <category-id type="integer">2</category-id>
+ <done-ratio type="integer">0</done-ratio>
+ <lock-version type="integer">7</lock-version>
+ <priority-id type="integer">4</priority-id>
+ <project-id type="integer">1</project-id>
+ <status-id type="integer">3</status-id>
+ <tracker-id type="integer">1</tracker-id>
+ <fixed-version-id type="integer">1</fixed-version-id>
+ <id type="integer">3</id>
+ <parent-id type="integer">3</parent-id>
+ <root-id type="integer">3</root-id>
+
+ <estimated-hours type="float" nil="true"></estimated-hours>
+
+ <created-on type="datetime">2009-09-04T20:11:52+02:00</created-on>
+ <updated-on type="datetime">2009-09-06T00:37:40+02:00</updated-on>
+ <due-date type="date" nil="true"></due-date>
+ <start-date type="date">2009-09-04</start-date>
+
+ <description>avec une description !</description>
+ <subject>yes!</subject>
+ <lft type="integer">1</lft>
+ <rgt type="integer">2</rgt>
+ </issue>
+ <issue>
+ <assigned-to-id type="integer" nil="true"></assigned-to-id>
+ <author-id type="integer">5</author-id>
+ <category-id type="integer">2</category-id>
+ <done-ratio type="integer">0</done-ratio>
+ <lock-version type="integer">7</lock-version>
+ <priority-id type="integer">4</priority-id>
+ <project-id type="integer">1</project-id>
+ <status-id type="integer">3</status-id>
+ <tracker-id type="integer">1</tracker-id>
+ <fixed-version-id type="integer">1</fixed-version-id>
+ <id type="integer">4</id>
+
+ <estimated-hours type="float" nil="true"></estimated-hours>
+
+ <created-on type="datetime">2009-09-04T20:11:52+02:00</created-on>
+ <updated-on type="datetime">2009-09-06T00:37:40+02:00</updated-on>
+ <due-date type="date" nil="true"></due-date>
+ <start-date type="date">2009-09-04</start-date>
+
+ <description>avec une description !2</description>
+ <subject>yes!2</subject>
+ </issue>
+</issues>
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issue.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issueCategory.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issueCategorys.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issueCategory.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issueCategory.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<issue-categories type="array">
+ <issue-category>
+ <assigned-to-id type="integer" nil="true"/>
+ <id type="integer">1</id>
+ <name>categorie one</name>
+ <project-id type="integer">1</project-id>
+ </issue-category>
+ <issue-category>
+ <assigned-to-id type="integer" nil="true"/>
+ <id type="integer">2</id>
+ <name>categorie two</name>
+ <project-id type="integer">1</project-id>
+ </issue-category>
+</issue-categories>
\ No newline at end of file
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issueCategory.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issueCategorys.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issueCategorys.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issueCategorys.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<issue-categories type="array">
- <issue-category>
- <assigned-to-id type="integer" nil="true"/>
- <id type="integer">1</id>
- <name>categorie one</name>
- <project-id type="integer">1</project-id>
- </issue-category>
- <issue-category>
- <assigned-to-id type="integer" nil="true"/>
- <id type="integer">2</id>
- <name>categorie two</name>
- <project-id type="integer">1</project-id>
- </issue-category>
-</issue-categories>
\ No newline at end of file
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issuePriority.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issuePrioritys.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issuePriority.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issuePriority.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<issue-priorities type="array">
+ <issue-priority>
+ <id type="integer">3</id>
+ <is-default type="boolean">false</is-default>
+ <name>Bas</name>
+ <opt>IPRI</opt>
+ <position type="integer">1</position>
+ <parent-id type="integer">1</parent-id>
+ <project-id type="integer">2</project-id>
+ <active type="boolean">true</active>
+ </issue-priority>
+ <issue-priority>
+ <id type="integer">4</id>
+ <is-default type="boolean">true</is-default>
+ <name>Normal</name>
+ <opt>IPRI</opt>
+ <position type="integer">2</position>
+ </issue-priority>
+ <issue-priority>
+ <id type="integer">5</id>
+ <is-default type="boolean">false</is-default>
+ <name>Haut</name>
+ <opt>IPRI</opt>
+ <position type="integer">3</position>
+ </issue-priority>
+ <issue-priority>
+ <id type="integer">6</id>
+ <is-default type="boolean">false</is-default>
+ <name>Urgent</name>
+ <opt>IPRI</opt>
+ <position type="integer">4</position>
+ </issue-priority>
+ <issue-priority>
+ <id type="integer">7</id>
+ <is-default type="boolean">false</is-default>
+ <name>Immédiat</name>
+ <opt>IPRI</opt>
+ <position type="integer">5</position>
+ </issue-priority>
+</issue-priorities>
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issuePriority.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issuePrioritys.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issuePrioritys.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issuePrioritys.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<issue-priorities type="array">
- <issue-priority>
- <id type="integer">3</id>
- <is-default type="boolean">false</is-default>
- <name>Bas</name>
- <opt>IPRI</opt>
- <position type="integer">1</position>
- <parent-id type="integer">1</parent-id>
- <project-id type="integer">2</project-id>
- <active type="boolean">true</active>
- </issue-priority>
- <issue-priority>
- <id type="integer">4</id>
- <is-default type="boolean">true</is-default>
- <name>Normal</name>
- <opt>IPRI</opt>
- <position type="integer">2</position>
- </issue-priority>
- <issue-priority>
- <id type="integer">5</id>
- <is-default type="boolean">false</is-default>
- <name>Haut</name>
- <opt>IPRI</opt>
- <position type="integer">3</position>
- </issue-priority>
- <issue-priority>
- <id type="integer">6</id>
- <is-default type="boolean">false</is-default>
- <name>Urgent</name>
- <opt>IPRI</opt>
- <position type="integer">4</position>
- </issue-priority>
- <issue-priority>
- <id type="integer">7</id>
- <is-default type="boolean">false</is-default>
- <name>Immédiat</name>
- <opt>IPRI</opt>
- <position type="integer">5</position>
- </issue-priority>
-</issue-priorities>
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issueStatus.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issueStatuss.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issueStatus.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issueStatus.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<issue-statuses type="array">
+
+ <issue-status>
+ <id type="integer">1</id>
+ <is-closed type="boolean">false</is-closed>
+ <is-default type="boolean">true</is-default>
+ <name>Nouveau</name>
+ <position type="integer">1</position>
+ <default-done-ratio>10</default-done-ratio>
+ </issue-status>
+
+ <issue-status>
+ <id type="integer">2</id>
+ <is-closed type="boolean">false</is-closed>
+ <is-default type="boolean">false</is-default>
+ <name>Assigné</name>
+ <position type="integer">2</position>
+ </issue-status>
+
+ <issue-status>
+ <id type="integer">3</id>
+ <is-closed type="boolean">false</is-closed>
+ <is-default type="boolean">false</is-default>
+ <name>Résolu</name>
+ <position type="integer">3</position>
+ </issue-status>
+
+ <issue-status>
+ <id type="integer">4</id>
+ <is-closed type="boolean">false</is-closed>
+ <is-default type="boolean">false</is-default>
+ <name>Commentaire</name>
+ <position type="integer">4</position>
+ </issue-status>
+ <issue-status>
+ <id type="integer">5</id>
+ <is-closed type="boolean">true</is-closed>
+ <is-default type="boolean">false</is-default>
+ <name>Fermé</name>
+ <position type="integer">5</position>
+ </issue-status>
+ <issue-status>
+ <id type="integer">6</id>
+ <is-closed type="boolean">true</is-closed>
+ <is-default type="boolean">false</is-default>
+ <name>Rejeté</name>
+ <position type="integer">6</position>
+ </issue-status>
+</issue-statuses>
\ No newline at end of file
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issueStatus.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issueStatuss.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issueStatuss.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issueStatuss.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<issue-statuses type="array">
-
- <issue-status>
- <id type="integer">1</id>
- <is-closed type="boolean">false</is-closed>
- <is-default type="boolean">true</is-default>
- <name>Nouveau</name>
- <position type="integer">1</position>
- <default-done-ratio>10</default-done-ratio>
- </issue-status>
-
- <issue-status>
- <id type="integer">2</id>
- <is-closed type="boolean">false</is-closed>
- <is-default type="boolean">false</is-default>
- <name>Assigné</name>
- <position type="integer">2</position>
- </issue-status>
-
- <issue-status>
- <id type="integer">3</id>
- <is-closed type="boolean">false</is-closed>
- <is-default type="boolean">false</is-default>
- <name>Résolu</name>
- <position type="integer">3</position>
- </issue-status>
-
- <issue-status>
- <id type="integer">4</id>
- <is-closed type="boolean">false</is-closed>
- <is-default type="boolean">false</is-default>
- <name>Commentaire</name>
- <position type="integer">4</position>
- </issue-status>
- <issue-status>
- <id type="integer">5</id>
- <is-closed type="boolean">true</is-closed>
- <is-default type="boolean">false</is-default>
- <name>Fermé</name>
- <position type="integer">5</position>
- </issue-status>
- <issue-status>
- <id type="integer">6</id>
- <is-closed type="boolean">true</is-closed>
- <is-default type="boolean">false</is-default>
- <name>Rejeté</name>
- <position type="integer">6</position>
- </issue-status>
-</issue-statuses>
\ No newline at end of file
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issues.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issues.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issues.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<issues type="array">
- <issue>
- <assigned-to-id type="integer" nil="true"></assigned-to-id>
- <author-id type="integer">5</author-id>
- <category-id type="integer">2</category-id>
- <done-ratio type="integer">0</done-ratio>
- <lock-version type="integer">7</lock-version>
- <priority-id type="integer">4</priority-id>
- <project-id type="integer">1</project-id>
- <status-id type="integer">3</status-id>
- <tracker-id type="integer">1</tracker-id>
- <fixed-version-id type="integer">1</fixed-version-id>
- <id type="integer">3</id>
- <parent-id type="integer">3</parent-id>
- <root-id type="integer">3</root-id>
-
- <estimated-hours type="float" nil="true"></estimated-hours>
-
- <created-on type="datetime">2009-09-04T20:11:52+02:00</created-on>
- <updated-on type="datetime">2009-09-06T00:37:40+02:00</updated-on>
- <due-date type="date" nil="true"></due-date>
- <start-date type="date">2009-09-04</start-date>
-
- <description>avec une description !</description>
- <subject>yes!</subject>
- <lft type="integer">1</lft>
- <rgt type="integer">2</rgt>
- </issue>
- <issue>
- <assigned-to-id type="integer" nil="true"></assigned-to-id>
- <author-id type="integer">5</author-id>
- <category-id type="integer">2</category-id>
- <done-ratio type="integer">0</done-ratio>
- <lock-version type="integer">7</lock-version>
- <priority-id type="integer">4</priority-id>
- <project-id type="integer">1</project-id>
- <status-id type="integer">3</status-id>
- <tracker-id type="integer">1</tracker-id>
- <fixed-version-id type="integer">1</fixed-version-id>
- <id type="integer">4</id>
-
- <estimated-hours type="float" nil="true"></estimated-hours>
-
- <created-on type="datetime">2009-09-04T20:11:52+02:00</created-on>
- <updated-on type="datetime">2009-09-06T00:37:40+02:00</updated-on>
- <due-date type="date" nil="true"></due-date>
- <start-date type="date">2009-09-04</start-date>
-
- <description>avec une description !2</description>
- <subject>yes!2</subject>
- </issue>
-</issues>
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/news.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/newss.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/news.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/news.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<news type="array">
+ <news>
+ <author-id type="integer">4</author-id>
+ <comments-count type="integer">0</comments-count>
+ <created-on type="datetime">2009-09-17T21:50:26+02:00</created-on>
+ <description>description</description>
+ <id type="integer">85</id>
+ <project-id type="integer">1</project-id>
+ <summary>summary</summary>
+ <title>title</title>
+ </news>
+ <news>
+ <author-id type="integer">4</author-id>
+ <comments-count type="integer">0</comments-count>
+ <created-on type="datetime">2009-09-17T21:55:26+02:00</created-on>
+ <description>description2</description>
+ <id type="integer">86</id>
+ <project-id type="integer">1</project-id>
+ <summary>summary2</summary>
+ <title>title2</title>
+ </news>
+</news>
\ No newline at end of file
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/news.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/newss.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/newss.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/newss.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<news type="array">
- <news>
- <author-id type="integer">4</author-id>
- <comments-count type="integer">0</comments-count>
- <created-on type="datetime">2009-09-17T21:50:26+02:00</created-on>
- <description>description</description>
- <id type="integer">85</id>
- <project-id type="integer">1</project-id>
- <summary>summary</summary>
- <title>title</title>
- </news>
- <news>
- <author-id type="integer">4</author-id>
- <comments-count type="integer">0</comments-count>
- <created-on type="datetime">2009-09-17T21:55:26+02:00</created-on>
- <description>description2</description>
- <id type="integer">86</id>
- <project-id type="integer">1</project-id>
- <summary>summary2</summary>
- <title>title2</title>
- </news>
-</news>
\ No newline at end of file
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/project.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/projects.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/project.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/project.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<projects type="array">
+ <project>
+ <created-on type="datetime">2009-09-04T18:11:54+02:00</created-on>
+ <description/>
+ <homepage/>
+ <id type="integer">1</id>
+ <identifier>one</identifier>
+ <is-public type="boolean">true</is-public>
+ <name>one</name>
+ <parent-id type="integer" nil="true"/>
+ <lft type="integer">1</lft>
+ <rgt type="integer">2</rgt>
+ <projects-count type="integer">0</projects-count>
+ <status type="integer">1</status>
+ <updated-on type="datetime">2009-09-04T18:11:54+02:00</updated-on>
+ </project>
+ <project>
+ <created-on type="datetime">2009-09-05T16:22:14+02:00</created-on>
+ <description/>
+ <homepage/>
+ <id type="integer">2</id>
+ <identifier>two</identifier>
+ <is-public type="boolean">false</is-public>
+ <name>two</name>
+ <parent-id type="integer" nil="true"/>
+ <projects-count type="integer">0</projects-count>
+ <status type="integer">1</status>
+ <updated-on type="datetime">2009-09-05T16:22:29+02:00</updated-on>
+ </project>
+</projects>
\ No newline at end of file
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/project.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/projects.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/projects.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/projects.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<projects type="array">
- <project>
- <created-on type="datetime">2009-09-04T18:11:54+02:00</created-on>
- <description/>
- <homepage/>
- <id type="integer">1</id>
- <identifier>one</identifier>
- <is-public type="boolean">true</is-public>
- <name>one</name>
- <parent-id type="integer" nil="true"/>
- <lft type="integer">1</lft>
- <rgt type="integer">2</rgt>
- <projects-count type="integer">0</projects-count>
- <status type="integer">1</status>
- <updated-on type="datetime">2009-09-04T18:11:54+02:00</updated-on>
- </project>
- <project>
- <created-on type="datetime">2009-09-05T16:22:14+02:00</created-on>
- <description/>
- <homepage/>
- <id type="integer">2</id>
- <identifier>two</identifier>
- <is-public type="boolean">false</is-public>
- <name>two</name>
- <parent-id type="integer" nil="true"/>
- <projects-count type="integer">0</projects-count>
- <status type="integer">1</status>
- <updated-on type="datetime">2009-09-05T16:22:29+02:00</updated-on>
- </project>
-</projects>
\ No newline at end of file
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/timeEntry.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/timeEntrys.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/timeEntry.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/timeEntry.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<time-entries type="array">
+ <time-entry>
+ <activity-id type="integer">8</activity-id>
+ <comments>Test</comments>
+ <created-on type="datetime">2009-12-31T23:02:02+01:00</created-on>
+ <hours type="float">1.0</hours>
+ <id type="integer">1</id>
+ <issue-id type="integer">6</issue-id>
+ <project-id type="integer">1</project-id>
+ <spent-on type="date">2009-12-31</spent-on>
+ <tmonth type="integer">12</tmonth>
+ <tweek type="integer">53</tweek>
+ <tyear type="integer">2009</tyear>
+ <updated-on type="datetime">2009-12-31T23:02:02+01:00</updated-on>
+ <user-id type="integer">4</user-id>
+ </time-entry>
+ <time-entry>
+ <activity-id type="integer">9</activity-id>
+ <comments>deuxième temps</comments>
+ <created-on type="datetime">2009-12-31T23:10:01+01:00</created-on>
+ <hours type="float">2.0</hours>
+ <id type="integer">2</id>
+ <issue-id type="integer">6</issue-id>
+ <project-id type="integer">1</project-id>
+ <spent-on type="date">2009-12-31</spent-on>
+ <tmonth type="integer">12</tmonth>
+ <tweek type="integer">53</tweek>
+ <tyear type="integer">2009</tyear>
+ <updated-on type="datetime">2009-12-31T23:10:01+01:00</updated-on>
+ <user-id type="integer">4</user-id>
+ </time-entry>
+</time-entries>
\ No newline at end of file
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/timeEntry.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/timeEntrys.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/timeEntrys.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/timeEntrys.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<time-entries type="array">
- <time-entry>
- <activity-id type="integer">8</activity-id>
- <comments>Test</comments>
- <created-on type="datetime">2009-12-31T23:02:02+01:00</created-on>
- <hours type="float">1.0</hours>
- <id type="integer">1</id>
- <issue-id type="integer">6</issue-id>
- <project-id type="integer">1</project-id>
- <spent-on type="date">2009-12-31</spent-on>
- <tmonth type="integer">12</tmonth>
- <tweek type="integer">53</tweek>
- <tyear type="integer">2009</tyear>
- <updated-on type="datetime">2009-12-31T23:02:02+01:00</updated-on>
- <user-id type="integer">4</user-id>
- </time-entry>
- <time-entry>
- <activity-id type="integer">9</activity-id>
- <comments>deuxième temps</comments>
- <created-on type="datetime">2009-12-31T23:10:01+01:00</created-on>
- <hours type="float">2.0</hours>
- <id type="integer">2</id>
- <issue-id type="integer">6</issue-id>
- <project-id type="integer">1</project-id>
- <spent-on type="date">2009-12-31</spent-on>
- <tmonth type="integer">12</tmonth>
- <tweek type="integer">53</tweek>
- <tyear type="integer">2009</tyear>
- <updated-on type="datetime">2009-12-31T23:10:01+01:00</updated-on>
- <user-id type="integer">4</user-id>
- </time-entry>
-</time-entries>
\ No newline at end of file
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/tracker.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/trackers.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/tracker.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/tracker.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<trackers type="array">
+ <tracker>
+ <id type="integer">1</id>
+ <project-id type="NilClass">1</project-id>
+ <tracker-id type="NilClass">1</tracker-id>
+ <position type="integer">1</position>
+
+ <is-in-chlog type="boolean">true</is-in-chlog>
+ <is-in-roadmap type="boolean">false</is-in-roadmap>
+
+ <name>Anomalie</name>
+ </tracker>
+ <tracker>
+ <id type="integer">2</id>
+ <is-in-chlog type="boolean">true</is-in-chlog>
+ <is-in-roadmap type="boolean">true</is-in-roadmap>
+ <name>Evolution</name>
+ <position type="integer">2</position>
+ <project-id type="NilClass">1</project-id>
+ <tracker-id type="NilClass">2</tracker-id>
+ </tracker>
+ <tracker>
+ <id type="integer">3</id>
+ <is-in-chlog type="boolean">false</is-in-chlog>
+ <is-in-roadmap type="boolean">false</is-in-roadmap>
+ <name>Assistance</name>
+ <position type="integer">3</position>
+ <project-id type="NilClass">1</project-id>
+ <tracker-id type="NilClass">3</tracker-id>
+ </tracker>
+</trackers>
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/tracker.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/trackers.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/trackers.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/trackers.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<trackers type="array">
- <tracker>
- <id type="integer">1</id>
- <project-id type="NilClass">1</project-id>
- <tracker-id type="NilClass">1</tracker-id>
- <position type="integer">1</position>
-
- <is-in-chlog type="boolean">true</is-in-chlog>
- <is-in-roadmap type="boolean">false</is-in-roadmap>
-
- <name>Anomalie</name>
- </tracker>
- <tracker>
- <id type="integer">2</id>
- <is-in-chlog type="boolean">true</is-in-chlog>
- <is-in-roadmap type="boolean">true</is-in-roadmap>
- <name>Evolution</name>
- <position type="integer">2</position>
- <project-id type="NilClass">1</project-id>
- <tracker-id type="NilClass">2</tracker-id>
- </tracker>
- <tracker>
- <id type="integer">3</id>
- <is-in-chlog type="boolean">false</is-in-chlog>
- <is-in-roadmap type="boolean">false</is-in-roadmap>
- <name>Assistance</name>
- <position type="integer">3</position>
- <project-id type="NilClass">1</project-id>
- <tracker-id type="NilClass">3</tracker-id>
- </tracker>
-</trackers>
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/user.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/users.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/user.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/user.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<users type="array">
+ <user>
+ <created-on type="datetime">2009-09-04T17:24:46+02:00</created-on>
+ <updated-on type="datetime">2009-09-06T01:23:59+02:00</updated-on>
+ <last-login-on type="datetime">2009-09-06T01:23:59+02:00</last-login-on>
+
+ <id type="integer">1</id>
+ <auth-source-id type="integer" nil="true"></auth-source-id>
+ <member-id type="NilClass">5</member-id>
+ <role-id type="NilClass">3</role-id>
+ <status type="integer">1</status>
+
+ <admin type="boolean">true</admin>
+ <mail-notification type="boolean">true</mail-notification>
+
+ <firstname>Redmine</firstname>
+ <hashed-password>70c881d4a26984ddce795f6f71817c9cf4480e79</hashed-password>
+ <language>fr</language>
+ <lastname>Admin</lastname>
+ <login>admin</login>
+ <mail>dummy(a)codelutin.com</mail>
+ <identity-url>yo</identity-url>
+ </user>
+ <user>
+ <admin type="boolean">true</admin>
+ <auth-source-id type="integer" nil="true"></auth-source-id>
+ <created-on type="datetime">2009-09-04T19:49:02+02:00</created-on>
+ <firstname>tony</firstname>
+ <hashed-password>8aed1322e5450badb078e1fb60a817a1df25a2ca</hashed-password>
+ <id type="integer">5</id>
+ <language>fr</language>
+ <last-login-on type="datetime">2009-09-04T19:49:38+02:00</last-login-on>
+ <lastname>chemit2</lastname>
+ <login>tchemit2</login>
+ <mail>chemit(a)codelutin.com</mail>
+ <mail-notification type="boolean">false</mail-notification>
+ <member-id type="NilClass">4</member-id>
+ <role-id type="NilClass">3</role-id>
+ <status type="integer">1</status>
+ <updated-on type="datetime">2009-09-04T19:49:38+02:00</updated-on>
+ </user>
+ <user>
+ <admin type="boolean">false</admin>
+ <auth-source-id type="integer" nil="true"></auth-source-id>
+ <created-on type="datetime">2009-09-05T16:24:11+02:00</created-on>
+ <firstname>dev</firstname>
+ <hashed-password>70c881d4a26984ddce795f6f71817c9cf4480e79</hashed-password>
+ <id type="integer">7</id>
+ <language>fr</language>
+ <last-login-on type="datetime">2009-09-06T16:34:39+02:00</last-login-on>
+ <lastname>dev</lastname>
+ <login>dev</login>
+ <mail>dev3(a)ynot-home.info</mail>
+ <mail-notification type="boolean">false</mail-notification>
+ <member-id type="NilClass">9</member-id>
+ <role-id type="NilClass">4</role-id>
+ <status type="integer">1</status>
+ <updated-on type="datetime">2009-09-06T16:34:39+02:00</updated-on>
+ </user>
+</users>
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/user.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/users.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/users.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/users.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,86 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<users type="array">
- <user>
- <created-on type="datetime">2009-09-04T17:24:46+02:00</created-on>
- <updated-on type="datetime">2009-09-06T01:23:59+02:00</updated-on>
- <last-login-on type="datetime">2009-09-06T01:23:59+02:00</last-login-on>
-
- <id type="integer">1</id>
- <auth-source-id type="integer" nil="true"></auth-source-id>
- <member-id type="NilClass">5</member-id>
- <role-id type="NilClass">3</role-id>
- <status type="integer">1</status>
-
- <admin type="boolean">true</admin>
- <mail-notification type="boolean">true</mail-notification>
-
- <firstname>Redmine</firstname>
- <hashed-password>70c881d4a26984ddce795f6f71817c9cf4480e79</hashed-password>
- <language>fr</language>
- <lastname>Admin</lastname>
- <login>admin</login>
- <mail>dummy(a)codelutin.com</mail>
- <identity-url>yo</identity-url>
- </user>
- <user>
- <admin type="boolean">true</admin>
- <auth-source-id type="integer" nil="true"></auth-source-id>
- <created-on type="datetime">2009-09-04T19:49:02+02:00</created-on>
- <firstname>tony</firstname>
- <hashed-password>8aed1322e5450badb078e1fb60a817a1df25a2ca</hashed-password>
- <id type="integer">5</id>
- <language>fr</language>
- <last-login-on type="datetime">2009-09-04T19:49:38+02:00</last-login-on>
- <lastname>chemit2</lastname>
- <login>tchemit2</login>
- <mail>chemit(a)codelutin.com</mail>
- <mail-notification type="boolean">false</mail-notification>
- <member-id type="NilClass">4</member-id>
- <role-id type="NilClass">3</role-id>
- <status type="integer">1</status>
- <updated-on type="datetime">2009-09-04T19:49:38+02:00</updated-on>
- </user>
- <user>
- <admin type="boolean">false</admin>
- <auth-source-id type="integer" nil="true"></auth-source-id>
- <created-on type="datetime">2009-09-05T16:24:11+02:00</created-on>
- <firstname>dev</firstname>
- <hashed-password>70c881d4a26984ddce795f6f71817c9cf4480e79</hashed-password>
- <id type="integer">7</id>
- <language>fr</language>
- <last-login-on type="datetime">2009-09-06T16:34:39+02:00</last-login-on>
- <lastname>dev</lastname>
- <login>dev</login>
- <mail>dev3(a)ynot-home.info</mail>
- <mail-notification type="boolean">false</mail-notification>
- <member-id type="NilClass">9</member-id>
- <role-id type="NilClass">4</role-id>
- <status type="integer">1</status>
- <updated-on type="datetime">2009-09-06T16:34:39+02:00</updated-on>
- </user>
-</users>
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/version.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/versions.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/version.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/version.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<versions type="array">
+ <version>
+ <created-on type="datetime">2009-09-06T02:47:39+02:00</created-on>
+ <description>yo</description>
+ <effective-date type="date" nil="true"></effective-date>
+ <id type="integer">9</id>
+ <name>yor</name>
+ <project-id type="integer">1</project-id>
+ <updated-on type="datetime">2009-09-06T02:50:49+02:00</updated-on>
+ <wiki-page-title nil="true"></wiki-page-title>
+ <sharing>none</sharing>
+ <status>open</status>
+ </version>
+ <version>
+ <created-on type="datetime">2009-09-06T03:05:09+02:00</created-on>
+ <description>ysssoye</description>
+ <effective-date type="date" nil="true"></effective-date>
+ <id type="integer">13</id>
+ <name>rrrrrrrrrouuuuuua</name>
+ <project-id type="integer">1</project-id>
+ <updated-on type="datetime">2009-09-06T03:05:09+02:00</updated-on>
+ <wiki-page-title nil="true"></wiki-page-title>
+ </version>
+ <version>
+ <created-on type="datetime">2009-09-06T03:07:58+02:00</created-on>
+ <description>ysssoye</description>
+ <effective-date type="date" nil="true"></effective-date>
+ <id type="integer">15</id>
+ <name>aaaauuuuuua</name>
+ <project-id type="integer">1</project-id>
+ <updated-on type="datetime">2009-09-06T03:07:58+02:00</updated-on>
+ <wiki-page-title nil="true"></wiki-page-title>
+ </version>
+ <version>
+ <created-on type="datetime">2009-09-06T04:12:25+02:00</created-on>
+ <description>ysssoyeppppppppppppppppp</description>
+ <effective-date type="date" nil="true"></effective-date>
+ <id type="integer">16</id>
+ <name>aaaau</name>
+ <project-id type="integer">1</project-id>
+ <updated-on type="datetime">2009-09-06T04:13:20+02:00</updated-on>
+ <wiki-page-title nil="true"></wiki-page-title>
+ </version>
+ <version>
+ <created-on type="datetime">2009-09-06T03:05:40+02:00</created-on>
+ <description>ysssoye</description>
+ <effective-date type="date" nil="true"></effective-date>
+ <id type="integer">14</id>
+ <name>aaaaaaaaaarrrrrrrrrouuuuuua</name>
+ <project-id type="integer">1</project-id>
+ <updated-on type="datetime">2009-09-06T03:05:40+02:00</updated-on>
+ <wiki-page-title nil="true"></wiki-page-title>
+ </version>
+ <version>
+ <created-on type="datetime">2009-09-05T00:39:15+02:00</created-on>
+ <description></description>
+ <effective-date type="date" nil="true"></effective-date>
+ <id type="integer">5</id>
+ <name>2</name>
+ <project-id type="integer">1</project-id>
+ <updated-on type="datetime">2009-09-05T00:39:15+02:00</updated-on>
+ <wiki-page-title nil="true"></wiki-page-title>
+ </version>
+ <version>
+ <created-on type="datetime">2009-09-04T18:13:05+02:00</created-on>
+ <description></description>
+ <effective-date type="date" nil="true"></effective-date>
+ <id type="integer">1</id>
+ <name>1.0.0</name>
+ <project-id type="integer">1</project-id>
+ <updated-on type="datetime">2009-09-04T18:13:05+02:00</updated-on>
+ <wiki-page-title nil="true"></wiki-page-title>
+ </version>
+ <version>
+ <created-on type="datetime">2009-09-06T03:00:12+02:00</created-on>
+ <description>yoye</description>
+ <effective-date type="date">2009-09-06</effective-date>
+ <id type="integer">11</id>
+ <name>yaouuuuuua</name>
+ <project-id type="integer">1</project-id>
+ <updated-on type="datetime">2009-09-06T03:00:12+02:00</updated-on>
+ <wiki-page-title nil="true"></wiki-page-title>
+ </version>
+ <version>
+ <created-on type="datetime">2009-09-06T02:50:59+02:00</created-on>
+ <description>yoye</description>
+ <effective-date type="date">2009-09-06</effective-date>
+ <id type="integer">10</id>
+ <name>ya</name>
+ <project-id type="integer">1</project-id>
+ <updated-on type="datetime">2009-09-06T02:54:16+02:00</updated-on>
+ <wiki-page-title nil="true"></wiki-page-title>
+ </version>
+ <version>
+ <created-on type="datetime">2009-09-06T03:00:37+02:00</created-on>
+ <description>ysssoye</description>
+ <effective-date type="date">2009-09-06</effective-date>
+ <id type="integer">12</id>
+ <name>ouuuuuua</name>
+ <project-id type="integer">1</project-id>
+ <updated-on type="datetime">2009-09-06T03:00:42+02:00</updated-on>
+ <wiki-page-title nil="true"></wiki-page-title>
+ </version>
+</versions>
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/version.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/versions.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/versions.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/versions.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,130 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<versions type="array">
- <version>
- <created-on type="datetime">2009-09-06T02:47:39+02:00</created-on>
- <description>yo</description>
- <effective-date type="date" nil="true"></effective-date>
- <id type="integer">9</id>
- <name>yor</name>
- <project-id type="integer">1</project-id>
- <updated-on type="datetime">2009-09-06T02:50:49+02:00</updated-on>
- <wiki-page-title nil="true"></wiki-page-title>
- <sharing>none</sharing>
- <status>open</status>
- </version>
- <version>
- <created-on type="datetime">2009-09-06T03:05:09+02:00</created-on>
- <description>ysssoye</description>
- <effective-date type="date" nil="true"></effective-date>
- <id type="integer">13</id>
- <name>rrrrrrrrrouuuuuua</name>
- <project-id type="integer">1</project-id>
- <updated-on type="datetime">2009-09-06T03:05:09+02:00</updated-on>
- <wiki-page-title nil="true"></wiki-page-title>
- </version>
- <version>
- <created-on type="datetime">2009-09-06T03:07:58+02:00</created-on>
- <description>ysssoye</description>
- <effective-date type="date" nil="true"></effective-date>
- <id type="integer">15</id>
- <name>aaaauuuuuua</name>
- <project-id type="integer">1</project-id>
- <updated-on type="datetime">2009-09-06T03:07:58+02:00</updated-on>
- <wiki-page-title nil="true"></wiki-page-title>
- </version>
- <version>
- <created-on type="datetime">2009-09-06T04:12:25+02:00</created-on>
- <description>ysssoyeppppppppppppppppp</description>
- <effective-date type="date" nil="true"></effective-date>
- <id type="integer">16</id>
- <name>aaaau</name>
- <project-id type="integer">1</project-id>
- <updated-on type="datetime">2009-09-06T04:13:20+02:00</updated-on>
- <wiki-page-title nil="true"></wiki-page-title>
- </version>
- <version>
- <created-on type="datetime">2009-09-06T03:05:40+02:00</created-on>
- <description>ysssoye</description>
- <effective-date type="date" nil="true"></effective-date>
- <id type="integer">14</id>
- <name>aaaaaaaaaarrrrrrrrrouuuuuua</name>
- <project-id type="integer">1</project-id>
- <updated-on type="datetime">2009-09-06T03:05:40+02:00</updated-on>
- <wiki-page-title nil="true"></wiki-page-title>
- </version>
- <version>
- <created-on type="datetime">2009-09-05T00:39:15+02:00</created-on>
- <description></description>
- <effective-date type="date" nil="true"></effective-date>
- <id type="integer">5</id>
- <name>2</name>
- <project-id type="integer">1</project-id>
- <updated-on type="datetime">2009-09-05T00:39:15+02:00</updated-on>
- <wiki-page-title nil="true"></wiki-page-title>
- </version>
- <version>
- <created-on type="datetime">2009-09-04T18:13:05+02:00</created-on>
- <description></description>
- <effective-date type="date" nil="true"></effective-date>
- <id type="integer">1</id>
- <name>1.0.0</name>
- <project-id type="integer">1</project-id>
- <updated-on type="datetime">2009-09-04T18:13:05+02:00</updated-on>
- <wiki-page-title nil="true"></wiki-page-title>
- </version>
- <version>
- <created-on type="datetime">2009-09-06T03:00:12+02:00</created-on>
- <description>yoye</description>
- <effective-date type="date">2009-09-06</effective-date>
- <id type="integer">11</id>
- <name>yaouuuuuua</name>
- <project-id type="integer">1</project-id>
- <updated-on type="datetime">2009-09-06T03:00:12+02:00</updated-on>
- <wiki-page-title nil="true"></wiki-page-title>
- </version>
- <version>
- <created-on type="datetime">2009-09-06T02:50:59+02:00</created-on>
- <description>yoye</description>
- <effective-date type="date">2009-09-06</effective-date>
- <id type="integer">10</id>
- <name>ya</name>
- <project-id type="integer">1</project-id>
- <updated-on type="datetime">2009-09-06T02:54:16+02:00</updated-on>
- <wiki-page-title nil="true"></wiki-page-title>
- </version>
- <version>
- <created-on type="datetime">2009-09-06T03:00:37+02:00</created-on>
- <description>ysssoye</description>
- <effective-date type="date">2009-09-06</effective-date>
- <id type="integer">12</id>
- <name>ouuuuuua</name>
- <project-id type="integer">1</project-id>
- <updated-on type="datetime">2009-09-06T03:00:42+02:00</updated-on>
- <wiki-page-title nil="true"></wiki-page-title>
- </version>
-</versions>
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/attachment.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/attachments.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/attachment.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/attachment.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<attachments type="array">
+ <attachment>
+ <author-id type="integer">4</author-id>
+ <container-id type="integer">1</container-id>
+ <id type="integer">1</id>
+ <filesize type="integer">411</filesize>
+ <downloads type="integer">0</downloads>
+
+ <created-on type="datetime">2009-09-05T12:56:41+02:00</created-on>
+
+ <container-type>Version</container-type>
+ <content-type>application/json</content-type>
+ <description></description>
+ <digest>6ea84342c7475c05fb077b4aca832f9a</digest>
+ <disk-filename>090905125641_get_issue.json</disk-filename>
+ <filename>get_issue.json</filename>
+ </attachment>
+</attachments>
\ No newline at end of file
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/attachment.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/attachments.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/attachments.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/attachments.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<attachments type="array">
- <attachment>
- <author-id type="integer">4</author-id>
- <container-id type="integer">1</container-id>
- <id type="integer">1</id>
- <filesize type="integer">411</filesize>
- <downloads type="integer">0</downloads>
-
- <created-on type="datetime">2009-09-05T12:56:41+02:00</created-on>
-
- <container-type>Version</container-type>
- <content-type>application/json</content-type>
- <description></description>
- <digest>6ea84342c7475c05fb077b4aca832f9a</digest>
- <disk-filename>090905125641_get_issue.json</disk-filename>
- <filename>get_issue.json</filename>
- </attachment>
-</attachments>
\ No newline at end of file
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issue.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issues.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issue.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issue.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<issues type="array">
+ <issue>
+ <assigned-to-id type="integer" nil="true"></assigned-to-id>
+ <author-id type="integer">5</author-id>
+ <category-id type="integer">2</category-id>
+ <done-ratio type="integer">0</done-ratio>
+ <lock-version type="integer">7</lock-version>
+ <priority-id type="integer">4</priority-id>
+ <project-id type="integer">1</project-id>
+ <status-id type="integer">3</status-id>
+ <tracker-id type="integer">1</tracker-id>
+ <fixed-version-id type="integer">1</fixed-version-id>
+ <id type="integer">3</id>
+ <parent-id type="integer">3</parent-id>
+ <root-id type="integer">3</root-id>
+
+ <estimated-hours type="float" nil="true"></estimated-hours>
+
+ <created-on type="datetime">2009-09-04T20:11:52+02:00</created-on>
+ <updated-on type="datetime">2009-09-06T00:37:40+02:00</updated-on>
+ <due-date type="date" nil="true"></due-date>
+ <start-date type="date">2009-09-04</start-date>
+
+ <description>avec une description !</description>
+ <subject>yes!</subject>
+ <lft type="integer">1</lft>
+ <rgt type="integer">2</rgt>
+ </issue>
+</issues>
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issue.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issueCategory.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issueCategorys.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issueCategory.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issueCategory.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<issue-categories type="array">
+ <issue-category>
+ <assigned-to-id type="integer" nil="true"/>
+ <id type="integer">1</id>
+ <name>categorie one</name>
+ <project-id type="integer">1</project-id>
+ </issue-category>
+</issue-categories>
\ No newline at end of file
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issueCategory.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issueCategorys.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issueCategorys.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issueCategorys.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<issue-categories type="array">
- <issue-category>
- <assigned-to-id type="integer" nil="true"/>
- <id type="integer">1</id>
- <name>categorie one</name>
- <project-id type="integer">1</project-id>
- </issue-category>
-</issue-categories>
\ No newline at end of file
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issuePriority.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issuePrioritys.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issuePriority.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issuePriority.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<issue-priorities type="array">
+ <issue-priority>
+ <id type="integer">3</id>
+ <is-default type="boolean">false</is-default>
+ <name>Bas</name>
+ <opt>IPRI</opt>
+ <position type="integer">1</position>
+ <active type="boolean">true</active>
+ <parent-id type="integer">1</parent-id>
+ <project-id type="integer">2</project-id>
+ </issue-priority>
+</issue-priorities>
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issuePriority.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issuePrioritys.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issuePrioritys.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issuePrioritys.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<issue-priorities type="array">
- <issue-priority>
- <id type="integer">3</id>
- <is-default type="boolean">false</is-default>
- <name>Bas</name>
- <opt>IPRI</opt>
- <position type="integer">1</position>
- <active type="boolean">true</active>
- <parent-id type="integer">1</parent-id>
- <project-id type="integer">2</project-id>
- </issue-priority>
-</issue-priorities>
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issueStatus.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issueStatuss.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issueStatus.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issueStatus.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<issue-statuses type="array">
+
+ <issue-status>
+ <id type="integer">1</id>
+ <is-closed type="boolean">false</is-closed>
+ <is-default type="boolean">true</is-default>
+ <name>Nouveau</name>
+ <position type="integer">1</position>
+ <default-done-ratio>10</default-done-ratio>
+ </issue-status>
+
+</issue-statuses>
\ No newline at end of file
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issueStatus.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issueStatuss.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issueStatuss.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issueStatuss.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<issue-statuses type="array">
-
- <issue-status>
- <id type="integer">1</id>
- <is-closed type="boolean">false</is-closed>
- <is-default type="boolean">true</is-default>
- <name>Nouveau</name>
- <position type="integer">1</position>
- <default-done-ratio>10</default-done-ratio>
- </issue-status>
-
-</issue-statuses>
\ No newline at end of file
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issues.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issues.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issues.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<issues type="array">
- <issue>
- <assigned-to-id type="integer" nil="true"></assigned-to-id>
- <author-id type="integer">5</author-id>
- <category-id type="integer">2</category-id>
- <done-ratio type="integer">0</done-ratio>
- <lock-version type="integer">7</lock-version>
- <priority-id type="integer">4</priority-id>
- <project-id type="integer">1</project-id>
- <status-id type="integer">3</status-id>
- <tracker-id type="integer">1</tracker-id>
- <fixed-version-id type="integer">1</fixed-version-id>
- <id type="integer">3</id>
- <parent-id type="integer">3</parent-id>
- <root-id type="integer">3</root-id>
-
- <estimated-hours type="float" nil="true"></estimated-hours>
-
- <created-on type="datetime">2009-09-04T20:11:52+02:00</created-on>
- <updated-on type="datetime">2009-09-06T00:37:40+02:00</updated-on>
- <due-date type="date" nil="true"></due-date>
- <start-date type="date">2009-09-04</start-date>
-
- <description>avec une description !</description>
- <subject>yes!</subject>
- <lft type="integer">1</lft>
- <rgt type="integer">2</rgt>
- </issue>
-</issues>
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/news.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/newss.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/news.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/news.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<news type="array">
+ <news>
+ <author-id type="integer">4</author-id>
+ <comments-count type="integer">0</comments-count>
+ <created-on type="datetime">2009-09-17T21:50:26+02:00</created-on>
+ <description>description</description>
+ <id type="integer">85</id>
+ <project-id type="integer">1</project-id>
+ <summary>summary</summary>
+ <title>title</title>
+ </news>
+</news>
\ No newline at end of file
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/news.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/newss.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/newss.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/newss.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<news type="array">
- <news>
- <author-id type="integer">4</author-id>
- <comments-count type="integer">0</comments-count>
- <created-on type="datetime">2009-09-17T21:50:26+02:00</created-on>
- <description>description</description>
- <id type="integer">85</id>
- <project-id type="integer">1</project-id>
- <summary>summary</summary>
- <title>title</title>
- </news>
-</news>
\ No newline at end of file
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/project.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/projects.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/project.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/project.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<projects type="array">
+ <project>
+ <created-on type="datetime">2009-09-04T18:11:54+02:00</created-on>
+ <updated-on type="datetime">2009-09-04T18:11:54+02:00</updated-on>
+
+ <description></description>
+ <homepage></homepage>
+ <identifier>one</identifier>
+ <name>one</name>
+
+ <id type="integer">1</id>
+ <parent-id type="integer" nil="true"></parent-id>
+ <lft type="integer">1</lft>
+ <rgt type="integer">2</rgt>
+ <projects-count type="integer">0</projects-count>
+ <status type="integer">1</status>
+
+ <is-public type="boolean">true</is-public>
+ </project>
+</projects>
\ No newline at end of file
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/project.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/projects.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/projects.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/projects.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<projects type="array">
- <project>
- <created-on type="datetime">2009-09-04T18:11:54+02:00</created-on>
- <updated-on type="datetime">2009-09-04T18:11:54+02:00</updated-on>
-
- <description></description>
- <homepage></homepage>
- <identifier>one</identifier>
- <name>one</name>
-
- <id type="integer">1</id>
- <parent-id type="integer" nil="true"></parent-id>
- <lft type="integer">1</lft>
- <rgt type="integer">2</rgt>
- <projects-count type="integer">0</projects-count>
- <status type="integer">1</status>
-
- <is-public type="boolean">true</is-public>
- </project>
-</projects>
\ No newline at end of file
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/timeEntry.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/timeEntrys.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/timeEntry.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/timeEntry.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<time-entries type="array">
+ <time-entry>
+ <activity-id type="integer">8</activity-id>
+ <comments>Test</comments>
+ <created-on type="datetime">2009-12-31T23:02:02+01:00</created-on>
+ <hours type="float">1.0</hours>
+ <id type="integer">1</id>
+ <issue-id type="integer">6</issue-id>
+ <project-id type="integer">1</project-id>
+ <spent-on type="date">2009-12-31</spent-on>
+ <tmonth type="integer">12</tmonth>
+ <tweek type="integer">53</tweek>
+ <tyear type="integer">2009</tyear>
+ <updated-on type="datetime">2009-12-31T23:02:02+01:00</updated-on>
+ <user-id type="integer">4</user-id>
+ </time-entry>
+</time-entries>
\ No newline at end of file
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/timeEntry.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/timeEntrys.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/timeEntrys.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/timeEntrys.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<time-entries type="array">
- <time-entry>
- <activity-id type="integer">8</activity-id>
- <comments>Test</comments>
- <created-on type="datetime">2009-12-31T23:02:02+01:00</created-on>
- <hours type="float">1.0</hours>
- <id type="integer">1</id>
- <issue-id type="integer">6</issue-id>
- <project-id type="integer">1</project-id>
- <spent-on type="date">2009-12-31</spent-on>
- <tmonth type="integer">12</tmonth>
- <tweek type="integer">53</tweek>
- <tyear type="integer">2009</tyear>
- <updated-on type="datetime">2009-12-31T23:02:02+01:00</updated-on>
- <user-id type="integer">4</user-id>
- </time-entry>
-</time-entries>
\ No newline at end of file
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/tracker.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/trackers.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/tracker.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/tracker.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<trackers type="array">
+ <tracker>
+ <id type="integer">1</id>
+ <project-id type="NilClass">1</project-id>
+ <tracker-id type="NilClass">1</tracker-id>
+ <position type="integer">1</position>
+
+ <is-in-chlog type="boolean">true</is-in-chlog>
+ <is-in-roadmap type="boolean">false</is-in-roadmap>
+
+ <name>Anomalie</name>
+ </tracker>
+</trackers>
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/tracker.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/trackers.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/trackers.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/trackers.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<trackers type="array">
- <tracker>
- <id type="integer">1</id>
- <project-id type="NilClass">1</project-id>
- <tracker-id type="NilClass">1</tracker-id>
- <position type="integer">1</position>
-
- <is-in-chlog type="boolean">true</is-in-chlog>
- <is-in-roadmap type="boolean">false</is-in-roadmap>
-
- <name>Anomalie</name>
- </tracker>
-</trackers>
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/user.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/users.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/user.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/user.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<users type="array">
+ <user>
+ <created-on type="datetime">2009-09-04T17:24:46+02:00</created-on>
+ <updated-on type="datetime">2009-09-06T01:23:59+02:00</updated-on>
+ <last-login-on type="datetime">2009-09-06T01:23:59+02:00</last-login-on>
+
+ <id type="integer">1</id>
+ <auth-source-id type="integer" nil="true"></auth-source-id>
+ <member-id type="NilClass">5</member-id>
+ <role-id type="NilClass">3</role-id>
+ <status type="integer">1</status>
+
+ <admin type="boolean">true</admin>
+ <mail-notification type="boolean">true</mail-notification>
+
+ <firstname>Redmine</firstname>
+ <hashed-password>70c881d4a26984ddce795f6f71817c9cf4480e79</hashed-password>
+ <language>fr</language>
+ <lastname>Admin</lastname>
+ <login>admin</login>
+ <mail>dummy(a)codelutin.com</mail>
+ <identity-url>yo</identity-url>
+ </user>
+</users>
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/user.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/users.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/users.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/users.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<users type="array">
- <user>
- <created-on type="datetime">2009-09-04T17:24:46+02:00</created-on>
- <updated-on type="datetime">2009-09-06T01:23:59+02:00</updated-on>
- <last-login-on type="datetime">2009-09-06T01:23:59+02:00</last-login-on>
-
- <id type="integer">1</id>
- <auth-source-id type="integer" nil="true"></auth-source-id>
- <member-id type="NilClass">5</member-id>
- <role-id type="NilClass">3</role-id>
- <status type="integer">1</status>
-
- <admin type="boolean">true</admin>
- <mail-notification type="boolean">true</mail-notification>
-
- <firstname>Redmine</firstname>
- <hashed-password>70c881d4a26984ddce795f6f71817c9cf4480e79</hashed-password>
- <language>fr</language>
- <lastname>Admin</lastname>
- <login>admin</login>
- <mail>dummy(a)codelutin.com</mail>
- <identity-url>yo</identity-url>
- </user>
-</users>
Copied: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/version.xml (from rev 293, branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/versions.xml)
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/version.xml (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/version.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+
+<versions type="array">
+ <version>
+ <created-on type="datetime">2009-09-06T02:47:39+02:00</created-on>
+ <description>yo</description>
+ <effective-date type="date" nil="true"></effective-date>
+ <id type="integer">9</id>
+ <name>yor</name>
+ <project-id type="integer">1</project-id>
+ <updated-on type="datetime">2009-09-06T02:50:49+02:00</updated-on>
+ <wiki-page-title nil="true"></wiki-page-title>
+ <sharing>none</sharing>
+ <status>open</status>
+ </version>
+</versions>
Property changes on: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/version.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/versions.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/versions.xml 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/versions.xml 2012-07-14 17:08:23 UTC (rev 298)
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #%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%
- -->
-
-<versions type="array">
- <version>
- <created-on type="datetime">2009-09-06T02:47:39+02:00</created-on>
- <description>yo</description>
- <effective-date type="date" nil="true"></effective-date>
- <id type="integer">9</id>
- <name>yor</name>
- <project-id type="integer">1</project-id>
- <updated-on type="datetime">2009-09-06T02:50:49+02:00</updated-on>
- <wiki-page-title nil="true"></wiki-page-title>
- <sharing>none</sharing>
- <status>open</status>
- </version>
-</versions>
Modified: branches/jredmine-1.x/jredmine-client/src/test/resources/test-config.properties
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/test/resources/test-config.properties 2012-07-14 17:07:01 UTC (rev 297)
+++ branches/jredmine-1.x/jredmine-client/src/test/resources/test-config.properties 2012-07-14 17:08:23 UTC (rev 298)
@@ -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
test.encoding=UTF-8
+test.verbose=false
\ No newline at end of file
1
0
r297 - in branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine: . model rest
by tchemit@users.nuiton.org 14 Jul '12
by tchemit@users.nuiton.org 14 Jul '12
14 Jul '12
Author: tchemit
Date: 2012-07-14 19:07:01 +0200 (Sat, 14 Jul 2012)
New Revision: 297
Url: http://nuiton.org/repositories/revision/jredmine/297
Log:
refs #2034: Updates to helper-m-p 1.5 (use better rest api) + improve model design
Added:
branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/rest/RedmineRequestFactory.java
Modified:
branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineAnonymousService.java
branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineService.java
branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/ModelHelper.java
branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java
branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/rest/DefaultRequestBuilder.java
branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/rest/IssueScopeRequestBuilder.java
branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/rest/ProjectScopeRequestBuilder.java
branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/rest/RedmineRestClient.java
branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/rest/VersionScopeRequestBuilder.java
Modified: branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineAnonymousService.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineAnonymousService.java 2012-07-14 17:06:09 UTC (rev 296)
+++ branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineAnonymousService.java 2012-07-14 17:07:01 UTC (rev 297)
@@ -33,13 +33,13 @@
import org.nuiton.jredmine.model.IssueCategory;
import org.nuiton.jredmine.model.IssuePriority;
import org.nuiton.jredmine.model.IssueStatus;
+import org.nuiton.jredmine.model.ModelHelper;
import org.nuiton.jredmine.model.News;
import org.nuiton.jredmine.model.Project;
import org.nuiton.jredmine.model.TimeEntry;
import org.nuiton.jredmine.model.Tracker;
import org.nuiton.jredmine.model.User;
import org.nuiton.jredmine.model.Version;
-import org.nuiton.jredmine.rest.RedmineRestClient;
/**
* Default implementation of {@link RedmineAnonymousService}.
@@ -71,26 +71,26 @@
@Override
public IssueStatus[] getIssueStatuses() throws RedmineServiceException {
- return getDatas(RedmineRestClient.GET_ISSUE_STATUS_LIST,
+ return getDatas(ModelHelper.GET_ALL_ISSUE_STATUS_REQUEST_NAME,
IssueStatus.class
);
}
@Override
public IssuePriority[] getIssuePriorities() throws RedmineServiceException {
- return getDatas(RedmineRestClient.GET_ISSUE_PRIORITY_LIST,
+ return getDatas(ModelHelper.GET_ALL_ISSUE_PRIORITY_REQUEST_NAME,
IssuePriority.class
);
}
@Override
public Project[] getProjects() throws RedmineServiceException {
- return getDatas(RedmineRestClient.GET_PROJECT_LIST, Project.class);
+ return getDatas(ModelHelper.GET_ALL_PROJECT_REQUEST_NAME, Project.class);
}
@Override
public IssueCategory[] getIssueCategories(String projectName) throws RedmineServiceException {
- return getDatas(RedmineRestClient.GET_ISSUE_CATEGORY_LIST,
+ return getDatas(ModelHelper.GET_ALL_ISSUE_CATEGORY_REQUEST_NAME,
IssueCategory.class,
projectName
);
@@ -98,7 +98,7 @@
@Override
public Project getProject(String projectName) throws RedmineServiceException {
- return getData(RedmineRestClient.GET_PROJECT,
+ return getData(ModelHelper.GET_PROJECT_REQUEST_NAME,
Project.class,
projectName
);
@@ -106,7 +106,7 @@
@Override
public Tracker[] getTrackers(String projectName) throws RedmineServiceException {
- return getDatas(RedmineRestClient.GET_TRACKER_LIST,
+ return getDatas(ModelHelper.GET_ALL_TRACKER_REQUEST_NAME,
Tracker.class,
projectName
);
@@ -114,7 +114,7 @@
@Override
public News[] getNews(String projectName) throws RedmineServiceException {
- return getDatas(RedmineRestClient.GET_NEWS_LIST,
+ return getDatas(ModelHelper.GET_ALL_NEWS_REQUEST_NAME,
News.class,
projectName
);
@@ -122,7 +122,7 @@
@Override
public User[] getProjectMembers(String projectName) throws RedmineServiceException {
- return getDatas(RedmineRestClient.GET_USER_LIST,
+ return getDatas(ModelHelper.GET_ALL_USER_REQUEST_NAME,
User.class,
projectName
);
@@ -130,7 +130,7 @@
@Override
public Version[] getVersions(String projectName) throws RedmineServiceException {
- return getDatas(RedmineRestClient.GET_VERSION_LIST,
+ return getDatas(ModelHelper.GET_ALL_VERSION_REQUEST_NAME,
Version.class,
projectName
);
@@ -139,7 +139,7 @@
@Override
public Version getVersion(String projectName,
String versionName) throws RedmineServiceException {
- return getData(RedmineRestClient.GET_VERSION,
+ return getData(ModelHelper.GET_VERSION_REQUEST_NAME,
Version.class,
projectName,
versionName
@@ -149,7 +149,7 @@
@Override
public Attachment[] getAttachments(String projectName,
String versionName) throws RedmineServiceException {
- return getDatas(RedmineRestClient.GET_ATTACHMENTS_LIST,
+ return getDatas(ModelHelper.GET_ALL_ATTACHMENTS_REQUEST_NAME,
Attachment.class,
projectName,
versionName
@@ -159,7 +159,7 @@
@Override
public Issue[] getIssues(String projectName,
String versionName) throws RedmineServiceException {
- return getDatas(RedmineRestClient.GET_ISSUE_LIST,
+ return getDatas(ModelHelper.GET_ALL_ISSUES_REQUEST_NAME,
Issue.class,
projectName,
versionName
@@ -169,7 +169,7 @@
@Override
public TimeEntry[] getIssueTimeEntries(String projectName,
String issueId) throws RedmineServiceException {
- return getDatas(RedmineRestClient.GET_ISSUE_TIME_ENTRY_LIST,
+ return getDatas(ModelHelper.GET_ALL_ISSUE_TIME_ENTRY_REQUEST_NAME,
TimeEntry.class,
projectName,
issueId
@@ -178,7 +178,7 @@
@Override
public Issue[] getIssues(String projectName) throws RedmineServiceException {
- Issue[] result = getDatas(RedmineRestClient.GET_PROJECT_ISSUES,
+ Issue[] result = getDatas(ModelHelper.GET_ALL_PROJECT_ISSUES_REQUEST_NAME,
Issue.class,
projectName
);
@@ -187,7 +187,7 @@
@Override
public Issue[] getOpenedIssues(String projectName) throws RedmineServiceException {
- Issue[] result = getDatas(RedmineRestClient.GET_PROJECT_OPENED_ISSUES,
+ Issue[] result = getDatas(ModelHelper.GET_ALL_PROJECT_OPENED_ISSUES_REQUEST_NAME,
Issue.class,
projectName
);
@@ -196,7 +196,7 @@
@Override
public Issue[] getClosedIssues(String projectName) throws RedmineServiceException {
- Issue[] result = getDatas(RedmineRestClient.GET_PROJECT_CLOSED_ISSUES,
+ Issue[] result = getDatas(ModelHelper.GET_ALL_PROJECT_CLOSED_ISSUES_REQUEST_NAME,
Issue.class,
projectName
);
Modified: branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineService.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineService.java 2012-07-14 17:06:09 UTC (rev 296)
+++ branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineService.java 2012-07-14 17:07:01 UTC (rev 297)
@@ -29,11 +29,11 @@
import org.nuiton.io.rest.RestClient;
import org.nuiton.io.rest.RestClientConfiguration;
import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.ModelHelper;
import org.nuiton.jredmine.model.News;
import org.nuiton.jredmine.model.Project;
import org.nuiton.jredmine.model.TimeEntry;
import org.nuiton.jredmine.model.Version;
-import org.nuiton.jredmine.rest.RedmineRestClient;
/**
* Default {@link RedmineService} implementation based on a {@link RestClient}
@@ -67,7 +67,8 @@
@Override
public Project[] getUserProjects() throws RedmineServiceException {
checkLoggued();
- Project[] result = getDatas(RedmineRestClient.GET_USER_PROJECTS, Project.class);
+ Project[] result = getDatas(ModelHelper.GET_USER_PROJECTS_REQUEST_NAME,
+ Project.class);
return result;
}
@@ -76,7 +77,7 @@
Version version) throws RedmineServiceException {
// send data and obtain created version
- Version result = sendData(RedmineRestClient.ADD_VERSION,
+ Version result = sendData(ModelHelper.ADD_VERSION_REQUEST_NAME,
Version.class,
projectName,
version
@@ -89,7 +90,7 @@
Version version) throws RedmineServiceException {
// send data and obtain updated version
- Version result = sendData(RedmineRestClient.UPDATE_VERSION,
+ Version result = sendData(ModelHelper.UPDATE_VERSION_REQUEST_NAME,
Version.class,
projectName,
version
@@ -103,7 +104,7 @@
Version newVersion) throws RedmineServiceException {
// send data and obtain updated or created new version
- Version result = sendData(RedmineRestClient.NEXT_VERSION,
+ Version result = sendData(ModelHelper.NEXT_VERSION_REQUEST_NAME,
Version.class,
projectName,
newVersion,
@@ -118,7 +119,7 @@
Attachment attachement) throws RedmineServiceException {
// send data and obtain created attachment
- Attachment result = sendData(RedmineRestClient.ADD_ATTACHMENT,
+ Attachment result = sendData(ModelHelper.ADD_ATTACHMENT_REQUEST_NAME,
Attachment.class,
projectName,
versionName,
@@ -131,7 +132,7 @@
public News addNews(String projectName,
News news) throws RedmineServiceException {
// send data and obtain created news
- News result = sendData(RedmineRestClient.ADD_NEWS,
+ News result = sendData(ModelHelper.ADD_NEWS_REQUEST_NAME,
News.class,
projectName,
news
@@ -144,7 +145,7 @@
String issueId,
TimeEntry entry) throws RedmineServiceException {
// send data and obtain updated version
- TimeEntry result = sendData(RedmineRestClient.ADD_ISSUE_TIME_ENTRY,
+ TimeEntry result = sendData(ModelHelper.ADD_ISSUE_TIME_ENTRY_REQUEST_NAME,
TimeEntry.class,
projectName,
issueId,
Modified: branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/ModelHelper.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/ModelHelper.java 2012-07-14 17:06:09 UTC (rev 296)
+++ branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/ModelHelper.java 2012-07-14 17:07:01 UTC (rev 297)
@@ -38,6 +38,64 @@
*/
public class ModelHelper {
+ public static final String GET_ALL_ISSUE_STATUS_REQUEST_NAME = "IssueStatus/all";
+
+ public static final String GET_ALL_ISSUE_PRIORITY_REQUEST_NAME = "IssuePriority/all";
+
+ public static final String GET_ALL_ISSUE_CATEGORY_REQUEST_NAME = "IssueCategory/all";
+
+ public static final String GET_USER_PROJECTS_REQUEST_NAME = "User/Project/all";
+
+ public static final String GET_ALL_PROJECT_REQUEST_NAME = "Project/all";
+
+ public static final String GET_PROJECT_REQUEST_NAME = "Project/detail";
+
+ public static final String GET_ALL_VERSION_REQUEST_NAME = "Project/Version/all";
+
+ public static final String GET_ALL_TRACKER_REQUEST_NAME = "Project/Tracker/all";
+
+ public static final String GET_ALL_PROJECT_ISSUES_REQUEST_NAME = "Project/Issue/all";
+
+ public static final String GET_ALL_PROJECT_OPENED_ISSUES_REQUEST_NAME = "Project/Issue/opened";
+
+ public static final String GET_ALL_PROJECT_CLOSED_ISSUES_REQUEST_NAME = "Project/Issue/closed";
+
+ public static final String GET_ALL_USER_REQUEST_NAME = "Project/User/all";
+
+ public static final String GET_ALL_NEWS_REQUEST_NAME = "Project/News/all";
+
+ public static final String GET_VERSION_REQUEST_NAME = "Project/Version/detail";
+
+ public static final String GET_ALL_ISSUES_REQUEST_NAME = "Project/Version/Issue/all";
+
+ public static final String GET_ALL_ATTACHMENTS_REQUEST_NAME = "Project/Version/Attachment/all";
+
+ public static final String ADD_ATTACHMENT_REQUEST_NAME = "Project/Version/Attachment/add";
+
+ public static final String ADD_VERSION_REQUEST_NAME = "Project/Version/add";
+
+ public static final String UPDATE_VERSION_REQUEST_NAME = "Project/Version/update";
+
+ public static final String NEXT_VERSION_REQUEST_NAME = "Project/Version/next";
+
+ public static final String ADD_NEWS_REQUEST_NAME = "Project/News/add";
+
+ public static final String GET_ALL_ISSUE_TIME_ENTRY_REQUEST_NAME = "Project/Issue/TimeEntry/all";
+
+ public static final String ADD_ISSUE_TIME_ENTRY_REQUEST_NAME = "Project/Issue/TimeEntry/add";
+
+ public static final String LOGIN_REQUEST_NAME = "Login";
+
+ public static final String LOGOUT_REQUEST_NAME = "Logout";
+
+ public static final String PING_REQUEST_NAME = "Ping";
+
+ public static final String VERSION_SCOPE = "version";
+
+ public static final String PROJECT_SCOPE = "project";
+
+ public static final String ISSUE_SCOPE = "issue";
+
public static <T extends IdAble> T byId(int id, T... datas) {
for (T data : datas) {
if (data.getId() == id) {
Modified: branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java 2012-07-14 17:06:09 UTC (rev 296)
+++ branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java 2012-07-14 17:07:01 UTC (rev 297)
@@ -24,8 +24,6 @@
*/
package org.nuiton.jredmine.model;
-import org.nuiton.jredmine.rest.RedmineRestClient;
-
/**
* Un énumération pour connaitre l'ensemble des classes du modèle.
*
@@ -34,17 +32,17 @@
*/
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);
+ issueStatus(IssueStatus.class, RedmineModelScope.none, ModelHelper.GET_ALL_ISSUE_STATUS_REQUEST_NAME),
+ issuePriority(IssuePriority.class, RedmineModelScope.none, ModelHelper.GET_ALL_ISSUE_PRIORITY_REQUEST_NAME),
+ project(Project.class, RedmineModelScope.none, ModelHelper.GET_ALL_PROJECT_REQUEST_NAME),
+ issueCategory(IssueCategory.class, RedmineModelScope.project, ModelHelper.GET_ALL_ISSUE_CATEGORY_REQUEST_NAME),
+ tracker(Tracker.class, RedmineModelScope.project, ModelHelper.GET_ALL_TRACKER_REQUEST_NAME),
+ user(User.class, RedmineModelScope.project, ModelHelper.GET_ALL_USER_REQUEST_NAME),
+ news(News.class, RedmineModelScope.project, ModelHelper.GET_ALL_NEWS_REQUEST_NAME),
+ version(Version.class, RedmineModelScope.project, ModelHelper.GET_ALL_VERSION_REQUEST_NAME),
+ issue(Issue.class, RedmineModelScope.version, ModelHelper.GET_ALL_ISSUES_REQUEST_NAME),
+ timeEntry(TimeEntry.class, RedmineModelScope.issue, ModelHelper.GET_ALL_ISSUE_TIME_ENTRY_REQUEST_NAME),
+ attachment(Attachment.class, RedmineModelScope.version, ModelHelper.GET_ALL_ATTACHMENTS_REQUEST_NAME);
private final Class<?> modelType;
Modified: branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/rest/DefaultRequestBuilder.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/rest/DefaultRequestBuilder.java 2012-07-14 17:06:09 UTC (rev 296)
+++ branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/rest/DefaultRequestBuilder.java 2012-07-14 17:07:01 UTC (rev 297)
@@ -24,6 +24,9 @@
*/
package org.nuiton.jredmine.rest;
+import com.google.common.base.Joiner;
+import org.apache.commons.lang3.ArrayUtils;
+import org.nuiton.io.rest.RestMethod;
import org.nuiton.io.rest.RestRequest;
import org.nuiton.io.rest.RestRequestBuilder;
@@ -38,17 +41,20 @@
*/
public class DefaultRequestBuilder implements RestRequestBuilder {
- public static final String CONTEXT_PATH = "jredmine";
+ private static final long serialVersionUID = 1L;
- public static final String[] EMPTY_STRING_ARRAY = new String[0];
-
protected String name;
- protected String action;
+ protected String[] action;
- public DefaultRequestBuilder(String name, String action) {
+ protected final RestMethod method;
+
+ public DefaultRequestBuilder(String name,
+ RestMethod method,
+ String... action) {
this.name = name;
this.action = action;
+ this.method = method;
}
@Override
@@ -62,12 +68,12 @@
*/
public String[] getParameters(Object... args) {
// by default, no parameter
- return EMPTY_STRING_ARRAY;
+ return ArrayUtils.EMPTY_STRING_ARRAY;
}
public String[] getPath(Object... args) {
// by default, path is contextPath / action
- return new String[]{CONTEXT_PATH, action};
+ return action;
}
public Map<String, File> getAttachments(Object... args) {
@@ -94,6 +100,25 @@
public Map<String, File> getAttachments() {
return DefaultRequestBuilder.this.getAttachments(args);
}
+
+ @Override
+ public boolean containsAttachments() {
+ Map<String, File> attachments = getAttachments();
+ return attachments != null && !attachments.isEmpty();
+ }
+
+ @Override
+ public String toPath(String redmineUrl) {
+ String result = redmineUrl + "/" +
+ Joiner.on('/').join(getPath());
+ return result;
+ }
+
+ @Override
+ public RestMethod getMethod() {
+ return method;
+ }
+
};
}
}
Modified: branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/rest/IssueScopeRequestBuilder.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/rest/IssueScopeRequestBuilder.java 2012-07-14 17:06:09 UTC (rev 296)
+++ branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/rest/IssueScopeRequestBuilder.java 2012-07-14 17:07:01 UTC (rev 297)
@@ -24,6 +24,8 @@
*/
package org.nuiton.jredmine.rest;
+import org.nuiton.io.rest.RestMethod;
+
/**
* Builder of requests which are in a project and issue context.
* <p/>
@@ -34,10 +36,18 @@
*/
public class IssueScopeRequestBuilder extends ProjectScopeRequestBuilder {
- public IssueScopeRequestBuilder(String name, String action) {
- super(name, action);
+ private static final long serialVersionUID = 1L;
+
+ public IssueScopeRequestBuilder(String name,
+ RestMethod method,
+ String... action) {
+ super(name, method, action);
}
+ public IssueScopeRequestBuilder(String name, String... action) {
+ this(name, null, action);
+ }
+
@Override
public String[] getParameters(Object... args) {
Modified: branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/rest/ProjectScopeRequestBuilder.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/rest/ProjectScopeRequestBuilder.java 2012-07-14 17:06:09 UTC (rev 296)
+++ branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/rest/ProjectScopeRequestBuilder.java 2012-07-14 17:07:01 UTC (rev 297)
@@ -24,6 +24,8 @@
*/
package org.nuiton.jredmine.rest;
+import org.nuiton.io.rest.RestMethod;
+
/**
* Builder of requests which are in a project context.
*
@@ -32,10 +34,18 @@
*/
public class ProjectScopeRequestBuilder extends DefaultRequestBuilder {
- public ProjectScopeRequestBuilder(String name, String action) {
- super(name, action);
+ private static final long serialVersionUID = 1L;
+
+ public ProjectScopeRequestBuilder(String name, String... action) {
+ this(name, null, action);
}
+ public ProjectScopeRequestBuilder(String name,
+ RestMethod method,
+ String... action) {
+ super(name, method, action);
+ }
+
@Override
public String[] getPath(Object... args) {
@@ -43,10 +53,9 @@
String projectName = (String) args[0];
- return new String[]{
- CONTEXT_PATH,
- action,
- projectName
- };
+ String[] result = new String[action.length + 1];
+ System.arraycopy(action, 0, result, 0, action.length);
+ result[action.length] = projectName;
+ return result;
}
}
Added: branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/rest/RedmineRequestFactory.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/rest/RedmineRequestFactory.java (rev 0)
+++ branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/rest/RedmineRequestFactory.java 2012-07-14 17:07:01 UTC (rev 297)
@@ -0,0 +1,202 @@
+package org.nuiton.jredmine.rest;
+
+import com.google.common.base.Strings;
+import org.nuiton.io.rest.AbstractRequestFactory;
+import org.nuiton.io.rest.RestMethod;
+import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.ModelHelper;
+import org.nuiton.jredmine.model.News;
+import org.nuiton.jredmine.model.TimeEntry;
+import org.nuiton.jredmine.model.Version;
+import org.nuiton.jredmine.model.VersionStatusEnum;
+
+import java.io.File;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * TODO
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public class RedmineRequestFactory extends AbstractRequestFactory {
+
+ @Override
+ public void addDefaultRequests() {
+
+ // misc requests
+
+ addRequestBuilder(new DefaultRequestBuilder(ModelHelper.PING_REQUEST_NAME, RestMethod.GET, "jredmine", "ping"));
+ addRequestBuilder(new DefaultRequestBuilder(ModelHelper.LOGOUT_REQUEST_NAME, RestMethod.GET, "jredmine", "logout"));
+ addRequestBuilder(new DefaultRequestBuilder(ModelHelper.LOGIN_REQUEST_NAME, RestMethod.POST, "jredmine", "login") {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+ String login = (String) args[0];
+ String password = (String) args[1];
+ return new String[]{"username", login, "password", password};
+ }
+ });
+
+ // data with no scope requests
+
+ addRequestBuilder(new DefaultRequestBuilder(ModelHelper.GET_ALL_PROJECT_REQUEST_NAME, RestMethod.GET, "jredmine", "get_projects.xml"));
+ addRequestBuilder(new DefaultRequestBuilder(ModelHelper.GET_USER_PROJECTS_REQUEST_NAME, RestMethod.GET, "jredmine", "get_user_projects.xml"));
+ addRequestBuilder(new DefaultRequestBuilder(ModelHelper.GET_ALL_ISSUE_STATUS_REQUEST_NAME, RestMethod.GET, "jredmine", "get_issue_statuses.xml"));
+ addRequestBuilder(new DefaultRequestBuilder(ModelHelper.GET_ALL_ISSUE_PRIORITY_REQUEST_NAME, RestMethod.GET, "jredmine", "get_issue_priorities.xml"));
+
+ // data with project scope requests
+
+ addRequestBuilder(new ProjectScopeRequestBuilder(ModelHelper.GET_PROJECT_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project.xml"));
+ addRequestBuilder(new ProjectScopeRequestBuilder(ModelHelper.GET_ALL_PROJECT_ISSUES_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_issues.xml"));
+ addRequestBuilder(new ProjectScopeRequestBuilder(ModelHelper.GET_ALL_PROJECT_OPENED_ISSUES_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_opened_issues.xml"));
+ addRequestBuilder(new ProjectScopeRequestBuilder(ModelHelper.GET_ALL_PROJECT_CLOSED_ISSUES_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_closed_issues.xml"));
+ addRequestBuilder(new ProjectScopeRequestBuilder(ModelHelper.GET_ALL_VERSION_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_versions.xml"));
+ addRequestBuilder(new ProjectScopeRequestBuilder(ModelHelper.GET_ALL_ISSUE_CATEGORY_REQUEST_NAME, RestMethod.GET, "jredmine", "get_issue_categories.xml"));
+ addRequestBuilder(new ProjectScopeRequestBuilder(ModelHelper.GET_ALL_TRACKER_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_trackers.xml"));
+ addRequestBuilder(new ProjectScopeRequestBuilder(ModelHelper.GET_ALL_USER_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_users.xml"));
+ addRequestBuilder(new ProjectScopeRequestBuilder(ModelHelper.GET_ALL_NEWS_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_news.xml"));
+
+ addRequestBuilder(new ProjectScopeRequestBuilder(ModelHelper.ADD_VERSION_REQUEST_NAME, RestMethod.POST, "jredmine", "add_version.xml") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+ Version version = (Version) args[1];
+ String date = getVersionEffectiveDate(version);
+ String status = getVersionStatus(version);
+ return new String[]{
+ "version[name]", version.getName(),
+ "version[description]", version.getDescription(),
+ "version[effective_date]", date,
+ "version[status]", status
+ };
+ }
+ });
+
+ addRequestBuilder(new ProjectScopeRequestBuilder(ModelHelper.UPDATE_VERSION_REQUEST_NAME, RestMethod.POST, "jredmine", "update_version.xml") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+ Version version = (Version) args[1];
+ String date = getVersionEffectiveDate(version);
+ String status = getVersionStatus(version);
+ return new String[]{
+ "version[name]", version.getName(),
+ "version[description]", version.getDescription(),
+ "version[effective_date]", date,
+ "version[status]", status
+ };
+ }
+ });
+
+ addRequestBuilder(new ProjectScopeRequestBuilder(ModelHelper.NEXT_VERSION_REQUEST_NAME, RestMethod.POST, "jredmine", "next_version.xml") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+
+
+ Version version = (Version) args[1];
+ String date = getVersionEffectiveDate(version);
+ String status = getVersionStatus(version);
+ String oldVersionName = (String) args[2];
+ return new String[]{
+ "oldVersionName", oldVersionName,
+ "version[name]", version.getName(),
+ "version[description]", version.getDescription(),
+ "version[effective_date]", date,
+ "version[status]", status
+ };
+ }
+ });
+
+ addRequestBuilder(new ProjectScopeRequestBuilder(ModelHelper.ADD_NEWS_REQUEST_NAME, RestMethod.POST, "jredmine", "add_news.xml") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+ News news = (News) args[1];
+ return new String[]{
+ "news[title]", news.getTitle(),
+ "news[summary]", news.getSummary(),
+ "news[description]", news.getDescription()
+ };
+ }
+ });
+
+ // version scope requests
+
+ addRequestBuilder(new VersionScopeRequestBuilder(ModelHelper.GET_VERSION_REQUEST_NAME, RestMethod.GET, "jredmine", "get_version.xml"));
+ addRequestBuilder(new VersionScopeRequestBuilder(ModelHelper.GET_ALL_ISSUES_REQUEST_NAME, RestMethod.GET, "jredmine", "get_version_issues.xml"));
+ addRequestBuilder(new VersionScopeRequestBuilder(ModelHelper.GET_ALL_ATTACHMENTS_REQUEST_NAME, RestMethod.GET, "jredmine", "get_version_attachments.xml"));
+ addRequestBuilder(new VersionScopeRequestBuilder(ModelHelper.ADD_ATTACHMENT_REQUEST_NAME, RestMethod.POST, "jredmine", "add_version_attachment.xml") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+ String versionId = (String) args[1];
+ Attachment attachment = (Attachment) args[2];
+ return new String[]{
+ "version_name", versionId,
+ "attachment[description]", attachment.getDescription()
+ };
+ }
+
+ @Override
+ public Map<String, File> getAttachments(Object... args) {
+ Map<String, File> upload = new HashMap<String, File>();
+ Attachment attachment = (Attachment) args[2];
+ upload.put("attachment[file]", attachment.getToUpload());
+ return upload;
+ }
+ });
+
+ // issue scope requests
+
+ addRequestBuilder(new IssueScopeRequestBuilder(ModelHelper.GET_ALL_ISSUE_TIME_ENTRY_REQUEST_NAME, RestMethod.GET, "jredmine", "get_issue_times.xml"));
+
+ addRequestBuilder(new IssueScopeRequestBuilder(ModelHelper.ADD_ISSUE_TIME_ENTRY_REQUEST_NAME, RestMethod.POST, "jredmine", "add_issue_time.xml") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+ String issueId = (String) args[1];
+ TimeEntry timeEntry = (TimeEntry) args[2];
+ Date d = timeEntry.getSpentOn();
+ if (d == null) {
+ d = new Date();
+ }
+ String date = DATE_FORMAT.format(d);
+ return new String[]{
+ "issue_id", issueId,
+ //"timeEntry[issue_id]", issueId,
+ "time_entry[activity_id]", timeEntry.getActivityId() + "",
+ "time_entry[spent_on]", date,
+ "time_entry[hours]", timeEntry.getHours() + "",
+ "time_entry[comments]", timeEntry.getComments() == null ? "" : timeEntry.getComments()
+ };
+ }
+ });
+}
+
+ protected static String getVersionStatus(Version version) {
+ String status = version.getStatus();
+ if (Strings.isNullOrEmpty(status)) {
+
+ // use default open status
+ status = VersionStatusEnum.open.name();
+ }
+ return status;
+ }
+
+ protected static String getVersionEffectiveDate(Version version) {
+ return version.getEffectiveDate() == null ? "" :
+ DATE_FORMAT.format(version.getEffectiveDate());
+ }
+}
Modified: branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/rest/RedmineRestClient.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/rest/RedmineRestClient.java 2012-07-14 17:06:09 UTC (rev 296)
+++ branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/rest/RedmineRestClient.java 2012-07-14 17:07:01 UTC (rev 297)
@@ -29,31 +29,14 @@
import org.apache.commons.httpclient.StatusLine;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.codehaus.plexus.util.StringUtils;
+import org.nuiton.io.rest.RequestFactory;
import org.nuiton.io.rest.RestClient;
import org.nuiton.io.rest.RestClientConfiguration;
import org.nuiton.io.rest.RestRequest;
import org.nuiton.io.rest.RestSession;
-import org.nuiton.jredmine.model.Attachment;
-import org.nuiton.jredmine.model.Issue;
-import org.nuiton.jredmine.model.IssueCategory;
-import org.nuiton.jredmine.model.IssuePriority;
-import org.nuiton.jredmine.model.IssueStatus;
-import org.nuiton.jredmine.model.News;
-import org.nuiton.jredmine.model.Project;
-import org.nuiton.jredmine.model.TimeEntry;
-import org.nuiton.jredmine.model.Tracker;
-import org.nuiton.jredmine.model.User;
-import org.nuiton.jredmine.model.Version;
-import org.nuiton.jredmine.model.VersionStatusEnum;
+import org.nuiton.jredmine.model.ModelHelper;
-import java.io.File;
import java.io.IOException;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
/**
* Implementation of a {@link RestClient} to access a Redmine server via the
@@ -67,219 +50,22 @@
private static final Log log = LogFactory.getLog(RedmineRestClient.class);
- public static final String GET_ISSUE_LIST = Issue.class.getName() + "list";
+ private final RequestFactory requestFactory;
- public static final String GET_ISSUE_STATUS_LIST = IssueStatus.class.getName() + "list";
-
- public static final String GET_ISSUE_PRIORITY_LIST = IssuePriority.class.getName() + "list";
-
- public static final String GET_ISSUE_CATEGORY_LIST = IssueCategory.class.getName() + "list";
-
- public static final String GET_ISSUE_TIME_ENTRY_LIST = TimeEntry.class.getName() + "list";
-
- public static final String GET_PROJECT_LIST = Project.class.getName() + "list";
-
- public static final String GET_PROJECT_ISSUES = Project.class.getName() + "issues";
-
- public static final String GET_PROJECT_OPENED_ISSUES = Project.class.getName() + "opened-issues";
-
- public static final String GET_PROJECT_CLOSED_ISSUES = Project.class.getName() + "closed-issues";
-
- public static final String GET_USER_PROJECTS = Project.class.getName() + "forUser";
-
- public static final String GET_PROJECT = Project.class.getName() + "detail";
-
- public static final String GET_VERSION_LIST = Version.class.getName() + "list";
-
- public static final String GET_TRACKER_LIST = Tracker.class.getName() + "list";
-
- public static final String GET_ATTACHMENTS_LIST = Attachment.class.getName() + "list";
-
- public static final String GET_USER_LIST = User.class.getName() + "list";
-
- public static final String GET_NEWS_LIST = News.class.getName() + "list";
-
- public static final String GET_VERSION = Version.class.getName() + "detail";
-
- public static final String ADD_VERSION = Version.class.getName() + "add";
-
- public static final String UPDATE_VERSION = Version.class.getName() + "update";
-
- public static final String NEXT_VERSION = Version.class.getName() + "next";
-
- public static final String ADD_NEWS = News.class.getName() + "add";
-
- public static final String ADD_ATTACHMENT = Attachment.class.getName() + "add";
-
- public static final String ADD_ISSUE_TIME_ENTRY = TimeEntry.class.getName() + "add";
-
- public static final String LOGIN = "login";
-
- public static final String LOGOUT = "logout";
-
- public static final String PING = "ping";
-
- public final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd");
-
public RedmineRestClient() {
+ requestFactory = new RedmineRequestFactory();
+ requestFactory.addDefaultRequests();
}
public RedmineRestClient(RestClientConfiguration configuration) {
super(configuration);
+ requestFactory = new RedmineRequestFactory();
+ requestFactory.addDefaultRequests();
}
@Override
- protected void addDefaultRequests() {
-
- addRequestBuilder(new DefaultRequestBuilder(PING, "ping"));
- addRequestBuilder(new DefaultRequestBuilder(LOGOUT, "logout"));
- addRequestBuilder(new DefaultRequestBuilder(LOGIN, "login") {
-
- @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
-
- addRequestBuilder(new DefaultRequestBuilder(GET_PROJECT_LIST, "get_projects.xml"));
- addRequestBuilder(new DefaultRequestBuilder(GET_USER_PROJECTS, "get_user_projects.xml"));
- addRequestBuilder(new DefaultRequestBuilder(GET_ISSUE_STATUS_LIST, "get_issue_statuses.xml"));
- addRequestBuilder(new DefaultRequestBuilder(GET_ISSUE_PRIORITY_LIST, "get_issue_priorities.xml"));
-
- // with project scope
-
- addRequestBuilder(new ProjectScopeRequestBuilder(GET_PROJECT, "get_project.xml"));
- addRequestBuilder(new ProjectScopeRequestBuilder(GET_PROJECT_ISSUES, "get_project_issues.xml"));
- addRequestBuilder(new ProjectScopeRequestBuilder(GET_PROJECT_OPENED_ISSUES, "get_project_opened_issues.xml"));
- addRequestBuilder(new ProjectScopeRequestBuilder(GET_PROJECT_CLOSED_ISSUES, "get_project_closed_issues.xml"));
- addRequestBuilder(new ProjectScopeRequestBuilder(GET_VERSION_LIST, "get_project_versions.xml"));
- addRequestBuilder(new ProjectScopeRequestBuilder(GET_ISSUE_CATEGORY_LIST, "get_issue_categories.xml"));
- addRequestBuilder(new ProjectScopeRequestBuilder(GET_TRACKER_LIST, "get_project_trackers.xml"));
- addRequestBuilder(new ProjectScopeRequestBuilder(GET_USER_LIST, "get_project_users.xml"));
- addRequestBuilder(new ProjectScopeRequestBuilder(GET_NEWS_LIST, "get_project_news.xml"));
-
- addRequestBuilder(new ProjectScopeRequestBuilder(ADD_VERSION, "add_version.xml") {
-
- @Override
- public String[] getParameters(Object... args) {
- Version version = (Version) args[1];
- String date = getVersionEffectiveDate(version);
- String status = getVersionStatus(version);
- return new String[]{
- "version[name]", version.getName(),
- "version[description]", version.getDescription(),
- "version[effective_date]", date,
- "version[status]", status
- };
- }
- });
-
- addRequestBuilder(new ProjectScopeRequestBuilder(UPDATE_VERSION, "update_version.xml") {
-
- @Override
- public String[] getParameters(Object... args) {
- Version version = (Version) args[1];
- String date = getVersionEffectiveDate(version);
- String status = getVersionStatus(version);
- return new String[]{
- "version[name]", version.getName(),
- "version[description]", version.getDescription(),
- "version[effective_date]", date,
- "version[status]", status
- };
- }
- });
-
- addRequestBuilder(new ProjectScopeRequestBuilder(NEXT_VERSION, "next_version.xml") {
-
- @Override
- public String[] getParameters(Object... args) {
-
-
- Version version = (Version) args[1];
- String date = getVersionEffectiveDate(version);
- String status = getVersionStatus(version);
- String oldVersionName = (String) args[2];
- return new String[]{
- "oldVersionName", oldVersionName,
- "version[name]", version.getName(),
- "version[description]", version.getDescription(),
- "version[effective_date]", date,
- "version[status]", status
- };
- }
- });
-
- addRequestBuilder(new ProjectScopeRequestBuilder(ADD_NEWS, "add_news.xml") {
-
- @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()
- };
- }
- });
-
- // with version scope
-
- addRequestBuilder(new VersionScopeRequestBuilder(GET_VERSION, "get_version.xml"));
- addRequestBuilder(new VersionScopeRequestBuilder(GET_ISSUE_LIST, "get_version_issues.xml"));
- addRequestBuilder(new VersionScopeRequestBuilder(GET_ATTACHMENTS_LIST, "get_version_attachments.xml"));
-
-
- addRequestBuilder(new VersionScopeRequestBuilder(ADD_ATTACHMENT, "add_version_attachment.xml") {
-
- @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;
- }
- });
-
- // with issue scope
-
- addRequestBuilder(new IssueScopeRequestBuilder(GET_ISSUE_TIME_ENTRY_LIST, "get_issue_times.xml"));
-
- addRequestBuilder(new IssueScopeRequestBuilder(ADD_ISSUE_TIME_ENTRY, "add_issue_time.xml") {
-
- @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()
- };
- }
- });
+ public RequestFactory getRequestFactory() {
+ return requestFactory;
}
@Override
@@ -299,7 +85,7 @@
return;
}
try {
- RestRequest request = getRequest(LOGOUT);
+ RestRequest request = getRequest(ModelHelper.LOGOUT_REQUEST_NAME);
session.setOpen(false);
session.doRequest(request);
} finally {
@@ -311,7 +97,7 @@
try {
- RestRequest request = getRequest(PING);
+ RestRequest request = getRequest(ModelHelper.PING_REQUEST_NAME);
HttpMethod gm = session.doRequest(request);
StatusLine sl = gm.getStatusLine();
@@ -345,7 +131,7 @@
protected void login(RestSession session) throws IOException {
- RestRequest request = getRequest(LOGIN,
+ RestRequest request = getRequest(ModelHelper.LOGIN_REQUEST_NAME,
configuration.getRestUsername(),
configuration.getRestPassword());
@@ -368,18 +154,4 @@
}
- protected String getVersionStatus(Version version) {
- String status = version.getStatus();
- if (StringUtils.isEmpty(status)) {
-
- // use default open status
- status = VersionStatusEnum.open.name();
- }
- return status;
- }
-
- protected String getVersionEffectiveDate(Version version) {
- return version.getEffectiveDate() == null ? "" :
- DATE_FORMAT.format(version.getEffectiveDate());
- }
}
Modified: branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/rest/VersionScopeRequestBuilder.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/rest/VersionScopeRequestBuilder.java 2012-07-14 17:06:09 UTC (rev 296)
+++ branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/rest/VersionScopeRequestBuilder.java 2012-07-14 17:07:01 UTC (rev 297)
@@ -24,6 +24,8 @@
*/
package org.nuiton.jredmine.rest;
+import org.nuiton.io.rest.RestMethod;
+
/**
* Builder of requests which are in a project and version context.
*
@@ -32,10 +34,16 @@
*/
public class VersionScopeRequestBuilder extends ProjectScopeRequestBuilder {
- public VersionScopeRequestBuilder(String name, String action) {
- super(name, action);
+ private static final long serialVersionUID = 1L;
+
+ public VersionScopeRequestBuilder(String name, RestMethod method, String... action) {
+ super(name, method, action);
}
+ public VersionScopeRequestBuilder(String name, String... action) {
+ this(name, null, action);
+ }
+
@Override
public String[] getParameters(Object... args) {
1
0
r296 - branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3
by tchemit@users.nuiton.org 14 Jul '12
by tchemit@users.nuiton.org 14 Jul '12
14 Jul '12
Author: tchemit
Date: 2012-07-14 19:06:09 +0200 (Sat, 14 Jul 2012)
New Revision: 296
Url: http://nuiton.org/repositories/revision/jredmine/296
Log:
fixes #2033: Improve xpp3 reader api
Modified:
branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/AttachmentXpp3Reader.java
branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueCategoryXpp3Reader.java
branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssuePriorityXpp3Reader.java
branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueStatusXpp3Reader.java
branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueXpp3Reader.java
branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/NewsXpp3Reader.java
branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectXpp3Reader.java
branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/TimeEntryXpp3Reader.java
branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/TrackerXpp3Reader.java
branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserXpp3Reader.java
branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/VersionXpp3Reader.java
Modified: branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/AttachmentXpp3Reader.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/AttachmentXpp3Reader.java 2012-07-14 16:58:29 UTC (rev 295)
+++ branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/AttachmentXpp3Reader.java 2012-07-14 17:06:09 UTC (rev 296)
@@ -29,8 +29,6 @@
import java.beans.IntrospectionException;
-import static org.nuiton.io.xpp3.Xpp3Helper.addTagTextContentMappers;
-
/**
* {@link Attachment} reader.
*
@@ -46,17 +44,17 @@
@Override
protected void initMappers() throws IntrospectionException {
- addTagTextContentMappers(Attachment.class, RedmineDataConverter.Integer, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Integer, true,
"author-id",
"container-id",
"filesize",
"downloads",
"id");
- addTagTextContentMappers(Attachment.class, RedmineDataConverter.Datetime, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Datetime, true,
"created-on");
- addTagTextContentMappers(Attachment.class, RedmineDataConverter.Text, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Text, true,
"container-type",
"content-type",
"description",
Modified: branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueCategoryXpp3Reader.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueCategoryXpp3Reader.java 2012-07-14 16:58:29 UTC (rev 295)
+++ branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueCategoryXpp3Reader.java 2012-07-14 17:06:09 UTC (rev 296)
@@ -30,8 +30,6 @@
import java.beans.IntrospectionException;
-import static org.nuiton.io.xpp3.Xpp3Helper.addTagTextContentMappers;
-
/**
* {@link Issue} reader.
*
@@ -47,12 +45,12 @@
@Override
protected void initMappers() throws IntrospectionException {
- addTagTextContentMappers(IssueCategory.class, RedmineDataConverter.Integer, true, allMappers,
+ addTagTextContentMappers( RedmineDataConverter.Integer, true,
"project-id",
"assigned-to-id",
"id");
- addTagTextContentMappers(IssueCategory.class, RedmineDataConverter.Text, true, allMappers,
+ addTagTextContentMappers( RedmineDataConverter.Text, true,
"name");
}
}
Modified: branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssuePriorityXpp3Reader.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssuePriorityXpp3Reader.java 2012-07-14 16:58:29 UTC (rev 295)
+++ branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssuePriorityXpp3Reader.java 2012-07-14 17:06:09 UTC (rev 296)
@@ -30,8 +30,6 @@
import java.beans.IntrospectionException;
-import static org.nuiton.io.xpp3.Xpp3Helper.addTagTextContentMappers;
-
/**
* {@link Issue} reader.
*
@@ -48,17 +46,17 @@
protected void initMappers() throws IntrospectionException {
- addTagTextContentMappers(IssuePriority.class, RedmineDataConverter.Integer, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Integer, true,
"id",
"parent-id",
"project-id",
"position");
- addTagTextContentMappers(IssuePriority.class, RedmineDataConverter.Boolean, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Boolean, true,
"is-default",
"active");
- addTagTextContentMappers(IssuePriority.class, RedmineDataConverter.Text, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Text, true,
"name",
"opt");
}
Modified: branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueStatusXpp3Reader.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueStatusXpp3Reader.java 2012-07-14 16:58:29 UTC (rev 295)
+++ branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueStatusXpp3Reader.java 2012-07-14 17:06:09 UTC (rev 296)
@@ -30,8 +30,6 @@
import java.beans.IntrospectionException;
-import static org.nuiton.io.xpp3.Xpp3Helper.addTagTextContentMappers;
-
/**
* {@link Issue} reader.
*
@@ -47,16 +45,16 @@
@Override
protected void initMappers() throws IntrospectionException {
- addTagTextContentMappers(IssueStatus.class, RedmineDataConverter.Integer, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Integer, true,
"id",
"position",
"default-done-ratio");
- addTagTextContentMappers(IssueStatus.class, RedmineDataConverter.Boolean, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Boolean, true,
"is-closed",
"is-default");
- addTagTextContentMappers(IssueStatus.class, RedmineDataConverter.Text, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Text, true,
"name");
}
}
Modified: branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueXpp3Reader.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueXpp3Reader.java 2012-07-14 16:58:29 UTC (rev 295)
+++ branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueXpp3Reader.java 2012-07-14 17:06:09 UTC (rev 296)
@@ -26,12 +26,9 @@
import org.nuiton.io.xpp3.AbstractXpp3Reader;
import org.nuiton.jredmine.model.Issue;
-import org.nuiton.jredmine.model.Project;
import java.beans.IntrospectionException;
-import static org.nuiton.io.xpp3.Xpp3Helper.addTagTextContentMappers;
-
/**
* {@link Issue} reader.
*
@@ -47,7 +44,7 @@
@Override
protected void initMappers() throws IntrospectionException {
- addTagTextContentMappers(Issue.class, RedmineDataConverter.Integer, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Integer, true,
"assigned-to-id",
"author-id",
"category-id",
@@ -64,22 +61,22 @@
"lft",
"rgt");
- addTagTextContentMappers(Issue.class, RedmineDataConverter.Float, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Float, true,
"estimated-hours");
- addTagTextContentMappers(Issue.class, RedmineDataConverter.Datetime, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Datetime, true,
"created-on",
"updated-on");
- addTagTextContentMappers(Issue.class, RedmineDataConverter.Date, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Date, true,
"due-date",
"start-date");
- addTagTextContentMappers(Issue.class, RedmineDataConverter.Text, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Text, true,
"description",
"subject");
- addTagTextContentMappers(Issue.class, RedmineDataConverter.Boolean, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Boolean, true,
"is-private");
}
}
Modified: branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/NewsXpp3Reader.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/NewsXpp3Reader.java 2012-07-14 16:58:29 UTC (rev 295)
+++ branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/NewsXpp3Reader.java 2012-07-14 17:06:09 UTC (rev 296)
@@ -29,8 +29,6 @@
import java.beans.IntrospectionException;
-import static org.nuiton.io.xpp3.Xpp3Helper.addTagTextContentMappers;
-
/**
* @author tchemit <chemit(a)codelutin.com>
* @since 1.0.0
@@ -44,16 +42,16 @@
@Override
protected void initMappers() throws IntrospectionException {
- addTagTextContentMappers(News.class, RedmineDataConverter.Integer, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Integer, true,
"id",
"author-id",
"project-id",
"comments-count");
- addTagTextContentMappers(News.class, RedmineDataConverter.Datetime, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Datetime, true,
"created-on");
- addTagTextContentMappers(News.class, RedmineDataConverter.Text, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Text, true,
"description",
"summary",
"title");
Modified: branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectXpp3Reader.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectXpp3Reader.java 2012-07-14 16:58:29 UTC (rev 295)
+++ branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectXpp3Reader.java 2012-07-14 17:06:09 UTC (rev 296)
@@ -29,8 +29,6 @@
import java.beans.IntrospectionException;
-import static org.nuiton.io.xpp3.Xpp3Helper.addTagTextContentMappers;
-
/**
* {@link Project} reader.
*
@@ -46,7 +44,7 @@
@Override
protected void initMappers() throws IntrospectionException {
- addTagTextContentMappers(Project.class, RedmineDataConverter.Integer, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Integer, true,
"id",
"lft",
"rgt",
@@ -54,14 +52,14 @@
"projects-count",
"status");
- addTagTextContentMappers(Project.class, RedmineDataConverter.Boolean, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Boolean, true,
"is-public");
- addTagTextContentMappers(Project.class, RedmineDataConverter.Datetime, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Datetime, true,
"created-on",
"updated-on");
- addTagTextContentMappers(Project.class, RedmineDataConverter.Text, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Text, true,
"description",
"homepage",
"identifier",
Modified: branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/TimeEntryXpp3Reader.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/TimeEntryXpp3Reader.java 2012-07-14 16:58:29 UTC (rev 295)
+++ branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/TimeEntryXpp3Reader.java 2012-07-14 17:06:09 UTC (rev 296)
@@ -29,8 +29,6 @@
import java.beans.IntrospectionException;
-import static org.nuiton.io.xpp3.Xpp3Helper.addTagTextContentMappers;
-
/**
* Created: 31 déc. 2009
*
@@ -45,7 +43,7 @@
@Override
protected void initMappers() throws IntrospectionException {
- addTagTextContentMappers(TimeEntry.class, RedmineDataConverter.Integer, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Integer, true,
"id",
"activity-id",
"issue-id",
@@ -56,18 +54,18 @@
"tweek"
);
- addTagTextContentMappers(TimeEntry.class, RedmineDataConverter.Float, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Float, true,
"hours"
);
- addTagTextContentMappers(TimeEntry.class, RedmineDataConverter.Datetime, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Datetime, true,
"created-on",
"updated-on");
- addTagTextContentMappers(TimeEntry.class, RedmineDataConverter.Date, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Date, true,
"spent-on");
- addTagTextContentMappers(TimeEntry.class, RedmineDataConverter.Text, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Text, true,
"comments");
}
}
Modified: branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/TrackerXpp3Reader.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/TrackerXpp3Reader.java 2012-07-14 16:58:29 UTC (rev 295)
+++ branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/TrackerXpp3Reader.java 2012-07-14 17:06:09 UTC (rev 296)
@@ -29,8 +29,6 @@
import java.beans.IntrospectionException;
-import static org.nuiton.io.xpp3.Xpp3Helper.addTagTextContentMappers;
-
/**
* {@link Tracker} reader.
*
@@ -46,17 +44,17 @@
@Override
protected void initMappers() throws IntrospectionException {
- addTagTextContentMappers(Tracker.class, RedmineDataConverter.Integer, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Integer, true,
"id",
"project-id",
"tracker-id",
"position");
- addTagTextContentMappers(Tracker.class, RedmineDataConverter.Boolean, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Boolean, true,
"is-in-chlog",
"is-in-roadmap");
- addTagTextContentMappers(Tracker.class, RedmineDataConverter.Text, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Text, true,
"name");
}
}
Modified: branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserXpp3Reader.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserXpp3Reader.java 2012-07-14 16:58:29 UTC (rev 295)
+++ branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserXpp3Reader.java 2012-07-14 17:06:09 UTC (rev 296)
@@ -29,8 +29,6 @@
import java.beans.IntrospectionException;
-import static org.nuiton.io.xpp3.Xpp3Helper.addTagTextContentMappers;
-
/**
* {@link User} reader.
*
@@ -46,23 +44,23 @@
@Override
protected void initMappers() throws IntrospectionException {
- addTagTextContentMappers(User.class, RedmineDataConverter.Integer, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Integer, true,
"id",
"auth-source-id",
"member-id",
"role-id",
"status");
- addTagTextContentMappers(User.class, RedmineDataConverter.Boolean, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Boolean, true,
"admin",
"mail-notification");
- addTagTextContentMappers(User.class, RedmineDataConverter.Datetime, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Datetime, true,
"created-on",
"updated-on",
"last-login-on");
- addTagTextContentMappers(User.class, RedmineDataConverter.Text, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Text, true,
"firstname",
"hashed-password",
"language",
Modified: branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/VersionXpp3Reader.java
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/VersionXpp3Reader.java 2012-07-14 16:58:29 UTC (rev 295)
+++ branches/jredmine-1.x/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/VersionXpp3Reader.java 2012-07-14 17:06:09 UTC (rev 296)
@@ -29,8 +29,6 @@
import java.beans.IntrospectionException;
-import static org.nuiton.io.xpp3.Xpp3Helper.addTagTextContentMappers;
-
/**
* {@link Version} reader.
*
@@ -46,17 +44,17 @@
@Override
protected void initMappers() throws IntrospectionException {
- addTagTextContentMappers(Version.class, RedmineDataConverter.Integer, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Integer, true,
"id",
"project-id");
- addTagTextContentMappers(Version.class, RedmineDataConverter.Datetime, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Datetime, true,
"created-on",
"updated-on");
- addTagTextContentMappers(Version.class, RedmineDataConverter.Date, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Date, true,
"effective-date");
- addTagTextContentMappers(Version.class, RedmineDataConverter.Text, true, allMappers,
+ addTagTextContentMappers(RedmineDataConverter.Text, true,
"name",
"description",
"wiki-page-title",
1
0
r295 - in branches/jredmine-1.x: . jredmine-client jredmine-client/src/site jredmine-maven-plugin jredmine-maven-plugin/src/site src/site
by tchemit@users.nuiton.org 14 Jul '12
by tchemit@users.nuiton.org 14 Jul '12
14 Jul '12
Author: tchemit
Date: 2012-07-14 18:58:29 +0200 (Sat, 14 Jul 2012)
New Revision: 295
Url: http://nuiton.org/repositories/revision/jredmine/295
Log:
fixes #2187: Updates to mavenpom 3.3.4
Modified:
branches/jredmine-1.x/jredmine-client/pom.xml
branches/jredmine-1.x/jredmine-client/src/site/site_fr.xml
branches/jredmine-1.x/jredmine-maven-plugin/pom.xml
branches/jredmine-1.x/jredmine-maven-plugin/src/site/site_fr.xml
branches/jredmine-1.x/pom.xml
branches/jredmine-1.x/src/site/site_fr.xml
Modified: branches/jredmine-1.x/jredmine-client/pom.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/pom.xml 2012-07-14 12:33:53 UTC (rev 294)
+++ branches/jredmine-1.x/jredmine-client/pom.xml 2012-07-14 16:58:29 UTC (rev 295)
@@ -34,7 +34,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>jredmine</artifactId>
- <version>1.3</version>
+ <version>1.4-SNAPSHOT</version>
</parent>
<groupId>org.nuiton.jredmine</groupId>
@@ -71,6 +71,11 @@
</dependency>
<dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</dependency>
@@ -124,18 +129,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>
@@ -152,49 +145,7 @@
<!-- 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>
Modified: branches/jredmine-1.x/jredmine-client/src/site/site_fr.xml
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/site/site_fr.xml 2012-07-14 12:33:53 UTC (rev 294)
+++ branches/jredmine-1.x/jredmine-client/src/site/site_fr.xml 2012-07-14 16:58:29 UTC (rev 295)
@@ -26,43 +26,62 @@
<project name="${project.name}">
- <bannerLeft>
- <name>${project.name}</name>
- <href>index.html</href>
- </bannerLeft>
+ <bannerLeft>
+ <name>${project.name}</name>
+ <href>index.html</href>
+ </bannerLeft>
- <body>
+ <body>
- <breadcrumbs>
- <item name="${project.name}" href="index.html"/>
- </breadcrumbs>
+ <breadcrumbs>
+ <item name="${project.name}" href="index.html"/>
+ </breadcrumbs>
- <menu ref="parent"/>
+ <menu ref="parent"/>
- <menu name="Utilisateur">
- <item name="Introduction" href="index.html"/>
- <item name="JRedmine rails API" href="rails_api.html"/>
- <item name="JRedmine java service" href="redmine_service.html"/>
- </menu>
+ <menu name="Utilisateur">
+ <item name="Introduction" href="index.html"/>
+ <item name="JRedmine rails API" href="rails_api.html"/>
+ <item name="JRedmine java service" href="redmine_service.html"/>
+ </menu>
- <menu name="Téléchargement">
- <item href="http://nuiton.org/projects/list_files/jredmine" name="Sources bundles"/>
+ <menu name="Téléchargement">
+ <item href="http://nuiton.org/projects/list_files/jredmine" name="Sources bundles"/>
- <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}.jar"
- name="Librairie (jar)"/>
- <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}-javadoc.jar"
- name="Javadoc (jar)"/>
- <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}-sources.jar"
- name="Sources (jar)"/>
- <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}-tests.jar"
- name="Test Librairie (jar)"/>
- <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}-test-javadoc.jar"
- name="Test Javadoc (jar)"/>
- <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}-test-sources.jar"
- name="Test Sources (jar)"/>
- </menu>
+ <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}.jar"
+ name="Librairie (jar)"/>
+ <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}-javadoc.jar"
+ name="Javadoc (jar)"/>
+ <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}-sources.jar"
+ name="Sources (jar)"/>
+ <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}-tests.jar"
+ name="Test Librairie (jar)"/>
+ <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}-test-javadoc.jar"
+ name="Test Javadoc (jar)"/>
+ <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}-test-sources.jar"
+ name="Test Sources (jar)"/>
+ </menu>
- <menu ref="reports"/>
+ <menu ref="reports"/>
- </body>
+ <footer>
+
+ <script type="text/javascript"
+ src="http://maven-site.nuiton.org/public/js/maven-site-nuiton.org.js">
+ </script>
+
+ <div id='projectMetas'
+ projectversion='${project.version}'
+ platform='${project.platform}'
+ projectid='${project.projectId}'
+ scm='${project.scm.developerConnection}'
+ scmwebeditorenabled='${project.scmwebeditorEnabled}'
+ scmwebeditorurl='${project.scmwebeditorUrl}'
+ siteSourcesType='${project.siteSourcesType}'
+ piwikEnabled='${project.piwikEnabled}'
+ piwikId='${project.piwikId}'>
+ </div>
+ </footer>
+
+ </body>
</project>
Modified: branches/jredmine-1.x/jredmine-maven-plugin/pom.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/pom.xml 2012-07-14 12:33:53 UTC (rev 294)
+++ branches/jredmine-1.x/jredmine-maven-plugin/pom.xml 2012-07-14 16:58:29 UTC (rev 295)
@@ -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>
@@ -33,7 +35,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>jredmine</artifactId>
- <version>1.3</version>
+ <version>1.4-SNAPSHOT</version>
</parent>
<groupId>org.nuiton.jredmine</groupId>
@@ -47,13 +49,13 @@
<version>${project.version}</version>
</dependency>
- <dependency>
+ <!--dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jredmine-client</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<classifier>tests</classifier>
- </dependency>
+ </dependency-->
<dependency>
<groupId>org.nuiton</groupId>
@@ -101,7 +103,6 @@
<artifactId>maven-core</artifactId>
</dependency>
-
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
@@ -112,16 +113,17 @@
<artifactId>maven-artifact</artifactId>
</dependency>
+ <!-- dependencies to mojo annotations -->
<dependency>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-annotations</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-api</artifactId>
</dependency>
- <!--dependency>
- <groupId>org.apache.maven.reporting</groupId>
- <artifactId>maven-reporting-impl</artifactId>
- </dependency-->
-
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changes-plugin</artifactId>
@@ -203,21 +205,28 @@
<build>
- <plugins>
+ <pluginManagement>
+ <plugins>
- <plugin>
- <artifactId>maven-plugin-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>helpmojo</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
+ <plugin>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <configuration>
+ <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>helpmojo</goal>
+ <goal>descriptor</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
- </plugins>
+ </plugins>
+ </pluginManagement>
+
</build>
<!-- ************************************************************* -->
Modified: branches/jredmine-1.x/jredmine-maven-plugin/src/site/site_fr.xml
===================================================================
--- branches/jredmine-1.x/jredmine-maven-plugin/src/site/site_fr.xml 2012-07-14 12:33:53 UTC (rev 294)
+++ branches/jredmine-1.x/jredmine-maven-plugin/src/site/site_fr.xml 2012-07-14 16:58:29 UTC (rev 295)
@@ -26,55 +26,74 @@
<project name="${project.name}">
- <bannerLeft>
- <name>${project.name}</name>
- <href>index.html</href>
- </bannerLeft>
+ <bannerLeft>
+ <name>${project.name}</name>
+ <href>index.html</href>
+ </bannerLeft>
- <body>
+ <body>
- <breadcrumbs>
- <item name="${project.name}" href="index.html"/>
- </breadcrumbs>
+ <breadcrumbs>
+ <item name="${project.name}" href="index.html"/>
+ </breadcrumbs>
- <menu ref="parent"/>
+ <menu ref="parent"/>
- <menu name="Utilisateur">
- <item name="Introduction" href="index.html"/>
- <item name="Usage" href="usage.html"/>
- <item name="Goals" href="plugin-info.html">
- <item name="generate-changes" href="generate-changes-mojo.html"/>
- <item name="display-data" href="display-data-mojo.html"/>
- <item name="generate-email-announcement" href="generate-email-announcement-mojo.html"/>
- <item name="generate-news-announcement" href="generate-news-announcement-mojo.html"/>
- <item name="update-version" href="update-version-mojo.html"/>
- <item name="next-version" href="next-version-mojo.html"/>
- <item name="publish-news" href="publish-news-mojo.html"/>
- <item name="publish-attachments" href="publish-attachments-mojo.html"/>
- <item name="help" href="help-mojo.html"/>
- </item>
- <item name="Reports" href="plugin-info.html">
- <item name="issues-report" href="issues-report-mojo.html"/>
- <item name="issues-report-by-assignee" href="issues-report-by-assignee-mojo.html"/>
- <item name="issues-report-by-category" href="issues-report-by-category-mojo.html"/>
- <item name="issues-report-by-priority" href="issues-report-by-priority-mojo.html"/>
- <item name="issues-report-by-reporter" href="issues-report-by-reporter-mojo.html"/>
- <item name="issues-report-by-status" href="issues-report-by-status-mojo.html"/>
- <item name="issues-report-by-tracker" href="issues-report-by-tracker-mojo.html"/>
- <item name="issues-report-by-version" href="issues-report-by-version-mojo.html"/>
- </item>
- </menu>
+ <menu name="Utilisateur">
+ <item name="Introduction" href="index.html"/>
+ <item name="Usage" href="usage.html"/>
+ <item name="Goals" href="plugin-info.html">
+ <item name="generate-changes" href="generate-changes-mojo.html"/>
+ <item name="display-data" href="display-data-mojo.html"/>
+ <item name="generate-email-announcement" href="generate-email-announcement-mojo.html"/>
+ <item name="generate-news-announcement" href="generate-news-announcement-mojo.html"/>
+ <item name="update-version" href="update-version-mojo.html"/>
+ <item name="next-version" href="next-version-mojo.html"/>
+ <item name="publish-news" href="publish-news-mojo.html"/>
+ <item name="publish-attachments" href="publish-attachments-mojo.html"/>
+ <item name="help" href="help-mojo.html"/>
+ </item>
+ <item name="Reports" href="plugin-info.html">
+ <item name="issues-report" href="issues-report-mojo.html"/>
+ <item name="issues-report-by-assignee" href="issues-report-by-assignee-mojo.html"/>
+ <item name="issues-report-by-category" href="issues-report-by-category-mojo.html"/>
+ <item name="issues-report-by-priority" href="issues-report-by-priority-mojo.html"/>
+ <item name="issues-report-by-reporter" href="issues-report-by-reporter-mojo.html"/>
+ <item name="issues-report-by-status" href="issues-report-by-status-mojo.html"/>
+ <item name="issues-report-by-tracker" href="issues-report-by-tracker-mojo.html"/>
+ <item name="issues-report-by-version" href="issues-report-by-version-mojo.html"/>
+ </item>
+ </menu>
- <menu name="Téléchargement">
- <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-maven-plugin/${project.version}/${project.build.finalName}.jar"
- name="Librairie (jar)"/>
- <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-maven-plugin/${project.version}/${project.build.finalName}-javadoc.jar"
- name="Javadoc (jar)"/>
- <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-maven-plugin/${project.version}/${project.build.finalName}-sources.jar"
- name="Sources (jar)"/>
- </menu>
+ <menu name="Téléchargement">
+ <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-maven-plugin/${project.version}/${project.build.finalName}.jar"
+ name="Librairie (jar)"/>
+ <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-maven-plugin/${project.version}/${project.build.finalName}-javadoc.jar"
+ name="Javadoc (jar)"/>
+ <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-maven-plugin/${project.version}/${project.build.finalName}-sources.jar"
+ name="Sources (jar)"/>
+ </menu>
- <menu ref="reports"/>
+ <menu ref="reports"/>
- </body>
+ <footer>
+
+ <script type="text/javascript"
+ src="http://maven-site.nuiton.org/public/js/maven-site-nuiton.org.js">
+ </script>
+
+ <div id='projectMetas'
+ projectversion='${project.version}'
+ platform='${project.platform}'
+ projectid='${project.projectId}'
+ scm='${project.scm.developerConnection}'
+ scmwebeditorenabled='${project.scmwebeditorEnabled}'
+ scmwebeditorurl='${project.scmwebeditorUrl}'
+ siteSourcesType='${project.siteSourcesType}'
+ piwikEnabled='${project.piwikEnabled}'
+ piwikId='${project.piwikId}'>
+ </div>
+ </footer>
+
+ </body>
</project>
Modified: branches/jredmine-1.x/pom.xml
===================================================================
--- branches/jredmine-1.x/pom.xml 2012-07-14 12:33:53 UTC (rev 294)
+++ branches/jredmine-1.x/pom.xml 2012-07-14 16:58:29 UTC (rev 295)
@@ -33,11 +33,11 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmineAndCentral</artifactId>
- <version>3.1.1</version>
+ <version>3.3.4</version>
</parent>
<artifactId>jredmine</artifactId>
- <version>1.3</version>
+ <version>1.4-SNAPSHOT</version>
<modules>
<module>jredmine-client</module>
@@ -229,7 +229,15 @@
<scope>provided</scope>
</dependency>
+ <!-- dependencies to mojo annotations -->
<dependency>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-annotations</artifactId>
+ <version>${pluginPluginVersion}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>${mavenVersion}</version>
@@ -524,21 +532,16 @@
<projectId>jredmine</projectId>
+ <helperPluginVersion>1.5-SNAPSHOT</helperPluginVersion>
+
<!-- must be on a fixed version, not on the snapshot to make possible release -->
- <jredminePluginVersion>1.2.2</jredminePluginVersion>
+ <jredminePluginVersion>1.3</jredminePluginVersion>
<doxiaVersion>1.2</doxiaVersion>
<!-- documentation is in apt -->
<siteSourcesType>apt</siteSourcesType>
- <!-- test config -->
- <test.redmineUrl>http://www.mynuiton.org</test.redmineUrl>
- <test.redmineUsername>chemit</test.redmineUsername>
- <test.redminePassword>azer</test.redminePassword>
- <test.verbose>false</test.verbose>
- <test.encoding>UTF-8</test.encoding>
-
</properties>
<build>
@@ -551,11 +554,15 @@
<configuration>
<environmentVariables>
<test.redmineUrl>${test.redmineUrl}</test.redmineUrl>
- <test.redmineUsername>${test.redmineUsername}
- </test.redmineUsername>
- <test.redminePassword>${test.redminePassword}
- </test.redminePassword>
- <test.verbose>${test.verbose}</test.verbose>
+ <jredmine-test.login>
+ ${jredmine-test.login}
+ </jredmine-test.login>
+ <jredmine-test.password>
+ ${jredmine-test.password}
+ </jredmine-test.password>
+ <jredmine-test.verbose>
+ ${jredmine-test.verbose}
+ </jredmine-test.verbose>
</environmentVariables>
</configuration>
</plugin>
@@ -586,7 +593,7 @@
<plugin>
<groupId>org.nuiton.jredmine</groupId>
- <artifactId>maven-jredmine-plugin</artifactId>
+ <artifactId>jredmine-maven-plugin</artifactId>
<version>${jredminePluginVersion}</version>
<!-- TC-20100106 Due to cyclic dependency problem between modules,
we do not propagate jredmine-maven-plugin to child modules -->
@@ -618,7 +625,7 @@
<!-- generate the changes.xml from redmine -->
<plugin>
<groupId>org.nuiton.jredmine</groupId>
- <artifactId>maven-jredmine-plugin</artifactId>
+ <artifactId>jredmine-maven-plugin</artifactId>
<!-- TC-20100106 Due to cyclic dependency problem between modules,
we do not propagate jredmine-maven-plugin to child modules -->
<inherited>false</inherited>
@@ -640,8 +647,7 @@
</activation>
<properties>
<!-- always use this version to perform the profile (to use last improvements) -->
- <!-- TODO Uncomment this after release 1.3 -->
- <!--jredminePluginVersion>${project.version}</jredminePluginVersion-->
+ <jredminePluginVersion>${project.version}</jredminePluginVersion>
</properties>
@@ -659,9 +665,7 @@
<properties>
<!-- always use this version to perform the profile (to use last improvements) -->
- <!-- TODO Uncomment this after release 1.3 -->
- <!--jredminePluginVersion>${project.version}</jredminePluginVersion-->
-
+ <jredminePluginVersion>${project.version}</jredminePluginVersion>
</properties>
</profile>
Modified: branches/jredmine-1.x/src/site/site_fr.xml
===================================================================
--- branches/jredmine-1.x/src/site/site_fr.xml 2012-07-14 12:33:53 UTC (rev 294)
+++ branches/jredmine-1.x/src/site/site_fr.xml 2012-07-14 16:58:29 UTC (rev 295)
@@ -32,6 +32,30 @@
<href>index.html</href>
</bannerLeft>
+ <bannerRight>
+ <src>http://www.codelutin.com/images/lutinorange-codelutin.png</src>
+ <href>http://www.codelutin.com</href>
+ </bannerRight>
+
+ <skin>
+ <groupId>org.apache.maven.skins</groupId>
+ <artifactId>maven-fluido-skin</artifactId>
+ <version>1.2.2</version>
+ </skin>
+
+ <custom>
+ <fluidoSkin>
+ <topBarEnabled>false</topBarEnabled>
+ <googleSearch/>
+ <sideBarEnabled>true</sideBarEnabled>
+ <searchEnabled>true</searchEnabled>
+ <sourceLineNumbersEnabled>true</sourceLineNumbersEnabled>
+ </fluidoSkin>
+ </custom>
+
+ <publishDate position="right" format="dd/MM/yyyy"/>
+ <version position="right"/>
+
<poweredBy>
<logo href="http://maven.apache.org" name="Maven"
img="${project.url}/images/logos/maven-feather.png"/>
@@ -43,6 +67,12 @@
<item name="${project.name}" href="index.html"/>
</breadcrumbs>
+ <links>
+ <item name="nuiton.org" href="http://www.nuiton.org"/>
+ <item name="CodeLutin" href="http://codelutin.com"/>
+ <item name="Libre-Entreprise" href="http://www.libre-entreprise.org/"/>
+ </links>
+
<menu name="Utilisateur">
<item name="Introduction" href="index.html"/>
</menu>
@@ -51,5 +81,24 @@
<menu ref="reports"/>
+ <footer>
+
+ <script type="text/javascript"
+ src="http://maven-site.nuiton.org/public/js/maven-site-nuiton.org.js">
+ </script>
+
+ <div id='projectMetas'
+ projectversion='${project.version}'
+ platform='${project.platform}'
+ projectid='${project.projectId}'
+ scm='${project.scm.developerConnection}'
+ scmwebeditorenabled='${project.scmwebeditorEnabled}'
+ scmwebeditorurl='${project.scmwebeditorUrl}'
+ siteSourcesType='${project.siteSourcesType}'
+ piwikEnabled='${project.piwikEnabled}'
+ piwikId='${project.piwikId}'>
+ </div>
+ </footer>
+
</body>
</project>
1
0
r294 - branches/jredmine-1.x/jredmine-client/src/main/redmine/jredmine/app/controllers
by tchemit@users.nuiton.org 14 Jul '12
by tchemit@users.nuiton.org 14 Jul '12
14 Jul '12
Author: tchemit
Date: 2012-07-14 14:33:53 +0200 (Sat, 14 Jul 2012)
New Revision: 294
Url: http://nuiton.org/repositories/revision/jredmine/294
Log:
fixes #2032 (bad get_issue_times redmine plugin api)
Modified:
branches/jredmine-1.x/jredmine-client/src/main/redmine/jredmine/app/controllers/jredmine_controller.rb
Modified: branches/jredmine-1.x/jredmine-client/src/main/redmine/jredmine/app/controllers/jredmine_controller.rb
===================================================================
--- branches/jredmine-1.x/jredmine-client/src/main/redmine/jredmine/app/controllers/jredmine_controller.rb 2012-07-14 12:22:52 UTC (rev 293)
+++ branches/jredmine-1.x/jredmine-client/src/main/redmine/jredmine/app/controllers/jredmine_controller.rb 2012-07-14 12:33:53 UTC (rev 294)
@@ -182,7 +182,7 @@
# recuperation des temps d'une issue
def get_issue_times
- render_array_result @issue.time_entries, "timeEntries"
+ render_array_result @issue.time_entries, "time-entries"
end
# recuperation de la version d'un projet
1
0
Author: tchemit
Date: 2012-07-14 14:22:52 +0200 (Sat, 14 Jul 2012)
New Revision: 293
Url: http://nuiton.org/repositories/revision/jredmine/293
Log:
new branche for jredmine (and redmine 1.x maintenace)
Added:
branches/jredmine-1.x/
1
0
Author: tchemit
Date: 2012-07-13 19:44:33 +0200 (Fri, 13 Jul 2012)
New Revision: 292
Url: http://nuiton.org/repositories/revision/jredmine/292
Log:
add jredmine-cleint 2.x (to be continued\!)
Added:
trunk/jredmine-client-1.x/src/main/assembly/jredmine_rails-1.x.xml
trunk/jredmine-client-2.x/
trunk/jredmine-client-2.x/LICENSE.txt
trunk/jredmine-client-2.x/README.txt
trunk/jredmine-client-2.x/changelog.txt
trunk/jredmine-client-2.x/pom.xml
trunk/jredmine-client-2.x/src/
trunk/jredmine-client-2.x/src/license/
trunk/jredmine-client-2.x/src/main/
trunk/jredmine-client-2.x/src/main/java/
trunk/jredmine-client-2.x/src/main/java/org/
trunk/jredmine-client-2.x/src/main/java/org/nuiton/
trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/
trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/
trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/RedmineAnonymousServiceImpl.java
trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/RedmineRequestFactoryImpl.java
trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/RedmineRestClient.java
trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/RedmineServiceImpl.java
trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/RedmineServiceImplementorImpl.java
trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/RedmineServiceProviderImpl.java
trunk/jredmine-client-2.x/src/main/resources/
trunk/jredmine-client-2.x/src/site/
trunk/jredmine-client-2.x/src/site/apt/
trunk/jredmine-client-2.x/src/site/apt/index.apt
trunk/jredmine-client-2.x/src/site/apt/rails_api.apt
trunk/jredmine-client-2.x/src/site/apt/redmine_service.apt
trunk/jredmine-client-2.x/src/site/site_fr.xml
trunk/jredmine-client-2.x/src/test/
trunk/jredmine-client-2.x/src/test/java/
trunk/jredmine-client-2.x/src/test/java/org/
trunk/jredmine-client-2.x/src/test/java/org/nuiton/
trunk/jredmine-client-2.x/src/test/java/org/nuiton/jredmine/
trunk/jredmine-client-2.x/src/test/java/org/nuiton/jredmine/v2_x/
trunk/jredmine-client-2.x/src/test/java/org/nuiton/jredmine/v2_x/RedmineAnonymousServiceTest.java
trunk/jredmine-client-2.x/src/test/java/org/nuiton/jredmine/v2_x/RedmineFixtures.java
trunk/jredmine-client-2.x/src/test/java/org/nuiton/jredmine/v2_x/RedmineServer.java
trunk/jredmine-client-2.x/src/test/java/org/nuiton/jredmine/v2_x/RedmineServiceAsAnonymousTest.java
trunk/jredmine-client-2.x/src/test/java/org/nuiton/jredmine/v2_x/RedmineServiceTest.java
trunk/jredmine-client-2.x/src/test/resources/
trunk/jredmine-client-2.x/src/test/resources/log4j.properties
trunk/jredmine-client-2.x/src/test/resources/test-config.properties
Removed:
trunk/jredmine-client-1.x/src/main/assembly/jredmine_rails-1.3.x.xml
Modified:
trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_x/RedmineServiceProviderImpl.java
trunk/jredmine-maven-plugin/pom.xml
trunk/pom.xml
Deleted: trunk/jredmine-client-1.x/src/main/assembly/jredmine_rails-1.3.x.xml
===================================================================
--- trunk/jredmine-client-1.x/src/main/assembly/jredmine_rails-1.3.x.xml 2012-07-13 17:16:17 UTC (rev 291)
+++ trunk/jredmine-client-1.x/src/main/assembly/jredmine_rails-1.3.x.xml 2012-07-13 17:44:33 UTC (rev 292)
@@ -1,40 +0,0 @@
-<!--
- #%L
- JRedmine :: Client
-
- $Id$
- $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/main/assembly/… $
- %%
- 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%
- -->
-<assembly>
- <id>jredmine_rails-1.3.x</id>
- <formats>
- <format>zip</format>
- </formats>
- <includeBaseDirectory>false</includeBaseDirectory>
- <fileSets>
- <fileSet>
- <directory>src/main/redmine/jredmine</directory>
- <outputDirectory>jredmine</outputDirectory>
- <includes>
- <include>**/*</include>
- </includes>
- </fileSet>
- </fileSets>
-</assembly>
\ No newline at end of file
Copied: trunk/jredmine-client-1.x/src/main/assembly/jredmine_rails-1.x.xml (from rev 290, trunk/jredmine-client-1.x/src/main/assembly/jredmine_rails-1.3.x.xml)
===================================================================
--- trunk/jredmine-client-1.x/src/main/assembly/jredmine_rails-1.x.xml (rev 0)
+++ trunk/jredmine-client-1.x/src/main/assembly/jredmine_rails-1.x.xml 2012-07-13 17:44:33 UTC (rev 292)
@@ -0,0 +1,40 @@
+<!--
+ #%L
+ JRedmine :: Client
+
+ $Id$
+ $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/main/assembly/… $
+ %%
+ 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%
+ -->
+<assembly>
+ <id>jredmine_rails-1.3.x</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <fileSets>
+ <fileSet>
+ <directory>src/main/redmine/jredmine</directory>
+ <outputDirectory>jredmine</outputDirectory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+</assembly>
\ No newline at end of file
Property changes on: trunk/jredmine-client-1.x/src/main/assembly/jredmine_rails-1.x.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Modified: trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_x/RedmineServiceProviderImpl.java
===================================================================
--- trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_x/RedmineServiceProviderImpl.java 2012-07-13 17:16:17 UTC (rev 291)
+++ trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_x/RedmineServiceProviderImpl.java 2012-07-13 17:44:33 UTC (rev 292)
@@ -39,7 +39,7 @@
@Override
public String getRedmineVersion() {
- return "1.3.x";
+ return "1";
}
@Override
Property changes on: trunk/jredmine-client-2.x
___________________________________________________________________
Added: svn:ignore
+ target
*.ipr
*.iws
*.iml
.idea
.project
.classpath
.settings
Added: trunk/jredmine-client-2.x/LICENSE.txt
===================================================================
--- trunk/jredmine-client-2.x/LICENSE.txt (rev 0)
+++ trunk/jredmine-client-2.x/LICENSE.txt 2012-07-13 17:44:33 UTC (rev 292)
@@ -0,0 +1,166 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
+
Property changes on: trunk/jredmine-client-2.x/LICENSE.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-2.x/README.txt
===================================================================
--- trunk/jredmine-client-2.x/README.txt (rev 0)
+++ trunk/jredmine-client-2.x/README.txt 2012-07-13 17:44:33 UTC (rev 292)
@@ -0,0 +1,2 @@
+To deploy new version of pom: mvn deploy
+To install localy: mvn install
Property changes on: trunk/jredmine-client-2.x/README.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-2.x/changelog.txt
===================================================================
--- trunk/jredmine-client-2.x/changelog.txt (rev 0)
+++ trunk/jredmine-client-2.x/changelog.txt 2012-07-13 17:44:33 UTC (rev 292)
@@ -0,0 +1,5 @@
+maven-redmine-plugin (1.0.0-SNAPSHOT) stable; urgency=low
+
+ * //TODO_FILL_ME
+
+ -- author -- date -R
Property changes on: trunk/jredmine-client-2.x/changelog.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-2.x/pom.xml
===================================================================
--- trunk/jredmine-client-2.x/pom.xml (rev 0)
+++ trunk/jredmine-client-2.x/pom.xml 2012-07-13 17:44:33 UTC (rev 292)
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ JRedmine :: Client 2.x
+ %%
+ 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%
+ -->
+
+<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>
+
+ <!-- ************************************************************* -->
+ <!-- *** POM Relationships *************************************** -->
+ <!-- ************************************************************* -->
+
+ <parent>
+ <groupId>org.nuiton</groupId>
+ <artifactId>jredmine</artifactId>
+ <version>1.4-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-client-2.x</artifactId>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>jredmine-client-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.nuiton</groupId>
+ <artifactId>helper-maven-plugin</artifactId>
+ <scope>compile</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>velocity</groupId>
+ <artifactId>velocity</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+
+ </dependencies>
+
+ <name>JRedmine :: Client 2.x</name>
+ <description>The JRedmine client for redmine 2.x series</description>
+
+ <properties>
+ <!-- extra files to include in release -->
+ <redmine.releaseFiles>
+ ${redmine.libReleaseFiles}
+ </redmine.releaseFiles>
+ </properties>
+
+ <build>
+
+ <plugins>
+ <!-- expose new plexus components -->
+ <plugin>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-metadata</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate-metadata</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+
+ </build>
+
+ <reporting>
+ <excludeDefaults>true</excludeDefaults>
+ </reporting>
+
+ <profiles>
+
+ <profile>
+ <id>reporting</id>
+ <activation>
+ <property>
+ <name>performRelease</name>
+ <value>true</value>
+ </property>
+ </activation>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.plexus</groupId>
+ <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>
+
+ </profiles>
+
+</project>
Property changes on: trunk/jredmine-client-2.x/pom.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/RedmineAnonymousServiceImpl.java
===================================================================
--- trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/RedmineAnonymousServiceImpl.java (rev 0)
+++ trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/RedmineAnonymousServiceImpl.java 2012-07-13 17:44:33 UTC (rev 292)
@@ -0,0 +1,289 @@
+package org.nuiton.jredmine.v2_x;
+/*
+ * #%L
+ * JRedmine :: Client 2.x
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.io.rest.RestClient;
+import org.nuiton.jredmine.RedmineAnonymousService;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+import org.nuiton.jredmine.RedmineServiceImplementor;
+import org.nuiton.jredmine.RedmineServiceLoginException;
+import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.Issue;
+import org.nuiton.jredmine.model.IssueCategory;
+import org.nuiton.jredmine.model.IssuePriority;
+import org.nuiton.jredmine.model.IssueStatus;
+import org.nuiton.jredmine.model.ModelHelper;
+import org.nuiton.jredmine.model.News;
+import org.nuiton.jredmine.model.Project;
+import org.nuiton.jredmine.model.TimeEntry;
+import org.nuiton.jredmine.model.Tracker;
+import org.nuiton.jredmine.model.User;
+import org.nuiton.jredmine.model.Version;
+
+/**
+ * Default implementation of {@link RedmineAnonymousService}.
+ * <p/>
+ * This implementation just make sure that the rest client is anonnymous.
+ * <p/>
+ * Created: 2 janv. 2010
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @see RedmineServiceConfiguration#isAnonymous()
+ * @since 1.0.3
+ */
+public class RedmineAnonymousServiceImpl implements RedmineServiceImplementor, RedmineAnonymousService {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(RedmineAnonymousServiceImpl.class);
+
+ protected RedmineServiceImplementor delegateImplementor;
+
+ public RedmineAnonymousServiceImpl() {
+ delegateImplementor = new RedmineServiceImplementorImpl();
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ /// RedmineAnonymousService implementation
+ ///////////////////////////////////////////////////////////////////////////
+
+ @Override
+ public IssueStatus[] getIssueStatuses() throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_ISSUE_STATUS_REQUEST_NAME,
+ IssueStatus.class
+ );
+ }
+
+ @Override
+ public IssuePriority[] getIssuePriorities() throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_ISSUE_PRIORITY_REQUEST_NAME,
+ IssuePriority.class
+ );
+ }
+
+ @Override
+ public Project[] getProjects() throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_PROJECT_REQUEST_NAME, Project.class);
+ }
+
+ @Override
+ public IssueCategory[] getIssueCategories(String projectName) throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_ISSUE_CATEGORY_REQUEST_NAME,
+ IssueCategory.class,
+ projectName
+ );
+ }
+
+ @Override
+ public Project getProject(String projectName) throws RedmineServiceException {
+ return getData(ModelHelper.GET_PROJECT_REQUEST_NAME,
+ Project.class,
+ projectName
+ );
+ }
+
+ @Override
+ public Tracker[] getTrackers(String projectName) throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_TRACKER_REQUEST_NAME,
+ Tracker.class,
+ projectName
+ );
+ }
+
+ @Override
+ public News[] getNews(String projectName) throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_NEWS_REQUEST_NAME,
+ News.class,
+ projectName
+ );
+ }
+
+ @Override
+ public User[] getProjectMembers(String projectName) throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_USER_REQUEST_NAME,
+ User.class,
+ projectName
+ );
+ }
+
+ @Override
+ public Version[] getVersions(String projectName) throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_VERSION_REQUEST_NAME,
+ Version.class,
+ projectName
+ );
+ }
+
+ @Override
+ public Version getVersion(String projectName,
+ String versionName) throws RedmineServiceException {
+ return getData(ModelHelper.GET_VERSION_REQUEST_NAME,
+ Version.class,
+ projectName,
+ versionName
+ );
+ }
+
+ @Override
+ public Attachment[] getAttachments(String projectName,
+ String versionName) throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_ATTACHMENTS_REQUEST_NAME,
+ Attachment.class,
+ projectName,
+ versionName
+ );
+ }
+
+ @Override
+ public Issue[] getIssues(String projectName,
+ String versionName) throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_ISSUES_REQUEST_NAME,
+ Issue.class,
+ projectName,
+ versionName
+ );
+ }
+
+ @Override
+ public TimeEntry[] getIssueTimeEntries(String projectName,
+ String issueId) throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_ISSUE_TIME_ENTRY_REQUEST_NAME,
+ TimeEntry.class,
+ projectName,
+ issueId
+ );
+ }
+
+ @Override
+ public Issue[] getIssues(String projectName) throws RedmineServiceException {
+ Issue[] result = getDatas(ModelHelper.GET_ALL_PROJECT_ISSUES_REQUEST_NAME,
+ Issue.class,
+ projectName
+ );
+ return result;
+ }
+
+ @Override
+ public Issue[] getOpenedIssues(String projectName) throws RedmineServiceException {
+ Issue[] result = getDatas(ModelHelper.GET_ALL_PROJECT_OPENED_ISSUES_REQUEST_NAME,
+ Issue.class,
+ projectName
+ );
+ return result;
+ }
+
+ @Override
+ public Issue[] getClosedIssues(String projectName) throws RedmineServiceException {
+ Issue[] result = getDatas(ModelHelper.GET_ALL_PROJECT_CLOSED_ISSUES_REQUEST_NAME,
+ Issue.class,
+ projectName
+ );
+ return result;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ /// RedmineServiceImplementor implementation
+ ///////////////////////////////////////////////////////////////////////////
+ @Override
+ public RedmineServiceImplementor init(RedmineServiceConfiguration configuration) throws RedmineServiceException {
+ // Force to not be loggued
+ configuration.setAnonymous(true);
+ if (log.isDebugEnabled()) {
+ log.debug("init configuration for " + this);
+ }
+ return delegateImplementor.init(configuration);
+ }
+
+ @Override
+ public RestClient getSession() {
+ return delegateImplementor.getSession();
+ }
+
+ @Override
+ public int ping() {
+ return delegateImplementor.ping();
+ }
+
+ @Override
+ public void login() throws RedmineServiceLoginException {
+ delegateImplementor.login();
+ }
+
+ @Override
+ public void logout() throws RedmineServiceLoginException {
+ delegateImplementor.logout();
+ }
+
+ @Override
+ public <T> T getData(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ return delegateImplementor.getData(requestName, type, args);
+ }
+
+ @Override
+ public <T> T[] getDatas(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ return delegateImplementor.getDatas(requestName, type, args);
+ }
+
+ @Override
+ public <T> T sendData(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ return delegateImplementor.sendData(requestName, type, args);
+ }
+
+ @Override
+ public <T> T[] sendDatas(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ return delegateImplementor.sendDatas(requestName, type, args);
+ }
+
+ @Override
+ public boolean isInit() {
+ return delegateImplementor.isInit();
+ }
+
+ @Override
+ public boolean isLoggued() {
+ return delegateImplementor.isLoggued();
+ }
+
+ @Override
+ public void destroy() throws RedmineServiceException {
+ delegateImplementor.destroy();
+ }
+
+ @Override
+ public void checkLoggued() throws IllegalStateException, RedmineServiceLoginException, NullPointerException {
+ delegateImplementor.checkLoggued();
+ }
+
+}
Property changes on: trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/RedmineAnonymousServiceImpl.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/RedmineRequestFactoryImpl.java
===================================================================
--- trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/RedmineRequestFactoryImpl.java (rev 0)
+++ trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/RedmineRequestFactoryImpl.java 2012-07-13 17:44:33 UTC (rev 292)
@@ -0,0 +1,232 @@
+package org.nuiton.jredmine.v2_x;
+/*
+ * #%L
+ * JRedmine :: Client 2.x
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import com.google.common.base.Strings;
+import org.nuiton.io.rest.AbstractRequestFactory;
+import org.nuiton.io.rest.RestMethod;
+import org.nuiton.io.rest.RestRequest;
+import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.ModelHelper;
+import org.nuiton.jredmine.model.News;
+import org.nuiton.jredmine.model.TimeEntry;
+import org.nuiton.jredmine.model.Version;
+import org.nuiton.jredmine.model.VersionStatusEnum;
+import org.nuiton.jredmine.request.DefaultRedmineRequestBuilder;
+import org.nuiton.jredmine.request.IssueScopeRedmineRequestBuilder;
+import org.nuiton.jredmine.request.ProjectScopeRedmineRequestBuilder;
+import org.nuiton.jredmine.request.VersionScopeRedmineRequestBuilder;
+
+import java.io.File;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Factory of {@link RestRequest}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public class RedmineRequestFactoryImpl extends AbstractRequestFactory {
+
+ @Override
+ public void addDefaultRequests() {
+
+ // misc requests
+
+ addRequestBuilder(new DefaultRedmineRequestBuilder(ModelHelper.PING_REQUEST_NAME, RestMethod.GET, "projects"));
+ addRequestBuilder(new DefaultRedmineRequestBuilder(ModelHelper.LOGOUT_REQUEST_NAME, RestMethod.GET, "logout"));
+ addRequestBuilder(new DefaultRedmineRequestBuilder(ModelHelper.LOGIN_REQUEST_NAME, RestMethod.POST, "login") {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+ String login = (String) args[0];
+ String password = (String) args[1];
+ return new String[]{"username", login, "password", password};
+ }
+ });
+
+ // data with no scope requests
+
+ addRequestBuilder(new DefaultRedmineRequestBuilder(ModelHelper.GET_ALL_PROJECT_REQUEST_NAME, RestMethod.GET, "projects.xml"));
+ addRequestBuilder(new DefaultRedmineRequestBuilder(ModelHelper.GET_USER_PROJECTS_REQUEST_NAME, RestMethod.GET, "jredmine", "get_user_projects.xml"));
+ addRequestBuilder(new DefaultRedmineRequestBuilder(ModelHelper.GET_ALL_ISSUE_STATUS_REQUEST_NAME, RestMethod.GET, "jredmine", "get_issue_statuses.xml"));
+ addRequestBuilder(new DefaultRedmineRequestBuilder(ModelHelper.GET_ALL_ISSUE_PRIORITY_REQUEST_NAME, RestMethod.GET, "jredmine", "get_issue_priorities.xml"));
+
+ // data with project scope requests
+
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_PROJECT_REQUEST_NAME, RestMethod.GET, "projects")); // projectName.xml
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_PROJECT_ISSUES_REQUEST_NAME, RestMethod.GET, "issues.xml")); // ?project_id=10&limit=10000
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_PROJECT_OPENED_ISSUES_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_opened_issues.xml")); //project_id=10&status_id=open&limit=10000
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_PROJECT_CLOSED_ISSUES_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_closed_issues.xml")); //project_id=10&status_id=closed&limit=10000
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_VERSION_REQUEST_NAME, RestMethod.GET, "projects", "versions.xml")); // projectName
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_ISSUE_CATEGORY_REQUEST_NAME, RestMethod.GET, "jredmine", "get_issue_categories.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_TRACKER_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_trackers.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_USER_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_users.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_NEWS_REQUEST_NAME, RestMethod.GET, "projects", "news.xml")); // projectName middle
+
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.ADD_VERSION_REQUEST_NAME, RestMethod.POST, "jredmine", "add_version.xml") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+ Version version = (Version) args[1];
+ String date = getVersionEffectiveDate(version);
+ String status = getVersionStatus(version);
+ return new String[]{
+ "version[name]", version.getName(),
+ "version[description]", version.getDescription(),
+ "version[effective_date]", date,
+ "version[status]", status
+ };
+ }
+ });
+
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.UPDATE_VERSION_REQUEST_NAME, RestMethod.POST, "jredmine", "update_version.xml") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+ Version version = (Version) args[1];
+ String date = getVersionEffectiveDate(version);
+ String status = getVersionStatus(version);
+ return new String[]{
+ "version[name]", version.getName(),
+ "version[description]", version.getDescription(),
+ "version[effective_date]", date,
+ "version[status]", status
+ };
+ }
+ });
+
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.NEXT_VERSION_REQUEST_NAME, RestMethod.POST, "jredmine", "next_version.xml") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+
+
+ Version version = (Version) args[1];
+ String date = getVersionEffectiveDate(version);
+ String status = getVersionStatus(version);
+ String oldVersionName = (String) args[2];
+ return new String[]{
+ "oldVersionName", oldVersionName,
+ "version[name]", version.getName(),
+ "version[description]", version.getDescription(),
+ "version[effective_date]", date,
+ "version[status]", status
+ };
+ }
+ });
+
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.ADD_NEWS_REQUEST_NAME, RestMethod.POST, "jredmine", "add_news.xml") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+ News news = (News) args[1];
+ return new String[]{
+ "news[title]", news.getTitle(),
+ "news[summary]", news.getSummary(),
+ "news[description]", news.getDescription()
+ };
+ }
+ });
+
+ // version scope requests
+
+ addRequestBuilder(new VersionScopeRedmineRequestBuilder(ModelHelper.GET_VERSION_REQUEST_NAME, RestMethod.GET, "versions"));
+ addRequestBuilder(new VersionScopeRedmineRequestBuilder(ModelHelper.GET_ALL_ISSUES_REQUEST_NAME, RestMethod.GET, "jredmine", "get_version_issues.xml"));
+ addRequestBuilder(new VersionScopeRedmineRequestBuilder(ModelHelper.GET_ALL_ATTACHMENTS_REQUEST_NAME, RestMethod.GET, "jredmine", "get_version_attachments.xml"));
+ addRequestBuilder(new VersionScopeRedmineRequestBuilder(ModelHelper.ADD_ATTACHMENT_REQUEST_NAME, RestMethod.POST, "jredmine", "add_version_attachment.xml") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+ String versionId = (String) args[1];
+ Attachment attachment = (Attachment) args[2];
+ return new String[]{
+ "version_name", versionId,
+ "attachment[description]", attachment.getDescription()
+ };
+ }
+
+ @Override
+ public Map<String, File> getAttachments(Object... args) {
+ Map<String, File> upload = new HashMap<String, File>();
+ Attachment attachment = (Attachment) args[2];
+ upload.put("attachment[file]", attachment.getToUpload());
+ return upload;
+ }
+ });
+
+ // issue scope requests
+
+ addRequestBuilder(new IssueScopeRedmineRequestBuilder(ModelHelper.GET_ALL_ISSUE_TIME_ENTRY_REQUEST_NAME, RestMethod.GET, "jredmine", "get_issue_times.xml"));
+
+ addRequestBuilder(new IssueScopeRedmineRequestBuilder(ModelHelper.ADD_ISSUE_TIME_ENTRY_REQUEST_NAME, RestMethod.POST, "jredmine", "add_issue_time.xml") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+ String issueId = (String) args[1];
+ TimeEntry timeEntry = (TimeEntry) args[2];
+ Date d = timeEntry.getSpentOn();
+ if (d == null) {
+ d = new Date();
+ }
+ String date = DATE_FORMAT.format(d);
+ return new String[]{
+ "issue_id", issueId,
+ //"timeEntry[issue_id]", issueId,
+ "time_entry[activity_id]", timeEntry.getActivityId() + "",
+ "time_entry[spent_on]", date,
+ "time_entry[hours]", timeEntry.getHours() + "",
+ "time_entry[comments]", timeEntry.getComments() == null ? "" : timeEntry.getComments()
+ };
+ }
+ });
+ }
+
+ protected static String getVersionStatus(Version version) {
+ String status = version.getStatus();
+ if (Strings.isNullOrEmpty(status)) {
+
+ // use default open status
+ status = VersionStatusEnum.open.name();
+ }
+ return status;
+ }
+
+ protected static String getVersionEffectiveDate(Version version) {
+ return version.getEffectiveDate() == null ? "" :
+ DATE_FORMAT.format(version.getEffectiveDate());
+ }
+
+
+}
Property changes on: trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/RedmineRequestFactoryImpl.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/RedmineRestClient.java
===================================================================
--- trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/RedmineRestClient.java (rev 0)
+++ trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/RedmineRestClient.java 2012-07-13 17:44:33 UTC (rev 292)
@@ -0,0 +1,175 @@
+package org.nuiton.jredmine.v2_x;
+/*
+ * #%L
+ * JRedmine :: Client 2.x
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import org.apache.commons.httpclient.HttpMethod;
+import org.apache.commons.httpclient.HttpStatus;
+import org.apache.commons.httpclient.StatusLine;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codehaus.plexus.util.StringUtils;
+import org.nuiton.io.rest.RequestFactory;
+import org.nuiton.io.rest.RestClient;
+import org.nuiton.io.rest.RestRequest;
+import org.nuiton.io.rest.RestSession;
+import org.nuiton.jredmine.model.ModelHelper;
+import org.nuiton.jredmine.model.Version;
+import org.nuiton.jredmine.model.VersionStatusEnum;
+
+import java.io.IOException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
+/**
+ * Implementation of a {@link RestClient} to access a Redmine server via the
+ * {@code redmine_rest} rails plugin.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0.0
+ */
+public class RedmineRestClient extends RestClient {
+
+ private static final Log log = LogFactory.getLog(RedmineRestClient.class);
+
+ /**
+ * To obtain redmine requests.
+ *
+ * @since 1.4
+ */
+ protected RequestFactory requestFactory;
+
+ public final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd");
+
+ public RedmineRestClient() {
+ requestFactory = new RedmineRequestFactoryImpl();
+ }
+
+ @Override
+ public RequestFactory getRequestFactory() {
+ return requestFactory;
+ }
+
+ @Override
+ protected void open(RestSession session) throws IOException {
+
+ ping(session);
+
+ if (!configuration.isAnonymous()) {
+ login(session);
+ }
+ }
+
+ @Override
+ protected void close(RestSession session) throws IOException {
+
+ if (session != null) {
+
+ try {
+ RestRequest request = getRequest(ModelHelper.LOGOUT_REQUEST_NAME);
+ session.setOpen(false);
+ session.doRequest(request);
+ } finally {
+ session.close();
+ }
+ }
+ }
+
+ public int ping(RestSession session) throws IOException {
+
+ try {
+
+ RestRequest request = getRequest(ModelHelper.PING_REQUEST_NAME);
+ HttpMethod gm = session.doRequest(request);
+
+ StatusLine sl = gm.getStatusLine();
+ int statusCode = sl.getStatusCode();
+ if (log.isDebugEnabled()) {
+ log.debug("status code " + statusCode + " for " + gm.getPath());
+ }
+
+ if (statusCode != HttpStatus.SC_OK) {
+ gm.releaseConnection();
+ throw new IOException(
+ "Got error code <" + statusCode + ":" +
+ sl.getReasonPhrase() + "> on " + gm.getPath());
+ }
+
+// String content = gm.getResponseBodyAsString();
+//
+// boolean ok = "ping".equals(content);
+// if (!ok) {
+// throw new IOException(
+// "can not connect to " + configuration.getRestUrl());
+// }
+ return statusCode;
+ } catch (IOException ex) {
+ throw ex;
+ } catch (Exception ex) {
+ throw new IOException(
+ "could not ping " + configuration.getRestUrl() +
+ " for reason " + ex.getMessage(), ex);
+ }
+ }
+
+ public void login(RestSession session) throws IOException {
+
+ RestRequest request = getRequest(ModelHelper.LOGIN_REQUEST_NAME,
+ configuration.getRestUsername(),
+ configuration.getRestPassword());
+
+ HttpMethod gm = session.doRequest(request);
+
+ StatusLine sl = gm.getStatusLine();
+ int statusCode = sl.getStatusCode();
+ if (log.isDebugEnabled()) {
+ log.debug("status code " + statusCode + " for " + gm.getPath());
+ }
+
+ if (statusCode != HttpStatus.SC_OK &&
+ statusCode != HttpStatus.SC_MOVED_TEMPORARILY) {
+ gm.releaseConnection();
+ throw new IOException(
+ "Got error code <" + statusCode + ":" +
+ sl.getReasonPhrase() + "> on " + gm.getPath());
+ }
+
+ // ok session is logged in
+
+ }
+
+ protected String getVersionStatus(Version version) {
+ String status = version.getStatus();
+ if (StringUtils.isEmpty(status)) {
+
+ // use default open status
+ status = VersionStatusEnum.open.name();
+ }
+ return status;
+ }
+
+ protected String getVersionEffectiveDate(Version version) {
+ return version.getEffectiveDate() == null ? "" :
+ DATE_FORMAT.format(version.getEffectiveDate());
+ }
+}
Property changes on: trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/RedmineRestClient.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/RedmineServiceImpl.java
===================================================================
--- trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/RedmineServiceImpl.java (rev 0)
+++ trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/RedmineServiceImpl.java 2012-07-13 17:44:33 UTC (rev 292)
@@ -0,0 +1,151 @@
+package org.nuiton.jredmine.v2_x;
+/*
+ * #%L
+ * JRedmine :: Client 2.x
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.io.rest.RestClient;
+import org.nuiton.jredmine.RedmineService;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+import org.nuiton.jredmine.RedmineServiceImplementor;
+import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.ModelHelper;
+import org.nuiton.jredmine.model.News;
+import org.nuiton.jredmine.model.Project;
+import org.nuiton.jredmine.model.TimeEntry;
+import org.nuiton.jredmine.model.Version;
+
+/**
+ * Default {@link RedmineService} implementation based on a {@link RestClient}
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0.0
+ */
+public class RedmineServiceImpl extends RedmineAnonymousServiceImpl implements RedmineService {
+
+ protected static final Log log = LogFactory.getLog(RedmineServiceImpl.class);
+
+ ///////////////////////////////////////////////////////////////////////////
+ /// RedmineServiceImplementor implementation
+ ///////////////////////////////////////////////////////////////////////////
+
+ @Override
+ public RedmineServiceImplementor init(RedmineServiceConfiguration configuration) throws RedmineServiceException {
+ return delegateImplementor.init(configuration);
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ /// RedmineLogguedService implementation
+ ///////////////////////////////////////////////////////////////////////////
+
+ @Override
+ public Project[] getUserProjects() throws RedmineServiceException {
+ checkLoggued();
+ Project[] result = getDatas(ModelHelper.GET_USER_PROJECTS_REQUEST_NAME, Project.class);
+ return result;
+ }
+
+ @Override
+ public Version addVersion(String projectName,
+ Version version) throws RedmineServiceException {
+
+ // send data and obtain created version
+ Version result = sendData(ModelHelper.ADD_VERSION_REQUEST_NAME,
+ Version.class,
+ projectName,
+ version
+ );
+ return result;
+ }
+
+ @Override
+ public Version updateVersion(String projectName,
+ Version version) throws RedmineServiceException {
+
+ // send data and obtain updated version
+ Version result = sendData(ModelHelper.UPDATE_VERSION_REQUEST_NAME,
+ Version.class,
+ projectName,
+ version
+ );
+ return result;
+ }
+
+ @Override
+ public Version nextVersion(String projectName,
+ String oldVersionName,
+ Version newVersion) throws RedmineServiceException {
+
+ // send data and obtain updated or created new version
+ Version result = sendData(ModelHelper.NEXT_VERSION_REQUEST_NAME,
+ Version.class,
+ projectName,
+ newVersion,
+ oldVersionName
+ );
+ return result;
+ }
+
+ @Override
+ public Attachment addAttachment(String projectName,
+ String versionName,
+ Attachment attachement) throws RedmineServiceException {
+
+ // send data and obtain created attachment
+ Attachment result = sendData(ModelHelper.ADD_ATTACHMENT_REQUEST_NAME,
+ Attachment.class,
+ projectName,
+ versionName,
+ attachement
+ );
+ return result;
+ }
+
+ @Override
+ public News addNews(String projectName,
+ News news) throws RedmineServiceException {
+ // send data and obtain created news
+ News result = sendData(ModelHelper.ADD_NEWS_REQUEST_NAME,
+ News.class,
+ projectName,
+ news
+ );
+ return result;
+ }
+
+ @Override
+ public TimeEntry addIssueTimeEntry(String projectName,
+ String issueId,
+ TimeEntry entry) throws RedmineServiceException {
+ // send data and obtain updated version
+ TimeEntry result = sendData(ModelHelper.ADD_ISSUE_TIME_ENTRY_REQUEST_NAME,
+ TimeEntry.class,
+ projectName,
+ issueId,
+ entry
+ );
+ return result;
+ }
+}
Property changes on: trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/RedmineServiceImpl.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/RedmineServiceImplementorImpl.java
===================================================================
--- trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/RedmineServiceImplementorImpl.java (rev 0)
+++ trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/RedmineServiceImplementorImpl.java 2012-07-13 17:44:33 UTC (rev 292)
@@ -0,0 +1,317 @@
+package org.nuiton.jredmine.v2_x;
+/*
+ * #%L
+ * JRedmine :: Client 2.x
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.io.rest.RestClient;
+import org.nuiton.io.rest.RestException;
+import org.nuiton.io.rest.RestRequest;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+import org.nuiton.jredmine.RedmineServiceImplementor;
+import org.nuiton.jredmine.RedmineServiceLoginException;
+import org.nuiton.jredmine.model.io.xpp3.DefaultRedmineXpp3Helper;
+import org.nuiton.jredmine.model.io.xpp3.RedmineXpp3Helper;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * Default Redmine technical service implementation.
+ * <p/>
+ * Created: 2 janv. 2010
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @see RedmineServiceImplementor
+ * @since 1.0.3
+ */
+public class RedmineServiceImplementorImpl implements RedmineServiceImplementor {
+
+ /** Logger */
+ private static final Log log =
+ LogFactory.getLog(RedmineServiceImplementorImpl.class);
+
+ /** Client Rest. */
+ protected final RedmineRestClient session;
+
+ /** xpp3 xpp3Helper to transform xml stream to pojo. */
+ protected final RedmineXpp3Helper xpp3Helper;
+
+ /** internal state to known if service was init */
+ protected boolean init;
+
+ /** internal state to known if service was opened */
+ protected boolean open;
+
+ public RedmineServiceImplementorImpl() {
+ if (log.isDebugEnabled()) {
+ log.debug("new " + this);
+ }
+ session = new RedmineRestClient();
+ xpp3Helper = new DefaultRedmineXpp3Helper();
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ /// RedmineServiceImplementor implementation
+ ///////////////////////////////////////////////////////////////////////////
+
+
+ public RedmineRestClient getSession() {
+ return session;
+ }
+
+ @Override
+ public boolean isInit() {
+ return init;
+ }
+
+ @Override
+ public boolean isLoggued() {
+ return session.isOpen();
+ }
+
+ @Override
+ public RedmineServiceImplementor init(RedmineServiceConfiguration configuration) throws RedmineServiceException {
+ session.setConfiguration(configuration);
+ session.requestFactory.addDefaultRequests();
+ RedmineServiceImplementor result = init(session);
+ return result;
+ }
+
+ public RedmineServiceImplementor init(RedmineRestClient session) throws RedmineServiceException {
+ if (open) {
+ throw new IllegalStateException(
+ "the client " + this + " was already opened!");
+ }
+ try {
+
+ if (!session.isOpen()) {
+ session.open();
+ }
+
+ init = true;
+ } catch (Exception e) {
+ throw new RedmineServiceException(
+ "could not init service for reason " + e.getMessage(), e);
+ }
+ return this;
+ }
+
+ @Override
+ public int ping() {
+
+ try {
+ return session.ping(session.getSession());
+ } catch (IOException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Could not ping ", e);
+ }
+ return -1;
+ }
+ }
+
+ @Override
+ public void login() {
+ }
+
+ @Override
+ public void logout() {
+ }
+
+ @Override
+ public void destroy() throws RedmineServiceException {
+ checkInit();
+ try {
+ if (session.isOpen()) {
+ try {
+ session.close();
+ } catch (RestException ex) {
+ throw new RedmineServiceException(
+ "has problem while closing Rest client " +
+ ex.getMessage(), ex);
+ }
+ }
+ } finally {
+ // can't remove the reference since plexus injects it
+// if (session != null) {
+// session = null;
+// }
+ init = false;
+ }
+ }
+
+ @Override
+ public <T> T getData(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ checkInit();
+ InputStream stream = askDataStream(requestName, args);
+ T result = getDataFromStream(type, stream);
+ return result;
+ }
+
+ @Override
+ public <T> T[] getDatas(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ checkInit();
+ InputStream stream = askDataStream(requestName, args);
+ T[] result = getDatasFromStream(type, stream);
+ return result;
+ }
+
+ @Override
+ public <T> T sendData(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ checkLoggued();
+ InputStream stream = sendDataStream(requestName, args);
+ T result = getDataFromStream(type, stream);
+ return result;
+ }
+
+ @Override
+ public <T> T[] sendDatas(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ checkLoggued();
+ InputStream stream = sendDataStream(requestName, args);
+ T[] result = getDatasFromStream(type, stream);
+ return result;
+ }
+
+ @Override
+ public void checkLoggued() throws IllegalStateException, RedmineServiceLoginException, NullPointerException {
+ checkInit();
+ checkSessionNotNull(session);
+ checkSessionConfigurationNotNull(session);
+ if (session.getConfiguration().isAnonymous()) {
+ throw new RedmineServiceLoginException(
+ "can not access this service in anonymous mode");
+ }
+ }
+
+ protected InputStream askDataStream(String requestName,
+ Object... args) throws RedmineServiceException {
+
+ RestRequest r = getRequest(requestName, args);
+
+ // obtain data from rest client
+ try {
+
+ InputStream stream = session.askData(r);
+ return stream;
+ } catch (Exception e) {
+ throw new RedmineServiceException(
+ "could not obtain data stream for request " + requestName +
+ " for reason " + e.getMessage(), e);
+ }
+ }
+
+ protected InputStream sendDataStream(String requestName,
+ Object... args) throws RedmineServiceException {
+
+ RestRequest r = getRequest(requestName, args);
+
+ // obtain data from rest client
+ try {
+
+ InputStream stream = session.sendData(r);
+ return stream;
+ } catch (Exception e) {
+ throw new RedmineServiceException(
+ "could not send data stream for request " + requestName +
+ " for reason " + e.getMessage(), e);
+ }
+ }
+
+ protected RestRequest getRequest(String requestName,
+ Object... args) throws RedmineServiceException {
+ RestRequest r;
+ try {
+ r = session.getRequest(requestName, args);
+ } catch (Exception e) {
+ throw new RedmineServiceException(
+ "could not find the request named " + requestName +
+ " for reason " + e.getMessage(), e);
+ }
+ if (r == null) {
+ throw new RedmineServiceException(
+ "could not find the request named " + requestName);
+ }
+ return r;
+ }
+
+ protected <T> T getDataFromStream(Class<T> type,
+ InputStream stream) throws RedmineServiceException {
+ if (stream == null) {
+ return null;
+ }
+
+ try {
+ T result = xpp3Helper.readObject(type, stream, true);
+ return result;
+ } catch (Exception ex) {
+ throw new RedmineServiceException(
+ "could not obtain datas of type " + type + " for reason " +
+ ex.getMessage(), ex);
+ }
+ }
+
+ protected <T> T[] getDatasFromStream(Class<T> type,
+ InputStream stream) throws RedmineServiceException {
+ if (stream == null) {
+ return null;
+ }
+ try {
+ T[] result = xpp3Helper.readObjects(type, stream, true);
+ return result;
+ } catch (Exception ex) {
+ throw new RedmineServiceException(
+ "could not obtain datas of type " + type + " for reason " +
+ ex.getMessage(), ex);
+ }
+ }
+
+ protected void checkInit() throws IllegalStateException {
+ if (!init) {
+ throw new IllegalStateException(
+ "the client " + this + " is not init!");
+ }
+ }
+
+ protected void checkSessionNotNull(RestClient session) {
+ if (session == null) {
+ throw new NullPointerException("session can not be null");
+ }
+ }
+
+ protected void checkSessionConfigurationNotNull(RestClient session) {
+ if (session.getConfiguration() == null) {
+ throw new NullPointerException(
+ "session configuration can not be null");
+ }
+ }
+}
Property changes on: trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/RedmineServiceImplementorImpl.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/RedmineServiceProviderImpl.java
===================================================================
--- trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/RedmineServiceProviderImpl.java (rev 0)
+++ trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/RedmineServiceProviderImpl.java 2012-07-13 17:44:33 UTC (rev 292)
@@ -0,0 +1,59 @@
+package org.nuiton.jredmine.v2_x;
+/*
+ * #%L
+ * JRedmine :: Client 2.x
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import org.nuiton.jredmine.RedmineAnonymousService;
+import org.nuiton.jredmine.RedmineService;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceProvider;
+
+/**
+ * Implmentation of {@link RedmineServiceProvider} for this module.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @plexus.component role="org.nuiton.jredmine.RedmineServiceProvider" role-hint="1.3.x"
+ * @since 1.4
+ */
+public class RedmineServiceProviderImpl implements RedmineServiceProvider {
+
+ @Override
+ public String getRedmineVersion() {
+ return "2";
+ }
+
+ @Override
+ public boolean isRequireJRedminePlugin() {
+ return false;
+ }
+
+ @Override
+ public RedmineService newRedmineService(RedmineServiceConfiguration configuration) {
+ return new RedmineServiceImpl();
+ }
+
+ @Override
+ public RedmineAnonymousService newRedmineAnonymousService(RedmineServiceConfiguration configuration) {
+ return new RedmineAnonymousServiceImpl();
+ }
+}
Property changes on: trunk/jredmine-client-2.x/src/main/java/org/nuiton/jredmine/v2_x/RedmineServiceProviderImpl.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-2.x/src/site/apt/index.apt
===================================================================
--- trunk/jredmine-client-2.x/src/site/apt/index.apt (rev 0)
+++ trunk/jredmine-client-2.x/src/site/apt/index.apt 2012-07-13 17:44:33 UTC (rev 292)
@@ -0,0 +1,122 @@
+~~~
+~~ #%L
+~~ JRedmine :: Client
+~~
+~~ $Id$
+~~ $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/site/apt/index… $
+~~ %%
+~~ 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%
+~~~
+----
+JRedmine-client
+----
+----
+2009-09-15
+----
+
+ Ce module contient un plugin <rails> qui permet d'ouvrir l'api de redmine au
+ protocole <REST>, ainsi q'un client <Java> pour interroger les services <REST>.
+
+
+Plugin <rails> JRedmine
+
+ Le but de ce plugin est de pouvoir accéder aux données d'un serveur Redmine en
+ utilisant le protocole <REST>, mais aussi d'effectuer des tâches de
+ maintenance sur le serveur.
+
+ La page {{{./rails_api.html}API}} détaille l'ensemble des services disponibles
+ depuis le serveur Redmine.
+
+* Source du plugin
+
+ Les sources du plugin <rails> sont sont dans le répertoire <<src/main/redmine>>
+
+--------------------------------------------------------------------------------
+
+src/main/redmine/
+`-- jredmine
+ |-- README.rdoc
+ |-- app
+ | |-- controllers
+ | | `-- jredmine_controller.rb
+ | |-- helpers
+ | |-- models
+ | `-- views
+ |-- assets
+ | |-- images
+ | |-- javascripts
+ | `-- stylesheets
+ |-- config
+ | `-- routes.rb
+ |-- db
+ | `-- migrate
+ |-- init.rb
+ |-- lang
+ | `-- en.yml
+ |-- lib
+ | `-- tasks
+ `-- test
+ `-- functional
+--------------------------------------------------------------------------------
+
+* Récupération d'une version packagée
+
+ Il est possible de récupérer une version zippée du plugin (voir la section des
+ téléchargements).
+
+* Installation du plugin sur le serveur Redmine
+
+ * récupération du zip du plugin
+
+ * dézippage dans le répertoire vendor/plugins
+
+ * relancer votre instance de redmine (ou apache).
+
+* Configuration des permissions du plugin dans le serveur Redmine
+
+ Le plugin est activable par projet et par rôle.
+
+ Pour rendre accessible le plugin pour un projet donné, il faut donc ajouter
+ le module JRedmine sur le projet dans l'onglet de configuration des modules
+ du projet.
+
+ Pour rendre accessible le plugin pour un rôle, il faut lui ajouter la
+ permission <<allow_jredmine>> dans la page des permissions du rôle.
+
+* Tester le plugin
+
+ Une fois la configuration des permissions réalisées, vous pouvez tester le
+ plugin dans un navigateur web.
+
+ Pour cela, loggez-vous en web sur redmine, puis lancer (dans un autre onglet)
+ l'url suivante : (remplacer <XX> par le chemin d'accès à votre redmine
+ et <YY> par le nom d'un de vos projet).
+
+--------------------------------------------------------------------------------
+http://XX/jredmine/get_project/YY
+--------------------------------------------------------------------------------
+
+ Vous devez obtenir en retour la description xml du projet demandé.
+
+Client java
+
+ Le client java qui interroge le plugin rails se base sur l'api du plugin rails
+ et transforme les données retournées en xml en objets java.
+
+ La {{{./redmine_service.html}page suivante}} détaille les services disponibles
+ en java.
Property changes on: trunk/jredmine-client-2.x/src/site/apt/index.apt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-2.x/src/site/apt/rails_api.apt
===================================================================
--- trunk/jredmine-client-2.x/src/site/apt/rails_api.apt (rev 0)
+++ trunk/jredmine-client-2.x/src/site/apt/rails_api.apt 2012-07-13 17:44:33 UTC (rev 292)
@@ -0,0 +1,503 @@
+~~~
+~~ #%L
+~~ JRedmine :: Client
+~~
+~~ $Id$
+~~ $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/site/apt/rails… $
+~~ %%
+~~ 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%
+~~~
+----
+API du plugin rails JRedmine
+----
+----
+2009-09-20
+----
+
+Introduction
+
+ Ce document décrit l'API du plugin rails.
+
+
+ Toutes les actions REST sont préfixés par <<jredmine/>>.
+
+ Par exemple, si votre serveur redmine accessible sur <http://myredmine>,
+ les appels sur redmine seront de type <http://myredmine/jredmine/XXX>.
+
+ On distingue donc trois types d'API :
+
+ * API de login : pour gérer la connexion au serveur Redmine : une connexion
+ authentifié est requise pour pouvoir récupérer des données ou effectuer des
+ actions sur le serveur.
+
+ * API de lecture : pour récupérer des données du serveur.
+
+ * API d'actions : pour effecuter des actions de maintenance sur le serveur.
+
+ Toutes les données en sortie du plugin sont au format <xml>, ou <json>.
+
+API de login
+
+*-----------*-----------------------------------------------+
+| <action> | <description> |
+*-----------*-----------------------------------------------+
+| <<ping>> | un service de ping qui retourne le mot <ping> |
+*-----------*-----------------------------------------------+
+| <<login>> | pour connecter l'utilisateur au serveur |
+*-----------*-----------------------------------------------+
+| <<logout>>| pour déconnecter l'utilisateur du serveur |
+*-----------*-----------------------------------------------+
+
+* ping
+
+ Ce service ne requiert pas de paramètre.
+
+ Requète :
+
+--------------------------------------------------------------------------------
+jredmine/ping
+--------------------------------------------------------------------------------
+
+* login
+
+ Ce service nécessite deux paramètres :
+
+ * <<username>>
+
+ * <<password>>
+
+ <<Note:>> Cette requête ne peut être exécutée qu'en <<POST>>.
+
+ Requète :
+
+--------------------------------------------------------------------------------
+jredmine/login
+--------------------------------------------------------------------------------
+
+* logout
+
+ Ce service ne requiert pas de paramètre.
+
+ Requète :
+
+--------------------------------------------------------------------------------
+jredmine/logout
+--------------------------------------------------------------------------------
+
+API de lecture
+
+ On distingue quatre niveaux de données récupérables :
+
+ * les données qui ne dépendent pas d'un projet
+
+ * les données qui dépendent d'un projet
+
+ * les données qui dépendent d'une version d'un projet
+
+ * les données qui dépendent d'une issued'un projet
+
+* Services des données indépendantes
+
+*--------------------------*-----------------------------------+
+| <action[.xml\|.json]> | <données récupérées> |
+*--------------------------*-----------------------------------+
+| <<get_projects>> | tous les projets |
+*--------------------------*-----------------------------------+
+| <<get_user_projects>> | tous les projets dont l'utilisateur connecté est membre |
+*--------------------------*-----------------------------------+
+| <<get_issue_statuses>> | tous les status de demandes |
+*--------------------------*-----------------------------------+
+| <<get_issue_priorities>> | toutes les prioritiés de demandes |
+*--------------------------*-----------------------------------+
+
+** get_projects
+
+ Ce service ne requiert pas de paramètre.
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/get_projects.xml
+jredmine/get_projects.json
+--------------------------------------------------------------------------------
+
+** get_user_projects
+
+ Ce service ne requiert pas de paramètre.
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/get_user_projects.xml
+jredmine/get_user_projects.json
+--------------------------------------------------------------------------------
+
+** get_issue_statuses
+
+ Ce service ne requiert pas de paramètre.
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/get_issue_statuses.xml
+jredmine/get_issue_statuses.json
+--------------------------------------------------------------------------------
+
+** get_issue_priorities
+
+ Ce service ne requiert pas de paramètre.
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/get_issue_priorities.xml
+jredmine/get_issue_priorities.json
+--------------------------------------------------------------------------------
+
+* Services des données dépendantes d'un projet
+
+*-------------------------------*---------------------------------------+
+| <action[.xml\|.json]> | <données récupérées pour un projet> |
+*-------------------------------*---------------------------------------+
+| <<get_projet>> | le projet |
+*-------------------------------*---------------------------------------+
+| <<get_issue_categories>> | touts les catégories de demande |
+*-------------------------------*---------------------------------------+
+| <<get_project_users>> | tous les membres du projet |
+*-------------------------------*---------------------------------------+
+| <<get_project_trackers>> | tous les types de tracker |
+*-------------------------------*---------------------------------------+
+| <<get_project_versions>> | toutes les versions d'un projet |
+*-------------------------------*---------------------------------------+
+| <<get_project_issues>> | toutes les issues d'un projet |
+*-------------------------------*---------------------------------------+
+| <<get_project_opened_issues>> | toutes les issues ouvertes d'un projet|
+*-------------------------------*---------------------------------------+
+| <<get_project_closed_issues>> | toutes les issues fermées d'un projet |
+*-------------------------------*---------------------------------------+
+
+** get_projet
+
+ Ce service ne requiert pas de paramètre.
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/get_projet.xml/myProject
+jredmine/get_projet.json/myProject
+--------------------------------------------------------------------------------
+
+** get_issue_categories
+
+ Ce service ne requiert pas de paramètre.
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/get_issue_categories.xml/myProject
+jredmine/get_issue_categories.json/myProject
+--------------------------------------------------------------------------------
+
+** get_project_users
+
+ Ce service ne requiert pas de paramètre.
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/get_project_users.xml/myProject
+jredmine/get_project_users.json/myProject
+--------------------------------------------------------------------------------
+
+** get_project_trackers
+
+ Ce service ne requiert pas de paramètre.
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/get_project_trackers.xml/myProject
+jredmine/get_project_trackers.json/myProject
+--------------------------------------------------------------------------------
+
+** get_project_versions
+
+ Ce service ne requiert pas de paramètre.
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/get_project_versions.xml/myProject
+jredmine/get_project_versions.json/myProject
+--------------------------------------------------------------------------------
+
+** get_issues
+
+ Ce service ne requiert pas de paramètre.
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/get_project_issues.xml/myProject
+jredmine/get_project_issues.json/myProject
+--------------------------------------------------------------------------------
+
+* Services des données dépendantes d'une version d'un projet
+
+*------------------------------*-----------------------------------------------------+
+| <action[.xml\|.json]> | <données récupérées pour une version d'un projet> |
+*------------------------------*-----------------------------------------------------+
+| <<get_version>> | la version |
+*------------------------------*-----------------------------------------------------+
+| <<get_version_issues>> | touts les catégories de demande |
+*------------------------------*-----------------------------------------------------+
+| <<get_versions_attachments>> | tous les membres du projet |
+*------------------------------*-----------------------------------------------------+
+
+** get_version
+
+ Ce service requiert un paramètre :
+
+ * <<version_name>> le nom de la version
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/get_version.xml/myProject?version_name=myVersion
+jredmine/get_version.json/myProject?version_name=myVersion
+--------------------------------------------------------------------------------
+
+** get_version_issues
+
+ Ce service requiert un paramètre :
+
+ * <<version_name>> le nom de la version
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/get_version_issues.xml/myProject?version_name=myVersion
+jredmine/get_version_issues.json/myProject?version_name=myVersion
+--------------------------------------------------------------------------------
+
+** get_versions_attachments
+
+ Ce service requiert un paramètre :
+
+ * <<version_name>> le nom de la version
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/get_versions_attachments.xml/myProject?version_name=myVersion
+jredmine/get_versions_attachments.json/myProject?version_name=myVersion
+--------------------------------------------------------------------------------
+
+* Services des données dépendantes d'une issue d'un projet
+
+*--------------------------*---------------------------------------------------+
+| <action[.xml\|.json]> | <données récupérées pour une issue d'un projet> |
+*--------------------------*---------------------------------------------------+
+| <<get_issue_times>> | les temps de l'issue |
+*--------------------------*---------------------------------------------------+
+
+** get_issue_times
+
+ Ce service requiert un paramètre :
+
+ * <<issue_id>> l'id de l'issue
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/get_issue_time.xml/myProject?issue_id=myIssueId
+jredmine/get_issue_time.json/myProject?issue_id=myIssueId
+--------------------------------------------------------------------------------
+
+API d'actions
+
+*----------------------------*-----------------------------------------------+
+| <action> | <description> |
+*----------------------------*-----------------------------------------------+
+| <<add_version>> | ajouter une version à un projet |
+*----------------------------*-----------------------------------------------+
+| <<update_version>> | mettre à jour une version d'un projet |
+*----------------------------*-----------------------------------------------+
+| <<next_version>> | préparer la prochaine version d'un projet |
+*----------------------------*-----------------------------------------------+
+| <<add_attachment>> | ajouter un fichier à un projet |
+*----------------------------*-----------------------------------------------+
+| <<add_version_attachment>> | ajouter un fichier à une version d'un projet |
+*----------------------------*-----------------------------------------------+
+| <<add_news>> | ajouter une annonce à un projet |
+*----------------------------*-----------------------------------------------+
+| <<add_issue_time>> | ajouter un temps à une issue d'un projet |
+*----------------------------*-----------------------------------------------+
+| <<update_issue_time>> | mettre à jour le temps d'une issue d'un projet|
+*----------------------------*-----------------------------------------------+
+
+ <<Note:>> Toutes ces opérations doivent obligatoirement être exécutées
+ par une méthod http <<POST>> (donc pas réalisable via un navigateur).
+
+* add_version
+
+ Ce service requiert trois paramètres :
+
+ * <<version[name]>> le nom de la version
+
+ * <<version[description]>> la description de la version
+
+ * <<version[effective_date]>> la date effective de la version
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/add_version.xml/myProject
+jredmine/add_version.json/myProject
+--------------------------------------------------------------------------------
+
+* update_version
+
+ Ce service requiert trois paramètres :
+
+ * <<version[name]>> le nom de la version
+
+ * <<version[description]>> la description de la version
+
+ * <<version[effective_date]>> la date effective de la version
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/update_version.xml/myProject
+jredmine/update_version.json/myProject
+--------------------------------------------------------------------------------
+
+* next_version
+
+ Ce service requiert quatre paramètres :
+
+ * <<previousVersionName>> le nom de la version précédente
+
+ * <<version[name]>> le nom de la version
+
+ * <<version[description]>> la description de la version
+
+ * <<version[effective_date]>> la date effective de la version
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/next_version.xml/myProject
+jredmine/next_version.json/myProject
+--------------------------------------------------------------------------------
+
+* add_attachment
+
+ Ce service requiert deux paramètres :
+
+ * <<attachment[description]>> la description de la pièce jointe
+
+ * <<attachment[file]>> la pièce-jointe
+
+ <<Note:>> La requète est de type <<multi-part>>.
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/add_attachment.xml/myProject
+jredmine/add_attachment.json/myProject
+--------------------------------------------------------------------------------
+
+* add_version_attachment
+
+ Ce service requiert trois paramètres :
+
+ * <<version_name>> le nom de la version
+
+ * <<attachment[description]>> la description de la pièce jointe
+
+ * <<attachment[file]>> la pièce-jointe
+
+ <<Note:>> La requète est de type <<multi-part>>.
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/add_version_attachment.xml/myProject
+jredmine/add_version_attachment.json/myProject
+--------------------------------------------------------------------------------
+
+* add_news
+
+ Ce service requiert trois paramètres :
+
+ * <<news[title]>> le titre de de la version
+
+ * <<news[summary]>> la description de l'annonce
+
+ * <<news[description]>> le contenu de l'annonce
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/add_news.xml/myProject
+jredmine/add_news.json/myProject
+--------------------------------------------------------------------------------
+
+** add_issue_time
+
+ Ce service requiert cinq paramètres :
+
+ * <<issue_id>> l'id de l'issue
+
+ * <<time_entry[activity_id]>> l'id de l'activité du temps à ajouter
+
+ * <<time_entry[hours]>> le nombre d'heures du temps à ajouter
+
+ * <<time_entry[spent_on]>> la date du temps à ajouter (si null, on prend la date du jour)
+
+ * <<time_entry[comments]>> commentaire du temps à ajouter
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/add_issue_time.xml/myProject
+jredmine/add_issue_time.json/myProject
+--------------------------------------------------------------------------------
+
+** update_issue_time
+
+ Ce service requiert cinq paramètres :
+
+ * <<issue_id>> l'id de l'issue
+
+ * <<time_entry[activity_id]>> l'id de l'activité du temps à mettre à jour
+
+ * <<time_entry[hours]>> le nombre d'heures du temps à mettre à jour
+
+ * <<time_entry[spent_on]>> la date du temps à mettre à jour (si null, on prend la date du jour)
+
+ * <<time_entry[comments]>> commentaire du temps à mettre à jour
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/update_issue_time.xml/myProject
+jredmine/update_issue_time.json/myProject
+--------------------------------------------------------------------------------
Property changes on: trunk/jredmine-client-2.x/src/site/apt/rails_api.apt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-2.x/src/site/apt/redmine_service.apt
===================================================================
--- trunk/jredmine-client-2.x/src/site/apt/redmine_service.apt (rev 0)
+++ trunk/jredmine-client-2.x/src/site/apt/redmine_service.apt 2012-07-13 17:44:33 UTC (rev 292)
@@ -0,0 +1,71 @@
+~~~
+~~ #%L
+~~ JRedmine :: Client
+~~
+~~ $Id$
+~~ $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/site/apt/redmi… $
+~~ %%
+~~ 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%
+~~~
+----
+RedmineService
+----
+----
+2009-09-15
+----
+
+Les contrats de service
+
+ L'api java sépare depuis la version 1.0.3 les services publiques et privés.
+
+* org.nuiton.jredmine.RedmineAnonymousService
+
+ Ce contrat permet d'exécuter les services publiques (services anonymes).
+
+* org.nuiton.jredmine.RedmineLogguedService
+
+ Ce contrat permet d'exécuter les services privés (services avec login).
+
+* org.nuiton.jredmine.RedmineService
+
+ Ce contrat regroupe les deux précédents et constitue l'ensemble des services
+ connus par redmine.
+
+
+Les implentations de service
+
+ L'api offre deux implentations de service.
+
+* org.nuiton.jredmine.DefaultRedmineAnonymousService
+
+ Ce service peut-être appelé pour tout opération publique, la session
+ sous-jacente au service (RedmineRestClient) n'établiera pas d'authentification
+ vers les serveur redmine.
+
+* org.nuiton.jredmine.DefaultRedmineService
+
+ Ce service peut-être appelé pour toute opération vers le serveur redmine.
+
+ Si la configuration requièrt un login (propriété anonymous à false), une
+ authentification sera effectuée.
+
+ A noter que si on utilise ce service en anonyme et que l'on tente d'appeler
+ une méthode de service privé, une exception sera remontée indiquant qu'il faut
+ être authentifié pour effectuer cette opération.
+
+ <Pour plus de détails, consulter la javadoc du module.>
Property changes on: trunk/jredmine-client-2.x/src/site/apt/redmine_service.apt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-2.x/src/site/site_fr.xml
===================================================================
--- trunk/jredmine-client-2.x/src/site/site_fr.xml (rev 0)
+++ trunk/jredmine-client-2.x/src/site/site_fr.xml 2012-07-13 17:44:33 UTC (rev 292)
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ JRedmine :: Client
+
+ $Id$
+ $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/site/site_fr.x… $
+ %%
+ 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%
+ -->
+
+<project name="${project.name}">
+
+ <bannerLeft>
+ <name>${project.name}</name>
+ <href>index.html</href>
+ </bannerLeft>
+
+ <bannerRight>
+ <src>http://www.codelutin.com/images/lutinorange-codelutin.png</src>
+ <href>http://www.codelutin.com</href>
+ </bannerRight>
+
+ <skin>
+ <groupId>org.apache.maven.skins</groupId>
+ <artifactId>maven-fluido-skin</artifactId>
+ <version>1.2.1</version>
+ </skin>
+
+ <custom>
+ <fluidoSkin>
+ <topBarEnabled>true</topBarEnabled>
+ <googleSearch/>
+ <sideBarEnabled>false</sideBarEnabled>
+ <searchEnabled>true</searchEnabled>
+ <sourceLineNumbersEnabled>true</sourceLineNumbersEnabled>
+ </fluidoSkin>
+ </custom>
+
+ <publishDate position="right" format="dd/MM/yyyy"/>
+ <version position="right"/>
+
+ <body>
+
+ <breadcrumbs>
+ <item name="${project.name}" href="index.html"/>
+ </breadcrumbs>
+
+ <links>
+ <item name="nuiton.org" href="http://www.nuiton.org"/>
+ <item name="CodeLutin" href="http://codelutin.com"/>
+ <item name="Libre-Entreprise" href="http://www.libre-entreprise.org/"/>
+ </links>
+
+ <menu ref="parent"/>
+
+ <menu name="Utilisateur">
+ <item name="Introduction" href="index.html"/>
+ <item name="JRedmine rails API" href="rails_api.html"/>
+ <item name="JRedmine java service" href="redmine_service.html"/>
+ </menu>
+
+ <menu name="Téléchargement">
+ <item href="http://nuiton.org/projects/list_files/jredmine" name="Sources bundles"/>
+
+ <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}.jar"
+ name="Librairie (jar)"/>
+ <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}-javadoc.jar"
+ name="Javadoc (jar)"/>
+ <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}-sources.jar"
+ name="Sources (jar)"/>
+ <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}-tests.jar"
+ name="Test Librairie (jar)"/>
+ <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}-test-javadoc.jar"
+ name="Test Javadoc (jar)"/>
+ <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}-test-sources.jar"
+ name="Test Sources (jar)"/>
+ </menu>
+
+ <menu ref="reports"/>
+
+ <footer>
+
+ <script type="text/javascript"
+ src="http://maven-site.nuiton.org/public/js/maven-site-nuiton.org.js">
+ </script>
+
+ <div id='projectMetas'
+ projectversion='${project.version}'
+ platform='${project.platform}'
+ projectid='${project.projectId}'
+ scm='${project.scm.connection}'
+ scmwebeditorenabled='${project.scmwebeditorEnabled}'
+ scmwebeditorurl='${project.scmwebeditorUrl}'
+ siteSourcesType='${project.siteSourcesType}'
+ piwikEnabled='${project.piwikEnabled}'
+ piwikId='${project.piwikId}'>
+ </div>
+ </footer>
+
+ </body>
+</project>
Property changes on: trunk/jredmine-client-2.x/src/site/site_fr.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-2.x/src/test/java/org/nuiton/jredmine/v2_x/RedmineAnonymousServiceTest.java
===================================================================
--- trunk/jredmine-client-2.x/src/test/java/org/nuiton/jredmine/v2_x/RedmineAnonymousServiceTest.java (rev 0)
+++ trunk/jredmine-client-2.x/src/test/java/org/nuiton/jredmine/v2_x/RedmineAnonymousServiceTest.java 2012-07-13 17:44:33 UTC (rev 292)
@@ -0,0 +1,188 @@
+package org.nuiton.jredmine.v2_x;
+/*
+ * #%L
+ * JRedmine :: Client 2.x
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+import org.nuiton.jredmine.RedmineAnonymousService;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.Issue;
+import org.nuiton.jredmine.model.IssueCategory;
+import org.nuiton.jredmine.model.IssuePriority;
+import org.nuiton.jredmine.model.IssueStatus;
+import org.nuiton.jredmine.model.News;
+import org.nuiton.jredmine.model.Project;
+import org.nuiton.jredmine.model.TimeEntry;
+import org.nuiton.jredmine.model.Tracker;
+import org.nuiton.jredmine.model.User;
+import org.nuiton.jredmine.model.Version;
+
+import java.io.IOException;
+
+/**
+ * Tests the {@link RedmineAnonymousServiceImpl}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.5
+ */
+@Ignore
+public class RedmineAnonymousServiceTest {
+
+ protected static final RedmineFixtures fixtures = new RedmineFixtures();
+
+ @Rule
+ public final RedmineServer<RedmineAnonymousService> server = createNewServer(fixtures);
+
+ protected RedmineAnonymousService getService() {
+ return server.getService();
+ }
+
+ protected RedmineServer<RedmineAnonymousService> createNewServer(RedmineFixtures fixtures) {
+ return new RedmineServer<RedmineAnonymousService>(fixtures) {
+
+ @Override
+ protected RedmineAnonymousService createService(
+ RedmineFixtures fixture,
+ RedmineServiceConfiguration configuration) throws IOException, RedmineServiceException {
+
+ return fixture.newRedmineAnonymousService(configuration);
+ }
+
+ @Override
+ protected RedmineServiceConfiguration createConfiguration(RedmineFixtures fixture) throws IOException {
+ RedmineServiceConfiguration conf = fixture.newAnonymousConfiguration();
+ return conf;
+ }
+ };
+ }
+
+ @BeforeClass
+ public static void beforeClass() {
+ RedmineServer<RedmineAnonymousService> newServer =
+ new RedmineAnonymousServiceTest().createNewServer(fixtures);
+ newServer.checkService();
+ }
+
+ @Test
+ public void getProjects() throws Exception {
+ Project[] projects = getService().getProjects();
+ Assert.assertNotNull(projects);
+ }
+
+ @Test
+ public void getIssuePriorities() throws Exception {
+ IssuePriority[] issuePriorities = getService().getIssuePriorities();
+ Assert.assertNotNull(issuePriorities);
+ }
+
+ @Test
+ public void getIssueStatuses() throws Exception {
+ IssueStatus[] issueStatuses = getService().getIssueStatuses();
+ Assert.assertNotNull(issueStatuses);
+ }
+
+ @Test
+ public void getProject() throws Exception {
+ Project project = getService().getProject(fixtures.projectName());
+ Assert.assertNotNull(project);
+ }
+
+ @Test
+ public void getIssueCategories() throws Exception {
+ IssueCategory[] issueCategories = getService().getIssueCategories(fixtures.projectName());
+ Assert.assertNotNull(issueCategories);
+ }
+
+ @Test
+ public void getTrackers() throws Exception {
+ Tracker[] trackers = getService().getTrackers(fixtures.projectName());
+ Assert.assertNotNull(trackers);
+ }
+
+ @Test
+ public void getNews() throws Exception {
+ News[] news = getService().getNews(fixtures.projectName());
+ Assert.assertNotNull(news);
+ }
+
+ @Test
+ public void getProjectMembers() throws Exception {
+ User[] users = getService().getProjectMembers(fixtures.projectName());
+ Assert.assertNotNull(users);
+ }
+
+ @Test
+ public void getProjectIssues() throws Exception {
+ Issue[] issues = getService().getIssues(fixtures.projectName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getVersions() throws Exception {
+ Version[] versions = getService().getVersions(fixtures.projectName());
+ Assert.assertNotNull(versions);
+ }
+
+ @Test
+ public void getVersion() throws Exception {
+ Version version = getService().getVersion(fixtures.projectName(), fixtures.versionName());
+ Assert.assertNotNull(version);
+ }
+
+ @Test
+ public void getVersionIssues() throws Exception {
+ Issue[] issues = getService().getIssues(fixtures.projectName(), fixtures.versionName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getOpenedIssues() throws Exception {
+ Issue[] issues = getService().getOpenedIssues(fixtures.projectName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getClosedIssues() throws Exception {
+ Issue[] issues = getService().getClosedIssues(fixtures.projectName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getIssueTimeEntries() throws Exception {
+ TimeEntry[] timeEntries = getService().getIssueTimeEntries(fixtures.projectName(), fixtures.issueId());
+ Assert.assertNotNull(timeEntries);
+ }
+
+ @Test
+ public void getAttachments() throws Exception {
+ Attachment[] attachments = getService().getAttachments(fixtures.projectName(), fixtures.versionName());
+ Assert.assertNotNull(attachments);
+ }
+
+}
Property changes on: trunk/jredmine-client-2.x/src/test/java/org/nuiton/jredmine/v2_x/RedmineAnonymousServiceTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-2.x/src/test/java/org/nuiton/jredmine/v2_x/RedmineFixtures.java
===================================================================
--- trunk/jredmine-client-2.x/src/test/java/org/nuiton/jredmine/v2_x/RedmineFixtures.java (rev 0)
+++ trunk/jredmine-client-2.x/src/test/java/org/nuiton/jredmine/v2_x/RedmineFixtures.java 2012-07-13 17:44:33 UTC (rev 292)
@@ -0,0 +1,821 @@
+package org.nuiton.jredmine.v2_x;
+/*
+ * #%L
+ * JRedmine :: Client 2.x
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import com.google.common.base.Charsets;
+import com.google.common.collect.ArrayListMultimap;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.jredmine.RedmineAnonymousService;
+import org.nuiton.jredmine.RedmineService;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.Issue;
+import org.nuiton.jredmine.model.IssueCategory;
+import org.nuiton.jredmine.model.IssuePriority;
+import org.nuiton.jredmine.model.IssueStatus;
+import org.nuiton.jredmine.model.News;
+import org.nuiton.jredmine.model.Project;
+import org.nuiton.jredmine.model.TimeEntry;
+import org.nuiton.jredmine.model.Tracker;
+import org.nuiton.jredmine.model.User;
+import org.nuiton.jredmine.model.Version;
+import org.nuiton.jredmine.model.io.xpp3.RedmineDataConverter;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Date;
+import java.util.List;
+import java.util.Properties;
+
+/**
+ * fixtures of redmine model.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public class RedmineFixtures {
+
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(RedmineFixtures.class);
+
+ public static final String FILE_TO_UPLOAD_CONTENT = "Fichier à uploader";
+
+ public static final String PROJECT_NAME = "jredmine";
+
+ public static final String VERSION_NAME = "1.3";
+
+ public static final String ISSUE_ID = "2030";
+
+ private Project JRedmineProject;
+
+ private ArrayListMultimap<Class<?>, Object> model;
+
+ private RedmineServiceConfiguration anonymousConfiguration;
+
+ private RedmineServiceConfiguration logguedConfiguration;
+
+ public String projectName() {
+ return PROJECT_NAME;
+ }
+
+ public String versionName() {
+ return VERSION_NAME;
+ }
+
+ public String issueId() {
+ return ISSUE_ID;
+ }
+
+ public RedmineServiceConfiguration newAnonymousConfiguration()
+ throws IOException {
+ RedmineServiceConfiguration conf = new FakeRedmineServiceConfiguration();
+ copyConfiguration(getAnonymousConfiguration(), conf);
+ return conf;
+ }
+
+ public RedmineServiceConfiguration newLogguedConfiguration()
+ throws IOException {
+ RedmineServiceConfiguration conf = new FakeRedmineServiceConfiguration();
+ copyConfiguration(getLogguedConfiguration(), conf);
+ return conf;
+ }
+
+ public RedmineAnonymousService newRedmineAnonymousService(RedmineServiceConfiguration configuration)
+ throws IOException, RedmineServiceException {
+ RedmineAnonymousServiceImpl service = new RedmineAnonymousServiceImpl();
+ service.init(configuration);
+ return service;
+ }
+
+ public RedmineService newRedmineService(RedmineServiceConfiguration configuration)
+ throws IOException, RedmineServiceException {
+ RedmineServiceImpl service = new RedmineServiceImpl();
+ service.init(configuration);
+ return service;
+ }
+
+ protected RedmineServiceConfiguration getAnonymousConfiguration()
+ throws IOException {
+ if (anonymousConfiguration == null) {
+
+ Properties props = new Properties();
+
+ InputStream inputStream = null;
+ try {
+ String jredmineConfiguration = System.getenv("jredmine-test.properties");
+ if (jredmineConfiguration == null) {
+ if (log.isWarnEnabled()) {
+ log.warn("Could not find environement variable " +
+ "'jredmine-test.properties' will use " +
+ "default test configuration");
+ }
+
+ inputStream = getClass().getResourceAsStream("/test-config.properties");
+ } else {
+
+ File file = new File(jredmineConfiguration);
+
+ if (!file.exists()) {
+ throw new IllegalStateException("Could not find " + jredmineConfiguration +
+ " file");
+ }
+ inputStream = FileUtils.openInputStream(file);
+ }
+ props.load(inputStream);
+ } finally {
+ if (inputStream != null) {
+ inputStream.close();
+ }
+ }
+ anonymousConfiguration = new FakeRedmineServiceConfiguration();
+
+ String url = props.getProperty("test.redmineUrl");
+ anonymousConfiguration.setRestUrl(new URL(url));
+
+ String e = props.getProperty("test.encoding");
+ anonymousConfiguration.setEncoding(e);
+
+ String verbose = props.getProperty("test.verbose");
+ if (StringUtils.isNotEmpty(verbose)) {
+ anonymousConfiguration.setVerbose(Boolean.valueOf(verbose));
+ }
+ anonymousConfiguration.setEncoding(Charsets.UTF_8.name());
+ anonymousConfiguration.setAnonymous(true);
+
+ verbose = System.getenv("jredmine-test.verbose");
+ if (StringUtils.isNotEmpty(verbose)) {
+ anonymousConfiguration.setVerbose(Boolean.valueOf(verbose));
+ }
+
+ }
+ return anonymousConfiguration;
+ }
+
+ protected RedmineServiceConfiguration getLogguedConfiguration()
+ throws IOException {
+ if (logguedConfiguration == null) {
+
+ // use anonymous configuration
+
+ RedmineServiceConfiguration anoConf = getAnonymousConfiguration();
+ if (anoConf != null) {
+ logguedConfiguration = new FakeRedmineServiceConfiguration();
+ copyConfiguration(anoConf, logguedConfiguration);
+
+ // get system login password from env
+ String login = System.getenv("jredmine-test.login");
+ String password = System.getenv("jredmine-test.password");
+ if (!"null".equals(login)) {
+ logguedConfiguration.setRestUsername(login);
+ }
+ if (!"null".equals(password)) {
+ logguedConfiguration.setRestPassword(password);
+ }
+ logguedConfiguration.setAnonymous(false);
+ }
+ }
+ return logguedConfiguration;
+ }
+
+ protected void copyConfiguration(RedmineServiceConfiguration src,
+ RedmineServiceConfiguration dst) {
+ dst.setRestUrl(src.getRestUrl());
+ dst.setRestUsername(src.getRestUsername());
+ dst.setRestPassword(src.getRestPassword());
+ dst.setEncoding(src.getEncoding());
+ dst.setVerbose(src.isVerbose());
+ dst.setAnonymous(src.isAnonymous());
+ }
+
+ public List<Attachment> getAttachments() {
+ return get(Attachment.class);
+ }
+
+ public List<Issue> getIssues() {
+ return get(Issue.class);
+ }
+
+ public List<Project> getProjects() {
+ return get(Project.class);
+ }
+
+ public List<Tracker> getTrackers() {
+ return get(Tracker.class);
+ }
+
+ public List<User> getUsers() {
+ return get(User.class);
+ }
+
+ public List<Version> getVersions() {
+ return get(Version.class);
+ }
+
+ public <T> List<T> get(Class<T> modelType) {
+ if (model == null) {
+ try {
+ loadModel();
+ } catch (Exception ex) {
+ throw new RuntimeException(ex);
+ }
+ }
+ return (List<T>) model.get(modelType);
+ }
+
+ public <T> T get(Class<T> type, int pos) {
+ List<T> ts = get(type);
+ return ts.get(pos);
+ }
+
+ public Project getJRedmineProject() {
+ if (JRedmineProject == null) {
+ JRedmineProject = new Project();
+ JRedmineProject.setName("jredmine");
+ JRedmineProject.setIdentifier("jredmine");
+ JRedmineProject.setIsPublic(true);
+ JRedmineProject.setHomepage("http://maven-site.nuiton.org/jredmine");
+ JRedmineProject.setDescription(
+ "Permet de communiquer en java avec un serveur " + "redmine qui a installé le plugin rails jredmine");
+ JRedmineProject.setId(36);
+ JRedmineProject.setStatus(1);
+ }
+ return JRedmineProject;
+ }
+
+
+ public static final String VERSION_TO_CREATE_NAME = "do_not_use_me";
+
+ public Version getVersion() {
+ Version version = new Version();
+ version.setName(VERSION_TO_CREATE_NAME);
+ version.setDescription("Une version créée par les tests de jredmine," +
+ " ne pas utiliser,et modifiée");
+ return version;
+ }
+
+ private void loadModel()
+ throws Exception {
+ model = ArrayListMultimap.create();
+
+ Attachment tempA;
+ tempA = new Attachment();
+ tempA.setAuthorId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempA.setContainerId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempA.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempA.setFilesize((Integer) RedmineDataConverter.Integer.convert("411"));
+ tempA.setDownloads((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempA.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T12:56:41+02:00"));
+ tempA.setContainerType((String) RedmineDataConverter.Text.convert("Version"));
+ tempA.setContentType((String) RedmineDataConverter.Text.convert("application/json"));
+ tempA.setDigest((String) RedmineDataConverter.Text.convert("6ea84342c7475c05fb077b4aca832f9a"));
+ tempA.setDiskFilename((String) RedmineDataConverter.Text.convert("090905125641_get_issue.json"));
+ tempA.setFilename((String) RedmineDataConverter.Text.convert("get_issue.json"));
+ model.put(Attachment.class, tempA);
+ tempA = new Attachment();
+ tempA.setAuthorId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempA.setContainerId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempA.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempA.setFilesize((Integer) RedmineDataConverter.Integer.convert("411"));
+ tempA.setDownloads((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempA.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T12:56:41+02:00"));
+ tempA.setContainerType((String) RedmineDataConverter.Text.convert("Version"));
+ tempA.setContentType((String) RedmineDataConverter.Text.convert("application/json"));
+ tempA.setDigest((String) RedmineDataConverter.Text.convert("6ea84342c7475c05fb077b4aca832f9a"));
+ tempA.setDiskFilename((String) RedmineDataConverter.Text.convert("090905125641_get_issue.json2"));
+ tempA.setFilename((String) RedmineDataConverter.Text.convert("get_issue.json2"));
+ model.put(Attachment.class, tempA);
+
+ Issue tempI;
+ tempI = new Issue();
+ tempI.setAuthorId((Integer) RedmineDataConverter.Integer.convert("5"));
+ tempI.setCategoryId((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempI.setDoneRatio((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempI.setLockVersion((Integer) RedmineDataConverter.Integer.convert("7"));
+ tempI.setPriorityId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempI.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setStatusId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempI.setTrackerId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setFixedVersionId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempI.setParentId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempI.setRootId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempI.setLft((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setRgt((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempI.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T20:11:52+02:00"));
+ tempI.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T00:37:40+02:00"));
+ tempI.setStartDate((Date) RedmineDataConverter.Date.convert("2009-09-04"));
+ tempI.setDescription((String) RedmineDataConverter.Text.convert("avec une description !"));
+ tempI.setSubject((String) RedmineDataConverter.Text.convert("yes!"));
+ model.put(Issue.class, tempI);
+ tempI = new Issue();
+ tempI.setAuthorId((Integer) RedmineDataConverter.Integer.convert("5"));
+ tempI.setCategoryId((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempI.setDoneRatio((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempI.setLockVersion((Integer) RedmineDataConverter.Integer.convert("7"));
+ tempI.setPriorityId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempI.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setStatusId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempI.setTrackerId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setFixedVersionId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempI.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T20:11:52+02:00"));
+ tempI.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T00:37:40+02:00"));
+ tempI.setStartDate((Date) RedmineDataConverter.Date.convert("2009-09-04"));
+ tempI.setDescription((String) RedmineDataConverter.Text.convert("avec une description !2"));
+ tempI.setSubject((String) RedmineDataConverter.Text.convert("yes!2"));
+ model.put(Issue.class, tempI);
+
+ Project tempP;
+ tempP = new Project();
+ tempP.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:11:54+02:00"));
+ tempP.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:11:54+02:00"));
+ tempP.setIdentifier((String) RedmineDataConverter.Text.convert("one"));
+ tempP.setName((String) RedmineDataConverter.Text.convert("one"));
+ tempP.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempP.setLft((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempP.setRgt((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempP.setProjectsCount((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempP.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempP.setIsPublic((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ model.put(Project.class, tempP);
+ tempP = new Project();
+ tempP.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T16:22:14+02:00"));
+ tempP.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T16:22:29+02:00"));
+ tempP.setIdentifier((String) RedmineDataConverter.Text.convert("two"));
+ tempP.setName((String) RedmineDataConverter.Text.convert("two"));
+ tempP.setId((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempP.setProjectsCount((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempP.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempP.setIsPublic((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ model.put(Project.class, tempP);
+
+ Tracker tempT;
+ tempT = new Tracker();
+ tempT.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setTrackerId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setPosition((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setIsInChlog((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempT.setIsInRoadmap((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempT.setName((String) RedmineDataConverter.Text.convert("Anomalie"));
+ model.put(Tracker.class, tempT);
+ tempT = new Tracker();
+ tempT.setId((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempT.setIsInChlog((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempT.setIsInRoadmap((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempT.setName((String) RedmineDataConverter.Text.convert("Evolution"));
+ tempT.setPosition((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempT.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setTrackerId((Integer) RedmineDataConverter.Integer.convert("2"));
+ model.put(Tracker.class, tempT);
+ tempT = new Tracker();
+ tempT.setId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempT.setIsInChlog((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempT.setIsInRoadmap((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempT.setName((String) RedmineDataConverter.Text.convert("Assistance"));
+ tempT.setPosition((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempT.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setTrackerId((Integer) RedmineDataConverter.Integer.convert("3"));
+ model.put(Tracker.class, tempT);
+
+ User tempU;
+ tempU = new User();
+ tempU.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T17:24:46+02:00"));
+ tempU.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T01:23:59+02:00"));
+ tempU.setLastLoginOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T01:23:59+02:00"));
+ tempU.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempU.setMemberId((Integer) RedmineDataConverter.Integer.convert("5"));
+ tempU.setRoleId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempU.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempU.setAdmin((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempU.setMailNotification((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempU.setFirstname((String) RedmineDataConverter.Text.convert("Redmine"));
+ tempU.setHashedPassword(
+ (String) RedmineDataConverter.Text.convert("70c881d4a26984ddce795f6f71817c9cf4480e79"));
+ tempU.setLanguage((String) RedmineDataConverter.Text.convert("fr"));
+ tempU.setLastname((String) RedmineDataConverter.Text.convert("Admin"));
+ tempU.setLogin((String) RedmineDataConverter.Text.convert("admin"));
+ tempU.setMail((String) RedmineDataConverter.Text.convert("dummy(a)codelutin.com"));
+ tempU.setIdentityUrl((String) RedmineDataConverter.Text.convert("yo"));
+ model.put(User.class, tempU);
+ tempU = new User();
+ tempU.setAdmin((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempU.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T19:49:02+02:00"));
+ tempU.setFirstname((String) RedmineDataConverter.Text.convert("tony"));
+ tempU.setHashedPassword(
+ (String) RedmineDataConverter.Text.convert("8aed1322e5450badb078e1fb60a817a1df25a2ca"));
+ tempU.setId((Integer) RedmineDataConverter.Integer.convert("5"));
+ tempU.setLanguage((String) RedmineDataConverter.Text.convert("fr"));
+ tempU.setLastLoginOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T19:49:38+02:00"));
+ tempU.setLastname((String) RedmineDataConverter.Text.convert("chemit2"));
+ tempU.setLogin((String) RedmineDataConverter.Text.convert("tchemit2"));
+ tempU.setMail((String) RedmineDataConverter.Text.convert("chemit(a)codelutin.com"));
+ tempU.setMailNotification((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempU.setMemberId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempU.setRoleId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempU.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempU.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T19:49:38+02:00"));
+ model.put(User.class, tempU);
+ tempU = new User();
+ tempU.setAdmin((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempU.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T16:24:11+02:00"));
+ tempU.setFirstname((String) RedmineDataConverter.Text.convert("dev"));
+ tempU.setHashedPassword(
+ (String) RedmineDataConverter.Text.convert("70c881d4a26984ddce795f6f71817c9cf4480e79"));
+ tempU.setId((Integer) RedmineDataConverter.Integer.convert("7"));
+ tempU.setLanguage((String) RedmineDataConverter.Text.convert("fr"));
+ tempU.setLastLoginOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T16:34:39+02:00"));
+ tempU.setLastname((String) RedmineDataConverter.Text.convert("dev"));
+ tempU.setLogin((String) RedmineDataConverter.Text.convert("dev"));
+ tempU.setMail((String) RedmineDataConverter.Text.convert("dev3(a)ynot-home.info"));
+ tempU.setMailNotification((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempU.setMemberId((Integer) RedmineDataConverter.Integer.convert("9"));
+ tempU.setRoleId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempU.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempU.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T16:34:39+02:00"));
+ model.put(User.class, tempU);
+
+ Version tempV;
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:47:39+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("yo"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("9"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("yor"));
+ tempV.setSharing((String) RedmineDataConverter.Text.convert("none"));
+ tempV.setStatus((String) RedmineDataConverter.Text.convert("open"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:50:49+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:09+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("13"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("rrrrrrrrrouuuuuua"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:09+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:07:58+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("15"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("aaaauuuuuua"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:07:58+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T04:12:25+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoyeppppppppppppppppp"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("16"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("aaaau"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T04:13:20+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:40+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("14"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("aaaaaaaaaarrrrrrrrrouuuuuua"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:40+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T00:39:15+02:00"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("5"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("2"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T00:39:15+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:13:05+02:00"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("1.0.0"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:13:05+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:12+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("yoye"));
+ tempV.setEffectiveDate((Date) RedmineDataConverter.Date.convert("2009-09-06"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("11"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("yaouuuuuua"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:12+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:50:59+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("yoye"));
+ tempV.setEffectiveDate((Date) RedmineDataConverter.Date.convert("2009-09-06"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("10"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("ya"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:54:16+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:37+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
+ tempV.setEffectiveDate((Date) RedmineDataConverter.Date.convert("2009-09-06"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("12"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("ouuuuuua"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:42+02:00"));
+ model.put(Version.class, tempV);
+
+ IssueStatus tempIS;
+ tempIS = new IssueStatus();
+ tempIS.setId(1);
+ tempIS.setName("Nouveau");
+ tempIS.setPosition(1);
+ tempIS.setDefaultDoneRatio(10);
+ tempIS.setIsClosed(false);
+ tempIS.setIsDefault(true);
+ model.put(IssueStatus.class, tempIS);
+ tempIS = new IssueStatus();
+ tempIS.setId(2);
+ tempIS.setName("Assigné");
+ tempIS.setPosition(2);
+ tempIS.setIsClosed(false);
+ tempIS.setIsDefault(false);
+ model.put(IssueStatus.class, tempIS);
+ tempIS = new IssueStatus();
+ tempIS.setId(3);
+ tempIS.setName("Résolu");
+ tempIS.setPosition(3);
+ tempIS.setIsClosed(false);
+ tempIS.setIsDefault(false);
+ model.put(IssueStatus.class, tempIS);
+ tempIS = new IssueStatus();
+ tempIS.setId(4);
+ tempIS.setName("Commentaire");
+ tempIS.setPosition(4);
+ tempIS.setIsClosed(false);
+ tempIS.setIsDefault(false);
+ model.put(IssueStatus.class, tempIS);
+ tempIS = new IssueStatus();
+ tempIS.setId(5);
+ tempIS.setName("Fermé");
+ tempIS.setPosition(5);
+ tempIS.setIsClosed(true);
+ tempIS.setIsDefault(false);
+ model.put(IssueStatus.class, tempIS);
+ tempIS = new IssueStatus();
+ tempIS.setId(6);
+ tempIS.setPosition(6);
+ tempIS.setName("Rejeté");
+ tempIS.setIsClosed(true);
+ tempIS.setIsDefault(false);
+ model.put(IssueStatus.class, tempIS);
+
+ IssuePriority tempIP;
+ tempIP = new IssuePriority();
+ tempIP.setId(3);
+ tempIP.setParentId(1);
+ tempIP.setProjectId(2);
+ tempIP.setName("Bas");
+ tempIP.setPosition(1);
+ tempIP.setOpt("IPRI");
+ tempIP.setIsDefault(false);
+ tempIP.setActive(true);
+ model.put(IssuePriority.class, tempIP);
+ tempIP = new IssuePriority();
+ tempIP.setId(4);
+ tempIP.setName("Normal");
+ tempIP.setPosition(2);
+ tempIP.setOpt("IPRI");
+ tempIP.setIsDefault(true);
+ model.put(IssuePriority.class, tempIP);
+ tempIP = new IssuePriority();
+ tempIP.setId(5);
+ tempIP.setName("Haut");
+ tempIP.setPosition(3);
+ tempIP.setOpt("IPRI");
+ tempIP.setIsDefault(false);
+ model.put(IssuePriority.class, tempIP);
+ tempIP = new IssuePriority();
+ tempIP.setId(6);
+ tempIP.setName("Urgent");
+ tempIP.setPosition(4);
+ tempIP.setOpt("IPRI");
+ tempIP.setIsDefault(false);
+ model.put(IssuePriority.class, tempIP);
+ tempIP = new IssuePriority();
+ tempIP.setId(7);
+ tempIP.setName("Immédiat");
+ tempIP.setPosition(5);
+ tempIP.setOpt("IPRI");
+ tempIP.setIsDefault(false);
+ model.put(IssuePriority.class, tempIP);
+
+ IssueCategory tempIC;
+ tempIC = new IssueCategory();
+ tempIC.setId(1);
+ tempIC.setName("categorie one");
+ tempIC.setProjectId(1);
+ model.put(IssueCategory.class, tempIC);
+ tempIC = new IssueCategory();
+ tempIC.setId(2);
+ tempIC.setName("categorie two");
+ tempIC.setProjectId(1);
+ model.put(IssueCategory.class, tempIC);
+
+ News tempN;
+ tempN = new News();
+ tempN.setId(85);
+ tempN.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-17T21:50:26+02:00"));
+ tempN.setProjectId(1);
+ tempN.setAuthorId(4);
+ tempN.setCommentsCount(0);
+ tempN.setDescription("description");
+ tempN.setSummary("summary");
+ tempN.setTitle("title");
+ model.put(News.class, tempN);
+ tempN = new News();
+ tempN.setId(86);
+ tempN.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-17T21:55:26+02:00"));
+ tempN.setProjectId(1);
+ tempN.setAuthorId(4);
+ tempN.setCommentsCount(0);
+ tempN.setDescription("description2");
+ tempN.setSummary("summary2");
+ tempN.setTitle("title2");
+ model.put(News.class, tempN);
+
+ TimeEntry tempE;
+
+ tempE = new TimeEntry();
+ tempE.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:02:02+01:00"));
+ tempE.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:02:02+01:00"));
+ tempE.setSpentOn((Date) RedmineDataConverter.Date.convert("2009-12-31"));
+ tempE.setId(1);
+ tempE.setProjectId(1);
+ tempE.setUserId(4);
+ tempE.setIssueId(6);
+ tempE.setActivityId(8);
+
+ tempE.setHours(1);
+ tempE.setTmonth(12);
+ tempE.setTyear(2009);
+ tempE.setTweek(53);
+ tempE.setComments("Test");
+ model.put(TimeEntry.class, tempE);
+
+ tempE = new TimeEntry();
+ tempE.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:10:01+01:00"));
+ tempE.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:10:01+01:00"));
+ tempE.setSpentOn((Date) RedmineDataConverter.Date.convert("2009-12-31"));
+ tempE.setId(2);
+ tempE.setProjectId(1);
+ tempE.setUserId(4);
+ tempE.setIssueId(6);
+ tempE.setActivityId(9);
+
+ tempE.setHours(2);
+ tempE.setTmonth(12);
+ tempE.setTyear(2009);
+ tempE.setTweek(53);
+ tempE.setComments("deuxième temps");
+ model.put(TimeEntry.class, tempE);
+ }
+
+
+ public Attachment getAttachment() {
+ Attachment result = new Attachment();
+ File fileToUpload = null;
+ try {
+ fileToUpload = File.createTempFile("toupload", ".txt");
+ FileUtils.write(fileToUpload, FILE_TO_UPLOAD_CONTENT);
+ result.setToUpload(fileToUpload);
+ result.setDescription("attachment description...");
+ return result;
+ } catch (IOException e) {
+ throw new RuntimeException("Could not create temp file", e);
+ }
+
+ }
+
+ /**
+ * Configuration of a redmine service for test purposes.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+ public static class FakeRedmineServiceConfiguration implements RedmineServiceConfiguration {
+
+ URL restUrl;
+
+ String restUsername;
+
+ String restPassword;
+
+ boolean verbose;
+
+ boolean anonymous;
+
+ String encoding;
+
+ @Override
+ public String getEncoding() {
+ return encoding;
+ }
+
+ @Override
+ public void setEncoding(String encoding) {
+ this.encoding = encoding;
+ }
+
+ @Override
+ public String getRestPassword() {
+ return restPassword;
+ }
+
+ @Override
+ public void setRestPassword(String restPassword) {
+ this.restPassword = restPassword;
+ }
+
+ @Override
+ public URL getRestUrl() {
+ return restUrl;
+ }
+
+ @Override
+ public void setRestUrl(URL restUrl) {
+ this.restUrl = restUrl;
+ }
+
+ @Override
+ public String getRestUsername() {
+ return restUsername;
+ }
+
+ @Override
+ public void setRestUsername(String restUsername) {
+ this.restUsername = restUsername;
+ }
+
+ @Override
+ public boolean isVerbose() {
+ return verbose;
+ }
+
+ @Override
+ public void setVerbose(boolean verbose) {
+ this.verbose = verbose;
+ }
+
+ @Override
+ public boolean isAnonymous() {
+ return anonymous;
+ }
+
+ @Override
+ public void setAnonymous(boolean anonymous) {
+ this.anonymous = anonymous;
+ }
+
+ @Override
+ public String toString() {
+ ToStringBuilder b = new ToStringBuilder(this,
+ ToStringStyle.MULTI_LINE_STYLE
+ );
+ b.append("redmineUrl", restUrl);
+ if (anonymous) {
+ b.append("anonymous", true);
+ } else {
+ b.append("redmineUsername", restUsername);
+ b.append("redminePassword", "***");
+ }
+ b.append("encoding", encoding);
+ b.append("verbose", verbose);
+ return b.toString();
+ }
+ }
+}
Property changes on: trunk/jredmine-client-2.x/src/test/java/org/nuiton/jredmine/v2_x/RedmineFixtures.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-2.x/src/test/java/org/nuiton/jredmine/v2_x/RedmineServer.java
===================================================================
--- trunk/jredmine-client-2.x/src/test/java/org/nuiton/jredmine/v2_x/RedmineServer.java (rev 0)
+++ trunk/jredmine-client-2.x/src/test/java/org/nuiton/jredmine/v2_x/RedmineServer.java 2012-07-13 17:44:33 UTC (rev 292)
@@ -0,0 +1,206 @@
+package org.nuiton.jredmine.v2_x;
+/*
+ * #%L
+ * JRedmine :: Client 2.x
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codehaus.plexus.util.StringUtils;
+import org.junit.Assume;
+import org.junit.rules.TestWatcher;
+import org.junit.runner.Description;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+import org.nuiton.jredmine.RedmineServiceImplementor;
+
+import java.io.IOException;
+
+/**
+ * A redmine server usable by tests.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public abstract class RedmineServer<S> extends TestWatcher {
+
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(RedmineServer.class);
+
+ /**
+ * Fixtures.
+ *
+ * @since 1.4
+ */
+ protected final RedmineFixtures fixtures;
+
+ /**
+ * Service configuration to use.
+ *
+ * @since 1.4
+ */
+ protected RedmineServiceConfiguration configuration;
+
+ /**
+ * Current service.
+ *
+ * @since 1.4
+ */
+ protected S service;
+
+ public RedmineServer(RedmineFixtures fixtures) {
+ this.fixtures = fixtures;
+ }
+
+ protected abstract S createService(RedmineFixtures fixtures,
+ RedmineServiceConfiguration configuration) throws IOException, RedmineServiceException;
+
+ protected abstract RedmineServiceConfiguration createConfiguration(RedmineFixtures fixtures) throws IOException;
+
+ public RedmineFixtures getFixtures() {
+ return fixtures;
+ }
+
+ public RedmineServiceConfiguration getConfiguration() {
+ return configuration;
+ }
+
+ public S getService() {
+ return service;
+ }
+
+ @Override
+ protected void starting(Description description) {
+
+ try {
+ configuration = createConfiguration(fixtures);
+ } catch (IOException e) {
+
+ throw new IllegalStateException("Could not create configuration", e);
+ }
+
+ try {
+ service = createService(fixtures, configuration);
+ } catch (Exception e) {
+ throw new IllegalStateException("Could not create service", e);
+ }
+ }
+
+ @Override
+ protected void finished(Description description) {
+
+ if (service != null) {
+ try {
+ ((RedmineServiceImplementor) service).destroy();
+ } catch (RedmineServiceException e) {
+ throw new IllegalStateException("Could not close service ", e);
+ }
+ }
+ }
+
+ protected void checkService() {
+
+ if (log.isInfoEnabled()) {
+ log.info("Will check service...");
+ }
+
+ try {
+
+ try {
+ configuration = createConfiguration(fixtures);
+ } catch (IOException e) {
+
+ throw new IllegalStateException("Could not create configuration", e);
+ }
+
+ boolean anonymous = configuration.isAnonymous();
+ try {
+ configuration.setAnonymous(true);
+ service = createService(fixtures, configuration);
+ } catch (Exception e) {
+
+ // could not init service
+ if (log.isInfoEnabled()) {
+ log.info("Will skip test " +
+ RedmineServiceTest.class.getName() +
+ ", since could not init service", e);
+ }
+ Assume.assumeTrue(false);
+ return;
+
+ } finally {
+
+ //push back initial flag value
+ configuration.setAnonymous(anonymous);
+ }
+
+ if (!anonymous) {
+
+ if (StringUtils.isBlank(configuration.getRestUsername())) {
+ if (log.isInfoEnabled()) {
+ log.info("Will skip test " +
+ RedmineServiceTest.class.getName() +
+ ", since not username was given and loggued service is required");
+ }
+ Assume.assumeTrue(false);
+ return;
+ }
+
+
+ if (StringUtils.isBlank(configuration.getRestPassword())) {
+ if (log.isInfoEnabled()) {
+ log.info("Will skip test " +
+ RedmineServiceTest.class.getName() +
+ ", since not password was given and loggued service is required");
+ }
+ Assume.assumeTrue(false);
+ return;
+ }
+
+ // recheck service (to test now login)
+ try {
+ service = createService(fixtures, configuration);
+ } catch (Exception e) {
+ // ping was not ok
+ if (log.isInfoEnabled()) {
+ log.info("Will skip test " +
+ RedmineServiceTest.class.getName() +
+ ", since login [" + configuration.getRestUsername() + "] was bad : " + e.getMessage(), e);
+ }
+
+ Assume.assumeTrue(false);
+ }
+ }
+ } finally {
+ if (log.isInfoEnabled()) {
+ log.info("Service checked...");
+ }
+ if (service != null) {
+ try {
+ ((RedmineServiceImplementor) service).destroy();
+ } catch (RedmineServiceException e) {
+ throw new IllegalStateException("Could not close service", e);
+ }
+ }
+ }
+ }
+}
Property changes on: trunk/jredmine-client-2.x/src/test/java/org/nuiton/jredmine/v2_x/RedmineServer.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-2.x/src/test/java/org/nuiton/jredmine/v2_x/RedmineServiceAsAnonymousTest.java
===================================================================
--- trunk/jredmine-client-2.x/src/test/java/org/nuiton/jredmine/v2_x/RedmineServiceAsAnonymousTest.java (rev 0)
+++ trunk/jredmine-client-2.x/src/test/java/org/nuiton/jredmine/v2_x/RedmineServiceAsAnonymousTest.java 2012-07-13 17:44:33 UTC (rev 292)
@@ -0,0 +1,225 @@
+package org.nuiton.jredmine.v2_x;
+/*
+ * #%L
+ * JRedmine :: Client 2.x
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+import org.nuiton.jredmine.RedmineService;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+import org.nuiton.jredmine.RedmineServiceLoginException;
+import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.Issue;
+import org.nuiton.jredmine.model.IssueCategory;
+import org.nuiton.jredmine.model.IssuePriority;
+import org.nuiton.jredmine.model.IssueStatus;
+import org.nuiton.jredmine.model.News;
+import org.nuiton.jredmine.model.Project;
+import org.nuiton.jredmine.model.TimeEntry;
+import org.nuiton.jredmine.model.Tracker;
+import org.nuiton.jredmine.model.User;
+import org.nuiton.jredmine.model.Version;
+
+import java.io.IOException;
+
+/**
+ * Tests the {@link RedmineAnonymousServiceImpl}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.5
+ */
+@Ignore
+public class RedmineServiceAsAnonymousTest {
+
+ protected static final RedmineFixtures fixtures = new RedmineFixtures();
+
+ @Rule
+ public final RedmineServer<RedmineService> server = createNewServer(fixtures);
+
+ protected RedmineService getService() {
+ return server.getService();
+ }
+
+ protected RedmineServer<RedmineService> createNewServer(RedmineFixtures fixtures) {
+ return new RedmineServer<RedmineService>(fixtures) {
+
+ @Override
+ protected RedmineService createService(
+ RedmineFixtures fixture,
+ RedmineServiceConfiguration configuration) throws IOException, RedmineServiceException {
+
+ return fixture.newRedmineService(configuration);
+ }
+
+ @Override
+ protected RedmineServiceConfiguration createConfiguration(RedmineFixtures fixture) throws IOException {
+ RedmineServiceConfiguration conf = fixture.newAnonymousConfiguration();
+ return conf;
+ }
+ };
+ }
+
+
+ @BeforeClass
+ public static void beforeClass() {
+ RedmineServer<RedmineService> newServer =
+ new RedmineServiceAsAnonymousTest().createNewServer(fixtures);
+ newServer.checkService();
+ }
+
+ @Test
+ public void getProjects() throws Exception {
+ Project[] projects = getService().getProjects();
+ Assert.assertNotNull(projects);
+ }
+
+ @Test
+ public void getIssuePriorities() throws Exception {
+ IssuePriority[] issuePriorities = getService().getIssuePriorities();
+ Assert.assertNotNull(issuePriorities);
+ }
+
+ @Test
+ public void getIssueStatuses() throws Exception {
+ IssueStatus[] issueStatuses = getService().getIssueStatuses();
+ Assert.assertNotNull(issueStatuses);
+ }
+
+ @Test
+ public void getProject() throws Exception {
+ Project project = getService().getProject(fixtures.projectName());
+ Assert.assertNotNull(project);
+ }
+
+ @Test
+ public void getIssueCategories() throws Exception {
+ IssueCategory[] issueCategories = getService().getIssueCategories(fixtures.projectName());
+ Assert.assertNotNull(issueCategories);
+ }
+
+ @Test
+ public void getTrackers() throws Exception {
+ Tracker[] trackers = getService().getTrackers(fixtures.projectName());
+ Assert.assertNotNull(trackers);
+ }
+
+ @Test
+ public void getNews() throws Exception {
+ News[] news = getService().getNews(fixtures.projectName());
+ Assert.assertNotNull(news);
+ }
+
+ @Test
+ public void getProjectMembers() throws Exception {
+ User[] users = getService().getProjectMembers(fixtures.projectName());
+ Assert.assertNotNull(users);
+ }
+
+ @Test
+ public void getProjectIssues() throws Exception {
+ Issue[] issues = getService().getIssues(fixtures.projectName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getVersions() throws Exception {
+ Version[] versions = getService().getVersions(fixtures.projectName());
+ Assert.assertNotNull(versions);
+ }
+
+ @Test
+ public void getVersion() throws Exception {
+ Version version = getService().getVersion(fixtures.projectName(), fixtures.versionName());
+ Assert.assertNotNull(version);
+ }
+
+ @Test
+ public void getVersionIssues() throws Exception {
+ Issue[] issues = getService().getIssues(fixtures.projectName(), fixtures.versionName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getOpenedIssues() throws Exception {
+ Issue[] issues = getService().getOpenedIssues(fixtures.projectName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getClosedIssues() throws Exception {
+ Issue[] issues = getService().getClosedIssues(fixtures.projectName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getIssueTimeEntries() throws Exception {
+ TimeEntry[] timeEntries = getService().getIssueTimeEntries(fixtures.projectName(), fixtures.issueId());
+ Assert.assertNotNull(timeEntries);
+ }
+
+ @Test
+ public void getAttachments() throws Exception {
+ Attachment[] attachments = getService().getAttachments(fixtures.projectName(), fixtures.versionName());
+ Assert.assertNotNull(attachments);
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ public void getUserProjects() throws Exception {
+ getService().getUserProjects();
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ public void addVersion() throws Exception {
+ getService().addVersion(fixtures.projectName(), new Version());
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ public void addAttachment() throws Exception {
+ getService().addAttachment(fixtures.projectName(), fixtures.versionName(), new Attachment());
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ public void addNews() throws Exception {
+ getService().addNews(fixtures.projectName(), new News());
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ public void updateVersion() throws Exception {
+ getService().updateVersion(fixtures.projectName(), new Version());
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ public void nextVersion() throws Exception {
+ getService().nextVersion(fixtures.projectName(), fixtures.versionName(), new Version());
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ public void addIssueTime() throws Exception {
+ getService().addIssueTimeEntry(fixtures.projectName(), fixtures.issueId(), new TimeEntry());
+ }
+
+}
Property changes on: trunk/jredmine-client-2.x/src/test/java/org/nuiton/jredmine/v2_x/RedmineServiceAsAnonymousTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-2.x/src/test/java/org/nuiton/jredmine/v2_x/RedmineServiceTest.java
===================================================================
--- trunk/jredmine-client-2.x/src/test/java/org/nuiton/jredmine/v2_x/RedmineServiceTest.java (rev 0)
+++ trunk/jredmine-client-2.x/src/test/java/org/nuiton/jredmine/v2_x/RedmineServiceTest.java 2012-07-13 17:44:33 UTC (rev 292)
@@ -0,0 +1,237 @@
+package org.nuiton.jredmine.v2_x;
+/*
+ * #%L
+ * JRedmine :: Client 2.x
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+import org.nuiton.jredmine.RedmineService;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.Issue;
+import org.nuiton.jredmine.model.IssueCategory;
+import org.nuiton.jredmine.model.IssuePriority;
+import org.nuiton.jredmine.model.IssueStatus;
+import org.nuiton.jredmine.model.News;
+import org.nuiton.jredmine.model.Project;
+import org.nuiton.jredmine.model.TimeEntry;
+import org.nuiton.jredmine.model.Tracker;
+import org.nuiton.jredmine.model.User;
+import org.nuiton.jredmine.model.Version;
+
+import java.io.IOException;
+
+/**
+ * Tests the {@link RedmineAnonymousServiceImpl}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.5
+ */
+@Ignore
+public class RedmineServiceTest {
+
+ protected static final RedmineFixtures fixtures = new RedmineFixtures();
+
+ @Rule
+ public final RedmineServer<RedmineService> server = createNewServer(fixtures);
+
+ protected RedmineService getService() {
+ return server.getService();
+ }
+
+
+ protected RedmineServer<RedmineService> createNewServer(RedmineFixtures fixtures) {
+ return new RedmineServer<RedmineService>(fixtures) {
+
+ @Override
+ protected RedmineService createService(
+ RedmineFixtures fixture,
+ RedmineServiceConfiguration configuration) throws IOException, RedmineServiceException {
+ return fixture.newRedmineService(configuration);
+ }
+
+ @Override
+ protected RedmineServiceConfiguration createConfiguration(RedmineFixtures fixture) throws IOException {
+ RedmineServiceConfiguration conf = fixture.newLogguedConfiguration();
+ return conf;
+ }
+ };
+ }
+
+ @BeforeClass
+ public static void beforeClass() {
+ RedmineServer<RedmineService> newServer =
+ new RedmineServiceTest().createNewServer(fixtures);
+ newServer.checkService();
+ }
+
+ @Test
+ public void getProjects() throws Exception {
+ Project[] projects = getService().getProjects();
+ Assert.assertNotNull(projects);
+ }
+
+ @Test
+ public void getIssuePriorities() throws Exception {
+ IssuePriority[] issuePriorities = getService().getIssuePriorities();
+ Assert.assertNotNull(issuePriorities);
+ }
+
+ @Test
+ public void getIssueStatuses() throws Exception {
+ IssueStatus[] issueStatuses = getService().getIssueStatuses();
+ Assert.assertNotNull(issueStatuses);
+ }
+
+ @Test
+ public void getProject() throws Exception {
+ Project project = getService().getProject(fixtures.projectName());
+ Assert.assertNotNull(project);
+ }
+
+ @Test
+ public void getIssueCategories() throws Exception {
+ IssueCategory[] issueCategories = getService().getIssueCategories(fixtures.projectName());
+ Assert.assertNotNull(issueCategories);
+ }
+
+ @Test
+ public void getTrackers() throws Exception {
+ Tracker[] trackers = getService().getTrackers(fixtures.projectName());
+ Assert.assertNotNull(trackers);
+ }
+
+ @Test
+ public void getNews() throws Exception {
+ News[] news = getService().getNews(fixtures.projectName());
+ Assert.assertNotNull(news);
+ }
+
+ @Test
+ public void getProjectMembers() throws Exception {
+ User[] users = getService().getProjectMembers(fixtures.projectName());
+ Assert.assertNotNull(users);
+ }
+
+ @Test
+ public void getProjectIssues() throws Exception {
+ Issue[] issues = getService().getIssues(fixtures.projectName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getVersions() throws Exception {
+ Version[] versions = getService().getVersions(fixtures.projectName());
+ Assert.assertNotNull(versions);
+ }
+
+ @Test
+ public void getVersion() throws Exception {
+ Version version = getService().getVersion(fixtures.projectName(), fixtures.versionName());
+ Assert.assertNotNull(version);
+ }
+
+ @Test
+ public void getVersionIssues() throws Exception {
+ Issue[] issues = getService().getIssues(fixtures.projectName(), fixtures.versionName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getOpenedIssues() throws Exception {
+ Issue[] issues = getService().getOpenedIssues(fixtures.projectName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getClosedIssues() throws Exception {
+ Issue[] issues = getService().getClosedIssues(fixtures.projectName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getIssueTimeEntries() throws Exception {
+ TimeEntry[] timeEntries = getService().getIssueTimeEntries(fixtures.projectName(), fixtures.issueId());
+ Assert.assertNotNull(timeEntries);
+ }
+
+ @Test
+ public void getAttachments() throws Exception {
+ Attachment[] attachments = getService().getAttachments(fixtures.projectName(), fixtures.versionName());
+ Assert.assertNotNull(attachments);
+ }
+
+ @Test
+ public void getUserProjects() throws Exception {
+ Project[] userProjects = getService().getUserProjects();
+ Assert.assertNotNull(userProjects);
+ }
+
+ @Ignore
+ @Test
+ public void addVersion() throws Exception {
+ getService().addVersion(fixtures.projectName(), new Version());
+ }
+
+ @Ignore
+ @Test
+ public void addAttachment() throws Exception {
+ Version version = fixtures.getVersion();
+ Attachment attachment = fixtures.getAttachment();
+ Attachment updatedAttachment = getService().addAttachment(
+ fixtures.projectName(),
+ version.getName(),
+ attachment
+ );
+ Assert.assertNotNull(updatedAttachment);
+ }
+
+ @Ignore
+ @Test
+ public void addNews() throws Exception {
+ getService().addNews(fixtures.projectName(), new News());
+ }
+
+ @Ignore
+ @Test
+ public void updateVersion() throws Exception {
+ getService().updateVersion(fixtures.projectName(), new Version());
+ }
+
+ @Ignore
+ @Test
+ public void nextVersion() throws Exception {
+ getService().nextVersion(fixtures.projectName(), fixtures.versionName(), new Version());
+ }
+
+ @Ignore
+ @Test
+ public void addIssueTime() throws Exception {
+ getService().addIssueTimeEntry(fixtures.projectName(), fixtures.issueId(), new TimeEntry());
+ }
+
+}
Property changes on: trunk/jredmine-client-2.x/src/test/java/org/nuiton/jredmine/v2_x/RedmineServiceTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-2.x/src/test/resources/log4j.properties
===================================================================
--- trunk/jredmine-client-2.x/src/test/resources/log4j.properties (rev 0)
+++ trunk/jredmine-client-2.x/src/test/resources/log4j.properties 2012-07-13 17:44:33 UTC (rev 292)
@@ -0,0 +1,33 @@
+###
+# #%L
+# JRedmine :: Client 2.x
+# $Id$
+# $HeadURL:$
+# %%
+# Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+# %%
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Lesser Public License for more details.
+#
+# You should have received a copy of the GNU General Lesser Public
+# License along with this program. If not, see
+# <http://www.gnu.org/licenses/lgpl-3.0.html>.
+# #L%
+###
+log4j.rootCategory=WARN, stdout
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=[%p] (%c{1}:%L) - %m%n
+
+log4j.logger.org.nuiton.jredmine=INFO
+log4j.logger.org.nuiton.io.rest=INFO
+#log4j.logger.org.nuiton.io.xpp3.Xpp3Helper=DEBUG
+log4j.logger.org.apache.commons.httpclient.HttpClient=INFO
Property changes on: trunk/jredmine-client-2.x/src/test/resources/log4j.properties
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-2.x/src/test/resources/test-config.properties
===================================================================
--- trunk/jredmine-client-2.x/src/test/resources/test-config.properties (rev 0)
+++ trunk/jredmine-client-2.x/src/test/resources/test-config.properties 2012-07-13 17:44:33 UTC (rev 292)
@@ -0,0 +1,27 @@
+###
+# #%L
+# JRedmine :: Client 2.x
+# $Id$
+# $HeadURL:$
+# %%
+# Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+# %%
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Lesser Public License for more details.
+#
+# You should have received a copy of the GNU General Lesser Public
+# License along with this program. If not, see
+# <http://www.gnu.org/licenses/lgpl-3.0.html>.
+# #L%
+###
+# default values for test configuration
+test.redmineUrl=http://nuiton.org
+test.encoding=UTF-8
+test.verbose=false
Property changes on: trunk/jredmine-client-2.x/src/test/resources/test-config.properties
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Modified: trunk/jredmine-maven-plugin/pom.xml
===================================================================
--- trunk/jredmine-maven-plugin/pom.xml 2012-07-13 17:16:17 UTC (rev 291)
+++ trunk/jredmine-maven-plugin/pom.xml 2012-07-13 17:44:33 UTC (rev 292)
@@ -56,6 +56,17 @@
</exclusion>
</exclusions>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>jredmine-client-2.x</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
<dependency>
<groupId>org.nuiton</groupId>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-07-13 17:16:17 UTC (rev 291)
+++ trunk/pom.xml 2012-07-13 17:44:33 UTC (rev 292)
@@ -42,6 +42,7 @@
<modules>
<module>jredmine-client-api</module>
<module>jredmine-client-1.x</module>
+ <module>jredmine-client-2.x</module>
<module>jredmine-maven-plugin</module>
</modules>
1
0
r291 - in trunk/jredmine-client-1.x/src: main/java/org/nuiton/jredmine main/java/org/nuiton/jredmine/v1_x test/java/org/nuiton/jredmine test/java/org/nuiton/jredmine/v1_x
by tchemit@users.nuiton.org 13 Jul '12
by tchemit@users.nuiton.org 13 Jul '12
13 Jul '12
Author: tchemit
Date: 2012-07-13 19:16:17 +0200 (Fri, 13 Jul 2012)
New Revision: 291
Url: http://nuiton.org/repositories/revision/jredmine/291
Log:
rename packages
Added:
trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_x/
trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_x/RedmineAnonymousServiceImpl.java
trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_x/RedmineRequestFactoryImpl.java
trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_x/RedmineRestClient.java
trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_x/RedmineServiceImpl.java
trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_x/RedmineServiceImplementorImpl.java
trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_x/RedmineServiceProviderImpl.java
trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_x/
trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_x/RedmineAnonymousServiceTest.java
trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_x/RedmineFixtures.java
trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_x/RedmineServer.java
trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_x/RedmineServiceAsAnonymousTest.java
trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_x/RedmineServiceTest.java
Removed:
trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_3_x/
trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_3_x/
Added: trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_x/RedmineAnonymousServiceImpl.java
===================================================================
--- trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_x/RedmineAnonymousServiceImpl.java (rev 0)
+++ trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_x/RedmineAnonymousServiceImpl.java 2012-07-13 17:16:17 UTC (rev 291)
@@ -0,0 +1,289 @@
+package org.nuiton.jredmine.v1_x;
+/*
+ * #%L
+ * JRedmine :: Client 1.x
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.io.rest.RestClient;
+import org.nuiton.jredmine.RedmineAnonymousService;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+import org.nuiton.jredmine.RedmineServiceImplementor;
+import org.nuiton.jredmine.RedmineServiceLoginException;
+import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.Issue;
+import org.nuiton.jredmine.model.IssueCategory;
+import org.nuiton.jredmine.model.IssuePriority;
+import org.nuiton.jredmine.model.IssueStatus;
+import org.nuiton.jredmine.model.ModelHelper;
+import org.nuiton.jredmine.model.News;
+import org.nuiton.jredmine.model.Project;
+import org.nuiton.jredmine.model.TimeEntry;
+import org.nuiton.jredmine.model.Tracker;
+import org.nuiton.jredmine.model.User;
+import org.nuiton.jredmine.model.Version;
+
+/**
+ * Default implementation of {@link RedmineAnonymousService}.
+ * <p/>
+ * This implementation just make sure that the rest client is anonnymous.
+ * <p/>
+ * Created: 2 janv. 2010
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @see RedmineServiceConfiguration#isAnonymous()
+ * @since 1.0.3
+ */
+public class RedmineAnonymousServiceImpl implements RedmineServiceImplementor, RedmineAnonymousService {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(RedmineAnonymousServiceImpl.class);
+
+ protected RedmineServiceImplementor delegateImplementor;
+
+ public RedmineAnonymousServiceImpl() {
+ delegateImplementor = new RedmineServiceImplementorImpl();
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ /// RedmineAnonymousService implementation
+ ///////////////////////////////////////////////////////////////////////////
+
+ @Override
+ public IssueStatus[] getIssueStatuses() throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_ISSUE_STATUS_REQUEST_NAME,
+ IssueStatus.class
+ );
+ }
+
+ @Override
+ public IssuePriority[] getIssuePriorities() throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_ISSUE_PRIORITY_REQUEST_NAME,
+ IssuePriority.class
+ );
+ }
+
+ @Override
+ public Project[] getProjects() throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_PROJECT_REQUEST_NAME, Project.class);
+ }
+
+ @Override
+ public IssueCategory[] getIssueCategories(String projectName) throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_ISSUE_CATEGORY_REQUEST_NAME,
+ IssueCategory.class,
+ projectName
+ );
+ }
+
+ @Override
+ public Project getProject(String projectName) throws RedmineServiceException {
+ return getData(ModelHelper.GET_PROJECT_REQUEST_NAME,
+ Project.class,
+ projectName
+ );
+ }
+
+ @Override
+ public Tracker[] getTrackers(String projectName) throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_TRACKER_REQUEST_NAME,
+ Tracker.class,
+ projectName
+ );
+ }
+
+ @Override
+ public News[] getNews(String projectName) throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_NEWS_REQUEST_NAME,
+ News.class,
+ projectName
+ );
+ }
+
+ @Override
+ public User[] getProjectMembers(String projectName) throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_USER_REQUEST_NAME,
+ User.class,
+ projectName
+ );
+ }
+
+ @Override
+ public Version[] getVersions(String projectName) throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_VERSION_REQUEST_NAME,
+ Version.class,
+ projectName
+ );
+ }
+
+ @Override
+ public Version getVersion(String projectName,
+ String versionName) throws RedmineServiceException {
+ return getData(ModelHelper.GET_VERSION_REQUEST_NAME,
+ Version.class,
+ projectName,
+ versionName
+ );
+ }
+
+ @Override
+ public Attachment[] getAttachments(String projectName,
+ String versionName) throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_ATTACHMENTS_REQUEST_NAME,
+ Attachment.class,
+ projectName,
+ versionName
+ );
+ }
+
+ @Override
+ public Issue[] getIssues(String projectName,
+ String versionName) throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_ISSUES_REQUEST_NAME,
+ Issue.class,
+ projectName,
+ versionName
+ );
+ }
+
+ @Override
+ public TimeEntry[] getIssueTimeEntries(String projectName,
+ String issueId) throws RedmineServiceException {
+ return getDatas(ModelHelper.GET_ALL_ISSUE_TIME_ENTRY_REQUEST_NAME,
+ TimeEntry.class,
+ projectName,
+ issueId
+ );
+ }
+
+ @Override
+ public Issue[] getIssues(String projectName) throws RedmineServiceException {
+ Issue[] result = getDatas(ModelHelper.GET_ALL_PROJECT_ISSUES_REQUEST_NAME,
+ Issue.class,
+ projectName
+ );
+ return result;
+ }
+
+ @Override
+ public Issue[] getOpenedIssues(String projectName) throws RedmineServiceException {
+ Issue[] result = getDatas(ModelHelper.GET_ALL_PROJECT_OPENED_ISSUES_REQUEST_NAME,
+ Issue.class,
+ projectName
+ );
+ return result;
+ }
+
+ @Override
+ public Issue[] getClosedIssues(String projectName) throws RedmineServiceException {
+ Issue[] result = getDatas(ModelHelper.GET_ALL_PROJECT_CLOSED_ISSUES_REQUEST_NAME,
+ Issue.class,
+ projectName
+ );
+ return result;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ /// RedmineServiceImplementor implementation
+ ///////////////////////////////////////////////////////////////////////////
+ @Override
+ public RedmineServiceImplementor init(RedmineServiceConfiguration configuration) throws RedmineServiceException {
+ // Force to not be loggued
+ configuration.setAnonymous(true);
+ if (log.isDebugEnabled()) {
+ log.debug("init configuration for " + this);
+ }
+ return delegateImplementor.init(configuration);
+ }
+
+ @Override
+ public RestClient getSession() {
+ return delegateImplementor.getSession();
+ }
+
+ @Override
+ public int ping() {
+ return delegateImplementor.ping();
+ }
+
+ @Override
+ public void login() throws RedmineServiceLoginException {
+ delegateImplementor.login();
+ }
+
+ @Override
+ public void logout() throws RedmineServiceLoginException {
+ delegateImplementor.logout();
+ }
+
+ @Override
+ public <T> T getData(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ return delegateImplementor.getData(requestName, type, args);
+ }
+
+ @Override
+ public <T> T[] getDatas(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ return delegateImplementor.getDatas(requestName, type, args);
+ }
+
+ @Override
+ public <T> T sendData(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ return delegateImplementor.sendData(requestName, type, args);
+ }
+
+ @Override
+ public <T> T[] sendDatas(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ return delegateImplementor.sendDatas(requestName, type, args);
+ }
+
+ @Override
+ public boolean isInit() {
+ return delegateImplementor.isInit();
+ }
+
+ @Override
+ public boolean isLoggued() {
+ return delegateImplementor.isLoggued();
+ }
+
+ @Override
+ public void destroy() throws RedmineServiceException {
+ delegateImplementor.destroy();
+ }
+
+ @Override
+ public void checkLoggued() throws IllegalStateException, RedmineServiceLoginException, NullPointerException {
+ delegateImplementor.checkLoggued();
+ }
+
+}
Added: trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_x/RedmineRequestFactoryImpl.java
===================================================================
--- trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_x/RedmineRequestFactoryImpl.java (rev 0)
+++ trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_x/RedmineRequestFactoryImpl.java 2012-07-13 17:16:17 UTC (rev 291)
@@ -0,0 +1,235 @@
+package org.nuiton.jredmine.v1_x;
+/*
+ * #%L
+ * JRedmine :: Client 1.x
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import com.google.common.base.Strings;
+import org.nuiton.io.rest.AbstractRequestFactory;
+import org.nuiton.io.rest.RestMethod;
+import org.nuiton.io.rest.RestRequest;
+import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.ModelHelper;
+import org.nuiton.jredmine.model.News;
+import org.nuiton.jredmine.model.TimeEntry;
+import org.nuiton.jredmine.model.Version;
+import org.nuiton.jredmine.model.VersionStatusEnum;
+import org.nuiton.jredmine.request.DefaultRedmineRequestBuilder;
+import org.nuiton.jredmine.request.IssueScopeRedmineRequestBuilder;
+import org.nuiton.jredmine.request.ProjectScopeRedmineRequestBuilder;
+import org.nuiton.jredmine.request.VersionScopeRedmineRequestBuilder;
+
+import java.io.File;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Factory of {@link RestRequest}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public class RedmineRequestFactoryImpl extends AbstractRequestFactory {
+
+ @Override
+ public void addDefaultRequests() {
+
+ // misc requests
+
+ addRequestBuilder(new DefaultRedmineRequestBuilder(ModelHelper.PING_REQUEST_NAME, RestMethod.GET, "jredmine", "ping"));
+// addRequestBuilder(new DefaultRedmineRequestBuilder(PING_REQUEST_NAME, RestMethod.GET, "projects"));
+ addRequestBuilder(new DefaultRedmineRequestBuilder(ModelHelper.LOGOUT_REQUEST_NAME, RestMethod.GET, "jredmine", "logout"));
+// addRequestBuilder(new DefaultRedmineRequestBuilder(LOGIN_REQUEST_NAME, RestMethod.POST, "login") {
+ addRequestBuilder(new DefaultRedmineRequestBuilder(ModelHelper.LOGIN_REQUEST_NAME, RestMethod.POST, "jredmine", "login") {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+ String login = (String) args[0];
+ String password = (String) args[1];
+ return new String[]{"username", login, "password", password};
+ }
+ });
+
+ // data with no scope requests
+
+ addRequestBuilder(new DefaultRedmineRequestBuilder(ModelHelper.GET_ALL_PROJECT_REQUEST_NAME, RestMethod.GET, "jredmine", "get_projects.xml"));
+// addRequestBuilder(new DefaultRedmineRequestBuilder(GET_ALL_PROJECT_REQUEST_NAME, RestMethod.GET, "projects.xml"));
+ addRequestBuilder(new DefaultRedmineRequestBuilder(ModelHelper.GET_USER_PROJECTS_REQUEST_NAME, RestMethod.GET, "jredmine", "get_user_projects.xml"));
+ addRequestBuilder(new DefaultRedmineRequestBuilder(ModelHelper.GET_ALL_ISSUE_STATUS_REQUEST_NAME, RestMethod.GET, "jredmine", "get_issue_statuses.xml"));
+ addRequestBuilder(new DefaultRedmineRequestBuilder(ModelHelper.GET_ALL_ISSUE_PRIORITY_REQUEST_NAME, RestMethod.GET, "jredmine", "get_issue_priorities.xml"));
+
+ // data with project scope requests
+
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_PROJECT_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_PROJECT_ISSUES_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_issues.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_PROJECT_OPENED_ISSUES_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_opened_issues.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_PROJECT_CLOSED_ISSUES_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_closed_issues.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_VERSION_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_versions.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_ISSUE_CATEGORY_REQUEST_NAME, RestMethod.GET, "jredmine", "get_issue_categories.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_TRACKER_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_trackers.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_USER_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_users.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.GET_ALL_NEWS_REQUEST_NAME, RestMethod.GET, "jredmine", "get_project_news.xml"));
+
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.ADD_VERSION_REQUEST_NAME, RestMethod.POST, "jredmine", "add_version.xml") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+ Version version = (Version) args[1];
+ String date = getVersionEffectiveDate(version);
+ String status = getVersionStatus(version);
+ return new String[]{
+ "version[name]", version.getName(),
+ "version[description]", version.getDescription(),
+ "version[effective_date]", date,
+ "version[status]", status
+ };
+ }
+ });
+
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.UPDATE_VERSION_REQUEST_NAME, RestMethod.POST, "jredmine", "update_version.xml") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+ Version version = (Version) args[1];
+ String date = getVersionEffectiveDate(version);
+ String status = getVersionStatus(version);
+ return new String[]{
+ "version[name]", version.getName(),
+ "version[description]", version.getDescription(),
+ "version[effective_date]", date,
+ "version[status]", status
+ };
+ }
+ });
+
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.NEXT_VERSION_REQUEST_NAME, RestMethod.POST, "jredmine", "next_version.xml") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+
+
+ Version version = (Version) args[1];
+ String date = getVersionEffectiveDate(version);
+ String status = getVersionStatus(version);
+ String oldVersionName = (String) args[2];
+ return new String[]{
+ "oldVersionName", oldVersionName,
+ "version[name]", version.getName(),
+ "version[description]", version.getDescription(),
+ "version[effective_date]", date,
+ "version[status]", status
+ };
+ }
+ });
+
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ModelHelper.ADD_NEWS_REQUEST_NAME, RestMethod.POST, "jredmine", "add_news.xml") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+ News news = (News) args[1];
+ return new String[]{
+ "news[title]", news.getTitle(),
+ "news[summary]", news.getSummary(),
+ "news[description]", news.getDescription()
+ };
+ }
+ });
+
+ // version scope requests
+
+ addRequestBuilder(new VersionScopeRedmineRequestBuilder(ModelHelper.GET_VERSION_REQUEST_NAME, RestMethod.GET, "jredmine", "get_version.xml"));
+ addRequestBuilder(new VersionScopeRedmineRequestBuilder(ModelHelper.GET_ALL_ISSUES_REQUEST_NAME, RestMethod.GET, "jredmine", "get_version_issues.xml"));
+ addRequestBuilder(new VersionScopeRedmineRequestBuilder(ModelHelper.GET_ALL_ATTACHMENTS_REQUEST_NAME, RestMethod.GET, "jredmine", "get_version_attachments.xml"));
+ addRequestBuilder(new VersionScopeRedmineRequestBuilder(ModelHelper.ADD_ATTACHMENT_REQUEST_NAME, RestMethod.POST, "jredmine", "add_version_attachment.xml") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+ String versionId = (String) args[1];
+ Attachment attachment = (Attachment) args[2];
+ return new String[]{
+ "version_name", versionId,
+ "attachment[description]", attachment.getDescription()
+ };
+ }
+
+ @Override
+ public Map<String, File> getAttachments(Object... args) {
+ Map<String, File> upload = new HashMap<String, File>();
+ Attachment attachment = (Attachment) args[2];
+ upload.put("attachment[file]", attachment.getToUpload());
+ return upload;
+ }
+ });
+
+ // issue scope requests
+
+ addRequestBuilder(new IssueScopeRedmineRequestBuilder(ModelHelper.GET_ALL_ISSUE_TIME_ENTRY_REQUEST_NAME, RestMethod.GET, "jredmine", "get_issue_times.xml"));
+
+ addRequestBuilder(new IssueScopeRedmineRequestBuilder(ModelHelper.ADD_ISSUE_TIME_ENTRY_REQUEST_NAME, RestMethod.POST, "jredmine", "add_issue_time.xml") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+ String issueId = (String) args[1];
+ TimeEntry timeEntry = (TimeEntry) args[2];
+ Date d = timeEntry.getSpentOn();
+ if (d == null) {
+ d = new Date();
+ }
+ String date = DATE_FORMAT.format(d);
+ return new String[]{
+ "issue_id", issueId,
+ //"timeEntry[issue_id]", issueId,
+ "time_entry[activity_id]", timeEntry.getActivityId() + "",
+ "time_entry[spent_on]", date,
+ "time_entry[hours]", timeEntry.getHours() + "",
+ "time_entry[comments]", timeEntry.getComments() == null ? "" : timeEntry.getComments()
+ };
+ }
+ });
+ }
+
+ protected static String getVersionStatus(Version version) {
+ String status = version.getStatus();
+ if (Strings.isNullOrEmpty(status)) {
+
+ // use default open status
+ status = VersionStatusEnum.open.name();
+ }
+ return status;
+ }
+
+ protected static String getVersionEffectiveDate(Version version) {
+ return version.getEffectiveDate() == null ? "" :
+ DATE_FORMAT.format(version.getEffectiveDate());
+ }
+
+
+}
Added: trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_x/RedmineRestClient.java
===================================================================
--- trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_x/RedmineRestClient.java (rev 0)
+++ trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_x/RedmineRestClient.java 2012-07-13 17:16:17 UTC (rev 291)
@@ -0,0 +1,175 @@
+package org.nuiton.jredmine.v1_x;
+/*
+ * #%L
+ * JRedmine :: Client 1.x
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import org.apache.commons.httpclient.HttpMethod;
+import org.apache.commons.httpclient.HttpStatus;
+import org.apache.commons.httpclient.StatusLine;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codehaus.plexus.util.StringUtils;
+import org.nuiton.io.rest.RequestFactory;
+import org.nuiton.io.rest.RestClient;
+import org.nuiton.io.rest.RestRequest;
+import org.nuiton.io.rest.RestSession;
+import org.nuiton.jredmine.model.ModelHelper;
+import org.nuiton.jredmine.model.Version;
+import org.nuiton.jredmine.model.VersionStatusEnum;
+
+import java.io.IOException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
+/**
+ * Implementation of a {@link RestClient} to access a Redmine server via the
+ * {@code redmine_rest} rails plugin.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0.0
+ */
+public class RedmineRestClient extends RestClient {
+
+ private static final Log log = LogFactory.getLog(RedmineRestClient.class);
+
+ /**
+ * To obtain redmine requests.
+ *
+ * @since 1.4
+ */
+ protected RequestFactory requestFactory;
+
+ public final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd");
+
+ public RedmineRestClient() {
+ requestFactory = new RedmineRequestFactoryImpl();
+ }
+
+ @Override
+ public RequestFactory getRequestFactory() {
+ return requestFactory;
+ }
+
+ @Override
+ protected void open(RestSession session) throws IOException {
+
+ ping(session);
+
+ if (!configuration.isAnonymous()) {
+ login(session);
+ }
+ }
+
+ @Override
+ protected void close(RestSession session) throws IOException {
+
+ if (session != null) {
+
+ try {
+ RestRequest request = getRequest(ModelHelper.LOGOUT_REQUEST_NAME);
+ session.setOpen(false);
+ session.doRequest(request);
+ } finally {
+ session.close();
+ }
+ }
+ }
+
+ public int ping(RestSession session) throws IOException {
+
+ try {
+
+ RestRequest request = getRequest(ModelHelper.PING_REQUEST_NAME);
+ HttpMethod gm = session.doRequest(request);
+
+ StatusLine sl = gm.getStatusLine();
+ int statusCode = sl.getStatusCode();
+ if (log.isDebugEnabled()) {
+ log.debug("status code " + statusCode + " for " + gm.getPath());
+ }
+
+ if (statusCode != HttpStatus.SC_OK) {
+ gm.releaseConnection();
+ throw new IOException(
+ "Got error code <" + statusCode + ":" +
+ sl.getReasonPhrase() + "> on " + gm.getPath());
+ }
+
+// String content = gm.getResponseBodyAsString();
+//
+// boolean ok = "ping".equals(content);
+// if (!ok) {
+// throw new IOException(
+// "can not connect to " + configuration.getRestUrl());
+// }
+ return statusCode;
+ } catch (IOException ex) {
+ throw ex;
+ } catch (Exception ex) {
+ throw new IOException(
+ "could not ping " + configuration.getRestUrl() +
+ " for reason " + ex.getMessage(), ex);
+ }
+ }
+
+ public void login(RestSession session) throws IOException {
+
+ RestRequest request = getRequest(ModelHelper.LOGIN_REQUEST_NAME,
+ configuration.getRestUsername(),
+ configuration.getRestPassword());
+
+ HttpMethod gm = session.doRequest(request);
+
+ StatusLine sl = gm.getStatusLine();
+ int statusCode = sl.getStatusCode();
+ if (log.isDebugEnabled()) {
+ log.debug("status code " + statusCode + " for " + gm.getPath());
+ }
+
+ if (statusCode != HttpStatus.SC_OK &&
+ statusCode != HttpStatus.SC_MOVED_TEMPORARILY) {
+ gm.releaseConnection();
+ throw new IOException(
+ "Got error code <" + statusCode + ":" +
+ sl.getReasonPhrase() + "> on " + gm.getPath());
+ }
+
+ // ok session is logged in
+
+ }
+
+ protected String getVersionStatus(Version version) {
+ String status = version.getStatus();
+ if (StringUtils.isEmpty(status)) {
+
+ // use default open status
+ status = VersionStatusEnum.open.name();
+ }
+ return status;
+ }
+
+ protected String getVersionEffectiveDate(Version version) {
+ return version.getEffectiveDate() == null ? "" :
+ DATE_FORMAT.format(version.getEffectiveDate());
+ }
+}
Added: trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_x/RedmineServiceImpl.java
===================================================================
--- trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_x/RedmineServiceImpl.java (rev 0)
+++ trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_x/RedmineServiceImpl.java 2012-07-13 17:16:17 UTC (rev 291)
@@ -0,0 +1,151 @@
+package org.nuiton.jredmine.v1_x;
+/*
+ * #%L
+ * JRedmine :: Client 1.x
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.io.rest.RestClient;
+import org.nuiton.jredmine.RedmineService;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+import org.nuiton.jredmine.RedmineServiceImplementor;
+import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.ModelHelper;
+import org.nuiton.jredmine.model.News;
+import org.nuiton.jredmine.model.Project;
+import org.nuiton.jredmine.model.TimeEntry;
+import org.nuiton.jredmine.model.Version;
+
+/**
+ * Default {@link RedmineService} implementation based on a {@link RestClient}
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.0.0
+ */
+public class RedmineServiceImpl extends RedmineAnonymousServiceImpl implements RedmineService {
+
+ protected static final Log log = LogFactory.getLog(RedmineServiceImpl.class);
+
+ ///////////////////////////////////////////////////////////////////////////
+ /// RedmineServiceImplementor implementation
+ ///////////////////////////////////////////////////////////////////////////
+
+ @Override
+ public RedmineServiceImplementor init(RedmineServiceConfiguration configuration) throws RedmineServiceException {
+ return delegateImplementor.init(configuration);
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ /// RedmineLogguedService implementation
+ ///////////////////////////////////////////////////////////////////////////
+
+ @Override
+ public Project[] getUserProjects() throws RedmineServiceException {
+ checkLoggued();
+ Project[] result = getDatas(ModelHelper.GET_USER_PROJECTS_REQUEST_NAME, Project.class);
+ return result;
+ }
+
+ @Override
+ public Version addVersion(String projectName,
+ Version version) throws RedmineServiceException {
+
+ // send data and obtain created version
+ Version result = sendData(ModelHelper.ADD_VERSION_REQUEST_NAME,
+ Version.class,
+ projectName,
+ version
+ );
+ return result;
+ }
+
+ @Override
+ public Version updateVersion(String projectName,
+ Version version) throws RedmineServiceException {
+
+ // send data and obtain updated version
+ Version result = sendData(ModelHelper.UPDATE_VERSION_REQUEST_NAME,
+ Version.class,
+ projectName,
+ version
+ );
+ return result;
+ }
+
+ @Override
+ public Version nextVersion(String projectName,
+ String oldVersionName,
+ Version newVersion) throws RedmineServiceException {
+
+ // send data and obtain updated or created new version
+ Version result = sendData(ModelHelper.NEXT_VERSION_REQUEST_NAME,
+ Version.class,
+ projectName,
+ newVersion,
+ oldVersionName
+ );
+ return result;
+ }
+
+ @Override
+ public Attachment addAttachment(String projectName,
+ String versionName,
+ Attachment attachement) throws RedmineServiceException {
+
+ // send data and obtain created attachment
+ Attachment result = sendData(ModelHelper.ADD_ATTACHMENT_REQUEST_NAME,
+ Attachment.class,
+ projectName,
+ versionName,
+ attachement
+ );
+ return result;
+ }
+
+ @Override
+ public News addNews(String projectName,
+ News news) throws RedmineServiceException {
+ // send data and obtain created news
+ News result = sendData(ModelHelper.ADD_NEWS_REQUEST_NAME,
+ News.class,
+ projectName,
+ news
+ );
+ return result;
+ }
+
+ @Override
+ public TimeEntry addIssueTimeEntry(String projectName,
+ String issueId,
+ TimeEntry entry) throws RedmineServiceException {
+ // send data and obtain updated version
+ TimeEntry result = sendData(ModelHelper.ADD_ISSUE_TIME_ENTRY_REQUEST_NAME,
+ TimeEntry.class,
+ projectName,
+ issueId,
+ entry
+ );
+ return result;
+ }
+}
Added: trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_x/RedmineServiceImplementorImpl.java
===================================================================
--- trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_x/RedmineServiceImplementorImpl.java (rev 0)
+++ trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_x/RedmineServiceImplementorImpl.java 2012-07-13 17:16:17 UTC (rev 291)
@@ -0,0 +1,317 @@
+package org.nuiton.jredmine.v1_x;
+/*
+ * #%L
+ * JRedmine :: Client 1.x
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.io.rest.RestClient;
+import org.nuiton.io.rest.RestException;
+import org.nuiton.io.rest.RestRequest;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+import org.nuiton.jredmine.RedmineServiceImplementor;
+import org.nuiton.jredmine.RedmineServiceLoginException;
+import org.nuiton.jredmine.model.io.xpp3.DefaultRedmineXpp3Helper;
+import org.nuiton.jredmine.model.io.xpp3.RedmineXpp3Helper;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * Default Redmine technical service implementation.
+ * <p/>
+ * Created: 2 janv. 2010
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @see RedmineServiceImplementor
+ * @since 1.0.3
+ */
+public class RedmineServiceImplementorImpl implements RedmineServiceImplementor {
+
+ /** Logger */
+ private static final Log log =
+ LogFactory.getLog(RedmineServiceImplementorImpl.class);
+
+ /** Client Rest. */
+ protected final RedmineRestClient session;
+
+ /** xpp3 xpp3Helper to transform xml stream to pojo. */
+ protected final RedmineXpp3Helper xpp3Helper;
+
+ /** internal state to known if service was init */
+ protected boolean init;
+
+ /** internal state to known if service was opened */
+ protected boolean open;
+
+ public RedmineServiceImplementorImpl() {
+ if (log.isDebugEnabled()) {
+ log.debug("new " + this);
+ }
+ session = new RedmineRestClient();
+ xpp3Helper = new DefaultRedmineXpp3Helper();
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ /// RedmineServiceImplementor implementation
+ ///////////////////////////////////////////////////////////////////////////
+
+
+ public RedmineRestClient getSession() {
+ return session;
+ }
+
+ @Override
+ public boolean isInit() {
+ return init;
+ }
+
+ @Override
+ public boolean isLoggued() {
+ return session.isOpen();
+ }
+
+ @Override
+ public RedmineServiceImplementor init(RedmineServiceConfiguration configuration) throws RedmineServiceException {
+ session.setConfiguration(configuration);
+ session.requestFactory.addDefaultRequests();
+ RedmineServiceImplementor result = init(session);
+ return result;
+ }
+
+ public RedmineServiceImplementor init(RedmineRestClient session) throws RedmineServiceException {
+ if (open) {
+ throw new IllegalStateException(
+ "the client " + this + " was already opened!");
+ }
+ try {
+
+ if (!session.isOpen()) {
+ session.open();
+ }
+
+ init = true;
+ } catch (Exception e) {
+ throw new RedmineServiceException(
+ "could not init service for reason " + e.getMessage(), e);
+ }
+ return this;
+ }
+
+ @Override
+ public int ping() {
+
+ try {
+ return session.ping(session.getSession());
+ } catch (IOException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Could not ping ", e);
+ }
+ return -1;
+ }
+ }
+
+ @Override
+ public void login() {
+ }
+
+ @Override
+ public void logout() {
+ }
+
+ @Override
+ public void destroy() throws RedmineServiceException {
+ checkInit();
+ try {
+ if (session.isOpen()) {
+ try {
+ session.close();
+ } catch (RestException ex) {
+ throw new RedmineServiceException(
+ "has problem while closing Rest client " +
+ ex.getMessage(), ex);
+ }
+ }
+ } finally {
+ // can't remove the reference since plexus injects it
+// if (session != null) {
+// session = null;
+// }
+ init = false;
+ }
+ }
+
+ @Override
+ public <T> T getData(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ checkInit();
+ InputStream stream = askDataStream(requestName, args);
+ T result = getDataFromStream(type, stream);
+ return result;
+ }
+
+ @Override
+ public <T> T[] getDatas(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ checkInit();
+ InputStream stream = askDataStream(requestName, args);
+ T[] result = getDatasFromStream(type, stream);
+ return result;
+ }
+
+ @Override
+ public <T> T sendData(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ checkLoggued();
+ InputStream stream = sendDataStream(requestName, args);
+ T result = getDataFromStream(type, stream);
+ return result;
+ }
+
+ @Override
+ public <T> T[] sendDatas(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ checkLoggued();
+ InputStream stream = sendDataStream(requestName, args);
+ T[] result = getDatasFromStream(type, stream);
+ return result;
+ }
+
+ @Override
+ public void checkLoggued() throws IllegalStateException, RedmineServiceLoginException, NullPointerException {
+ checkInit();
+ checkSessionNotNull(session);
+ checkSessionConfigurationNotNull(session);
+ if (session.getConfiguration().isAnonymous()) {
+ throw new RedmineServiceLoginException(
+ "can not access this service in anonymous mode");
+ }
+ }
+
+ protected InputStream askDataStream(String requestName,
+ Object... args) throws RedmineServiceException {
+
+ RestRequest r = getRequest(requestName, args);
+
+ // obtain data from rest client
+ try {
+
+ InputStream stream = session.askData(r);
+ return stream;
+ } catch (Exception e) {
+ throw new RedmineServiceException(
+ "could not obtain data stream for request " + requestName +
+ " for reason " + e.getMessage(), e);
+ }
+ }
+
+ protected InputStream sendDataStream(String requestName,
+ Object... args) throws RedmineServiceException {
+
+ RestRequest r = getRequest(requestName, args);
+
+ // obtain data from rest client
+ try {
+
+ InputStream stream = session.sendData(r);
+ return stream;
+ } catch (Exception e) {
+ throw new RedmineServiceException(
+ "could not send data stream for request " + requestName +
+ " for reason " + e.getMessage(), e);
+ }
+ }
+
+ protected RestRequest getRequest(String requestName,
+ Object... args) throws RedmineServiceException {
+ RestRequest r;
+ try {
+ r = session.getRequest(requestName, args);
+ } catch (Exception e) {
+ throw new RedmineServiceException(
+ "could not find the request named " + requestName +
+ " for reason " + e.getMessage(), e);
+ }
+ if (r == null) {
+ throw new RedmineServiceException(
+ "could not find the request named " + requestName);
+ }
+ return r;
+ }
+
+ protected <T> T getDataFromStream(Class<T> type,
+ InputStream stream) throws RedmineServiceException {
+ if (stream == null) {
+ return null;
+ }
+
+ try {
+ T result = xpp3Helper.readObject(type, stream, true);
+ return result;
+ } catch (Exception ex) {
+ throw new RedmineServiceException(
+ "could not obtain datas of type " + type + " for reason " +
+ ex.getMessage(), ex);
+ }
+ }
+
+ protected <T> T[] getDatasFromStream(Class<T> type,
+ InputStream stream) throws RedmineServiceException {
+ if (stream == null) {
+ return null;
+ }
+ try {
+ T[] result = xpp3Helper.readObjects(type, stream, true);
+ return result;
+ } catch (Exception ex) {
+ throw new RedmineServiceException(
+ "could not obtain datas of type " + type + " for reason " +
+ ex.getMessage(), ex);
+ }
+ }
+
+ protected void checkInit() throws IllegalStateException {
+ if (!init) {
+ throw new IllegalStateException(
+ "the client " + this + " is not init!");
+ }
+ }
+
+ protected void checkSessionNotNull(RestClient session) {
+ if (session == null) {
+ throw new NullPointerException("session can not be null");
+ }
+ }
+
+ protected void checkSessionConfigurationNotNull(RestClient session) {
+ if (session.getConfiguration() == null) {
+ throw new NullPointerException(
+ "session configuration can not be null");
+ }
+ }
+}
Added: trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_x/RedmineServiceProviderImpl.java
===================================================================
--- trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_x/RedmineServiceProviderImpl.java (rev 0)
+++ trunk/jredmine-client-1.x/src/main/java/org/nuiton/jredmine/v1_x/RedmineServiceProviderImpl.java 2012-07-13 17:16:17 UTC (rev 291)
@@ -0,0 +1,59 @@
+package org.nuiton.jredmine.v1_x;
+/*
+ * #%L
+ * JRedmine :: Client 1.x
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import org.nuiton.jredmine.RedmineAnonymousService;
+import org.nuiton.jredmine.RedmineService;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceProvider;
+
+/**
+ * Implmentation of {@link RedmineServiceProvider} for this module.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @plexus.component role="org.nuiton.jredmine.RedmineServiceProvider" role-hint="1.3.x"
+ * @since 1.4
+ */
+public class RedmineServiceProviderImpl implements RedmineServiceProvider {
+
+ @Override
+ public String getRedmineVersion() {
+ return "1.3.x";
+ }
+
+ @Override
+ public boolean isRequireJRedminePlugin() {
+ return true;
+ }
+
+ @Override
+ public RedmineService newRedmineService(RedmineServiceConfiguration configuration) {
+ return new RedmineServiceImpl();
+ }
+
+ @Override
+ public RedmineAnonymousService newRedmineAnonymousService(RedmineServiceConfiguration configuration) {
+ return new RedmineAnonymousServiceImpl();
+ }
+}
Added: trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_x/RedmineAnonymousServiceTest.java
===================================================================
--- trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_x/RedmineAnonymousServiceTest.java (rev 0)
+++ trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_x/RedmineAnonymousServiceTest.java 2012-07-13 17:16:17 UTC (rev 291)
@@ -0,0 +1,186 @@
+package org.nuiton.jredmine.v1_x;
+/*
+ * #%L
+ * JRedmine :: Client 1.x
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.Test;
+import org.nuiton.jredmine.RedmineAnonymousService;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.Issue;
+import org.nuiton.jredmine.model.IssueCategory;
+import org.nuiton.jredmine.model.IssuePriority;
+import org.nuiton.jredmine.model.IssueStatus;
+import org.nuiton.jredmine.model.News;
+import org.nuiton.jredmine.model.Project;
+import org.nuiton.jredmine.model.TimeEntry;
+import org.nuiton.jredmine.model.Tracker;
+import org.nuiton.jredmine.model.User;
+import org.nuiton.jredmine.model.Version;
+
+import java.io.IOException;
+
+/**
+ * Tests the {@link RedmineAnonymousServiceImpl}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.5
+ */
+public class RedmineAnonymousServiceTest {
+
+ protected static final RedmineFixtures fixtures = new RedmineFixtures();
+
+ @Rule
+ public final RedmineServer<RedmineAnonymousService> server = createNewServer(fixtures);
+
+ protected RedmineAnonymousService getService() {
+ return server.getService();
+ }
+
+ protected RedmineServer<RedmineAnonymousService> createNewServer(RedmineFixtures fixtures) {
+ return new RedmineServer<RedmineAnonymousService>(fixtures) {
+
+ @Override
+ protected RedmineAnonymousService createService(
+ RedmineFixtures fixture,
+ RedmineServiceConfiguration configuration) throws IOException, RedmineServiceException {
+
+ return fixture.newRedmineAnonymousService(configuration);
+ }
+
+ @Override
+ protected RedmineServiceConfiguration createConfiguration(RedmineFixtures fixture) throws IOException {
+ RedmineServiceConfiguration conf = fixture.newAnonymousConfiguration();
+ return conf;
+ }
+ };
+ }
+
+ @BeforeClass
+ public static void beforeClass() {
+ RedmineServer<RedmineAnonymousService> newServer =
+ new RedmineAnonymousServiceTest().createNewServer(fixtures);
+ newServer.checkService();
+ }
+
+ @Test
+ public void getProjects() throws Exception {
+ Project[] projects = getService().getProjects();
+ Assert.assertNotNull(projects);
+ }
+
+ @Test
+ public void getIssuePriorities() throws Exception {
+ IssuePriority[] issuePriorities = getService().getIssuePriorities();
+ Assert.assertNotNull(issuePriorities);
+ }
+
+ @Test
+ public void getIssueStatuses() throws Exception {
+ IssueStatus[] issueStatuses = getService().getIssueStatuses();
+ Assert.assertNotNull(issueStatuses);
+ }
+
+ @Test
+ public void getProject() throws Exception {
+ Project project = getService().getProject(fixtures.projectName());
+ Assert.assertNotNull(project);
+ }
+
+ @Test
+ public void getIssueCategories() throws Exception {
+ IssueCategory[] issueCategories = getService().getIssueCategories(fixtures.projectName());
+ Assert.assertNotNull(issueCategories);
+ }
+
+ @Test
+ public void getTrackers() throws Exception {
+ Tracker[] trackers = getService().getTrackers(fixtures.projectName());
+ Assert.assertNotNull(trackers);
+ }
+
+ @Test
+ public void getNews() throws Exception {
+ News[] news = getService().getNews(fixtures.projectName());
+ Assert.assertNotNull(news);
+ }
+
+ @Test
+ public void getProjectMembers() throws Exception {
+ User[] users = getService().getProjectMembers(fixtures.projectName());
+ Assert.assertNotNull(users);
+ }
+
+ @Test
+ public void getProjectIssues() throws Exception {
+ Issue[] issues = getService().getIssues(fixtures.projectName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getVersions() throws Exception {
+ Version[] versions = getService().getVersions(fixtures.projectName());
+ Assert.assertNotNull(versions);
+ }
+
+ @Test
+ public void getVersion() throws Exception {
+ Version version = getService().getVersion(fixtures.projectName(), fixtures.versionName());
+ Assert.assertNotNull(version);
+ }
+
+ @Test
+ public void getVersionIssues() throws Exception {
+ Issue[] issues = getService().getIssues(fixtures.projectName(), fixtures.versionName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getOpenedIssues() throws Exception {
+ Issue[] issues = getService().getOpenedIssues(fixtures.projectName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getClosedIssues() throws Exception {
+ Issue[] issues = getService().getClosedIssues(fixtures.projectName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getIssueTimeEntries() throws Exception {
+ TimeEntry[] timeEntries = getService().getIssueTimeEntries(fixtures.projectName(), fixtures.issueId());
+ Assert.assertNotNull(timeEntries);
+ }
+
+ @Test
+ public void getAttachments() throws Exception {
+ Attachment[] attachments = getService().getAttachments(fixtures.projectName(), fixtures.versionName());
+ Assert.assertNotNull(attachments);
+ }
+
+}
Added: trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_x/RedmineFixtures.java
===================================================================
--- trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_x/RedmineFixtures.java (rev 0)
+++ trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_x/RedmineFixtures.java 2012-07-13 17:16:17 UTC (rev 291)
@@ -0,0 +1,821 @@
+package org.nuiton.jredmine.v1_x;
+/*
+ * #%L
+ * JRedmine :: Client 1.x
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import com.google.common.base.Charsets;
+import com.google.common.collect.ArrayListMultimap;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.jredmine.RedmineAnonymousService;
+import org.nuiton.jredmine.RedmineService;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.Issue;
+import org.nuiton.jredmine.model.IssueCategory;
+import org.nuiton.jredmine.model.IssuePriority;
+import org.nuiton.jredmine.model.IssueStatus;
+import org.nuiton.jredmine.model.News;
+import org.nuiton.jredmine.model.Project;
+import org.nuiton.jredmine.model.TimeEntry;
+import org.nuiton.jredmine.model.Tracker;
+import org.nuiton.jredmine.model.User;
+import org.nuiton.jredmine.model.Version;
+import org.nuiton.jredmine.model.io.xpp3.RedmineDataConverter;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Date;
+import java.util.List;
+import java.util.Properties;
+
+/**
+ * fixtures of redmine model.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public class RedmineFixtures {
+
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(RedmineFixtures.class);
+
+ public static final String FILE_TO_UPLOAD_CONTENT = "Fichier à uploader";
+
+ public static final String PROJECT_NAME = "jredmine";
+
+ public static final String VERSION_NAME = "1.3";
+
+ public static final String ISSUE_ID = "2030";
+
+ private Project JRedmineProject;
+
+ private ArrayListMultimap<Class<?>, Object> model;
+
+ private RedmineServiceConfiguration anonymousConfiguration;
+
+ private RedmineServiceConfiguration logguedConfiguration;
+
+ public String projectName() {
+ return PROJECT_NAME;
+ }
+
+ public String versionName() {
+ return VERSION_NAME;
+ }
+
+ public String issueId() {
+ return ISSUE_ID;
+ }
+
+ public RedmineServiceConfiguration newAnonymousConfiguration()
+ throws IOException {
+ RedmineServiceConfiguration conf = new FakeRedmineServiceConfiguration();
+ copyConfiguration(getAnonymousConfiguration(), conf);
+ return conf;
+ }
+
+ public RedmineServiceConfiguration newLogguedConfiguration()
+ throws IOException {
+ RedmineServiceConfiguration conf = new FakeRedmineServiceConfiguration();
+ copyConfiguration(getLogguedConfiguration(), conf);
+ return conf;
+ }
+
+ public RedmineAnonymousService newRedmineAnonymousService(RedmineServiceConfiguration configuration)
+ throws IOException, RedmineServiceException {
+ RedmineAnonymousServiceImpl service = new RedmineAnonymousServiceImpl();
+ service.init(configuration);
+ return service;
+ }
+
+ public RedmineService newRedmineService(RedmineServiceConfiguration configuration)
+ throws IOException, RedmineServiceException {
+ RedmineServiceImpl service = new RedmineServiceImpl();
+ service.init(configuration);
+ return service;
+ }
+
+ protected RedmineServiceConfiguration getAnonymousConfiguration()
+ throws IOException {
+ if (anonymousConfiguration == null) {
+
+ Properties props = new Properties();
+
+ InputStream inputStream = null;
+ try {
+ String jredmineConfiguration = System.getenv("jredmine-test.properties");
+ if (jredmineConfiguration == null) {
+ if (log.isWarnEnabled()) {
+ log.warn("Could not find environement variable " +
+ "'jredmine-test.properties' will use " +
+ "default test configuration");
+ }
+
+ inputStream = getClass().getResourceAsStream("/test-config.properties");
+ } else {
+
+ File file = new File(jredmineConfiguration);
+
+ if (!file.exists()) {
+ throw new IllegalStateException("Could not find " + jredmineConfiguration +
+ " file");
+ }
+ inputStream = FileUtils.openInputStream(file);
+ }
+ props.load(inputStream);
+ } finally {
+ if (inputStream != null) {
+ inputStream.close();
+ }
+ }
+ anonymousConfiguration = new FakeRedmineServiceConfiguration();
+
+ String url = props.getProperty("test.redmineUrl");
+ anonymousConfiguration.setRestUrl(new URL(url));
+
+ String e = props.getProperty("test.encoding");
+ anonymousConfiguration.setEncoding(e);
+
+ String verbose = props.getProperty("test.verbose");
+ if (StringUtils.isNotEmpty(verbose)) {
+ anonymousConfiguration.setVerbose(Boolean.valueOf(verbose));
+ }
+ anonymousConfiguration.setEncoding(Charsets.UTF_8.name());
+ anonymousConfiguration.setAnonymous(true);
+
+ verbose = System.getenv("jredmine-test.verbose");
+ if (StringUtils.isNotEmpty(verbose)) {
+ anonymousConfiguration.setVerbose(Boolean.valueOf(verbose));
+ }
+
+ }
+ return anonymousConfiguration;
+ }
+
+ protected RedmineServiceConfiguration getLogguedConfiguration()
+ throws IOException {
+ if (logguedConfiguration == null) {
+
+ // use anonymous configuration
+
+ RedmineServiceConfiguration anoConf = getAnonymousConfiguration();
+ if (anoConf != null) {
+ logguedConfiguration = new FakeRedmineServiceConfiguration();
+ copyConfiguration(anoConf, logguedConfiguration);
+
+ // get system login password from env
+ String login = System.getenv("jredmine-test.login");
+ String password = System.getenv("jredmine-test.password");
+ if (!"null".equals(login)) {
+ logguedConfiguration.setRestUsername(login);
+ }
+ if (!"null".equals(password)) {
+ logguedConfiguration.setRestPassword(password);
+ }
+ logguedConfiguration.setAnonymous(false);
+ }
+ }
+ return logguedConfiguration;
+ }
+
+ protected void copyConfiguration(RedmineServiceConfiguration src,
+ RedmineServiceConfiguration dst) {
+ dst.setRestUrl(src.getRestUrl());
+ dst.setRestUsername(src.getRestUsername());
+ dst.setRestPassword(src.getRestPassword());
+ dst.setEncoding(src.getEncoding());
+ dst.setVerbose(src.isVerbose());
+ dst.setAnonymous(src.isAnonymous());
+ }
+
+ public List<Attachment> getAttachments() {
+ return get(Attachment.class);
+ }
+
+ public List<Issue> getIssues() {
+ return get(Issue.class);
+ }
+
+ public List<Project> getProjects() {
+ return get(Project.class);
+ }
+
+ public List<Tracker> getTrackers() {
+ return get(Tracker.class);
+ }
+
+ public List<User> getUsers() {
+ return get(User.class);
+ }
+
+ public List<Version> getVersions() {
+ return get(Version.class);
+ }
+
+ public <T> List<T> get(Class<T> modelType) {
+ if (model == null) {
+ try {
+ loadModel();
+ } catch (Exception ex) {
+ throw new RuntimeException(ex);
+ }
+ }
+ return (List<T>) model.get(modelType);
+ }
+
+ public <T> T get(Class<T> type, int pos) {
+ List<T> ts = get(type);
+ return ts.get(pos);
+ }
+
+ public Project getJRedmineProject() {
+ if (JRedmineProject == null) {
+ JRedmineProject = new Project();
+ JRedmineProject.setName("jredmine");
+ JRedmineProject.setIdentifier("jredmine");
+ JRedmineProject.setIsPublic(true);
+ JRedmineProject.setHomepage("http://maven-site.nuiton.org/jredmine");
+ JRedmineProject.setDescription(
+ "Permet de communiquer en java avec un serveur " + "redmine qui a installé le plugin rails jredmine");
+ JRedmineProject.setId(36);
+ JRedmineProject.setStatus(1);
+ }
+ return JRedmineProject;
+ }
+
+
+ public static final String VERSION_TO_CREATE_NAME = "do_not_use_me";
+
+ public Version getVersion() {
+ Version version = new Version();
+ version.setName(VERSION_TO_CREATE_NAME);
+ version.setDescription("Une version créée par les tests de jredmine," +
+ " ne pas utiliser,et modifiée");
+ return version;
+ }
+
+ private void loadModel()
+ throws Exception {
+ model = ArrayListMultimap.create();
+
+ Attachment tempA;
+ tempA = new Attachment();
+ tempA.setAuthorId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempA.setContainerId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempA.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempA.setFilesize((Integer) RedmineDataConverter.Integer.convert("411"));
+ tempA.setDownloads((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempA.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T12:56:41+02:00"));
+ tempA.setContainerType((String) RedmineDataConverter.Text.convert("Version"));
+ tempA.setContentType((String) RedmineDataConverter.Text.convert("application/json"));
+ tempA.setDigest((String) RedmineDataConverter.Text.convert("6ea84342c7475c05fb077b4aca832f9a"));
+ tempA.setDiskFilename((String) RedmineDataConverter.Text.convert("090905125641_get_issue.json"));
+ tempA.setFilename((String) RedmineDataConverter.Text.convert("get_issue.json"));
+ model.put(Attachment.class, tempA);
+ tempA = new Attachment();
+ tempA.setAuthorId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempA.setContainerId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempA.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempA.setFilesize((Integer) RedmineDataConverter.Integer.convert("411"));
+ tempA.setDownloads((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempA.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T12:56:41+02:00"));
+ tempA.setContainerType((String) RedmineDataConverter.Text.convert("Version"));
+ tempA.setContentType((String) RedmineDataConverter.Text.convert("application/json"));
+ tempA.setDigest((String) RedmineDataConverter.Text.convert("6ea84342c7475c05fb077b4aca832f9a"));
+ tempA.setDiskFilename((String) RedmineDataConverter.Text.convert("090905125641_get_issue.json2"));
+ tempA.setFilename((String) RedmineDataConverter.Text.convert("get_issue.json2"));
+ model.put(Attachment.class, tempA);
+
+ Issue tempI;
+ tempI = new Issue();
+ tempI.setAuthorId((Integer) RedmineDataConverter.Integer.convert("5"));
+ tempI.setCategoryId((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempI.setDoneRatio((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempI.setLockVersion((Integer) RedmineDataConverter.Integer.convert("7"));
+ tempI.setPriorityId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempI.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setStatusId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempI.setTrackerId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setFixedVersionId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempI.setParentId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempI.setRootId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempI.setLft((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setRgt((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempI.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T20:11:52+02:00"));
+ tempI.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T00:37:40+02:00"));
+ tempI.setStartDate((Date) RedmineDataConverter.Date.convert("2009-09-04"));
+ tempI.setDescription((String) RedmineDataConverter.Text.convert("avec une description !"));
+ tempI.setSubject((String) RedmineDataConverter.Text.convert("yes!"));
+ model.put(Issue.class, tempI);
+ tempI = new Issue();
+ tempI.setAuthorId((Integer) RedmineDataConverter.Integer.convert("5"));
+ tempI.setCategoryId((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempI.setDoneRatio((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempI.setLockVersion((Integer) RedmineDataConverter.Integer.convert("7"));
+ tempI.setPriorityId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempI.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setStatusId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempI.setTrackerId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setFixedVersionId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempI.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T20:11:52+02:00"));
+ tempI.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T00:37:40+02:00"));
+ tempI.setStartDate((Date) RedmineDataConverter.Date.convert("2009-09-04"));
+ tempI.setDescription((String) RedmineDataConverter.Text.convert("avec une description !2"));
+ tempI.setSubject((String) RedmineDataConverter.Text.convert("yes!2"));
+ model.put(Issue.class, tempI);
+
+ Project tempP;
+ tempP = new Project();
+ tempP.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:11:54+02:00"));
+ tempP.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:11:54+02:00"));
+ tempP.setIdentifier((String) RedmineDataConverter.Text.convert("one"));
+ tempP.setName((String) RedmineDataConverter.Text.convert("one"));
+ tempP.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempP.setLft((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempP.setRgt((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempP.setProjectsCount((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempP.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempP.setIsPublic((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ model.put(Project.class, tempP);
+ tempP = new Project();
+ tempP.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T16:22:14+02:00"));
+ tempP.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T16:22:29+02:00"));
+ tempP.setIdentifier((String) RedmineDataConverter.Text.convert("two"));
+ tempP.setName((String) RedmineDataConverter.Text.convert("two"));
+ tempP.setId((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempP.setProjectsCount((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempP.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempP.setIsPublic((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ model.put(Project.class, tempP);
+
+ Tracker tempT;
+ tempT = new Tracker();
+ tempT.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setTrackerId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setPosition((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setIsInChlog((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempT.setIsInRoadmap((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempT.setName((String) RedmineDataConverter.Text.convert("Anomalie"));
+ model.put(Tracker.class, tempT);
+ tempT = new Tracker();
+ tempT.setId((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempT.setIsInChlog((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempT.setIsInRoadmap((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempT.setName((String) RedmineDataConverter.Text.convert("Evolution"));
+ tempT.setPosition((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempT.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setTrackerId((Integer) RedmineDataConverter.Integer.convert("2"));
+ model.put(Tracker.class, tempT);
+ tempT = new Tracker();
+ tempT.setId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempT.setIsInChlog((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempT.setIsInRoadmap((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempT.setName((String) RedmineDataConverter.Text.convert("Assistance"));
+ tempT.setPosition((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempT.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setTrackerId((Integer) RedmineDataConverter.Integer.convert("3"));
+ model.put(Tracker.class, tempT);
+
+ User tempU;
+ tempU = new User();
+ tempU.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T17:24:46+02:00"));
+ tempU.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T01:23:59+02:00"));
+ tempU.setLastLoginOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T01:23:59+02:00"));
+ tempU.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempU.setMemberId((Integer) RedmineDataConverter.Integer.convert("5"));
+ tempU.setRoleId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempU.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempU.setAdmin((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempU.setMailNotification((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempU.setFirstname((String) RedmineDataConverter.Text.convert("Redmine"));
+ tempU.setHashedPassword(
+ (String) RedmineDataConverter.Text.convert("70c881d4a26984ddce795f6f71817c9cf4480e79"));
+ tempU.setLanguage((String) RedmineDataConverter.Text.convert("fr"));
+ tempU.setLastname((String) RedmineDataConverter.Text.convert("Admin"));
+ tempU.setLogin((String) RedmineDataConverter.Text.convert("admin"));
+ tempU.setMail((String) RedmineDataConverter.Text.convert("dummy(a)codelutin.com"));
+ tempU.setIdentityUrl((String) RedmineDataConverter.Text.convert("yo"));
+ model.put(User.class, tempU);
+ tempU = new User();
+ tempU.setAdmin((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempU.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T19:49:02+02:00"));
+ tempU.setFirstname((String) RedmineDataConverter.Text.convert("tony"));
+ tempU.setHashedPassword(
+ (String) RedmineDataConverter.Text.convert("8aed1322e5450badb078e1fb60a817a1df25a2ca"));
+ tempU.setId((Integer) RedmineDataConverter.Integer.convert("5"));
+ tempU.setLanguage((String) RedmineDataConverter.Text.convert("fr"));
+ tempU.setLastLoginOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T19:49:38+02:00"));
+ tempU.setLastname((String) RedmineDataConverter.Text.convert("chemit2"));
+ tempU.setLogin((String) RedmineDataConverter.Text.convert("tchemit2"));
+ tempU.setMail((String) RedmineDataConverter.Text.convert("chemit(a)codelutin.com"));
+ tempU.setMailNotification((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempU.setMemberId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempU.setRoleId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempU.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempU.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T19:49:38+02:00"));
+ model.put(User.class, tempU);
+ tempU = new User();
+ tempU.setAdmin((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempU.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T16:24:11+02:00"));
+ tempU.setFirstname((String) RedmineDataConverter.Text.convert("dev"));
+ tempU.setHashedPassword(
+ (String) RedmineDataConverter.Text.convert("70c881d4a26984ddce795f6f71817c9cf4480e79"));
+ tempU.setId((Integer) RedmineDataConverter.Integer.convert("7"));
+ tempU.setLanguage((String) RedmineDataConverter.Text.convert("fr"));
+ tempU.setLastLoginOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T16:34:39+02:00"));
+ tempU.setLastname((String) RedmineDataConverter.Text.convert("dev"));
+ tempU.setLogin((String) RedmineDataConverter.Text.convert("dev"));
+ tempU.setMail((String) RedmineDataConverter.Text.convert("dev3(a)ynot-home.info"));
+ tempU.setMailNotification((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempU.setMemberId((Integer) RedmineDataConverter.Integer.convert("9"));
+ tempU.setRoleId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempU.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempU.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T16:34:39+02:00"));
+ model.put(User.class, tempU);
+
+ Version tempV;
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:47:39+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("yo"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("9"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("yor"));
+ tempV.setSharing((String) RedmineDataConverter.Text.convert("none"));
+ tempV.setStatus((String) RedmineDataConverter.Text.convert("open"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:50:49+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:09+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("13"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("rrrrrrrrrouuuuuua"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:09+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:07:58+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("15"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("aaaauuuuuua"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:07:58+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T04:12:25+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoyeppppppppppppppppp"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("16"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("aaaau"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T04:13:20+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:40+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("14"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("aaaaaaaaaarrrrrrrrrouuuuuua"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:40+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T00:39:15+02:00"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("5"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("2"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T00:39:15+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:13:05+02:00"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("1.0.0"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:13:05+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:12+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("yoye"));
+ tempV.setEffectiveDate((Date) RedmineDataConverter.Date.convert("2009-09-06"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("11"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("yaouuuuuua"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:12+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:50:59+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("yoye"));
+ tempV.setEffectiveDate((Date) RedmineDataConverter.Date.convert("2009-09-06"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("10"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("ya"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:54:16+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:37+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
+ tempV.setEffectiveDate((Date) RedmineDataConverter.Date.convert("2009-09-06"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("12"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("ouuuuuua"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:42+02:00"));
+ model.put(Version.class, tempV);
+
+ IssueStatus tempIS;
+ tempIS = new IssueStatus();
+ tempIS.setId(1);
+ tempIS.setName("Nouveau");
+ tempIS.setPosition(1);
+ tempIS.setDefaultDoneRatio(10);
+ tempIS.setIsClosed(false);
+ tempIS.setIsDefault(true);
+ model.put(IssueStatus.class, tempIS);
+ tempIS = new IssueStatus();
+ tempIS.setId(2);
+ tempIS.setName("Assigné");
+ tempIS.setPosition(2);
+ tempIS.setIsClosed(false);
+ tempIS.setIsDefault(false);
+ model.put(IssueStatus.class, tempIS);
+ tempIS = new IssueStatus();
+ tempIS.setId(3);
+ tempIS.setName("Résolu");
+ tempIS.setPosition(3);
+ tempIS.setIsClosed(false);
+ tempIS.setIsDefault(false);
+ model.put(IssueStatus.class, tempIS);
+ tempIS = new IssueStatus();
+ tempIS.setId(4);
+ tempIS.setName("Commentaire");
+ tempIS.setPosition(4);
+ tempIS.setIsClosed(false);
+ tempIS.setIsDefault(false);
+ model.put(IssueStatus.class, tempIS);
+ tempIS = new IssueStatus();
+ tempIS.setId(5);
+ tempIS.setName("Fermé");
+ tempIS.setPosition(5);
+ tempIS.setIsClosed(true);
+ tempIS.setIsDefault(false);
+ model.put(IssueStatus.class, tempIS);
+ tempIS = new IssueStatus();
+ tempIS.setId(6);
+ tempIS.setPosition(6);
+ tempIS.setName("Rejeté");
+ tempIS.setIsClosed(true);
+ tempIS.setIsDefault(false);
+ model.put(IssueStatus.class, tempIS);
+
+ IssuePriority tempIP;
+ tempIP = new IssuePriority();
+ tempIP.setId(3);
+ tempIP.setParentId(1);
+ tempIP.setProjectId(2);
+ tempIP.setName("Bas");
+ tempIP.setPosition(1);
+ tempIP.setOpt("IPRI");
+ tempIP.setIsDefault(false);
+ tempIP.setActive(true);
+ model.put(IssuePriority.class, tempIP);
+ tempIP = new IssuePriority();
+ tempIP.setId(4);
+ tempIP.setName("Normal");
+ tempIP.setPosition(2);
+ tempIP.setOpt("IPRI");
+ tempIP.setIsDefault(true);
+ model.put(IssuePriority.class, tempIP);
+ tempIP = new IssuePriority();
+ tempIP.setId(5);
+ tempIP.setName("Haut");
+ tempIP.setPosition(3);
+ tempIP.setOpt("IPRI");
+ tempIP.setIsDefault(false);
+ model.put(IssuePriority.class, tempIP);
+ tempIP = new IssuePriority();
+ tempIP.setId(6);
+ tempIP.setName("Urgent");
+ tempIP.setPosition(4);
+ tempIP.setOpt("IPRI");
+ tempIP.setIsDefault(false);
+ model.put(IssuePriority.class, tempIP);
+ tempIP = new IssuePriority();
+ tempIP.setId(7);
+ tempIP.setName("Immédiat");
+ tempIP.setPosition(5);
+ tempIP.setOpt("IPRI");
+ tempIP.setIsDefault(false);
+ model.put(IssuePriority.class, tempIP);
+
+ IssueCategory tempIC;
+ tempIC = new IssueCategory();
+ tempIC.setId(1);
+ tempIC.setName("categorie one");
+ tempIC.setProjectId(1);
+ model.put(IssueCategory.class, tempIC);
+ tempIC = new IssueCategory();
+ tempIC.setId(2);
+ tempIC.setName("categorie two");
+ tempIC.setProjectId(1);
+ model.put(IssueCategory.class, tempIC);
+
+ News tempN;
+ tempN = new News();
+ tempN.setId(85);
+ tempN.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-17T21:50:26+02:00"));
+ tempN.setProjectId(1);
+ tempN.setAuthorId(4);
+ tempN.setCommentsCount(0);
+ tempN.setDescription("description");
+ tempN.setSummary("summary");
+ tempN.setTitle("title");
+ model.put(News.class, tempN);
+ tempN = new News();
+ tempN.setId(86);
+ tempN.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-17T21:55:26+02:00"));
+ tempN.setProjectId(1);
+ tempN.setAuthorId(4);
+ tempN.setCommentsCount(0);
+ tempN.setDescription("description2");
+ tempN.setSummary("summary2");
+ tempN.setTitle("title2");
+ model.put(News.class, tempN);
+
+ TimeEntry tempE;
+
+ tempE = new TimeEntry();
+ tempE.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:02:02+01:00"));
+ tempE.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:02:02+01:00"));
+ tempE.setSpentOn((Date) RedmineDataConverter.Date.convert("2009-12-31"));
+ tempE.setId(1);
+ tempE.setProjectId(1);
+ tempE.setUserId(4);
+ tempE.setIssueId(6);
+ tempE.setActivityId(8);
+
+ tempE.setHours(1);
+ tempE.setTmonth(12);
+ tempE.setTyear(2009);
+ tempE.setTweek(53);
+ tempE.setComments("Test");
+ model.put(TimeEntry.class, tempE);
+
+ tempE = new TimeEntry();
+ tempE.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:10:01+01:00"));
+ tempE.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:10:01+01:00"));
+ tempE.setSpentOn((Date) RedmineDataConverter.Date.convert("2009-12-31"));
+ tempE.setId(2);
+ tempE.setProjectId(1);
+ tempE.setUserId(4);
+ tempE.setIssueId(6);
+ tempE.setActivityId(9);
+
+ tempE.setHours(2);
+ tempE.setTmonth(12);
+ tempE.setTyear(2009);
+ tempE.setTweek(53);
+ tempE.setComments("deuxième temps");
+ model.put(TimeEntry.class, tempE);
+ }
+
+
+ public Attachment getAttachment() {
+ Attachment result = new Attachment();
+ File fileToUpload = null;
+ try {
+ fileToUpload = File.createTempFile("toupload", ".txt");
+ FileUtils.write(fileToUpload, FILE_TO_UPLOAD_CONTENT);
+ result.setToUpload(fileToUpload);
+ result.setDescription("attachment description...");
+ return result;
+ } catch (IOException e) {
+ throw new RuntimeException("Could not create temp file", e);
+ }
+
+ }
+
+ /**
+ * Configuration of a redmine service for test purposes.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+ public static class FakeRedmineServiceConfiguration implements RedmineServiceConfiguration {
+
+ URL restUrl;
+
+ String restUsername;
+
+ String restPassword;
+
+ boolean verbose;
+
+ boolean anonymous;
+
+ String encoding;
+
+ @Override
+ public String getEncoding() {
+ return encoding;
+ }
+
+ @Override
+ public void setEncoding(String encoding) {
+ this.encoding = encoding;
+ }
+
+ @Override
+ public String getRestPassword() {
+ return restPassword;
+ }
+
+ @Override
+ public void setRestPassword(String restPassword) {
+ this.restPassword = restPassword;
+ }
+
+ @Override
+ public URL getRestUrl() {
+ return restUrl;
+ }
+
+ @Override
+ public void setRestUrl(URL restUrl) {
+ this.restUrl = restUrl;
+ }
+
+ @Override
+ public String getRestUsername() {
+ return restUsername;
+ }
+
+ @Override
+ public void setRestUsername(String restUsername) {
+ this.restUsername = restUsername;
+ }
+
+ @Override
+ public boolean isVerbose() {
+ return verbose;
+ }
+
+ @Override
+ public void setVerbose(boolean verbose) {
+ this.verbose = verbose;
+ }
+
+ @Override
+ public boolean isAnonymous() {
+ return anonymous;
+ }
+
+ @Override
+ public void setAnonymous(boolean anonymous) {
+ this.anonymous = anonymous;
+ }
+
+ @Override
+ public String toString() {
+ ToStringBuilder b = new ToStringBuilder(this,
+ ToStringStyle.MULTI_LINE_STYLE
+ );
+ b.append("redmineUrl", restUrl);
+ if (anonymous) {
+ b.append("anonymous", true);
+ } else {
+ b.append("redmineUsername", restUsername);
+ b.append("redminePassword", "***");
+ }
+ b.append("encoding", encoding);
+ b.append("verbose", verbose);
+ return b.toString();
+ }
+ }
+}
Added: trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_x/RedmineServer.java
===================================================================
--- trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_x/RedmineServer.java (rev 0)
+++ trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_x/RedmineServer.java 2012-07-13 17:16:17 UTC (rev 291)
@@ -0,0 +1,206 @@
+package org.nuiton.jredmine.v1_x;
+/*
+ * #%L
+ * JRedmine :: Client 1.x
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codehaus.plexus.util.StringUtils;
+import org.junit.Assume;
+import org.junit.rules.TestWatcher;
+import org.junit.runner.Description;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+import org.nuiton.jredmine.RedmineServiceImplementor;
+
+import java.io.IOException;
+
+/**
+ * A redmine server usable by tests.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public abstract class RedmineServer<S> extends TestWatcher {
+
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(RedmineServer.class);
+
+ /**
+ * Fixtures.
+ *
+ * @since 1.4
+ */
+ protected final RedmineFixtures fixtures;
+
+ /**
+ * Service configuration to use.
+ *
+ * @since 1.4
+ */
+ protected RedmineServiceConfiguration configuration;
+
+ /**
+ * Current service.
+ *
+ * @since 1.4
+ */
+ protected S service;
+
+ public RedmineServer(RedmineFixtures fixtures) {
+ this.fixtures = fixtures;
+ }
+
+ protected abstract S createService(RedmineFixtures fixtures,
+ RedmineServiceConfiguration configuration) throws IOException, RedmineServiceException;
+
+ protected abstract RedmineServiceConfiguration createConfiguration(RedmineFixtures fixtures) throws IOException;
+
+ public RedmineFixtures getFixtures() {
+ return fixtures;
+ }
+
+ public RedmineServiceConfiguration getConfiguration() {
+ return configuration;
+ }
+
+ public S getService() {
+ return service;
+ }
+
+ @Override
+ protected void starting(Description description) {
+
+ try {
+ configuration = createConfiguration(fixtures);
+ } catch (IOException e) {
+
+ throw new IllegalStateException("Could not create configuration", e);
+ }
+
+ try {
+ service = createService(fixtures, configuration);
+ } catch (Exception e) {
+ throw new IllegalStateException("Could not create service", e);
+ }
+ }
+
+ @Override
+ protected void finished(Description description) {
+
+ if (service != null) {
+ try {
+ ((RedmineServiceImplementor) service).destroy();
+ } catch (RedmineServiceException e) {
+ throw new IllegalStateException("Could not close service ", e);
+ }
+ }
+ }
+
+ protected void checkService() {
+
+ if (log.isInfoEnabled()) {
+ log.info("Will check service...");
+ }
+
+ try {
+
+ try {
+ configuration = createConfiguration(fixtures);
+ } catch (IOException e) {
+
+ throw new IllegalStateException("Could not create configuration", e);
+ }
+
+ boolean anonymous = configuration.isAnonymous();
+ try {
+ configuration.setAnonymous(true);
+ service = createService(fixtures, configuration);
+ } catch (Exception e) {
+
+ // could not init service
+ if (log.isInfoEnabled()) {
+ log.info("Will skip test " +
+ RedmineServiceTest.class.getName() +
+ ", since could not init service", e);
+ }
+ Assume.assumeTrue(false);
+ return;
+
+ } finally {
+
+ //push back initial flag value
+ configuration.setAnonymous(anonymous);
+ }
+
+ if (!anonymous) {
+
+ if (StringUtils.isBlank(configuration.getRestUsername())) {
+ if (log.isInfoEnabled()) {
+ log.info("Will skip test " +
+ RedmineServiceTest.class.getName() +
+ ", since not username was given and loggued service is required");
+ }
+ Assume.assumeTrue(false);
+ return;
+ }
+
+
+ if (StringUtils.isBlank(configuration.getRestPassword())) {
+ if (log.isInfoEnabled()) {
+ log.info("Will skip test " +
+ RedmineServiceTest.class.getName() +
+ ", since not password was given and loggued service is required");
+ }
+ Assume.assumeTrue(false);
+ return;
+ }
+
+ // recheck service (to test now login)
+ try {
+ service = createService(fixtures, configuration);
+ } catch (Exception e) {
+ // ping was not ok
+ if (log.isInfoEnabled()) {
+ log.info("Will skip test " +
+ RedmineServiceTest.class.getName() +
+ ", since login [" + configuration.getRestUsername() + "] was bad : " + e.getMessage(), e);
+ }
+
+ Assume.assumeTrue(false);
+ }
+ }
+ } finally {
+ if (log.isInfoEnabled()) {
+ log.info("Service checked...");
+ }
+ if (service != null) {
+ try {
+ ((RedmineServiceImplementor) service).destroy();
+ } catch (RedmineServiceException e) {
+ throw new IllegalStateException("Could not close service", e);
+ }
+ }
+ }
+ }
+}
Added: trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_x/RedmineServiceAsAnonymousTest.java
===================================================================
--- trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_x/RedmineServiceAsAnonymousTest.java (rev 0)
+++ trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_x/RedmineServiceAsAnonymousTest.java 2012-07-13 17:16:17 UTC (rev 291)
@@ -0,0 +1,223 @@
+package org.nuiton.jredmine.v1_x;
+/*
+ * #%L
+ * JRedmine :: Client 1.x
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.Test;
+import org.nuiton.jredmine.RedmineService;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+import org.nuiton.jredmine.RedmineServiceLoginException;
+import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.Issue;
+import org.nuiton.jredmine.model.IssueCategory;
+import org.nuiton.jredmine.model.IssuePriority;
+import org.nuiton.jredmine.model.IssueStatus;
+import org.nuiton.jredmine.model.News;
+import org.nuiton.jredmine.model.Project;
+import org.nuiton.jredmine.model.TimeEntry;
+import org.nuiton.jredmine.model.Tracker;
+import org.nuiton.jredmine.model.User;
+import org.nuiton.jredmine.model.Version;
+
+import java.io.IOException;
+
+/**
+ * Tests the {@link RedmineAnonymousServiceImpl}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.5
+ */
+public class RedmineServiceAsAnonymousTest {
+
+ protected static final RedmineFixtures fixtures = new RedmineFixtures();
+
+ @Rule
+ public final RedmineServer<RedmineService> server = createNewServer(fixtures);
+
+ protected RedmineService getService() {
+ return server.getService();
+ }
+
+ protected RedmineServer<RedmineService> createNewServer(RedmineFixtures fixtures) {
+ return new RedmineServer<RedmineService>(fixtures) {
+
+ @Override
+ protected RedmineService createService(
+ RedmineFixtures fixture,
+ RedmineServiceConfiguration configuration) throws IOException, RedmineServiceException {
+
+ return fixture.newRedmineService(configuration);
+ }
+
+ @Override
+ protected RedmineServiceConfiguration createConfiguration(RedmineFixtures fixture) throws IOException {
+ RedmineServiceConfiguration conf = fixture.newAnonymousConfiguration();
+ return conf;
+ }
+ };
+ }
+
+
+ @BeforeClass
+ public static void beforeClass() {
+ RedmineServer<RedmineService> newServer =
+ new RedmineServiceAsAnonymousTest().createNewServer(fixtures);
+ newServer.checkService();
+ }
+
+ @Test
+ public void getProjects() throws Exception {
+ Project[] projects = getService().getProjects();
+ Assert.assertNotNull(projects);
+ }
+
+ @Test
+ public void getIssuePriorities() throws Exception {
+ IssuePriority[] issuePriorities = getService().getIssuePriorities();
+ Assert.assertNotNull(issuePriorities);
+ }
+
+ @Test
+ public void getIssueStatuses() throws Exception {
+ IssueStatus[] issueStatuses = getService().getIssueStatuses();
+ Assert.assertNotNull(issueStatuses);
+ }
+
+ @Test
+ public void getProject() throws Exception {
+ Project project = getService().getProject(fixtures.projectName());
+ Assert.assertNotNull(project);
+ }
+
+ @Test
+ public void getIssueCategories() throws Exception {
+ IssueCategory[] issueCategories = getService().getIssueCategories(fixtures.projectName());
+ Assert.assertNotNull(issueCategories);
+ }
+
+ @Test
+ public void getTrackers() throws Exception {
+ Tracker[] trackers = getService().getTrackers(fixtures.projectName());
+ Assert.assertNotNull(trackers);
+ }
+
+ @Test
+ public void getNews() throws Exception {
+ News[] news = getService().getNews(fixtures.projectName());
+ Assert.assertNotNull(news);
+ }
+
+ @Test
+ public void getProjectMembers() throws Exception {
+ User[] users = getService().getProjectMembers(fixtures.projectName());
+ Assert.assertNotNull(users);
+ }
+
+ @Test
+ public void getProjectIssues() throws Exception {
+ Issue[] issues = getService().getIssues(fixtures.projectName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getVersions() throws Exception {
+ Version[] versions = getService().getVersions(fixtures.projectName());
+ Assert.assertNotNull(versions);
+ }
+
+ @Test
+ public void getVersion() throws Exception {
+ Version version = getService().getVersion(fixtures.projectName(), fixtures.versionName());
+ Assert.assertNotNull(version);
+ }
+
+ @Test
+ public void getVersionIssues() throws Exception {
+ Issue[] issues = getService().getIssues(fixtures.projectName(), fixtures.versionName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getOpenedIssues() throws Exception {
+ Issue[] issues = getService().getOpenedIssues(fixtures.projectName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getClosedIssues() throws Exception {
+ Issue[] issues = getService().getClosedIssues(fixtures.projectName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getIssueTimeEntries() throws Exception {
+ TimeEntry[] timeEntries = getService().getIssueTimeEntries(fixtures.projectName(), fixtures.issueId());
+ Assert.assertNotNull(timeEntries);
+ }
+
+ @Test
+ public void getAttachments() throws Exception {
+ Attachment[] attachments = getService().getAttachments(fixtures.projectName(), fixtures.versionName());
+ Assert.assertNotNull(attachments);
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ public void getUserProjects() throws Exception {
+ getService().getUserProjects();
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ public void addVersion() throws Exception {
+ getService().addVersion(fixtures.projectName(), new Version());
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ public void addAttachment() throws Exception {
+ getService().addAttachment(fixtures.projectName(), fixtures.versionName(), new Attachment());
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ public void addNews() throws Exception {
+ getService().addNews(fixtures.projectName(), new News());
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ public void updateVersion() throws Exception {
+ getService().updateVersion(fixtures.projectName(), new Version());
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ public void nextVersion() throws Exception {
+ getService().nextVersion(fixtures.projectName(), fixtures.versionName(), new Version());
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ public void addIssueTime() throws Exception {
+ getService().addIssueTimeEntry(fixtures.projectName(), fixtures.issueId(), new TimeEntry());
+ }
+
+}
Added: trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_x/RedmineServiceTest.java
===================================================================
--- trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_x/RedmineServiceTest.java (rev 0)
+++ trunk/jredmine-client-1.x/src/test/java/org/nuiton/jredmine/v1_x/RedmineServiceTest.java 2012-07-13 17:16:17 UTC (rev 291)
@@ -0,0 +1,236 @@
+package org.nuiton.jredmine.v1_x;
+/*
+ * #%L
+ * JRedmine :: Client 1.x
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+import org.nuiton.jredmine.RedmineService;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.Issue;
+import org.nuiton.jredmine.model.IssueCategory;
+import org.nuiton.jredmine.model.IssuePriority;
+import org.nuiton.jredmine.model.IssueStatus;
+import org.nuiton.jredmine.model.News;
+import org.nuiton.jredmine.model.Project;
+import org.nuiton.jredmine.model.TimeEntry;
+import org.nuiton.jredmine.model.Tracker;
+import org.nuiton.jredmine.model.User;
+import org.nuiton.jredmine.model.Version;
+
+import java.io.IOException;
+
+/**
+ * Tests the {@link RedmineAnonymousServiceImpl}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.5
+ */
+public class RedmineServiceTest {
+
+ protected static final RedmineFixtures fixtures = new RedmineFixtures();
+
+ @Rule
+ public final RedmineServer<RedmineService> server = createNewServer(fixtures);
+
+ protected RedmineService getService() {
+ return server.getService();
+ }
+
+
+ protected RedmineServer<RedmineService> createNewServer(RedmineFixtures fixtures) {
+ return new RedmineServer<RedmineService>(fixtures) {
+
+ @Override
+ protected RedmineService createService(
+ RedmineFixtures fixture,
+ RedmineServiceConfiguration configuration) throws IOException, RedmineServiceException {
+ return fixture.newRedmineService(configuration);
+ }
+
+ @Override
+ protected RedmineServiceConfiguration createConfiguration(RedmineFixtures fixture) throws IOException {
+ RedmineServiceConfiguration conf = fixture.newLogguedConfiguration();
+ return conf;
+ }
+ };
+ }
+
+ @BeforeClass
+ public static void beforeClass() {
+ RedmineServer<RedmineService> newServer =
+ new RedmineServiceTest().createNewServer(fixtures);
+ newServer.checkService();
+ }
+
+ @Test
+ public void getProjects() throws Exception {
+ Project[] projects = getService().getProjects();
+ Assert.assertNotNull(projects);
+ }
+
+ @Test
+ public void getIssuePriorities() throws Exception {
+ IssuePriority[] issuePriorities = getService().getIssuePriorities();
+ Assert.assertNotNull(issuePriorities);
+ }
+
+ @Test
+ public void getIssueStatuses() throws Exception {
+ IssueStatus[] issueStatuses = getService().getIssueStatuses();
+ Assert.assertNotNull(issueStatuses);
+ }
+
+ @Test
+ public void getProject() throws Exception {
+ Project project = getService().getProject(fixtures.projectName());
+ Assert.assertNotNull(project);
+ }
+
+ @Test
+ public void getIssueCategories() throws Exception {
+ IssueCategory[] issueCategories = getService().getIssueCategories(fixtures.projectName());
+ Assert.assertNotNull(issueCategories);
+ }
+
+ @Test
+ public void getTrackers() throws Exception {
+ Tracker[] trackers = getService().getTrackers(fixtures.projectName());
+ Assert.assertNotNull(trackers);
+ }
+
+ @Test
+ public void getNews() throws Exception {
+ News[] news = getService().getNews(fixtures.projectName());
+ Assert.assertNotNull(news);
+ }
+
+ @Test
+ public void getProjectMembers() throws Exception {
+ User[] users = getService().getProjectMembers(fixtures.projectName());
+ Assert.assertNotNull(users);
+ }
+
+ @Test
+ public void getProjectIssues() throws Exception {
+ Issue[] issues = getService().getIssues(fixtures.projectName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getVersions() throws Exception {
+ Version[] versions = getService().getVersions(fixtures.projectName());
+ Assert.assertNotNull(versions);
+ }
+
+ @Test
+ public void getVersion() throws Exception {
+ Version version = getService().getVersion(fixtures.projectName(), fixtures.versionName());
+ Assert.assertNotNull(version);
+ }
+
+ @Test
+ public void getVersionIssues() throws Exception {
+ Issue[] issues = getService().getIssues(fixtures.projectName(), fixtures.versionName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getOpenedIssues() throws Exception {
+ Issue[] issues = getService().getOpenedIssues(fixtures.projectName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getClosedIssues() throws Exception {
+ Issue[] issues = getService().getClosedIssues(fixtures.projectName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getIssueTimeEntries() throws Exception {
+ TimeEntry[] timeEntries = getService().getIssueTimeEntries(fixtures.projectName(), fixtures.issueId());
+ Assert.assertNotNull(timeEntries);
+ }
+
+ @Test
+ public void getAttachments() throws Exception {
+ Attachment[] attachments = getService().getAttachments(fixtures.projectName(), fixtures.versionName());
+ Assert.assertNotNull(attachments);
+ }
+
+ @Test
+ public void getUserProjects() throws Exception {
+ Project[] userProjects = getService().getUserProjects();
+ Assert.assertNotNull(userProjects);
+ }
+
+ @Ignore
+ @Test
+ public void addVersion() throws Exception {
+ getService().addVersion(fixtures.projectName(), new Version());
+ }
+
+ @Ignore
+ @Test
+ public void addAttachment() throws Exception {
+ Version version = fixtures.getVersion();
+ Attachment attachment = fixtures.getAttachment();
+ Attachment updatedAttachment = getService().addAttachment(
+ fixtures.projectName(),
+ version.getName(),
+ attachment
+ );
+ Assert.assertNotNull(updatedAttachment);
+ }
+
+ @Ignore
+ @Test
+ public void addNews() throws Exception {
+ getService().addNews(fixtures.projectName(), new News());
+ }
+
+ @Ignore
+ @Test
+ public void updateVersion() throws Exception {
+ getService().updateVersion(fixtures.projectName(), new Version());
+ }
+
+ @Ignore
+ @Test
+ public void nextVersion() throws Exception {
+ getService().nextVersion(fixtures.projectName(), fixtures.versionName(), new Version());
+ }
+
+ @Ignore
+ @Test
+ public void addIssueTime() throws Exception {
+ getService().addIssueTimeEntry(fixtures.projectName(), fixtures.issueId(), new TimeEntry());
+ }
+
+}
1
0