From 5b65a5952185b73a1679bbdd571046138df490b2 Mon Sep 17 00:00:00 2001 From: Bernard Labno Date: Thu, 5 Jul 2012 16:25:04 +0000 Subject: [PATCH] Implement getAssignees --- src/main/java/pl/com/it_crowd/youtrack/api/YoutrackAPI.java | 18 ++++++++++++++++++ src/main/java/pl/com/it_crowd/youtrack/api/rest/AssignedByType.java | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/pl/com/it_crowd/youtrack/api/rest/AssigneeList.java | 188 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/pl/com/it_crowd/youtrack/api/rest/AssigneeType.java | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/pl/com/it_crowd/youtrack/api/rest/Comment.java | 8 ++++---- src/main/java/pl/com/it_crowd/youtrack/api/rest/Field.java | 2 +- src/main/java/pl/com/it_crowd/youtrack/api/rest/Issue.java | 6 +++--- src/main/java/pl/com/it_crowd/youtrack/api/rest/Issues.java | 2 +- src/main/java/pl/com/it_crowd/youtrack/api/rest/ObjectFactory.java | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++- src/main/java/pl/com/it_crowd/youtrack/api/rest/User.java | 2 +- src/main/java/pl/com/it_crowd/youtrack/api/rest/UserGroupRefType.java | 113 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/pl/com/it_crowd/youtrack/api/rest/UserRefs.java | 2 +- src/main/xjb/bindings.xjb | 6 ++++++ src/main/xsd/assignees.xml | 37 +++++++++++++++++++++++++++++++++++++ src/main/xsd/assignees.xsd | 22 ++++++++++++++++++++++ src/main/xsd/issuesCount.xml | 2 ++ src/main/xsd/issuesCount.xsd | 4 ++++ src/main/xsd/types.xsd | 22 ++++++++++++++++++++++ src/test/java/pl/com/it_crowd/youtrack/api/rest/YoutrackAPITest.java | 67 ++++++++++++++++++++++++++++++++++++++----------------------------- 19 files changed, 692 insertions(+), 41 deletions(-) create mode 100644 src/main/java/pl/com/it_crowd/youtrack/api/rest/AssignedByType.java create mode 100644 src/main/java/pl/com/it_crowd/youtrack/api/rest/AssigneeList.java create mode 100644 src/main/java/pl/com/it_crowd/youtrack/api/rest/AssigneeType.java create mode 100644 src/main/java/pl/com/it_crowd/youtrack/api/rest/UserGroupRefType.java create mode 100644 src/main/xsd/assignees.xml create mode 100644 src/main/xsd/assignees.xsd create mode 100644 src/main/xsd/issuesCount.xml create mode 100644 src/main/xsd/issuesCount.xsd diff --git a/src/main/java/pl/com/it_crowd/youtrack/api/YoutrackAPI.java b/src/main/java/pl/com/it_crowd/youtrack/api/YoutrackAPI.java index 59e2494..bb78f00 100644 --- a/src/main/java/pl/com/it_crowd/youtrack/api/YoutrackAPI.java +++ b/src/main/java/pl/com/it_crowd/youtrack/api/YoutrackAPI.java @@ -27,6 +27,7 @@ import org.apache.http.util.EntityUtils; import pl.com.it_crowd.youtrack.api.exceptions.NoResultFoundException; import pl.com.it_crowd.youtrack.api.exceptions.YoutrackAPIException; import pl.com.it_crowd.youtrack.api.exceptions.YoutrackErrorException; +import pl.com.it_crowd.youtrack.api.rest.AssigneeList; import pl.com.it_crowd.youtrack.api.rest.Issue; import pl.com.it_crowd.youtrack.api.rest.Issues; import pl.com.it_crowd.youtrack.api.rest.User; @@ -207,6 +208,23 @@ public class YoutrackAPI { return matcher.group(1); } + public AssigneeList getAssignees(String project) throws IOException, JAXBException + { + final URI uri; + try { + uri = new URIBuilder(serviceLocation + "/rest/admin/project/" + project + "/assignee").build(); + } catch (URISyntaxException e) { + throw new RuntimeException(e); + } + final String responseString = execute(new HttpGet(uri)); + final Object result = YoutrackUnmarshaller.unmarshall(responseString); + if (result instanceof AssigneeList) { + return (AssigneeList) result; + } else { + throw new YoutrackAPIException("Unexpected type: " + result); + } + } + public List getIndividualAssignees(String project) throws IOException, JAXBException { final URI uri; diff --git a/src/main/java/pl/com/it_crowd/youtrack/api/rest/AssignedByType.java b/src/main/java/pl/com/it_crowd/youtrack/api/rest/AssignedByType.java new file mode 100644 index 0000000..3c75382 --- /dev/null +++ b/src/main/java/pl/com/it_crowd/youtrack/api/rest/AssignedByType.java @@ -0,0 +1,63 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.07.05 at 06:19:38 PM CEST +// + +package pl.com.it_crowd.youtrack.api.rest; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

Java class for assignedByType complex type. + *

+ *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <complexType name="assignedByType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="userGroupRef" type="{}userGroupRefType"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "assignedByType", propOrder = {"userGroupRef"}) +public class AssignedByType { +// ------------------------------ FIELDS ------------------------------ + + @XmlElement(required = true) + protected UserGroupRefType userGroupRef; + +// --------------------- GETTER / SETTER METHODS --------------------- + + /** + * Gets the value of the userGroupRef property. + * + * @return possible object is + * {@link UserGroupRefType } + */ + public UserGroupRefType getUserGroupRef() + { + return userGroupRef; + } + + /** + * Sets the value of the userGroupRef property. + * + * @param value allowed object is + * {@link UserGroupRefType } + */ + public void setUserGroupRef(UserGroupRefType value) + { + this.userGroupRef = value; + } +} diff --git a/src/main/java/pl/com/it_crowd/youtrack/api/rest/AssigneeList.java b/src/main/java/pl/com/it_crowd/youtrack/api/rest/AssigneeList.java new file mode 100644 index 0000000..445c5b9 --- /dev/null +++ b/src/main/java/pl/com/it_crowd/youtrack/api/rest/AssigneeList.java @@ -0,0 +1,188 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.07.05 at 06:19:38 PM CEST +// + +package pl.com.it_crowd.youtrack.api.rest; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; +import java.util.ArrayList; +import java.util.List; + +/** + *

Java class for anonymous complex type. + *

+ *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="assignees">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="assignee" type="{}assigneeType" maxOccurs="unbounded" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *       <attribute name="groupsUrl" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="individualsUrl" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = {"assignees"}) +@XmlRootElement(name = "assigneeList") +public class AssigneeList { +// ------------------------------ FIELDS ------------------------------ + + @XmlElement(required = true) + protected AssigneeList.Assignees assignees; + + @XmlAttribute + protected String groupsUrl; + + @XmlAttribute + protected String individualsUrl; + +// --------------------- GETTER / SETTER METHODS --------------------- + + /** + * Gets the value of the assignees property. + * + * @return possible object is + * {@link AssigneeList.Assignees } + */ + public AssigneeList.Assignees getAssignees() + { + return assignees; + } + + /** + * Sets the value of the assignees property. + * + * @param value allowed object is + * {@link AssigneeList.Assignees } + */ + public void setAssignees(AssigneeList.Assignees value) + { + this.assignees = value; + } + + /** + * Gets the value of the groupsUrl property. + * + * @return possible object is + * {@link String } + */ + public String getGroupsUrl() + { + return groupsUrl; + } + + /** + * Sets the value of the groupsUrl property. + * + * @param value allowed object is + * {@link String } + */ + public void setGroupsUrl(String value) + { + this.groupsUrl = value; + } + + /** + * Gets the value of the individualsUrl property. + * + * @return possible object is + * {@link String } + */ + public String getIndividualsUrl() + { + return individualsUrl; + } + + /** + * Sets the value of the individualsUrl property. + * + * @param value allowed object is + * {@link String } + */ + public void setIndividualsUrl(String value) + { + this.individualsUrl = value; + } + +// -------------------------- INNER CLASSES -------------------------- + + /** + *

Java class for anonymous complex type. + *

+ *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="assignee" type="{}assigneeType" maxOccurs="unbounded" minOccurs="0"/>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"assignees"}) + public static class Assignees { +// ------------------------------ FIELDS ------------------------------ + + @XmlElement(name = "assignee") + protected List assignees; + +// --------------------- GETTER / SETTER METHODS --------------------- + + /** + * Gets the value of the assignees property. + *

+ *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the assignees property. + *

+ *

+ * For example, to add a new item, do as follows: + *

+         *    getAssignees().add(newItem);
+         * 
+ *

+ *

+ *

+ * Objects of the following type(s) are allowed in the list + * {@link AssigneeType } + */ + public List getAssignees() + { + if (assignees == null) { + assignees = new ArrayList(); + } + return this.assignees; + } + } +} diff --git a/src/main/java/pl/com/it_crowd/youtrack/api/rest/AssigneeType.java b/src/main/java/pl/com/it_crowd/youtrack/api/rest/AssigneeType.java new file mode 100644 index 0000000..189570c --- /dev/null +++ b/src/main/java/pl/com/it_crowd/youtrack/api/rest/AssigneeType.java @@ -0,0 +1,116 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.07.05 at 06:19:38 PM CEST +// + +package pl.com.it_crowd.youtrack.api.rest; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

