Author: tchemit Date: 2009-09-19 16:49:32 +0200 (Sat, 19 Sep 2009) New Revision: 183 Added: jredmine/ jredmine/trunk/ jredmine/trunk/LICENSE.txt jredmine/trunk/README.txt jredmine/trunk/changelog.txt jredmine/trunk/jredmine-client/ jredmine/trunk/jredmine-client/LICENSE.txt jredmine/trunk/jredmine-client/README.txt jredmine/trunk/jredmine-client/changelog.txt jredmine/trunk/jredmine-client/pom.xml jredmine/trunk/jredmine-client/src/ jredmine/trunk/jredmine-client/src/main/ jredmine/trunk/jredmine-client/src/main/assembly/ jredmine/trunk/jredmine-client/src/main/assembly/redmine_rest_plugin.xml jredmine/trunk/jredmine-client/src/main/java/ jredmine/trunk/jredmine-client/src/main/java/org/ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineService.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineService.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceException.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/Attachment.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/I18nAble.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/IdAble.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/Issue.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/IssueCategory.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/IssuePriority.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/IssueStatus.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/ModelHelper.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/News.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/Project.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelScope.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/Tracker.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/User.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/Version.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/AttachmentXpp3Reader.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueCategoryXpp3Reader.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssuePriorityXpp3Reader.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueStatusXpp3Reader.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueXpp3Reader.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/NewsXpp3Reader.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectXpp3Reader.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineDataConverter.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3Helper.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/TrackerXpp3Reader.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserXpp3Reader.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/VersionXpp3Reader.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/rest/ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/rest/DefaultRequestBuilder.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/rest/ProjectScopeRequestBuilder.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/rest/RedmineRestClient.java jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/rest/VersionScopeRequestBuilder.java jredmine/trunk/jredmine-client/src/main/redmine/ jredmine/trunk/jredmine-client/src/main/redmine/jredmine/ jredmine/trunk/jredmine-client/src/main/redmine/jredmine/README.rdoc jredmine/trunk/jredmine-client/src/main/redmine/jredmine/app/ jredmine/trunk/jredmine-client/src/main/redmine/jredmine/app/controllers/ jredmine/trunk/jredmine-client/src/main/redmine/jredmine/app/controllers/rest_controller.rb jredmine/trunk/jredmine-client/src/main/redmine/jredmine/app/helpers/ jredmine/trunk/jredmine-client/src/main/redmine/jredmine/app/models/ jredmine/trunk/jredmine-client/src/main/redmine/jredmine/app/views/ jredmine/trunk/jredmine-client/src/main/redmine/jredmine/assets/ jredmine/trunk/jredmine-client/src/main/redmine/jredmine/assets/images/ jredmine/trunk/jredmine-client/src/main/redmine/jredmine/assets/javascripts/ jredmine/trunk/jredmine-client/src/main/redmine/jredmine/assets/stylesheets/ jredmine/trunk/jredmine-client/src/main/redmine/jredmine/db/ jredmine/trunk/jredmine-client/src/main/redmine/jredmine/db/migrate/ jredmine/trunk/jredmine-client/src/main/redmine/jredmine/init.rb jredmine/trunk/jredmine-client/src/main/redmine/jredmine/lang/ jredmine/trunk/jredmine-client/src/main/redmine/jredmine/lang/en.yml jredmine/trunk/jredmine-client/src/main/redmine/jredmine/lib/ jredmine/trunk/jredmine-client/src/main/redmine/jredmine/lib/tasks/ jredmine/trunk/jredmine-client/src/main/redmine/jredmine/test/ jredmine/trunk/jredmine-client/src/main/redmine/jredmine/test/functional/ jredmine/trunk/jredmine-client/src/main/resources/ jredmine/trunk/jredmine-client/src/main/resources/META-INF/ jredmine/trunk/jredmine-client/src/main/resources/META-INF/services/ jredmine/trunk/jredmine-client/src/main/resources/META-INF/services/org.nuiton.io.xpp3.Xpp3Reader jredmine/trunk/jredmine-client/src/site/ jredmine/trunk/jredmine-client/src/site/apt/ jredmine/trunk/jredmine-client/src/site/apt/index.apt jredmine/trunk/jredmine-client/src/site/apt/todo.apt jredmine/trunk/jredmine-client/src/site/site.xml jredmine/trunk/jredmine-client/src/test/ jredmine/trunk/jredmine-client/src/test/java/ jredmine/trunk/jredmine-client/src/test/java/org/ jredmine/trunk/jredmine-client/src/test/java/org/nuiton/ jredmine/trunk/jredmine-client/src/test/java/org/nuiton/jredmine/ jredmine/trunk/jredmine-client/src/test/java/org/nuiton/jredmine/RemoteServiceTest.java jredmine/trunk/jredmine-client/src/test/java/org/nuiton/jredmine/TestHelper.java jredmine/trunk/jredmine-client/src/test/java/org/nuiton/jredmine/model/ jredmine/trunk/jredmine-client/src/test/java/org/nuiton/jredmine/model/io/ jredmine/trunk/jredmine-client/src/test/java/org/nuiton/jredmine/model/io/xpp3/ jredmine/trunk/jredmine-client/src/test/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3HelperTest.java jredmine/trunk/jredmine-client/src/test/java/org/nuiton/jredmine/rest/ jredmine/trunk/jredmine-client/src/test/java/org/nuiton/jredmine/rest/RedmineRestClientTest.java jredmine/trunk/jredmine-client/src/test/resources/ jredmine/trunk/jredmine-client/src/test/resources/log4j.properties jredmine/trunk/jredmine-client/src/test/resources/org/ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/attachments.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issueCategorys.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issuePrioritys.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issueStatuss.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issues.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/newss.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/projects.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/trackers.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/users.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/versions.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/attachments.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issueCategorys.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issuePrioritys.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issueStatuss.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issues.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/newss.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/projects.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/trackers.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/users.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/versions.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/attachments.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issueCategorys.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issuePrioritys.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issueStatuss.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issues.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/newss.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/projects.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/trackers.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/users.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/versions.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/attachment.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/issue.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/issueCategory.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/issuePriority.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/issueStatus.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/news.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/project.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/tracker.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/user.xml jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/version.xml jredmine/trunk/jredmine-client/src/test/resources/test-config.properties jredmine/trunk/maven-jredmine-plugin/ jredmine/trunk/maven-jredmine-plugin/LICENSE.txt jredmine/trunk/maven-jredmine-plugin/README.txt jredmine/trunk/maven-jredmine-plugin/changelog.txt jredmine/trunk/maven-jredmine-plugin/org/ jredmine/trunk/maven-jredmine-plugin/org/nuiton/ jredmine/trunk/maven-jredmine-plugin/org/nuiton/jredmine/ jredmine/trunk/maven-jredmine-plugin/org/nuiton/jredmine/plugin/ jredmine/trunk/maven-jredmine-plugin/org/nuiton/jredmine/plugin/announcement/ jredmine/trunk/maven-jredmine-plugin/pom.xml jredmine/trunk/maven-jredmine-plugin/src/ jredmine/trunk/maven-jredmine-plugin/src/it/ jredmine/trunk/maven-jredmine-plugin/src/it/multi/ jredmine/trunk/maven-jredmine-plugin/src/it/multi/invoker.properties jredmine/trunk/maven-jredmine-plugin/src/it/multi/module1/ jredmine/trunk/maven-jredmine-plugin/src/it/multi/module1/pom.xml jredmine/trunk/maven-jredmine-plugin/src/it/multi/module1/src/ jredmine/trunk/maven-jredmine-plugin/src/it/multi/module1/src/module1.txt jredmine/trunk/maven-jredmine-plugin/src/it/multi/module2/ jredmine/trunk/maven-jredmine-plugin/src/it/multi/module2/pom.xml jredmine/trunk/maven-jredmine-plugin/src/it/multi/module2/src/ jredmine/trunk/maven-jredmine-plugin/src/it/multi/module2/src/module2.txt jredmine/trunk/maven-jredmine-plugin/src/it/multi/pom.xml jredmine/trunk/maven-jredmine-plugin/src/it/multi/src/ jredmine/trunk/maven-jredmine-plugin/src/it/multi/src/pom.txt jredmine/trunk/maven-jredmine-plugin/src/it/multi/verify.groovy jredmine/trunk/maven-jredmine-plugin/src/it/report/ jredmine/trunk/maven-jredmine-plugin/src/it/report/invoker.properties jredmine/trunk/maven-jredmine-plugin/src/it/report/pom.xml jredmine/trunk/maven-jredmine-plugin/src/it/report/verify.groovy jredmine/trunk/maven-jredmine-plugin/src/it/settings.xml jredmine/trunk/maven-jredmine-plugin/src/it/single/ jredmine/trunk/maven-jredmine-plugin/src/it/single/invoker.properties jredmine/trunk/maven-jredmine-plugin/src/it/single/pom.xml jredmine/trunk/maven-jredmine-plugin/src/it/single/verify.groovy jredmine/trunk/maven-jredmine-plugin/src/main/ jredmine/trunk/maven-jredmine-plugin/src/main/java/ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojo.java jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/CollectFilesMojo.java jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/GenerateChangesMojo.java jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/IssueCollectorConfiguration.java jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/IssuesCollector.java jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojo.java jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishNewsMojo.java jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/SendEmailMojo.java jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/UpdateVersionMojo.java jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/AbstractAnnouncementMojo.java jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/AnnouncementGenerator.java jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojo.java jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojo.java jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractIssuesReport.java jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractRedmineReport.java jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssueReportGenerator.java jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReport.java jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByAssignee.java jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByCategory.java jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByPriority.java jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByReporter.java jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByStatus.java jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByTracker.java jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByVersion.java jredmine/trunk/maven-jredmine-plugin/src/main/resources/ jredmine/trunk/maven-jredmine-plugin/src/main/resources/META-INF/ jredmine/trunk/maven-jredmine-plugin/src/main/resources/META-INF/plexus/ jredmine/trunk/maven-jredmine-plugin/src/main/resources/META-INF/plexus/components.xml jredmine/trunk/maven-jredmine-plugin/src/main/resources/log4j.properties jredmine/trunk/maven-jredmine-plugin/src/main/resources/org/ jredmine/trunk/maven-jredmine-plugin/src/main/resources/org/nuiton/ jredmine/trunk/maven-jredmine-plugin/src/main/resources/org/nuiton/jredmine/ jredmine/trunk/maven-jredmine-plugin/src/main/resources/org/nuiton/jredmine/plugin/ jredmine/trunk/maven-jredmine-plugin/src/main/resources/org/nuiton/jredmine/plugin/announcement/ jredmine/trunk/maven-jredmine-plugin/src/main/resources/org/nuiton/jredmine/plugin/announcement/release-email-announcement.vm jredmine/trunk/maven-jredmine-plugin/src/main/resources/org/nuiton/jredmine/plugin/announcement/release-news-announcement.vm jredmine/trunk/maven-jredmine-plugin/src/main/resources/redmine-report.properties jredmine/trunk/maven-jredmine-plugin/src/main/resources/redmine-report_de.properties jredmine/trunk/maven-jredmine-plugin/src/main/resources/redmine-report_en.properties jredmine/trunk/maven-jredmine-plugin/src/main/resources/redmine-report_fr.properties jredmine/trunk/maven-jredmine-plugin/src/site/ jredmine/trunk/maven-jredmine-plugin/src/site/apt/ jredmine/trunk/maven-jredmine-plugin/src/site/apt/Todo.apt jredmine/trunk/maven-jredmine-plugin/src/site/apt/index.apt jredmine/trunk/maven-jredmine-plugin/src/site/apt/usage.apt jredmine/trunk/maven-jredmine-plugin/src/site/site.xml jredmine/trunk/maven-jredmine-plugin/src/test/ jredmine/trunk/maven-jredmine-plugin/src/test/java/ jredmine/trunk/maven-jredmine-plugin/src/test/java/org/ jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/ jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/ jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/ jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/AbstractRedmineMojoTest.java jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/DisplayDataMojoTest.java jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/GenerateChangesMojoTest.java jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojoTest.java jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/PublishNewsMojoTest.java jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/SendEmailMojoTest.java jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/UpdateVersionMojoTest.java jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/announcement/ jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojoTest.java jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojoTest.java jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/ jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/AbstractIssuesReportTest.java jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByAssigneeTest.java jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByCategoryTest.java jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByPriorityTest.java jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByReporterTest.java jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByStatusTest.java jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByTrackerTest.java jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByVersionTest.java jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportTest.java jredmine/trunk/maven-jredmine-plugin/src/test/resources/ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/DisplayDataMojoTest/ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/DisplayDataMojoTest/displayAll.xml jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/DisplayDataMojoTest/displayIssuePriorities.xml jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/DisplayDataMojoTest/displayIssueStatuses.xml jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/DisplayDataMojoTest/displayProjectIssueCategories.xml jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/DisplayDataMojoTest/displayProjectTrackers.xml jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/DisplayDataMojoTest/displayProjectUsers.xml jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/GenerateChangesMojoTest/ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/GenerateChangesMojoTest/generateChanges.xml jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/PublishAttachmentsMojoTest/ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/PublishAttachmentsMojoTest/publishAttachments.xml jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/PublishAttachmentsMojoTest/skipPublishAttachments.xml jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/PublishNewsMojoTest/ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/PublishNewsMojoTest/newsContentFile.txt jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/PublishNewsMojoTest/publishNews.xml jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/PublishNewsMojoTest/skipPublishNews.xml jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/SendEmailMojoTest/ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/SendEmailMojoTest/mailContentFile.txt jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/SendEmailMojoTest/sendEmail.xml jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/SendEmailMojoTest/skipSendEmail.xml jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/UpdateVersionMojoTest/ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/UpdateVersionMojoTest/skipUpdateVersion.xml jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/UpdateVersionMojoTest/updateVersion.xml jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojoTest/ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojoTest/generateEmailAnnouncement.xml jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojoTest/skipGenerateEmailAnnouncement.xml jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojoTest/ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojoTest/generateNewsAnnouncement.xml jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojoTest/skipGenerateNewsAnnouncement.xml jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/changes.xml jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByAssigneeTest/ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByAssigneeTest/issueReport.xml jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByCategoryTest/ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByCategoryTest/issueReport.xml jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByPriorityTest/ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByPriorityTest/issueReport.xml jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByReporterTest/ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByReporterTest/issueReport.xml jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByStatusTest/ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByStatusTest/issueReport.xml jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByTrackerTest/ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByTrackerTest/issueReport.xml jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByVersionTest/ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByVersionTest/issueReport.xml jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportTest/ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportTest/issueReport.xml jredmine/trunk/pom.xml jredmine/trunk/src/ jredmine/trunk/src/site/ jredmine/trunk/src/site/apt/ jredmine/trunk/src/site/apt/index.apt jredmine/trunk/src/site/apt/todo.apt jredmine/trunk/src/site/site.xml Log: JRedmine initial import Added: jredmine/trunk/LICENSE.txt =================================================================== --- jredmine/trunk/LICENSE.txt (rev 0) +++ jredmine/trunk/LICENSE.txt 2009-09-19 14:49:32 UTC (rev 183) @@ -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. + Added: jredmine/trunk/README.txt =================================================================== --- jredmine/trunk/README.txt (rev 0) +++ jredmine/trunk/README.txt 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,2 @@ +To deploy new version of pom: mvn deploy +To install localy: mvn install Added: jredmine/trunk/changelog.txt =================================================================== --- jredmine/trunk/changelog.txt (rev 0) +++ jredmine/trunk/changelog.txt 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,5 @@ +maven-redmine-plugin (1.0.0-SNAPSHOT) stable; urgency=low + + * //TODO_FILL_ME + + -- author -- date -R Added: jredmine/trunk/jredmine-client/LICENSE.txt =================================================================== --- jredmine/trunk/jredmine-client/LICENSE.txt (rev 0) +++ jredmine/trunk/jredmine-client/LICENSE.txt 2009-09-19 14:49:32 UTC (rev 183) @@ -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. + Added: jredmine/trunk/jredmine-client/README.txt =================================================================== --- jredmine/trunk/jredmine-client/README.txt (rev 0) +++ jredmine/trunk/jredmine-client/README.txt 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,2 @@ +To deploy new version of pom: mvn deploy +To install localy: mvn install Added: jredmine/trunk/jredmine-client/changelog.txt =================================================================== --- jredmine/trunk/jredmine-client/changelog.txt (rev 0) +++ jredmine/trunk/jredmine-client/changelog.txt 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,5 @@ +maven-redmine-plugin (1.0.0-SNAPSHOT) stable; urgency=low + + * //TODO_FILL_ME + + -- author -- date -R Added: jredmine/trunk/jredmine-client/pom.xml =================================================================== --- jredmine/trunk/jredmine-client/pom.xml (rev 0) +++ jredmine/trunk/jredmine-client/pom.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,189 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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.0.0-SNAPSHOT</version> + </parent> + + <groupId>org.nuiton.jredmine</groupId> + <artifactId>jredmine-client</artifactId> + + <dependencies> + + <dependency> + <groupId>org.nuiton</groupId> + <artifactId>maven-helper-plugin</artifactId> + <scope>compile</scope> + <exclusions> + <exclusion> + <groupId>org.apache.maven</groupId> + <artifactId>maven-artifact</artifactId> + </exclusion> + + <exclusion> + <groupId>org.apache.maven</groupId> + <artifactId>maven-artifact-manager</artifactId> + </exclusion> + + <exclusion> + <groupId>org.apache.maven.shared</groupId> + <artifactId>maven-dependency-tree</artifactId> + </exclusion> + + <exclusion> + <groupId>org.apache.maven</groupId> + <artifactId>maven-model</artifactId> + </exclusion> + + <exclusion> + <groupId>org.apache.maven</groupId> + <artifactId>maven-profile</artifactId> + </exclusion> + + <exclusion> + <groupId>org.apache.maven</groupId> + <artifactId>maven-settings</artifactId> + </exclusion> + + <exclusion> + <groupId>org.apache.velocity</groupId> + <artifactId>velocity</artifactId> + </exclusion> + + </exclusions> + </dependency> + + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + </dependency> + + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <scope>test</scope> + </dependency> + + <!-- fix dependency in xpp parsing from plexus (need at least version > 2.2) --> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + </dependency> + + <!-- fix dependency in maven-helper-plugin --> + <dependency> + <groupId>commons-httpclient</groupId> + <artifactId>commons-httpclient</artifactId> + </dependency> + + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </dependency> + + </dependencies> + + <!-- ************************************************************* --> + <!-- *** Project Information ************************************* --> + <!-- ************************************************************* --> + <name>JRedmine client</name> + + <description>The JRedmine client</description> + + <!-- ************************************************************* --> + <!-- *** Build Settings ****************************************** --> + <!-- ************************************************************* --> + + <packaging>jar</packaging> + + <build> + + <plugins> + <!-- expose new plexus components --> + <plugin> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-maven-plugin</artifactId> + <version>1.3.8</version> + <executions> + <execution> + <goals> + <goal>descriptor</goal> + </goals> + </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> + <!-- ************************************************************* --> + <!-- *** Build Environment ************************************** --> + <!-- ************************************************************* --> + + <!-- Build Environment : Environment Information --> + + <!-- Maven Environment : profiles --> + + <profiles> + <profile> + <id>release-profile</id> + <activation> + <property> + <name>performRelease</name> + <value>true</value> + </property> + </activation> + <build> + <plugins> + + <!-- launch in a release the assembly, but not attach it to project --> + + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <executions> + <execution> + <id>create-assemblies</id> + <phase>verify</phase> + <goals> + <goal>single</goal> + </goals> + </execution> + </executions> + <configuration> + <attach>false</attach> + <descriptorRefs> + <descriptorRef>deps</descriptorRef> + <descriptorRef>full</descriptorRef> + </descriptorRefs> + <descriptors> + <descriptor>src/main/assembly/redmine_rest_plugin.xml</descriptor> + </descriptors> + </configuration> + </plugin> + + </plugins> + + </build> + </profile> + </profiles> + +</project> Added: jredmine/trunk/jredmine-client/src/main/assembly/redmine_rest_plugin.xml =================================================================== --- jredmine/trunk/jredmine-client/src/main/assembly/redmine_rest_plugin.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/main/assembly/redmine_rest_plugin.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,16 @@ +<assembly> + <id>redmine_rest_plugin</id> + <formats> + <format>zip</format> + </formats> + <includeBaseDirectory>false</includeBaseDirectory> + <fileSets> + <fileSet> + <directory>src/main/redmine/redmine_rest</directory> + <outputDirectory>redmine_rest</outputDirectory> + <includes> + <include>**/*</include> + </includes> + </fileSet> + </fileSets> +</assembly> \ No newline at end of file Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineService.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineService.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineService.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,338 @@ +package org.nuiton.jredmine; + +import java.io.IOException; +import org.nuiton.io.rest.RestException; +import org.nuiton.jredmine.model.Attachment; +import org.nuiton.jredmine.model.News; +import org.nuiton.jredmine.model.Version; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.nuiton.io.rest.RestClient; +import org.nuiton.io.rest.RestRequest; +import java.io.InputStream; +import org.codehaus.plexus.util.xml.pull.XmlPullParserException; +import org.nuiton.io.rest.RestClientConfiguration; +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.Project; +import org.nuiton.jredmine.model.Tracker; +import org.nuiton.jredmine.model.User; +import org.nuiton.jredmine.model.io.xpp3.RedmineXpp3Helper; +import org.nuiton.jredmine.rest.RedmineRestClient; + +/** + * Default {@link RedmineService} implementation base on a {@link RestClient} + * + * @author chemit + * @since 1.0.0 + * + * @plexus.component role="org.nuiton.jredmine.RedmineService" + * role-hint="default" + */ +public class DefaultRedmineService implements RedmineService, RedmineServiceImplementor { + + protected static final Log log = LogFactory.getLog(DefaultRedmineService.class); + /** + * client Rest + */ + protected RestClient session; + /** + * xpp3 xpp3Helper + */ + protected final RedmineXpp3Helper xpp3Helper; + /** + * internal state to known if service was init + */ + protected boolean init; + + public DefaultRedmineService() { + this.xpp3Helper = new RedmineXpp3Helper(); + if (log.isDebugEnabled()) { + log.debug("new " + this); + } + } + + /////////////////////////////////////////////////////////////////////////// + /// RedmineService implementation + /////////////////////////////////////////////////////////////////////////// + @Override + public Version addVersion(String projectId, Version version) throws RedmineServiceException { + checkInit(); + RestRequest r = getRequest(RedmineRestClient.ADD_VERSION, projectId, version); + + // send data and obtain created version + try { + + InputStream stream = session.sendData(r); + Version v = getDataFromStream(Version.class, stream); + return v; + } catch (Exception e) { + throw new RedmineServiceException("could not send for reason " + e.getMessage(), e); + } + } + + @Override + public Attachment addAttachment(String projectId, String versionId, Attachment attachement) throws RedmineServiceException { + checkInit(); + RestRequest r = getRequest(RedmineRestClient.ADD_ATTACHMENT, projectId, versionId, attachement); + + // send data and obtain created attachment + try { + + InputStream stream = session.sendData(r); + Attachment v = getDataFromStream(Attachment.class, stream); + return v; + } catch (Exception e) { + throw new RedmineServiceException("could not send for reason " + e.getMessage(), e); + } + } + + @Override + public News addNews(String projectId, News news) throws RedmineServiceException { + checkInit(); + RestRequest r = getRequest(RedmineRestClient.ADD_NEWS, projectId, news); + + // send data and obtain created news + try { + + InputStream stream = session.sendData(r); + News v = getDataFromStream(News.class, stream); + return v; + } catch (Exception e) { + throw new RedmineServiceException("could not send for reason " + e.getMessage(), e); + } + } + + @Override + public Version updateVersion(String projectId, Version version) throws RedmineServiceException { + checkInit(); + RestRequest r = getRequest(RedmineRestClient.UPDATE_VERSION, projectId, version); + + // send data and obtain updated version + try { + + InputStream stream = session.sendData(r); + Version v = getDataFromStream(Version.class, stream); + return v; + } catch (Exception e) { + throw new RedmineServiceException("could not send for reason " + e.getMessage(), e); + } + } + + @Override + public IssueStatus[] getIssueStatuses() throws RedmineServiceException { + return getDatas(IssueStatus.class); + } + + @Override + public IssuePriority[] getIssuePriorities() throws RedmineServiceException { + return getDatas(IssuePriority.class); + } + + @Override + public Project[] getProjects() throws RedmineServiceException { + return getDatas(Project.class); + } + + @Override + public IssueCategory[] getIssueCategories(String projectId) throws RedmineServiceException { + return getDatas(IssueCategory.class, projectId); + } + + @Override + public Project getProject(String projectId) throws RedmineServiceException { + return getData(Project.class, projectId); + } + + @Override + public Tracker[] getTrackers(String projectId) throws RedmineServiceException { + return getDatas(Tracker.class, projectId); + } + + @Override + public News[] getNews(String projectId) throws RedmineServiceException { + return getDatas(News.class, projectId); + } + + @Override + public User[] getUsers(String projectId) throws RedmineServiceException { + return getDatas(User.class, projectId); + } + + @Override + public Version[] getVersions(String projectId) throws RedmineServiceException { + return getDatas(Version.class, projectId); + } + + @Override + public Version getVersion(String projectId, String versionId) throws RedmineServiceException { + return getData(Version.class, projectId, versionId); + } + + @Override + public Attachment[] getAttachments(String projectId, String versionId) throws RedmineServiceException { + return getDatas(Attachment.class, projectId, versionId); + } + + @Override + public Issue[] getIssues(String projectId, String versionId) throws RedmineServiceException { + return getDatas(Issue.class, projectId, versionId); + } + + /////////////////////////////////////////////////////////////////////////// + /// RedmineServiceImplementor implementation + /////////////////////////////////////////////////////////////////////////// + @Override + public boolean isInit() { + return init; + } + + @Override + public RedmineServiceImplementor init(RestClientConfiguration configuration) throws RedmineServiceException { + RedmineServiceImplementor result = init(new RedmineRestClient(configuration)); + return result; + } + + @Override + public RedmineServiceImplementor init(RedmineRestClient session) throws RedmineServiceException { + if (init) { + throw new IllegalStateException("the client " + this + " was already init!"); + } + try { + this.session = session; + + if (!session.isOpen()) { + session.open(); + } + + init = true; + } catch (Exception e) { + throw new RedmineServiceException("could not init service for reason " + e.getMessage(), e); + } + return this; + } + + @Override + public 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 { + if (session != null) { + session = null; + } + init = false; + } + } + + @Override + public <T> T getData(Class<T> type, Object... args) throws RedmineServiceException { + checkInit(); + + InputStream stream = getDataStream(type, args); + + if (stream == null) { + return null; + } + + T result = getDataFromStream(type, stream); + return result; + } + + @Override + public <T> T[] getDatas(Class<T> type, Object... args) throws RedmineServiceException { + checkInit(); + + InputStream stream = getDatasStream(type, args); + + if (stream == null) { + return null; + } + + T[] result = getDatasFromStream(type, stream); + return result; + } + + @Override + public <T> InputStream getDataStream(Class<T> type, Object... args) throws RedmineServiceException { + + InputStream stream = getDataStream(type, false, args); + return stream; + } + + @Override + public <T> InputStream getDatasStream(Class<T> type, Object... args) throws RedmineServiceException { + + InputStream stream = getDataStream(type, true, args); + return stream; + } + + /////////////////////////////////////////////////////////////////////////// + /// Internal methods + /////////////////////////////////////////////////////////////////////////// + protected <T> InputStream getDataStream(Class<T> type, boolean array, Object... args) throws RedmineServiceException { + + String requestName = type.getName() + (array ? "list" : "detail"); + RestRequest r = getRequest(requestName, args); + + // obtain data from rest session + try { + + InputStream stream = session.askData(r); + return stream; + } catch (Exception e) { + throw new RedmineServiceException("could not botain data stream for type " + type + " 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 { + + try { + T result = xpp3Helper.readObject(type, stream); + return result; + } catch (IOException ex) { + throw new RedmineServiceException("could not obtain datas of type " + type + " for reason " + ex.getMessage(), ex); + } catch (XmlPullParserException 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 { + + try { + T[] result = xpp3Helper.readObjects(type, stream); + return result; + } catch (IOException ex) { + throw new RedmineServiceException("could not obtain datas of type " + type + " for reason " + ex.getMessage(), ex); + } catch (XmlPullParserException 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!"); + } + } +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineService.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineService.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineService.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineService.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,58 @@ +package org.nuiton.jredmine; + +import org.nuiton.jredmine.model.Attachment; +import org.nuiton.jredmine.model.Issue; +import org.nuiton.jredmine.model.IssueCategory; +import org.nuiton.jredmine.model.IssuePriority; +import org.nuiton.jredmine.model.IssueStatus; +import org.nuiton.jredmine.model.News; +import org.nuiton.jredmine.model.Project; +import org.nuiton.jredmine.model.Tracker; +import org.nuiton.jredmine.model.User; +import org.nuiton.jredmine.model.Version; + +/** + * The service that mirrors the rails redmine_rest plugin api. + * + * TODO javadoc + * + * @author chemit + * @since 1.0.0 + */ +public interface RedmineService { + + /** Plexus lookup name */ + String ROLE = RedmineService.class.getName(); + + Project[] getProjects() throws RedmineServiceException; + + IssuePriority[] getIssuePriorities() throws RedmineServiceException; + + IssueStatus[] getIssueStatuses() throws RedmineServiceException; + + Project getProject(String projectId) throws RedmineServiceException; + + IssueCategory[] getIssueCategories(String projectId) throws RedmineServiceException; + + Tracker[] getTrackers(String projectId) throws RedmineServiceException; + + News[] getNews(String projectId) throws RedmineServiceException; + + User[] getUsers(String projectId) throws RedmineServiceException; + + Version[] getVersions(String projectId) throws RedmineServiceException; + + Version getVersion(String projectId, String versionId) throws RedmineServiceException; + + Issue[] getIssues(String projectId, String versionId) throws RedmineServiceException; + + Attachment[] getAttachments(String projectId, String versionId) throws RedmineServiceException; + + Version addVersion(String projectId, Version version) throws RedmineServiceException; + + Version updateVersion(String projectId, Version version) throws RedmineServiceException; + + News addNews(String projectId, News news) throws RedmineServiceException; + + Attachment addAttachment(String projectId, String versionId, Attachment attachement) throws RedmineServiceException; +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineService.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceException.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceException.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceException.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,27 @@ +package org.nuiton.jredmine; + +/** + * An exception to throw when something is wrong in a {@link StorageService}. + * + * @author chemit + * @since 1.0.0 + */ +public class RedmineServiceException extends Exception { + + private static final long serialVersionUID = 1L; + + public RedmineServiceException(Throwable cause) { + super(cause); + } + + public RedmineServiceException(String message, Throwable cause) { + super(message, cause); + } + + public RedmineServiceException(String message) { + super(message); + } + + public RedmineServiceException() { + } +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceException.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,30 @@ +package org.nuiton.jredmine; + +import java.io.InputStream; +import org.nuiton.io.rest.RestClientConfiguration; +import org.nuiton.jredmine.rest.RedmineRestClient; + +/** + * Technical contrat te be implemented in a {@link RedmineService}. + * + * @author chemit + * @since 1.0.0 + */ +public interface RedmineServiceImplementor { + + boolean isInit(); + + RedmineServiceImplementor init(RedmineRestClient session) throws RedmineServiceException; + + RedmineServiceImplementor init(RestClientConfiguration configuration) throws RedmineServiceException; + + void destroy() throws RedmineServiceException; + + <T> T getData(Class<T> type, Object... args) throws RedmineServiceException; + + <T> T[] getDatas(Class<T> type, Object... args) throws RedmineServiceException; + + <T> InputStream getDataStream(Class<T> type, Object... args) throws RedmineServiceException; + + <T> InputStream getDatasStream(Class<T> type, Object... args) throws RedmineServiceException; +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/Attachment.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/Attachment.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/Attachment.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,143 @@ +package org.nuiton.jredmine.model; + +import java.io.File; +import java.util.Date; + +/** + * A file attachment from redmine server. + * + * @author chemit + * @since 1.0.0 + */ +public class Attachment implements IdAble { + +// public static Attachment getAttachmentById(Integer attachmentId, Attachment[] list) { +// for (Attachment i : list) { +// if (i.getId() == attachmentId) { +// return i; +// } +// } +// return null; +// } + protected int id; + protected int authorId; + protected int containerId; + protected int filesize; + protected int downloads; + protected Date createdOn; + protected String containerType; + protected String contentType; + protected String description; + protected String digest; + protected String diskFilename; + protected String filename; + /** + * not from redmine but to redmine (file to attach) + */ + protected File toUpload; + + public int getAuthorId() { + return authorId; + } + + public int getContainerId() { + return containerId; + } + + public String getContainerType() { + return containerType; + } + + public String getContentType() { + return contentType; + } + + public Date getCreatedOn() { + return createdOn; + } + + public String getDescription() { + return description; + } + + public String getDigest() { + return digest; + } + + public String getDiskFilename() { + return diskFilename; + } + + public int getDownloads() { + return downloads; + } + + public String getFilename() { + return filename; + } + + public int getFilesize() { + return filesize; + } + + @Override + public int getId() { + return id; + } + + public File getToUpload() { + return toUpload; + } + + public void setAuthorId(int authorId) { + this.authorId = authorId; + } + + public void setContainerId(int containerId) { + this.containerId = containerId; + } + + public void setContainerType(String containerType) { + this.containerType = containerType; + } + + public void setContentType(String contentType) { + this.contentType = contentType; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + public void setDescription(String description) { + this.description = description; + } + + public void setDigest(String digest) { + this.digest = digest; + } + + public void setDiskFilename(String diskFilename) { + this.diskFilename = diskFilename; + } + + public void setDownloads(int downloads) { + this.downloads = downloads; + } + + public void setFilename(String filename) { + this.filename = filename; + } + + public void setFilesize(int filesize) { + this.filesize = filesize; + } + + public void setId(int id) { + this.id = id; + } + + public void setToUpload(File toUpload) { + this.toUpload = toUpload; + } +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/Attachment.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/I18nAble.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/I18nAble.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/I18nAble.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,12 @@ +package org.nuiton.jredmine.model; + +/** + * Alls object offers an name. + * + * @author chemit + * @since 1.0.0 + */ +public interface I18nAble { + + String getName(); +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/I18nAble.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/IdAble.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/IdAble.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/IdAble.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,12 @@ +package org.nuiton.jredmine.model; + +/** + * Alls object offers an id. + * + * @author chemit + * @since 1.0.0 + */ +public interface IdAble { + + int getId(); +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/IdAble.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/Issue.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/Issue.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/Issue.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,204 @@ +package org.nuiton.jredmine.model; + +import java.util.Date; + +/** + * An issue on redmine's server. + * + * @author chemit + * @since 1.0.0 + */ +public class Issue implements IdAble { +// +// public static Issue[] filterByTrackerId(int trackerId, Issue... issues) { +// List<Issue> result = new ArrayList<Issue>(); +// for (Issue i : issues) { +// if (i.getTrackerId() == trackerId) { +// result.add(i); +// } +// } +// return result.toArray(new Issue[result.size()]); +// } +// +// public static Issue[] filterByVersionId(int versionId, Issue... issues) { +// List<Issue> result = new ArrayList<Issue>(); +// for (Issue i : issues) { +// if (i.getFixedVersionId() == versionId) { +// result.add(i); +// } +// } +// return result.toArray(new Issue[result.size()]); +// } +// +// public static Issue getIssueById(int id, Issue... issues) { +// for (Issue i : issues) { +// if (i.getId() == id) { +// return i; +// } +// } +// return null; +// } + protected int assignedToId; + protected int authorId; + protected int categoryId; + protected int doneRatio; + protected int lockVersion; + protected int priorityId; + protected int projectId; + protected int statusId; + protected int trackerId; + protected int fixedVersionId; + protected int id; + protected float estimatedHours; + protected Date createdOn; + protected Date updatedOn; + protected Date dueDate; + protected Date startDate; + protected String description; + protected String subject; + + public int getAssignedToId() { + return assignedToId; + } + + public int getAuthorId() { + return authorId; + } + + public int getCategoryId() { + return categoryId; + } + + public Date getCreatedOn() { + return createdOn; + } + + public String getDescription() { + return description; + } + + public int getDoneRatio() { + return doneRatio; + } + + public Date getDueDate() { + return dueDate; + } + + public float getEstimatedHours() { + return estimatedHours; + } + + public int getFixedVersionId() { + return fixedVersionId; + } + + @Override + public int getId() { + return id; + } + + public int getLockVersion() { + return lockVersion; + } + + public int getPriorityId() { + return priorityId; + } + + public int getProjectId() { + return projectId; + } + + public Date getStartDate() { + return startDate; + } + + public int getStatusId() { + return statusId; + } + + public String getSubject() { + return subject; + } + + public int getTrackerId() { + return trackerId; + } + + public Date getUpdatedOn() { + return updatedOn; + } + + public void setAssignedToId(int assignedToId) { + this.assignedToId = assignedToId; + } + + public void setAuthorId(int authorId) { + this.authorId = authorId; + } + + public void setCategoryId(int categoryId) { + this.categoryId = categoryId; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + public void setDescription(String description) { + this.description = description; + } + + public void setDoneRatio(int doneRatio) { + this.doneRatio = doneRatio; + } + + public void setDueDate(Date dueDate) { + this.dueDate = dueDate; + } + + public void setEstimatedHours(float estimatedHours) { + this.estimatedHours = estimatedHours; + } + + public void setFixedVersionId(int fixedVersionId) { + this.fixedVersionId = fixedVersionId; + } + + public void setId(int id) { + this.id = id; + } + + public void setLockVersion(int lockVersion) { + this.lockVersion = lockVersion; + } + + public void setPriorityId(int priorityId) { + this.priorityId = priorityId; + } + + public void setProjectId(int projectId) { + this.projectId = projectId; + } + + public void setStartDate(Date startDate) { + this.startDate = startDate; + } + + public void setStatusId(int statusId) { + this.statusId = statusId; + } + + public void setSubject(String subject) { + this.subject = subject; + } + + public void setTrackerId(int trackerId) { + this.trackerId = trackerId; + } + + public void setUpdatedOn(Date updatedOn) { + this.updatedOn = updatedOn; + } +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/Issue.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/IssueCategory.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/IssueCategory.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/IssueCategory.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,56 @@ +package org.nuiton.jredmine.model; + +/** + * + * @author chemit + * @since 1.0.0 + */ +public class IssueCategory implements IdAble, I18nAble { +// +// public static IssueCategory getIssueCategoryById(Integer id, IssueCategory... categories) { +// for (IssueCategory u : categories) { +// if (u.getId() == id) { +// return u; +// } +// } +// return null; +// } + protected int projectId; + protected int assignedToId; + protected int id; + protected String name; + + public int getAssignedToId() { + return assignedToId; + } + + @Override + public int getId() { + return id; + } + + @Override + public String getName() { + return name; + } + + public int getProjectId() { + return projectId; + } + + public void setAssignedToId(int assigneToId) { + this.assignedToId = assigneToId; + } + + public void setId(int id) { + this.id = id; + } + + public void setName(String name) { + this.name = name; + } + + public void setProjectId(int projectId) { + this.projectId = projectId; + } +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/IssueCategory.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/IssuePriority.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/IssuePriority.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/IssuePriority.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,57 @@ +package org.nuiton.jredmine.model; + +/** + * + * @author chemit + * @since 1.0.0 + */ +public class IssuePriority implements IdAble,I18nAble{ + + protected int id; + protected boolean isDefault; + protected String name; + protected String opt; + protected int position; + + @Override + public int getId() { + return id; + } + + public boolean isIsDefault() { + return isDefault; + } + + @Override + public String getName() { + return name; + } + + public String getOpt() { + return opt; + } + + public int getPosition() { + return position; + } + + public void setId(int id) { + this.id = id; + } + + public void setIsDefault(boolean isDefault) { + this.isDefault = isDefault; + } + + public void setName(String name) { + this.name = name; + } + + public void setOpt(String opt) { + this.opt = opt; + } + + public void setPosition(int position) { + this.position = position; + } +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/IssuePriority.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/IssueStatus.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/IssueStatus.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/IssueStatus.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,65 @@ +package org.nuiton.jredmine.model; + +/** + * + * @author chemit + * @since 1.0.0 + */ +public class IssueStatus implements IdAble, I18nAble { +// +// public static IssueStatus getIssueStatusById(Integer id, IssueStatus... statuses) { +// for (IssueStatus u : statuses) { +// if (u.getId() == id) { +// return u; +// } +// } +// return null; +// } + protected int id; + protected int position; + protected boolean isClosed; + protected boolean isDefault; + protected String name; + + @Override + public int getId() { + return id; + } + + public boolean isIsClosed() { + return isClosed; + } + + public boolean isIsDefault() { + return isDefault; + } + + @Override + public String getName() { + return name; + } + + public int getPosition() { + return position; + } + + public void setId(int id) { + this.id = id; + } + + public void setIsClosed(boolean isClosed) { + this.isClosed = isClosed; + } + + public void setIsDefault(boolean isDefault) { + this.isDefault = isDefault; + } + + public void setName(String name) { + this.name = name; + } + + public void setPosition(int position) { + this.position = position; + } +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/IssueStatus.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/ModelHelper.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/ModelHelper.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/ModelHelper.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,74 @@ +package org.nuiton.jredmine.model; + +import java.lang.reflect.Array; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * Some usefull methods on redmine's entities, mainly to filter datas. + * + * @author chemit + * @since 1.0.0 + */ +public class ModelHelper { + + public static <T extends IdAble> T byId(int id, T... datas) { + for (T data : datas) { + if (data.getId() == id) { + return data; + } + } + return null; + } + + public static User byLogin(String login, User... users) { + for (User u : users) { + if (u.getLogin().equals(login)) { + return u; + } + } + return null; + } + + public static Version byVersionName(String name, Version... versions) { + for (Version u : versions) { + if (u.getName().equals(name)) { + return u; + } + } + return null; + } + + public static Issue[] byTrackerId(int trackerId, Issue... issues) { + List<Issue> result = new ArrayList<Issue>(); + for (Issue i : issues) { + if (i.getTrackerId() == trackerId) { + result.add(i); + } + } + return result.toArray(new Issue[result.size()]); + } + + public static Issue[] byVersionId(int versionId, Issue... issues) { + List<Issue> result = new ArrayList<Issue>(); + for (Issue i : issues) { + if (i.getFixedVersionId() == versionId) { + result.add(i); + } + } + return result.toArray(new Issue[result.size()]); + } + + public static <T extends IdAble> T[] byIds(Class<T> type, T[] result, Integer... ids) { + + List<Integer> lIds = Arrays.asList(ids); + List<T> filter = new ArrayList<T>(lIds.size()); + for (T v : result) { + if (lIds.contains(v.getId())) { + filter.add(v); + } + } + return filter.toArray((T[]) Array.newInstance(type, filter.size())); + } +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/ModelHelper.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/News.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/News.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/News.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,85 @@ +package org.nuiton.jredmine.model; + +import java.util.Date; + +/** + * + * @author chemit + * @since 1.0.0 + */ +public class News implements IdAble { + + protected int id; + protected int projectId; + protected int authorId; + protected int commentsCount; + protected String description; + protected String title; + protected String summary; + protected Date createdOn; + + @Override + public int getId() { + return id; + } + + public int getAuthorId() { + return authorId; + } + + public int getCommentsCount() { + return commentsCount; + } + + public Date getCreatedOn() { + return createdOn; + } + + public String getDescription() { + return description; + } + + public int getProjectId() { + return projectId; + } + + public String getSummary() { + return summary; + } + + public String getTitle() { + return title; + } + + public void setAuthorId(int authorId) { + this.authorId = authorId; + } + + public void setCommentsCount(int commentsCount) { + this.commentsCount = commentsCount; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + public void setDescription(String description) { + this.description = description; + } + + public void setId(int id) { + this.id = id; + } + + public void setProjectId(int projectId) { + this.projectId = projectId; + } + + public void setSummary(String summary) { + this.summary = summary; + } + + public void setTitle(String title) { + this.title = title; + } +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/News.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/Project.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/Project.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/Project.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,114 @@ +package org.nuiton.jredmine.model; + +import java.util.Date; + +/** + * redmine project + * + * @author chemit + * @since 1.0.0 + */ +public class Project implements IdAble, I18nAble { + + protected Date createdOn; + protected Date updatedOn; + protected String description; + protected String homepage; + protected String identifier; + protected String name; + protected int id; + protected int parentId; + protected int projectsCount; + protected int status; + protected boolean isPublic; + + public Date getCreatedOn() { + return createdOn; + } + + public String getDescription() { + return description; + } + + public String getHomepage() { + return homepage; + } + + @Override + public int getId() { + return id; + } + + public String getIdentifier() { + return identifier; + } + + public boolean isIsPublic() { + return isPublic; + } + + @Override + public String getName() { + return name; + } + + public int getParentId() { + return parentId; + } + + public int getProjectsCount() { + return projectsCount; + } + + public Date getUpdatedOn() { + return updatedOn; + } + + public int getStatus() { + return status; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + public void setDescription(String description) { + this.description = description; + } + + public void setHomepage(String homepage) { + this.homepage = homepage; + } + + public void setId(int id) { + this.id = id; + } + + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + public void setIsPublic(boolean ispublic) { + this.isPublic = ispublic; + } + + public void setName(String name) { + this.name = name; + } + + public void setParentId(int parentId) { + this.parentId = parentId; + } + + public void setProjectsCount(int projectsCount) { + this.projectsCount = projectsCount; + } + + public void setUpdatedOn(Date updatedOn) { + this.updatedOn = updatedOn; + } + + public void setStatus(int status) { + this.status = status; + } +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/Project.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,60 @@ +package org.nuiton.jredmine.model; + +/** + * Un énumération pour connaitre l'ensemble des classes du modèle. + * + * @author chemit + * @since 1.0.0 + */ +public enum RedmineModelEnum { + + issueStatus(IssueStatus.class, RedmineModelScope.none), + issuePriority(IssuePriority.class, RedmineModelScope.none), + project(Project.class, RedmineModelScope.none), + issueCategory(IssueCategory.class, RedmineModelScope.project), + tracker(Tracker.class, RedmineModelScope.project), + user(User.class, RedmineModelScope.project), + news(News.class, RedmineModelScope.project), + version(Version.class, RedmineModelScope.project), + issue(Issue.class, RedmineModelScope.version), + attachment(Attachment.class, RedmineModelScope.version); + private final Class<?> modelType; + private final RedmineModelScope scope; + + private RedmineModelEnum(Class<?> modelType, RedmineModelScope scope) { + this.modelType = modelType; + this.scope = scope; + } + + public Class<?> getModelType() { + return modelType; + } + + public RedmineModelScope getScope() { + return scope; + } + + public static RedmineModelEnum valueOf(Class<?> type) { + for (RedmineModelEnum e : values()) { + if (type == e.getModelType()) { + return e; + } + } + return null; + } + + public static RedmineModelEnum safeValueOf(Class<?> type) { + if (type == null) { + throw new NullPointerException("klass parameter can not be null"); + } + + // check dataType is authorized + + RedmineModelEnum r = valueOf(type); + if (r == null) { + throw new IllegalArgumentException("the type " + type.getName() + " is not allowed!"); + } + + return r; + } +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelScope.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelScope.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelScope.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,34 @@ +package org.nuiton.jredmine.model; + +/** + * + * Une enumeration pour caracteriser le scope d'une donnée dans le modèle. + * + * <p/> + * Pour une donnée qui ne dépend de rien, elle est en scope {@link #none}. + * <p/> + * Pour une donnée qui dépend d'un projet, elle est en scope {@link #project}. + * <p/> + * Pour une donnée qui dépend d'une version, elle est en scpoe {@link #version}. + * + * A savoir qu'une donnée de scope {@link #version}, elle est aussi de scope + * {@link #project} car la version dépend en dépend. + * + * @author chemit + * @since 1.0.0 + */ +public enum RedmineModelScope { + + /** + * none scope, requires nothing + */ + none, + /** + * project scope, requires a project + */ + project, + /** + * version scope, requires a project and a version + */ + version +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelScope.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/Tracker.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/Tracker.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/Tracker.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,83 @@ +package org.nuiton.jredmine.model; + +/** + * + * @author chemit + * @since 1.0.0 + */ +public class Tracker implements IdAble, I18nAble { +// +// public static Tracker getTrackerById(int id,Tracker... trackers) { +// for (Tracker u : trackers) { +// if (u.getId() == id) { +// return u; +// } +// } +// return null; +// } + protected int id; + protected int projectId; + protected int trackerId; + protected int position; + protected boolean isInChlog; + protected boolean isInRoadmap; + protected String name; + + @Override + public int getId() { + return id; + } + + public boolean isIsInChlog() { + return isInChlog; + } + + public boolean isIsInRoadmap() { + return isInRoadmap; + } + + @Override + public String getName() { + return name; + } + + public int getPosition() { + return position; + } + + public int getProjectId() { + return projectId; + } + + public int getTrackerId() { + return trackerId; + } + + public void setId(int id) { + this.id = id; + } + + public void setIsInChlog(boolean isInChlog) { + this.isInChlog = isInChlog; + } + + public void setIsInRoadmap(boolean isInRoadmap) { + this.isInRoadmap = isInRoadmap; + } + + public void setName(String name) { + this.name = name; + } + + public void setPosition(int position) { + this.position = position; + } + + public void setProjectId(int projectId) { + this.projectId = projectId; + } + + public void setTrackerId(int trackerId) { + this.trackerId = trackerId; + } +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/Tracker.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/User.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/User.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/User.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,180 @@ +package org.nuiton.jredmine.model; + +import java.util.Date; + +/** + * + * @author chemit + * + * @since 1.0.0 + */ +public class User implements IdAble, I18nAble { +// +// public static User getUserByLogin(String login, User... users) { +// for (User u : users) { +// if (u.getLogin().equals(login)) { +// return u; +// } +// } +// return null; +// } +// +// public static User getUserById(int id, User... users) { +// for (User u : users) { +// if (u.getId() == id) { +// return u; +// } +// } +// return null; +// } + protected boolean admin; + protected boolean mailNotification; + protected int id; + protected int authSourceId; + protected int memberId; + protected int roleId; + protected int status; + protected Date createdOn; + protected Date updatedOn; + protected Date lastLoginOn; + protected String firstname; + protected String lastname; + protected String login; + protected String language; + protected String mail; + protected String hashedPassword; + + public boolean isAdmin() { + return admin; + } + + public int getAuthSourceId() { + return authSourceId; + } + + public Date getCreatedOn() { + return createdOn; + } + + public String getMail() { + return mail; + } + + public String getFirstname() { + return firstname; + } + + public String getHashedPassword() { + return hashedPassword; + } + + @Override + public int getId() { + return id; + } + + public String getLanguage() { + return language; + } + + public Date getLastLoginOn() { + return lastLoginOn; + } + + public String getLastname() { + return lastname; + } + + public String getLogin() { + return login; + } + + public boolean isMailNotification() { + return mailNotification; + } + + public int getMemberId() { + return memberId; + } + + public int getRoleId() { + return roleId; + } + + public int getStatus() { + return status; + } + + public Date getUpdatedOn() { + return updatedOn; + } + + public void setAdmin(boolean admin) { + this.admin = admin; + } + + public void setAuthSourceId(int authSourceId) { + this.authSourceId = authSourceId; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + public void setMail(String email) { + this.mail = email; + } + + public void setFirstname(String firstname) { + this.firstname = firstname; + } + + public void setHashedPassword(String hashedPassword) { + this.hashedPassword = hashedPassword; + } + + public void setId(int id) { + this.id = id; + } + + public void setLanguage(String language) { + this.language = language; + } + + public void setLastLoginOn(Date lastLoginOn) { + this.lastLoginOn = lastLoginOn; + } + + public void setLastname(String lastname) { + this.lastname = lastname; + } + + public void setLogin(String login) { + this.login = login; + } + + public void setMailNotification(boolean mailNotification) { + this.mailNotification = mailNotification; + } + + public void setMemberId(int memberId) { + this.memberId = memberId; + } + + public void setRoleId(int roleId) { + this.roleId = roleId; + } + + public void setStatus(int status) { + this.status = status; + } + + public void setUpdatedOn(Date updatedOn) { + this.updatedOn = updatedOn; + } + + @Override + public String getName() { + return firstname + " " + lastname; + } +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/User.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/Version.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/Version.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/Version.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,103 @@ +package org.nuiton.jredmine.model; + +import java.util.Date; + +/** + * + * @author chemit + * @since 1.0.0 + */ +public class Version implements IdAble, I18nAble { +// +// public static Version getVersionByName(String login, Version... versions) { +// for (Version u : versions) { +// if (u.getName().equals(login)) { +// return u; +// } +// } +// return null; +// } +// +// public static Version getVersionById(int id, Version... versions) { +// for (Version u : versions) { +// if (u.getId() == id) { +// return u; +// } +// } +// return null; +// } + protected Date createdOn; + protected Date updatedOn; + protected Date effectiveDate; + protected String name; + protected String description; + protected String wikiPageTitle; + protected int id; + protected int projectId; + + public Date getCreatedOn() { + return createdOn; + } + + public String getDescription() { + return description; + } + + public Date getEffectiveDate() { + return effectiveDate; + } + + @Override + public int getId() { + return id; + } + + @Override + public String getName() { + return name; + } + + public int getProjectId() { + return projectId; + } + + public Date getUpdatedOn() { + return updatedOn; + } + + public String getWikiPageTitle() { + return wikiPageTitle; + } + + public void setCreatedOn(Date createdOn) { + this.createdOn = createdOn; + } + + public void setDescription(String description) { + this.description = description; + } + + public void setEffectiveDate(Date effectiveDate) { + this.effectiveDate = effectiveDate; + } + + public void setId(int id) { + this.id = id; + } + + public void setName(String name) { + this.name = name; + } + + public void setProjectId(int projectId) { + this.projectId = projectId; + } + + public void setUpdatedOn(Date updatedOn) { + this.updatedOn = updatedOn; + } + + public void setWikiPageTitle(String wikiPagetitle) { + this.wikiPageTitle = wikiPagetitle; + } +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/Version.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/AttachmentXpp3Reader.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/AttachmentXpp3Reader.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/AttachmentXpp3Reader.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,41 @@ +package org.nuiton.jredmine.model.io.xpp3; + +import java.beans.IntrospectionException; +import org.nuiton.io.xpp3.AbstractXpp3Reader; +import org.nuiton.jredmine.model.Attachment; +import static org.nuiton.io.xpp3.Xpp3Helper.addTagTextContentMappers; + +/** + * {@link Attachment} reader. + * + * @author chemit + * @since 1.0.0 + */ +public class AttachmentXpp3Reader extends AbstractXpp3Reader<Attachment> { + + public AttachmentXpp3Reader() { + super(Attachment.class, "attachments", "attachment"); + } + + @Override + protected void initMappers() throws IntrospectionException { + + addTagTextContentMappers(Attachment.class, RedmineDataConverter.Integer, true, allMappers, + "author-id", + "container-id", + "filesize", + "downloads", + "id"); + + addTagTextContentMappers(Attachment.class, RedmineDataConverter.Datetime, true, allMappers, + "created-on"); + + addTagTextContentMappers(Attachment.class, RedmineDataConverter.Text, true, allMappers, + "container-type", + "content-type", + "description", + "digest", + "disk-filename", + "filename"); + } +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/AttachmentXpp3Reader.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueCategoryXpp3Reader.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueCategoryXpp3Reader.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueCategoryXpp3Reader.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,32 @@ +package org.nuiton.jredmine.model.io.xpp3; + +import java.beans.IntrospectionException; +import org.nuiton.io.xpp3.AbstractXpp3Reader; +import org.nuiton.jredmine.model.Issue; +import org.nuiton.jredmine.model.IssueCategory; +import static org.nuiton.io.xpp3.Xpp3Helper.addTagTextContentMappers; + +/** + * {@link Issue} reader. + * + * @author chemit + * @since 1.0.0 + */ +public class IssueCategoryXpp3Reader extends AbstractXpp3Reader<IssueCategory> { + + public IssueCategoryXpp3Reader() { + super(IssueCategory.class, "issue-categories", "issue-category"); + } + + @Override + protected void initMappers() throws IntrospectionException { + + addTagTextContentMappers(IssueCategory.class, RedmineDataConverter.Integer, true, allMappers, + "project-id", + "assigned-to-id", + "id"); + + addTagTextContentMappers(IssueCategory.class, RedmineDataConverter.Text, true, allMappers, + "name"); + } +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueCategoryXpp3Reader.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssuePriorityXpp3Reader.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssuePriorityXpp3Reader.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssuePriorityXpp3Reader.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,36 @@ +package org.nuiton.jredmine.model.io.xpp3; + +import java.beans.IntrospectionException; +import org.nuiton.io.xpp3.AbstractXpp3Reader; +import org.nuiton.jredmine.model.Issue; +import org.nuiton.jredmine.model.IssuePriority; +import static org.nuiton.io.xpp3.Xpp3Helper.addTagTextContentMappers; + +/** + * {@link Issue} reader. + * + * @author chemit + * @since 1.0.0 + */ +public class IssuePriorityXpp3Reader extends AbstractXpp3Reader<IssuePriority> { + + public IssuePriorityXpp3Reader() { + super(IssuePriority.class, "enumerations", "enumeration"); + } + + @Override + protected void initMappers() throws IntrospectionException { + + + addTagTextContentMappers(IssuePriority.class, RedmineDataConverter.Integer, true, allMappers, + "id", + "position"); + + addTagTextContentMappers(IssuePriority.class, RedmineDataConverter.Boolean, true, allMappers, + "is-default"); + + addTagTextContentMappers(IssuePriority.class, RedmineDataConverter.Text, true, allMappers, + "name", + "opt"); + } +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssuePriorityXpp3Reader.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueStatusXpp3Reader.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueStatusXpp3Reader.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueStatusXpp3Reader.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,35 @@ +package org.nuiton.jredmine.model.io.xpp3; + +import java.beans.IntrospectionException; +import org.nuiton.io.xpp3.AbstractXpp3Reader; +import org.nuiton.jredmine.model.Issue; +import org.nuiton.jredmine.model.IssueStatus; +import static org.nuiton.io.xpp3.Xpp3Helper.addTagTextContentMappers; + +/** + * {@link Issue} reader. + * + * @author chemit + * @since 1.0.0 + */ +public class IssueStatusXpp3Reader extends AbstractXpp3Reader<IssueStatus> { + + public IssueStatusXpp3Reader() { + super(IssueStatus.class, "issue-statuses", "issue-status"); + } + + @Override + protected void initMappers() throws IntrospectionException { + + addTagTextContentMappers(IssueStatus.class, RedmineDataConverter.Integer, true, allMappers, + "id", + "position"); + + addTagTextContentMappers(IssueStatus.class, RedmineDataConverter.Boolean, true, allMappers, + "is-closed", + "is-default"); + + addTagTextContentMappers(IssueStatus.class, RedmineDataConverter.Text, true, allMappers, + "name"); + } +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueStatusXpp3Reader.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueXpp3Reader.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueXpp3Reader.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueXpp3Reader.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,51 @@ +package org.nuiton.jredmine.model.io.xpp3; + +import java.beans.IntrospectionException; +import org.nuiton.io.xpp3.AbstractXpp3Reader; +import org.nuiton.jredmine.model.Issue; +import static org.nuiton.io.xpp3.Xpp3Helper.addTagTextContentMappers; + +/** + * {@link Issue} reader. + * + * @author chemit + * @since 1.0.0 + */ +public class IssueXpp3Reader extends AbstractXpp3Reader<Issue> { + + public IssueXpp3Reader() { + super(Issue.class, "issues", "issue"); + } + + @Override + protected void initMappers() throws IntrospectionException { + + addTagTextContentMappers(Issue.class, RedmineDataConverter.Integer, true, allMappers, + "assigned-to-id", + "author-id", + "category-id", + "done-ratio", + "lock-version", + "priority-id", + "project-id", + "status-id", + "tracker-id", + "fixed-version-id", + "id"); + + addTagTextContentMappers(Issue.class, RedmineDataConverter.Float, true, allMappers, + "estimated-hours"); + + addTagTextContentMappers(Issue.class, RedmineDataConverter.Datetime, true, allMappers, + "created-on", + "updated-on"); + + addTagTextContentMappers(Issue.class, RedmineDataConverter.Date, true, allMappers, + "due-date", + "start-date"); + + addTagTextContentMappers(Issue.class, RedmineDataConverter.Text, true, allMappers, + "description", + "subject"); + } +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/IssueXpp3Reader.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/NewsXpp3Reader.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/NewsXpp3Reader.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/NewsXpp3Reader.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,37 @@ +package org.nuiton.jredmine.model.io.xpp3; + +import java.beans.IntrospectionException; +import org.nuiton.io.xpp3.AbstractXpp3Reader; +import org.nuiton.jredmine.model.News; + +import static org.nuiton.io.xpp3.Xpp3Helper.addTagTextContentMappers; + +/** + * + * @author chemit + * @since 1.0.0 + */ +public class NewsXpp3Reader extends AbstractXpp3Reader<News> { + + public NewsXpp3Reader() { + super(News.class, "news", "news"); + } + + @Override + protected void initMappers() throws IntrospectionException { + + addTagTextContentMappers(News.class, RedmineDataConverter.Integer, true, allMappers, + "id", + "author-id", + "project-id", + "comments-count"); + + addTagTextContentMappers(News.class, RedmineDataConverter.Datetime, true, allMappers, + "created-on"); + + addTagTextContentMappers(News.class, RedmineDataConverter.Text, true, allMappers, + "description", + "summary", + "title"); + } +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/NewsXpp3Reader.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectXpp3Reader.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectXpp3Reader.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectXpp3Reader.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,42 @@ +package org.nuiton.jredmine.model.io.xpp3; + +import java.beans.IntrospectionException; +import org.nuiton.io.xpp3.AbstractXpp3Reader; +import org.nuiton.jredmine.model.Project; +import static org.nuiton.io.xpp3.Xpp3Helper.addTagTextContentMappers; + +/** + * {@link Project} reader. + * + * @author chemit + * @since 1.0.0 + */ +public class ProjectXpp3Reader extends AbstractXpp3Reader<Project> { + + public ProjectXpp3Reader() { + super(Project.class, "projects", "project"); + } + + @Override + protected void initMappers() throws IntrospectionException { + + addTagTextContentMappers(Project.class, RedmineDataConverter.Integer, true, allMappers, + "id", + "parent-id", + "projects-count", + "status"); + + addTagTextContentMappers(Project.class, RedmineDataConverter.Boolean, true, allMappers, + "is-public"); + + addTagTextContentMappers(Project.class, RedmineDataConverter.Datetime, true, allMappers, + "created-on", + "updated-on"); + + addTagTextContentMappers(Project.class, RedmineDataConverter.Text, true, allMappers, + "description", + "homepage", + "identifier", + "name"); + } +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/ProjectXpp3Reader.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineDataConverter.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineDataConverter.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineDataConverter.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,87 @@ +package org.nuiton.jredmine.model.io.xpp3; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Locale; +import org.nuiton.io.xpp3.DataConverter; + +/** + * A enumaration to convert some data from a string representation. + * + * Can not use directly a converter from commons-beans library, since we have + * several different converter to use for same type (see {@link #Date} and + * {@link #Datetime}). + * + * @author chemit + * @since 1.0.0 + */ +public enum RedmineDataConverter implements DataConverter { + + Boolean { + + @Override + public Object convert(String t) throws Exception { + Object r = java.lang.Boolean.valueOf(t); + return r; + } + }, Short { + + @Override + public Object convert(String t) throws Exception { + Object r = java.lang.Short.valueOf(t); + return r; + } + }, Integer { + + @Override + public Object convert(String t) throws Exception { + Object r = java.lang.Integer.valueOf(t); + return r; + } + }, Long { + + @Override + public Object convert(String t) throws Exception { + Object r = java.lang.Long.valueOf(t); + return r; + } + }, Float { + + @Override + public Object convert(String t) throws Exception { + Object r = java.lang.Float.valueOf(t); + return r; + } + }, Double { + + @Override + public Object convert(String t) throws Exception { + Object r = java.lang.Double.valueOf(t); + return r; + } + }, Date { + + @Override + public Object convert(String t) throws Exception { + Object r = dateParser.parse(t); + return r; + } + }, Datetime { + + @Override + public Object convert(String t) throws Exception { + Object r = datetimeParser.parse(t); + return r; + } + }, Text { + + @Override + public Object convert(String t) throws Exception { + return t; + } + }; + //FIXME TC20090907 this a a big hack (the + party) redmine returns us a timezone + // in a format we can not deal with (+hh:mm), so actually, ignore it... + static final DateFormat datetimeParser = new SimpleDateFormat("yyyy-MM-dd\'T\'HH:mm:ss\'+\'SS\':\'SS", Locale.US); + static final DateFormat dateParser = new SimpleDateFormat("yyyy-MM-dd", Locale.US); +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineDataConverter.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3Helper.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3Helper.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3Helper.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,58 @@ +package org.nuiton.jredmine.model.io.xpp3; + +import java.io.ByteArrayInputStream; +import org.codehaus.plexus.util.ReaderFactory; +import org.codehaus.plexus.util.xml.pull.XmlPullParserException; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import org.nuiton.io.xpp3.Xpp3Helper; +import org.nuiton.jredmine.model.RedmineModelEnum; + +/** + * Pour construire le modèle à partir de fichiers xml contenant les données. + * + * @author chemit + * @since 1.0.0 + */ +public class RedmineXpp3Helper { + + public <O> O readObject(Class<O> klass, String txt) throws IOException, XmlPullParserException { + O result = readObject(klass, new ByteArrayInputStream(txt.getBytes())); + return result; + } + + public <O> O[] readObjects(Class<O> klass, String txt) throws IOException, XmlPullParserException { + O[] results = readObjects(klass, new ByteArrayInputStream(txt.getBytes())); + return results; + } + + public <O> O readObject(Class<O> klass, File file) throws IOException, XmlPullParserException { + O result = readObject(klass, new FileInputStream(file)); + return result; + } + + public <O> O[] readObjects(Class<O> klass, File file) throws IOException, XmlPullParserException { + O[] results = readObjects(klass, new FileInputStream(file)); + return results; + } + + public <O> O readObject(Class<O> klass, InputStream stream) throws IOException, XmlPullParserException { + + RedmineModelEnum.safeValueOf(klass); + + O result = Xpp3Helper.readObject(klass, ReaderFactory.newXmlReader(stream)); + + return result; + } + + public <O> O[] readObjects(Class<O> klass, InputStream stream) throws IOException, XmlPullParserException { + + RedmineModelEnum.safeValueOf(klass); + + O[] results = Xpp3Helper.readObjects(klass, ReaderFactory.newXmlReader(stream)); + return results; + } +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3Helper.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/TrackerXpp3Reader.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/TrackerXpp3Reader.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/TrackerXpp3Reader.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,36 @@ +package org.nuiton.jredmine.model.io.xpp3; + +import java.beans.IntrospectionException; +import org.nuiton.io.xpp3.AbstractXpp3Reader; +import org.nuiton.jredmine.model.Tracker; +import static org.nuiton.io.xpp3.Xpp3Helper.addTagTextContentMappers; + +/** + * {@link Tracker} reader. + * + * @author chemit + * @since 1.0.0 + */ +public class TrackerXpp3Reader extends AbstractXpp3Reader<Tracker> { + + public TrackerXpp3Reader() { + super(Tracker.class, "trackers", "tracker"); + } + + @Override + protected void initMappers() throws IntrospectionException { + + addTagTextContentMappers(Tracker.class, RedmineDataConverter.Integer, true, allMappers, + "id", + "project-id", + "tracker-id", + "position"); + + addTagTextContentMappers(Tracker.class, RedmineDataConverter.Boolean, true, allMappers, + "is-in-chlog", + "is-in-roadmap"); + + addTagTextContentMappers(Tracker.class, RedmineDataConverter.Text, true, allMappers, + "name"); + } +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/TrackerXpp3Reader.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserXpp3Reader.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserXpp3Reader.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserXpp3Reader.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,47 @@ +package org.nuiton.jredmine.model.io.xpp3; + +import java.beans.IntrospectionException; +import org.nuiton.io.xpp3.AbstractXpp3Reader; +import org.nuiton.jredmine.model.User; +import static org.nuiton.io.xpp3.Xpp3Helper.addTagTextContentMappers; + +/** + * {@link User} reader. + * + * @author chemit + * @since 1.0.0 + */ +public class UserXpp3Reader extends AbstractXpp3Reader<User> { + + public UserXpp3Reader() { + super(User.class, "users", "user"); + } + + @Override + protected void initMappers() throws IntrospectionException { + + addTagTextContentMappers(User.class, RedmineDataConverter.Integer, true, allMappers, + "id", + "auth-source-id", + "member-id", + "role-id", + "status"); + + addTagTextContentMappers(User.class, RedmineDataConverter.Boolean, true, allMappers, + "admin", + "mail-notification"); + + addTagTextContentMappers(User.class, RedmineDataConverter.Datetime, true, allMappers, + "created-on", + "updated-on", + "last-login-on"); + + addTagTextContentMappers(User.class, RedmineDataConverter.Text, true, allMappers, + "firstname", + "hashed-password", + "language", + "lastname", + "login", + "mail"); + } +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/UserXpp3Reader.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/VersionXpp3Reader.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/VersionXpp3Reader.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/VersionXpp3Reader.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,37 @@ +package org.nuiton.jredmine.model.io.xpp3; + +import java.beans.IntrospectionException; +import org.nuiton.io.xpp3.AbstractXpp3Reader; +import org.nuiton.jredmine.model.Version; +import static org.nuiton.io.xpp3.Xpp3Helper.addTagTextContentMappers; + +/** + * {@link Version} reader. + * @author chemit + * @since 1.0.0 + */ +public class VersionXpp3Reader extends AbstractXpp3Reader<Version> { + + public VersionXpp3Reader() { + super(Version.class, "versions", "version"); + } + + @Override + protected void initMappers() throws IntrospectionException { + + addTagTextContentMappers(Version.class, RedmineDataConverter.Integer, true, allMappers, + "id", + "project-id"); + + addTagTextContentMappers(Version.class, RedmineDataConverter.Datetime, true, allMappers, + "created-on", + "updated-on"); + addTagTextContentMappers(Version.class, RedmineDataConverter.Date, true, allMappers, + "effective-date"); + + addTagTextContentMappers(Version.class, RedmineDataConverter.Text, true, allMappers, + "name", + "description", + "wiki-page-title"); + } +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/io/xpp3/VersionXpp3Reader.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/rest/DefaultRequestBuilder.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/rest/DefaultRequestBuilder.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/rest/DefaultRequestBuilder.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,62 @@ +package org.nuiton.jredmine.rest; + +import java.io.File; +import java.util.Map; +import org.nuiton.io.rest.RestRequest; +import org.nuiton.io.rest.RestRequestBuilder; + +/** + * Default {@link RestRequestBuilder} to be used in {@link RedmineRestClient}. + * + * @author chemit + * @since 1.0.0 + */ +public class DefaultRequestBuilder implements RestRequestBuilder { + + protected String name; + protected String action; + + public DefaultRequestBuilder(String name, String action) { + this.name = name; + this.action = action; + } + + @Override + public String getName() { + return name; + } + + public String[] getParameters(Object... args) { + return new String[0]; + } + + public String[] getPath(Object... args) { + return new String[]{"rest", action}; + } + + public Map<String, File> getAttachments(Object... args) { + return null; + } + + @Override + public RestRequest create(final Object... args) { + + return new RestRequest() { + + @Override + public String[] getPath() { + return DefaultRequestBuilder.this.getPath(args); + } + + @Override + public String[] getParameters() { + return DefaultRequestBuilder.this.getParameters(args); + } + + @Override + public Map<String, File> getAttachments() { + return DefaultRequestBuilder.this.getAttachments(args); + } + }; + } +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/rest/DefaultRequestBuilder.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/rest/ProjectScopeRequestBuilder.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/rest/ProjectScopeRequestBuilder.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/rest/ProjectScopeRequestBuilder.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,28 @@ +package org.nuiton.jredmine.rest; + +/** + * Builder of requests which are in a project context. + * + * @author chemit + * @since 1.0.0 + */ +public class ProjectScopeRequestBuilder extends DefaultRequestBuilder { + + public ProjectScopeRequestBuilder(String name, String action) { + super(name, action); + } + + @Override + public String[] getPath(Object... args) { + + // one args : projectId + + String projectId = (String) args[0]; + + return new String[]{ + "rest", + action, + projectId + }; + } +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/rest/ProjectScopeRequestBuilder.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/rest/RedmineRestClient.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/rest/RedmineRestClient.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/rest/RedmineRestClient.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,231 @@ +package org.nuiton.jredmine.rest; + +import java.io.File; +import java.io.IOException; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.HashMap; +import java.util.Map; +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.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.Tracker; +import org.nuiton.jredmine.model.User; +import org.nuiton.jredmine.model.Version; + +/** + * Implementation of a {@link RestClient} to access a Redmine server via the + * {@code redmine_rest} rails plugin. + * + * @author chemit + * @since 1.0.0 + */ +public class RedmineRestClient extends RestClient { + + private static final Log log = LogFactory.getLog(RedmineRestClient.class); + public static final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); + public static final String GET_ISSUE_LIST = Issue.class.getName() + "list"; + public static final String GET_ISSUE_STATUS_LIST = IssueStatus.class.getName() + "list"; + public static final String GET_ISSUE_PRIORITY_LIST = IssuePriority.class.getName() + "list"; + public static final String GET_ISSUE_CATEGORY_LIST = IssueCategory.class.getName() + "list"; + public static final String GET_PROJECT_LIST = Project.class.getName() + "list"; + 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 ADD_NEWS = News.class.getName() + "add"; + public static final String ADD_ATTACHMENT = Attachment.class.getName() + "add"; + public static final String LOGIN = "login"; + public static final String LOGOUT = "logout"; + public static final String PING = "ping"; + + public RedmineRestClient(RestClientConfiguration configuration) { + super(configuration); + + 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_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_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")); + + // 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 ProjectScopeRequestBuilder(ADD_VERSION, "add_version.xml") { + + @Override + public String[] getParameters(Object... args) { + Version version = (Version) args[1]; + return new String[]{ + "version", version.getName(), + "description", version.getDescription(), + "date", DATE_FORMAT.format(version.getEffectiveDate()) + }; + } + }); + addRequestBuilder(new ProjectScopeRequestBuilder(UPDATE_VERSION, "update_version.xml") { + + @Override + public String[] getParameters(Object... args) { + Version version = (Version) args[1]; + return new String[]{ + "version", version.getName(), + "description", version.getDescription(), + "date", DATE_FORMAT.format(version.getEffectiveDate()) + }; + } + }); + + 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(), + "authorId", news.getAuthorId() + "" + }; + } + }); + + 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; + } + }); + } + + @Override + protected void open(RestSession session) throws IOException { + + ping(session); + + login(session); + } + + @Override + protected void close(RestSession session) throws IOException { + + if (session == null) { + return; + } + try { + RestRequest request = getRequest(LOGOUT); + session.setOpen(false); + session.doRequest(request); + } finally { + session.close(); + } + } + + protected void ping(RestSession session) throws IOException { + + try { + + RestRequest request = getRequest(PING); + HttpMethod gm = session.doRequest(request); + + StatusLine sl = gm.getStatusLine(); + int statusCode = sl.getStatusCode(); + if (log.isDebugEnabled()) { + log.debug("status code " + statusCode + " for " + gm.getPath()); + } + + if (statusCode != HttpStatus.SC_OK) { + gm.releaseConnection(); + throw new IOException("Got error code <" + statusCode + ":" + sl.getReasonPhrase() + "> on " + gm.getPath()); + } + + String content = gm.getResponseBodyAsString(); + + boolean ok = "ping".equals(content); + if (!ok) { + throw new IOException("can not connect to " + configuration.getRestUrl()); + } + } catch (IOException ex) { + throw ex; + } catch (Exception ex) { + throw new IOException("could not ping " + configuration.getRestUrl() + " for reason " + ex.getMessage(), ex); + } + } + + protected void login(RestSession session) throws IOException { + + RestRequest request = getRequest(LOGIN, configuration.getRestUsername(), configuration.getRestPassword()); + + HttpMethod gm = session.doRequest(request); + + StatusLine sl = gm.getStatusLine(); + int statusCode = sl.getStatusCode(); + if (log.isDebugEnabled()) { + log.debug("status code " + statusCode + " for " + gm.getPath()); + } + + if (statusCode != HttpStatus.SC_OK) { + gm.releaseConnection(); + throw new IOException("Got error code <" + statusCode + ":" + sl.getReasonPhrase() + "> on " + gm.getPath()); + } + + // ok session is logged in + + } +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/rest/RedmineRestClient.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/rest/VersionScopeRequestBuilder.java =================================================================== --- jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/rest/VersionScopeRequestBuilder.java (rev 0) +++ jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/rest/VersionScopeRequestBuilder.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,27 @@ +package org.nuiton.jredmine.rest; + +/** + * Builder of requests which are in a project and version context. + * + * @author chemit + * @since 1.0.0 + */ +public class VersionScopeRequestBuilder extends ProjectScopeRequestBuilder { + + public VersionScopeRequestBuilder(String name, String action) { + super(name, action); + } + + @Override + public String[] getParameters(Object... args) { + + // args 1 = project id + // args 2 = version name + + String versionId = (String) args[1]; + + return new String[]{ + "version_name", versionId + }; + } +} Property changes on: jredmine/trunk/jredmine-client/src/main/java/org/nuiton/jredmine/rest/VersionScopeRequestBuilder.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/main/redmine/jredmine/README.rdoc =================================================================== --- jredmine/trunk/jredmine-client/src/main/redmine/jredmine/README.rdoc (rev 0) +++ jredmine/trunk/jredmine-client/src/main/redmine/jredmine/README.rdoc 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,39 @@ += rest + +This plugin expose some services via a the REST protocol: + +jredmine/get_projects +jredmine/get_issue_statuses +jredmine/get_issue_priorities + +jredmine/get_project/X + +jredmine/get_project_trackers/X +jredmine/get_project_issue_categories/X +jredmine/get_project_users/X +jredmine/get_project_versions/X + +jredmine/get_version/X?version_name=Y +jredmine/get_version_issues/X?version_name=Y +jredmine/get_version_attachements/X?version_name=Y + +jredmine/add_version/X?version_name=Y +jredmine/update_version/X?version_name=Y + +jredmine/add_news/X?version_name=Y +jredmine/add_attachment/X?version_name=Y + +where X is a project identifier and Y a version name + +You have to add those lines to config/routes.rb + +# jredmine: ping, login , logout, with no project context... +map.connect 'jredmine/:action', :controller => 'rest' ,:action => ['ping', 'login', 'logout', 'get_projects', 'get_issue_statuses', 'get_issue_priorities'] +map.connect 'jredmine/:action.:format', :controller => 'rest' ,:action => ['get_projects', 'get_issue_statuses', 'get_issue_priorities'], :format => ['xml', 'json'] + +# jredmine/action/?? (:project_id) +map.connect 'jredmine/:action/:project_id', :controller => 'rest' +map.connect 'jredmine/:action.:format/:project_id', :controller => 'rest', :format => ['xml', 'json'] + + + Added: jredmine/trunk/jredmine-client/src/main/redmine/jredmine/app/controllers/rest_controller.rb =================================================================== --- jredmine/trunk/jredmine-client/src/main/redmine/jredmine/app/controllers/rest_controller.rb (rev 0) +++ jredmine/trunk/jredmine-client/src/main/redmine/jredmine/app/controllers/rest_controller.rb 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,352 @@ +class RestController < ActionController::Base + + # find user (after login) + before_filter :find_user, :except => [:ping, :login] + + # find project and check permission + before_filter :find_project, :except => [:ping, :login, :logout, :get_projects, :get_issue_statuses, :get_issue_priorities] + + # find project's version + before_filter :find_version, :only => [:get_version, :get_version_issues, :get_version_attachments, :add_version_attachment] + + # check can edit project before push requests + #before_filter :check_edit, :only => [:add_version, :update_version, :add_file, :add_news, :add_attachment, :add_version_attachment] + + # ping service (just to test if service is reachable) + def ping + render :text => "ping", :status => 200 + end + + # Login request and validation + def login + if !request.post? + # Logout user : get method not possible + self.logged_user = nil + render_status 405, "POST method required" + else + # Authenticate user + user = User.try_to_login(params[:username], params[:password]) + if user.nil? + # Invalid credentials + render_status 401, "Invalid credentials" + elsif user.new_record? + # Onthefly creation failed, + render_status 401, "User not activated" + else + # Valid user + self.logged_user = user + # always generate a key and set autologin cookie + token = Token.create(:user => user, :action => 'autologin') + cookies[:autologin] = { :value => token.value, :expires => 1.year.from_now } + render_status 200, "User logged in" + end + end + end + + # Log out current user and redirect to welcome page + def logout + cookies.delete :autologin + Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin']) if User.current.logged? + # user is no more connected + self.logged_user = nil + render_status 200, "User logged out" + end + + # recuperation des projets + def get_projects + @projects = Project.find(:all) + render_array_result @projects, "projects" + end + + # recuperation des priorities d'issues + def get_issue_priorities + get_enumeration "IPRI" + end + + # recuperation des differentes categories d'issues + def get_issue_categories + @issue_categories = @project.issue_categories.find(:all) + render_array_result @issue_categories, "issue_categories" + end + + # recuperation des differentes statuts d'issues + def get_issue_statuses + @issue_status = IssueStatus.find(:all) + render_array_result @issue_status, "issue_statuses" + end + # recuperation du projet + def get_project + render_result @project + end + + # recuperation de tous les membres d'un projet + def get_project_users + @members = @project.members.find(:all) + @r = [] + for m in @members + u = User.find(m[:user_id]) + u[:role_id] = m[:role_id] + u[:member_id] = m[:id] + #TODO - should remove the hashed password ? + @r << u + end + render_array_result @r, "users" + end + + # recuperation de toutes les annonces d'un projet + def get_project_news + @news = @project.news.find(:all) + render_array_result @news, "news" + end + + # recuperation des trakers d'un projet + def get_project_trackers + @trackers = @project.trackers.find(:all) + render_array_result @trackers, "trackers" + end + + # recuperation des versions d'un projet + def get_project_versions + @versions = @project.versions.find(:all) + render_array_result @versions, "versions" + end + + # recuperation de la version d'un projet + def get_version + render_result @version + end + + # recuperation des issues d'un projet pour une version donnee + def get_version_issues + @issues = @version.fixed_issues.find(:all) + render_array_result @issues, "issues" + end + + # recuperation des pieces jointes d'un projet pour une version donnee + def get_version_attachments + @files = @version.attachments.find(:all) + render_array_result @files, "attachments" + end + + def show_permissions + allowed_permissions + render_result @allowed_permissions + end + + def show_actions + allowed_actions + render_result @allowed_actions + end + + # add a new version for a given project + def add_version(version=params[:version], description = params[:description], date = params[:date]) + if !request.post? + render_status 405, "POST method required for action add_version" + return false + end + @version = @project.versions.find_by_name(version) + if !@version + allowed = User.current.allowed_to?({:controller => 'projects', :action => "add_version"}, @project) + if !allowed + render_status 401, "No permission to add a version" + else + @version = Version.create(:project => @project, :name => version) + if description + @version['description'] = description + end + if date + @version['effective_date'] = date + end + if @version.save + render_result @version + else + render_status 505, "Could not add the version..." + end + end + else + render_result @version + end + end + + # update a existing version for a given project + def update_version(version=params[:version], description = params[:description], date = params[:date]) + if !request.post? + render_status 405, "POST method required for action update_version" + return false + end + @version = @project.versions.find_by_name(version) + if !@version + render_status 404, "The version " + version + " does not exist, can not update it..." + else + allowed = User.current.allowed_to?({:controller => 'versions', :action => "edit"}, @project) + if !allowed + render_status 401, "No permission to edit a version" + else + if description + @version['description'] = description + end + if date + @version['effective_date'] = date + end + if @version.save + render_result @version + else + render_status 505, "Could not update the version..." + end + end + end + end + + # add a new news for a given project + def add_news(author_id = params[:authorId]) + if !request.post? + render_status 405, "POST method required for action add_news" + return false + end + allowed = User.current.allowed_to?({:controller => 'news', :action => "new"}, @project) + if !allowed + msg = "No permission to add a news on project "+ @project.name + render_status 401, msg + else + news_user = User.find(author_id) + @news = News.new(:project => @project, :author => news_user) + @news.attributes = params[:news] + if @news.save + Mailer.deliver_news_added(@news) if Setting.notified_events.include?('news_added') + render_result @news + else + render_status 505, "Could not add the news..." + end + end + end + + def add_version_attachment + add_attachment + end + + def add_attachment(attachment = params["attachment"]) + if !request.post? + render_status 405, "POST method required for action add_attachment" + return false + end + container = !@version ? @project : @version + if attachment + file = attachment['file'] + next unless file && file.size > 0 + a = Attachment.create(:container => container, + :file => file, + :description => attachment['description'].to_s.strip, + :author => User.current) + # a.new_record? ? (unsaved << a) : (attached << a) + # end + end + #if !attached.empty? && Setting.notified_events.include?('file_added') + # Mailer.deliver_attachments_added(attached) + #end + render_result a + end + + private + + def find_user + # Check the settings cache for each request + Setting.check_cache + # Find the current user + User.current = find_current_user + if !session[:user_id] + render_status 401, "Not connected" + end + end + + # Returns the current user or nil if no user is logged in + def find_current_user + if session[:user_id] + # existing session + (User.active.find(session[:user_id]) rescue nil) + elsif cookies[:autologin] + # auto-login feature + User.find_by_autologin_key(cookies[:autologin]) + end + end + + def find_project() + begin + @project = Project.find(params[:project_id]) + allowed = User.current.allowed_to?({:controller => 'rest', :action => "allow_rest"}, @project) + if !allowed + render_status 401, "No permission to access project nor rest service" + end + rescue ActiveRecord::RecordNotFound + render_status 404, "#{params[:project_id]} is not a project" + return false + end + end + + # recuperation des valeurs d'une enumration + def get_enumeration(type = params[:type]) + @result = Enumeration.get_values(type) + render_array_result @result, "enumerations" + end + + def check_edit + # check if user can edit the project + allowed = User.current.allowed_to?({:controller => 'projects', :action => "edit"}, @project) + if !allowed + render_status 401, "No permission to edit the project" + end + end + + def find_version(version = params[:version_name]) + @version = @project.versions.find_by_name(version) + if !@version + render_status 404, "#{version} is not a version for project #{@project.name}" + end + end + + def render_status(code,message) + render :text => message, :status => code + end + + def render_array_result(result,tag) + if !result.any? + respond_to do |format| + format.json { render :text => "[]" } + format.xml { render :text => "<"+tag+"></"+tag+">" } + end + else + respond_to do |format| + format.json { render :text => result.to_json } + format.xml { render :text => result.to_xml } + end + end + end + + def render_result(result) + respond_to do |format| + format.json { render :text => result.to_json } + format.xml { render :text => result.to_xml } + end + end + + def logged_user=(user) + if user && user.is_a?(User) + User.current = user + session[:user_id] = user.id + else + User.current = User.anonymous + session[:user_id] = nil + end + end + + def allowed_permissions + @allowed_permissions ||= begin + module_names = @project.enabled_modules.collect {|m| m.name} + Redmine::AccessControl.modules_permissions(module_names).collect {|p| p.name} + end + end + + def allowed_actions + @allowed_actions ||= allowed_permissions.inject([]) { |actions, permission| actions += Redmine::AccessControl.allowed_actions(permission) }.flatten + end + +end Added: jredmine/trunk/jredmine-client/src/main/redmine/jredmine/init.rb =================================================================== --- jredmine/trunk/jredmine-client/src/main/redmine/jredmine/init.rb (rev 0) +++ jredmine/trunk/jredmine-client/src/main/redmine/jredmine/init.rb 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,11 @@ +require 'redmine' + +Redmine::Plugin.register :redmine_rest do + name 'Redmine Rest plugin' + author 'Tony Chemit' + description 'A plugin to expose projects in REST' + version '0.0.1' + project_module :rest do + permission :allow_rest, :rest => :allow_rest + end +end Added: jredmine/trunk/jredmine-client/src/main/redmine/jredmine/lang/en.yml =================================================================== --- jredmine/trunk/jredmine-client/src/main/redmine/jredmine/lang/en.yml (rev 0) +++ jredmine/trunk/jredmine-client/src/main/redmine/jredmine/lang/en.yml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,2 @@ +# English strings go here +my_label: "My label" Added: jredmine/trunk/jredmine-client/src/main/resources/META-INF/services/org.nuiton.io.xpp3.Xpp3Reader =================================================================== --- jredmine/trunk/jredmine-client/src/main/resources/META-INF/services/org.nuiton.io.xpp3.Xpp3Reader (rev 0) +++ jredmine/trunk/jredmine-client/src/main/resources/META-INF/services/org.nuiton.io.xpp3.Xpp3Reader 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,10 @@ +org.nuiton.jredmine.model.io.xpp3.AttachmentXpp3Reader +org.nuiton.jredmine.model.io.xpp3.IssueXpp3Reader +org.nuiton.jredmine.model.io.xpp3.IssueCategoryXpp3Reader +org.nuiton.jredmine.model.io.xpp3.IssuePriorityXpp3Reader +org.nuiton.jredmine.model.io.xpp3.IssueStatusXpp3Reader +org.nuiton.jredmine.model.io.xpp3.NewsXpp3Reader +org.nuiton.jredmine.model.io.xpp3.ProjectXpp3Reader +org.nuiton.jredmine.model.io.xpp3.TrackerXpp3Reader +org.nuiton.jredmine.model.io.xpp3.UserXpp3Reader +org.nuiton.jredmine.model.io.xpp3.VersionXpp3Reader Added: jredmine/trunk/jredmine-client/src/site/apt/index.apt =================================================================== --- jredmine/trunk/jredmine-client/src/site/apt/index.apt (rev 0) +++ jredmine/trunk/jredmine-client/src/site/apt/index.apt 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,15 @@ +---- +Introduction +---- +---- +2009-09-15 +---- + +JRedmine model + + This module defines the java model mirroring the redmine model and offers + somme xml readers of redmine's datas in xml format using xpp3 xml parsers. + + + + Added: jredmine/trunk/jredmine-client/src/site/site.xml =================================================================== --- jredmine/trunk/jredmine-client/src/site/site.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/site/site.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project name="${project.name}"> + + <bannerLeft> + <name>${project.name}</name> + <href>index.html</href> + </bannerLeft> + + <body> + + <breadcrumbs> + <item name="${project.name}" href="${project.url}" /> + </breadcrumbs> + + <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="redmine-report" href="redmine-report-mojo.html"/> + <item name="get-project-data" href="get-project-data-mojo.html"/> + <item name="get-project-version-data" href="get-project-version-data-mojo.html"/> + <item name="help" href="help-mojo.html"/> + </item--> + </menu> + + <menu name="Développeur"> + <item name="Todo" href="todo.html"/> + </menu> + + <menu name="Téléchargement"> + <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-model/${project.version}/${project.build.finalName}.jar" + name="Librairie (jar)"/> + <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-model/${project.version}/${project.build.finalName}-javadoc.jar" + name="Javadoc (jar)"/> + <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-model/${project.version}/${project.build.finalName}-sources.jar" + name="Sources (jar)"/> + </menu> + + <menu ref="reports"/> + + </body> +</project> Added: jredmine/trunk/jredmine-client/src/test/java/org/nuiton/jredmine/RemoteServiceTest.java =================================================================== --- jredmine/trunk/jredmine-client/src/test/java/org/nuiton/jredmine/RemoteServiceTest.java (rev 0) +++ jredmine/trunk/jredmine-client/src/test/java/org/nuiton/jredmine/RemoteServiceTest.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,157 @@ +package org.nuiton.jredmine; + +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Assume; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +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.Tracker; +import org.nuiton.jredmine.model.User; +import org.nuiton.jredmine.model.Version; +import org.nuiton.jredmine.rest.RedmineRestClient; + +/** + * + * @author chemit + */ +public class RemoteServiceTest { + + /** + * shared rest client (open only one session for all the test) + */ + static RedmineRestClient client; + /** + * service to test + */ + RedmineService service; + + @BeforeClass + public static void setUpClass() throws Exception { + RestClientConfiguration configuration = TestHelper.getTestConfiguration(); + + client = new RedmineRestClient(configuration); + try { + + client.open(); + } catch (Exception e) { + + // could not log + System.out.println("can not connect to server " + configuration.getRestUrl() + ", will skip test " + RemoteServiceTest.class.getName()); + } finally { + Assume.assumeTrue(client != null && client.isOpen()); + } + } + + @AfterClass + public static void tearDownClass() throws Exception { + if (client != null) { + client.close(); + } + } + + @Before + public void setUp() throws Exception { + service = new DefaultRedmineService(); + + ((RedmineServiceImplementor) service).init(client); + } + + @After + public void tearDown() throws Exception { + + service = null; + } + + @Test + public void testIsInit() throws Exception { + + Assert.assertFalse(new DefaultRedmineService().isInit()); + + } + + @Test + public void testGetProjects() throws Exception { + Project[] projects = service.getProjects(); + } + + @Test + public void testGetIssuePriorities() throws Exception { + IssuePriority[] suePriorities = service.getIssuePriorities(); + } + + @Test + public void testGetIssueStatuses() throws Exception { + IssueStatus[] sueStatuses = service.getIssueStatuses(); + } + + @Test + public void testGetProject() throws Exception { + Project project = service.getProject("one"); + } + + @Test + public void testGetIssueCategories() throws Exception { + IssueCategory[] sueCategories = service.getIssueCategories("one"); + } + + @Test + public void testGetTrackers() throws Exception { + Tracker[] trackers = service.getTrackers("one"); + } + + @Test + public void testGetNews() throws Exception { + News[] news = service.getNews("one"); + } + + @Test + public void testGetUsers() throws Exception { + User[] users = service.getUsers("one"); + } + + @Test + public void testGetVersions() throws Exception { + Version[] versions = service.getVersions("one"); + } + + @Test + public void testGetVersion() throws Exception { + Version version = service.getVersion("one", "1.0.0"); + } + + @Test + public void testGetIssues() throws Exception { + Issue[] sues = service.getIssues("one", "1.0.0"); + } + + @Test + public void testGetAttachments() throws Exception { + Attachment[] attachments = service.getAttachments("one", "1.0.0"); + } + + @Test + public void testAddVersion() throws Exception { + } + + @Test + public void testAddAttachment() throws Exception { + } + + @Test + public void testAddNews() throws Exception { + } + + @Test + public void testUpdateVersion() throws Exception { + } +} Property changes on: jredmine/trunk/jredmine-client/src/test/java/org/nuiton/jredmine/RemoteServiceTest.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/test/java/org/nuiton/jredmine/TestHelper.java =================================================================== --- jredmine/trunk/jredmine-client/src/test/java/org/nuiton/jredmine/TestHelper.java (rev 0) +++ jredmine/trunk/jredmine-client/src/test/java/org/nuiton/jredmine/TestHelper.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,671 @@ +package org.nuiton.jredmine; + +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; +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.Tracker; +import org.nuiton.jredmine.model.User; +import org.nuiton.jredmine.model.Version; +import org.nuiton.jredmine.model.io.xpp3.RedmineDataConverter; + +/** + * + * @author chemit + * @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; +// String rep = type.getName(); + 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.version.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 = null; + 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 = null; + 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.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 = null; + 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.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 = null; + 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 = null; + 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@codelutin.com")); + 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@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@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 = null; + 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.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.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.setName("Bas"); + tempIP.setPosition(1); + tempIP.setOpt("IPRI"); + tempIP.setIsDefault(false); + 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); + + + } +} Property changes on: jredmine/trunk/jredmine-client/src/test/java/org/nuiton/jredmine/TestHelper.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/test/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3HelperTest.java =================================================================== --- jredmine/trunk/jredmine-client/src/test/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3HelperTest.java (rev 0) +++ jredmine/trunk/jredmine-client/src/test/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3HelperTest.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,243 @@ +package org.nuiton.jredmine.model.io.xpp3; + +import java.util.Set; +import org.nuiton.jredmine.TestHelper; +import java.beans.Introspector; +import org.nuiton.jredmine.model.*; +import java.io.File; +import java.io.FileInputStream; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.codehaus.plexus.util.IOUtil; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * + * @author chemit + * @since 1.0.0 + */ +public class RedmineXpp3HelperTest { + + protected static final Log log = LogFactory.getLog(RedmineXpp3HelperTest.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 + }; + protected static File testDir; + protected static RedmineXpp3Helper builder; + File file; + protected boolean verbose; + protected static int universeSize; + + @BeforeClass + public static void setUpClass() throws Exception { + + testDir = TestHelper.getTestDir(RedmineXpp3HelperTest.class.getPackage().getName(), "target" + File.separator + "test-classes"); + + builder = new RedmineXpp3Helper(); + + log.info("test dir : " + TestHelper.getRelativePath(TestHelper.getBasedir(), testDir)); + + // setup memory model + TestHelper.loadMemoryModel(); + + universeSize = TYPE_ORDER.length; + + 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); + } + } + } + + } + + @AfterClass + public static void tearDownClass() throws Exception { + testDir = null; + builder = null; + } + + @Before + public void setUp() { + verbose = TestHelper.isVerbose(); + } + + @After + public void tearDown() { + file = null; + } + + /** + * Test the method {@code read} of class ModelBuilder. + * + * @throws Exception + */ + @Test + public void testRead() throws Exception { + + TestAction action = new TestAction() { + + @Override + protected <T> void runForType(File rootDir, Class<T> type, List<?> expected) throws Exception { + + File file = new File(rootDir, Introspector.decapitalize(type.getSimpleName()) + ".xml"); + + if (verbose) { + log.info("will test " + TestHelper.getRelativePath(TestHelper.getBasedir(), file)); + } + + // test from file + + T actual = builder.readObject(type, file); + + TestHelper.assertMyEquals(type, expected.get(0), actual); + + // test from string + + String txt = IOUtil.toString(new FileInputStream(file)); + + actual = builder.readObject(type, txt); + + TestHelper.assertMyEquals(type, expected.get(0), actual); + } + }; + + 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))); + } + + /** + * Test the method {@code readArray} of class ModelBuilder. + * + * @throws Exception + */ + @Test + @SuppressWarnings("unchecked") + public void testReadArray() throws Exception { + + TestAction action = new TestAction() { + + @Override + protected <T> void runForType(File rootDir, Class<T> type, List<?> expected) throws Exception { + + File file = new File(rootDir, Introspector.decapitalize(type.getSimpleName()) + "s.xml"); + + if (verbose) { + log.info("will test " + TestHelper.getRelativePath(TestHelper.getBasedir(), file)); + } + + // test from file + + T[] actual = builder.readObjects(type, file); + + TestHelper.assertMyListEquals(type, (List<T>) expected, actual); + + // test from text + String txt = IOUtil.toString(new FileInputStream(file)); + + actual = builder.readObjects(type, txt); + + TestHelper.assertMyListEquals(type, (List<T>) expected, actual); + } + }; + + action.run("array-empty", + Collections.EMPTY_LIST, + Collections.EMPTY_LIST, + Collections.EMPTY_LIST, + Collections.EMPTY_LIST, + Collections.EMPTY_LIST, + Collections.EMPTY_LIST, + Collections.EMPTY_LIST, + Collections.EMPTY_LIST, + Collections.EMPTY_LIST, + Collections.EMPTY_LIST); + + + 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))); + + 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)); + + } + + /** + * A little action wrapper to simplify this test class :) + * + */ + public static abstract class TestAction { + + /** + * 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; + + public void run(String name, List<?>... expected) throws Exception { + Assert.assertEquals(universeSize, expected.length); + File rootDir = new File(testDir, name); + + for (int i = 0; i < universeSize; i++) { + + RedmineModelEnum next = TYPE_ORDER[i]; + + runForType(rootDir, next.getModelType(), expected[i]); + } + } + } +} Property changes on: jredmine/trunk/jredmine-client/src/test/java/org/nuiton/jredmine/model/io/xpp3/RedmineXpp3HelperTest.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/test/java/org/nuiton/jredmine/rest/RedmineRestClientTest.java =================================================================== --- jredmine/trunk/jredmine-client/src/test/java/org/nuiton/jredmine/rest/RedmineRestClientTest.java (rev 0) +++ jredmine/trunk/jredmine-client/src/test/java/org/nuiton/jredmine/rest/RedmineRestClientTest.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,194 @@ +package org.nuiton.jredmine.rest; + +import java.io.IOException; +import java.io.InputStream; +import org.codehaus.plexus.util.IOUtil; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Assume; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.nuiton.io.rest.RestClientConfiguration; +import org.nuiton.io.rest.RestException; +import org.nuiton.io.rest.RestRequest; +import org.nuiton.jredmine.TestHelper; +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.Tracker; +import org.nuiton.jredmine.model.User; +import org.nuiton.jredmine.model.Version; + +/** + * + * @author chemit + * @since 1.0.0 + */ +public class RedmineRestClientTest { + + static RestClientConfiguration configuration; + RedmineRestClient client; + + public RedmineRestClientTest() { + } + + @BeforeClass + public static void setUpClass() throws Exception { + + configuration = TestHelper.getTestConfiguration(); + + RedmineRestClient client = new RedmineRestClient(configuration); + try { + + client.open(); + } catch (Exception e) { + + // could not log + System.out.println("could not connect to server " + configuration.getRestUrl() + ", will skip test " + RedmineRestClientTest.class.getName()); + } finally { + Assume.assumeTrue(client.isOpen()); + } + } + + @AfterClass + public static void tearDownClass() throws Exception { + } + + @Before + public void setUp() throws Exception { + + client = new RedmineRestClient(configuration); + client.open(); + } + + @After + public void tearDown() throws Exception { + + if (client != null) { + client.close(); + } + } + + @Test + public void isOpen() throws Exception { + Assert.assertTrue(client.isOpen()); + } + + @Test + public void isClose() throws Exception { + Assert.assertTrue(client.isOpen()); + client.close(); + Assert.assertFalse(client.isOpen()); + } + + @Test + public void getDatas() throws Exception { + + String toString; + + // get projects + + toString = doRequest(Project.class, "list"); + if (configuration.isVerbose()) { + System.out.println(toString); + } + + // get issue statuses + + toString = doRequest(IssueStatus.class, "list"); + if (configuration.isVerbose()) { + System.out.println(toString); + } + + // get issue priorities + + toString = doRequest(IssuePriority.class, "list"); + if (configuration.isVerbose()) { + System.out.println(toString); + } + + // get project + + toString = doRequest(Project.class, "detail", "one"); + if (configuration.isVerbose()) { + System.out.println(toString); + } + + // get project issue categories + + toString = doRequest(IssueCategory.class, "list", "one"); + if (configuration.isVerbose()) { + System.out.println(toString); + } + + // get project versions + + toString = doRequest(Version.class, "list", "one"); + if (configuration.isVerbose()) { + System.out.println(toString); + } + + // get project users + + toString = doRequest(User.class, "list", "one"); + if (configuration.isVerbose()) { + System.out.println(toString); + } + + // get project trackers + + toString = doRequest(Tracker.class, "list", "one"); + if (configuration.isVerbose()) { + System.out.println(toString); + } + + // get project news + + toString = doRequest(News.class, "list", "one"); + if (configuration.isVerbose()) { + System.out.println(toString); + } + + // get version + + toString = doRequest(Version.class, "detail", "one", "1.0.0"); + if (configuration.isVerbose()) { + System.out.println(toString); + } + + // get issues + + toString = doRequest(Issue.class, "list", "one", "1.0.0"); + if (configuration.isVerbose()) { + System.out.println(toString); + } + + // get attachments + + toString = doRequest(Attachment.class, "list", "one", "1.0.0"); + if (configuration.isVerbose()) { + System.out.println(toString); + } + + } + + protected String doRequest(Class<?> type, String action, Object... params) throws IOException, RestException { + + String requestId = type.getName() + action; + + RestRequest request; + InputStream askData; + String toString; + + request = client.getRequest(requestId, params); + askData = client.askData(request); + toString = IOUtil.toString(askData); + return toString; + } +} Property changes on: jredmine/trunk/jredmine-client/src/test/java/org/nuiton/jredmine/rest/RedmineRestClientTest.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/jredmine-client/src/test/resources/log4j.properties =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/log4j.properties (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/log4j.properties 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,26 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +log4j.rootCategory=WARN, stdout + +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +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.apache.commons.httpclient.HttpClient=INFO Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/attachments.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/attachments.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/attachments.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,3 @@ +<?xml version="1.0" encoding="UTF-8"?> +<attachments type="array"> +</attachments> \ No newline at end of file Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issueCategorys.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issueCategorys.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issueCategorys.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,3 @@ +<?xml version="1.0" encoding="UTF-8"?> +<issue-categories type="array"> +</issue-categories> \ No newline at end of file Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issuePrioritys.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issuePrioritys.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issuePrioritys.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +<enumerations type="array"/> Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issueStatuss.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issueStatuss.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issueStatuss.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +<issue-statuses type="array"/> Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issues.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issues.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/issues.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,3 @@ +<?xml version="1.0" encoding="UTF-8"?> +<issues type="array"> +</issues> Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/newss.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/newss.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/newss.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +<news type="array"/> Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/projects.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/projects.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/projects.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,3 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projects type="array"> +</projects> \ No newline at end of file Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/trackers.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/trackers.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/trackers.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,3 @@ +<?xml version="1.0" encoding="UTF-8"?> +<trackers type="array"> +</trackers> Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/users.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/users.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/users.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,3 @@ +<?xml version="1.0" encoding="UTF-8"?> +<users type="array"> +</users> Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/versions.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/versions.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-empty/versions.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,3 @@ +<?xml version="1.0" encoding="UTF-8"?> +<versions type="array"> +</versions> Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/attachments.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/attachments.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/attachments.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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 Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issueCategorys.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issueCategorys.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issueCategorys.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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 Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issuePrioritys.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issuePrioritys.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issuePrioritys.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<enumerations type="array"> + <enumeration> + <id type="integer">3</id> + <is-default type="boolean">false</is-default> + <name>Bas</name> + <opt>IPRI</opt> + <position type="integer">1</position> + </enumeration> + <enumeration> + <id type="integer">4</id> + <is-default type="boolean">true</is-default> + <name>Normal</name> + <opt>IPRI</opt> + <position type="integer">2</position> + </enumeration> + <enumeration> + <id type="integer">5</id> + <is-default type="boolean">false</is-default> + <name>Haut</name> + <opt>IPRI</opt> + <position type="integer">3</position> + </enumeration> + <enumeration> + <id type="integer">6</id> + <is-default type="boolean">false</is-default> + <name>Urgent</name> + <opt>IPRI</opt> + <position type="integer">4</position> + </enumeration> + <enumeration> + <id type="integer">7</id> + <is-default type="boolean">false</is-default> + <name>Immédiat</name> + <opt>IPRI</opt> + <position type="integer">5</position> + </enumeration> +</enumerations> Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issueStatuss.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issueStatuss.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issueStatuss.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + </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 Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issues.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issues.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/issues.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + + <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> + </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> Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/newss.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/newss.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/newss.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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 Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/projects.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/projects.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/projects.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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"/> + <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 Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/trackers.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/trackers.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/trackers.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/users.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/users.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/users.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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@codelutin.com</mail> + </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@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@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> Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/versions.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/versions.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-multi/versions.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + </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> Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/attachments.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/attachments.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/attachments.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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 Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issueCategorys.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issueCategorys.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issueCategorys.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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 Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issuePrioritys.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issuePrioritys.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issuePrioritys.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<enumerations type="array"> + <enumeration> + <id type="integer">3</id> + <is-default type="boolean">false</is-default> + <name>Bas</name> + <opt>IPRI</opt> + <position type="integer">1</position> + </enumeration> +</enumerations> Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issueStatuss.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issueStatuss.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issueStatuss.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + </issue-status> + +</issue-statuses> \ No newline at end of file Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issues.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issues.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/issues.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + + <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> + </issue> +</issues> Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/newss.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/newss.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/newss.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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 Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/projects.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/projects.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/projects.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + <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 Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/trackers.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/trackers.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/trackers.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/users.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/users.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/users.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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@codelutin.com</mail> + </user> +</users> Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/versions.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/versions.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/array-singleton/versions.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + </version> +</versions> Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/attachment.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/attachment.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/attachment.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/issue.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/issue.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/issue.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + + <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> +</issue> Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/issueCategory.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/issueCategory.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/issueCategory.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/issuePriority.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/issuePriority.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/issuePriority.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<enumeration> + <id type="integer">3</id> + <is-default type="boolean">false</is-default> + <name>Bas</name> + <opt>IPRI</opt> + <position type="integer">1</position> +</enumeration> Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/issueStatus.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/issueStatus.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/issueStatus.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> +</issue-status> Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/news.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/news.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/news.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/project.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/project.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/project.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + <projects-count type="integer">0</projects-count> + <status type="integer">1</status> + + <is-public type="boolean">true</is-public> +</project> Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/tracker.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/tracker.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/tracker.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/user.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/user.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/user.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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@codelutin.com</mail> +</user> Added: jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/version.xml =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/version.xml (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/org/nuiton/jredmine/model/io/xpp3/single/version.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> +</version> Added: jredmine/trunk/jredmine-client/src/test/resources/test-config.properties =================================================================== --- jredmine/trunk/jredmine-client/src/test/resources/test-config.properties (rev 0) +++ jredmine/trunk/jredmine-client/src/test/resources/test-config.properties 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,6 @@ +# 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.encoding=UTF-8 Added: jredmine/trunk/maven-jredmine-plugin/LICENSE.txt =================================================================== --- jredmine/trunk/maven-jredmine-plugin/LICENSE.txt (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/LICENSE.txt 2009-09-19 14:49:32 UTC (rev 183) @@ -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. + Added: jredmine/trunk/maven-jredmine-plugin/README.txt =================================================================== --- jredmine/trunk/maven-jredmine-plugin/README.txt (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/README.txt 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,2 @@ +To deploy new version of pom: mvn deploy +To install localy: mvn install Added: jredmine/trunk/maven-jredmine-plugin/changelog.txt =================================================================== --- jredmine/trunk/maven-jredmine-plugin/changelog.txt (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/changelog.txt 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,5 @@ +maven-redmine-plugin (1.0.0-SNAPSHOT) stable; urgency=low + + * //TODO_FILL_ME + + -- author -- date -R Added: jredmine/trunk/maven-jredmine-plugin/pom.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/pom.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/pom.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,261 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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.0.0-SNAPSHOT</version> + </parent> + + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-plugin</artifactId> + + <dependencies> + + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>jredmine-client</artifactId> + <version>${project.version}</version> + </dependency> + + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>jredmine-client</artifactId> + <version>${project.version}</version> + <scope>test</scope> + <classifier>tests</classifier> + </dependency> + + <dependency> + <groupId>org.nuiton</groupId> + <artifactId>maven-helper-plugin</artifactId> + </dependency> + + <!-- fix dependency pb in velocity (need at least version > 2.2) --> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + </dependency> + + <!-- FIXME si on ne le rajoute pas, on se retrouve avec la version 1.1 qui ne convient pas --> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + </dependency> + + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-project</artifactId> + </dependency> + + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-core</artifactId> + </dependency> + + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-plugin-api</artifactId> + </dependency> + + <dependency> + <groupId>org.sonatype.plexus</groupId> + <artifactId>plexus-sec-dispatcher</artifactId> + </dependency> + + <dependency> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-changes-plugin</artifactId> + </dependency> + + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <scope>compile</scope> + </dependency> + + <dependency> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpclient</artifactId> + </dependency> + + <!-- tests dependencies --> + + <dependency> + <groupId>org.nuiton</groupId> + <artifactId>maven-helper-plugin</artifactId> + <scope>test</scope> + <classifier>tests</classifier> + </dependency> + + <dependency> + <groupId>org.apache.maven.plugin-testing</groupId> + <artifactId>maven-plugin-testing-harness</artifactId> + </dependency> + + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </dependency> + + </dependencies> + + <!-- ************************************************************* --> + <!-- *** Project Information ************************************* --> + <!-- ************************************************************* --> + <name>JRedmine maven plugin</name> + + <description>JRedmine maven plugin to interacts with Redmine's server</description> + + <!-- ************************************************************* --> + <!-- *** Build Settings ****************************************** --> + <!-- ************************************************************* --> + + <packaging>maven-plugin</packaging> + + <properties> + + <maven.changeFile>${maven.gen.dir}/changes/changes.xml</maven.changeFile> + <!--<maven.changeFile>${maven.changeFile}</maven.changeFile>--> + + <!-- redmine issue and version url pattern --> + <maven.redmine.issue.url>http://www.mynuiton.org/issues/show/%ISSUE%</maven.redmine.issue.url> + <!--<maven.redmine.issue.url>${maven.redmine.issue.url}</maven.redmine.issue.url>--> + + <!-- redmine server (must be defined in your settings.xml) --> + <redmine.serverId>redmine-local</redmine.serverId> + <!--<redmine.serverId>redmine-${plateform}</redmine.serverId>--> + + <!-- redmine project --> + <redmine.projectId>one</redmine.projectId> + <redmine.versionId>1.0.0</redmine.versionId> + <!--<redmine.projectId>${projectId}</redmine.projectId>--> + + <redmine.url>http://www.mynuiton.org</redmine.url> + </properties> + + <build> + + <defaultGoal>install</defaultGoal> + + <plugins> + + <plugin> + <artifactId>maven-plugin-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>helpmojo</goal> + </goals> + </execution> + </executions> + </plugin> + + </plugins> + + <pluginManagement> + <plugins> + + <!-- <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <includes> + <include>**/*TestSuite.java</include> + </includes> + </configuration> + </plugin>--> + + </plugins> + </pluginManagement> + + </build> + + <reporting> + <plugins> + + <plugin> + <artifactId>maven-plugin-plugin</artifactId> + </plugin> + + <plugin> + <groupId>${project.groupId}</groupId> + <artifactId>maven-jredmine-plugin</artifactId> + <version>${project.version}</version> + <configuration> + <xmlPath>${maven.changeFile}</xmlPath> + <issueLinkTemplate>${maven.redmine.issue.url}</issueLinkTemplate> + <versionLinkTemplate>http://www.mynuiton.org/versions/show/%VERSION%</versionLinkTemplate> + <!--<onlyCurrentVersion>true</onlyCurrentVersion>--> + <!--<maxEntries>2</maxEntries>--> + <columnNames>key,summary,status,assignee,reporter,tracker,priority,version,category,createdOn</columnNames> + </configuration> + <reportSets> + <reportSet> + <reports> + <report>issues-report</report> + <report>issues-report-by-tracker</report> + <report>issues-report-by-status</report> + <report>issues-report-by-category</report> + <report>issues-report-by-priority</report> + <report>issues-report-by-version</report> + </reports> + </reportSet> + </reportSets> + </plugin> + + </plugins> + </reporting> + + <!-- ************************************************************* --> + <!-- *** Build Environment ************************************** --> + <!-- ************************************************************* --> + + <profiles> + + <profile> + <id>run-its</id> + <build> + <plugins> + <plugin> + <artifactId>maven-invoker-plugin</artifactId> + <configuration> + <pomIncludes> + <pomInclude>single/pom.xml</pomInclude> + <pomInclude>multi/pom.xml</pomInclude> + <pomInclude>report/pom.xml</pomInclude> + <!--<pomInclude>**/pom.xml</pomInclude>--> + </pomIncludes> + <postBuildHookScript>verify</postBuildHookScript> + <localRepositoryPath>${basedir}/target/local-repo</localRepositoryPath> + <!--<goals> + <goal>clean</goal> + <goal>install</goal> + </goals>--> + <settingsFile>src/it/settings.xml</settingsFile> + <cloneProjectsTo>${project.build.directory}/its</cloneProjectsTo> + </configuration> + <executions> + <execution> + <id>integration-test</id> + <goals> + <goal>install</goal> + <goal>run</goal> + </goals> + <phase>validate</phase> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + + </profiles> + +</project> Added: jredmine/trunk/maven-jredmine-plugin/src/it/multi/invoker.properties =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/it/multi/invoker.properties (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/it/multi/invoker.properties 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,21 @@ +# A comma or space separated list of goals/phases to execute, may +# specify an empty list to execute the default goal of the IT project +invoker.goals=clean install + +# Optionally, a list of goals to run during further invocations of Maven +#invoker.goals.2=${project.groupId}:${project.artifactId}:${project.version}:run + +# A comma or space separated list of profiles to activate +#invoker.profiles=run-all run-once + +# The value for the environment variable MAVEN_OPTS +#invoker.mavenOpts=-Dfile.encoding=UTF-16 -Xms32m -Xmx256m + +# Possible values are "fail-fast" (default), "fail-at-end" and "fail-never" +invoker.failureBehavior=fail-at-end + +# The expected result of the build, possible values are "success" (default) and "failure" +#invoker.buildResult=success + +# A boolean value controlling the -N flag, defaults to "false" +#invoker.nonRecursive=false Added: jredmine/trunk/maven-jredmine-plugin/src/it/multi/module1/pom.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/it/multi/module1/pom.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/it/multi/module1/pom.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> + +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.nuiton.jredmine.test.multi</groupId> + <artifactId>pom</artifactId> + <version>0</version> + </parent> + + <artifactId>module1</artifactId> + + <name>JRedmine multi module1</name> + + <packaging>pom</packaging> + + <properties> + + <releaseFiles>${basedir}/src/module1.txt</releaseFiles> + + </properties> + +</project> Added: jredmine/trunk/maven-jredmine-plugin/src/it/multi/module1/src/module1.txt =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/it/multi/module1/src/module1.txt (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/it/multi/module1/src/module1.txt 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1 @@ +This is the file content to upload \ No newline at end of file Added: jredmine/trunk/maven-jredmine-plugin/src/it/multi/module2/pom.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/it/multi/module2/pom.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/it/multi/module2/pom.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> + +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.nuiton.jredmine.test.multi</groupId> + <artifactId>pom</artifactId> + <version>0</version> + </parent> + + <artifactId>module2</artifactId> + + <name>JRedmine multi module2</name> + + <packaging>jar</packaging> + + <properties> + + <releaseFiles>${basedir}/src/module2.txt</releaseFiles> + + </properties> + +</project> Added: jredmine/trunk/maven-jredmine-plugin/src/it/multi/module2/src/module2.txt =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/it/multi/module2/src/module2.txt (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/it/multi/module2/src/module2.txt 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1 @@ +This is the file content to upload \ No newline at end of file Added: jredmine/trunk/maven-jredmine-plugin/src/it/multi/pom.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/it/multi/pom.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/it/multi/pom.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,148 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + <groupId>org.nuiton.jredmine.test.multi</groupId> + <artifactId>pom</artifactId> + <version>0</version> + + <modules> + <module>module1</module> + <module>module2</module> + </modules> + + <name>JRedmine multi pom</name> + <description>Test JRedmine plugin for a multi module.</description> + + <packaging>pom</packaging> + + <url>http://www.foo.com</url> + + <issueManagement> + <system>redmine</system> + <url>http://www.mynuiton.org/projects/one/issues</url> + </issueManagement> + + <properties> + + <pluginVersion>@pom.version@</pluginVersion> + + <!-- default encoding --> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + + <maven.changeFile>target/changes/changes.xml</maven.changeFile> + <maven.redmine.issue.url>http://www.mynuiton.org/issues/show/%ISSUE%</maven.redmine.issue.url> + <redmine.serverId>redmine-local</redmine.serverId> + <redmine.projectId>one</redmine.projectId> + <redmine.versionId>1.0.0</redmine.versionId> + + <redmine.url>http://www.mynuiton.org</redmine.url> + <releaseFiles>${basedir}/src/pom.txt</releaseFiles> + + <collectedFiles>target/collect.properties</collectedFiles> + + </properties> + + <build> + + <pluginManagement> + <plugins> + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-plugin</artifactId> + <version>${pluginVersion}</version> + </plugin> + </plugins> + </pluginManagement> + + + <plugins> + + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-plugin</artifactId> + <executions> + <execution> + <id>generate-changes</id> + <goals> + <goal>generate-changes</goal> + <goal>generate-news-announcement</goal> + <goal>generate-email-announcement</goal> + </goals> + <phase>generate-resources</phase> + <configuration> + <xmlPath>${maven.changeFile}</xmlPath> + + <generateOnce>true</generateOnce> + + <actionMapping>fix:1, add:2</actionMapping> + <issueLinkTemplate>${maven.redmine.issue.url}</issueLinkTemplate> + + <xmlPath>${maven.changeFile}</xmlPath> + <urlDownload>http://www.mynuiton.org/projects/list_files/one</urlDownload> + </configuration> + </execution> + + <execution> + <id>collect-files</id> + <goals> + <goal>collect-files</goal> + </goals> + <phase>package</phase> + <configuration> + <extraFiles>${releaseFiles}</extraFiles> + <descriptionFile>${collectedFiles}</descriptionFile> + <!--<copyFiles>false</copyFiles>--> + </configuration> + </execution> + + <execution> + <id>publish-redmine</id> + <!-- only executed on the pom --> + <inherited>false</inherited> + <goals> + <goal>update-version</goal> + <goal>publish-attachments</goal> + <goal>publish-news</goal> + <goal>send-email</goal> + </goals> + <phase>verify</phase> + <configuration> + + <!-- Send nothing ! --> + <dryRun>true</dryRun> + + <!-- update-version --> + <closeVersion>true</closeVersion> + + <!-- publish-attachments --> + <filesFromProperties>${collectedFiles}</filesFromProperties> + + <!-- publish-news --> + <newsContentFile>target/announcement/release-news-announcement.vm</newsContentFile> + <newsSummary>${project.description}</newsSummary> + <newsTitle>${project.name} ${project.version} released</newsTitle> + + <!-- send-email --> + <emailTitle>[ANNOUNCEMENT] - ${project.name} ${project.version} released</emailTitle> + <emailContentFile>target/announcement/release-email-announcement.vm</emailContentFile> + <mailSender> + <name>Nuiton Release Notification</name> + <email>noreply@noway.fr</email> + </mailSender> + <toAddresses> + <item>chemit@codelutin.com</item> + </toAddresses> + <smtpHost>smtp</smtpHost> + </configuration> + </execution> + </executions> + </plugin> + + </plugins> + + </build> + +</project> Added: jredmine/trunk/maven-jredmine-plugin/src/it/multi/src/pom.txt =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/it/multi/src/pom.txt (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/it/multi/src/pom.txt 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1 @@ +This is the file content to upload \ No newline at end of file Added: jredmine/trunk/maven-jredmine-plugin/src/it/multi/verify.groovy =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/it/multi/verify.groovy (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/it/multi/verify.groovy 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,44 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +assert new File(basedir, 'target/changes/changes.xml').exists(); +assert new File(basedir, 'target/announcement/release-news-announcement.vm').exists(); +assert new File(basedir, 'target/announcement/release-email-announcement.vm').exists(); +assert new File(basedir, 'target/collect.properties').exists(); + +assert !new File(basedir, 'module1/target/announcement/release-news-announcement.vm').exists(); +assert !new File(basedir, 'module1/target/announcement/release-email-announcement.vm').exists(); +assert !new File(basedir, 'module1/target/collect.properties').exists(); + +assert !new File(basedir, 'module2/target/announcement/release-news-announcement.vm').exists(); +assert !new File(basedir, 'module2/target/announcement/release-email-announcement.vm').exists(); +assert !new File(basedir, 'module2/target/collect.properties').exists(); + +assert new File(basedir, 'target/collect/org.nuiton.jredmine.test.multi--pom/pom.xml').exists(); +assert new File(basedir, 'target/collect/org.nuiton.jredmine.test.multi--pom/pom.txt').exists(); +assert new File(basedir, 'target/collect/org.nuiton.jredmine.test.multi--module1/pom.xml').exists(); +assert new File(basedir, 'target/collect/org.nuiton.jredmine.test.multi--module1/module1.txt').exists(); +assert new File(basedir, 'target/collect/org.nuiton.jredmine.test.multi--module2/module2-0.jar').exists(); +assert new File(basedir, 'target/collect/org.nuiton.jredmine.test.multi--module2/module2.txt').exists(); + +//content = new File(basedir, 'target/announcement/announcement.vm').text; + +//assert content.contains( 'Test report.' ); + +return true; Added: jredmine/trunk/maven-jredmine-plugin/src/it/report/invoker.properties =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/it/report/invoker.properties (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/it/report/invoker.properties 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,21 @@ +# A comma or space separated list of goals/phases to execute, may +# specify an empty list to execute the default goal of the IT project +invoker.goals=clean site + +# Optionally, a list of goals to run during further invocations of Maven +#invoker.goals.2=${project.groupId}:${project.artifactId}:${project.version}:run + +# A comma or space separated list of profiles to activate +#invoker.profiles=its,jdk15 + +# The value for the environment variable MAVEN_OPTS +#invoker.mavenOpts=-Dfile.encoding=UTF-16 -Xms32m -Xmx256m + +# Possible values are "fail-fast" (default), "fail-at-end" and "fail-never" +invoker.failureBehavior=fail-at-end + +# The expected result of the build, possible values are "success" (default) and "failure" +#invoker.buildResult=success + +# A boolean value controlling the -N flag, defaults to "false" +#invoker.nonRecursive=false Added: jredmine/trunk/maven-jredmine-plugin/src/it/report/pom.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/it/report/pom.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/it/report/pom.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,84 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> + +<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> + + <groupId>org.nuiton.jredmine</groupId> + <artifactId>test-report</artifactId> + <version>0</version> + + <name>JRedmine report</name> + <packaging>pom</packaging> + <description>Test JRedmine plugin reports</description> + + <url>http://www.foo.com</url> + + <issueManagement> + <system>redmine</system> + <url>http://www.mynuiton.org/projects/one/issues</url> + </issueManagement> + + <properties> + + <pluginVersion>@pom.version@</pluginVersion> + + <!-- default encoding --> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + + <!--<redmine.url>http://www.mynuiton.org</redmine.url>--> + </properties> + + <reporting> + <plugins> + + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-plugin</artifactId> + <version>${pluginVersion}</version> + <configuration> + <serverId>redmine-local</serverId> + <projectId>one</projectId> + <versionId>1.0.0</versionId> + <issueLinkTemplate>http://www.mynuiton.org/issues/show/%ISSUE%</issueLinkTemplate> + <versionLinkTemplate>http://www.mynuiton.org/versions/show/%VERSION%</versionLinkTemplate> + <columnNames>key,summary,status,assignee,reporter,tracker,priority,version,category,createdOn</columnNames> + </configuration> + <reportSets> + <reportSet> + <reports> + <report>issues-report</report> + <report>issues-report-by-tracker</report> + <report>issues-report-by-status</report> + <report>issues-report-by-category</report> + <report>issues-report-by-priority</report> + <report>issues-report-by-version</report> + </reports> + </reportSet> + </reportSets> + </plugin> + + </plugins> + </reporting> + +</project> Added: jredmine/trunk/maven-jredmine-plugin/src/it/report/verify.groovy =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/it/report/verify.groovy (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/it/report/verify.groovy 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,32 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + assert new File(basedir, 'target/site/redmine-report.html').exists(); + assert new File(basedir, 'target/site/redmine-report-by-category.html').exists(); + assert new File(basedir, 'target/site/redmine-report-by-priority.html').exists(); + assert new File(basedir, 'target/site/redmine-report-by-status.html').exists(); + assert new File(basedir, 'target/site/redmine-report-by-tracker.html').exists(); + assert new File(basedir, 'target/site/redmine-report-by-version.html').exists(); + assert new File(basedir, 'target/site/redmine-report.html').exists(); + +//content = new File(basedir, 'target/announcement/announcement.vm').text; + +//assert content.contains( 'Test report.' ); + +return true; Added: jredmine/trunk/maven-jredmine-plugin/src/it/settings.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/it/settings.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/it/settings.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +<settings> + + <servers> + <server> + <id>redmine-local</id> + <username>chemit</username> + <password>{i4S9W9sEp0gH4jrveLOLJlL0O0D5TpyIplB4Abql5o8=}</password> + </server> + </servers> + + <profiles> + <profile> + <id>it-repo</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + <repositories> + <repository> + <id>local.central</id> + <url>file:///@localRepository@</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>local.central</id> + <url>file:///@localRepository@</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </pluginRepository> + </pluginRepositories> + </profile> + </profiles> +</settings> Added: jredmine/trunk/maven-jredmine-plugin/src/it/single/invoker.properties =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/it/single/invoker.properties (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/it/single/invoker.properties 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,21 @@ +# A comma or space separated list of goals/phases to execute, may +# specify an empty list to execute the default goal of the IT project +invoker.goals=clean verify + +# Optionally, a list of goals to run during further invocations of Maven +#invoker.goals.2=${project.groupId}:${project.artifactId}:${project.version}:run + +# A comma or space separated list of profiles to activate +#invoker.profiles=its,jdk15 + +# The value for the environment variable MAVEN_OPTS +#invoker.mavenOpts=-Dfile.encoding=UTF-16 -Xms32m -Xmx256m + +# Possible values are "fail-fast" (default), "fail-at-end" and "fail-never" +invoker.failureBehavior=fail-at-end + +# The expected result of the build, possible values are "success" (default) and "failure" +#invoker.buildResult=success + +# A boolean value controlling the -N flag, defaults to "false" +#invoker.nonRecursive=false Added: jredmine/trunk/maven-jredmine-plugin/src/it/single/pom.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/it/single/pom.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/it/single/pom.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,140 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + <groupId>org.nuiton.jredmine.test</groupId> + <artifactId>single</artifactId> + <version>0</version> + + <name>JRedmine single</name> + <packaging>jar</packaging> + <description>Test JRedmine plugin for a single module.</description> + + <url>http://www.foo.com</url> + + <issueManagement> + <system>redmine</system> + <url>http://www.mynuiton.org/projects/one/issues</url> + </issueManagement> + + <properties> + + <pluginVersion>@pom.version@</pluginVersion> + + <!-- default encoding --> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + + <maven.changeFile>target/changes/changes.xml</maven.changeFile> + <maven.redmine.issue.url>http://www.mynuiton.org/issues/show/%ISSUE%</maven.redmine.issue.url> + <redmine.serverId>redmine-local</redmine.serverId> + <redmine.projectId>one</redmine.projectId> + <redmine.versionId>1.0.0</redmine.versionId> + + <redmine.url>http://www.mynuiton.org</redmine.url> + <releaseFiles>${basedir}/pom.xml</releaseFiles> + + <collectedFiles>target/collect.properties</collectedFiles> + + </properties> + + <build> + + <pluginManagement> + <plugins> + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-plugin</artifactId> + <version>${pluginVersion}</version> + </plugin> + </plugins> + </pluginManagement> + + <plugins> + + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-plugin</artifactId> + <executions> + <execution> + <id>generate</id> + <goals> + <goal>generate-changes</goal> + <goal>generate-news-announcement</goal> + <goal>generate-email-announcement</goal> + </goals> + <phase>generate-resources</phase> + <configuration> + <!-- common --> + <xmlPath>${maven.changeFile}</xmlPath> + + <!-- generate-changes --> + <generateOnce>true</generateOnce> + <actionMapping>fix:1, add:2</actionMapping> + <issueLinkTemplate>${maven.redmine.issue.url}</issueLinkTemplate> + + <!-- generate announcements --> + <urlDownload>http://www.mynuiton.org/projects/list_files/one</urlDownload> + </configuration> + </execution> + + <execution> + <id>collect-files</id> + <goals> + <goal>collect-files</goal> + </goals> + <phase>package</phase> + <configuration> + <extraFiles>${releaseFiles}</extraFiles> + <descriptionFile>${collectedFiles}</descriptionFile> + <!--<copyFiles>false</copyFiles>--> + </configuration> + </execution> + + <execution> + <id>publish-redmine</id> + <goals> + <goal>update-version</goal> + <goal>publish-attachments</goal> + <goal>publish-news</goal> + <goal>send-email</goal> + </goals> + <phase>verify</phase> + <configuration> + + <!-- Send nothing ! --> + <dryRun>true</dryRun> + + <!-- update-version --> + <closeVersion>true</closeVersion> + + <!-- publish-attachments --> + <filesFromProperties>${collectedFiles}</filesFromProperties> + + <!-- publish-news --> + <newsContentFile>target/announcement/release-news-announcement.vm</newsContentFile> + <newsSummary>${project.description}</newsSummary> + <newsTitle>${project.name} ${project.version} released</newsTitle> + + <!-- send-email --> + <emailTitle>[ANNOUNCEMENT] - ${project.name} ${project.version} released</emailTitle> + <emailContentFile>target/announcement/release-email-announcement.vm</emailContentFile> + <mailSender> + <name>Nuiton Release Notification</name> + <email>noreply@noway.fr</email> + </mailSender> + <toAddresses> + <item>chemit@codelutin.com</item> + </toAddresses> + <smtpHost>smtp</smtpHost> + </configuration> + </execution> + </executions> + </plugin> + + </plugins> + + </build> + +</project> Added: jredmine/trunk/maven-jredmine-plugin/src/it/single/verify.groovy =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/it/single/verify.groovy (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/it/single/verify.groovy 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,31 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + assert new File(basedir, 'target/changes/changes.xml').exists(); + assert new File(basedir, 'target/announcement/release-news-announcement.vm').exists(); + assert new File(basedir, 'target/announcement/release-email-announcement.vm').exists(); + assert new File(basedir, 'target/collect.properties').exists(); + assert new File(basedir, 'target/collect/org.nuiton.jredmine.test--single/pom.xml').exists(); + assert new File(basedir, 'target/collect/org.nuiton.jredmine.test--single/single-0.jar').exists(); + +//content = new File(basedir, 'target/announcement/announcement.vm').text; + +//assert content.contains( 'Test report.' ); + +return true; Added: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojo.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojo.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojo.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,503 @@ +package org.nuiton.jredmine.plugin; + +import java.io.File; +import java.net.URL; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.model.IssueManagement; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.project.MavenProject; +import org.apache.maven.settings.Server; +import org.apache.maven.settings.Settings; +import org.nuiton.io.rest.RestClientConfiguration; +import org.nuiton.plugin.AbstractPlugin; +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.jredmine.RedmineService; +import org.nuiton.jredmine.RedmineServiceException; +import org.nuiton.jredmine.RedmineServiceImplementor; +import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher; + +/** + * Abstract redmine mojo. + * + * @author tchemit + * @since 1.0.0 + * @requiresOnline true + * @requiresProject true + */ +public abstract class AbstractRedmineMojo extends AbstractPlugin implements RestClientConfiguration { + + public static final String REDMINE_SYSTEM = "redmine"; + /** + * @parameter expression="${session}" + * @required + * @readonly + */ + protected MavenSession mavenSession; + /** + * Dependance du projet. + * + * @parameter default-value="${project}" + * @required + * @readonly + * @since 1.0.0 + */ + protected MavenProject project; + /** + * Dependance du settings. + * + * @parameter default-value="${settings}" + * @required + * @readonly + * @since 1.0.0 + */ + protected Settings settings; + /** + * Server id to use for authentication (must be defined in your setting + * and use the maven >= 2.1.0 password encryption mecanism). + * <p/> + * + * @parameter expression="${redmine.serverId}" + * @since 1.0.0 + */ + protected String serverId; + /** + * The real basedir redmine url. + * + * If no url is given, will use the one filled in issue management. + * + * @parameter expression="${redmine.url}" + * @since 1.0.0 + */ + protected URL redmineUrl; + /** + * The redmine's server login. + * + * @parameter expression="${redmine.username}" + * @since 1.0.0 + */ + protected String redmineUsername; + /** + * The redmine's server password. + * + * @parameter expression="${redmine.password}" + * @since 1.0.0 + */ + protected String redminePassword; + /** + * The encoding used to read and write files. + * + * @parameter expression="${redmine.encoding}" default-value="${project.build.sourceEncoding}" + * @since 1.0.0 + */ + protected String encoding; + /** + * Project identifier. + * + * @parameter expression="${redmine.projectId}" default-value="${project.artifactId}" + * @required + * @since 1.0.0 + */ + protected String projectId; + /** + * Version identifier. + * + * @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}" + * @since 1.0.0 + */ + protected boolean verbose; + /** + * password decypher + * + * @component roleHint="maven-redmine-plugin" + * @since 1.0.0 + */ + protected SecDispatcher sec; + /** + * Redmine service. + * + * @component + * @since 1.0.0 + */ + protected RedmineService service; + private final boolean requireProject; + private final boolean requireVersion; + private final boolean requireUser; + protected Project releaseProject; + protected Version releaseVersion; + protected User releaseUser; + protected User[] users; + protected DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); + + public AbstractRedmineMojo(boolean requireProject, boolean requireVersion, boolean requireUser) { + super(); + this.requireProject = requireProject; + this.requireVersion = requireVersion; + this.requireUser = requireUser; + } + + /////////////////////////////////////////////////////////////////////////// + /// AbstractPlugin + /////////////////////////////////////////////////////////////////////////// + @Override + protected boolean ensurePackaging() { + // accept all project's packaging + return false; + } + + @Override + protected boolean init() throws Exception { + + // check issue management + + IssueManagement issueManagement = project.getIssueManagement(); + + if (issueManagement == null) { + getLog().error("No Issue Management set."); + + return false; + } else if ((issueManagement.getUrl() == null) || (issueManagement.getUrl().trim().equals(""))) { + getLog().error("No URL set in Issue Management."); + + return false; + } else if ((issueManagement.getSystem() != null) && !(issueManagement.getSystem().equalsIgnoreCase(AbstractRedmineMojo.REDMINE_SYSTEM))) { + getLog().error("Redmine's Plugin only supports 'redmine' Issue Management system."); + + return false; + } + + // check server (if used) + + Server server = null; + + if (serverId != null && !serverId.trim().isEmpty()) { + + server = settings.getServer(serverId); + + if (server == null) { + getLog().error("Could not find server with id '" + serverId + "', check your settings.xml file."); + return false; + } + } + + // prepare Redmine service configuration + + URL url = getRestUrl(); + String username = getRestUsername(); + String password = getRestPassword(); + + // check authentication configuration is stable + + boolean noUsername = username == null || username.trim().isEmpty(); + boolean noPassword = password == null || password.trim().isEmpty(); + + if (server != null && !noUsername) { + getLog().error("Authentication configuration is wrong :\ncan not use both 'serverId' and 'redmineUsername' parameters, check your plugin configuration."); + return false; + } + + if (server != null && !noPassword) { + getLog().error("Authentication configuration is wrong :\ncan not use both 'serverId' and 'redminePassword' parameters, check your plugin configuration."); + return false; + } + + if (server == null && noUsername && noPassword) { + getLog().error("Authentication configuration is wrong :\nno configuration is given, please fill parameter 'serverId' or 'redmineUsername' and 'redminePassword'."); + return false; + } + + if (server == null && (noUsername || noPassword)) { + getLog().error("Authentication configuration is wrong :\nconfiguration is not complete, please fill parameter 'serverId' or 'redmineUsername' and 'redminePassword'."); + return false; + } + + if (url == null || url.toString().isEmpty()) { + + // no redmine url specified, guess it from issueManagement + + url = new URL(issueManagement.getUrl()); + + if (verbose) { + getLog().info("use the url from issue management : " + url); + } + } + + if (server != null) { + // obtain username and password from server + + username = server.getUsername(); + password = sec.decrypt(server.getPassword()); + } + + // apply configuration + + setRestUrl(url); + setRestUsername(username); + setRestPassword(password); + + if (verbose) { + getLog().info("Redmine configuration :\n>> host : " + + getRestUrl() + "\n>> username : " + + getRestUsername()); + } + + // init Redmine service + + try { + + ((RedmineServiceImplementor) service).init(this); + + } catch (Exception e) { + getLog().error("could not init Redmine service [" + getRestUrl() + "] with user '" + getRestUsername() + "'"); + if (verbose) { + getLog().error(e); + } + return false; + } + + // check project exists + + if (requireProject) { + boolean r = initReleaseProject(); + if (!r) { + getLog().error("the project '" + projectId + "' could not be retreave from redmine server, goal is skip"); + return false; + } + } + + + // check user exists + + if (requireUser) { + boolean r = initReleaseUser(); + if (!r) { + getLog().error("the user '" + redmineUsername + "' could not be retreave from redmine server, goal is skip"); + return false; + } + } + + + // check version exists + + if (requireVersion) { + boolean r = initReleaseVersion(); + if (!r) { + getLog().error("the version '" + versionId + "' could not be retreave from redmine server, goal is skip"); + return false; + } + } + + return true; + } + + @Override + public void execute() throws MojoExecutionException, MojoFailureException { + try { + super.execute(); + } finally { + // always close service (it will release connections to redmine) + closeService(); + } + } + + /** + * Re-expose the protected method for test purposes... + * + * @throws Exception + * @see AbstractPlugin#doAction() + */ + @Override + protected abstract void doAction() throws Exception; + + /////////////////////////////////////////////////////////////////////////// + /// Plugin + /////////////////////////////////////////////////////////////////////////// + @Override + public MavenProject getProject() { + return project; + } + + @Override + public void setProject(MavenProject project) { + this.project = project; + } + + @Override + public boolean isVerbose() { + return verbose; + } + + @Override + public void setVerbose(boolean verbose) { + this.verbose = verbose; + } + + /////////////////////////////////////////////////////////////////////////// + /// RestClientConfiguration + /////////////////////////////////////////////////////////////////////////// + @Override + public String getRestPassword() { + return redminePassword; + } + + @Override + public URL getRestUrl() { + return redmineUrl; + } + + @Override + public String getRestUsername() { + return redmineUsername; + } + + @Override + public void setRestPassword(String restPassword) { + this.redminePassword = restPassword; + } + + @Override + public void setRestUrl(URL restUrl) { + this.redmineUrl = restUrl; + } + + @Override + public void setRestUsername(String restUsername) { + this.redmineUsername = restUsername; + } + + @Override + public String getEncoding() { + return encoding; + } + + @Override + public void setEncoding(String encoding) { + this.encoding = encoding; + } + + /////////////////////////////////////////////////////////////////////////// + /// Others + /////////////////////////////////////////////////////////////////////////// + protected boolean initReleaseProject() throws MojoExecutionException { + + if (projectId == null || projectId.trim().isEmpty()) { + throw new MojoExecutionException("required a projectId parameter"); + } + try { + this.releaseProject = service.getProject(projectId); + if (releaseProject == null) { + return false; + } + return true; + } catch (RedmineServiceException e) { + getLog().warn("could not retreave project '" + projectId + "', goal is skip"); + if (verbose) { + getLog().error(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; + } + + this.releaseVersion = v; + return true; + } catch (RedmineServiceException e) { + getLog().warn("could not retreave version " + versionId + ", goal is skip"); + if (verbose) { + getLog().error(e); + } + return false; + } + } + + protected boolean initReleaseUser() { + + try { + users = service.getUsers(projectId); + + User user = ModelHelper.byLogin(redmineUsername, users); + + if (user == null) { + + return false; + } + this.releaseUser = user; + } catch (RedmineServiceException e) { + getLog().warn("could not retreave user '" + redmineUsername + "', goal is skip"); + if (verbose) { + getLog().error(e); + } + return false; + } + + return true; + } + + protected void closeService() { + if (service != null) { + RedmineServiceImplementor i; + i = ((RedmineServiceImplementor) service); + + if (i.isInit()) { + try { + if (verbose) { + getLog().info("<<< Close redmine rest client..."); + } + i.destroy(); + } catch (Exception ex) { + getLog().error("could not close redmine client for reason " + ex.getMessage(), ex); + } + } + } + } + + + protected boolean isExecutionRoot() { + return project == getExecutionRootProject(); + } + + protected MavenProject getExecutionRootProject() { + MavenProject root = project; + String executionRootDirectory = mavenSession.getExecutionRootDirectory(); + while (root != null) { + File dir = root.getBasedir(); + getLog().debug("Current Folder:" + dir); + boolean result = executionRootDirectory.equalsIgnoreCase(dir.toString()); + if (result) { + break; + } + root = root.getParent(); + } + if (verbose) { + getLog().info("root project " + root); + } + return root; + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojo.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/CollectFilesMojo.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/CollectFilesMojo.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/CollectFilesMojo.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,325 @@ +package org.nuiton.jredmine.plugin; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; +import java.util.regex.Pattern; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.util.FileUtils; + +/** + * Collect files some files from a project and copy them into a directory. + * + * @goal collect-files + * @requiresProject true + * + * @author tchemit + * @since 1.0.3 + */ +public class CollectFilesMojo extends AbstractMojo { + + /** + * @parameter expression="${session}" + * @required + * @readonly + */ + private MavenSession mavenSession; + /** + * Dependance du projet. + * + * @parameter default-value="${project}" + * @required + * @readonly + * @since 1.0.3 + */ + protected MavenProject project; + /** + * The artifacts to publish from the project build. + * + * @parameter expression="${project.attachedArtifacts}" + * @required + * @readonly + * @since 1.0.0 + */ + protected List attachedArtifacts; + /** + * User extra files to collect. + * + * Multi values can be used, separated by comma. + * + * @parameter expression="${helper.extraFiles}" + * @since 1.0.0 + */ + protected String extraFiles; + /** + * File name pattern of selected files to publish. + * + * If no Set - no include filter + * + * @parameter expression="${helper.includes}" default-value="" + * @since 1.0.0 + */ + protected String includes; + /** + * File name pattern of selected files to publish. + * + * If no Set - no exclude filter + * + * @parameter expression="${helper.excludes}" default-value="" + * @since 1.0.0 + */ + protected String excludes; + /** + * Directory where to store collected files. + * <p/> + * <b>Note :</b> In a multi-module context, will always use the value of + * the property of the root module, because we need to push collected files + * to only one place. + * + * @parameter expression="${helper.outputDirectory}" default-value="target/collect" + * @since 1.0.0 + */ + protected String outputDirectory; + /** + * Properties file will all files collected indexed by their path. + * <p/> + * <b>Note :</b> If not Set, will not generate the description file. + * + * @parameter expression="${helper.descriptionFile}" + * @since 1.0.0 + */ + protected String descriptionFile; + /** + * Un flag pour collecter aussi les fichiers attaches au projet. + * + * @parameter expression="${helper.includeAttached}" default-value="true" + * @since 1.0.0 + */ + protected boolean includeAttached; + /** + * Un flag pour recopier les fichiers collectés. + * + * @parameter expression="${helper.copyFiles}" default-value="true" + * @since 1.0.0 + */ + protected boolean copyFiles; + /** + * Un flag pour activer le mode verbeux. + * + * @parameter expression="${helper.verbose}" default-value="${maven.verbose}" + * @since 1.0.0 + */ + protected boolean verbose; + /** + * A flag to skip the goal. + * + * @parameter expression="${helper.skip}" default-value="false" + * @since 1.0.0 + */ + protected boolean skip; + /** + * Un flag pour activer le mode verbeux. + * + * @parameter expression="${helper.dryRun}" default-value="false" + * @since 1.0.0 + */ + protected boolean dryRun; + + @Override + public void execute() throws MojoExecutionException, MojoFailureException { + + if (skip) { + getLog().info("Skip flag in on, goal will not be executed"); + } + List<File> files = getFiles(); + if (files.isEmpty()) { + + getLog().warn("No files to collect."); + return; + } + + MavenProject rootProject = getExecutionRootProject(); + + File base = new File(rootProject.getBasedir(), outputDirectory); + + File output = new File(base, project.getGroupId() + "--" + project.getArtifactId()); + + if (rootProject == project || verbose) { + // just print on root + getLog().info("Ouput dir : " + output); + } + + if (dryRun) { + getLog().info("\n dryRun flag is on, no file will be copied!\n"); + } else { + + if (!output.exists()) { + output.mkdirs(); + } + } + + File description = null; + + Properties p = new Properties(); + boolean withDescriptionFile = false; + if (descriptionFile != null && !descriptionFile.trim().isEmpty()) { + + description = new File(rootProject.getBasedir(), descriptionFile); + + withDescriptionFile = true; + + if (description.exists()) { + // reload existing + try { + p.load(new FileInputStream(description)); + getLog().info("Load " + description); + } catch (IOException ex) { + throw new MojoExecutionException("could not load file " + description, ex); + } + } + } + + if (!withDescriptionFile && !copyFiles) { + throw new MojoExecutionException("must use at least one of the parameters 'copyFiles' or 'descriptionFile'"); + } + + String basedir = rootProject.getBasedir().getAbsolutePath(); + int basedirLength = basedir.length(); + for (File f : files) { + String absolutePath = f.getAbsolutePath(); + String path = absolutePath.substring(basedirLength + 1); + File dst = new File(output, f.getName()); + if (withDescriptionFile && copyFiles) { + p.put(path, dst.getAbsolutePath()); + } else { + p.put(path, f.getAbsolutePath()); + } + getLog().info("collected file " + path); + if (!dryRun && copyFiles) { + try { + // copy the collected file + FileUtils.copyFile(f, dst); + } catch (IOException ex) { + throw new MojoExecutionException("could not copy file " + f, ex); + } + } + } + + if (description != null) { + try { + p.store(new FileOutputStream(description), "Generated by " + this.getClass()); + getLog().info("Save " + description); + } catch (IOException ex) { + throw new MojoExecutionException("could not save file " + description, ex); + } + } + } + + protected List<File> getFiles() { + + Pattern includePattern = includes == null || includes.trim().isEmpty() ? null : Pattern.compile(includes.trim()); + Pattern excludePattern = excludes == null || excludes.trim().isEmpty() ? null : Pattern.compile(excludes.trim()); + + List<File> result = new ArrayList<File>(); + + // attach the project mail file + + if (includeAttached) { + + if ("pom".equals(project.getPackaging())) { + addFile(project.getFile(), "adding artifact file : ", result, includePattern, excludePattern); + } else { + Artifact a = project.getArtifact(); + if (a != null) { + addFile(a.getFile(), "adding artifact file : ", result, includePattern, excludePattern); + } + } + } + File file; + + // attach extra files + + if (extraFiles != null && !extraFiles.trim().isEmpty()) { + + for (String path : extraFiles.split(",")) { + + file = new File(path); + addFile(file, "adding user file : ", result, includePattern, excludePattern); + + } + } + + // attach project attached files + + if (includeAttached && attachedArtifacts != null) { + + for (Object o : attachedArtifacts) { + + file = ((Artifact) o).getFile(); + addFile(file, "adding attached artifact file : ", result, includePattern, excludePattern); + } + } + + return result; + } + + protected MavenProject getExecutionRootProject() { + MavenProject root = project; + String executionRootDirectory = mavenSession.getExecutionRootDirectory(); + while (root != null) { + File basedir = root.getBasedir(); + getLog().debug("Current Folder:" + basedir); + boolean result = executionRootDirectory.equalsIgnoreCase(basedir.toString()); + if (result) { + break; + } + root = root.getParent(); + } + if (verbose) { + getLog().info("root project " + root); + } + return root; + } + + protected void addFile(File f, String msg, List<File> files, Pattern includePattern, Pattern excludePattern) { + if (f == null) { + return; + } + if (!f.exists()) { + getLog().warn("skip unexisting file " + f); + return; + } + if (excludePattern != null) { + if (excludePattern.matcher(f.getName()).matches()) { + // skip this file + if (verbose) { + getLog().info("skip " + f + " : in excludes " + excludes); + } + return; + } + } + if (includePattern != null) { + if (!includePattern.matcher(f.getName()).matches()) { + // skip this file + if (verbose) { + getLog().info("skip " + f + " : not in includes " + includes); + } + return; + } + } + if (verbose) { + getLog().info(msg + f); + } + files.add(f); + } +} + Property changes on: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/CollectFilesMojo.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,136 @@ +package org.nuiton.jredmine.plugin; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.apache.maven.plugin.MojoFailureException; +import org.nuiton.jredmine.model.I18nAble; +import org.nuiton.jredmine.model.IdAble; +import org.nuiton.jredmine.model.RedmineModelEnum; +import org.nuiton.jredmine.model.RedmineModelScope; +import org.nuiton.jredmine.RedmineServiceImplementor; + +/** + * Display in console some data from redmine's server. + * + * @goal display-data + * + * @author tchemit + * @since 1.0.0 + */ +public class DisplayDataMojo extends AbstractRedmineMojo { + + /** + * The data types to display : {@code issueSatus}, {@code issuePriority}, + * {@code issueCategory}, {@code tracker} and {@code user}. + * <p/> + * {@code issueStatus} and {@code issuePriority} are common for all + * projects, so for those datas, no extrat configuration is required. + * <p/> + * {@code isseCategoriy}, {@code tracker} and {@code user} are project + * specific, so you have to fill also the {@code projectId} parameter to + * obtain data for those types. + * <p/> + * Note : you can specifiy several types separated by comma + * + * @parameter expression="${redmine.types}" + * @required + * @since 1.0.0 + */ + protected String types; + /** + * list of actions to perform + */ + protected List<RedmineModelEnum> actions; + + public DisplayDataMojo() { + super(false, false, false); + } + + @Override + protected boolean init() throws Exception { + + boolean init = super.init(); + if (init) { + + actions = getDownloadActions(types, + RedmineModelEnum.issueStatus, + RedmineModelEnum.issuePriority, + RedmineModelEnum.issueCategory, + RedmineModelEnum.tracker, + RedmineModelEnum.user); + + if (actions.isEmpty()) { + // no data to treate + getLog().warn("no data types detected, you must fill the required parameter dataTypes"); + init = false; + } + } + return init; + } + + @Override + protected void doAction() throws Exception { + + StringBuilder buffer = new StringBuilder("\n"); + for (RedmineModelEnum entry : actions) { + + RedmineModelScope scope = entry.getScope(); + + Object[] datas = ((RedmineServiceImplementor) service).getDatas(entry.getModelType(), projectId, versionId); + buffer.append("\nValues of '" + entry).append('\''); + if (scope == RedmineModelScope.project || scope == RedmineModelScope.version) { + buffer.append(" for project " + projectId); + } + buffer.append('\n'); + for (Object data : datas) { + buffer.append(" - " + ((IdAble) data).getId()).append(" = ").append(((I18nAble) data).getName()).append('\n'); + } + } + System.out.println(buffer.toString()); + } + + protected List<RedmineModelEnum> getDownloadActions(String dataTypes, RedmineModelEnum... universe) throws MojoFailureException { + + List<RedmineModelEnum> results = new ArrayList<RedmineModelEnum>(); + + List<RedmineModelEnum> universeList = new ArrayList<RedmineModelEnum>(Arrays.asList(universe)); + + for (String dataType : dataTypes.split(",")) { + +// if (dataType.endsWith("s")) { +// dataType = dataType.substring(0, dataType.length() - 1); +// } + + RedmineModelEnum result; + try { + result = RedmineModelEnum.valueOf(dataType.trim()); + } catch (Exception e) { + throw new MojoFailureException("could not obtain data type " + dataType + " in " + Arrays.toString(RedmineModelEnum.values())); + } + RedmineModelScope scope = result.getScope(); + + if (scope == RedmineModelScope.project || scope == RedmineModelScope.version) { + + // check projectId used + if (projectId == null && projectId.isEmpty()) { + throw new MojoFailureException("could not use the data type " + result + " since it is not a project requires and projectId was not filled"); + } + } + if (scope == RedmineModelScope.version) { + // check versionId use + if (versionId == null || versionId.isEmpty()) { + throw new MojoFailureException("could not use the data type " + result + " since it a version requires and versionId was not filled"); + } + } + + if (!universeList.isEmpty() && !universeList.contains(result)) { + // can not accept these value + getLog().warn("the type " + result + " is not authorized, universe : " + universeList); + continue; + } + results.add(result); + } + return results; + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/GenerateChangesMojo.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/GenerateChangesMojo.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/GenerateChangesMojo.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,634 @@ +package org.nuiton.jredmine.plugin; + +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugins.changes.model.Action; +import org.apache.maven.plugins.changes.model.Author; +import org.apache.maven.plugins.changes.model.Body; +import org.apache.maven.plugins.changes.model.ChangesDocument; +import org.apache.maven.plugins.changes.model.Properties; +import org.apache.maven.plugins.changes.model.Release; +import org.apache.maven.plugins.changes.model.io.xpp3.ChangesXpp3Writer; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.util.FileUtils; +import org.codehaus.plexus.util.xml.XmlStreamWriter; +import org.nuiton.jredmine.model.Issue; +import org.nuiton.jredmine.model.IssueCategory; +import org.nuiton.jredmine.model.IssueStatus; +import org.nuiton.jredmine.model.ModelHelper; +import org.nuiton.jredmine.model.Project; +import org.nuiton.jredmine.model.Tracker; +import org.nuiton.jredmine.model.User; +import org.nuiton.jredmine.model.Version; +import org.nuiton.jredmine.RedmineServiceException; +import org.nuiton.util.PluginHelper; + +/** + * Generates the changes.xml file from the Redmine's server to be used + * by the maven-changes-plugin to generates the release report and send + * the annoncement mail at a release time. + * + * @since 1.0.0 + * + * @author tchemit + * @goal generate-changes + */ +public class GenerateChangesMojo extends AbstractRedmineMojo implements IssueCollectorConfiguration { + + /** + * The actions understood by the changes.xml format. + * + */ + enum Actions { + + add, + fix, + update, + remove + } + /** + * The path of the <code>changes.xml</code> file that will be converted into an HTML report. + * + * @parameter expression="${redmine.xmlPath}" default-value="${basedir}/src/changes/changes.xml" + * @required + * @since 1.0.0 + */ + protected File xmlPath; + /** + * The description of the release. + * + * <b>Note :</b> if not sets - will use the redmine version description (if exists). + * + * @parameter expression="${releaseDescription}" + * @since 1.0.0 + */ + protected String releaseDescription; + /** + * The changes file title. + * + * @parameter expression="${changesTitle}" default-value="${project.description}" + * @required + * @since 1.0.0 + */ + protected String changesTitle; + /** + * If you only want to show issues for the current version in the report. + * The current version being used is <code>${project.version}</code> minus + * any "-SNAPSHOT" suffix. + * + * @parameter expression="${redmine.onlyCurrentVersion}" default-value="false" + * @since 1.0.0 + */ + protected boolean onlyCurrentVersion; + /** + * The action mapping to the redmine tracker ids. + * + * Possible actions are {@code add}, {@code fix}, {@code update}, {@code remove} + * + * The syntax of mapping is {@ocode action:id [,action:id]*} + * + * Example : + * + * <pre> + * fix:1 + * fix:1, add:1 + * </pre> + * + * @parameter expression="${redmine.actionMapping}" + * @required + * @since 1.0.0 + */ + protected String actionMapping; + /** + * The comma separated list of statuses ids to include in the changes.xml + * + * <b>Note :</b> If a value is set to empty - that means to include all status. + * <p/> + * @parameter expression="${redmine.statusIds}" + * @since 1.0.0 + */ + protected String statusIds; + /** + * The comma separated list of category ids to include in the changes.xml + * + * <b>Note :</b> If a value is set to empty - that means to include all categories. + * <p/> + * @parameter expression="${redmine.categoryIds}" + * @since 1.0.0 + */ + protected String categoryIds; + /** + * A flag to skip the goal. + * + * @parameter expression="${redmine.skipGenerateChanges}" default-value="false" + * @since 1.0.0 + */ + protected boolean skipGenerateChanges; + /** + * A flag to generate only once in a multi-module project. The changes.xml + * file will be generated only once in the pom module and then copy in the + * modules. + * <p/> + * The default behaviour is to generate once to reduce calls to redmine + * + * @parameter expression="${redmine.generateOnce}" default-value="true" + * @since 1.0.0 + */ + protected boolean generateOnce; + /** + * @parameter expression="${session}" + * @required + * @readonly + */ + private MavenSession mavenSession; + /** + * le fichier deja genere + */ + private static File cacheChangesFile; + /** + * le mapping entre l'id d'un tracker et le type d'action + */ + protected Map<Integer, String> trackerToAction; + protected Map<String, String> filters; + private Version[] versions; + + public GenerateChangesMojo() { + super(true, false, true); + } + + protected boolean isGoalSkip() { + return skipGenerateChanges; + } + + @Override + protected boolean init() throws Exception { + + if (isGoalSkip()) { + return true; + } + + if (xmlPath == null || xmlPath.getAbsolutePath().trim().isEmpty()) { + throw new MojoExecutionException("required a xmlPath parameter"); + } + + if (versionId == null || versionId.trim().isEmpty()) { + throw new MojoExecutionException("required a versionId parameter"); + } + + versionId = PluginHelper.removeSnapshotSuffix(versionId); + + boolean result = super.init(); + if (!result) { + return false; + } + + File xmlParent = xmlPath.getParentFile(); + if (!xmlParent.exists()) { + xmlParent.mkdirs(); + } + + if (generateOnce) { + + if (cacheChangesFile == null || !cacheChangesFile.exists()) { + + // the changes.xml does not exists, must generate it + generateOnce = false; + } else { + + // nothing to generate (so no init) + // will just copy the already generated changes.xml file + return true; + } + } + + try { + + // get trackers + + Tracker[] releaseTrackers; + try { + + releaseTrackers = service.getTrackers(projectId); + + } catch (RedmineServiceException e) { + throw new MojoExecutionException("could not obtain trackers for reason " + e.getMessage(), e); + } + + // get statuses + + IssueStatus[] statuses; + try { + + statuses = service.getIssueStatuses(); + + } catch (RedmineServiceException e) { + throw new MojoExecutionException("could not obtain statuses for reason " + e.getMessage(), e); + } + + // get categories + + IssueCategory[] categories; + try { + + categories = service.getIssueCategories(projectId); + + } catch (RedmineServiceException e) { + throw new MojoExecutionException("could not obtain categories for reason " + e.getMessage(), e); + } + + // get versions + + try { + + versions = service.getVersions(projectId); + + } catch (RedmineServiceException e) { + throw new MojoExecutionException("could not obtain versions for reason " + e.getMessage(), e); + } + + filters = new HashMap<String, String>(); + + // build trackerToAction and tracker filter + + trackerToAction = new HashMap<Integer, String>(); + + String[] entries = actionMapping.split(","); + StringBuilder buffer = new StringBuilder(); + for (String entry : entries) { + String[] parts = entry.split(":"); + if (parts.length != 2) { + // error in syntax + throw new MojoExecutionException("the trackerMapping entry " + Arrays.toString(parts) + " is not well formed"); + } + String action = parts[0].trim().toLowerCase(); + + try { + Actions.valueOf(action); + } catch (Exception e) { + throw new MojoExecutionException("the action " + action + " is unknown... authorized : " + Arrays.toString(Actions.values())); + } + + Integer id = Integer.valueOf(parts[1].trim()); + + Tracker t = ModelHelper.byId(id, releaseTrackers); + + if (t == null) { + throw new MojoExecutionException("could not obtain the tracker with id " + id); + } + + trackerToAction.put(id, action); + buffer.append(",").append(id); + } + + filters.put("tracker", buffer.substring(1)); + + // create status filters + if (statusIds != null && !statusIds.trim().isEmpty()) { + + for (String s : statusIds.split(",")) { + Integer id = Integer.valueOf(s.trim()); + + IssueStatus t = ModelHelper.byId(id, statuses); + + if (t == null) { + throw new MojoExecutionException("could not obtain the status with id " + id); + } + } + + } + + filters.put("status", statusIds); + + if (categoryIds != null && !categoryIds.trim().isEmpty()) { + + // create category filters + + for (String s : categoryIds.split(",")) { + Integer id = Integer.valueOf(s.trim()); + + IssueCategory t = ModelHelper.byId(id, categories); + + if (t == null) { + throw new MojoExecutionException("could not obtain the category with id " + id); + } + } + + filters.put("category", categoryIds); + } + + // create version filters + + List<Version> versionList = new ArrayList<Version>(); + + boolean versionExist = true; + + if (releaseVersion == null) { + versionExist = false; + + // la version n'existe pas encore sur redmine + getLog().warn("The version " + versionId + " does not exist on redmine"); + + releaseVersion = new Version(); + releaseVersion.setName(versionId); + releaseVersion.setProjectId(releaseProject.getId()); + } + + if (onlyCurrentVersion) { + + // just release version + versionList.add(releaseVersion); + } else { + + // obtain all released versions (just a effective-date) + + buffer = new StringBuilder(); + + for (Version v : versions) { + + String id = v.getName(); + + boolean keep = true; + if (!versionId.equals(id)) { + + //TODO TC-20090914 make this better, since this is a + // very soft test to test only the effective date + + if (v.getEffectiveDate() == null) { + // skip this unclosed version + keep = false; + } + } + + if (keep) { + + buffer.append(",").append(v.getName()); + versionList.add(v); + } + } + + if (!versionExist) { + versionList.add(releaseVersion); + } + } + + versions = versionList.toArray(new Version[versionList.size()]); + + if (!onlyCurrentVersion) { + filters.put("version", buffer.substring(1)); + } + + } catch (Exception e) { + if (verbose) { + getLog().warn("could not init the plugin for reason " + e.getMessage(), e); + } else { + getLog().warn("could not init the plugin for reason " + e.getMessage()); + } + result = false; + } + return result; + } + + @Override + protected void doAction() throws Exception { + + if (isGoalSkip()) { + getLog().warn("skipGoal flag is on, the goal is skip."); + return; + } + + if (generateOnce) { + // just copy the already generated changes.xml fil + + getLog().info("Use already generated " + xmlPath.getName() + " (" + cacheChangesFile + ")"); + + FileUtils.copyFile(cacheChangesFile, xmlPath); + + return; + } + + if (releaseVersion.getEffectiveDate() == null) { + getLog().warn("The version " + versionId + " is not effective on redmine, should update effective-date property to today"); + //TODO call the reset service rest/update_version + + releaseVersion.setEffectiveDate(new Date()); + } + + getLog().info("release project " + releaseProject.getName()); + getLog().info("release version " + releaseVersion.getName()); + getLog().info("release date " + releaseVersion.getEffectiveDate()); + getLog().info("release user " + releaseUser.getFirstname() + " " + releaseUser.getLastname()); + + // init issues collector + + IssuesCollector collector = new IssuesCollector(getLog(), verbose); + + // collects issues + + try { + + collector.collect(service, this); + + } catch (RedmineServiceException ex) { + collector.clearFilters(); + throw new MojoExecutionException("could not obtains issues for reason " + ex.getMessage(), ex); + } + + //TODO make some logic checks : version must be + // build the maven changes.xml as memory model + ChangesDocument doc = buildChangesDocument(releaseProject, releaseVersion, releaseUser, collector); + + // store the generated file + ChangesXpp3Writer xppWriter = new ChangesXpp3Writer(); + + XmlStreamWriter writer = new XmlStreamWriter(xmlPath); + + xppWriter.write(writer, doc); + + getLog().info("File saved in " + xmlPath.getParentFile().getAbsolutePath()); + + // cache result + cacheChangesFile = xmlPath; + } + + protected ChangesDocument buildChangesDocument(Project project, Version version, User user, IssuesCollector collector) throws RedmineServiceException { + ChangesDocument doc = new ChangesDocument(); + Properties properties = new Properties(); + Author author = new Author(); + author.setAuthorEmail(user.getMail()); + author.setName(user.getFirstname() + " " + user.getLastname()); + properties.setAuthor(author); + properties.setTitle(changesTitle); + doc.setProperties(properties); + + Body body = new Body(); + doc.setBody(body); + body.setModelEncoding(encoding); + + Issue[] issues = collector.getIssues(); + + // iterate on versions + for (Version v : versions) { + + boolean treateReleaseVersion = v.getId() == version.getId(); + + Issue[] issuesForVersion = ModelHelper.byVersionId(v.getId(), issues); + + Release release = new Release(); + body.addRelease(release); + + release.setVersion(v.getName()); + + if (v.getEffectiveDate() != null) { + + release.setDateRelease(dateFormat.format(v.getEffectiveDate())); + } + + if (v.getDescription() != null) { + release.setDescription(v.getDescription()); + } + + if (treateReleaseVersion) { + if (releaseDescription != null) { + + // override the release description + // this is the main version to release + release.setDescription(releaseDescription); + } + if (release.getDateRelease() == null) { + + release.setDateRelease(dateFormat.format(new Date())); + } + } + + // iterate on actions ? or order it + + for (Entry<Integer, String> entry : trackerToAction.entrySet()) { + + String type = entry.getValue(); + + // get issues for the tracker + Issue[] issuesForTracker = ModelHelper.byTrackerId(entry.getKey(), issuesForVersion); + + for (Issue issue : issuesForTracker) { + + // new action + Action action = new Action(); + action.setSystem("redmine"); + action.setAction(issue.getSubject()); + action.setIssue(issue.getId() + ""); + action.setType(type); + + if (issue.getDueDate() != null) { + action.setDate(dateFormat.format(issue.getDueDate())); + } else { + getLog().warn("issue " + issue.getSubject() + " has no dueDate..."); + } + + + int id = issue.getAssignedToId(); + if (id == 0) { + getLog().warn("issue " + issue.getSubject() + " is not assigned to any user, this is not normal..."); + id = issue.getAuthorId(); + } + User a = ModelHelper.byId(issue.getAuthorId(), users); + if (a != null) { + action.setDueTo(a.getFirstname() + " " + a.getLastname()); + action.setDueToEmail(a.getMail()); + + //TODO should check this is a developper name on pom.xml + action.setDev(a.getLogin()); + } + + release.addAction(action); + } + } + } + + return doc; + } + + protected MavenProject getExecutionRootProject() { + MavenProject root = project; + String executionRootDirectory = mavenSession.getExecutionRootDirectory(); + while (root != null) { + File basedir = root.getBasedir(); + getLog().debug("Current Folder:" + basedir); + boolean result = executionRootDirectory.equalsIgnoreCase(basedir.toString()); + if (result) { + break; + } + root = root.getParent(); + } + if (verbose) { + getLog().info("root project " + root); + } + return root; + } + + /////////////////////////////////////////////////////////////////////////// + /// IssueCollectionConfiguration + /////////////////////////////////////////////////////////////////////////// + @Override + public String getProjectId() { + return projectId; + } + + @Override + public String getVersionId() { + return versionId; + } + + @Override + public boolean isOnlyCurrentVersion() { + return onlyCurrentVersion; + } + + @Override + public int getMaxEntries() { + // no filter on priority for building the changes.xml file + return 0; + } + + @Override + public String getPriorityIds() { + // no filter on priority for building the changes.xml file + return null; + } + + @Override + public void setVersionId(String versionId) { + this.versionId = versionId; + } + + @Override + public String getCategoryIds() { + return getFilters().get("category"); + } + + @Override + public String getVersionNames() { + return getFilters().get("version"); + } + + @Override + public String getStatusIds() { + return getFilters().get("status"); + } + + @Override + public String getTrackerIds() { + return getFilters().get("tracker"); + } + + protected Map<String, String> getFilters() { + return filters; + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/GenerateChangesMojo.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/IssueCollectorConfiguration.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/IssueCollectorConfiguration.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/IssueCollectorConfiguration.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,32 @@ +package org.nuiton.jredmine.plugin; + +/** + * A simple contract to define the configuration of an issues collector. + * + * TODO javadoc + * + * @author chemit + * @since 1.0.0 + */ +public interface IssueCollectorConfiguration { + + boolean isOnlyCurrentVersion(); + + int getMaxEntries(); + + String getVersionNames(); + + String getPriorityIds(); + + String getStatusIds(); + + String getProjectId(); + + String getVersionId(); + + void setVersionId(String versionId); + + String getCategoryIds(); + + String getTrackerIds(); +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/IssueCollectorConfiguration.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/IssuesCollector.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/IssuesCollector.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/IssuesCollector.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,336 @@ +package org.nuiton.jredmine.plugin; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.apache.maven.plugin.logging.Log; +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.Tracker; +import org.nuiton.jredmine.model.Version; +import org.nuiton.jredmine.RedmineService; +import org.nuiton.jredmine.RedmineServiceException; + +/** + * A class to collect some issues due to given filters. + * + * @author chemit + * @since 1.0.0 + */ +public class IssuesCollector { + + /** + * logger + */ + protected final Log log; + /** + * verbose flag + */ + protected final boolean verbose; + /** + * to restrict on number of entries to collect + */ + protected Integer maxEntries; + /** + * the list of version ids collected + */ + protected List<Integer> versionIds; + /** + * the list of priority ids collected + */ + protected List<Integer> priorityIds; + /** + * the list of status ids collected + */ + protected List<Integer> statusIds; + /** + * the list of category ids collected + */ + protected List<Integer> categoryIds; + /** + * the list of tracker ids collected + */ + protected List<Integer> trackerIds; + /** + * the list of issues collected + */ + protected Issue[] issues; + + public IssuesCollector(Log log, boolean verbose) { + this.log = log; + this.verbose = verbose; + } + + /** + * Collects the issues given the configuration passed. + * + * @param service + * @param config the collector configuration + * + * @throws RedmineServiceException if any pb while retreave datas from redmine + */ + public void collect(RedmineService service, IssueCollectorConfiguration config) throws RedmineServiceException { + + clearFilters(); + + prepareFilters(service, config); + + // obtain versions to treate + + Version[] versions; + String projectId = config.getProjectId(); + + log.info("report project : " + projectId); + + versions = service.getVersions(projectId); + if (versionIds != null) { + // filtre sur version + versions = ModelHelper.byIds(Version.class, versions, versionIds.toArray(new Integer[versionIds.size()])); + } + + int nbIssues = 0; + + List<Issue> issueList = new ArrayList<Issue>(); + + for (Version v : versions) { + + if (verbose) { + log.info("discover all issues for version " + v.getName()); + } + + Issue[] currentIssues = service.getIssues(projectId, v.getName()); + for (Issue i : currentIssues) { + + if (canIncludeIssue(i)) { + issueList.add(i); + nbIssues++; + if (maxEntries != null && nbIssues >= maxEntries) { + break; + } + } + } + if (maxEntries != null && nbIssues >= maxEntries) { + break; + } + } + + issues = issueList.toArray(new Issue[issueList.size()]); + } + + public Integer getMaxEntries() { + return maxEntries; + } + + public List<Integer> getPriorityIds() { + return priorityIds; + } + + public List<Integer> getStatusIds() { + return statusIds; + } + + public List<Integer> getCategoryIds() { + return categoryIds; + } + + public List<Integer> getVersionIds() { + return versionIds; + } + + public List<Integer> getTrackerIds() { + return trackerIds; + } + + public Issue[] getIssues() { + return issues; + } + + /** + * clean all internal states. + * + * Note : this method is invoked at the begin of each + * {@link #collect(org.nuiton.jredmine.IssueCollectorConfiguration)} method. + */ + public void clearFilters() { + maxEntries = null; + priorityIds = null; + statusIds = null; + categoryIds = null; + trackerIds = null; + versionIds = null; + issues = null; + } + + /** + * Prepare the collector filters due to the given collector configuration. + * + * @param service + * @param config the collector configuration + * @throws RedmineServiceException if any pb whiile retreaving redmine's datas + */ + protected void prepareFilters(RedmineService service, IssueCollectorConfiguration config) throws RedmineServiceException { + + // maxEntries filter + + maxEntries = config.getMaxEntries(); + if (maxEntries == 0) { + // no limit + maxEntries = null; + } else { + log.info("limit issues : " + maxEntries); + } + + String projectId = config.getProjectId(); + + String tmp; + + // filter version + + tmp = config.getVersionNames(); + if (log.isDebugEnabled()) { + log.debug("version to filter : " + tmp); + } + if (tmp != null && !tmp.trim().isEmpty()) { + if (config.isOnlyCurrentVersion()) { + // not possible + log.warn("will not filter on versions while using the flag 'onlyCurrentVersion'"); + } else { + versionIds = new ArrayList<Integer>(); + List<String> svs = Arrays.asList(tmp.split(",")); + for (Version v : service.getVersions(projectId)) { + if (svs.contains(v.getName())) { + // keep the version + versionIds.add(v.getId()); + log.info("use version " + v.getName()); + } + } + } + } + + if (config.isOnlyCurrentVersion()) { + Version currentVersion = service.getVersion(projectId, config.getVersionId()); + versionIds = Arrays.asList(currentVersion.getId()); + } + + // filter status + + tmp = config.getStatusIds(); + this.statusIds = null; + if (tmp != null && !tmp.trim().isEmpty()) { + // filter on status + this.statusIds = new ArrayList<Integer>(); + List<Integer> svs = toIntegerList(tmp.split(",")); + for (IssueStatus s : service.getIssueStatuses()) { + int id = s.getId(); + if (svs.contains(id)) { + // keep this status + this.statusIds.add(id); + log.info("use status " + s.getName()); + } + } + } + + // filter priority + + tmp = config.getPriorityIds(); + if (tmp != null && !tmp.trim().isEmpty()) { + // filter on status + this.priorityIds = new ArrayList<Integer>(); + List<Integer> svs = toIntegerList(tmp.split(",")); + for (IssuePriority s : service.getIssuePriorities()) { + int id = s.getId(); + if (svs.contains(id)) { + // keep this status + this.priorityIds.add(id); + log.info("use priority " + s.getName()); + } + } + } + + // filter priority + + tmp = config.getCategoryIds(); + if (tmp != null && !tmp.trim().isEmpty()) { + // filter on status + this.categoryIds = new ArrayList<Integer>(); + List<Integer> svs = toIntegerList(tmp.split(",")); + for (IssueCategory s : service.getIssueCategories(projectId)) { + int id = s.getId(); + if (svs.contains(id)) { + // keep this status + this.categoryIds.add(id); + log.info("use category " + s.getName()); + } + } + } + + // filter tracker + tmp = config.getTrackerIds(); + if (tmp != null && !tmp.trim().isEmpty()) { + // filter on status + this.trackerIds = new ArrayList<Integer>(); + List<Integer> svs = toIntegerList(tmp.split(",")); + for (Tracker s : service.getTrackers(projectId)) { + int id = s.getId(); + if (svs.contains(id)) { + // keep this status + this.trackerIds.add(id); + log.info("use tracker " + s.getName()); + } + } + } + } + + /** + * Test if a given issue can be collected. + * + * @param i the issue ti test + * @return <code>true</code> if the issue can be collected, <code>false</code> + * otherwise. + */ + protected boolean canIncludeIssue(Issue i) { + if (statusIds != null) { + // filter on status + if (!statusIds.contains(i.getStatusId())) { + // reject status + return false; + } + } + if (priorityIds != null) { + // filter on priority + if (!priorityIds.contains(i.getPriorityId())) { + // reject priority + return false; + } + } + if (categoryIds != null) { + // filter on category + if (!categoryIds.contains(i.getCategoryId())) { + // reject category + return false; + } + } + if (trackerIds != null) { + // filter on tracker + if (!trackerIds.contains(i.getTrackerId())) { + // reject tracker + return false; + } + } + + // ok + return true; + } + + protected List<Integer> toIntegerList(String[] strIds) { + int length = strIds.length; + List<Integer> r = new ArrayList<Integer>(length); + for (int i = 0; i < length; i++) { + r.add(Integer.valueOf(strIds[i])); + } + return r; + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/IssuesCollector.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojo.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojo.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojo.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,214 @@ +package org.nuiton.jredmine.plugin; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Properties; +import org.apache.maven.plugin.MojoExecutionException; +import org.nuiton.jredmine.model.Attachment; +import org.nuiton.util.PluginHelper; + +/** + * Publish files for a given project and version on redmine server. + * + * @goal publish-attachments + * + * @author tchemit + * @since 1.0.0 + */ +public class PublishAttachmentsMojo extends AbstractRedmineMojo { + + /** + * The path of a properties files where files to deploy are descriped. + * <p/> + * The key of a property is the sortor key + * <p/> + * The value of a property is the path of the file to upload. + * <p/> + * If no Set - will not use this source + * + * @parameter expression="${redmine.filesFromProperties}" + * @since 1.0.0 + */ + protected File filesFromProperties; + /** + * A list of files to deploy. + * <p/> + * If no Set - will not use this source + * + * @parameter expression="${redmine.files}" + * @since 1.0.0 + */ + protected File[] files; + /** + * A flag to skip the goal. + * + * @parameter expression="${redmine.skipCollectReleaseAttachments}" default-value="false" + * @since 1.0.0 + */ + protected boolean skipPublishAttachments; + /** + * A flag to test plugin but send nothing to redmine. + * + * @parameter expression="${redmine.dryRun}" default-value="false" + * @since 1.0.0 + */ + protected boolean dryRun; + /** + * A flag to restirct only one run in a build (for multi-module context). + * + * @parameter expression="${redmine.runOnce}" default-value="true" + * @since 1.0.0 + */ + private boolean runOnce; + protected List<File> allFiles; + private boolean runOnceDone; + + public PublishAttachmentsMojo() { + super(true, true, true); + } + + protected boolean isGoalSkip() { + return skipPublishAttachments; + } + + @Override + protected boolean init() throws Exception { + + if (isGoalSkip()) { + + return true; + } + + runOnceDone = false; + if (runOnce) { + // check + + if (!isExecutionRoot()) { + getLog().info("runOnce flag is on, will skip the goal"); + runOnceDone = true; + return true; + } + } + versionId = PluginHelper.removeSnapshotSuffix(versionId); + + if (!super.init()) { + + return false; + } + + if (filesFromProperties != null && !filesFromProperties.exists()) { + // no file to publish... + getLog().warn("could not find the properties file " + filesFromProperties); + getLog().warn("will not use this source"); + filesFromProperties = null; + } + + if (filesFromProperties != null && files != null && files.length > 0) { + getLog().warn("can not use both sources files and filesFromProperties"); + return false; + } + + if (filesFromProperties != null) { + + allFiles = getFilesToDeploy(); + + } else { + allFiles = Arrays.asList(files); + } + + if (allFiles.isEmpty()) { + getLog().warn("No files to send."); + getLog().warn("will skip publish news to redmine..."); + return false; + } + + return true; + } + + @Override + protected void doAction() throws Exception { + + if (runOnce && runOnceDone) { + return; + } + if (isGoalSkip()) { + getLog().info("skipGoal flag is on, the goal is skip."); + return; + } + + if (dryRun) { + getLog().info("\n dryRun flag is on, no data will be send!\n"); + } + + String basedir = project.getBasedir().getAbsolutePath(); + int basedirLength = basedir.length() + 1; + for (File f : allFiles) { + + if (!f.exists()) { + getLog().warn("can not upload a non existing file " + f); + continue; + } + + if (f.getAbsolutePath().startsWith(basedir)) { + getLog().info("upload " + f.getAbsolutePath().substring(basedirLength)); + } else { + getLog().info("upload " + f.getAbsolutePath()); + } + + if (dryRun) { + continue; + } + + // upload the file + + long t0 = System.nanoTime(); + Attachment a = new Attachment(); + a.setFilename(f.getName()); + a.setAuthorId(releaseUser.getId()); + a.setContainerId(releaseVersion.getId()); + + //a.setDescription("a description test..."); + a.setToUpload(f); + + // do upload + Attachment result = service.addAttachment(projectId, releaseVersion.getName(), a); + long t1 = System.nanoTime(); + if (verbose) { + getLog().info("done in " + PluginHelper.convertTime(t1 - t0) + ". attachment id : " + result.getId() + ", size : " + PluginHelper.convertMemory(f.length())); + } + } + } + + protected List<File> getFilesToDeploy() throws MojoExecutionException { + + Properties p = new Properties(); + + // load definition file + + try { + p.load(new FileInputStream(filesFromProperties)); + getLog().info("Load " + filesFromProperties); + } catch (IOException ex) { + throw new MojoExecutionException("could not load file " + filesFromProperties, ex); + } + + List<File> results = new ArrayList<File>(); + + // sort attachments by file names + + List<String> names = new ArrayList<String>(p.stringPropertyNames()); + Collections.sort(names); + + for (String f : names) { + File file = new File(p.getProperty(f)); + results.add(file); + } + return results; + } +} + Property changes on: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojo.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishNewsMojo.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishNewsMojo.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishNewsMojo.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,163 @@ +package org.nuiton.jredmine.plugin; + +import java.io.File; +import org.nuiton.jredmine.model.News; +import org.nuiton.util.PluginHelper; + +/** + * Publish a news on redmine server. + * + * @goal publish-news + * + * @author tchemit + * @since 1.0.0 + */ +public class PublishNewsMojo extends AbstractRedmineMojo { + + /** + * The content file of the news. + * + * @parameter expression="${redmine.newsContentFile}" + * @required + * @since 1.0.0 + */ + private File newsContentFile; + /** + * Short description or introduction of the released artifact. + * + * @parameter expression="${redmine.newsSummary}" + * @since 1.0.0 + */ + private String newsSummary; + /** + * The title of the news to create on redmine server. + * + * <b>Note : </b> the size can not be more than 60 caracters (due to a + * redmine limitation). + * + * @parameter expression="${redmine.newsTitle}" + * @required + * @since 1.0.0 + */ + private String newsTitle; + /** + * A flag to skip the goal. + * + * @parameter expression="${redmine.skipPublishNews}" default-value="false" + * @since 1.0.0 + */ + private boolean skipPublishNews; + /** + * A flag to test plugin but send nothing to redmine. + * + * @parameter expression="${redmine.dryRun}" default-value="false" + * @since 1.0.0 + */ + protected boolean dryRun; + /** + * A flag to restirct only one run in a build (for multi-module context). + * + * @parameter expression="${redmine.runOnce}" default-value="true" + * @since 1.0.0 + */ + private boolean runOnce; + private boolean runOnceDone; + + protected boolean isGoalSkip() { + return skipPublishNews; + } + + public PublishNewsMojo() { + super(true, false, true); + } + + @Override + protected boolean init() throws Exception { + + if (isGoalSkip()) { + + return true; + } + + runOnceDone = false; + if (runOnce) { + // check + + if (!isExecutionRoot()) { + getLog().info("runOnce flag is on, will skip the goal"); + runOnceDone = true; + return true; + } + } + if (!super.init()) { + return false; + } + + if (newsSummary == null || newsSummary.trim().isEmpty()) { + newsSummary = project.getUrl(); + } + + if (!newsContentFile.exists()) { + // no file to publish... + getLog().warn("could not find the template " + newsContentFile); + return false; + } + + newsTitle = newsTitle.trim(); + if (newsTitle.length() > 60) { + getLog().warn("News title can not be longer than 60 cars, but was " + newsTitle.length()); + newsTitle = newsTitle = newsTitle.substring(0, 59); + getLog().warn("will use the restricted title : " + newsTitle); + } + + return true; + } + + @Override + protected void doAction() throws Exception { + if (runOnce && runOnceDone) { + return; + } + if (isGoalSkip()) { + getLog().info("skipGoal flag is on, the goal is skip."); + return; + } + + if (dryRun) { + getLog().info("\n dryRun flag is on, no data will be send!\n"); + } + + // create news to publish + + News news = new News(); + news.setAuthorId(releaseUser.getId()); + news.setProjectId(releaseProject.getId()); + news.setTitle(newsTitle); + news.setSummary(newsSummary); + + String newsContent = PluginHelper.readAsString(newsContentFile, encoding); + + news.setDescription(newsContent); + + if (dryRun) { + getLog().info("news title : " + news.getTitle()); + getLog().info("news summary : " + news.getSummary()); + getLog().info("news content :\n" + newsContent); + return; + } + + // publish news + + getLog().info("publish news " + news.getTitle()); + + if (verbose) { + getLog().info("redmine announcement :\n" + newsContent); + } + + news = service.addNews(releaseProject.getName(), news); + + if (verbose) { + getLog().info("done. news id : " + news.getId()); + } + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishNewsMojo.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/SendEmailMojo.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/SendEmailMojo.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/SendEmailMojo.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,458 @@ +package org.nuiton.jredmine.plugin; + +import org.apache.maven.plugin.announcement.MailSender; +import org.nuiton.util.PluginHelper; + +import java.io.File; +import java.util.List; + +import org.apache.maven.execution.MavenSession; +import org.apache.maven.model.Developer; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.announcement.mailsender.ProjectJavamailMailSender; +import org.apache.maven.project.MavenProject; +import org.apache.maven.settings.Server; +import org.apache.maven.settings.Settings; +import org.codehaus.plexus.logging.Logger; +import org.codehaus.plexus.logging.console.ConsoleLogger; +import org.codehaus.plexus.mailsender.MailMessage; +import org.codehaus.plexus.mailsender.MailSenderException; +import org.nuiton.plugin.AbstractPlugin; +import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher; + +/** + * Send a email. + * + * @goal send-email + * @requiresOnline true + * @requiresProject true + * + * @author tchemit + * @since 1.0.0 + */ +public class SendEmailMojo extends AbstractPlugin { + + /** + * @parameter expression="${session}" + * @required + * @readonly + */ + protected MavenSession mavenSession; + /** + * Dependance du projet. + * + * @parameter default-value="${project}" + * @required + * @readonly + * @since 1.0.0 + */ + protected MavenProject project; + /** + * Dependance du settings. + * + * @parameter default-value="${settings}" + * @required + * @readonly + * @since 1.0.0 + */ + protected Settings settings; + /** + * Un flag pour activer le mode verbeux. + * + * @parameter expression="${helper.verbose}" default-value="${maven.verbose}" + * @since 1.0.0 + */ + protected boolean verbose; + /** + * The Velocity template used to format the email announcement. + * + * @parameter expression="${helper.emailContentFile}" + * @required + * @since 1.0.0 + */ + private File emailContentFile; + /** + * The title of the email to send. + * + * @parameter expression="${helper.emailTitle}" + * @required + * @since 1.0.0 + */ + private String emailTitle; + /** + * Smtp Server. + * + * @parameter expression="${helper.smtpHost}" + * @required + */ + private String smtpHost; + /** + * Port. + * + * @parameter default-value="25" expression="${helper.smtpPort}" + * @required + */ + private int smtpPort; + /** + * The username used to send the email. + * + * @parameter expression="${helper.username}" + */ + private String username; + /** + * The password used to send the email. + * + * @parameter expression="${helper.password}" + */ + private String password; + /** + * Server id to use for authentication (must be defined in your setting + * and use the maven >= 2.1.0 password encryption mecanism). + * <p/> + * + * @parameter expression="${helper.serverId}" + * @since 1.0.0 + */ + protected String serverId; + /** + * If the email should be sent in SSL mode. + * + * @parameter default-value="false" expression="${helper.sslMode}" + */ + private boolean sslMode; + /** + * The id of the developer sending the announcement mail. Only used if the <tt>mailSender</tt> + * attribute is not set. In this case, this should match the id of one of the developers in + * the pom. If a matching developer is not found, then the first developer in the pom will be + * used. + * + * @parameter expression="${helper.fromDeveloperId}" + */ + private String fromDeveloperId; + /** + * Defines the sender of the announcement if the list of developer is empty or + * if the sender is not a member of the development team. + * + * @parameter expression="${helper.mailSender}" + */ + private MailSender mailSender; + /** + * Recipient email address. + * + * @parameter + * @required + */ + private List<String> toAddresses; + /** + * Possible senders. + * + * @parameter expression="${project.developers}" + * @required + * @readonly + */ + private List<Developer> from; + /** + * Mail content type to use. + * @parameter default-value="text/plain" + * @required + * @since 2.1 + */ + private String mailContentType; + /** + * The encoding used to read and write files. + * + * @parameter expression="${helper.encoding}" default-value="${project.build.sourceEncoding}" + * @since 1.0.0 + */ + protected String encoding; + /** + * A flag to skip the goal. + * + * @parameter expression="${helper.skipSendEmail}" default-value="false" + * @since 1.0.0 + */ + private boolean skipSendEmail; + /** + * A flag to test plugin but send nothing to redmine. + * + * @parameter expression="${dryRun}" default-value="false" + * @since 1.0.0 + */ + protected boolean dryRun; + /** + * A flag to restirct only one run in a build (for multi-module context). + * + * @parameter expression="${redmine.runOnce}" default-value="true" + * @since 1.0.0 + */ + private boolean runOnce; + /** + * password decypher + * + * @component roleHint="maven-redmine-plugin" + * @since 1.0.0 + */ + protected SecDispatcher sec; + private boolean runOnceDone; + /////////////////////////////////////////////////////////////////////////// + /// Plugin + /////////////////////////////////////////////////////////////////////////// + + @Override + public MavenProject getProject() { + return project; + } + + @Override + public void setProject(MavenProject project) { + this.project = project; + } + + @Override + public boolean isVerbose() { + return verbose; + } + + @Override + public void setVerbose(boolean verbose) { + this.verbose = verbose; + } + + @Override + protected boolean ensurePackaging() { + // accept all project's packaging + return false; + } + + /////////////////////////////////////////////////////////////////////////// + /// AbstractPlugin + /////////////////////////////////////////////////////////////////////////// + protected boolean isGoalSkip() { + return skipSendEmail; + } + + @Override + protected boolean init() throws Exception { + + if (isGoalSkip()) { + return true; + } + + runOnceDone = false; + if (runOnce) { + // check + + if (!isExecutionRoot()) { + getLog().info("runOnce flag is on, will skip the goal"); + runOnceDone = true; + return true; + } + } + + if (!emailContentFile.exists()) { + // no file to publish... + getLog().warn("could not find the template " + emailContentFile); + getLog().warn("will skip send email..."); + return false; + } + + // check server (if used) + + Server server = null; + + if (serverId != null && !serverId.trim().isEmpty()) { + + server = settings.getServer(serverId); + + if (server == null) { + getLog().error("Could not find server with id '" + serverId + "', check your settings.xml file."); + return false; + } + } + + // check authentication configuration is stable + + boolean noUsername = username == null || username.trim().isEmpty(); + boolean noPassword = password == null || password.trim().isEmpty(); + + if (server != null && !noUsername) { + getLog().error("Authentication configuration is wrong :\ncan not use both 'serverId' and 'username' parameters, check your plugin configuration."); + return false; + } + + if (server != null && !noPassword) { + getLog().error("Authentication configuration is wrong :\ncan not use both 'serverId' and 'password' parameters, check your plugin configuration."); + return false; + } + + if ((noUsername && !noPassword) || (!noUsername && noPassword)) { + getLog().error("Authentication configuration is wrong :\nconfiguration is not complete, please fill parameter 'serverId' or 'username' and 'password'."); + return false; + } + + if (server != null) { + // obtain username and password from server + + username = server.getUsername(); + password = sec.decrypt(server.getPassword()); + } + + // check mail sender + + if (mailSender == null) { + + if (from == null || from.isEmpty()) { + getLog().warn("The <developers> section in your pom should not be empty. Add a <developer> entry or set the " + "mailSender parameter."); + getLog().warn("will skip send email..."); + return false; + } + + if (fromDeveloperId == null) { + final Developer dev = from.get(0); + mailSender = new MailSender(dev.getName(), dev.getEmail()); + } else { + for (Developer developer : from) { + if (fromDeveloperId.equals(developer.getId())) { + mailSender = new MailSender(developer.getName(), developer.getEmail()); + break; + } + } + if (mailSender == null) { + getLog().warn("Missing developer with id '" + fromDeveloperId + "' in the <developers> section in your pom."); + getLog().warn("will skip send email..."); + return false; + } + } + } + + String fromAddress = mailSender.getEmail(); + if (fromAddress == null || fromAddress.equals("")) { + getLog().warn("Invalid mail sender: name and email is mandatory (" + mailSender + ")."); + getLog().warn("will skip send email..."); + return false; + } + + return true; + } + + @Override + protected void doAction() throws Exception { + if (runOnce && runOnceDone) { + return; + } + if (isGoalSkip()) { + getLog().info("skipGoal flag is on, the goal is skip."); + return; + } + + if (dryRun) { + getLog().info("\n dryRun flag is on, no mail will be send!\n"); + } + + String newsContent = PluginHelper.readAsString(emailContentFile, encoding); + + MailMessage mailMsg = createMessage(newsContent, mailSender); + + + ProjectJavamailMailSender mailer = createMailer(); + + if (getLog().isDebugEnabled()) { + getLog().debug("fromDeveloperId: " + fromDeveloperId); + } + + if (dryRun) { + getLog().info("Mail title : " + emailTitle); + getLog().info("Mail content :\n" + mailMsg.getContent()); + return; + } + getLog().info("Connecting to Host: " + smtpHost + ":" + smtpPort); + + try { + + mailer.send(mailMsg); + getLog().info("Sent..."); + } catch (MailSenderException e) { + throw new MojoExecutionException("Failed to send email for reason " + e.getMessage(), e); + } + } + + /////////////////////////////////////////////////////////////////////////// + /// Other + /////////////////////////////////////////////////////////////////////////// + protected MailMessage createMessage(String newsContent, MailSender mailSender) throws MailSenderException { + + String fromName = mailSender.getName(); + String fromAddress = mailSender.getEmail(); + + getLog().info("Using this sender for email announcement: " + fromAddress + " < " + fromName + " > "); + + MailMessage mailMsg = new MailMessage(); + mailMsg.setSubject(emailTitle); + if (getLog().isDebugEnabled()) { + getLog().debug("email announcement :\n" + newsContent); + } + mailMsg.setContent(newsContent); + mailMsg.setContentType(mailContentType); + mailMsg.setFrom(fromAddress, fromName); + for (String e : toAddresses) { + getLog().info("Sending mail to " + e + "..."); + mailMsg.addTo(e, ""); + } + return mailMsg; + } + + protected ProjectJavamailMailSender createMailer() { + + ProjectJavamailMailSender mailer = new ProjectJavamailMailSender(); + ConsoleLogger logger = new ConsoleLogger(Logger.LEVEL_INFO, "base"); + if (getLog().isDebugEnabled()) { + logger.setThreshold(Logger.LEVEL_DEBUG); + } + mailer.enableLogging(logger); + mailer.setSmtpHost(smtpHost); + mailer.setSmtpPort(smtpPort); + mailer.setSslMode(sslMode); + if (username != null) { + mailer.setUsername(username); + } + if (password != null) { + mailer.setPassword(password); + } + mailer.initialize(); + return mailer; + } + + public void setMailSender(MailSender sender) { + this.mailSender = sender; + } + + public void setFrom(List<Developer> from) { + this.from = from; + } + + public void setToAddresses(List<String> toAddresses) { + this.toAddresses = toAddresses; + } + + protected boolean isExecutionRoot() { + return project == getExecutionRootProject(); + } + + protected MavenProject getExecutionRootProject() { + MavenProject root = project; + String executionRootDirectory = mavenSession.getExecutionRootDirectory(); + while (root != null) { + File dir = root.getBasedir(); + getLog().debug("Current Folder:" + dir); + boolean result = executionRootDirectory.equalsIgnoreCase(dir.toString()); + if (result) { + break; + } + root = root.getParent(); + } + if (verbose) { + getLog().info("root project " + root); + } + return root; + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/SendEmailMojo.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/UpdateVersionMojo.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/UpdateVersionMojo.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/UpdateVersionMojo.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,183 @@ +package org.nuiton.jredmine.plugin; + +import java.text.ParseException; +import java.util.Date; +import org.apache.maven.plugin.MojoExecutionException; +import org.nuiton.jredmine.model.ModelHelper; +import org.nuiton.jredmine.model.Version; +import org.nuiton.util.PluginHelper; + +/** + * Create or update a version on redmine server. + *<p/> + * Will add a the version if not existing, otherwise, will update the version. + * + * @goal update-version + * + * @author tchemit + * @since 1.0.0 + */ +public class UpdateVersionMojo extends AbstractRedmineMojo { + + /** + * The news description to update to redmine server. + * + * Note : if not set, no update of the description will be made. + * + * @parameter expression="${redmine.versionDescription}" + * @since 1.0.0 + */ + protected String versionDescription; + /** + * A flag to close the version on redmine (will fix effectiveDate). + * + * @parameter expression="${redmine.closeVersion}" default-value="false" + * @since 1.0.0 + */ + private boolean closeVersion; + /** + * The effective date to set on the version. + * <p/> + * The format of the date is {@code yyyy-mm-dd}. + * <p/> + * If not Set - will use current day date only if {@link #closeVersion} + * flag is on. + * + * @parameter expression="${redmine.effectiveDate}" + * @since 1.0.0 + */ + private String effectiveDate; + /** + * A flag to skip the goal. + * + * @parameter expression="${redmine.skipUpdateVersion}" default-value="false" + * @since 1.0.0 + */ + private boolean skipUpdateVersion; + /** + * A flag to test plugin but send nothing to redmine. + * + * @parameter expression="${redmine.dryRun}" default-value="false" + * @since 1.0.0 + */ + protected boolean dryRun; + /** + * A flag to restirct only one run in a build (for multi-module context). + * + * @parameter expression="${redmine.runOnce}" default-value="true" + * @since 1.0.0 + */ + private boolean runOnce; + /** + * effective date to set + */ + private Date date; + private boolean runOnceDone; + + public UpdateVersionMojo() { + super(true, false, true); + } + + protected boolean isGoalSkip() { + return skipUpdateVersion; + } + + @Override + protected boolean init() throws Exception { + + if (isGoalSkip()) { + return true; + } + runOnceDone = false; + if (runOnce) { + // check + + if (!isExecutionRoot()) { + getLog().info("runOnce flag is on, will skip the goal"); + runOnceDone = true; + return true; + } + } + + if (versionId == null || versionId.trim().isEmpty()) { + throw new MojoExecutionException("required a versionId parameter"); + } + + versionId = PluginHelper.removeSnapshotSuffix(versionId); + + if (effectiveDate != null && !effectiveDate.trim().isEmpty()) { + try { + date = dateFormat.parse(effectiveDate); + } catch (ParseException e) { + throw new MojoExecutionException("could not parse effectivate date " + effectiveDate + " for reason " + e.getMessage(), e); + } + } else if (closeVersion) { + date = new Date(); + } + + return super.init(); + } + + @Override + protected void doAction() throws Exception { + if (runOnce && runOnceDone) { + return; + } + if (isGoalSkip()) { + getLog().info("skipGoal flag is on, the goal is skip."); + return; + } + + if (dryRun) { + getLog().info("\n dryRun flag is on, no data will be send!\n"); + } + + // get version + + boolean needCreateVersion; + + Version[] versions = service.getVersions(projectId); + Version v = ModelHelper.byVersionName(versionId, versions); + + if (v == null) { + // version must be created + needCreateVersion = true; + v = new Version(); + v.setName(versionId); + } else { + + needCreateVersion = false; + } + + if (versionDescription != null && !versionDescription.trim().isEmpty()) { + v.setDescription(versionDescription.trim()); + } + + if (date != null) { + v.setEffectiveDate(date); + } + + this.releaseVersion = v; + + // prepare version + if (needCreateVersion) { + + // create version + getLog().info("create version " + releaseVersion.getName()); + + if (!dryRun) { + service.addVersion(projectId, releaseVersion); + } + + } else { + + // update version + getLog().info("udpate version " + releaseVersion.getName()); + + if (!dryRun) { + service.updateVersion(projectId, releaseVersion); + } + } + + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/UpdateVersionMojo.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/AbstractAnnouncementMojo.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/AbstractAnnouncementMojo.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/AbstractAnnouncementMojo.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,304 @@ +package org.nuiton.jredmine.plugin.announcement; + +import java.io.File; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.changes.ChangesXML; +import org.apache.maven.plugins.changes.model.Release; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.VelocityEngine; +import org.apache.velocity.context.Context; +import org.codehaus.plexus.util.ReaderFactory; +import org.codehaus.plexus.util.StringUtils; +import org.codehaus.plexus.velocity.VelocityComponent; +import org.nuiton.jredmine.plugin.AbstractRedmineMojo; + +/** + * + * @author chemit + * @requiresOnline true + */ +public abstract class AbstractAnnouncementMojo extends AbstractRedmineMojo { + + /** + * Directory where the template file will be generated. + * + * @parameter expression="${redmine.templateOutputDirectory}" default-value="${project.build.directory}/announcement" + * @required + * @since 1.0.0 + */ + private File templateOutputDirectory; + /** + * The path of the changes.xml file. + * + * @parameter expression="${redmine.xmlPath}" default-value="${basedir}/src/changes/changes.xml" + * @required + * @since 1.0.0 + */ + private File xmlPath; + /** + * Directory that contains the template. + * <p> + * <b>Note:</b> This directory must be a subdirectory of + * <code>/src/main/resources/ or current project base directory</code>. + * </p> + * + * @parameter expression="${redmine.templateDirectory}" default-value="org/nuiton/jredmine/plugin/announcement" + * @required + * @since 1.0.0 + */ + private String templateDirectory; + /** + * The template encoding. + * + * @parameter expression="${redmine.templateEncoding}" default-value="${project.build.sourceEncoding}" + * @since 1.0.0 + */ + private String templateEncoding; + /** + * Map which will be pass to the velocity context + * @parameter + * @since 1.0.0 + */ + private Map<String, Object> announceParameters; +// /** +// * Template strings per system that is used to discover the URL to use to display an attchment. Each key in this +// * map denotes the (case-sensitive) identifier of the issue tracking system and its value gives the URL template. +// * <p> +// * There are 2 template tokens you can use. <code>%URL%</code>: this is computed by getting the +// * <code><issueManagement>/<url></code> value from the POM, and removing the last '/' +// * and everything that comes after it. <code>%FILE%</code>: this is the issue number. +// * </p> +// * +// * @parameter expression="${redmine.attachmentLinkTemplate}" +// * @since 1.0.0 +// */ +// protected String attachmentLinkTemplate; + /** + * @parameter expression="${project.groupId}" + * @readonly + * @since 1.0.0 + */ + private String groupId; + /** + * @parameter expression="${project.artifactId}" + * @readonly + * @since 1.0.0 + */ + private String artifactId; + /** + * Distribution url of the artifact. + * + * @parameter expression="${project.url}" + * @required + * @since 1.0.0 + */ + private String url; + /** + * Packaging structure for the artifact. + * + * @parameter expression="${project.packaging}" + * @readonly + * @since 1.0.0 + */ + private String packaging; + /** + * The name of the artifact to be used in the announcement. + * + * @parameter expression="${redmine.finalName}" default-value="${project.build.finalName}" + * @required + * @since 1.0.0 + */ + private String finalName; + /** + * The current project base directory. + * + * @parameter expression="${basedir}" + * @required + * @since 1.0.0 + */ + private String basedir; + /** + * URL where the artifact can be downloaded. If not specified, + * no URL is used. + * + * @parameter + * @since 1.0.0 + */ + private String urlDownload; + /** + * Name of the team that develops the artifact. + * + * @parameter expression="${redmine.developmentTeam}" default-value="${project.name} team" + * @required + * @since 1.0.0 + */ + private String developmentTeam; + /** + * Short description or introduction of the released artifact. + * + * @parameter expression="${redmine.introduction}" default-value="${project.description}" + * @since 1.0.0 + */ + private String introduction; + /** + * A flag to restirct only one run in a build (for multi-module context). + * + * @parameter expression="${redmine.runOnce}" default-value="true" + * @since 1.0.0 + */ + private boolean runOnce; + /** + * Velocity Component. + * + * @component roleHint="maven-changes-plugin" + */ + private VelocityComponent velocity; + private boolean runOnceDone; + + protected abstract String getAnnouncementTemplate(); + + protected abstract boolean isGoalSkip(); + + protected AbstractAnnouncementMojo() { + super(true, false, true); +// super(true, true, true); + } + + @Override + protected boolean init() throws Exception { + + if (isGoalSkip()) { + return true; + } + + runOnceDone = false; + if (runOnce) { + // check + + if (!isExecutionRoot()) { + getLog().info("runOnce flag is on, will skip the goal"); + runOnceDone = true; + return true; + } + } + + if (!super.init()) { + return false; + } + + if (!xmlPath.exists()) { + getLog().warn("can not find redmine-template at " + xmlPath + ", goal is skip"); + return false; + } + + if (StringUtils.isEmpty(templateEncoding)) { + templateEncoding = ReaderFactory.FILE_ENCODING; + getLog().warn( + "File encoding has not been set, using platform encoding " + templateEncoding + ", i.e. build is platform dependent!"); + } + + if (introduction == null || introduction.trim().isEmpty()) { + introduction = project.getUrl(); + } + + return true; + } + + @Override + protected void doAction() throws Exception { + + if (isGoalSkip()) { + getLog().info("skipGoal flag is on, the goal is skip."); + return; + } + + if (runOnce && runOnceDone) { + return; + } + + // do upload files to redmine, + + ChangesXML changesXml = new ChangesXML(xmlPath, getLog()); + + List<?> releases = changesXml.getReleaseList(); + + String template = getAnnouncementTemplate(); + + File out = new File(templateOutputDirectory, template); + + if (verbose) { + getLog().info("destination file " + out); + } + + getLog().info("Creating announcement [" + template + "] from " + xmlPath); + + VelocityEngine engine = velocity.getEngine(); + + engine.setApplicationAttribute("baseDirectory", basedir); + + AnnouncementGenerator generator = new AnnouncementGenerator(getLog(), url, ""); +// AnnouncementGenerator generator = new AnnouncementGenerator(getLog(), url, attachmentLinkTemplate); + + Context context = createVelocityContext(generator, releases); + + // generate redmine announcement file + + generator.doGenerate(engine, context, out, templateDirectory + "/" + template, templateEncoding); + + getLog().info("Created announcement [" + template + "] in " + out); + + } + + public Context createVelocityContext(AnnouncementGenerator generator, List<?> releases) throws MojoExecutionException { + + // prepare velocity context + Context context = new VelocityContext(); + context.put("releases", releases); + context.put("groupId", groupId); + context.put("artifactId", artifactId); + context.put("version", versionId); +// context.put("version", releaseVersion.getName()); + context.put("packaging", packaging); + context.put("url", url); + + Release release = generator.getLatestRelease(releases, versionId); +// Release release = generator.getLatestRelease(releases, releaseVersion.getName()); + + context.put("release", release); + context.put("introduction", introduction); + context.put("developmentTeam", developmentTeam); + context.put("finalName", finalName); + context.put("urlDownload", urlDownload); + context.put("project", project); +// +// if (downloads != null && downloads.length > 0) { +// Map<Attachment, String> attachmentsUrls = generator.getAttachmentsUrls(downloads); +// Object urls; +// if (attachmentsUrls == null || attachmentsUrls.isEmpty()) { +// urls = Collections.EMPTY_MAP; +// } else { +// urls = attachmentsUrls; +// } +// +// if (verbose) { +// getLog().info("nb attachments : " + ((Map<?, ?>) urls).size()); +// } +// +// if (getLog().isDebugEnabled()) { +// getLog().debug("attachmentsUrls :\n" + urls); +// } +// context.put("attachmentsUrls", urls); +// } + + if (announceParameters == null) { + // empty Map to prevent NPE in velocity execution + context.put("announceParameters", Collections.EMPTY_MAP); + } else { + context.put("announceParameters", announceParameters); + } + return context; + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/AbstractAnnouncementMojo.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/AnnouncementGenerator.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/AnnouncementGenerator.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/AnnouncementGenerator.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,206 @@ +package org.nuiton.jredmine.plugin.announcement; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.logging.Log; +import org.apache.maven.plugins.changes.model.Action; +import org.apache.maven.plugins.changes.model.Release; +import org.apache.velocity.Template; +import org.apache.velocity.app.VelocityEngine; +import org.apache.velocity.context.Context; +import org.apache.velocity.exception.ResourceNotFoundException; +import org.codehaus.plexus.util.StringUtils; +import org.nuiton.jredmine.model.Attachment; + +/** + * + * @author chemit + * @since 1.0.0 + */ +public class AnnouncementGenerator { + + /** + * The token any of urls denoting the base URL for the issue management. + */ + private static final String URL_TOKEN = "%URL%"; + /** + * The token in {@link #attachmentLinkTemplate} denoting the attachment ID. + */ + private static final String ATTACHMENT_TOKEN = "%FILE%"; + /** + * the redmine url + */ + private final String url; + /** + * the redmine attachment url template + */ + private final String attachmentLinkTemplate; + /** + * logger + */ + private final Log log; + + public AnnouncementGenerator(Log log, String url, String attachmentLinkTemplate) { + this.log = log; + this.url = url; + this.attachmentLinkTemplate = attachmentLinkTemplate; + } + + public Map<Attachment, String> getAttachmentsUrls(Attachment[] attachments) { + + // transform attachments urls + + boolean hasAttachmentLinks = canGenerateAttachmentLinks(); + + Map<Attachment, String> urls = null; + + if (hasAttachmentLinks) { + + urls = new HashMap<Attachment, String>(); + if (hasAttachmentLinks) { + for (Attachment a : attachments) { + String u = parseAttachmentLink(a.getId() + ""); + urls.put(a, u); + } + } + } else { + getLog().warn("can not render attachments urls"); + } + + return urls; + } + + public void doGenerate(VelocityEngine engine, Context context, File out, String templatePath, String templateEncoding) + throws MojoExecutionException { + + try { + + if (!out.getParentFile().exists()) { + out.getParentFile().mkdirs(); + } + + Writer writer = new OutputStreamWriter(new FileOutputStream(out), templateEncoding); + + Template velocityTemplate = engine.getTemplate(templatePath, templateEncoding); + + velocityTemplate.merge(context, writer); + + writer.flush(); + + writer.close(); + + } catch (ResourceNotFoundException rnfe) { + throw new MojoExecutionException("Resource not found.", rnfe); + } catch (Exception e) { + throw new MojoExecutionException(e.toString(), e); + } + } + + /** + * Checks whether links to the issues can be generated. + * + * @return <code>true</code> if issue links can be generated, <code>false</code> otherwise. + */ + public boolean canGenerateAttachmentLinks() { + return !StringUtils.isBlank(attachmentLinkTemplate) && (!StringUtils.isBlank(url) || attachmentLinkTemplate.indexOf(URL_TOKEN) < 0); + } + + protected String parseAttachmentLink(String id) { + String parseLink; + String issueLink = this.attachmentLinkTemplate; + parseLink = issueLink.replaceFirst(ATTACHMENT_TOKEN, id); + + if (parseLink.indexOf(URL_TOKEN) >= 0) { + String u = this.url.substring(0, this.url.lastIndexOf("/")); + parseLink = parseLink.replaceFirst(URL_TOKEN, u); + } + + return parseLink; + } + + /** + * Get the latest release by matching the supplied releases + * with the version from the pom. + * + * @param releases list of releases + * @param releaseVersion the release version + * @return A <code>Release</code> that matches the next release of the current project + * @throws MojoExecutionException + */ + public Release getLatestRelease(List<?> releases, String releaseVersion) + throws MojoExecutionException { + boolean isFound = false; + + Release release = null; + + String pomVersion = releaseVersion; + + getLog().debug("Found " + releases.size() + " releases."); + + for (int i = 0; i < releases.size(); i++) { + release = (Release) releases.get(i); + if (getLog().isDebugEnabled()) { + getLog().debug("The release: " + release.getVersion() + " has " + release.getActions().size() + " actions."); + } + + if (release.getVersion() != null && release.getVersion().equals(pomVersion)) { + isFound = true; + if (getLog().isDebugEnabled()) { + getLog().debug("Found the correct release: " + release.getVersion()); + logRelease(release); + } + return release; + } + } + + release = getRelease(releases, pomVersion); + isFound = (release != null); + + if (!isFound) { + throw new MojoExecutionException("Couldn't find the release '" + pomVersion + "' among the supplied releases."); + } else { + } + return release; + } + + protected Release getRelease(List<?> releases, String version) { + Release release = null; + for (int i = 0; i < releases.size(); i++) { + release = (Release) releases.get(i); + if (getLog().isDebugEnabled()) { + getLog().debug("The release: " + release.getVersion() + " has " + release.getActions().size() + " actions."); + } + + if (release.getVersion() != null && release.getVersion().equals(version)) { + if (getLog().isDebugEnabled()) { + getLog().debug("Found the correct release: " + release.getVersion()); + logRelease(release); + } + return release; + } + } + return null; + } + + private void logRelease(Release release) { + Action action; + for (Iterator<?> iterator = release.getActions().iterator(); iterator.hasNext();) { + action = (Action) iterator.next(); + getLog().debug("o " + action.getType()); + getLog().debug("issue : " + action.getIssue()); + getLog().debug("action : " + action.getAction()); + getLog().debug("dueTo : " + action.getDueTo()); + } + } + + protected Log getLog() { + return log; + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/AnnouncementGenerator.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojo.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojo.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojo.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,38 @@ +package org.nuiton.jredmine.plugin.announcement; + +/** + * Generate the content of the release email announcement. + * + * @goal generate-email-announcement + * + * @author tchemit + * @since 1.0.0 + */ +public class GenerateEmailAnnouncementMojo extends AbstractAnnouncementMojo { + + /** + * The Velocity template used to format the release email announcement. + * + * @parameter expression="${redmine.emailAnnouncementTemplate}" default-value="release-email-announcement.vm" + * @required + * @since 1.0.0 + */ + private String emailAnnouncementTemplate; + /** + * A flag to enable or disable the goal. + * + * @parameter expression="${changes.skipGenerateEmailAnnouncement}" default-value="false" + * @since 1.0.0 + */ + private boolean skipGenerateEmailAnnouncement; + + @Override + protected String getAnnouncementTemplate() { + return emailAnnouncementTemplate; + } + + @Override + protected boolean isGoalSkip() { + return skipGenerateEmailAnnouncement; + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojo.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojo.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojo.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojo.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,38 @@ +package org.nuiton.jredmine.plugin.announcement; + +/** + * Generate the content of the release announcement news for Redmine. + * + * @goal generate-news-announcement + * + * @author tchemit + * @since 1.0.0 + */ +public class GenerateNewsAnnouncementMojo extends AbstractAnnouncementMojo { + + /** + * The Velocity template used to format the redmine announcement. + * + * @parameter expression="${redmine.newsAnnouncementTemplate}" default-value="release-news-announcement.vm" + * @required + * @since 1.0.0 + */ + private String newsAnnouncementTemplate; + /** + * A flag to enable or disable the goal. + * + * @parameter expression="${redmine.skipGenerateNewsAnnouncement}" default-value="false" + * @since 1.0.0 + */ + private boolean skipGenerateNewsAnnouncement; + + @Override + protected String getAnnouncementTemplate() { + return newsAnnouncementTemplate; + } + + @Override + protected boolean isGoalSkip() { + return skipGenerateNewsAnnouncement; + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojo.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractIssuesReport.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractIssuesReport.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractIssuesReport.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,198 @@ +package org.nuiton.jredmine.plugin.report; + +import org.nuiton.jredmine.plugin.IssuesCollector; +import org.nuiton.jredmine.plugin.IssueCollectorConfiguration; +import java.util.Locale; +import java.util.Map; +import org.apache.maven.reporting.MavenReportException; +import org.nuiton.jredmine.model.Issue; +import org.nuiton.jredmine.RedmineServiceException; +import org.nuiton.util.PluginHelper; + +/** + * Abstract Generates a report for issues from Redmine's server + * + * @author tchemit + * @since 1.0.0 + */ +public abstract class AbstractIssuesReport extends AbstractRedmineReport implements IssueCollectorConfiguration { + + /** + * The meta to group issues (or null if no grouping) + * + * @since 1.0.0 + */ + protected final String group; + + protected AbstractIssuesReport(String group) { + super(true, false, false); + this.group = group; + } + + protected abstract String getColumnNames(); + + protected abstract Map<String, String> getFilters(); + + /////////////////////////////////////////////////////////////////////////// + /// MavenReport + /////////////////////////////////////////////////////////////////////////// + @Override + public final String getOutputName() { + return "redmine-report" + (group == null ? "" : ("-by-" + group)); + } + + @Override + public final String getName(Locale locale) { + return getBundle(locale).getString("report.name" + (group == null ? "" : "-" + group)); + } + + @Override + public final String getDescription(Locale locale) { + return getBundle(locale).getString("report.description" + (group == null ? "" : "-" + group)); + } + + /////////////////////////////////////////////////////////////////////////// + /// Plugin + /////////////////////////////////////////////////////////////////////////// + @Override + public boolean init() throws Exception { + + boolean result = super.init(); + if (result) { + + setVersionId(PluginHelper.removeSnapshotSuffix(getVersionId())); + + } + + return true; + } + + /////////////////////////////////////////////////////////////////////////// + /// AbstractRedmineReport + /////////////////////////////////////////////////////////////////////////// + @Override + public void executeReport(Locale locale) throws MavenReportException { + + if (isOnlyCurrentVersion()) { + getLog().info(getBundle(locale).getString("report.message.only.for.current.version") + " " + getVersionId()); + } + String projectId = getProjectId(); + + if (verbose) { + getLog().info("report project " + projectId); +// getLog().info("report version " + getVersionId()); + } + + // init issues collector + + IssuesCollector collector = new IssuesCollector(getLog(), verbose); + + try { + + collector.collect(service, this); + + } catch (RedmineServiceException ex) { + collector.clearFilters(); + throw new MavenReportException("could not obtains issues for reason " + ex.getMessage(), ex); + } + + // get issues from collector + + Issue[] issues = collector.getIssues(); + + try { + + if (issues.length == 0) { + getLog().warn("no issue to treate, will generate an empty raport."); + + IssueReportGenerator reportGenerator = new IssueReportGenerator(); + + reportGenerator.doGenerateEmptyReport(getBundle(locale), getSink()); + + } else { + IssueReportGenerator report = new IssueReportGenerator(getLog(), getColumnNames(), getGroup()); + + report.setIssueLinkTemplate(getIssueLinkTemplate()); + report.setVersionLinkTemplate(getVersionLinkTemplate()); + report.setUrl(redmineUrl.toString()); + + report.setIssues(issues); + report.setUsers(service.getUsers(projectId)); + report.setIssueCategories(service.getIssueCategories(projectId)); + report.setIssueStatuses(service.getIssueStatuses()); + report.setIssuePriorities(service.getIssuePriorities()); + report.setTrackers(service.getTrackers(projectId)); + report.setVersions(service.getVersions(projectId)); + + report.doGenerateReport(getBundle(locale), getSink(), getLog()); + } + + } catch (MavenReportException mre) { + // Rethrow this error from RedmineReportGenerator( String, String ) + // so that the build fails + throw mre; + } catch (Exception e) { + e.printStackTrace(); + } finally { + collector.clearFilters(); + } + } + + /////////////////////////////////////////////////////////////////////////// + /// IssueCollectionConfiguration + /////////////////////////////////////////////////////////////////////////// + @Override + public final String getProjectId() { + return projectId; + } + + @Override + public final String getVersionId() { + return versionId; + } + + @Override + public void setVersionId(String versionId) { + this.versionId = versionId; + } + + @Override + public String getCategoryIds() { + return getFilters() == null ? null : getFilters().get("category"); + } + + @Override + public String getVersionNames() { + return getFilters() == null ? null : getFilters().get("version"); + } + + @Override + public String getPriorityIds() { + return getFilters() == null ? null : getFilters().get("priority"); + } + + @Override + public String getStatusIds() { + return getFilters() == null ? null : getFilters().get("status"); + } + + @Override + public String getTrackerIds() { + return getFilters() == null ? null : getFilters().get("tracker"); + } + + /////////////////////////////////////////////////////////////////////////// + /// Others + /////////////////////////////////////////////////////////////////////////// + protected final String getGroup() { + return group; + } + + protected final String getIssueLinkTemplate() { + return issueLinkTemplate; + } + + protected final String getVersionLinkTemplate() { + return versionLinkTemplate; + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractIssuesReport.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractRedmineReport.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractRedmineReport.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractRedmineReport.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,257 @@ +package org.nuiton.jredmine.plugin.report; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.Writer; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import java.util.ResourceBundle; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.factory.ArtifactFactory; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.resolver.ArtifactNotFoundException; +import org.apache.maven.artifact.resolver.ArtifactResolutionException; +import org.apache.maven.artifact.resolver.ArtifactResolver; +import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; +import org.apache.maven.artifact.versioning.VersionRange; +import org.apache.maven.doxia.module.xhtml.decoration.render.RenderingContext; +import org.apache.maven.doxia.sink.Sink; +import org.apache.maven.doxia.site.decoration.Body; +import org.apache.maven.doxia.site.decoration.DecorationModel; +import org.apache.maven.doxia.site.decoration.Skin; +import org.apache.maven.doxia.siterenderer.Renderer; +import org.apache.maven.doxia.siterenderer.RendererException; +import org.apache.maven.doxia.siterenderer.SiteRenderingContext; +import org.apache.maven.doxia.siterenderer.sink.SiteRendererSink; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.reporting.MavenReport; +import org.apache.maven.reporting.MavenReportException; +import org.codehaus.plexus.i18n.I18N; +import org.nuiton.io.rest.RestClientConfiguration; +import org.nuiton.plugin.Plugin; +import org.nuiton.jredmine.plugin.AbstractRedmineMojo; + +/** + * Abstract redmine report mojo. + * + * @author chemit + * @since 1.0.0 + * + * @requiresReports true + */ +public abstract class AbstractRedmineReport extends AbstractRedmineMojo implements MavenReport, Plugin, RestClientConfiguration { + + /** + * Template strings per system that is used to discover the URL to use to display an issue report. Each key in this + * map denotes the (case-sensitive) identifier of the issue tracking system and its value gives the URL template. + * <p> + * There are 2 template tokens you can use. <code>%URL%</code>: this is computed by getting the + * <code><issueManagement>/<url></code> value from the POM, and removing the last '/' + * and everything that comes after it. <code>%ISSUE%</code>: this is the issue number. + * </p> + * + * @parameter expression="${redmine.issueLinkTemplate}" + * @since 1.0.0 + */ + protected String issueLinkTemplate; + /** + * Template strings per system that is used to discover the URL to use to display an issue report. Each key in this + * map denotes the (case-sensitive) identifier of the issue tracking system and its value gives the URL template. + * <p> + * There are 2 template tokens you can use. <code>%URL%</code>: this is computed by getting the + * <code><issueManagement>/<url></code> value from the POM, and removing the last '/' + * and everything that comes after it. <code>%VERSION%</code>: this is the issue number. + * </p> + * + * @parameter expression="${redmine.versionLinkTemplate}" + * @since 1.0.0 + */ + protected String versionLinkTemplate; + /** + * Local Repository. + * + * @parameter expression="${localRepository}" + * @required + * @readonly + */ + protected ArtifactRepository localRepository; + /** + * Report output directory. Note that this parameter is only relevant if the goal is run from the command line or + * from the default build lifecycle. If the goal is run indirectly as part of a site generation, the output + * directory configured in the Maven Site Plugin is used instead. + * + * @parameter default-value="${project.reporting.outputDirectory}" + */ + protected File outputDirectory; + /** + * @component + */ + protected ArtifactResolver resolver; + /** + * @component + */ + protected ArtifactFactory factory; + /** + * Internationalization. + * + * @component + */ + protected I18N i18n; + /** + * Doxia Site Renderer. + * + * @component + */ + protected Renderer siteRenderer; + private Sink sink; + private File reportOutputDirectory; + + protected abstract void executeReport(Locale locale) throws MavenReportException; + + public AbstractRedmineReport(boolean requireProject, boolean requireVersion, boolean requireUser) { + super(requireProject, requireVersion, requireUser); + } + + + /////////////////////////////////////////////////////////////////////////// + /// Plugin + /////////////////////////////////////////////////////////////////////////// + @Override + protected void doAction() throws Exception { + + try { + DecorationModel model = new DecorationModel(); + model.setBody(new Body()); + Map<String, String> attributes = new HashMap<String, String>(); + attributes.put("outputEncoding", encoding); + Locale currentLocale = Locale.getDefault(); + SiteRenderingContext siteContext = siteRenderer.createContextForSkin(getSkinArtifactFile(), attributes, + model, getName(currentLocale), currentLocale); + + RenderingContext context = new RenderingContext(outputDirectory, getOutputName() + ".html"); + + SiteRendererSink newSink = new SiteRendererSink(context); + generate(newSink, currentLocale); + + outputDirectory.mkdirs(); + + Writer writer = new FileWriter(new File(outputDirectory, getOutputName() + ".html")); + + siteRenderer.generateDocument(writer, newSink, siteContext); + + siteRenderer.copyResources(siteContext, new File(project.getBasedir(), "src/site/resources"), + outputDirectory); + + } catch (RendererException e) { + throw new MojoExecutionException( + "An error has occurred in " + getName(Locale.ENGLISH) + " report generation.", e); + } catch (IOException e) { + throw new MojoExecutionException( + "An error has occurred in " + getName(Locale.ENGLISH) + " report generation.", e); + } catch (MavenReportException e) { + throw new MojoExecutionException( + "An error has occurred in " + getName(Locale.ENGLISH) + " report generation.", e); + } finally { + + closeService(); + } + } + + /////////////////////////////////////////////////////////////////////////// + /// MavenReport + /////////////////////////////////////////////////////////////////////////// + @Override + public boolean canGenerateReport() { + boolean init = false; + try { + init = init(); + } catch (Exception ex) { + init = false; + } + return init; + } + + @Override + public void generate(org.codehaus.doxia.sink.Sink sink, Locale locale) + throws MavenReportException { + if (sink == null) { + throw new MavenReportException("You must specify a sink."); + } + + this.sink = sink; + + executeReport(locale); + } + + @Override + public String getName(Locale locale) { + return getBundle(locale).getString("report.name"); + } + + @Override + public String getDescription(Locale locale) { + return getBundle(locale).getString("report.description"); + } + + @Override + public String getCategoryName() { + return CATEGORY_PROJECT_REPORTS; + } + + @Override + public File getReportOutputDirectory() { + if (reportOutputDirectory == null) { + reportOutputDirectory = new File(outputDirectory.getAbsolutePath()); + } + return reportOutputDirectory; + } + + @Override + public void setReportOutputDirectory(File reportOutputDirectory) { + this.reportOutputDirectory = reportOutputDirectory; + } + + @Override + public boolean isExternalReport() { + return false; + } + + /////////////////////////////////////////////////////////////////////////// + /// Others + /////////////////////////////////////////////////////////////////////////// + protected Sink getSink() { + return sink; + } + + protected ResourceBundle getBundle(Locale locale) { + return ResourceBundle.getBundle("redmine-report", locale, this.getClass().getClassLoader()); + } + + protected File getSkinArtifactFile() + throws MojoExecutionException { + Skin skin = Skin.getDefaultSkin(); + + String version = skin.getVersion(); + Artifact artifact; + try { + if (version == null) { + version = Artifact.RELEASE_VERSION; + } + VersionRange versionSpec = VersionRange.createFromVersionSpec(version); + artifact = factory.createDependencyArtifact(skin.getGroupId(), skin.getArtifactId(), versionSpec, "jar", + null, null); + + resolver.resolve(artifact, project.getRemoteArtifactRepositories(), localRepository); + } catch (InvalidVersionSpecificationException e) { + throw new MojoExecutionException("The skin version '" + version + "' is not valid: " + e.getMessage()); + } catch (ArtifactResolutionException e) { + throw new MojoExecutionException("Unable to find skin", e); + } catch (ArtifactNotFoundException e) { + throw new MojoExecutionException("The skin does not exist: " + e.getMessage()); + } + + return artifact.getFile(); + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractRedmineReport.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssueReportGenerator.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssueReportGenerator.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssueReportGenerator.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,683 @@ +package org.nuiton.jredmine.plugin.report; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import org.apache.maven.doxia.sink.Sink; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.logging.Log; +import org.apache.maven.reporting.MavenReportException; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.ResourceBundle; +import java.util.TreeMap; +import org.codehaus.plexus.util.StringUtils; +import org.nuiton.jredmine.model.I18nAble; +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.Tracker; +import org.nuiton.jredmine.model.User; +import org.nuiton.jredmine.model.Version; + +/** + * Generates a Redmine report. + * + * @author tchemit + * @since 1.0.0 + */ +public class IssueReportGenerator { + + /** + * The token any of urls denoting the base URL for the issue management. + */ + private static final String URL_TOKEN = "%URL%"; + /** + * The token in {@link #issueLinkTemplate} denoting the issue ID. + */ + private static final String ISSUE_TOKEN = "%ISSUE%"; + /** + * The token in {@link #versionLinkTemplate} denoting the version ID. + */ + private static final String VERSION_TOKEN = "%VERSION%"; + + /** + * Universe of columns of the report. + * + * Can retreave th i18n header key by {@link #getI18nKey()} and have the + * logic of each cell generation in the methd {@link #sinkInsideCell(Sink, RedmineReportGenerator, Version, Issue)} + * + * @see #columnOrder + */ + public enum ReportColumn { + + key(false, "report.label.key") { + + @Override + public void sinkInsideCell(Sink sink, IssueReportGenerator generator, Issue issue) { + generator.constructIssueLink(issue, sink); + } + + @Override + protected Integer getGroupId(Issue issue) { + throw new UnsupportedOperationException(name() + "does not supports grouping"); + } + }, + summary(false, "report.label.summary") { + + @Override + public void sinkInsideCell(Sink sink, IssueReportGenerator generator, Issue issue) { + generator.sinkRawText(sink, issue.getDescription()); + } + + @Override + protected Integer getGroupId(Issue issue) { + throw new UnsupportedOperationException(name() + "does not supports grouping"); + } + }, + status(true, "report.label.status") { + + @Override + public void sinkInsideCell(Sink sink, IssueReportGenerator generator, Issue issue) { + + int id = issue.getStatusId(); + String t = id + ""; + IssueStatus status = generator.getIssueStatus(id); + if (status == null) { + t = id == 0 ? "-" : t; + } else { + t = status.getName(); + } + generator.sinkI18nAble(sink, id, status); + + } + + @Override + protected Integer getGroupId(Issue issue) { + return issue.getStatusId(); + } + }, + assignee(true, "report.label.by") { + + @Override + public void sinkInsideCell(Sink sink, IssueReportGenerator generator, Issue issue) { + int id = issue.getAssignedToId(); + User u = generator.getUser(id); + String t = issue.getAssignedToId() + ""; + if (u == null) { + generator.sinkRawText(sink, id == 0 ? " - " : t); + } else { + // ajout d'un lien (mailto:) + sink.link("mailto:" + u.getMail()); + sink.text(u.getLogin()); + sink.link_(); + } + } + + @Override + protected Integer getGroupId(Issue issue) { + return issue.getAssignedToId(); + } + }, + reporter(true, "report.label.reporter") { + + @Override + public void sinkInsideCell(Sink sink, IssueReportGenerator generator, Issue issue) { + int id = issue.getAuthorId(); + User u = generator.getUser(id); + String t = issue.getAuthorId() + ""; + if (u == null) { + generator.sinkRawText(sink, id == 0 ? " - " : t); + } else { + // ajout d'un lien (mailto:) + sink.link("mailto:" + u.getMail()); + sink.text(u.getLogin()); + sink.link_(); + } + } + + @Override + protected Integer getGroupId(Issue issue) { + return issue.getAuthorId(); + } + }, + tracker(true, "report.label.type") { + + @Override + public void sinkInsideCell(Sink sink, IssueReportGenerator generator, Issue issue) { + int id = issue.getTrackerId(); + Tracker status = generator.getTracker(id); + generator.sinkI18nAble(sink, id, status); + } + + @Override + protected Integer getGroupId(Issue issue) { + return issue.getTrackerId(); + } + }, + priority(true, "report.label.priority") { + + @Override + public void sinkInsideCell(Sink sink, IssueReportGenerator generator, Issue issue) { + int id = issue.getPriorityId(); + IssuePriority p = generator.getIssuePriority(id); + generator.sinkI18nAble(sink, id, p); + } + + @Override + protected Integer getGroupId(Issue issue) { + return issue.getPriorityId(); + } + }, + version(true, "report.label.version") { + + @Override + public void sinkInsideCell(Sink sink, IssueReportGenerator generator, Issue issue) { + int id = issue.getFixedVersionId(); + Version v2 = generator.getVersion(id); + generator.sinkI18nAble(sink, id, v2); + } + + @Override + protected Integer getGroupId(Issue issue) { + return issue.getFixedVersionId(); + } + }, + category(true, "report.label.category") { + + @Override + public void sinkInsideCell(Sink sink, IssueReportGenerator generator, Issue issue) { + int id = issue.getCategoryId(); + IssueCategory status = generator.getIssueCategory(id); + generator.sinkI18nAble(sink, id, status); + } + + @Override + protected Integer getGroupId(Issue issue) { + return issue.getCategoryId(); + } + }, + createdon(false, "report.label.created") { + + @Override + public void sinkInsideCell(Sink sink, IssueReportGenerator generator, Issue issue) { + Date d = issue.getCreatedOn(); + generator.sinkDate(sink, d); + } + + @Override + protected Integer getGroupId(Issue issue) { + throw new UnsupportedOperationException(name() + "does not supports grouping"); + } + }, + updatedon(false, "report.label.updated") { + + @Override + public void sinkInsideCell(Sink sink, IssueReportGenerator generator, Issue issue) { + Date d = issue.getUpdatedOn(); + generator.sinkDate(sink, d); + } + + @Override + protected Integer getGroupId(Issue issue) { + throw new UnsupportedOperationException(name() + "does not supports grouping"); + } + }; + private boolean canGroup; + private String i18nKey; + + private ReportColumn(boolean canGroup, String i18nKey) { + this.canGroup = canGroup; + this.i18nKey = i18nKey; + } + + public boolean isCanGroup() { + return canGroup; + } + + public String getI18nKey() { + return i18nKey; + } + + public abstract void sinkInsideCell(Sink sink, IssueReportGenerator generator, Issue issue); + + protected abstract Integer getGroupId(Issue issue); + + public void collectGroups(Issue[] issues, Map<Integer, List<Issue>> groups) { + for (Issue issue : issues) { + Integer id = getGroupId(issue); + List<Issue> c = groups.get(id); + if (c == null) { + c = new ArrayList<Issue>(); + groups.put(id, c); + } + c.add(issue); + } + } + } + private ReportColumn[] columns; + private ReportColumn groupColumn; + private String url; + private String issueLinkTemplate; + private String versionLinkTemplate; + private Issue[] issues; + private Map<Integer, IssueCategory> issueCategories; + private Map<Integer, IssuePriority> issuePriorities; + private Map<Integer, Version> versions; + private Map<Integer, IssueStatus> issueStatuses; + private Map<Integer, User> users; + private Map<Integer, Tracker> trackers; + private DateFormat dateFormat; + + public IssueReportGenerator() { + } + + /** + * + * @param log the logger + * @param columnNames The names of the columns to include in the report + * @param groupBy the group by column name (or null if not grouped) + * @throws MavenReportException + */ + public IssueReportGenerator(Log log, String columnNames, String groupBy) + throws MavenReportException { + + String[] columnNamesArray = columnNames.split(","); + int nbCols = columnNamesArray.length; + List<ReportColumn> tmp = new ArrayList<ReportColumn>(nbCols); + for (String col : columnNames.split(",")) { + try { + ReportColumn valueOf = ReportColumn.valueOf(col.trim().toLowerCase()); + tmp.add(valueOf); + } catch (Exception e) { + log.warn(col + " is an unkown column name, authorized : " + Arrays.toString(ReportColumn.values())); + if (log.isDebugEnabled()) { + log.debug(e); + } + } + } + if (tmp.isEmpty()) { + // This can happen if the user has configured column names and they are all invalid + throw new MavenReportException( + "maven-redmine-plugin: None of the configured columnNames '" + columnNames + "' are valid."); + } + if (groupBy != null && !groupBy.trim().isEmpty()) { + try { + groupColumn = ReportColumn.valueOf(groupBy.trim().toLowerCase()); + + if (!groupColumn.isCanGroup()) { + log.warn(groupColumn + " is not a grouping columne, grouping will be skip."); + groupColumn = null; + } else { + // remove the group column from the table + tmp.remove(groupColumn); + } + + log.info("group by " + groupColumn); + + } catch (Exception e) { + log.warn(groupBy + " is an unkown group column name, grouping will be skip."); + if (log.isDebugEnabled()) { + log.debug(e); + } + } + } + + columns = tmp.toArray(new ReportColumn[tmp.size()]); + } + + public void doGenerateEmptyReport(ResourceBundle bundle, Sink sink) { + sinkBeginReport(sink, bundle); + + sink.text(bundle.getString("report.error")); + + sinkEndReport(sink); + } + + public void doGenerateReport(ResourceBundle bundle, Sink sink, Log log) + throws MojoExecutionException { + + if (issues != null && issues.length == 0) { + throw new MojoExecutionException( + "maven-redmine-plugin: Can not generate report if no issues, use the doGenerateEmptyReport instead"); + } + + String d = bundle.getString("report.date.format"); + + dateFormat = new SimpleDateFormat(d); + + sinkBeginReport(sink, bundle); + + if (groupColumn == null) { + + sink.table(); + + constructHeaderRow(sink, bundle); + + constructDetailRows(sink, issues); + + sink.table_(); + + } else { + + // group data + + Map<Integer, List<Issue>> groups = new TreeMap<Integer, List<Issue>>(); + + groupColumn.collectGroups(issues, groups); + + for (Entry<Integer, List<Issue>> e : groups.entrySet()) { + + List<Issue> currentIssues = e.getValue(); + + sink.sectionTitle2(); + + sinkRawText(sink, bundle.getString(groupColumn.getI18nKey()) + " : "); + + groupColumn.sinkInsideCell(sink, this, currentIssues.get(0)); + + sink.sectionTitle2_(); + + sink.table(); + + constructHeaderRow(sink, bundle); + + constructDetailRows(sink, currentIssues.toArray(new Issue[currentIssues.size()])); + + sink.table_(); + } + + } + + sinkEndReport(sink); + } + + /** + * Checks whether links to the issues can be generated. + * + * @return <code>true</code> if issue links can be generated, <code>false</code> otherwise. + */ + public boolean canGenerateIssueLinks() { + if (!StringUtils.isEmpty(issueLinkTemplate)) { + return false; + } + return !StringUtils.isBlank(issueLinkTemplate) && (!StringUtils.isBlank(getUrl()) || issueLinkTemplate.indexOf(URL_TOKEN) < 0); + } + + /** + * Checks whether links to the issues can be generated. + * + * @return <code>true</code> if issue links can be generated, <code>false</code> otherwise. + */ + public boolean canGenerateVersionLinks() { + if (!StringUtils.isEmpty(versionLinkTemplate)) { + return false; + } + return !StringUtils.isBlank(versionLinkTemplate) && (!StringUtils.isBlank(getUrl()) || versionLinkTemplate.indexOf(URL_TOKEN) < 0); + } + + public void setUrl(String url) { + this.url = url; + } + + public String getUrl() { + return url; + } + + public void setIssueLinkTemplate(String issueLinkTemplate) { + this.issueLinkTemplate = issueLinkTemplate; + } + + public void setVersionLinkTemplate(String versionLinkTemplate) { + this.versionLinkTemplate = versionLinkTemplate; + } + + public void setIssueCategories(IssueCategory[] issueCategories) { + Map<Integer, IssueCategory> t = new TreeMap<Integer, IssueCategory>(); + for (IssueCategory s : issueCategories) { + t.put(s.getId(), s); + } + this.issueCategories = t; + } + + public void setIssueStatuses(IssueStatus[] issueStatuses) { + Map<Integer, IssueStatus> t = new TreeMap<Integer, IssueStatus>(); + for (IssueStatus s : issueStatuses) { + t.put(s.getId(), s); + } + this.issueStatuses = t; + } + + public void setIssuePriorities(IssuePriority[] issuePriorities) { + Map<Integer, IssuePriority> t = new TreeMap<Integer, IssuePriority>(); + for (IssuePriority s : issuePriorities) { + t.put(s.getId(), s); + } + this.issuePriorities = t; + } + + public void setUsers(User[] users) { + Map<Integer, User> t = new TreeMap<Integer, User>(); + for (User s : users) { + t.put(s.getId(), s); + } + this.users = t; + } + + public void setVersions(Version[] users) { + Map<Integer, Version> t = new TreeMap<Integer, Version>(); + for (Version s : users) { + t.put(s.getId(), s); + } + this.versions = t; + } + + public void setTrackers(Tracker[] users) { + Map<Integer, Tracker> t = new TreeMap<Integer, Tracker>(); + for (Tracker s : users) { + t.put(s.getId(), s); + } + this.trackers = t; + } + + public void setIssues(Issue[] issues) { + this.issues = issues; + } + + protected void constructHeaderRow(Sink sink, ResourceBundle bundle) { + + sink.tableRow(); + + for (ReportColumn c : columns) { + sinkHeader(sink, bundle.getString(c.getI18nKey())); + } + + sink.tableRow_(); + } + + protected void constructDetailRows(Sink sink, Issue[] issues) { + + for (Issue issue : issues) { + + sink.tableRow(); + + for (ReportColumn col : columns) { + + sink.tableCell(); + + col.sinkInsideCell(sink, this, issue); + + sink.tableCell_(); + + } + + sink.tableRow_(); + } + } + + protected String parseIssueLink(String issue) { + String parseLink; + String issueLink = this.issueLinkTemplate; + parseLink = issueLink.replaceFirst(ISSUE_TOKEN, issue); + + if (parseLink.indexOf(URL_TOKEN) >= 0) { + String u = this.url.substring(0, this.url.lastIndexOf("/")); + parseLink = parseLink.replaceFirst(URL_TOKEN, u); + } + + return parseLink; + } + + protected String parseVersionLink(String issue) { + String parseLink; + String issueLink = this.versionLinkTemplate; + parseLink = issueLink.replaceFirst(VERSION_TOKEN, issue); + + if (parseLink.indexOf(URL_TOKEN) >= 0) { + String u = this.url.substring(0, this.url.lastIndexOf("/")); + parseLink = parseLink.replaceFirst(URL_TOKEN, u); + } + + return parseLink; + } + + protected void constructIssueLink(Issue issue, Sink sink) { + String id = issue.getId() + ""; + + if (StringUtils.isNotEmpty(id)) { + + sink.link(parseIssueLink(id)); + + sink.text(issue.getSubject()); + + sink.link_(); + } + } + + protected void constructVersionLink(Version v, Sink sink, String prefix) { + String id = v.getId() + ""; + + if (StringUtils.isNotEmpty(id)) { + + sink.link(parseVersionLink(id)); + + sink.text(prefix + " " + v.getName()); + + sink.link_(); + } + } + + protected boolean isGroup() { + return groupColumn != null; + } + + protected IssueStatus getIssueStatus(int id) { + return issueStatuses == null ? null : issueStatuses.get(id); + } + + protected IssueCategory getIssueCategory(int id) { + return issueCategories == null ? null : issueCategories.get(id); + } + + protected IssuePriority getIssuePriority(int id) { + return issuePriorities == null ? null : issuePriorities.get(id); + } + + protected Version getVersion(int id) { + return versions == null ? null : versions.get(id); + } + + protected User getUser(int id) { + return users == null ? null : users.get(id); + } + + protected Tracker getTracker(int id) { + return trackers == null ? null : trackers.get(id); + } + + protected void sinkBeginReport(Sink sink, ResourceBundle bundle) { + sink.head(); + + String title; + if (isGroup()) { + title = bundle.getString("report.header-" + groupColumn.name()); + } else { + title = bundle.getString("report.header"); + } + + sink.title(); + + sink.text(title); + + sink.title_(); + + sink.head_(); + + sink.body(); + + sinkSectionTitle1(sink, title); + + } + + protected void sinkEndReport(Sink sink) { + sink.body_(); + + sink.flush(); + + sink.close(); + } + + protected void sinkHeader(Sink sink, String header) { + sink.tableHeaderCell(); + + sink.text(header); + + sink.tableHeaderCell_(); + } + + protected void sinkRawText(Sink sink, String text) { + + if (text != null) { + sink.rawText(text); + } else { + sink.rawText(" "); + } + } + + protected void sinkDate(Sink sink, Date d) { + String text = null; + if (d == null) { + text = " - "; + } else { + text = dateFormat.format(d); + } + sinkRawText(sink, text); + } + + protected void sinkI18nAble(Sink sink, int id, I18nAble obj) { + String t = null; + if (obj == null) { + t = id == 0 ? " - " : id + ""; + } else { + t = obj.getName(); + if (obj instanceof Version) { + constructVersionLink((Version) obj, sink, ""); + return; + } + } + sinkRawText(sink, t); + } + + protected void sinkSectionTitle1(Sink sink, String text) { + sink.sectionTitle1(); + + sink.text(text); + + sink.sectionTitle1_(); + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssueReportGenerator.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReport.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReport.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReport.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,109 @@ +package org.nuiton.jredmine.plugin.report; + +import java.util.Map; + +/** + * Generates a report for issues from Redmine's server + * + * @goal issues-report + * + * @author tchemit + * @since 1.0.0 + */ +public class IssuesReport extends AbstractIssuesReport { + + /** + * Maximum number of entries to be fetched from redmine. + * + * <b>Note:</b> use value 0 to have no limits + * + * @parameter expression="${redmine.maxEntries}" default-value="100" + * @since 1.0.0 + */ + protected int maxEntries; + /** + * If you only want to show issues for the current version in the report. + * The current version being used is <code>${project.version}</code> minus + * any "-SNAPSHOT" suffix. + * + * @parameter expression="${redmine.onlyCurrentVersion}" default-value="false" + * @since 1.0.0 + */ + protected boolean onlyCurrentVersion; + /** + * Sets some filters on issues to include. + * the possible keys are : + * <ul> + * <li><b>version</b> : to restrict on version fixed </li> + * <li><b>status</b> : to restrict on some status</li> + * <li><b>priority</b> : to restrict on some priorties</li> + * <li><b>category</b> : to restrict on some categories</li> + * <li><b>tracker</b> : to restrict on some tracker (says type of issues)</li> + * </ul> + * <p/> + * Values are Redmine's internal ids (except for the version entry + * which use Redmine's version names). + * <p/> + * Multiple values can be separated by commas. + * <p/> + * + * <b>Note :</b> If a value is set to empty - that means to not filter on + * that property. + * <p/> + * + * To see the internal ids, use the command : + * <pre> + * mvn redmine:display-ids -Dtype=<entry key> + * </pre> + * + * @parameter + * @since 1.0.0 + */ + protected Map<String, String> filters; + /** + * Sets the column names that you want to show in the report. The columns + * will appear in the report in the same order as you specify them here. + * Multiple values can be separated by commas. + * <p> + * Valid columns are: <code>Key</code>, <code>Summary</code>, + * <code>Status</code>, <code>Assignee</code>, + * <code>Reporter</code>, <code>Tracker</code>, <code>Priority</code>, + * <code>Version</code>, <code>Category</code>, <code>Created</code> and + * <code>Updated</code>. + * </p> + * + * @parameter expression="${redmine.columnNames}" default-value="Tracker,Category,Key,Summary,Status,Assignee,Version" + * @since 1.0.0 + */ + protected String columnNames; + + public IssuesReport() { + super(null); + } + + /////////////////////////////////////////////////////////////////////////// + /// IssueCollectionConfiguration + /////////////////////////////////////////////////////////////////////////// + @Override + public boolean isOnlyCurrentVersion() { + return onlyCurrentVersion; + } + + @Override + public int getMaxEntries() { + return maxEntries; + } + + /////////////////////////////////////////////////////////////////////////// + /// AbstractIssuesReport + /////////////////////////////////////////////////////////////////////////// + @Override + protected String getColumnNames() { + return columnNames; + } + + @Override + protected Map<String, String> getFilters() { + return filters; + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReport.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByAssignee.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByAssignee.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByAssignee.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,109 @@ +package org.nuiton.jredmine.plugin.report; + +import java.util.Map; + +/** + * Generates a report for issues from Redmine's server group by assignee. + * + * @goal issues-report-by-assignee + * + * @author tchemit + * @since 1.0.0 + */ +public class IssuesReportByAssignee extends AbstractIssuesReport { + + /** + * Maximum number of entries to be fetched from redmine. + * + * <b>Note:</b> use value 0 to have no limits + * + * @parameter expression="${redmine.maxEntries}" default-value="100" + * @since 1.0.0 + */ + protected int maxEntriesByAssignee; + /** + * If you only want to show issues for the current version in the report. + * The current version being used is <code>${project.version}</code> minus + * any "-SNAPSHOT" suffix. + * + * @parameter expression="${redmine.onlyCurrentVersion}" default-value="false" + * @since 1.0.0 + */ + protected boolean onlyCurrentVersionByAssignee; + /** + * Sets some filters on issues to include. + * the possible keys are : + * <ul> + * <li><b>version</b> : to restrict on version fixed </li> + * <li><b>status</b> : to restrict on some status</li> + * <li><b>priority</b> : to restrict on some priorties</li> + * <li><b>category</b> : to restrict on some categories</li> + * <li><b>tracker</b> : to restrict on some tracker (says type of issues)</li> + * </ul> + * <p/> + * Values are Redmine's internal ids (except for the version entry + * which use Redmine's version names). + * <p/> + * Multiple values can be separated by commas. + * <p/> + * + * <b>Note :</b> If a value is set to empty - that means to not filter on + * that property. + * <p/> + * + * To see the internal ids, use the command : + * <pre> + * mvn redmine:display-ids -Dtype=<entry key> + * </pre> + * + * @parameter + * @since 1.0.0 + */ + protected Map<String, String> filtersByAssignee; + /** + * Sets the column names that you want to show in the report. The columns + * will appear in the report in the same order as you specify them here. + * Multiple values can be separated by commas. + * <p> + * Valid columns are: <code>Key</code>, <code>Summary</code>, + * <code>Status</code>, <code>Assignee</code>, + * <code>Reporter</code>, <code>Tracker</code>, <code>Priority</code>, + * <code>Version</code>, <code>Category</code>, <code>Created</code> and + * <code>Updated</code>. + * </p> + * + * @parameter expression="${redmine.columnNames}" default-value="Tracker,Category,Key,Summary,Status,Assignee,Version" + * @since 2.0 + */ + protected String columnNamesByAssignee; + + public IssuesReportByAssignee() { + super("assignee"); + } + + /////////////////////////////////////////////////////////////////////////// + /// IssueCollectionConfiguration + /////////////////////////////////////////////////////////////////////////// + @Override + public boolean isOnlyCurrentVersion() { + return onlyCurrentVersionByAssignee; + } + + @Override + public int getMaxEntries() { + return maxEntriesByAssignee; + } + + /////////////////////////////////////////////////////////////////////////// + /// AbstractIssuesReport + /////////////////////////////////////////////////////////////////////////// + @Override + protected String getColumnNames() { + return columnNamesByAssignee; + } + + @Override + protected Map<String, String> getFilters() { + return filtersByAssignee; + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByAssignee.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByCategory.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByCategory.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByCategory.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,109 @@ +package org.nuiton.jredmine.plugin.report; + +import java.util.Map; + +/** + * Generates a report for issues from Redmine's server group by category. + * + * @goal issues-report-by-category + * + * @author tchemit + * @since 1.0.0 + */ +public class IssuesReportByCategory extends AbstractIssuesReport { + + /** + * Maximum number of entries to be fetched from redmine. + * + * <b>Note:</b> use value 0 to have no limits + * + * @parameter expression="${redmine.maxEntries}" default-value="100" + * @since 1.0.0 + */ + protected int maxEntriesByCategory; + /** + * If you only want to show issues for the current version in the report. + * The current version being used is <code>${project.version}</code> minus + * any "-SNAPSHOT" suffix. + * + * @parameter expression="${redmine.onlyCurrentVersion}" default-value="false" + * @since 1.0.0 + */ + protected boolean onlyCurrentVersionByCategory; + /** + * Sets some filters on issues to include. + * the possible keys are : + * <ul> + * <li><b>version</b> : to restrict on version fixed </li> + * <li><b>status</b> : to restrict on some status</li> + * <li><b>priority</b> : to restrict on some priorties</li> + * <li><b>category</b> : to restrict on some categories</li> + * <li><b>tracker</b> : to restrict on some tracker (says type of issues)</li> + * </ul> + * <p/> + * Values are Redmine's internal ids (except for the version entry + * which use Redmine's version names). + * <p/> + * Multiple values can be separated by commas. + * <p/> + * + * <b>Note :</b> If a value is set to empty - that means to not filter on + * that property. + * <p/> + * + * To see the internal ids, use the command : + * <pre> + * mvn redmine:display-ids -Dtype=<entry key> + * </pre> + * + * @parameter + * @since 1.0.0 + */ + protected Map<String, String> filtersByCategory; + /** + * Sets the column names that you want to show in the report. The columns + * will appear in the report in the same order as you specify them here. + * Multiple values can be separated by commas. + * <p> + * Valid columns are: <code>Key</code>, <code>Summary</code>, + * <code>Status</code>, <code>Assignee</code>, + * <code>Reporter</code>, <code>Tracker</code>, <code>Priority</code>, + * <code>Version</code>, <code>Category</code>, <code>Created</code> and + * <code>Updated</code>. + * </p> + * + * @parameter expression="${redmine.columnNames}" default-value="Tracker,Category,Key,Summary,Status,Assignee,Version" + * @since 2.0 + */ + protected String columnNamesByCategory; + + public IssuesReportByCategory() { + super("category"); + } + + /////////////////////////////////////////////////////////////////////////// + /// IssueCollectionConfiguration + /////////////////////////////////////////////////////////////////////////// + @Override + public boolean isOnlyCurrentVersion() { + return onlyCurrentVersionByCategory; + } + + @Override + public int getMaxEntries() { + return maxEntriesByCategory; + } + + /////////////////////////////////////////////////////////////////////////// + /// AbstractIssuesReport + /////////////////////////////////////////////////////////////////////////// + @Override + protected String getColumnNames() { + return columnNamesByCategory; + } + + @Override + protected Map<String, String> getFilters() { + return filtersByCategory; + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByCategory.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByPriority.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByPriority.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByPriority.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,109 @@ +package org.nuiton.jredmine.plugin.report; + +import java.util.Map; + +/** + * Generates a report for issues from Redmine's server group by priority. + * + * @goal issues-report-by-priority + * + * @author tchemit + * @since 1.0.0 + */ +public class IssuesReportByPriority extends AbstractIssuesReport { + + /** + * Maximum number of entries to be fetched from redmine. + * + * <b>Note:</b> use value 0 to have no limits + * + * @parameter expression="${redmine.maxEntries}" default-value="100" + * @since 1.0.0 + */ + protected int maxEntriesByPriority; + /** + * If you only want to show issues for the current version in the report. + * The current version being used is <code>${project.version}</code> minus + * any "-SNAPSHOT" suffix. + * + * @parameter expression="${redmine.onlyCurrentVersion}" default-value="false" + * @since 1.0.0 + */ + protected boolean onlyCurrentVersionByPriority; + /** + * Sets some filters on issues to include. + * the possible keys are : + * <ul> + * <li><b>version</b> : to restrict on version fixed </li> + * <li><b>status</b> : to restrict on some status</li> + * <li><b>priority</b> : to restrict on some priorties</li> + * <li><b>category</b> : to restrict on some categories</li> + * <li><b>tracker</b> : to restrict on some tracker (says type of issues)</li> + * </ul> + * <p/> + * Values are Redmine's internal ids (except for the version entry + * which use Redmine's version names). + * <p/> + * Multiple values can be separated by commas. + * <p/> + * + * <b>Note :</b> If a value is set to empty - that means to not filter on + * that property. + * <p/> + * + * To see the internal ids, use the command : + * <pre> + * mvn redmine:display-ids -Dtype=<entry key> + * </pre> + * + * @parameter + * @since 1.0.0 + */ + protected Map<String, String> filtersByPriority; + /** + * Sets the column names that you want to show in the report. The columns + * will appear in the report in the same order as you specify them here. + * Multiple values can be separated by commas. + * <p> + * Valid columns are: <code>Key</code>, <code>Summary</code>, + * <code>Status</code>, <code>Assignee</code>, + * <code>Reporter</code>, <code>Tracker</code>, <code>Priority</code>, + * <code>Version</code>, <code>Category</code>, <code>Created</code> and + * <code>Updated</code>. + * </p> + * + * @parameter expression="${redmine.columnNames}" default-value="Tracker,Category,Key,Summary,Status,Assignee,Version" + * @since 2.0 + */ + protected String columnNamesByPriority; + + public IssuesReportByPriority() { + super("priority"); + } + + /////////////////////////////////////////////////////////////////////////// + /// IssueCollectionConfiguration + /////////////////////////////////////////////////////////////////////////// + @Override + public boolean isOnlyCurrentVersion() { + return onlyCurrentVersionByPriority; + } + + @Override + public int getMaxEntries() { + return maxEntriesByPriority; + } + + /////////////////////////////////////////////////////////////////////////// + /// AbstractIssuesReport + /////////////////////////////////////////////////////////////////////////// + @Override + protected String getColumnNames() { + return columnNamesByPriority; + } + + @Override + protected Map<String, String> getFilters() { + return filtersByPriority; + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByPriority.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByReporter.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByReporter.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByReporter.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,109 @@ +package org.nuiton.jredmine.plugin.report; + +import java.util.Map; + +/** + * Generates a report for issues from Redmine's server group by reporter. + * + * @goal issues-report-by-reporter + * + * @author tchemit + * @since 1.0.0 + */ +public class IssuesReportByReporter extends AbstractIssuesReport { + + /** + * Maximum number of entries to be fetched from redmine. + * + * <b>Note:</b> use value 0 to have no limits + * + * @parameter expression="${redmine.maxEntries}" default-value="100" + * @since 1.0.0 + */ + protected int maxEntriesByReporter; + /** + * If you only want to show issues for the current version in the report. + * The current version being used is <code>${project.version}</code> minus + * any "-SNAPSHOT" suffix. + * + * @parameter expression="${redmine.onlyCurrentVersion}" default-value="false" + * @since 1.0.0 + */ + protected boolean onlyCurrentVersionByReporter; + /** + * Sets some filters on issues to include. + * the possible keys are : + * <ul> + * <li><b>version</b> : to restrict on version fixed </li> + * <li><b>status</b> : to restrict on some status</li> + * <li><b>priority</b> : to restrict on some priorties</li> + * <li><b>category</b> : to restrict on some categories</li> + * <li><b>tracker</b> : to restrict on some tracker (says type of issues)</li> + * </ul> + * <p/> + * Values are Redmine's internal ids (except for the version entry + * which use Redmine's version names). + * <p/> + * Multiple values can be separated by commas. + * <p/> + * + * <b>Note :</b> If a value is set to empty - that means to not filter on + * that property. + * <p/> + * + * To see the internal ids, use the command : + * <pre> + * mvn redmine:display-ids -Dtype=<entry key> + * </pre> + * + * @parameter + * @since 1.0.0 + */ + protected Map<String, String> filtersByReporter; + /** + * Sets the column names that you want to show in the report. The columns + * will appear in the report in the same order as you specify them here. + * Multiple values can be separated by commas. + * <p> + * Valid columns are: <code>Key</code>, <code>Summary</code>, + * <code>Status</code>, <code>Assignee</code>, + * <code>Reporter</code>, <code>Tracker</code>, <code>Priority</code>, + * <code>Version</code>, <code>Category</code>, <code>Created</code> and + * <code>Updated</code>. + * </p> + * + * @parameter expression="${redmine.columnNames}" default-value="Tracker,Category,Key,Summary,Status,Assignee,Version" + * @since 2.0 + */ + protected String columnNamesByReporter; + + public IssuesReportByReporter() { + super("reporter"); + } + + /////////////////////////////////////////////////////////////////////////// + /// IssueCollectionConfiguration + /////////////////////////////////////////////////////////////////////////// + @Override + public boolean isOnlyCurrentVersion() { + return onlyCurrentVersionByReporter; + } + + @Override + public int getMaxEntries() { + return maxEntriesByReporter; + } + + /////////////////////////////////////////////////////////////////////////// + /// AbstractIssuesReport + /////////////////////////////////////////////////////////////////////////// + @Override + protected String getColumnNames() { + return columnNamesByReporter; + } + + @Override + protected Map<String, String> getFilters() { + return filtersByReporter; + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByReporter.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByStatus.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByStatus.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByStatus.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,135 @@ +package org.nuiton.jredmine.plugin.report; + +import java.util.Map; + +/** + * Generates a report for issues from Redmine's server group by status. + * + * @goal issues-report-by-status + * + * @author tchemit + * @since 1.0.0 + */ +public class IssuesReportByStatus extends AbstractIssuesReport { + + /** + * Maximum number of entries to be fetched from redmine. + * + * <b>Note:</b> use value 0 to have no limits + * + * @parameter expression="${redmine.maxEntries}" default-value="100" + * @since 1.0.0 + */ + protected int maxEntriesByStatus; + /** + * If you only want to show issues for the current version in the report. + * The current version being used is <code>${project.version}</code> minus + * any "-SNAPSHOT" suffix. + * + * @parameter expression="${redmine.onlyCurrentVersion}" default-value="false" + * @since 1.0.0 + */ + protected boolean onlyCurrentVersionByStatus; + /** + * Sets some filters on issues to include. + * the possible keys are : + * <ul> + * <li><b>version</b> : to restrict on version fixed </li> + * <li><b>status</b> : to restrict on some status</li> + * <li><b>priority</b> : to restrict on some priorties</li> + * <li><b>category</b> : to restrict on some categories</li> + * <li><b>tracker</b> : to restrict on some tracker (says type of issues)</li> + * </ul> + * <p/> + * Values are Redmine's internal ids (except for the version entry + * which use Redmine's version names). + * <p/> + * Multiple values can be separated by commas. + * <p/> + * + * <b>Note :</b> If a value is set to empty - that means to not filter on + * that property. + * <p/> + * + * To see the internal ids, use the command : + * <pre> + * mvn redmine:display-ids -Dtype=<entry key> + * </pre> + * + * @parameter + * @since 1.0.0 + */ + protected Map<String, String> filtersByStatus; + /** + * Sets the column names that you want to show in the report. The columns + * will appear in the report in the same order as you specify them here. + * Multiple values can be separated by commas. + * <p> + * Valid columns are: <code>Key</code>, <code>Summary</code>, + * <code>Status</code>, <code>Assignee</code>, + * <code>Reporter</code>, <code>Tracker</code>, <code>Priority</code>, + * <code>Version</code>, <code>Category</code>, <code>Created</code> and + * <code>Updated</code>. + * </p> + * + * @parameter expression="${redmine.columnNames}" default-value="Tracker,Category,Key,Summary,Status,Assignee,Version" + * @since 2.0 + */ + protected String columnNamesByStatus; + /** + * Template strings per system that is used to discover the URL to use to display an issue report. Each key in this + * map denotes the (case-sensitive) identifier of the issue tracking system and its value gives the URL template. + * <p> + * There are 2 template tokens you can use. <code>%URL%</code>: this is computed by getting the + * <code><issueManagement>/<url></code> value from the POM, and removing the last '/' + * and everything that comes after it. <code>%ISSUE%</code>: this is the issue number. + * </p> + * + * @parameter expression="${redmine.issueLinkTemplate}" + * @since 1.0.0 + */ + protected String issueLinkTemplateByStatus; + /** + * Template strings per system that is used to discover the URL to use to display an issue report. Each key in this + * map denotes the (case-sensitive) identifier of the issue tracking system and its value gives the URL template. + * <p> + * There are 2 template tokens you can use. <code>%URL%</code>: this is computed by getting the + * <code><issueManagement>/<url></code> value from the POM, and removing the last '/' + * and everything that comes after it. <code>%VERSION%</code>: this is the issue number. + * </p> + * + * @parameter expression="${redmine.versionLinkTemplate}" + * @since 1.0.0 + */ + protected String versionLinkTemplateByStatus; + + public IssuesReportByStatus() { + super("status"); + } + + /////////////////////////////////////////////////////////////////////////// + /// IssueCollectionConfiguration + /////////////////////////////////////////////////////////////////////////// + @Override + public boolean isOnlyCurrentVersion() { + return onlyCurrentVersionByStatus; + } + + @Override + public int getMaxEntries() { + return maxEntriesByStatus; + } + + /////////////////////////////////////////////////////////////////////////// + /// AbstractIssuesReport + /////////////////////////////////////////////////////////////////////////// + @Override + protected String getColumnNames() { + return columnNamesByStatus; + } + + @Override + protected Map<String, String> getFilters() { + return filtersByStatus; + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByStatus.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByTracker.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByTracker.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByTracker.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,109 @@ +package org.nuiton.jredmine.plugin.report; + +import java.util.Map; + +/** + * Generates a report for issues from Redmine's server group by tracker. + * + * @goal issues-report-by-tracker + * + * @author tchemit + * @since 1.0.0 + */ +public class IssuesReportByTracker extends AbstractIssuesReport { + + /** + * Maximum number of entries to be fetched from redmine. + * + * <b>Note:</b> use value 0 to have no limits + * + * @parameter expression="${redmine.maxEntries}" default-value="100" + * @since 1.0.0 + */ + protected int maxEntriesByTracker; + /** + * If you only want to show issues for the current version in the report. + * The current version being used is <code>${project.version}</code> minus + * any "-SNAPSHOT" suffix. + * + * @parameter expression="${redmine.onlyCurrentVersion}" default-value="false" + * @since 1.0.0 + */ + protected boolean onlyCurrentVersionByTracker; + /** + * Sets some filters on issues to include. + * the possible keys are : + * <ul> + * <li><b>version</b> : to restrict on version fixed </li> + * <li><b>status</b> : to restrict on some status</li> + * <li><b>priority</b> : to restrict on some priorties</li> + * <li><b>category</b> : to restrict on some categories</li> + * <li><b>tracker</b> : to restrict on some tracker (says type of issues)</li> + * </ul> + * <p/> + * Values are Redmine's internal ids (except for the version entry + * which use Redmine's version names). + * <p/> + * Multiple values can be separated by commas. + * <p/> + * + * <b>Note :</b> If a value is set to empty - that means to not filter on + * that property. + * <p/> + * + * To see the internal ids, use the command : + * <pre> + * mvn redmine:display-ids -Dtype=<entry key> + * </pre> + * + * @parameter + * @since 1.0.0 + */ + protected Map<String, String> filtersByTracker; + /** + * Sets the column names that you want to show in the report. The columns + * will appear in the report in the same order as you specify them here. + * Multiple values can be separated by commas. + * <p> + * Valid columns are: <code>Key</code>, <code>Summary</code>, + * <code>Status</code>, <code>Assignee</code>, + * <code>Reporter</code>, <code>Tracker</code>, <code>Priority</code>, + * <code>Version</code>, <code>Category</code>, <code>Created</code> and + * <code>Updated</code>. + * </p> + * + * @parameter expression="${redmine.columnNames}" default-value="Tracker,Category,Key,Summary,Status,Assignee,Version" + * @since 2.0 + */ + protected String columnNamesByTracker; + + public IssuesReportByTracker() { + super("tracker"); + } + + /////////////////////////////////////////////////////////////////////////// + /// IssueCollectionConfiguration + /////////////////////////////////////////////////////////////////////////// + @Override + public boolean isOnlyCurrentVersion() { + return onlyCurrentVersionByTracker; + } + + @Override + public int getMaxEntries() { + return maxEntriesByTracker; + } + + /////////////////////////////////////////////////////////////////////////// + /// AbstractIssuesReport + /////////////////////////////////////////////////////////////////////////// + @Override + protected String getColumnNames() { + return columnNamesByTracker; + } + + @Override + protected Map<String, String> getFilters() { + return filtersByTracker; + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByTracker.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByVersion.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByVersion.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByVersion.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,109 @@ +package org.nuiton.jredmine.plugin.report; + +import java.util.Map; + +/** + * Generates a report for issues from Redmine's server group by version. + * + * @goal issues-report-by-version + * + * @author tchemit + * @since 1.0.0 + */ +public class IssuesReportByVersion extends AbstractIssuesReport { + + /** + * Maximum number of entries to be fetched from redmine. + * + * <b>Note:</b> use value 0 to have no limits + * + * @parameter expression="${redmine.maxEntries}" default-value="100" + * @since 1.0.0 + */ + protected int maxEntriesByVersion; + /** + * If you only want to show issues for the current version in the report. + * The current version being used is <code>${project.version}</code> minus + * any "-SNAPSHOT" suffix. + * + * @parameter expression="${redmine.onlyCurrentVersion}" default-value="false" + * @since 1.0.0 + */ + protected boolean onlyCurrentVersionByVersion; + /** + * Sets some filters on issues to include. + * the possible keys are : + * <ul> + * <li><b>version</b> : to restrict on version fixed </li> + * <li><b>status</b> : to restrict on some status</li> + * <li><b>priority</b> : to restrict on some priorties</li> + * <li><b>category</b> : to restrict on some categories</li> + * <li><b>tracker</b> : to restrict on some tracker (says type of issues)</li> + * </ul> + * <p/> + * Values are Redmine's internal ids (except for the version entry + * which use Redmine's version names). + * <p/> + * Multiple values can be separated by commas. + * <p/> + * + * <b>Note :</b> If a value is set to empty - that means to not filter on + * that property. + * <p/> + * + * To see the internal ids, use the command : + * <pre> + * mvn redmine:display-ids -Dtype=<entry key> + * </pre> + * + * @parameter + * @since 1.0.0 + */ + protected Map<String, String> filtersByVersion; + /** + * Sets the column names that you want to show in the report. The columns + * will appear in the report in the same order as you specify them here. + * Multiple values can be separated by commas. + * <p> + * Valid columns are: <code>Key</code>, <code>Summary</code>, + * <code>Status</code>, <code>Assignee</code>, + * <code>Reporter</code>, <code>Tracker</code>, <code>Priority</code>, + * <code>Version</code>, <code>Category</code>, <code>Created</code> and + * <code>Updated</code>. + * </p> + * + * @parameter expression="${redmine.columnNames}" default-value="Tracker,Category,Key,Summary,Status,Assignee,Version" + * @since 2.0 + */ + protected String columnNamesByVersion; + + public IssuesReportByVersion() { + super("version"); + } + + /////////////////////////////////////////////////////////////////////////// + /// IssueCollectionConfiguration + /////////////////////////////////////////////////////////////////////////// + @Override + public boolean isOnlyCurrentVersion() { + return onlyCurrentVersionByVersion; + } + + @Override + public int getMaxEntries() { + return maxEntriesByVersion; + } + + /////////////////////////////////////////////////////////////////////////// + /// AbstractIssuesReport + /////////////////////////////////////////////////////////////////////////// + @Override + protected String getColumnNames() { + return columnNamesByVersion; + } + + @Override + protected Map<String, String> getFilters() { + return filtersByVersion; + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByVersion.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/main/resources/META-INF/plexus/components.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/resources/META-INF/plexus/components.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/resources/META-INF/plexus/components.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,62 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> +<component-set> + <components> + <component> + <role>org.sonatype.plexus.components.sec.dispatcher.SecDispatcher</role> + <role-hint>maven-redmine-plugin</role-hint> + <implementation>org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher</implementation> + <requirements> + <requirement> + <role>org.sonatype.plexus.components.cipher.PlexusCipher</role> + <field-name>_cipher</field-name> + </requirement> + <requirement> + <role>org.sonatype.plexus.components.sec.dispatcher.PasswordDecryptor</role> + <field-name>_decryptors</field-name> + </requirement> + </requirements> + <configuration> + <_configurationFile>~/.m2/settings-security.xml</_configurationFile> + </configuration> + </component> + <!--component> + <role>org.codehaus.plexus.velocity.VelocityComponent</role> + <role-hint>maven-changes-plugin</role-hint> + <implementation>org.codehaus.plexus.velocity.DefaultVelocityComponent</implementation> + <configuration> + <properties> + <property> + <name>resource.loader</name> + <value>file,class</value> + </property> + <property> + <name>class.resource.loader.class</name> + <value>org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader</value> + </property> + <property> + <name>file.resource.loader.class</name> + <value>org.apache.maven.plugin.resource.loader.ProjectResourceLoader</value> + </property> + </properties> + </configuration> + </component--> + </components> +</component-set> \ No newline at end of file Added: jredmine/trunk/maven-jredmine-plugin/src/main/resources/log4j.properties =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/resources/log4j.properties (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/resources/log4j.properties 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,26 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +log4j.rootCategory=WARN, stdout + +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +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.apache.commons.httpclient.HttpClient=INFO Added: jredmine/trunk/maven-jredmine-plugin/src/main/resources/org/nuiton/jredmine/plugin/announcement/release-email-announcement.vm =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/resources/org/nuiton/jredmine/plugin/announcement/release-email-announcement.vm (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/resources/org/nuiton/jredmine/plugin/announcement/release-email-announcement.vm 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,131 @@ +## Licensed to the Apache Software Foundation (ASF) under one +## or more contributor license agreements. See the NOTICE file +## distributed with this work for additional information +## regarding copyright ownership. The ASF licenses this file +## to you under the Apache License, Version 2.0 (the +## "License"); you may not use this file except in compliance +## with the License. You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, +## software distributed under the License is distributed on an +## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +## KIND, either express or implied. See the License for the +## specific language governing permissions and limitations +## under the License. +The ${developmentTeam} is pleased to announce the ${finalName} release! + +${introduction} + +#if ($release.getActions().size() == 0) +No changes defined in this version. +#else +Changes in this version include: + +#if ($release.getActions('add').size() !=0) +New features: +#foreach($actionItem in $release.getActions('add')) +#set($action=$actionItem.getAction()) +#if ($actionItem.getIssue()) +#set($issue=$actionItem.getIssue()) +#else +#set($issue="") +#end +#if ($actionItem.getDueTo()) +#set($dueto=$actionItem.getDueTo()) +#else +#set($dueto="") +#end +o ${action} #if($!issue != "") Issue: $issue. #end#if($!dueto != "")Thanks to $dueto. #end + +#set($issue="") +#set($dueto="") +#end +#end + +#if ($release.getActions('fix').size() !=0) +Fixed Bugs: +#foreach($actionItem in $release.getActions('fix')) +#set($action=$actionItem.getAction()) +#if ($actionItem.getIssue()) +#set($issue=$actionItem.getIssue()) +#else +#set($issue="") +#end +#if ($actionItem.getDueTo()) +#set($dueto=$actionItem.getDueTo()) +#else +#set($dueto="") +#end +o ${action} #if($!issue != "") Issue: $issue. #end#if($!dueto != "")Thanks to $dueto. #end + +#set($issue="") +#set($dueto="") +#end +#end + +#if ($release.getActions('update').size() !=0) +Changes: +#foreach($actionItem in $release.getActions('update')) +#set($action=$actionItem.getAction()) +#if ($actionItem.getIssue()) +#set($issue=$actionItem.getIssue()) +#else +#set($issue="") +#end +#if ($actionItem.getDueTo()) +#set($dueto=$actionItem.getDueTo()) +#else +#set($dueto="") +#end +o ${action} #if($!issue != "") Issue: $issue. #end#if($!dueto != "")Thanks to $dueto. #end + +#set($issue="") +#set($dueto="") +#end +#end + +#if ($release.getActions('remove').size() !=0) +Removed: +#foreach($actionItem in $release.getActions('remove')) +#set($action=$actionItem.getAction()) +#if ($actionItem.getIssue()) +#set($issue=$actionItem.getIssue()) +#else +#set($issue="") +#end +#if ($actionItem.getDueTo()) +#set($dueto=$actionItem.getDueTo()) +#else +#set($dueto="") +#end +o ${action} #if($!issue != "") Issue: $issue. #end#if($!dueto != "")Thanks to $dueto. #end + +#set($issue="") +#set($dueto="") +#end +#end +## End of main loop +#end +## TODO make a short description from the packaging type (pom, plugin, jar, war,...) + +#if ($urlDownload) +For a manual installation, you can download files here: +${urlDownload} +#end + +#if ($attachmentsUrls) + +Release files: + +#foreach($a in $attachmentsUrls.entrySet()) +#set($attachment=$a.getKey()) +o ${attachment.getFilename()} - ${a.getValue()} +#end +#end + + +Have fun! +-${developmentTeam} + Added: jredmine/trunk/maven-jredmine-plugin/src/main/resources/org/nuiton/jredmine/plugin/announcement/release-news-announcement.vm =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/resources/org/nuiton/jredmine/plugin/announcement/release-news-announcement.vm (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/resources/org/nuiton/jredmine/plugin/announcement/release-news-announcement.vm 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,133 @@ +## Licensed to the Apache Software Foundation (ASF) under one +## or more contributor license agreements. See the NOTICE file +## distributed with this work for additional information +## regarding copyright ownership. The ASF licenses this file +## to you under the Apache License, Version 2.0 (the +## "License"); you may not use this file except in compliance +## with the License. You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, +## software distributed under the License is distributed on an +## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +## KIND, either express or implied. See the License for the +## specific language governing permissions and limitations +## under the License. +The ${developmentTeam} is pleased to announce the *${finalName}* release! + +${introduction} + +h3. Changes in this version: + +#if ($release.getActions().size() == 0) +No changes defined in this version. +#else +#if ($release.getActions('add').size() !=0) +New features: +#foreach($actionItem in $release.getActions('add')) +#set($action=$actionItem.getAction()) +#if ($actionItem.getIssue()) +#set($issue=$actionItem.getIssue()) +#else +#set($issue="") +#end +#if ($actionItem.getDueTo()) +#set($dueto=$actionItem.getDueTo()) +#else +#set($dueto="") +#end +* ${action} #if($!issue != "") Issue: $issue. #end#if($!dueto != "")Thanks to $dueto. #end + +#set($issue="") +#set($dueto="") +#end +#end + +#if ($release.getActions('fix').size() !=0) +Fixed Bugs: +#foreach($actionItem in $release.getActions('fix')) +#set($action=$actionItem.getAction()) +#if ($actionItem.getIssue()) +#set($issue=$actionItem.getIssue()) +#else +#set($issue="") +#end +#if ($actionItem.getDueTo()) +#set($dueto=$actionItem.getDueTo()) +#else +#set($dueto="") +#end +* ${action} #if($!issue != "") Issue: $issue. #end#if($!dueto != "")Thanks to $dueto. #end + +#set($issue="") +#set($dueto="") +#end +#end + +#if ($release.getActions('update').size() !=0) +Changes: +#foreach($actionItem in $release.getActions('update')) +#set($action=$actionItem.getAction()) +#if ($actionItem.getIssue()) +#set($issue=$actionItem.getIssue()) +#else +#set($issue="") +#end +#if ($actionItem.getDueTo()) +#set($dueto=$actionItem.getDueTo()) +#else +#set($dueto="") +#end +* ${action} #if($!issue != "") Issue: $issue. #end#if($!dueto != "")Thanks to $dueto. #end + +#set($issue="") +#set($dueto="") +#end +#end + +#if ($release.getActions('remove').size() !=0) +Removed: +#foreach($actionItem in $release.getActions('remove')) +#set($action=$actionItem.getAction()) +#if ($actionItem.getIssue()) +#set($issue=$actionItem.getIssue()) +#else +#set($issue="") +#end +#if ($actionItem.getDueTo()) +#set($dueto=$actionItem.getDueTo()) +#else +#set($dueto="") +#end +* ${action} #if($!issue != "") Issue: $issue. #end#if($!dueto != "")Thanks to $dueto. #end + +#set($issue="") +#set($dueto="") +#end +#end +## End of main loop +#end +## TODO make a short description from the packaging type (pom, plugin, jar, war,...) + +h3. Downloads + +#if ($urlDownload) +For a manual installation, you can download files here: +${urlDownload} +#end + +#if ($attachmentsUrls) + +Release files: + +#foreach($a in $attachmentsUrls.entrySet()) +#set($attachment=$a.getKey()) +* ${attachment.getFilename()} - ${a.getValue()} +#end +#end + + +Have fun! +-${developmentTeam} + Added: jredmine/trunk/maven-jredmine-plugin/src/main/resources/redmine-report.properties =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/resources/redmine-report.properties (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/resources/redmine-report.properties 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,66 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +report.name=Issues Report +report.header=Redmine Issues Report +report.description=Report on Issues from the Redmine Issue Tracking System. + +report.name-assignee=Issues / Assignee +report.header-assignee=Redmine Issues Report organized by Assignee. +report.description-assignee=Report on Issues from the Redmine Issue Tracking System (organized by assignees). + +report.name-reporter=Issues / Reporter +report.header-reporter=Redmine Issues Report organized by Reporter. +report.description-reporter=Report on Issues from the Redmine Issue Tracking System (organized by reporters). + +report.name-tracker=Issues / Tracker +report.header-tracker=Redmine Issues Report organized by Tracker. +report.description-tracker=Report on Issues from the Redmine Issue Tracking System (organized by trackers). + +report.name-status=Issues / Status +report.header-status=Redmine Issues Report organized by Status. +report.description-status=Report on Issues from the Redmine Issue Tracking System (organized by status). + +report.name-category=Issues / Category +report.header-category=Redmine Issues Report organized by Category. +report.description-category=Report on Issues from the Redmine Issue Tracking System (organized by category). + +report.name-priority=Issues / Priority +report.header-priority=Redmine Issues Report organized by Priority. +report.description-priority=Report on Issues from the Redmine Issue Tracking System (organized by priority). + +report.name-version=Issues / Version +report.header-version=Redmine Issues Report organized by Version. +report.description-version=Report on Issues from the Redmine Issue Tracking System (organized by version). + +report.error=An error occured that made it impossible to generate this report. \ + Please check the console for information on what might be the cause of this. +report.date.format=yyy-MM-dd 'at' mm:hh +report.label.key=Key +report.label.summary=Summary +report.label.status=Status +report.label.resolution=Resolution +report.label.by=By +report.label.reporter=Reporter +report.label.type=Type +report.label.priority=Priority +report.label.version=Version +report.label.fixVersion=Fix Version +report.label.category=Component +report.message.only.for.current.version=The Redmine Report will contain issues only for the current version +report.label.created=Created on +report.label.updated=Updated on Added: jredmine/trunk/maven-jredmine-plugin/src/main/resources/redmine-report_de.properties =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/resources/redmine-report_de.properties (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/resources/redmine-report_de.properties 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +report.name=Redmine-Bericht +report.description=Bericht \u00FCber die Probleme aus dem Problemverwaltungssystem Redmine. +report.error=Es ist ein Fehler aufgetreten, der die Erstellung dieses Berichts unm\u00F6glich macht. \ + Bitte werten Sie die Konsolenausgabe zur Feststellung der Ursache aus. +report.header=Redmine-Bericht +report.label.key=Schl\u00FCssel +report.label.summary=Zusammenfassung +report.label.status=Status +report.label.resolution=L\u00F6sung +report.label.by=Durch +report.label.reporter=Reporter +report.label.type=Typ +report.label.priority=Priorit\u00E4t +report.label.version=Version +report.label.fixVersion=Korrigierte Version +report.label.category=Komponente +report.message.only.for.current.version=The Redmine Report will contain issues only for the current version +report.label.created=Created on +report.label.updated=Updated on Added: jredmine/trunk/maven-jredmine-plugin/src/main/resources/redmine-report_en.properties =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/resources/redmine-report_en.properties (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/resources/redmine-report_en.properties 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,3 @@ + +report.label.created=Created on +report.label.updated=Updated on Added: jredmine/trunk/maven-jredmine-plugin/src/main/resources/redmine-report_fr.properties =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/main/resources/redmine-report_fr.properties (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/main/resources/redmine-report_fr.properties 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,66 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +report.name=Rapport des demandes +report.description=Rapport des issues sur le server de type Redmine. +report.header=Rapport des demandes du serveur Redmine + +report.name-reporter=Demandes / Reporteur +report.description-reporter=Rapport des issues sur un server de type Redmine organis\u00E9s par reporteur. +report.header-reporter=Rapport des demandes sur le serveur Redmine organis\u00E9 par reporteur. + +report.name-assignee=Demandes / Contributeur +report.description-assignee=Rapport des issues sur un server de type Redmine organis\u00E9s par contributeur. +report.header-assignee=Rapport des demandes sur le serveur Redmine organis\u00E9 par contributeur. + +report.name-tracker=Demandes / Tracker +report.description-tracker=Rapport des issues sur un server de type Redmine organis\u00E9s par tracker. +report.header-tracker=Rapport des demandes sur le serveur Redmine organis\u00E9 par type de demandes. + +report.name-status=Demandes / Statut +report.description-status=Rapport des issues sur un server de type Redmine organis\u00E9s par statut. +report.header-status=Rapport des demandes sur le serveur Redmine organis\u00E9s par statut. + +report.name-category=Demandes / Cat\u00E9gorie +report.description-category=Rapport des issues sur un server de type Redmine organis\u00E9s par cat\u00E9gorie. +report.header-category=Rapport des demandes sur le serveur Redmine organis\u00E9s par cat\u00E9gorie. + +report.name-priority=Demandes / Priorit\u00E9 +report.description-priority=Rapport des issues sur un server de type Redmine organis\u00E9s par priorit\u00E9. +report.header-priority=Rapport des demandes sur le serveur Redmine organis\u00E9s par priorit\u00E9. + +report.name-version=Demandes / Version +report.description-version=Rapport des issues sur un server de type Redmine organis\u00E9s par version. +report.header-version=Rapport des demandes sur le serveur Redmine organis\u00E9s par version. + +report.error=An error occured that made it impossible to generate this report. \ + Please check the console for information on what might be the cause of this. +report.date.format=dd/MM/yyyy '\u00E0' mm:hh +report.label.key=Sujet +report.label.summary=Description +report.label.status=Statut +report.label.resolution=Resolution +report.label.by=Par +report.label.reporter=Cr\u00E9ateur +report.label.type=Type +report.label.priority=Priorit\u00E9 +report.label.version=Version +report.label.fixVersion=Version fix\u00E9e +report.label.category=Cat\u00E9gorie +report.message.only.for.current.version=Le rapport Redmine n'utilisera que les demandes de la version courante +report.label.created=Date de cr\u00E9ation +report.label.updated=Date de mise \u00E0 jour Added: jredmine/trunk/maven-jredmine-plugin/src/site/apt/Todo.apt =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/site/apt/Todo.apt (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/site/apt/Todo.apt 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,8 @@ +---- +TODO +---- +---- +2009-0906 +---- + +Any idea ? Added: jredmine/trunk/maven-jredmine-plugin/src/site/apt/index.apt =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/site/apt/index.apt (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/site/apt/index.apt 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,32 @@ +---- +Introduction +---- +---- +2009-09-06 +---- + +maven-redmine-plugin + + //TODO-FILL_ME + + +* Presentation + + //TODO-FILL_ME + +* Goals Overview + + The plugin has the following goals: + + //TODO-FILL_ME + + + * {{{help-mojo.html}help}} display help about the plugin (goals, usage). + +* Usage + + Instructions on how to use the Plugin can be found on {{{usage.html}usage}} page + +* Examples + + to be done. Added: jredmine/trunk/maven-jredmine-plugin/src/site/apt/usage.apt =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/site/apt/usage.apt (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/site/apt/usage.apt 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,37 @@ +---- +Usage +---- +---- +2009-09-06 +---- + +generate-changes goal + +------------------------------------------------------------------------------ + + //TODO-FILL_ME +------------------------------------------------------------------------------ + +* How does it work ? + + //TODO-FILL_ME + + +help goal + + This goal display the help of the plugin (available goals). + + Use it directly (and only) from commandline : + +------------------------------------------------------------------------------ + + mvn license:help +------------------------------------------------------------------------------ + + To display verbose help : + +------------------------------------------------------------------------------ + mvn license:help -Ddetail +------------------------------------------------------------------------------ + + for full detail see {{{help-mojo.html}help}} detail page. Added: jredmine/trunk/maven-jredmine-plugin/src/site/site.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/site/site.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/site/site.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project name="${project.name}"> + + <publishDate format="dd/MM/yyyy"/> + + <skin> + <groupId>org.nuiton</groupId> + <artifactId>maven-nuiton-skin</artifactId> + <version>1.0.0</version> + </skin> + <bannerLeft> + <name>${project.name}</name> + <href>index.html</href> + </bannerLeft> + + <bannerRight> + <src>http://www.codelutin.com/images/lutinorange-codelutin.png</src> + <href>${project.organization.url}</href> + </bannerRight> + + <poweredBy> + <logo href="http://maven.apache.org" name="Maven" img="images/logos/maven-feather.png"/> + </poweredBy> + + <body> + + <breadcrumbs> + <item name="${project.name}" href="${project.url}" /> + </breadcrumbs> + + <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="redmine-report" href="redmine-report-mojo.html"/> + <item name="get-project-data" href="get-project-data-mojo.html"/> + <item name="get-project-version-data" href="get-project-version-data-mojo.html"/> + <item name="help" href="help-mojo.html"/> + </item> + </menu> + + <menu name="Téléchargement"> + <item href="${repository.home.url}/org/nuiton/maven-redmine-plugin/${project.version}/${project.build.finalName}.jar" + name="Librairie (jar)"/> + <item href="${repository.home.url}/org/nuiton/maven-redmine-plugin/${project.version}/${project.build.finalName}-javadoc.jar" + name="Javadoc (jar)"/> + <item href="${repository.home.url}/org/nuiton/maven-redmine-plugin/${project.version}/${project.build.finalName}-sources.jar" + name="Sources (jar)"/> + </menu> + + <menu ref="reports"/> + + </body> +</project> Added: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/AbstractRedmineMojoTest.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/AbstractRedmineMojoTest.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/AbstractRedmineMojoTest.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,64 @@ +package org.nuiton.jredmine.plugin; + +import java.io.File; +import java.io.IOException; +import org.apache.maven.model.IssueManagement; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.nuiton.jredmine.TestHelper; +import org.nuiton.plugin.AbstractMojoTest; + +/** + * + * @param <P> type of mojo to test + * @author chemit + * @since 1.0.0 + */ +public abstract class AbstractRedmineMojoTest<P extends AbstractRedmineMojo> extends AbstractMojoTest<P> { + + @BeforeClass + public static void atTheBegining() throws IOException { + + // load default configuration + TestHelper.initDefaultConfiguration(); + // load basedir + TestHelper.getBasedir(); + } + protected boolean canContinue; + + protected void beforeMojoInit(P mojo, File pomFile) throws Exception { + // add a issue management + IssueManagement i = new IssueManagement(); + i.setSystem("redmine"); + i.setUrl(mojo.getRestUrl() + "/projects/one/issues"); + mojo.getProject().setIssueManagement(i); + + } + + @Override + protected void setUpMojo(P mojo, File pomFile) throws Exception { + super.setUpMojo(mojo, pomFile); + + // copy redmine test server configuration + TestHelper.copyConfiguration(TestHelper.getTestConfiguration(), mojo); + + beforeMojoInit(mojo, pomFile); + + canContinue = mojo.init(); + if (canContinue) { + if (mojo.isVerbose()) { + log.info("setup done for " + mojo.getProject().getFile().getName()); + } + } else { + log.warn("setup was not successfull, will skip this test [" + getClass() + "]"); + } + } + + protected void mojoDoAction() throws Exception { + if (!canContinue) { + return; + } + Assert.assertNotNull(getMojo()); + getMojo().doAction(); + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/AbstractRedmineMojoTest.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/DisplayDataMojoTest.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/DisplayDataMojoTest.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/DisplayDataMojoTest.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,50 @@ +package org.nuiton.jredmine.plugin; + +import org.junit.Test; + +/** + * @author tchemit + * @since 1.0.0 + */ +public class DisplayDataMojoTest extends AbstractRedmineMojoTest<DisplayDataMojo> { + + @Override + protected String getGoalName(String methodName) { + return "display-data"; + } + + @Test + public void displayProjectTrackers() throws Exception { + mojoDoAction(); + } + + @Test + public void displayProjectUsers() throws Exception { + + mojoDoAction(); + } + + @Test + public void displayProjectIssueCategories() throws Exception { + + mojoDoAction(); + } + + @Test + public void displayIssueStatuses() throws Exception { + + mojoDoAction(); + } + + @Test + public void displayIssuePriorities() throws Exception { + + mojoDoAction(); + } + + @Test + public void displayAll() throws Exception { + + mojoDoAction(); + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/DisplayDataMojoTest.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/GenerateChangesMojoTest.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/GenerateChangesMojoTest.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/GenerateChangesMojoTest.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,23 @@ +package org.nuiton.jredmine.plugin; + +import org.junit.Test; + +/** + * @author tchemit + * @since 1.0.0 + */ +public class GenerateChangesMojoTest extends AbstractRedmineMojoTest<GenerateChangesMojo> { + + @Override + protected String getGoalName(String methodName) { + return "generate-changes"; + } + + @Test + public void generateChanges() throws Exception { + + + mojoDoAction(); + //TODO check file is generated + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/GenerateChangesMojoTest.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojoTest.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojoTest.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojoTest.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,27 @@ +package org.nuiton.jredmine.plugin; + +import org.junit.Test; + +/** + * @author tchemit + * @since 1.0.0 + */ +public class PublishAttachmentsMojoTest extends AbstractRedmineMojoTest<PublishAttachmentsMojo> { + + @Override + protected String getGoalName(String methodName) { + return "publish-attachments"; + } + + @Test + public void publishAttachments() throws Exception { + + mojoDoAction(); + } + + @Test + public void skipPublishAttachments() throws Exception { + + mojoDoAction(); + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojoTest.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/PublishNewsMojoTest.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/PublishNewsMojoTest.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/PublishNewsMojoTest.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,27 @@ +package org.nuiton.jredmine.plugin; + +import org.junit.Test; + +/** + * @author tchemit + * @since 1.0.0 + */ +public class PublishNewsMojoTest extends AbstractRedmineMojoTest<PublishNewsMojo> { + + @Override + protected String getGoalName(String methodName) { + return "publish-news"; + } + + @Test + public void publishNews() throws Exception { + + mojoDoAction(); + } + + @Test + public void skipPublishNews() throws Exception { + + mojoDoAction(); + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/PublishNewsMojoTest.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/SendEmailMojoTest.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/SendEmailMojoTest.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/SendEmailMojoTest.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,63 @@ +package org.nuiton.jredmine.plugin; + +import java.io.File; +import java.util.Arrays; +import junit.framework.Assert; +import org.apache.maven.plugin.announcement.MailSender; +import org.junit.Test; +import org.nuiton.plugin.AbstractMojoTest; + +/** + * @author tchemit + * @since 1.0.0 + */ +public class SendEmailMojoTest extends AbstractMojoTest<SendEmailMojo> { + + protected boolean canContinue; + + @Override + protected String getGoalName(String methodName) { + return "send-email"; + } + + @Override + protected void setUpMojo(SendEmailMojo mojo, File pomFile) throws Exception { + super.setUpMojo(mojo, pomFile); + + // copy redmine test server configuration + //TestHelper.copyConfiguration(TestHelper.getTestConfiguration(), mojo); + + + // add a mailSender here + MailSender sender = new MailSender(); + sender.setName("Nuiton Release Notification"); + sender.setEmail("test@noway.fr"); + mojo.setMailSender(sender); + + // add a destination + mojo.setToAddresses(Arrays.asList("chemit@codelutin.com")); + + canContinue = mojo.init(); + if (canContinue) { + if (mojo.isVerbose()) { + log.info("setup done for " + mojo.getProject().getFile().getName()); + } + } else { + log.warn("setup was not successfull, will skip this test [" + getClass() + "]"); + } + } + + @Test + public void sendEmail() throws Exception { + + Assert.assertNotNull(getMojo()); + getMojo().doAction(); + } + + @Test + public void skipSendEmail() throws Exception { + + Assert.assertNotNull(getMojo()); + getMojo().doAction(); + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/SendEmailMojoTest.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/UpdateVersionMojoTest.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/UpdateVersionMojoTest.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/UpdateVersionMojoTest.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,27 @@ +package org.nuiton.jredmine.plugin; + +import org.junit.Test; + +/** + * @author tchemit + * @since 1.0.0 + */ +public class UpdateVersionMojoTest extends AbstractRedmineMojoTest<UpdateVersionMojo> { + + @Override + protected String getGoalName(String methodName) { + return "update-version"; + } + + @Test + public void updateVersion() throws Exception { + + mojoDoAction(); + } + + @Test + public void skipUpdateVersion() throws Exception { + + mojoDoAction(); + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/UpdateVersionMojoTest.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojoTest.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojoTest.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojoTest.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,30 @@ +package org.nuiton.jredmine.plugin.announcement; + +import org.junit.Test; +import org.nuiton.jredmine.plugin.AbstractRedmineMojoTest; + +/** + * + * @author chemit + * @since 1.0.0 + */ +public class GenerateEmailAnnouncementMojoTest extends AbstractRedmineMojoTest<GenerateEmailAnnouncementMojo> { + + @Override + protected String getGoalName(String methodName) { + return "generate-email-announcement"; + } + + @Test + public void generateEmailAnnouncement() throws Exception { + + mojoDoAction(); + //TODO check file is generated + } + + @Test + public void skipGenerateEmailAnnouncement() throws Exception { + + mojoDoAction(); + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojoTest.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojoTest.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojoTest.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojoTest.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,30 @@ +package org.nuiton.jredmine.plugin.announcement; + +import org.junit.Test; +import org.nuiton.jredmine.plugin.AbstractRedmineMojoTest; + +/** + * + * @author chemit + * @since 1.0.0 + */ +public class GenerateNewsAnnouncementMojoTest extends AbstractRedmineMojoTest<GenerateNewsAnnouncementMojo> { + + @Override + protected String getGoalName(String methodName) { + return "generate-news-announcement"; + } + + @Test + public void generateNewsAnnouncement() throws Exception { + + mojoDoAction(); + //TODO check file is generated + } + + @Test + public void skipGenerateNewsAnnouncement() throws Exception { + + mojoDoAction(); + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojoTest.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/AbstractIssuesReportTest.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/AbstractIssuesReportTest.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/AbstractIssuesReportTest.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,33 @@ +package org.nuiton.jredmine.plugin.report; + +import org.junit.Assume; +import org.junit.Test; +import org.nuiton.jredmine.plugin.AbstractRedmineMojoTest; + +/** + * @param <P> type of issue reports to test + * @author tchemit + * @since 1.0.0 + */ +public abstract class AbstractIssuesReportTest<P extends AbstractIssuesReport> extends AbstractRedmineMojoTest<P> { + + @Test + public void issueReport() throws Exception { + + mojoDoreport(); + + checkDoreport(); + } + + protected void mojoDoreport() throws Exception { + + Assume.assumeTrue(canContinue); + + //TODO make this possible + //getMojo().executeReport(Locale.FRENCH); + } + + protected void checkDoreport() throws Exception { + //TODO do some tests : file is generated + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/AbstractIssuesReportTest.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByAssigneeTest.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByAssigneeTest.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByAssigneeTest.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,13 @@ +package org.nuiton.jredmine.plugin.report; + +/** + * @author tchemit + * @since 1.0.0 + */ +public class IssuesReportByAssigneeTest extends AbstractIssuesReportTest<IssuesReportByAssignee> { + + @Override + protected String getGoalName(String methodName) { + return "issues-report-by-assignee"; + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByAssigneeTest.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByCategoryTest.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByCategoryTest.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByCategoryTest.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,13 @@ +package org.nuiton.jredmine.plugin.report; + +/** + * @author tchemit + * @since 1.0.0 + */ +public class IssuesReportByCategoryTest extends AbstractIssuesReportTest<IssuesReportByAssignee> { + + @Override + protected String getGoalName(String methodName) { + return "issues-report-by-category"; + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByCategoryTest.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByPriorityTest.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByPriorityTest.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByPriorityTest.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,13 @@ +package org.nuiton.jredmine.plugin.report; + +/** + * @author tchemit + * @since 1.0.0 + */ +public class IssuesReportByPriorityTest extends AbstractIssuesReportTest<IssuesReportByAssignee> { + + @Override + protected String getGoalName(String methodName) { + return "issues-report-by-priority"; + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByPriorityTest.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByReporterTest.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByReporterTest.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByReporterTest.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,13 @@ +package org.nuiton.jredmine.plugin.report; + +/** + * @author tchemit + * @since 1.0.0 + */ +public class IssuesReportByReporterTest extends AbstractIssuesReportTest<IssuesReportByAssignee> { + + @Override + protected String getGoalName(String methodName) { + return "issues-report-by-reporter"; + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByReporterTest.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByStatusTest.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByStatusTest.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByStatusTest.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,14 @@ +package org.nuiton.jredmine.plugin.report; + +/** + * @author tchemit + * @since 1.0.0 + */ +public class IssuesReportByStatusTest extends AbstractIssuesReportTest<IssuesReportByAssignee> { + + @Override + protected String getGoalName(String methodName) { + return "issues-report-by-status"; + } + +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByStatusTest.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByTrackerTest.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByTrackerTest.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByTrackerTest.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,14 @@ +package org.nuiton.jredmine.plugin.report; + +/** + * @author tchemit + * @since 1.0.0 + */ +public class IssuesReportByTrackerTest extends AbstractIssuesReportTest<IssuesReportByAssignee> { + + @Override + protected String getGoalName(String methodName) { + return "issues-report-by-tracker"; + } + +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByTrackerTest.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByVersionTest.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByVersionTest.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByVersionTest.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,14 @@ +package org.nuiton.jredmine.plugin.report; + +/** + * @author tchemit + * @since 1.0.0 + */ +public class IssuesReportByVersionTest extends AbstractIssuesReportTest<IssuesReportByAssignee> { + + @Override + protected String getGoalName(String methodName) { + return "issues-report-by-version"; + } + +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportByVersionTest.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportTest.java =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportTest.java (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportTest.java 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,13 @@ +package org.nuiton.jredmine.plugin.report; + +/** + * @author tchemit + * @since 1.0.0 + */ +public class IssuesReportTest extends AbstractIssuesReportTest<IssuesReportByAssignee> { + + @Override + protected String getGoalName(String methodName) { + return "issues-report"; + } +} Property changes on: jredmine/trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/report/IssuesReportTest.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/DisplayDataMojoTest/displayAll.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/DisplayDataMojoTest/displayAll.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/DisplayDataMojoTest/displayAll.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + + <name>generate-changes</name> + + <build> + + <plugins> + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-plugin</artifactId> + <configuration> + <projectId>one</projectId> + <versionId>1.0.0</versionId> + <types>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 Added: jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/DisplayDataMojoTest/displayIssuePriorities.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/DisplayDataMojoTest/displayIssuePriorities.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/DisplayDataMojoTest/displayIssuePriorities.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + + <name>generate-changes</name> + + <build> + + <plugins> + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-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 Added: jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/DisplayDataMojoTest/displayIssueStatuses.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/DisplayDataMojoTest/displayIssueStatuses.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/DisplayDataMojoTest/displayIssueStatuses.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + + <name>generate-changes</name> + + <build> + + <plugins> + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-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 Added: jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/DisplayDataMojoTest/displayProjectIssueCategories.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/DisplayDataMojoTest/displayProjectIssueCategories.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/DisplayDataMojoTest/displayProjectIssueCategories.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + + <name>generate-changes</name> + + <build> + + <plugins> + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-plugin</artifactId> + <configuration> + <projectId>one</projectId> + <types>issueCategory</types> + </configuration> + <executions> + <execution> + <goals> + <goal>display-data</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> \ No newline at end of file Added: jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/DisplayDataMojoTest/displayProjectTrackers.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/DisplayDataMojoTest/displayProjectTrackers.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/DisplayDataMojoTest/displayProjectTrackers.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + + <name>generate-changes</name> + + <build> + + <plugins> + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-plugin</artifactId> + <configuration> + <projectId>one</projectId> + <types>tracker</types> + </configuration> + <executions> + <execution> + <goals> + <goal>display-data</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> \ No newline at end of file Added: jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/DisplayDataMojoTest/displayProjectUsers.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/DisplayDataMojoTest/displayProjectUsers.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/DisplayDataMojoTest/displayProjectUsers.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + + <name>generate-changes</name> + + <build> + + <plugins> + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-plugin</artifactId> + <configuration> + <projectId>one</projectId> + <types>user</types> + </configuration> + <executions> + <execution> + <goals> + <goal>display-data</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> \ No newline at end of file Added: jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/GenerateChangesMojoTest/generateChanges.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/GenerateChangesMojoTest/generateChanges.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/GenerateChangesMojoTest/generateChanges.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + + <name>generate-changes</name> + + <build> + + <plugins> + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-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> +</project> \ No newline at end of file Added: jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/PublishAttachmentsMojoTest/publishAttachments.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/PublishAttachmentsMojoTest/publishAttachments.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/PublishAttachmentsMojoTest/publishAttachments.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + + <name>generate-changes</name> + + <build> + + <plugins> + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-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> +</project> \ No newline at end of file Added: jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/PublishAttachmentsMojoTest/skipPublishAttachments.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/PublishAttachmentsMojoTest/skipPublishAttachments.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/PublishAttachmentsMojoTest/skipPublishAttachments.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + + <name>generate-changes</name> + + <build> + + <plugins> + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-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> +</project> \ No newline at end of file Added: jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/PublishNewsMojoTest/newsContentFile.txt =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/PublishNewsMojoTest/newsContentFile.txt (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/PublishNewsMojoTest/newsContentFile.txt 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1 @@ +Content of the test news \ No newline at end of file Added: jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/PublishNewsMojoTest/publishNews.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/PublishNewsMojoTest/publishNews.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/PublishNewsMojoTest/publishNews.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + + <name>generate-changes</name> + + <build> + + <plugins> + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-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> +</project> \ No newline at end of file Added: jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/PublishNewsMojoTest/skipPublishNews.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/PublishNewsMojoTest/skipPublishNews.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/PublishNewsMojoTest/skipPublishNews.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + + <name>generate-changes</name> + + <build> + + <plugins> + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-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> +</project> \ No newline at end of file Added: jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/SendEmailMojoTest/mailContentFile.txt =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/SendEmailMojoTest/mailContentFile.txt (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/SendEmailMojoTest/mailContentFile.txt 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1 @@ +The content of the test email \ No newline at end of file Added: jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/SendEmailMojoTest/sendEmail.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/SendEmailMojoTest/sendEmail.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/SendEmailMojoTest/sendEmail.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + + <name>generate-changes</name> + + <build> + + <plugins> + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-plugin</artifactId> + <configuration> + <emailContentFile>target/test-classes/org/nuiton/jredmine/plugin/SendEmailMojoTest/mailContentFile.txt</emailContentFile> + <emailTitle>[ANNOUNCEMENT] - One 1.0.0 released</emailTitle> + <encoding>UTF-8</encoding> + <skipSendEmail>false</skipSendEmail> + <!--<mailSender> + <name>Nuiton Release Notification</name> + <email>noreply@${platform}</email> + </mailSender> + <toAddresses> + <item>chemit@codelutin.com</item> + </toAddresses>--> + <smtpHost>smtp</smtpHost> + <smtpPort>25</smtpPort> + <dryRun>true</dryRun> + </configuration> + <executions> + <execution> + <goals> + <goal>send-email</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> \ No newline at end of file Added: jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/SendEmailMojoTest/skipSendEmail.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/SendEmailMojoTest/skipSendEmail.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/SendEmailMojoTest/skipSendEmail.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + + <name>generate-changes</name> + + <build> + + <plugins> + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-plugin</artifactId> + <configuration> + <emailContentFile>target/test-classes/org/nuiton/jredmine/plugin/SendEmailMojoTest/mailContentFile.txt</emailContentFile> + <emailTitle>[ANNOUNCEMENT] - One 1.0.0 released</emailTitle> + <encoding>UTF-8</encoding> + <skipSendEmail>true</skipSendEmail> + </configuration> + <executions> + <execution> + <goals> + <goal>send-email</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> \ No newline at end of file Added: jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/UpdateVersionMojoTest/skipUpdateVersion.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/UpdateVersionMojoTest/skipUpdateVersion.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/UpdateVersionMojoTest/skipUpdateVersion.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + + <name>generate-changes</name> + + <build> + + <plugins> + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-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> +</project> \ No newline at end of file Added: jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/UpdateVersionMojoTest/updateVersion.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/UpdateVersionMojoTest/updateVersion.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/UpdateVersionMojoTest/updateVersion.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + + <name>generate-changes</name> + + <build> + + <plugins> + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-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>publish-release-version</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> \ No newline at end of file Added: jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojoTest/generateEmailAnnouncement.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojoTest/generateEmailAnnouncement.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojoTest/generateEmailAnnouncement.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + + <name>generate-changes</name> + + <build> + + <plugins> + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-plugin</artifactId> + <configuration> + <finalName>One-1.0.0.jar</finalName> + <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> + <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> +</project> \ No newline at end of file Added: jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojoTest/skipGenerateEmailAnnouncement.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojoTest/skipGenerateEmailAnnouncement.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojoTest/skipGenerateEmailAnnouncement.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + + <name>generate-changes</name> + + <build> + + <plugins> + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-plugin</artifactId> + <configuration> + <finalName>One-1.0.0.jar</finalName> + <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> + <emailAnnouncementTemplate>release-email-announcement.vm</emailAnnouncementTemplate> + <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> +</project> \ No newline at end of file Added: jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojoTest/generateNewsAnnouncement.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojoTest/generateNewsAnnouncement.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojoTest/generateNewsAnnouncement.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + + <name>generate-changes</name> + + <build> + + <plugins> + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-plugin</artifactId> + <configuration> + <finalName>One-1.0.0.jar</finalName> + <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> + <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> +</project> \ No newline at end of file Added: jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojoTest/skipGenerateNewsAnnouncement.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojoTest/skipGenerateNewsAnnouncement.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojoTest/skipGenerateNewsAnnouncement.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + + <name>generate-changes</name> + + <build> + + <plugins> + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-plugin</artifactId> + <configuration> + <finalName>One-1.0.0.jar</finalName> + <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> + <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> +</project> \ No newline at end of file Added: jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/changes.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/changes.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/announcement/changes.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<document> + <properties> + <title>Title of the first release</title> + <author email="perso@noway.fr">Tony Chemit</author> + </properties> + <body> + <release version="aab" date="2009-09-13" description="COCO" /> + <release version="1.0.0" date="2009-09-13" description="The version 1.0.0 description"> + <action dev="chemit" due-to="Tony Chemit" due-to-email="perso@noway.fr" issue="2" type="add" system="redmine">test evol</action> + <action dev="chemit" due-to="Tony Chemit" due-to-email="perso@noway.fr" issue="4" type="fix" system="redmine">test anomalie</action> + <action dev="chemit" due-to="Tony Chemit" due-to-email="perso@noway.fr" issue="5" type="add" system="redmine">test evolution</action> + </release> + <release version="1.0.3" date="2009-09-12" description="new versions"> + <action dev="chemit" due-to="Tony Chemit" due-to-email="perso@noway.fr" issue="4" type="fix" system="redmine">test anomalie</action> + <action dev="chemit" due-to="Tony Chemit" due-to-email="perso@noway.fr" issue="5" type="add" system="redmine">test evolution</action> + </release> + <release version="yaouuuuuua" date="2009-09-06" description="yoye" /> + <release version="ya" date="2009-09-06" description="yoye" /> + <release version="ouuuuuua" date="2009-09-06" description="ysssoye" /> + </body> +</document> Added: jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByAssigneeTest/issueReport.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByAssigneeTest/issueReport.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByAssigneeTest/issueReport.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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-redmine-report</artifactId> + <version>0</version> + + <name>redmine-report</name> + + <build> + + <plugins> + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-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> +</project> \ No newline at end of file Added: jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByCategoryTest/issueReport.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByCategoryTest/issueReport.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByCategoryTest/issueReport.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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-redmine-report</artifactId> + <version>0</version> + + <name>redmine-report</name> + + <build> + + <plugins> + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-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> +</project> \ No newline at end of file Added: jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByPriorityTest/issueReport.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByPriorityTest/issueReport.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByPriorityTest/issueReport.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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-redmine-report</artifactId> + <version>0</version> + + <name>redmine-report</name> + + <build> + + <plugins> + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-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> +</project> \ No newline at end of file Added: jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByReporterTest/issueReport.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByReporterTest/issueReport.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByReporterTest/issueReport.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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-redmine-report</artifactId> + <version>0</version> + + <name>redmine-report</name> + + <build> + + <plugins> + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-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> +</project> \ No newline at end of file Added: jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByStatusTest/issueReport.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByStatusTest/issueReport.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByStatusTest/issueReport.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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-redmine-report</artifactId> + <version>0</version> + + <name>redmine-report</name> + + <build> + + <plugins> + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-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> +</project> \ No newline at end of file Added: jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByTrackerTest/issueReport.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByTrackerTest/issueReport.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByTrackerTest/issueReport.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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-redmine-report</artifactId> + <version>0</version> + + <name>redmine-report</name> + + <build> + + <plugins> + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-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> +</project> \ No newline at end of file Added: jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByVersionTest/issueReport.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByVersionTest/issueReport.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportByVersionTest/issueReport.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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-redmine-report</artifactId> + <version>0</version> + + <name>redmine-report</name> + + <build> + + <plugins> + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-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> +</project> \ No newline at end of file Added: jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportTest/issueReport.xml =================================================================== --- jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportTest/issueReport.xml (rev 0) +++ jredmine/trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/report/IssuesReportTest/issueReport.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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-redmine-report</artifactId> + <version>0</version> + + <name>redmine-report</name> + + <build> + + <plugins> + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-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> +</project> \ No newline at end of file Added: jredmine/trunk/pom.xml =================================================================== --- jredmine/trunk/pom.xml (rev 0) +++ jredmine/trunk/pom.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,721 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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 *************************************** --> + <!-- ************************************************************* --> + + <groupId>org.nuiton</groupId> + <artifactId>jredmine</artifactId> + <version>1.0.0-SNAPSHOT</version> + + <modules> + <module>jredmine-client</module> + <module>maven-jredmine-plugin</module> + </modules> + + <dependencyManagement> + + <dependencies> + <dependency> + <groupId>org.nuiton</groupId> + <artifactId>maven-helper-plugin</artifactId> + <version>${helper.version}</version> + <scope>compile</scope> + </dependency> + + <!-- fix dependency pb in velocity (need at least version > 2.2) --> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.4</version> + </dependency> + + <!-- FIXME si on ne le rajoute pas, on se retrouve avec la version 1.1 qui ne convient pas --> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + <version>1.5.15</version> + <scope>compile</scope> + </dependency> + + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-project</artifactId> + <version>${maven.version}</version> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-plugin-api</artifactId> + <version>${maven.version}</version> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-core</artifactId> + <version>${maven.version}</version> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>org.sonatype.plexus</groupId> + <artifactId>plexus-sec-dispatcher</artifactId> + <version>1.3.1</version> + </dependency> + + <dependency> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-changes-plugin</artifactId> + <version>2.1</version> + </dependency> + <dependency> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpclient</artifactId> + <version>4.0</version> + </dependency> + + <dependency> + <groupId>commons-httpclient</groupId> + <artifactId>commons-httpclient</artifactId> + <version>3.1</version> + </dependency> + + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.9</version> + <scope>runtime</scope> + </dependency> + + <!-- tests dependencies --> + + <dependency> + <groupId>org.nuiton</groupId> + <artifactId>maven-helper-plugin</artifactId> + <version>${helper.version}</version> + <scope>test</scope> + <classifier>tests</classifier> + </dependency> + + <dependency> + <groupId>org.apache.maven.plugin-testing</groupId> + <artifactId>maven-plugin-testing-harness</artifactId> + <version>1.2</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.7</version> + <scope>test</scope> + </dependency> + + </dependencies> + </dependencyManagement> + + <!-- ************************************************************* --> + <!-- *** Project Information ************************************* --> + <!-- ************************************************************* --> + <name>JRedmine project</name> + + <description>JRedmine is a java redmine client</description> + + <inceptionYear>2009</inceptionYear> + + <url>http://maven-site.nuiton.org/sandbox/jredmine</url> + + <licenses> + <license> + <name>Lesser General Public License (LGPL)</name> + <url>${maven.license.file}</url> + <distribution>local</distribution> + </license> + </licenses> + + <developers> + + <developer> + <name>Tony Chemit</name> + <id>tchemit</id> + <email>chemit@codelutin.com</email> + <organization>CodeLutin</organization> + <timezone>+2</timezone> + <roles> + <role>Développeur</role> + </roles> + </developer> + + </developers> + + <organization> + <name>CodeLutin</name> + <url>http://www.codelutin.com/</url> + </organization> + + <!-- ************************************************************* --> + <!-- *** Build Settings ****************************************** --> + <!-- ************************************************************* --> + + <packaging>pom</packaging> + + <properties> + + <!-- the redmine plateform used (nuiton.org or chorem.org) --> + <platform>nuiton.org</platform> + + <!-- a proprerty to define the id of the project, in a multi-module + project, you must use a hard-cored value, otherwise for modules + the artifactId will be expanded , otherwise, no need to override it + --> + <projectId>${project.artifactId}</projectId> + + <!-- a property to define list id --> + <listId>jredmine</listId> + + <!-- java level is 1.6 --> + <maven.compile.source>1.6</maven.compile.source> + <maven.compile.target>1.6</maven.compile.target> + + <!-- default encoding --> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + + <!-- by default, use maven 2 source base dir --> + <maven.src.dir>${basedir}/src</maven.src.dir> + + <!-- where to generate sources --> + <maven.gen.dir>${project.build.directory}/generated-sources</maven.gen.dir> + + <!-- where to generate test sources --> + <maven.test.gen.dir>${project.build.directory}/generated-test-sources</maven.test.gen.dir> + + <!-- locales for the site generation, by default only french --> + <maven.site.locales>fr</maven.site.locales> + + <!-- le fichier de license du projet --> + <maven.license.file>${project.basedir}/LICENSE.txt</maven.license.file> + + <!-- to allow bad tests --> + <maven.test.testFailureIgnore>false</maven.test.testFailureIgnore> + + <!-- to skip tests (can use also profile notests) --> + <maven.test.skip>false</maven.test.skip> + + <!-- to control fork mode of tests --> + <maven.test.forkMode>once</maven.test.forkMode> + + <!-- to activate generation of reports and javadoc when doing a site --> + <maven.reports.generate>true</maven.reports.generate> + + <!-- to activate or not the generation of detail dependencies in site --> + <maven.reports.dependencyDetailsEnabled>true</maven.reports.dependencyDetailsEnabled> + + <!-- to activate or not the generation of location detail of dependencies in site --> + <maven.reports.dependencyLocationsEnabled>true</maven.reports.dependencyLocationsEnabled> + + <!-- do not use 2.5 version, it is buggy (crazy aggregate mode !) --> + <javadoc.version>2.4</javadoc.version> + + <!-- pour ne pas generer la javadoc (quand on aura un javadoc 2.5) --> + <maven.javadoc.skip>false</maven.javadoc.skip> + + <maven.version>2.1.0</maven.version> + <helper.version>1.0.3-SNAPSHOT</helper.version> + + <!-- default license to use --> + <license.licenseName>lgpl_v3</license.licenseName> + + <!-- release repository url (to be used in site.xml) --> + <repository.home.url>http://maven.nuiton.org/release</repository.home.url> + + <!-- generated changes.xml file --> + <maven.changeFile>${maven.gen.dir}/changes/changes.xml</maven.changeFile> + + <test.redmineUrl>http://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> + + <defaultGoal>install</defaultGoal> + + + <plugins> + + <plugin> + <groupId>org.nuiton</groupId> + <artifactId>maven-helper-plugin</artifactId> + <executions> + <!-- check that the root module has a changelog.txt file --> + <execution> + <id>check-project-files</id> + <goals> + <goal>check-project-files</goal> + </goals> + <configuration> + <verbose>true</verbose> + </configuration> + </execution> + </executions> + </plugin> + + </plugins> + + <pluginManagement> + <plugins> + + <plugin> + <artifactId>maven-resources-plugin</artifactId> + <version>2.3</version> + <configuration> + <encoding>${project.build.sourceEncoding}</encoding> + </configuration> + </plugin> + + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <version>2.0.2</version> + <configuration> + <source>${maven.compile.source}</source> + <target>${maven.compile.target}</target> + <encoding>${project.build.sourceEncoding}</encoding> + </configuration> + </plugin> + + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.4.3</version> + <configuration> + <skip>${maven.test.skip}</skip> + <testFailureIgnore>${maven.test.testFailureIgnore}</testFailureIgnore> + <forkMode>${maven.test.forkMode}</forkMode> + <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> + </environmentVariables> + </configuration> + </plugin> + + <plugin> + <artifactId>maven-dependency-plugin</artifactId> + <version>2.1</version> + </plugin> + + <plugin> + <artifactId>maven-jar-plugin</artifactId> + <version>2.2</version> + <inherited>true</inherited> + + <configuration> + <archive> + <!-- cela fait bugger le chargement des service via + ServiceLoader donc on desactive --> + <!--index>true</index--> + <manifest> + <mainClass>${maven.jar.main.class}</mainClass> + </manifest> + <manifestEntries> + <url>${pom.url}</url> + </manifestEntries> + </archive> + </configuration> + </plugin> + + <plugin> + <artifactId>maven-source-plugin</artifactId> + <version>2.1</version> + <inherited>true</inherited> + <executions> + <execution> + <id>attach-sources</id> + <goals> + <goal>jar</goal> + </goals> + </execution> + </executions> + </plugin> + + <plugin> + <artifactId>maven-javadoc-plugin</artifactId> + <version>${javadoc.version}</version> + <configuration> + <docencoding>${project.reporting.outputEncoding}</docencoding> + <encoding>${project.reporting.outputEncoding}</encoding> + <charset>${project.reporting.outputEncoding}</charset> + <quiet>true</quiet> + <excludePackageNames>${maven.javadoc.excludePackageNames}</excludePackageNames> + <!-- uniquement a partir de javadoc 2.5 --> + <!--skip>${maven.javadoc.skip}</skip--> + </configuration> + <executions> + <execution> + <id>attach-javadocs</id> + <goals> + <goal>jar</goal> + </goals> + </execution> + </executions> + </plugin> + + <plugin> + <artifactId>maven-site-plugin</artifactId> + <version>2.0.1</version> + <configuration> + <inputEncoding>${project.reporting.outputEncoding}</inputEncoding> + <outputEncoding>${project.reporting.outputEncoding}</outputEncoding> + <generateReports>${maven.reports.generate}</generateReports> + <locales>${maven.site.locales}</locales> + </configuration> + </plugin> + + <plugin> + <artifactId>maven-release-plugin</artifactId> + <version>2.0-beta-9</version> + </plugin> + + <plugin> + <artifactId>maven-plugin-plugin</artifactId> + <version>2.5</version> + </plugin> + + <plugin> + <groupId>org.nuiton</groupId> + <artifactId>maven-helper-plugin</artifactId> + <version>${helper.version}</version> + </plugin> + + <plugin> + <artifactId>maven-enforcer-plugin</artifactId> + <version>1.0-beta-1</version> + </plugin> + + <plugin> + <artifactId>maven-invoker-plugin</artifactId> + <version>1.3</version> + </plugin> + + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <version>2.2-beta-4</version> + <dependencies> + <dependency> + <groupId>org.nuiton</groupId> + <artifactId>maven-helper-plugin</artifactId> + <version>${helper.version}</version> + </dependency> + </dependencies> + <executions> + <!-- + Pour construire les bundles d'une lib. + + Il suffit d'ajouter dans le profile release-profile : + + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <executions> + <execution> + <phase>verify</phase> + <goals> + <goal>single</goal> + </goals> + </execution> + </executions> + <configuration> + <attach>false</attach> + <descriptorRefs> + <descriptorRef>deps</descriptorRef> + <descriptorRef>full</descriptorRef> + </descriptorRefs> + </configuration> + </plugin> + --> + <!--execution> + <id>attach-assemblies-libs</id> + + </execution--> + </executions> + </plugin> + + </plugins> + </pluginManagement> + + </build> + + <reporting> + <plugins> + + <!-- + The Project Info Reports Plugin has twelve goals: + see http://maven.apache.org/plugins/maven-project-info-reports-plugin + --> + <plugin> + <artifactId>maven-project-info-reports-plugin</artifactId> + <version>2.1.2</version> + <configuration> + <dependencyDetailsEnabled>${maven.reports.dependencyDetailsEnabled}</dependencyDetailsEnabled> + <dependencyLocationsEnabled>${maven.reports.dependencyLocationsEnabled}</dependencyLocationsEnabled> + </configuration> + </plugin> + + <plugin> + <artifactId>maven-javadoc-plugin</artifactId> + <version>${javadoc.version}</version> + <configuration> + <quiet>true</quiet> + <docencoding>${project.build.sourceEncoding}</docencoding> + <encoding>${project.build.sourceEncoding}</encoding> + <excludePackageNames>${maven.javadoc.excludePackageNames}</excludePackageNames> + </configuration> + </plugin> + + <!-- changelog:changelog + changelog:dev-activity + changelog:file-activity --> + <!--FIXME : TC-20090816 : there is a bug with fileactivity + in report, trunk url are prefix with tag/xxx-releaseNumber !--> + <!--<plugin> + <artifactId>maven-changelog-plugin</artifactId> + <version>2.1</version> + configuration> + <displayFileDetailUrl>http://svn.nuiton.org/svn/jredmine%FILE%</displayFileDetailUrl> + </configuration + </plugin>--> + + <!-- Implicit add of reportSet to not generate jira reports --> + <plugin> + <artifactId>maven-changes-plugin</artifactId> + <version>2.1</version> + <configuration> + <issueLinkTemplatePerSystem> + <redmine>${maven.redmine.issue.url}</redmine> + </issueLinkTemplatePerSystem> + <xmlPath>${maven.changeFile}</xmlPath> + </configuration> + <reportSets> + <reportSet> + <reports> + <report>changes-report</report> + </reports> + </reportSet> + </reportSets> + </plugin> + + <plugin> + <artifactId>maven-checkstyle-plugin</artifactId> + <version>2.3</version> + <configuration> + <encoding>${project.reporting.outputEncoding}</encoding> + </configuration> + </plugin> + + <plugin> + <artifactId>maven-pmd-plugin</artifactId> + <version>2.4</version> + <configuration> + <linkXRef>true</linkXRef> + <sourceEncoding>${project.reporting.outputEncoding}</sourceEncoding> + <minimumTokens>100</minimumTokens> + <targetJdk>${maven.compile.target}</targetJdk> + </configuration> + + </plugin> + + <plugin> + <artifactId>maven-jxr-plugin</artifactId> + <version>2.1</version> + </plugin> + + <plugin> + <artifactId>maven-surefire-report-plugin</artifactId> + <version>2.4.3</version> + </plugin> + + <!-- a voir si on le garde car hudson le fait aussi ? --> + <!--<plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>cobertura-maven-plugin</artifactId> + <version>2.3</version> + </plugin>--> + + <!-- a tester si c'est viable sur du multi-module --> + <!-- il y a une version 2.1 voir pour la conf car sans conf ca plante --> + <!--plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>findbugs-maven-plugin</artifactId> + <version>1.2</version> + </plugin--> + </plugins> + </reporting> + + <!-- ************************************************************* --> + <!-- *** Build Environment ************************************** --> + <!-- ************************************************************* --> + + <!-- Build Environment : Environment Information --> + + <issueManagement> + <system>redmine</system> + <url>http://www.nuiton.org/projects/sandbox/issues</url> + </issueManagement> + + <ciManagement> + <system>hudson</system> + <url>http://hudson.nuiton.org/hudson/job/jredmine</url> + </ciManagement> + + <distributionManagement> + <repository> + <id>nuiton</id> + <url>scpexe://nuiton.org/var/lib/maven/release</url> + </repository> + <snapshotRepository> + <id>nuiton</id> + <url>scpexe://nuiton.org/var/lib/maven/snapshot</url> + </snapshotRepository> + <site> + <id>nuiton</id> + <url>scpexe://nuiton.org/var/lib/redmine-nuiton/project-site/jredmine</url> + </site> + </distributionManagement> + + <!--Any mailing lists for the project--> + <mailingLists> + <mailingList> + <name>${listId}-commits</name> + <subscribe>http://list.nuiton.org/cgi-bin/mailman/listinfo/${listId}-commits</subscribe> + <unsubscribe>http://list.nuiton.org/cgi-bin/mailman/listinfo/${listId}-commits</unsubscribe> + <post>${listId}-commits@list.nuiton.org</post> + <archive>http://list.nuiton.org/pipermail/${listId}-commits/</archive> + </mailingList> + + <mailingList> + <name>${listId}-devel</name> + <subscribe>http://list.nuiton.org/cgi-bin/mailman/listinfo/${listId}-devel</subscribe> + <unsubscribe>http://list.nuiton.org/cgi-bin/mailman/listinfo/${listId}-devel</unsubscribe> + <post>${listId}-devel@list.nuiton.org</post> + <archive>http://list.nuiton.org/pipermail/${listId}-devel/</archive> + </mailingList> + + <mailingList> + <name>${listId}-users</name> + <subscribe>http://list.nuiton.org/cgi-bin/mailman/listinfo/${listId}-users</subscribe> + <unsubscribe>http://list.nuiton.org/cgi-bin/mailman/listinfo/${listId}-users</unsubscribe> + <post>${listId}-users@list.nuiton.org</post> + <archive>http://list.nuiton.org/pipermail/${listId}-users/</archive> + </mailingList> + </mailingLists> + + <!-- Source control management. --> + <scm> + <connection>scm:svn:http://svn.nuiton.org/svn/sandbox/jredmine/trunk</connection> + <developerConnection>scm:svn:http://svn.nuiton.org/svn/sandbox/jredmine/trunk</developerConnection> + <url>http://www.nuiton.org/repositories/browse/sandbox/jredmine/trunk</url> + </scm> + + <profiles> + <profile> + <id>release-profile</id> + <activation> + <property> + <name>performRelease</name> + <value>true</value> + </property> + </activation> + <build> + <plugins> + + <!-- always compute source jar --> + <plugin> + <artifactId>maven-source-plugin</artifactId> + <executions> + <execution> + <id>attach-sources</id> + </execution> + </executions> + </plugin> + + <!-- always compute javadoc jar --> + <plugin> + <artifactId>maven-javadoc-plugin</artifactId> + <executions> + <execution> + <id>attach-javadocs</id> + </execution> + </executions> + </plugin> + + <!-- always add license and third-party files to classpath --> + <plugin> + <groupId>org.nuiton</groupId> + <artifactId>maven-helper-plugin</artifactId> + <executions> + <execution> + <id>attach-licenses</id> + <goals> + <goal>add-license</goal> + <goal>add-third-party</goal> + </goals> + </execution> + </executions> + </plugin> + + </plugins> + + </build> + </profile> + + <!-- do not execute tests (generaly a bad idea...) --> + <profile> + <id>notests</id> + <activation> + <activeByDefault>false</activeByDefault> + </activation> + <properties> + <maven.test.skip>true</maven.test.skip> + </properties> + </profile> + <!-- do not build reports (speedup site generation in dev) --> + <profile> + <id>noreports</id> + <activation> + <activeByDefault>false</activeByDefault> + </activation> + <properties> + <maven.reports.generate>false</maven.reports.generate> + </properties> + </profile> + <!-- do not build dependencies detail in maven-project-info-report (speedup site generation in dev) --> + <profile> + <id>nodepdetails</id> + <activation> + <activeByDefault>false</activeByDefault> + </activation> + <properties> + <maven.reports.dependencyDetailsEnabled>false</maven.reports.dependencyDetailsEnabled> + </properties> + </profile> + <!-- do not build locations of dependencies in maven-project-info-report (speedup site generation in dev) --> + <profile> + <id>nodeplocations</id> + <activation> + <activeByDefault>false</activeByDefault> + </activation> + <properties> + <maven.reports.dependencyLocationsEnabled>false</maven.reports.dependencyLocationsEnabled> + </properties> + </profile> + + </profiles> + +</project> Added: jredmine/trunk/src/site/apt/index.apt =================================================================== --- jredmine/trunk/src/site/apt/index.apt (rev 0) +++ jredmine/trunk/src/site/apt/index.apt 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,19 @@ +---- +Introduction +---- +---- +2009-09-15 +---- + +JRedmine + + JRedmine is a java client to redmine server, it allows to retreave datas + from a redmine server and edit datas on redmine server. + + The projects offers a redmine tails plugin to expose some services in REST + protocol (<redmine_rest>). + + The project offers also a maven plugin to perform actions related to a + project management (release notes, publish announcements and attachements,...) + + Added: jredmine/trunk/src/site/apt/todo.apt =================================================================== --- jredmine/trunk/src/site/apt/todo.apt (rev 0) +++ jredmine/trunk/src/site/apt/todo.apt 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,8 @@ +---- +TODO +---- +---- +2009-09-15 +---- + +Any idea ? Added: jredmine/trunk/src/site/site.xml =================================================================== --- jredmine/trunk/src/site/site.xml (rev 0) +++ jredmine/trunk/src/site/site.xml 2009-09-19 14:49:32 UTC (rev 183) @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project name="${project.name}"> + + <publishDate format="dd/MM/yyyy"/> + + <skin> + <groupId>org.nuiton</groupId> + <artifactId>maven-nuiton-skin</artifactId> + <version>1.0.0</version> + </skin> + <bannerLeft> + <name>${project.name}</name> + <href>index.html</href> + </bannerLeft> + + <bannerRight> + <src>http://www.codelutin.com/images/lutinorange-codelutin.png</src> + <href>${project.organization.url}</href> + </bannerRight> + + <poweredBy> + <logo href="http://maven.apache.org" name="Maven" img="images/logos/maven-feather.png"/> + </poweredBy> + + <body> + + <breadcrumbs> + <item name="${project.name}" href="${project.url}" /> + </breadcrumbs> + + <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="redmine-report" href="redmine-report-mojo.html"/> + <item name="get-project-data" href="get-project-data-mojo.html"/> + <item name="get-project-version-data" href="get-project-version-data-mojo.html"/> + <item name="help" href="help-mojo.html"/> + </item--> + </menu> + + <menu name="Développeur"> + <item name="Todo" href="todo.html"/> + </menu> + + <menu ref="modules"/> + + <!--menu name="Téléchargement"> + <item href="${repository.home.url}/org/nuiton/maven-redmine-plugin/${project.version}/${project.build.finalName}.jar" + name="Librairie (jar)"/> + <item href="${repository.home.url}/org/nuiton/maven-redmine-plugin/${project.version}/${project.build.finalName}-javadoc.jar" + name="Javadoc (jar)"/> + <item href="${repository.home.url}/org/nuiton/maven-redmine-plugin/${project.version}/${project.build.finalName}-sources.jar" + name="Sources (jar)"/> + </menu--> + + <menu ref="reports"/> + + </body> +</project>