Commit 5b65a5952185b73a1679bbdd571046138df490b2

Authored by bernard
1 parent 1f5ac8df

Implement getAssignees

... ... @@ -27,6 +27,7 @@ import org.apache.http.util.EntityUtils;
27 27 import pl.com.it_crowd.youtrack.api.exceptions.NoResultFoundException;
28 28 import pl.com.it_crowd.youtrack.api.exceptions.YoutrackAPIException;
29 29 import pl.com.it_crowd.youtrack.api.exceptions.YoutrackErrorException;
  30 +import pl.com.it_crowd.youtrack.api.rest.AssigneeList;
30 31 import pl.com.it_crowd.youtrack.api.rest.Issue;
31 32 import pl.com.it_crowd.youtrack.api.rest.Issues;
32 33 import pl.com.it_crowd.youtrack.api.rest.User;
... ... @@ -207,6 +208,23 @@ public class YoutrackAPI {
207 208 return matcher.group(1);
208 209 }
209 210
  211 + public AssigneeList getAssignees(String project) throws IOException, JAXBException
  212 + {
  213 + final URI uri;
  214 + try {
  215 + uri = new URIBuilder(serviceLocation + "/rest/admin/project/" + project + "/assignee").build();
  216 + } catch (URISyntaxException e) {
  217 + throw new RuntimeException(e);
  218 + }
  219 + final String responseString = execute(new HttpGet(uri));
  220 + final Object result = YoutrackUnmarshaller.unmarshall(responseString);
  221 + if (result instanceof AssigneeList) {
  222 + return (AssigneeList) result;
  223 + } else {
  224 + throw new YoutrackAPIException("Unexpected type: " + result);
  225 + }
  226 + }
  227 +