Java class for assigneeType complex type. + *

+ *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <complexType name="assigneeType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="assignedBy" type="{}assignedByType"/>
+ *       </sequence>
+ *       <attribute name="login" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="isIndividualAssignee" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "assigneeType", propOrder = {"assignedBy"}) +public class AssigneeType { +// ------------------------------ FIELDS ------------------------------ + + @XmlElement(required = true) + protected AssignedByType assignedBy; + + @XmlAttribute + protected String isIndividualAssignee; + + @XmlAttribute + protected String login; + +// --------------------- GETTER / SETTER METHODS --------------------- + + /** + * Gets the value of the assignedBy property. + * + * @return possible object is + * {@link AssignedByType } + */ + public AssignedByType getAssignedBy() + { + return assignedBy; + } + + /** + * Sets the value of the assignedBy property. + * + * @param value allowed object is + * {@link AssignedByType } + */ + public void setAssignedBy(AssignedByType value) + { + this.assignedBy = value; + } + + /** + * Gets the value of the isIndividualAssignee property. + * + * @return possible object is + * {@link String } + */ + public String getIsIndividualAssignee() + { + return isIndividualAssignee; + } + + /** + * Sets the value of the isIndividualAssignee property. + * + * @param value allowed object is + * {@link String } + */ + public void setIsIndividualAssignee(String value) + { + this.isIndividualAssignee = value; + } + + /** + * Gets the value of the login property. + * + * @return possible object is + * {@link String } + */ + public String getLogin() + { + return login; + } + + /** + * Sets the value of the login property. + * + * @param value allowed object is + * {@link String } + */ + public void setLogin(String value) + { + this.login = value; + } +} diff --git a/src/main/java/pl/com/it_crowd/youtrack/api/rest/Comment.java b/src/main/java/pl/com/it_crowd/youtrack/api/rest/Comment.java index 90bffa8..fed7571 100644 --- a/src/main/java/pl/com/it_crowd/youtrack/api/rest/Comment.java +++ b/src/main/java/pl/com/it_crowd/youtrack/api/rest/Comment.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.07.03 at 12:32:28 PM CEST +// Generated on: 2012.07.05 at 06:19:38 PM CEST // package pl.com.it_crowd.youtrack.api.rest; @@ -63,7 +63,7 @@ public class Comment { @XmlAttribute protected String author; - @XmlElementRefs({@XmlElementRef(name = "replies", type = JAXBElement.class), @XmlElementRef(name = "value", type = JAXBElement.class)}) + @XmlElementRefs({@XmlElementRef(name = "value", type = JAXBElement.class), @XmlElementRef(name = "replies", type = JAXBElement.class)}) @XmlMixed protected List content; @@ -130,9 +130,9 @@ public class Comment { *

*

* Objects of the following type(s) are allowed in the list - * {@link JAXBElement }{@code <}{@link String }{@code >} - * {@link JAXBElement }{@code <}{@link Comment.Value }{@code >} * {@link String } + * {@link JAXBElement }{@code <}{@link Comment.Value }{@code >} + * {@link JAXBElement }{@code <}{@link String }{@code >} */ public List getContent() { diff --git a/src/main/java/pl/com/it_crowd/youtrack/api/rest/Field.java b/src/main/java/pl/com/it_crowd/youtrack/api/rest/Field.java index 4abbc19..932bac2 100644 --- a/src/main/java/pl/com/it_crowd/youtrack/api/rest/Field.java +++ b/src/main/java/pl/com/it_crowd/youtrack/api/rest/Field.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.07.03 at 12:32:28 PM CEST +// Generated on: 2012.07.05 at 06:19:38 PM CEST // package pl.com.it_crowd.youtrack.api.rest; diff --git a/src/main/java/pl/com/it_crowd/youtrack/api/rest/Issue.java b/src/main/java/pl/com/it_crowd/youtrack/api/rest/Issue.java index 263919b..d78ac00 100644 --- a/src/main/java/pl/com/it_crowd/youtrack/api/rest/Issue.java +++ b/src/main/java/pl/com/it_crowd/youtrack/api/rest/Issue.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.07.03 at 12:32:28 PM CEST +// Generated on: 2012.07.05 at 06:19:38 PM CEST // package pl.com.it_crowd.youtrack.api.rest; @@ -40,7 +40,7 @@ import java.util.List; public class Issue { // ------------------------------ FIELDS ------------------------------ - @XmlElements({@XmlElement(name = "field", type = Field.class), @XmlElement(name = "comment", type = Comment.class)}) + @XmlElements({@XmlElement(name = "comment", type = Comment.class), @XmlElement(name = "field", type = Field.class)}) protected List fieldOrComment; @XmlAttribute @@ -66,8 +66,8 @@ public class Issue { *

*

* Objects of the following type(s) are allowed in the list - * {@link Field } * {@link Comment } + * {@link Field } */ public List getFieldOrComment() { diff --git a/src/main/java/pl/com/it_crowd/youtrack/api/rest/Issues.java b/src/main/java/pl/com/it_crowd/youtrack/api/rest/Issues.java index 02a6a98..72431b8 100644 --- a/src/main/java/pl/com/it_crowd/youtrack/api/rest/Issues.java +++ b/src/main/java/pl/com/it_crowd/youtrack/api/rest/Issues.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.07.03 at 12:32:28 PM CEST +// Generated on: 2012.07.05 at 06:19:38 PM CEST // package pl.com.it_crowd.youtrack.api.rest; diff --git a/src/main/java/pl/com/it_crowd/youtrack/api/rest/ObjectFactory.java b/src/main/java/pl/com/it_crowd/youtrack/api/rest/ObjectFactory.java index a2c9e8e..4e5d2c6 100644 --- a/src/main/java/pl/com/it_crowd/youtrack/api/rest/ObjectFactory.java +++ b/src/main/java/pl/com/it_crowd/youtrack/api/rest/ObjectFactory.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.07.03 at 12:32:28 PM CEST +// Generated on: 2012.07.05 at 06:19:38 PM CEST // package pl.com.it_crowd.youtrack.api.rest; @@ -35,6 +35,8 @@ public class ObjectFactory { private final static QName _Error_QNAME = new QName("", "error"); + private final static QName _Int_QNAME = new QName("", "int"); + private final static QName _Issue_QNAME = new QName("", "issue"); // --------------------------- CONSTRUCTORS --------------------------- @@ -49,6 +51,38 @@ public class ObjectFactory { // -------------------------- OTHER METHODS -------------------------- /** + * Create an instance of {@link AssignedByType } + */ + public AssignedByType createAssignedByType() + { + return new AssignedByType(); + } + + /** + * Create an instance of {@link AssigneeList } + */ + public AssigneeList createAssigneeList() + { + return new AssigneeList(); + } + + /** + * Create an instance of {@link AssigneeList.Assignees } + */ + public AssigneeList.Assignees createAssigneeListAssignees() + { + return new AssigneeList.Assignees(); + } + + /** + * Create an instance of {@link AssigneeType } + */ + public AssigneeType createAssigneeType() + { + return new AssigneeType(); + } + + /** * Create an instance of {@link Comment } */ public Comment createComment() @@ -108,6 +142,15 @@ public class ObjectFactory { } /** + * Create an instance of {@link JAXBElement }{@code <}{@link Short }{@code >}} + */ + @XmlElementDecl(namespace = "", name = "int") + public JAXBElement createInt(Short value) + { + return new JAXBElement(_Int_QNAME, Short.class, null, value); + } + + /** * Create an instance of {@link Issue } */ public Issue createIssue() @@ -141,6 +184,14 @@ public class ObjectFactory { } /** + * Create an instance of {@link UserGroupRefType } + */ + public UserGroupRefType createUserGroupRefType() + { + return new UserGroupRefType(); + } + + /** * Create an instance of {@link UserRefs } */ public UserRefs createUserRefs() diff --git a/src/main/java/pl/com/it_crowd/youtrack/api/rest/User.java b/src/main/java/pl/com/it_crowd/youtrack/api/rest/User.java index 24b3e33..3a41570 100644 --- a/src/main/java/pl/com/it_crowd/youtrack/api/rest/User.java +++ b/src/main/java/pl/com/it_crowd/youtrack/api/rest/User.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.07.03 at 12:32:28 PM CEST +// Generated on: 2012.07.05 at 06:19:38 PM CEST // package pl.com.it_crowd.youtrack.api.rest; diff --git a/src/main/java/pl/com/it_crowd/youtrack/api/rest/UserGroupRefType.java b/src/main/java/pl/com/it_crowd/youtrack/api/rest/UserGroupRefType.java new file mode 100644 index 0000000..53f095e --- /dev/null +++ b/src/main/java/pl/com/it_crowd/youtrack/api/rest/UserGroupRefType.java @@ -0,0 +1,113 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.07.05 at 06:19:38 PM CEST +// + +package pl.com.it_crowd.youtrack.api.rest; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlValue; + +/** + *

Java class for userGroupRefType complex type. + *

+ *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <complexType name="userGroupRefType">
+ *   <simpleContent>
+ *     <extension base="<http://www.w3.org/2001/XMLSchema>string">
+ *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="url" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </extension>
+ *   </simpleContent>
+ * </complexType>
+ * 
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "userGroupRefType", propOrder = {"value"}) +public class UserGroupRefType { +// ------------------------------ FIELDS ------------------------------ + + @XmlAttribute + protected String name; + + @XmlAttribute + protected String url; + + @XmlValue + protected String value; + +// --------------------- GETTER / SETTER METHODS --------------------- + + /** + * Gets the value of the name property. + * + * @return possible object is + * {@link String } + */ + public String getName() + { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is + * {@link String } + */ + public void setName(String value) + { + this.name = value; + } + + /** + * Gets the value of the url property. + * + * @return possible object is + * {@link String } + */ + public String getUrl() + { + return url; + } + + /** + * Sets the value of the url property. + * + * @param value allowed object is + * {@link String } + */ + public void setUrl(String value) + { + this.url = value; + } + + /** + * Gets the value of the value property. + * + * @return possible object is + * {@link String } + */ + public String getValue() + { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value allowed object is + * {@link String } + */ + public void setValue(String value) + { + this.value = value; + } +} diff --git a/src/main/java/pl/com/it_crowd/youtrack/api/rest/UserRefs.java b/src/main/java/pl/com/it_crowd/youtrack/api/rest/UserRefs.java index f1f5212..43e52a1 100644 --- a/src/main/java/pl/com/it_crowd/youtrack/api/rest/UserRefs.java +++ b/src/main/java/pl/com/it_crowd/youtrack/api/rest/UserRefs.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.07.03 at 12:32:28 PM CEST +// Generated on: 2012.07.05 at 06:19:38 PM CEST // package pl.com.it_crowd.youtrack.api.rest; diff --git a/src/main/xjb/bindings.xjb b/src/main/xjb/bindings.xjb index 54fb3c5..9c40975 100644 --- a/src/main/xjb/bindings.xjb +++ b/src/main/xjb/bindings.xjb @@ -15,6 +15,12 @@ + + + + + + diff --git a/src/main/xsd/assignees.xml b/src/main/xsd/assignees.xml new file mode 100644 index 0000000..a6827bc --- /dev/null +++ b/src/main/xsd/assignees.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/xsd/assignees.xsd b/src/main/xsd/assignees.xsd new file mode 100644 index 0000000..ea830f1 --- /dev/null +++ b/src/main/xsd/assignees.xsd @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/xsd/issuesCount.xml b/src/main/xsd/issuesCount.xml new file mode 100644 index 0000000..e805317 --- /dev/null +++ b/src/main/xsd/issuesCount.xml @@ -0,0 +1,2 @@ + +1663 diff --git a/src/main/xsd/issuesCount.xsd b/src/main/xsd/issuesCount.xsd new file mode 100644 index 0000000..c6c86bb --- /dev/null +++ b/src/main/xsd/issuesCount.xsd @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/main/xsd/types.xsd b/src/main/xsd/types.xsd index 97186b8..44158d5 100644 --- a/src/main/xsd/types.xsd +++ b/src/main/xsd/types.xsd @@ -1,6 +1,19 @@ + + + + + + + + + + + + + @@ -46,6 +59,15 @@ + + + + + + + + + diff --git a/src/test/java/pl/com/it_crowd/youtrack/api/rest/YoutrackAPITest.java b/src/test/java/pl/com/it_crowd/youtrack/api/rest/YoutrackAPITest.java index cf0ba77..90812e8 100644 --- a/src/test/java/pl/com/it_crowd/youtrack/api/rest/YoutrackAPITest.java +++ b/src/test/java/pl/com/it_crowd/youtrack/api/rest/YoutrackAPITest.java @@ -28,35 +28,6 @@ public class YoutrackAPITest { // -------------------------- OTHER METHODS -------------------------- @Test - public void commandAllStates() throws IOException, JAXBException - { - final YoutrackAPI api = new YoutrackAPI(getServiceLocation(), getUsername(), getPassword()); - final String issueId = "TST-1"; - IssueWrapper issue; - final StateValues[] stateValueses = StateValues.values(); - for (StateValues state : stateValueses) { - if (state.getCommandValue() != null && !StateValues.Duplicate.equals(state)) { - api.command(issueId, Command.stateCommand(state)); - issue = api.getIssue(issueId); - Assert.assertNotNull(issue); - Assert.assertEquals(state.getCommandValue(), issue.getFieldValue(Fields.state)); - } - } - } - - @Test - public void getIndividualAssignees() throws IOException, JAXBException - { - final YoutrackAPI api = new YoutrackAPI(getServiceLocation(), getUsername(), getPassword()); - final List assignees = api.getIndividualAssignees("TST"); - Assert.assertNotNull(assignees); - Assert.assertEquals(2, assignees.size()); - for (User user : assignees) { - Assert.assertTrue("bernard".equals(user.getLogin()) || "root".equals(user.getLogin())); - } - } - - @Test public void command() throws IOException, JAXBException { final YoutrackAPI api = new YoutrackAPI(getServiceLocation(), getUsername(), getPassword()); @@ -98,6 +69,23 @@ public class YoutrackAPITest { } @Test + public void commandAllStates() throws IOException, JAXBException + { + final YoutrackAPI api = new YoutrackAPI(getServiceLocation(), getUsername(), getPassword()); + final String issueId = "TST-1"; + IssueWrapper issue; + final StateValues[] stateValueses = StateValues.values(); + for (StateValues state : stateValueses) { + if (state.getCommandValue() != null && !StateValues.Duplicate.equals(state)) { + api.command(issueId, Command.stateCommand(state)); + issue = api.getIssue(issueId); + Assert.assertNotNull(issue); + Assert.assertEquals(state.getCommandValue(), issue.getFieldValue(Fields.state)); + } + } + } + + @Test public void createIssue() throws IOException, AuthenticationException, JAXBException { YoutrackAPI api = new YoutrackAPI(getServiceLocation(), getUsername(), getPassword()); @@ -107,6 +95,27 @@ public class YoutrackAPITest { } @Test + public void getAssignees() throws IOException, AuthenticationException, JAXBException + { + YoutrackAPI api = new YoutrackAPI(getServiceLocation(), getUsername(), getPassword()); + final AssigneeList assigneeList = api.getAssignees("TST"); + Assert.assertNotNull(assigneeList); + Assert.assertEquals(2, assigneeList.getAssignees().getAssignees().size()); + } + + @Test + public void getIndividualAssignees() throws IOException, JAXBException + { + final YoutrackAPI api = new YoutrackAPI(getServiceLocation(), getUsername(), getPassword()); + final List assignees = api.getIndividualAssignees("TST"); + Assert.assertNotNull(assignees); + Assert.assertEquals(2, assignees.size()); + for (User user : assignees) { + Assert.assertTrue("bernard".equals(user.getLogin()) || "root".equals(user.getLogin())); + } + } + + @Test public void getIssue() throws IOException, AuthenticationException, JAXBException { YoutrackAPI api = new YoutrackAPI(getServiceLocation(), getUsername(), getPassword()); -- libgit2 0.24.0