Showing
14 changed files
with
271 additions
and
26 deletions
| ... | ... | @@ -29,13 +29,15 @@ import pl.com.it_crowd.youtrack.api.exceptions.YoutrackAPIException; |
| 29 | 29 | import pl.com.it_crowd.youtrack.api.exceptions.YoutrackErrorException; |
| 30 | 30 | import pl.com.it_crowd.youtrack.api.rest.Issue; |
| 31 | 31 | import pl.com.it_crowd.youtrack.api.rest.Issues; |
| 32 | -import pl.com.it_crowd.youtrack.api.rest.ObjectFactory; | |
| 32 | +import pl.com.it_crowd.youtrack.api.rest.User; | |
| 33 | +import pl.com.it_crowd.youtrack.api.rest.UserRefs; | |
| 33 | 34 | |
| 34 | 35 | import javax.net.ssl.SSLContext; |
| 35 | 36 | import javax.net.ssl.TrustManager; |
| 36 | 37 | import javax.net.ssl.X509TrustManager; |
| 37 | 38 | import javax.xml.bind.JAXBElement; |
| 38 | 39 | import javax.xml.bind.JAXBException; |
| 40 | +import javax.xml.namespace.QName; | |
| 39 | 41 | import java.io.IOException; |
| 40 | 42 | import java.net.URI; |
| 41 | 43 | import java.net.URISyntaxException; |
| ... | ... | @@ -53,6 +55,10 @@ import java.util.regex.Pattern; |
| 53 | 55 | public class YoutrackAPI { |
| 54 | 56 | // ------------------------------ FIELDS ------------------------------ |
| 55 | 57 | |
| 58 | + private final static QName Error_QNAME = new QName("", "error"); | |
| 59 | + | |
| 60 | + private final static QName Issue_QNAME = new QName("", "issue"); | |
| 61 | + | |
| 56 | 62 | private HttpClient httpClient; |
| 57 | 63 | |
| 58 | 64 | private String serviceLocation; |
| ... | ... | @@ -201,6 +207,23 @@ public class YoutrackAPI { |
| 201 | 207 | return matcher.group(1); |
| 202 | 208 | } |
| 203 | 209 | |
| 210 | + public List<User> getIndividualAssignees(String project) throws IOException, JAXBException | |
| 211 | + { | |
| 212 | + final URI uri; | |
| 213 | + try { | |
| 214 | + uri = new URIBuilder(serviceLocation + "/rest/admin/project/" + project + "/assignee/individual").build(); | |
| 215 | + } catch (URISyntaxException e) { | |
| 216 | + throw new RuntimeException(e); | |
| 217 | + } | |
| 218 | + final String responseString = execute(new HttpGet(uri)); | |
| 219 | + final Object result = YoutrackUnmarshaller.unmarshall(responseString); | |
| 220 | + if (result instanceof UserRefs) { | |
| 221 | + return ((UserRefs) result).getUsers(); | |
| 222 | + } else { | |
| 223 | + throw new YoutrackAPIException("Unexpected type: " + result); | |
| 224 | + } | |
| 225 | + } | |
| 226 | + | |
| 204 | 227 | public IssueWrapper getIssue(String issueId) throws IOException, JAXBException |
| 205 | 228 | { |
| 206 | 229 | final URI uri; |
| ... | ... | @@ -224,15 +247,13 @@ public class YoutrackAPI { |
| 224 | 247 | return new IssueWrapper((Issue) result); |
| 225 | 248 | } else if (result instanceof JAXBElement) { |
| 226 | 249 | final JAXBElement jaxbElement = (JAXBElement) result; |
| 227 | - if (ObjectFactory._Error_QNAME.equals(jaxbElement.getName())) { | |
| 228 | - throw new RuntimeException("Unexpected type: " + jaxbElement.getValue()); | |
| 229 | - } else if (ObjectFactory._Issue_QNAME.equals(jaxbElement.getName())) { | |
| 250 | + if (Issue_QNAME.equals(jaxbElement.getName())) { | |
| 230 | 251 | return new IssueWrapper((Issue) jaxbElement.getValue()); |
| 231 | 252 | } else { |
| 232 | - throw new RuntimeException(jaxbElement.getValue() + ""); | |
| 253 | + throw new YoutrackAPIException("Unexpected type: " + jaxbElement.getValue()); | |
| 233 | 254 | } |
| 234 | 255 | } else { |
| 235 | - throw new RuntimeException("Unexpected type " + result); | |
| 256 | + throw new YoutrackAPIException("Unexpected type " + result); | |
| 236 | 257 | } |
| 237 | 258 | } |
| 238 | 259 | ... | ... |
| ... | ... | @@ -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.02 at 11:11:34 PM CEST | |
| 5 | +// Generated on: 2012.07.03 at 12:32:28 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 = "value", type = JAXBElement.class), @XmlElementRef(name = "replies", type = JAXBElement.class)}) | |
| 66 | + @XmlElementRefs({@XmlElementRef(name = "replies", type = JAXBElement.class), @XmlElementRef(name = "value", type = JAXBElement.class)}) | |
| 67 | 67 | @XmlMixed |
| 68 | 68 | protected List<Serializable> content; |
| 69 | 69 | ... | ... |
| ... | ... | @@ -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.02 at 11:11:34 PM CEST | |
| 5 | +// Generated on: 2012.07.03 at 12:32:28 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.02 at 11:11:34 PM CEST | |
| 5 | +// Generated on: 2012.07.03 at 12:32:28 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 = "comment", type = Comment.class), @XmlElement(name = "field", type = Field.class)}) | |
| 43 | + @XmlElements({@XmlElement(name = "field", type = Field.class), @XmlElement(name = "comment", type = Comment.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 Comment } | |
| 70 | 69 | * {@link Field } |
| 70 | + * {@link Comment } | |
| 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.02 at 11:11:34 PM CEST | |
| 5 | +// Generated on: 2012.07.03 at 12:32:28 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.02 at 11:11:34 PM CEST | |
| 5 | +// Generated on: 2012.07.03 at 12:32:28 PM CEST | |
| 6 | 6 | // |
| 7 | 7 | |
| 8 | 8 | package pl.com.it_crowd.youtrack.api.rest; |
| ... | ... | @@ -29,14 +29,14 @@ import javax.xml.namespace.QName; |
| 29 | 29 | public class ObjectFactory { |
| 30 | 30 | // ------------------------------ FIELDS ------------------------------ |
| 31 | 31 | |
| 32 | - public final static QName _Error_QNAME = new QName("", "error"); | |
| 33 | - | |
| 34 | - public final static QName _Issue_QNAME = new QName("", "issue"); | |
| 35 | - | |
| 36 | 32 | private final static QName _CommentReplies_QNAME = new QName("", "replies"); |
| 37 | 33 | |
| 38 | 34 | private final static QName _CommentValue_QNAME = new QName("", "value"); |
| 39 | 35 | |
| 36 | + private final static QName _Error_QNAME = new QName("", "error"); | |
| 37 | + | |
| 38 | + private final static QName _Issue_QNAME = new QName("", "issue"); | |
| 39 | + | |
| 40 | 40 | // --------------------------- CONSTRUCTORS --------------------------- |
| 41 | 41 | |
| 42 | 42 | /** |
| ... | ... | @@ -131,4 +131,20 @@ public class ObjectFactory { |
| 131 | 131 | { |
| 132 | 132 | return new Issues(); |
| 133 | 133 | } |
| 134 | + | |
| 135 | + /** | |
| 136 | + * Create an instance of {@link User } | |
| 137 | + */ | |
| 138 | + public User createUser() | |
| 139 | + { | |
| 140 | + return new User(); | |
| 141 | + } | |
| 142 | + | |
| 143 | + /** | |
| 144 | + * Create an instance of {@link UserRefs } | |
| 145 | + */ | |
| 146 | + public UserRefs createUserRefs() | |
| 147 | + { | |
| 148 | + return new UserRefs(); | |
| 149 | + } | |
| 134 | 150 | } | ... | ... |
| 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.03 at 12:32:28 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.XmlSchemaType; | |
| 14 | +import javax.xml.bind.annotation.XmlType; | |
| 15 | + | |
| 16 | +/** | |
| 17 | + * <p>Java class for userType complex type. | |
| 18 | + * <p/> | |
| 19 | + * <p>The following schema fragment specifies the expected content contained within this class. | |
| 20 | + * <p/> | |
| 21 | + * <pre> | |
| 22 | + * <complexType name="userType"> | |
| 23 | + * <complexContent> | |
| 24 | + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> | |
| 25 | + * <attribute name="login" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> | |
| 26 | + * <attribute name="url" type="{http://www.w3.org/2001/XMLSchema}anyURI" /> | |
| 27 | + * </restriction> | |
| 28 | + * </complexContent> | |
| 29 | + * </complexType> | |
| 30 | + * </pre> | |
| 31 | + */ | |
| 32 | +@XmlAccessorType(XmlAccessType.FIELD) | |
| 33 | +@XmlType(name = "userType") | |
| 34 | +public class User { | |
| 35 | +// ------------------------------ FIELDS ------------------------------ | |
| 36 | + | |
| 37 | + @XmlAttribute(required = true) | |
| 38 | + protected String login; | |
| 39 | + | |
| 40 | + @XmlAttribute | |
| 41 | + @XmlSchemaType(name = "anyURI") | |
| 42 | + protected String url; | |
| 43 | + | |
| 44 | +// --------------------- GETTER / SETTER METHODS --------------------- | |
| 45 | + | |
| 46 | + /** | |
| 47 | + * Gets the value of the login property. | |
| 48 | + * | |
| 49 | + * @return possible object is | |
| 50 | + * {@link String } | |
| 51 | + */ | |
| 52 | + public String getLogin() | |
| 53 | + { | |
| 54 | + return login; | |
| 55 | + } | |
| 56 | + | |
| 57 | + /** | |
| 58 | + * Sets the value of the login property. | |
| 59 | + * | |
| 60 | + * @param value allowed object is | |
| 61 | + * {@link String } | |
| 62 | + */ | |
| 63 | + public void setLogin(String value) | |
| 64 | + { | |
| 65 | + this.login = value; | |
| 66 | + } | |
| 67 | + | |
| 68 | + /** | |
| 69 | + * Gets the value of the url property. | |
| 70 | + * | |
| 71 | + * @return possible object is | |
| 72 | + * {@link String } | |
| 73 | + */ | |
| 74 | + public String getUrl() | |
| 75 | + { | |
| 76 | + return url; | |
| 77 | + } | |
| 78 | + | |
| 79 | + /** | |
| 80 | + * Sets the value of the url property. | |
| 81 | + * | |
| 82 | + * @param value allowed object is | |
| 83 | + * {@link String } | |
| 84 | + */ | |
| 85 | + public void setUrl(String value) | |
| 86 | + { | |
| 87 | + this.url = value; | |
| 88 | + } | |
| 89 | +} | ... | ... |
| 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.03 at 12:32:28 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.XmlRootElement; | |
| 14 | +import javax.xml.bind.annotation.XmlType; | |
| 15 | +import java.util.ArrayList; | |
| 16 | +import java.util.List; | |
| 17 | + | |
| 18 | +/** | |
| 19 | + * <p>Java class for anonymous complex type. | |
| 20 | + * <p/> | |
| 21 | + * <p>The following schema fragment specifies the expected content contained within this class. | |
| 22 | + * <p/> | |
| 23 | + * <pre> | |
| 24 | + * <complexType> | |
| 25 | + * <complexContent> | |
| 26 | + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> | |
| 27 | + * <sequence> | |
| 28 | + * <element name="user" type="{}userType" maxOccurs="unbounded" minOccurs="0"/> | |
| 29 | + * </sequence> | |
| 30 | + * </restriction> | |
| 31 | + * </complexContent> | |
| 32 | + * </complexType> | |
| 33 | + * </pre> | |
| 34 | + */ | |
| 35 | +@XmlAccessorType(XmlAccessType.FIELD) | |
| 36 | +@XmlType(name = "", propOrder = {"users"}) | |
| 37 | +@XmlRootElement(name = "userRefs") | |
| 38 | +public class UserRefs { | |
| 39 | +// ------------------------------ FIELDS ------------------------------ | |
| 40 | + | |
| 41 | + @XmlElement(name = "user") | |
| 42 | + protected List<User> users; | |
| 43 | + | |
| 44 | +// --------------------- GETTER / SETTER METHODS --------------------- | |
| 45 | + | |
| 46 | + /** | |
| 47 | + * Gets the value of the users property. | |
| 48 | + * <p/> | |
| 49 | + * <p/> | |
| 50 | + * This accessor method returns a reference to the live list, | |
| 51 | + * not a snapshot. Therefore any modification you make to the | |
| 52 | + * returned list will be present inside the JAXB object. | |
| 53 | + * This is why there is not a <CODE>set</CODE> method for the users property. | |
| 54 | + * <p/> | |
| 55 | + * <p/> | |
| 56 | + * For example, to add a new item, do as follows: | |
| 57 | + * <pre> | |
| 58 | + * getUsers().add(newItem); | |
| 59 | + * </pre> | |
| 60 | + * <p/> | |
| 61 | + * <p/> | |
| 62 | + * <p/> | |
| 63 | + * Objects of the following type(s) are allowed in the list | |
| 64 | + * {@link User } | |
| 65 | + */ | |
| 66 | + public List<User> getUsers() | |
| 67 | + { | |
| 68 | + if (users == null) { | |
| 69 | + users = new ArrayList<User>(); | |
| 70 | + } | |
| 71 | + return this.users; | |
| 72 | + } | |
| 73 | +} | ... | ... |
| ... | ... | @@ -9,6 +9,12 @@ |
| 9 | 9 | </jxb:bindings> |
| 10 | 10 | </jxb:bindings> |
| 11 | 11 | |
| 12 | + <jxb:bindings schemaLocation="../xsd/individualAssignees.xsd" node="/xs:schema"> | |
| 13 | + <jxb:bindings node=".//xs:element[@name='userRefs']//xs:sequence[@id='users']"> | |
| 14 | + <jxb:property name="users"/> | |
| 15 | + </jxb:bindings> | |
| 16 | + </jxb:bindings> | |
| 17 | + | |
| 12 | 18 | <jxb:bindings schemaLocation="../xsd/types.xsd" node="/xs:schema"> |
| 13 | 19 | |
| 14 | 20 | <jxb:globalBindings localScoping="nested"/> |
| ... | ... | @@ -28,6 +34,10 @@ |
| 28 | 34 | <jxb:class name="Comment"/> |
| 29 | 35 | </jxb:bindings> |
| 30 | 36 | |
| 37 | + <jxb:bindings node=".//xs:complexType[@name='userType']"> | |
| 38 | + <jxb:class name="User"/> | |
| 39 | + </jxb:bindings> | |
| 40 | + | |
| 31 | 41 | </jxb:bindings> |
| 32 | 42 | |
| 33 | 43 | </jxb:bindings> |
| \ No newline at end of file | ... | ... |
| 1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | -<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> | |
| 2 | +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> | |
| 3 | 3 | <xs:element name="error" type="xs:string"/> |
| 4 | 4 | </xs:schema> |
| \ No newline at end of file | ... | ... |
src/main/xsd/individualAssignees.xml
0 → 100644
| 1 | +<userRefs xsi:noNamespaceSchemaLocation="individualAssignees.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
| 2 | + <user login="root" url="http://localhost:8080/rest/admin/user/root"/> | |
| 3 | + <user login="bernard" url="http://localhost:8080/rest/admin/user/bernard"/> | |
| 4 | +</userRefs> | |
| \ No newline at end of file | ... | ... |
src/main/xsd/individualAssignees.xsd
0 → 100644
| 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="userRefs"> | |
| 7 | + <xs:complexType> | |
| 8 | + <xs:sequence id="users"> | |
| 9 | + <xs:element name="user" type="userType" maxOccurs="unbounded" minOccurs="0"/> | |
| 10 | + </xs:sequence> | |
| 11 | + </xs:complexType> | |
| 12 | + </xs:element> | |
| 13 | +</xs:schema> | |
| \ No newline at end of file | ... | ... |
| ... | ... | @@ -21,6 +21,7 @@ |
| 21 | 21 | </xs:choice> |
| 22 | 22 | <xs:attribute type="xs:string" name="id" use="optional"/> |
| 23 | 23 | </xs:complexType> |
| 24 | + | |
| 24 | 25 | <xs:complexType name="commentType" mixed="true"> |
| 25 | 26 | <xs:sequence> |
| 26 | 27 | <xs:element type="xs:string" name="replies" minOccurs="0"/> |
| ... | ... | @@ -44,4 +45,10 @@ |
| 44 | 45 | <xs:attribute type="xs:long" name="created" use="optional"/> |
| 45 | 46 | <xs:attribute type="xs:string" name="name" use="optional"/> |
| 46 | 47 | </xs:complexType> |
| 48 | + | |
| 49 | + <xs:complexType name="userType"> | |
| 50 | + <xs:attribute type="xs:string" name="login" use="required"/> | |
| 51 | + <xs:attribute type="xs:anyURI" name="url" use="optional"/> | |
| 52 | + </xs:complexType> | |
| 53 | + | |
| 47 | 54 | </xs:schema> |
| \ No newline at end of file | ... | ... |
| ... | ... | @@ -27,7 +27,7 @@ public class YoutrackAPITest { |
| 27 | 27 | // -------------------------- OTHER METHODS -------------------------- |
| 28 | 28 | |
| 29 | 29 | @Test |
| 30 | - public void commandAllStatesTest() throws IOException, JAXBException | |
| 30 | + public void commandAllStates() throws IOException, JAXBException | |
| 31 | 31 | { |
| 32 | 32 | final YoutrackAPI api = new YoutrackAPI(getServiceLocation(), getUsername(), getPassword()); |
| 33 | 33 | final String issueId = "TST-1"; |
| ... | ... | @@ -44,7 +44,19 @@ public class YoutrackAPITest { |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | @Test |
| 47 | - public void commandTest() throws IOException, JAXBException | |
| 47 | + public void getIndividualAssignees() throws IOException, JAXBException | |
| 48 | + { | |
| 49 | + final YoutrackAPI api = new YoutrackAPI(getServiceLocation(), getUsername(), getPassword()); | |
| 50 | + final List<User> assignees = api.getIndividualAssignees("TST"); | |
| 51 | + Assert.assertNotNull(assignees); | |
| 52 | + Assert.assertEquals(2, assignees.size()); | |
| 53 | + for (User user : assignees) { | |
| 54 | + Assert.assertTrue("bernard".equals(user.getLogin()) || "root".equals(user.getLogin())); | |
| 55 | + } | |
| 56 | + } | |
| 57 | + | |
| 58 | + @Test | |
| 59 | + public void command() throws IOException, JAXBException | |
| 48 | 60 | { |
| 49 | 61 | final YoutrackAPI api = new YoutrackAPI(getServiceLocation(), getUsername(), getPassword()); |
| 50 | 62 | final String issueId = "TST-1"; |
| ... | ... | @@ -85,7 +97,7 @@ public class YoutrackAPITest { |
| 85 | 97 | } |
| 86 | 98 | |
| 87 | 99 | @Test |
| 88 | - public void createIssueTest() throws IOException, AuthenticationException, JAXBException | |
| 100 | + public void createIssue() throws IOException, AuthenticationException, JAXBException | |
| 89 | 101 | { |
| 90 | 102 | YoutrackAPI api = new YoutrackAPI(getServiceLocation(), getUsername(), getPassword()); |
| 91 | 103 | final String issueId = api.createIssue("TST", "Test summary", "Test description"); |
| ... | ... | @@ -94,7 +106,7 @@ public class YoutrackAPITest { |
| 94 | 106 | } |
| 95 | 107 | |
| 96 | 108 | @Test |
| 97 | - public void getIssueTest() throws IOException, AuthenticationException, JAXBException | |
| 109 | + public void getIssue() throws IOException, AuthenticationException, JAXBException | |
| 98 | 110 | { |
| 99 | 111 | YoutrackAPI api = new YoutrackAPI(getServiceLocation(), getUsername(), getPassword()); |
| 100 | 112 | final IssueWrapper issue = api.getIssue("TST-1"); |
| ... | ... | @@ -116,7 +128,7 @@ public class YoutrackAPITest { |
| 116 | 128 | } |
| 117 | 129 | |
| 118 | 130 | @Test(expected = YoutrackErrorException.class) |
| 119 | - public void loginFailureTest() throws IOException, JAXBException | |
| 131 | + public void loginFailure() throws IOException, JAXBException | |
| 120 | 132 | { |
| 121 | 133 | final String username = "someFakeLogin"; |
| 122 | 134 | final String password = "someFakePassword"; |
| ... | ... | @@ -130,7 +142,7 @@ public class YoutrackAPITest { |
| 130 | 142 | } |
| 131 | 143 | |
| 132 | 144 | @Test |
| 133 | - public void loginTest() throws IOException, AuthenticationException, JAXBException | |
| 145 | + public void loginSuccess() throws IOException, AuthenticationException, JAXBException | |
| 134 | 146 | { |
| 135 | 147 | final String username = getUsername(); |
| 136 | 148 | final String password = getPassword(); |
| ... | ... | @@ -140,7 +152,7 @@ public class YoutrackAPITest { |
| 140 | 152 | } |
| 141 | 153 | |
| 142 | 154 | @Test |
| 143 | - public void searchIssuesByProjectTest() throws IOException, AuthenticationException, JAXBException | |
| 155 | + public void searchIssuesByProject() throws IOException, AuthenticationException, JAXBException | |
| 144 | 156 | { |
| 145 | 157 | YoutrackAPI api = new YoutrackAPI(getServiceLocation(), getUsername(), getPassword()); |
| 146 | 158 | List<IssueWrapper> issues = api.searchIssuesByProject("TST", null); | ... | ... |
Please
register
or
login
to post a comment