Commit 2b455d82adc3e32c401f4494a18ad8df2f573bdf

Authored by bernard
1 parent 4bd2f591

Code reformat.

... ... @@ -14,14 +14,17 @@ public class Issue implements Serializable {
14 14 // ------------------------------ FIELDS ------------------------------
15 15
16 16 private static final Log log = LogFactory.getLog(Issue.class);
  17 +
17 18 private List<Issues.Issue.Comment> comments;
  19 +
18 20 private Map<String, Issues.Issue.Field> fieldMap;
19 21
20 22 private Issues.Issue issue;
21 23
22 24 // --------------------------- CONSTRUCTORS ---------------------------
23 25
24   - public Issue(Issues.Issue issue) {
  26 + public Issue(Issues.Issue issue)
  27 + {
25 28 this.issue = issue;
26 29 fieldMap = new HashMap<String, Issues.Issue.Field>();
27 30 comments = new ArrayList<Issues.Issue.Comment>();
... ... @@ -39,11 +42,13 @@ public class Issue implements Serializable {
39 42
40 43 // -------------------------- OTHER METHODS --------------------------
41 44
42   - public Issues.Issue.Field getField(String field) {
  45 + public Issues.Issue.Field getField(String field)
  46 + {
43 47 return fieldMap.get(field);
44 48 }
45 49
46   - public String getFieldValue(String fieldName) {
  50 + public String getFieldValue(String fieldName)
  51 + {
47 52 Issues.Issue.Field field = fieldMap.get(fieldName);
48 53 if (field == null) {
49 54 return null;
... ... @@ -52,9 +57,11 @@ public class Issue implements Serializable {
52 57 return values.isEmpty() ? null : values.get(0).getContent();
53 58 }
54 59
55   - public String getFieldValue(Fields fieldName) {
  60 + public String getFieldValue(Fields fieldName)
  61 + {
56 62 return getFieldValue(fieldName.name());
57 63 }
  64 +
58 65 // -------------------------- ENUMERATIONS --------------------------
59 66
60 67 public enum Fields {
... ...
1   -package pl.com.it_crowd.youtrack.api.rest;
  1 +package pl.com.it_crowd.youtrack.api;
2 2
3 3 import com.gargoylesoftware.htmlunit.BrowserVersion;
4 4 import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
... ... @@ -11,8 +11,7 @@ import com.gargoylesoftware.htmlunit.html.DomNode;
11 11 import com.gargoylesoftware.htmlunit.util.NameValuePair;
12 12 import com.gargoylesoftware.htmlunit.xml.XmlPage;
13 13 import org.apache.http.auth.AuthenticationException;
14   -import pl.com.it_crowd.youtrack.api.Issue;
15   -import pl.com.it_crowd.youtrack.api.IssuesUnmarshaller;
  14 +import pl.com.it_crowd.youtrack.api.rest.Issues;
16 15
17 16 import javax.xml.bind.JAXBException;
18 17 import java.io.IOException;
... ... @@ -29,27 +28,31 @@ public class YoutrackAPI {
29 28
30 29 // --------------------------- CONSTRUCTORS ---------------------------
31 30
32   - public YoutrackAPI(String serviceLocation) {
  31 + public YoutrackAPI(String serviceLocation)
  32 + {
33 33 this.serviceLocation = serviceLocation;
34 34 this.webClient = new WebClient(BrowserVersion.FIREFOX_3_6);
35 35 this.webClient.setJavaScriptEnabled(false);
36 36 this.webClient.setCssEnabled(false);
37 37 }
38 38
39   - public YoutrackAPI(String serviceLocation, String username, String password) throws IOException, AuthenticationException {
  39 + public YoutrackAPI(String serviceLocation, String username, String password) throws IOException, AuthenticationException
  40 + {
40 41 this(serviceLocation);
41 42 login(username, password);
42 43 }
43 44
44 45 // --------------------- GETTER / SETTER METHODS ---------------------
45 46
46   - public String getServiceLocation() {
  47 + public String getServiceLocation()
  48 + {
47 49 return serviceLocation;
48 50 }
49 51
50 52 // -------------------------- OTHER METHODS --------------------------
51 53
52   - public void login(String username, String password) throws IOException, AuthenticationException {
  54 + public void login(String username, String password) throws IOException, AuthenticationException
  55 + {
53 56 ArrayList<NameValuePair> requestParameters = new ArrayList<NameValuePair>();
54 57 requestParameters.add(new NameValuePair("login", username));
55 58 requestParameters.add(new NameValuePair("password", password));
... ... @@ -68,7 +71,8 @@ public class YoutrackAPI {
68 71 }
69 72 }
70 73
71   - public List<Issue> searchIssuesByProject(String project, String filter) throws JAXBException, IOException {
  74 + public List<Issue> searchIssuesByProject(String project, String filter) throws JAXBException, IOException
  75 + {
72 76 String url = serviceLocation + "/rest/issue/byproject/" + project + "?filter=" + filter;
73 77 WebResponse webResponse = webClient.<Page>getPage(url).getWebResponse();
74 78 // System.out.println(webResponse.getContentAsString());
... ...
... ... @@ -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: 2011.12.16 at 09:34:48 AM CET
  5 +// Generated on: 2011.12.16 at 10:06:20 AM CET
6 6 //
7 7
8 8 package pl.com.it_crowd.youtrack.api.rest;
... ... @@ -96,9 +96,7 @@ import java.util.List;
96 96 * </pre>
97 97 */
98 98 @XmlAccessorType(XmlAccessType.FIELD)
99   -@XmlType(name = "", propOrder = {
100   - "issue"
101   -})
  99 +@XmlType(name = "", propOrder = {"issue"})
102 100 @XmlRootElement(name = "issues")
103 101 public class Issues {
104 102
... ... @@ -124,7 +122,8 @@ public class Issues {
124 122 * Objects of the following type(s) are allowed in the list
125 123 * {@link Issues.Issue }
126 124 */
127   - public List<Issues.Issue> getIssue() {
  125 + public List<Issues.Issue> getIssue()
  126 + {
128 127 if (issue == null) {
129 128 issue = new ArrayList<Issues.Issue>();
130 129 }
... ... @@ -199,16 +198,12 @@ public class Issues {
199 198 * </pre>
200 199 */
201 200 @XmlAccessorType(XmlAccessType.FIELD)
202   - @XmlType(name = "", propOrder = {
203   - "fieldOrComment"
204   - })
  201 + @XmlType(name = "", propOrder = {"fieldOrComment"})
205 202 public static class Issue {
206 203
207   - @XmlElements({
208   - @XmlElement(name = "field", type = Issues.Issue.Field.class),
209   - @XmlElement(name = "comment", type = Issues.Issue.Comment.class)
210   - })
  204 + @XmlElements({@XmlElement(name = "field", type = Issues.Issue.Field.class), @XmlElement(name = "comment", type = Issues.Issue.Comment.class)})
211 205 protected List<Object> fieldOrComment;
  206 +
212 207 @XmlAttribute
213 208 protected String id;
214 209
... ... @@ -233,7 +228,8 @@ public class Issues {
233 228 * {@link Issues.Issue.Field }
234 229 * {@link Issues.Issue.Comment }
235 230 */
236   - public List<Object> getFieldOrComment() {
  231 + public List<Object> getFieldOrComment()
  232 + {
237 233 if (fieldOrComment == null) {
238 234 fieldOrComment = new ArrayList<Object>();
239 235 }
... ... @@ -246,7 +242,8 @@ public class Issues {
246 242 * @return possible object is
247 243 * {@link String }
248 244 */
249   - public String getId() {
  245 + public String getId()
  246 + {
250 247 return id;
251 248 }
252 249
... ... @@ -256,7 +253,8 @@ public class Issues {
256 253 * @param value allowed object is
257 254 * {@link String }
258 255 */
259   - public void setId(String value) {
  256 + public void setId(String value)
  257 + {
260 258 this.id = value;
261 259 }
262 260
... ... @@ -296,28 +294,34 @@ public class Issues {
296 294 * </pre>
297 295 */
298 296 @XmlAccessorType(XmlAccessType.FIELD)
299   - @XmlType(name = "", propOrder = {
300   - "replies",
301   - "value"
302   - })
  297 + @XmlType(name = "", propOrder = {"replies", "value"})
303 298 public static class Comment {
304 299
305 300 protected String replies;
  301 +
306 302 protected Issues.Issue.Comment.Value value;
  303 +
307 304 @XmlAttribute
308 305 protected String id;
  306 +
309 307 @XmlAttribute
310 308 protected String author;
  309 +
311 310 @XmlAttribute
312 311 protected String issueId;
  312 +
313 313 @XmlAttribute
314 314 protected String deleted;
  315 +
315 316 @XmlAttribute
316 317 protected String text;
  318 +
317 319 @XmlAttribute
318 320 protected String shownForIssueAuthor;
  321 +
319 322 @XmlAttribute
320 323 protected String created;
  324 +
321 325 @XmlAttribute
322 326 protected String name;
323 327
... ... @@ -327,7 +331,8 @@ public class Issues {
327 331 * @return possible object is
328 332 * {@link String }
329 333 */
330   - public String getReplies() {
  334 + public String getReplies()
  335 + {
331 336 return replies;
332 337 }
333 338
... ... @@ -337,7 +342,8 @@ public class Issues {
337 342 * @param value allowed object is
338 343 * {@link String }
339 344 */
340   - public void setReplies(String value) {
  345 + public void setReplies(String value)
  346 + {
341 347 this.replies = value;
342 348 }
343 349
... ... @@ -347,7 +353,8 @@ public class Issues {
347 353 * @return possible object is
348 354 * {@link Issues.Issue.Comment.Value }
349 355 */
350   - public Issues.Issue.Comment.Value getValue() {
  356 + public Issues.Issue.Comment.Value getValue()
  357 + {
351 358 return value;
352 359 }
353 360
... ... @@ -357,7 +364,8 @@ public class Issues {
357 364 * @param value allowed object is
358 365 * {@link Issues.Issue.Comment.Value }
359 366 */
360   - public void setValue(Issues.Issue.Comment.Value value) {
  367 + public void setValue(Issues.Issue.Comment.Value value)
  368 + {
361 369 this.value = value;
362 370 }
363 371
... ... @@ -367,7 +375,8 @@ public class Issues {
367 375 * @return possible object is
368 376 * {@link String }
369 377 */
370   - public String getId() {
  378 + public String getId()
  379 + {
371 380 return id;
372 381 }
373 382
... ... @@ -377,7 +386,8 @@ public class Issues {
377 386 * @param value allowed object is
378 387 * {@link String }
379 388 */
380   - public void setId(String value) {
  389 + public void setId(String value)
  390 + {
381 391 this.id = value;
382 392 }
383 393
... ... @@ -387,7 +397,8 @@ public class Issues {
387 397 * @return possible object is
388 398 * {@link String }
389 399 */
390   - public String getAuthor() {
  400 + public String getAuthor()
  401 + {
391 402 return author;
392 403 }
393 404
... ... @@ -397,7 +408,8 @@ public class Issues {
397 408 * @param value allowed object is
398 409 * {@link String }
399 410 */
400   - public void setAuthor(String value) {
  411 + public void setAuthor(String value)
  412 + {
401 413 this.author = value;
402 414 }
403 415
... ... @@ -407,7 +419,8 @@ public class Issues {
407 419 * @return possible object is
408 420 * {@link String }
409 421 */
410   - public String getIssueId() {
  422 + public String getIssueId()
  423 + {
411 424 return issueId;
412 425 }
413 426
... ... @@ -417,7 +430,8 @@ public class Issues {
417 430 * @param value allowed object is
418 431 * {@link String }
419 432 */
420   - public void setIssueId(String value) {
  433 + public void setIssueId(String value)
  434 + {
421 435 this.issueId = value;
422 436 }
423 437
... ... @@ -427,7 +441,8 @@ public class Issues {
427 441 * @return possible object is
428 442 * {@link String }
429 443 */
430   - public String getDeleted() {
  444 + public String getDeleted()
  445 + {
431 446 return deleted;
432 447 }
433 448
... ... @@ -437,7 +452,8 @@ public class Issues {
437 452 * @param value allowed object is
438 453 * {@link String }
439 454 */
440   - public void setDeleted(String value) {
  455 + public void setDeleted(String value)
  456 + {
441 457 this.deleted = value;
442 458 }
443 459
... ... @@ -447,7 +463,8 @@ public class Issues {
447 463 * @return possible object is
448 464 * {@link String }
449 465 */
450   - public String getText() {
  466 + public String getText()
  467 + {
451 468 return text;
452 469 }
453 470
... ... @@ -457,7 +474,8 @@ public class Issues {
457 474 * @param value allowed object is
458 475 * {@link String }
459 476 */
460   - public void setText(String value) {
  477 + public void setText(String value)
  478 + {
461 479 this.text = value;
462 480 }
463 481
... ... @@ -467,7 +485,8 @@ public class Issues {
467 485 * @return possible object is
468 486 * {@link String }
469 487 */
470   - public String getShownForIssueAuthor() {
  488 + public String getShownForIssueAuthor()
  489 + {
471 490 return shownForIssueAuthor;
472 491 }
473 492
... ... @@ -477,7 +496,8 @@ public class Issues {
477 496 * @param value allowed object is
478 497 * {@link String }
479 498 */
480   - public void setShownForIssueAuthor(String value) {
  499 + public void setShownForIssueAuthor(String value)
  500 + {
481 501 this.shownForIssueAuthor = value;
482 502 }
483 503
... ... @@ -487,7 +507,8 @@ public class Issues {
487 507 * @return possible object is
488 508 * {@link String }
489 509 */
490   - public String getCreated() {
  510 + public String getCreated()
  511 + {
491 512 return created;
492 513 }
493 514
... ... @@ -497,7 +518,8 @@ public class Issues {
497 518 * @param value allowed object is
498 519 * {@link String }
499 520 */
500   - public void setCreated(String value) {
  521 + public void setCreated(String value)
  522 + {
501 523 this.created = value;
502 524 }
503 525
... ... @@ -507,7 +529,8 @@ public class Issues {
507 529 * @return possible object is
508 530 * {@link String }
509 531 */
510   - public String getName() {
  532 + public String getName()
  533 + {
511 534 return name;
512 535 }
513 536
... ... @@ -517,7 +540,8 @@ public class Issues {
517 540 * @param value allowed object is
518 541 * {@link String }
519 542 */
520   - public void setName(String value) {
  543 + public void setName(String value)
  544 + {
521 545 this.name = value;
522 546 }
523 547
... ... @@ -538,15 +562,15 @@ public class Issues {
538 562 * </pre>
539 563 */
540 564 @XmlAccessorType(XmlAccessType.FIELD)
541   - @XmlType(name = "", propOrder = {
542   - "value"
543   - })
  565 + @XmlType(name = "", propOrder = {"value"})
544 566 public static class Value {
545 567
546 568 @XmlValue
547 569 protected String value;
  570 +
548 571 @XmlAttribute
549 572 protected String type;
  573 +
550 574 @XmlAttribute
551 575 protected String role;
552 576
... ... @@ -556,7 +580,8 @@ public class Issues {
556 580 * @return possible object is
557 581 * {@link String }
558 582 */
559   - public String getValue() {
  583 + public String getValue()
  584 + {
560 585 return value;
561 586 }
562 587
... ... @@ -566,7 +591,8 @@ public class Issues {
566 591 * @param value allowed object is
567 592 * {@link String }
568 593 */
569   - public void setValue(String value) {
  594 + public void setValue(String value)
  595 + {
570 596 this.value = value;
571 597 }
572 598
... ... @@ -576,7 +602,8 @@ public class Issues {
576 602 * @return possible object is
577 603 * {@link String }
578 604 */
579   - public String getType() {
  605 + public String getType()
  606 + {
580 607 return type;
581 608 }
582 609
... ... @@ -586,7 +613,8 @@ public class Issues {
586 613 * @param value allowed object is
587 614 * {@link String }
588 615 */
589   - public void setType(String value) {
  616 + public void setType(String value)
  617 + {
590 618 this.type = value;
591 619 }
592 620
... ... @@ -596,7 +624,8 @@ public class Issues {
596 624 * @return possible object is
597 625 * {@link String }
598 626 */
599   - public String getRole() {
  627 + public String getRole()
  628 + {
600 629 return role;
601 630 }
602 631
... ... @@ -606,12 +635,11 @@ public class Issues {
606 635 * @param value allowed object is
607 636 * {@link String }
608 637 */
609   - public void setRole(String value) {
  638 + public void setRole(String value)
  639 + {
610 640 this.role = value;
611 641 }
612   -
613 642 }
614   -
615 643 }
616 644
617 645 /**
... ... @@ -642,13 +670,12 @@ public class Issues {
642 670 * </pre>
643 671 */
644 672 @XmlAccessorType(XmlAccessType.FIELD)
645   - @XmlType(name = "", propOrder = {
646   - "values"
647   - })
  673 + @XmlType(name = "", propOrder = {"values"})
648 674 public static class Field {
649 675
650 676 @XmlElement(name = "value")
651 677 protected List<Issues.Issue.Field.Value> values;
  678 +
652 679 @XmlAttribute
653 680 protected String name;
654 681
... ... @@ -672,7 +699,8 @@ public class Issues {
672 699 * Objects of the following type(s) are allowed in the list
673 700 * {@link Issues.Issue.Field.Value }
674 701 */
675   - public List<Issues.Issue.Field.Value> getValues() {
  702 + public List<Issues.Issue.Field.Value> getValues()
  703 + {
676 704 if (values == null) {
677 705 values = new ArrayList<Issues.Issue.Field.Value>();
678 706 }
... ... @@ -685,7 +713,8 @@ public class Issues {
685 713 * @return possible object is
686 714 * {@link String }
687 715 */
688   - public String getName() {
  716 + public String getName()
  717 + {
689 718 return name;
690 719 }
691 720
... ... @@ -695,7 +724,8 @@ public class Issues {
695 724 * @param value allowed object is
696 725 * {@link String }
697 726 */
698   - public void setName(String value) {
  727 + public void setName(String value)
  728 + {
699 729 this.name = value;
700 730 }
701 731
... ... @@ -716,15 +746,15 @@ public class Issues {
716 746 * </pre>
717 747 */
718 748 @XmlAccessorType(XmlAccessType.FIELD)
719   - @XmlType(name = "", propOrder = {
720   - "content"
721   - })
  749 + @XmlType(name = "", propOrder = {"content"})
722 750 public static class Value {
723 751
724 752 @XmlValue
725 753 protected String content;
  754 +
726 755 @XmlAttribute
727 756 protected String type;
  757 +
728 758 @XmlAttribute
729 759 protected String role;
730 760
... ... @@ -734,7 +764,8 @@ public class Issues {
734 764 * @return possible object is
735 765 * {@link String }
736 766 */
737   - public String getContent() {
  767 + public String getContent()
  768 + {
738 769 return content;
739 770 }
740 771
... ... @@ -744,7 +775,8 @@ public class Issues {
744 775 * @param value allowed object is
745 776 * {@link String }
746 777 */
747   - public void setContent(String value) {
  778 + public void setContent(String value)
  779 + {
748 780 this.content = value;
749 781 }
750 782
... ... @@ -754,7 +786,8 @@ public class Issues {
754 786 * @return possible object is
755 787 * {@link String }
756 788 */
757   - public String getType() {
  789 + public String getType()
  790 + {
758 791 return type;
759 792 }
760 793
... ... @@ -764,7 +797,8 @@ public class Issues {
764 797 * @param value allowed object is
765 798 * {@link String }
766 799 */
767   - public void setType(String value) {
  800 + public void setType(String value)
  801 + {
768 802 this.type = value;
769 803 }
770 804
... ... @@ -774,7 +808,8 @@ public class Issues {
774 808 * @return possible object is
775 809 * {@link String }
776 810 */
777   - public String getRole() {
  811 + public String getRole()
  812 + {
778 813 return role;
779 814 }
780 815
... ... @@ -784,14 +819,11 @@ public class Issues {
784 819 * @param value allowed object is
785 820 * {@link String }
786 821 */
787   - public void setRole(String value) {
  822 + public void setRole(String value)
  823 + {
788 824 this.role = value;
789 825 }
790   -
791 826 }
792   -
793 827 }
794   -
795 828 }
796   -
797 829 }
... ...
... ... @@ -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: 2011.12.16 at 09:34:48 AM CET
  5 +// Generated on: 2011.12.16 at 10:06:20 AM CET
6 6 //
7 7
8 8 package pl.com.it_crowd.youtrack.api.rest;
... ... @@ -28,49 +28,55 @@ public class ObjectFactory {
28 28 /**
29 29 * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: pl.com.it_crowd.youtrack.api.rest
30 30 */
31   - public ObjectFactory() {
  31 + public ObjectFactory()
  32 + {
32 33 }
33 34
34 35 /**
35   - * Create an instance of {@link Issues.Issue.Comment.Value }
  36 + * Create an instance of {@link Issues.Issue }
36 37 */
37   - public Issues.Issue.Comment.Value createIssuesIssueCommentValue() {
38   - return new Issues.Issue.Comment.Value();
  38 + public Issues.Issue createIssuesIssue()
  39 + {
  40 + return new Issues.Issue();
39 41 }
40 42
41 43 /**
42   - * Create an instance of {@link Issues.Issue.Field }
  44 + * Create an instance of {@link Issues.Issue.Comment }
43 45 */
44   - public Issues.Issue.Field createIssuesIssueField() {
45   - return new Issues.Issue.Field();
  46 + public Issues.Issue.Comment createIssuesIssueComment()
  47 + {
  48 + return new Issues.Issue.Comment();
46 49 }
47 50
48 51 /**
49 52 * Create an instance of {@link Issues }
50 53 */
51   - public Issues createIssues() {
  54 + public Issues createIssues()
  55 + {
52 56 return new Issues();
53 57 }
54 58
55 59 /**
56   - * Create an instance of {@link Issues.Issue.Field.Value }
  60 + * Create an instance of {@link Issues.Issue.Comment.Value }
57 61 */
58   - public Issues.Issue.Field.Value createIssuesIssueFieldValue() {
59   - return new Issues.Issue.Field.Value();
  62 + public Issues.Issue.Comment.Value createIssuesIssueCommentValue()
  63 + {
  64 + return new Issues.Issue.Comment.Value();
60 65 }
61 66
62 67 /**
63   - * Create an instance of {@link Issues.Issue.Comment }
  68 + * Create an instance of {@link Issues.Issue.Field.Value }
64 69 */
65   - public Issues.Issue.Comment createIssuesIssueComment() {
66   - return new Issues.Issue.Comment();
  70 + public Issues.Issue.Field.Value createIssuesIssueFieldValue()
  71 + {
  72 + return new Issues.Issue.Field.Value();
67 73 }
68 74
69 75 /**
70   - * Create an instance of {@link Issues.Issue }
  76 + * Create an instance of {@link Issues.Issue.Field }
71 77 */
72   - public Issues.Issue createIssuesIssue() {
73   - return new Issues.Issue();
  78 + public Issues.Issue.Field createIssuesIssueField()
  79 + {
  80 + return new Issues.Issue.Field();
74 81 }
75   -
76 82 }
... ...
... ... @@ -4,6 +4,7 @@ import junit.framework.Assert;
4 4 import org.apache.http.auth.AuthenticationException;
5 5 import org.junit.Test;
6 6 import pl.com.it_crowd.youtrack.api.Issue;
  7 +import pl.com.it_crowd.youtrack.api.YoutrackAPI;
7 8
8 9 import javax.xml.bind.JAXBException;
9 10 import java.io.IOException;
... ... @@ -16,14 +17,16 @@ public class YoutrackAPITest {
16 17 // -------------------------- OTHER METHODS --------------------------
17 18
18 19 @Test(expected = AuthenticationException.class)
19   - public void loginFailureTest() throws IOException, AuthenticationException {
  20 + public void loginFailureTest() throws IOException, AuthenticationException
  21 + {
20 22 final String username = "someFakeLogin";
21 23 final String password = "someFakePassword";
22 24 new YoutrackAPI("http://youtrack.it-crowd.com.pl", username, password);
23 25 }
24 26
25 27 @Test
26   - public void loginTest() throws IOException, AuthenticationException {
  28 + public void loginTest() throws IOException, AuthenticationException
  29 + {
27 30 final String username = getUsername();
28 31 final String password = getPassword();
29 32 new YoutrackAPI("http://youtrack.it-crowd.com.pl", username, password);
... ... @@ -32,7 +35,8 @@ public class YoutrackAPITest {
32 35 }
33 36
34 37 @Test
35   - public void searchIssuesByProjectTest() throws IOException, AuthenticationException, JAXBException {
  38 + public void searchIssuesByProjectTest() throws IOException, AuthenticationException, JAXBException
  39 + {
36 40 YoutrackAPI api = new YoutrackAPI("http://youtrack.it-crowd.com.pl", getUsername(), getPassword());
37 41 List<Issue> issues = api.searchIssuesByProject("SM", null);
38 42 Assert.assertTrue(!issues.isEmpty());
... ... @@ -43,11 +47,13 @@ public class YoutrackAPITest {
43 47 }
44 48 }
45 49
46   - private String getPassword() {
  50 + private String getPassword()
  51 + {
47 52 return System.getProperty("youtrackPassword");
48 53 }
49 54
50   - private String getUsername() {
  55 + private String getUsername()
  56 + {
51 57 return System.getProperty("youtrackUsername");
52 58 }
53 59 }
... ...
Please register or login to post a comment