210 228 public List<User> getIndividualAssignees(String project) throws IOException, JAXBException
211 229 {
212 230 final URI uri;
... ...
  1 +//
  2 +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
  3 +// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
  4 +// Any modifications to this file will be lost upon recompilation of the source schema.
  5 +// Generated on: 2012.07.05 at 06:19:38 PM CEST
  6 +//
  7 +
  8 +package pl.com.it_crowd.youtrack.api.rest;
  9 +
  10 +import javax.xml.bind.annotation.XmlAccessType;
  11 +import javax.xml.bind.annotation.XmlAccessorType;
  12 +import javax.xml.bind.annotation.XmlElement;
  13 +import javax.xml.bind.annotation.XmlType;
  14 +
  15 +/**
  16 + * <p>Java class for assignedByType complex type.
  17 + * <p/>
  18 + * <p>The following schema fragment specifies the expected content contained within this class.
  19 + * <p/>
  20 + * <pre>
  21 + * &lt;complexType name="assignedByType">
  22 + * &lt;complexContent>
  23 + * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
  24 + * &lt;sequence>
  25 + * &lt;element name="userGroupRef" type="{}userGroupRefType"/>
  26 + * &lt;/sequence>
  27 + * &lt;/restriction>
  28 + * &lt;/complexContent>
  29 + * &lt;/complexType>
  30 + * </pre>
  31 + */
  32 +@XmlAccessorType(XmlAccessType.FIELD)
  33 +@XmlType(name = "assignedByType", propOrder = {"userGroupRef"})
  34 +public class AssignedByType {
  35 +// ------------------------------ FIELDS ------------------------------
  36 +
  37 + @XmlElement(required = true)
  38 + protected UserGroupRefType userGroupRef;
  39 +
  40 +// --------------------- GETTER / SETTER METHODS ---------------------
  41 +
  42 + /**
  43 + * Gets the value of the userGroupRef property.
  44 + *
  45 + * @return possible object is
  46 + * {@link UserGroupRefType }
  47 + */
  48 + public UserGroupRefType getUserGroupRef()
  49 + {
  50 + return userGroupRef;
  51 + }
  52 +
  53 + /**
  54 + * Sets the value of the userGroupRef property.
  55 + *
  56 + * @param value allowed object is
  57 + * {@link UserGroupRefType }
  58 + */
  59 + public void setUserGroupRef(UserGroupRefType value)
  60 + {
  61 + this.userGroupRef = value;
  62 + }
  63 +}
... ...
  1 +//
  2 +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
  3 +// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
  4 +// Any modifications to this file will be lost upon recompilation of the source schema.
  5 +// Generated on: 2012.07.05 at 06:19:38 PM CEST
  6 +//
  7 +
  8 +package pl.com.it_crowd.youtrack.api.rest;
  9 +
  10 +import javax.xml.bind.annotation.XmlAccessType;
  11 +import javax.xml.bind.annotation.XmlAccessorType;
  12 +import javax.xml.bind.annotation.XmlAttribute;
  13 +import javax.xml.bind.annotation.XmlElement;
  14 +import javax.xml.bind.annotation.XmlRootElement;
  15 +import javax.xml.bind.annotation.XmlType;
  16 +import java.util.ArrayList;
  17 +import java.util.List;
  18 +
  19 +/**
  20 + * <p>Java class for anonymous complex type.
  21 + * <p/>
  22 + * <p>The following schema fragment specifies the expected content contained within this class.
  23 + * <p/>
  24 + * <pre>
  25 + * &lt;complexType>
  26 + * &lt;complexContent>
  27 + * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
  28 + * &lt;sequence>
  29 + * &lt;element name="assignees">
  30 + * &lt;complexType>
  31 + * &lt;complexContent>
  32 + * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
  33 + * &lt;sequence>
  34 + * &lt;element name="assignee" type="{}assigneeType" maxOccurs="unbounded" minOccurs="0"/>
  35 + * &lt;/sequence>
  36 + * &lt;/restriction>
  37 + * &lt;/complexContent>
  38 + * &lt;/complexType>
  39 + * &lt;/element>
  40 + * &lt;/sequence>
  41 + * &lt;attribute name="groupsUrl" type="{http://www.w3.org/2001/XMLSchema}string" />
  42 + * &lt;attribute name="individualsUrl" type="{http://www.w3.org/2001/XMLSchema}string" />
  43 + * &lt;/restriction>
  44 + * &lt;/complexContent>
  45 + * &lt;/complexType>
  46 + * </pre>
  47 + */
  48 +@XmlAccessorType(XmlAccessType.FIELD)
  49 +@XmlType(name = "", propOrder = {"assignees"})
  50 +@XmlRootElement(name = "assigneeList")
  51 +public class AssigneeList {
  52 +// ------------------------------ FIELDS ------------------------------
  53 +
  54 + @XmlElement(required = true)
  55 + protected AssigneeList.Assignees assignees;
  56 +
  57 + @XmlAttribute
  58 + protected String groupsUrl;
  59 +
  60 + @XmlAttribute
  61 + protected String individualsUrl;
  62 +
  63 +// --------------------- GETTER / SETTER METHODS ---------------------
  64 +
  65 + /**
  66 + * Gets the value of the assignees property.
  67 + *
  68 + * @return possible object is
  69 + * {@link AssigneeList.Assignees }
  70 + */
  71 + public AssigneeList.Assignees getAssignees()
  72 + {
  73 + return assignees;
  74 + }
  75 +
  76 + /**
  77 + * Sets the value of the assignees property.
  78 + *
  79 + * @param value allowed object is
  80 + * {@link AssigneeList.Assignees }
  81 + */
  82 + public void setAssignees(AssigneeList.Assignees value)
  83 + {
  84 + this.assignees = value;
  85 + }
  86 +
  87 + /**
  88 + * Gets the value of the groupsUrl property.
  89 + *
  90 + * @return possible object is
  91 + * {@link String }
  92 + */
  93 + public String getGroupsUrl()
  94 + {
  95 + return groupsUrl;
  96 + }
  97 +
  98 + /**
  99 + * Sets the value of the groupsUrl property.
  100 + *
  101 + * @param value allowed object is
  102 + * {@link String }
  103 + */
  104 + public void setGroupsUrl(String value)
  105 + {
  106 + this.groupsUrl = value;
  107 + }
  108 +
  109 + /**
  110 + * Gets the value of the individualsUrl property.
  111 + *
  112 + * @return possible object is
  113 + * {@link String }
  114 + */
  115 + public String getIndividualsUrl()
  116 + {
  117 + return individualsUrl;
  118 + }
  119 +
  120 + /**
  121 + * Sets the value of the individualsUrl property.
  122 + *
  123 + * @param value allowed object is
  124 + * {@link String }
  125 + */
  126 + public void setIndividualsUrl(String value)
  127 + {
  128 + this.individualsUrl = value;
  129 + }
  130 +
  131 +// -------------------------- INNER CLASSES --------------------------
  132 +
  133 + /**
  134 + * <p>Java class for anonymous complex type.
  135 + * <p/>
  136 + * <p>The following schema fragment specifies the expected content contained within this class.
  137 + * <p/>
  138 + * <pre>
  139 + * &lt;complexType>
  140 + * &lt;complexContent>
  141 + * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
  142 + * &lt;sequence>
  143 + * &lt;element name="assignee" type="{}assigneeType" maxOccurs="unbounded" minOccurs="0"/>
  144 + * &lt;/sequence>
  145 + * &lt;/restriction>
  146 + * &lt;/complexContent>
  147 + * &lt;/complexType>
  148 + * </pre>
  149 + */
  150 + @XmlAccessorType(XmlAccessType.FIELD)
  151 + @XmlType(name = "", propOrder = {"assignees"})
  152 + public static class Assignees {
  153 +// ------------------------------ FIELDS ------------------------------
  154 +
  155 + @XmlElement(name = "assignee")
  156 + protected List<AssigneeType> assignees;
  157 +
  158 +// --------------------- GETTER / SETTER METHODS ---------------------
  159 +
  160 + /**
  161 + * Gets the value of the assignees property.
  162 + * <p/>
  163 + * <p/>
  164 + * This accessor method returns a reference to the live list,
  165 + * not a snapshot. Therefore any modification you make to the
  166 + * returned list will be present inside the JAXB object.
  167 + * This is why there is not a <CODE>set</CODE> method for the assignees property.
  168 + * <p/>
  169 + * <p/>
  170 + * For example, to add a new item, do as follows:
  171 + * <pre>
  172 + * getAssignees().add(newItem);
  173 + * </pre>
  174 + * <p/>
  175 + * <p/>
  176 + * <p/>
  177 + * Objects of the following type(s) are allowed in the list
  178 + * {@link AssigneeType }
  179 + */
  180 + public List<AssigneeType> getAssignees()
  181 + {
  182 + if (assignees == null) {
  183 + assignees = new ArrayList<AssigneeType>();
  184 + }
  185 + return this.assignees;
  186 + }
  187 + }
  188 +}
... ...
  1 +//
  2 +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
  3 +// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
  4 +// Any modifications to this file will be lost upon recompilation of the source schema.
  5 +// Generated on: 2012.07.05 at 06:19:38 PM CEST
  6 +//
  7 +
  8 +package pl.com.it_crowd.youtrack.api.rest;
  9 +
  10 +import javax.xml.bind.annotation.XmlAccessType;
  11 +import javax.xml.bind.annotation.XmlAccessorType;
  12 +import javax.xml.bind.annotation.XmlAttribute;
  13 +import javax.xml.bind.annotation.XmlElement;
  14 +import javax.xml.bind.annotation.XmlType;
  15 +
  16 +/**
  17 + * <p>Java class for assigneeType complex type.
  18 + * <p/>
  19 + * <p>The following schema fragment specifies the expected content contained within this class.
  20 + * <p/>
  21 + * <pre>
  22 + * &lt;complexType name="assigneeType">
  23 + * &lt;complexContent>
  24 + * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
  25 + * &lt;sequence>
  26 + * &lt;element name="assignedBy" type="{}assignedByType"/>
  27 + * &lt;/sequence>
  28 + * &lt;attribute name="login" type="{http://www.w3.org/2001/XMLSchema}string" />
  29 + * &lt;attribute name="isIndividualAssignee" type="{http://www.w3.org/2001/XMLSchema}string" />
  30 + * &lt;/restriction>
  31 + * &lt;/complexContent>
  32 + * &lt;/complexType>
  33 + * </pre>
  34 + */
  35 +@XmlAccessorType(XmlAccessType.FIELD)
  36 +@XmlType(name = "assigneeType", propOrder = {"assignedBy"})
  37 +public class AssigneeType {
  38 +// ------------------------------ FIELDS ------------------------------
  39 +
  40 + @XmlElement(required = true)
  41 + protected AssignedByType assignedBy;
  42 +
  43 + @XmlAttribute
  44 + protected String isIndividualAssignee;
  45 +
  46 + @XmlAttribute
  47 + protected String login;
  48 +
  49 +// --------------------- GETTER / SETTER METHODS ---------------------
  50 +
  51 + /**
  52 + * Gets the value of the assignedBy property.
  53 + *
  54 + * @return possible object is
  55 + * {@link AssignedByType }
  56 + */
  57 + public AssignedByType getAssignedBy()
  58 + {
  59 + return assignedBy;
  60 + }
  61 +
  62 + /**
  63 + * Sets the value of the assignedBy property.
  64 + *
  65 + * @param value allowed object is
  66 + * {@link AssignedByType }
  67 + */
  68 + public void setAssignedBy(AssignedByType value)
  69 + {
  70 + this.assignedBy = value;
  71 + }
  72 +
  73 + /**
  74 + * Gets the value of the isIndividualAssignee property.
  75 + *
  76 + * @return possible object is
  77 + * {@link String }
  78 + */
  79 + public String getIsIndividualAssignee()
  80 + {
  81 + return isIndividualAssignee;
  82 + }
  83 +
  84 + /**
  85 + * Sets the value of the isIndividualAssignee property.
  86 + *
  87 + * @param value allowed object is
  88 + * {@link String }
  89 + */
  90 + public void setIsIndividualAssignee(String value)
  91 + {
  92 + this.isIndividualAssignee = value;
  93 + }
  94 +
  95 + /**
  96 + * Gets the value of the login property.
  97 + *
  98 + * @return possible object is
  99 + * {@link String }
  100 + */
  101 + public String getLogin()
  102 + {
  103 + return login;
  104 + }
  105 +
  106 + /**
  107 + * Sets the value of the login property.
  108 + *
  109 + * @param value allowed object is
  110 + * {@link String }
  111 + */
  112 + public void setLogin(String value)
  113 + {
  114 + this.login = value;
  115 + }
  116 +}
... ...
... ... @@ -2,7 +2,7 @@
2 2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
3 3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
4 4 // Any modifications to this file will be lost upon recompilation of the source schema.
5   -// Generated on: 2012.07.03 at 12:32:28 PM CEST
  5 +// Generated on: 2012.07.05 at 06:19:38 PM CEST
6 6 //
7 7
8 8 package pl.com.it_crowd.youtrack.api.rest;
... ... @@ -63,7 +63,7 @@ public class Comment {
63 63 @XmlAttribute
64 64 protected String author;
65 65
66   - @XmlElementRefs({@XmlElementRef(name = "replies", type = JAXBElement.class), @XmlElementRef(name = "value", type = JAXBElement.class)})
  66 + @XmlElementRefs({@XmlElementRef(name = "value", type = JAXBElement.class), @XmlElementRef(name = "replies", type = JAXBElement.class)})
67 67 @XmlMixed
68 68 protected List<Serializable> content;
69 69
... ... @@ -130,9 +130,9 @@ public class Comment {
130 130 * <p/>
131 131 * <p/>
132 132 * Objects of the following type(s) are allowed in the list
133   - * {@link JAXBElement }{@code <}{@link String }{@code >}
134   - * {@link JAXBElement }{@code <}{@link Comment.Value }{@code >}
135 133 * {@link String }
  134 + * {@link JAXBElement }{@code <}{@link Comment.Value }{@code >}
  135 + * {@link JAXBElement }{@code <}{@link String }{@code >}
136 136 */
137 137 public List<Serializable> getContent()
138 138 {
... ...
... ... @@ -2,7 +2,7 @@
2 2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
3 3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
4 4 // Any modifications to this file will be lost upon recompilation of the source schema.
5   -// Generated on: 2012.07.03 at 12:32:28 PM CEST
  5 +// Generated on: 2012.07.05 at 06:19:38 PM CEST
6 6 //
7 7
8 8 package pl.com.it_crowd.youtrack.api.rest;
... ...
... ... @@ -2,7 +2,7 @@
2 2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
3 3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
4 4 // Any modifications to this file will be lost upon recompilation of the source schema.
5   -// Generated on: 2012.07.03 at 12:32:28 PM CEST
  5 +// Generated on: 2012.07.05 at 06:19:38 PM CEST
6 6 //
7 7
8 8 package pl.com.it_crowd.youtrack.api.rest;
... ... @@ -40,7 +40,7 @@ import java.util.List;
40 40 public class Issue {
41 41 // ------------------------------ FIELDS ------------------------------
42 42
43   - @XmlElements({@XmlElement(name = "field", type = Field.class), @XmlElement(name = "comment", type = Comment.class)})
  43 + @XmlElements({@XmlElement(name = "comment", type = Comment.class), @XmlElement(name = "field", type = Field.class)})
44 44 protected List<Object> fieldOrComment;
45 45
46 46 @XmlAttribute
... ... @@ -66,8 +66,8 @@ public class Issue {
66 66 * <p/>
67 67 * <p/>
68 68 * Objects of the following type(s) are allowed in the list
69   - * {@link Field }
70 69 * {@link Comment }
  70 + * {@link Field }
71 71 */
72 72 public List<Object> getFieldOrComment()
73 73 {
... ...
... ... @@ -2,7 +2,7 @@
2 2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
3 3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
4 4 // Any modifications to this file will be lost upon recompilation of the source schema.
5   -// Generated on: 2012.07.03 at 12:32:28 PM CEST
  5 +// Generated on: 2012.07.05 at 06:19:38 PM CEST
6 6 //
7 7
8 8 package pl.com.it_crowd.youtrack.api.rest;
... ...
... ... @@ -2,7 +2,7 @@
2 2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
3 3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
4 4 // Any modifications to this file will be lost upon recompilation of the source schema.
5   -// Generated on: 2012.07.03 at 12:32:28 PM CEST
  5 +// Generated on: 2012.07.05 at 06:19:38 PM CEST
6 6 //
7 7
8 8 package pl.com.it_crowd.youtrack.api.rest;
... ... @@ -35,6 +35,8 @@ public class ObjectFactory {
35 35
36 36 private final static QName _Error_QNAME = new QName("", "error");
37 37
  38 + private final static QName _Int_QNAME = new QName("", "int");
  39 +
38 40 private final static QName _Issue_QNAME = new QName("", "issue");
39 41
40 42 // --------------------------- CONSTRUCTORS ---------------------------
... ... @@ -49,6 +51,38 @@ public class ObjectFactory {
49 51 // -------------------------- OTHER METHODS --------------------------
50 52
51 53 /**
  54 + * Create an instance of {@link AssignedByType }
  55 + */
  56 + public AssignedByType createAssignedByType()
  57 + {
  58 + return new AssignedByType();
  59 + }
  60 +
  61 + /**
  62 + * Create an instance of {@link AssigneeList }
  63 + */
  64 + public AssigneeList createAssigneeList()
  65 + {
  66 + return new AssigneeList();
  67 + }
  68 +
  69 + /**
  70 + * Create an instance of {@link AssigneeList.Assignees }
  71 + */
  72 + public AssigneeList.Assignees createAssigneeListAssignees()
  73 + {
  74 + return new AssigneeList.Assignees();
  75 + }
  76 +
  77 + /**
  78 + * Create an instance of {@link AssigneeType }
  79 + */
  80 + public AssigneeType createAssigneeType()
  81 + {
  82 + return new AssigneeType();
  83 + }
  84 +
  85 + /**
52 86 * Create an instance of {@link Comment }
53 87 */
54 88 public Comment createComment()
... ... @@ -108,6 +142,15 @@ public class ObjectFactory {
108 142 }
109 143
110 144 /**
  145 + * Create an instance of {@link JAXBElement }{@code <}{@link Short }{@code >}}
  146 + */
  147 + @XmlElementDecl(namespace = "", name = "int")
  148 + public JAXBElement<Short> createInt(Short value)
  149 + {
  150 + return new JAXBElement<Short>(_Int_QNAME, Short.class, null, value);
  151 + }
  152 +
  153 + /**
111 154 * Create an instance of {@link Issue }
112 155 */
113 156 public Issue createIssue()
... ... @@ -141,6 +184,14 @@ public class ObjectFactory {
141 184 }
142 185
143 186 /**
  187 + * Create an instance of {@link UserGroupRefType }
  188 + */
  189 + public UserGroupRefType createUserGroupRefType()
  190 + {
  191 + return new UserGroupRefType();
  192 + }
  193 +
  194 + /**
144 195 * Create an instance of {@link UserRefs }
145 196 */
146 197 public UserRefs createUserRefs()
... ...
... ... @@ -2,7 +2,7 @@
2 2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
3 3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
4 4 // Any modifications to this file will be lost upon recompilation of the source schema.
5   -// Generated on: 2012.07.03 at 12:32:28 PM CEST
  5 +// Generated on: 2012.07.05 at 06:19:38 PM CEST
6 6 //
7 7
8 8 package pl.com.it_crowd.youtrack.api.rest;
... ...
  1 +//
  2 +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
  3 +// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
  4 +// Any modifications to this file will be lost upon recompilation of the source schema.
  5 +// Generated on: 2012.07.05 at 06:19:38 PM CEST
  6 +//
  7 +
  8 +package pl.com.it_crowd.youtrack.api.rest;
  9 +
  10 +import javax.xml.bind.annotation.XmlAccessType;
  11 +import javax.xml.bind.annotation.XmlAccessorType;
  12 +import javax.xml.bind.annotation.XmlAttribute;
  13 +import javax.xml.bind.annotation.XmlType;
  14 +import javax.xml.bind.annotation.XmlValue;
  15 +
  16 +/**
  17 + * <p>Java class for userGroupRefType complex type.
  18 + * <p/>
  19 + * <p>The following schema fragment specifies the expected content contained within this class.
  20 + * <p/>
  21 + * <pre>
  22 + * &lt;complexType name="userGroupRefType">
  23 + * &lt;simpleContent>
  24 + * &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
  25 + * &lt;attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
  26 + * &lt;attribute name="url" type="{http://www.w3.org/2001/XMLSchema}string" />
  27 + * &lt;/extension>
  28 + * &lt;/simpleContent>
  29 + * &lt;/complexType>
  30 + * </pre>
  31 + */
  32 +@XmlAccessorType(XmlAccessType.FIELD)
  33 +@XmlType(name = "userGroupRefType", propOrder = {"value"})
  34 +public class UserGroupRefType {
  35 +// ------------------------------ FIELDS ------------------------------
  36 +
  37 + @XmlAttribute
  38 + protected String name;
  39 +
  40 + @XmlAttribute
  41 + protected String url;
  42 +
  43 + @XmlValue
  44 + protected String value;
  45 +
  46 +// --------------------- GETTER / SETTER METHODS ---------------------
  47 +
  48 + /**
  49 + * Gets the value of the name property.
  50 + *
  51 + * @return possible object is
  52 + * {@link String }
  53 + */
  54 + public String getName()
  55 + {
  56 + return name;
  57 + }
  58 +
  59 + /**
  60 + * Sets the value of the name property.
  61 + *
  62 + * @param value allowed object is
  63 + * {@link String }
  64 + */
  65 + public void setName(String value)
  66 + {
  67 + this.name = value;
  68 + }
  69 +
  70 + /**
  71 + * Gets the value of the url property.
  72 + *
  73 + * @return possible object is
  74 + * {@link String }
  75 + */
  76 + public String getUrl()
  77 + {
  78 + return url;
  79 + }
  80 +
  81 + /**
  82 + * Sets the value of the url property.
  83 + *
  84 + * @param value allowed object is
  85 + * {@link String }
  86 + */
  87 + public void setUrl(String value)
  88 + {
  89 + this.url = value;
  90 + }
  91 +
  92 + /**
  93 + * Gets the value of the value property.
  94 + *
  95 + * @return possible object is
  96 + * {@link String }
  97 + */
  98 + public String getValue()
  99 + {
  100 + return value;
  101 + }
  102 +
  103 + /**
  104 + * Sets the value of the value property.
  105 + *
  106 + * @param value allowed object is
  107 + * {@link String }
  108 + */
  109 + public void setValue(String value)
  110 + {
  111 + this.value = value;
  112 + }
  113 +}
... ...
... ... @@ -2,7 +2,7 @@
2 2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
3 3 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
4 4 // Any modifications to this file will be lost upon recompilation of the source schema.
5   -// Generated on: 2012.07.03 at 12:32:28 PM CEST
  5 +// Generated on: 2012.07.05 at 06:19:38 PM CEST
6 6 //
7 7
8 8 package pl.com.it_crowd.youtrack.api.rest;
... ...
... ... @@ -15,6 +15,12 @@
15 15 </jxb:bindings>
16 16 </jxb:bindings>
17 17
  18 + <jxb:bindings schemaLocation="../xsd/assignees.xsd" node="/xs:schema">
  19 + <jxb:bindings node=".//xs:element[@name='assigneeList']//xs:sequence[@id='innerAssignees']">
  20 + <jxb:property name="assignees"/>
  21 + </jxb:bindings>
  22 + </jxb:bindings>
  23 +
18 24 <jxb:bindings schemaLocation="../xsd/types.xsd" node="/xs:schema">
19 25
20 26 <jxb:globalBindings localScoping="nested"/>
... ...
  1 +<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  2 +<assigneeList xsi:noNamespaceSchemaLocation="assignees.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3 + groupsUrl="https://it-crowd.com.pl/youtrack/rest/admin/project/QWE_QA/assignee/group"
  4 + individualsUrl="https://it-crowd.com.pl/youtrack/rest/admin/project/QWE_QA/assignee/individual">
  5 + <assignees>
  6 + <assignee login="bernard" isIndividualAssignee="false">
  7 + <assignedBy>
  8 + <userGroupRef name="IT Crowd team" url="https://it-crowd.com.pl/youtrack/rest/admin/group/IT%20Crowd%20team"/>
  9 + </assignedBy>
  10 + </assignee>
  11 + <assignee login="jacek" isIndividualAssignee="false">
  12 + <assignedBy>
  13 + <userGroupRef name="IT Crowd team" url="https://it-crowd.com.pl/youtrack/rest/admin/group/IT%20Crowd%20team"/>
  14 + </assignedBy>
  15 + </assignee>
  16 + <assignee login="karol" isIndividualAssignee="false">
  17 + <assignedBy>
  18 + <userGroupRef name="IT Crowd team" url="https://it-crowd.com.pl/youtrack/rest/admin/group/IT%20Crowd%20team"/>
  19 + </assignedBy>
  20 + </assignee>
  21 + <assignee login="k.miksa" isIndividualAssignee="false">
  22 + <assignedBy>
  23 + <userGroupRef name="IT Crowd team" url="https://it-crowd.com.pl/youtrack/rest/admin/group/IT%20Crowd%20team"/>
  24 + </assignedBy>
  25 + </assignee>
  26 + <assignee login="tomek" isIndividualAssignee="false">
  27 + <assignedBy>
  28 + <userGroupRef name="IT Crowd team" url="https://it-crowd.com.pl/youtrack/rest/admin/group/IT%20Crowd%20team"/>
  29 + </assignedBy>
  30 + </assignee>
  31 + <assignee login="l.gladek" isIndividualAssignee="false">
  32 + <assignedBy>
  33 + <userGroupRef name="IT Crowd team" url="https://it-crowd.com.pl/youtrack/rest/admin/group/IT%20Crowd%20team"/>
  34 + </assignedBy>
  35 + </assignee>
  36 + </assignees>
  37 +</assigneeList>
\ No newline at end of file
... ...
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  3 +
  4 + <xs:include schemaLocation="types.xsd"/>
  5 +
  6 + <xs:element name="assigneeList">
  7 + <xs:complexType>
  8 + <xs:sequence id="assignees" minOccurs="1" maxOccurs="1">
  9 + <xs:element name="assignees">
  10 + <xs:complexType>
  11 + <xs:sequence id="innerAssignees">
  12 + <xs:element name="assignee" type="assigneeType" maxOccurs="unbounded" minOccurs="0"/>
  13 + </xs:sequence>
  14 + </xs:complexType>
  15 + </xs:element>
  16 + </xs:sequence>
  17 + <xs:attribute type="xs:string" name="groupsUrl"/>
  18 + <xs:attribute type="xs:string" name="individualsUrl"/>
  19 + </xs:complexType>
  20 + </xs:element>
  21 +
  22 +</xs:schema>
\ No newline at end of file
... ...
  1 +<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  2 +<int xsi:noNamespaceSchemaLocation="issuesCount.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">1663</int>
... ...
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  3 + <xs:element name="int" type="xs:short"/>
  4 +</xs:schema>
\ No newline at end of file
... ...
1 1 <?xml version="1.0" encoding="UTF-8"?>
2 2 <xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.1.0">
3 3
  4 + <xs:complexType name="assignedByType">
  5 + <xs:sequence>
  6 + <xs:element name="userGroupRef" type="userGroupRefType"/>
  7 + </xs:sequence>
  8 + </xs:complexType>
  9 +
  10 + <xs:complexType name="assigneeType">
  11 + <xs:sequence>
  12 + <xs:element name="assignedBy" type="assignedByType"/>
  13 + </xs:sequence>
  14 + <xs:attribute type="xs:string" name="login" use="optional"/>
  15 + <xs:attribute type="xs:string" name="isIndividualAssignee" use="optional"/>
  16 + </xs:complexType>
4 17
5 18 <xs:complexType name="fieldType">
6 19 <xs:sequence id="value" maxOccurs="unbounded" minOccurs="0">
... ... @@ -46,6 +59,15 @@
46 59 <xs:attribute type="xs:string" name="name" use="optional"/>
47 60 </xs:complexType>
48 61
  62 + <xs:complexType name="userGroupRefType">
  63 + <xs:simpleContent>
  64 + <xs:extension base="xs:string">
  65 + <xs:attribute type="xs:string" name="name" use="optional"/>
  66 + <xs:attribute type="xs:string" name="url" use="optional"/>
  67 + </xs:extension>
  68 + </xs:simpleContent>
  69 + </xs:complexType>
  70 +
49 71 <xs:complexType name="userType">
50 72 <xs:attribute type="xs:string" name="login" use="required"/>
51 73 <xs:attribute type="xs:anyURI" name="url" use="optional"/>
... ...
... ... @@ -28,35 +28,6 @@ public class YoutrackAPITest {
28 28 // -------------------------- OTHER METHODS --------------------------
29 29
30 30 @Test
31   - public void commandAllStates() throws IOException, JAXBException
32   - {
33   - final YoutrackAPI api = new YoutrackAPI(getServiceLocation(), getUsername(), getPassword());
34   - final String issueId = "TST-1";
35   - IssueWrapper issue;
36   - final StateValues[] stateValueses = StateValues.values();
37   - for (StateValues state : stateValueses) {
38   - if (state.getCommandValue() != null && !StateValues.Duplicate.equals(state)) {
39   - api.command(issueId, Command.stateCommand(state));
40   - issue = api.getIssue(issueId);
41   - Assert.assertNotNull(issue);
42   - Assert.assertEquals(state.getCommandValue(), issue.getFieldValue(Fields.state));
43   - }
44   - }
45   - }
46   -
47   - @Test
48   - public void getIndividualAssignees() throws IOException, JAXBException
49   - {
50   - final YoutrackAPI api = new YoutrackAPI(getServiceLocation(), getUsername(), getPassword());
51   - final List<User> assignees = api.getIndividualAssignees("TST");
52   - Assert.assertNotNull(assignees);
53   - Assert.assertEquals(2, assignees.size());
54   - for (User user : assignees) {
55   - Assert.assertTrue("bernard".equals(user.getLogin()) || "root".equals(user.getLogin()));
56   - }
57   - }
58   -
59   - @Test
60 31 public void command() throws IOException, JAXBException
61 32 {
62 33 final YoutrackAPI api = new YoutrackAPI(getServiceLocation(), getUsername(), getPassword());
... ... @@ -98,6 +69,23 @@ public class YoutrackAPITest {
98 69 }
99 70
100 71 @Test
  72 + public void commandAllStates() throws IOException, JAXBException
  73 + {
  74 + final YoutrackAPI api = new YoutrackAPI(getServiceLocation(), getUsername(), getPassword());
  75 + final String issueId = "TST-1";
  76 + IssueWrapper issue;
  77 + final StateValues[] stateValueses = StateValues.values();
  78 + for (StateValues state : stateValueses) {
  79 + if (state.getCommandValue() != null && !StateValues.Duplicate.equals(state)) {
  80 + api.command(issueId, Command.stateCommand(state));
  81 + issue = api.getIssue(issueId);
  82 + Assert.assertNotNull(issue);
  83 + Assert.assertEquals(state.getCommandValue(), issue.getFieldValue(Fields.state));
  84 + }
  85 + }
  86 + }
  87 +
  88 + @Test
101 89 public void createIssue() throws IOException, AuthenticationException, JAXBException
102 90 {
103 91 YoutrackAPI api = new YoutrackAPI(getServiceLocation(), getUsername(), getPassword());
... ... @@ -107,6 +95,27 @@ public class YoutrackAPITest {
107 95 }
108 96
109 97 @Test
  98 + public void getAssignees() throws IOException, AuthenticationException, JAXBException
  99 + {
  100 + YoutrackAPI api = new YoutrackAPI(getServiceLocation(), getUsername(), getPassword());
  101 + final AssigneeList assigneeList = api.getAssignees("TST");
  102 + Assert.assertNotNull(assigneeList);
  103 + Assert.assertEquals(2, assigneeList.getAssignees().getAssignees().size());
  104 + }
  105 +
  106 + @Test
  107 + public void getIndividualAssignees() throws IOException, JAXBException
  108 + {
  109 + final YoutrackAPI api = new YoutrackAPI(getServiceLocation(), getUsername(), getPassword());
  110 + final List<User> assignees = api.getIndividualAssignees("TST");
  111 + Assert.assertNotNull(assignees);
  112 + Assert.assertEquals(2, assignees.size());
  113 + for (User user : assignees) {
  114 + Assert.assertTrue("bernard".equals(user.getLogin()) || "root".equals(user.getLogin()));
  115 + }
  116 + }
  117 +
  118 + @Test
110 119 public void getIssue() throws IOException, AuthenticationException, JAXBException
111 120 {
112 121 YoutrackAPI api = new YoutrackAPI(getServiceLocation(), getUsername(), getPassword());
... ...
Please register or login to post a comment