Examples of GHIssue


Examples of org.kohsuke.github.GHIssue

      if (annotation == null) {
        return Status.NOT_TRACKING;
      }
      GitHub gitHub = GitHub.connect();
      GHRepository repository = gitHub.getRepository(annotation.repository());
      GHIssue issue = repository.getIssue(annotation.issue());
      if (issue != null && issue.getState() == GHIssueState.OPEN) {
        return Status.OPEN;
      } else {
        return Status.CLOSED;
      }
    } catch (FileNotFoundException e) {
View Full Code Here

Examples of org.kohsuke.github.GHIssue

  @Mock
  private GhprbPullRequest pr;

  @Test
  public void testCheckSkipBuild() throws NoSuchFieldException, SecurityException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
    GHIssue issue = mock(GHIssue.class);
   
    String[] comments = {"Some dumb comment\r\nThat shouldn't match", "[skip ci]"};
    String[] phraseArray = {"\\[skip\\W+ci\\]", "skip ci"};

    Method checkSkip = GhprbPullRequest.class.getDeclaredMethod("checkSkipBuild", GHIssue.class);
    checkSkip.setAccessible(true);
   
    Field shouldRun = GhprbPullRequest.class.getDeclaredField("shouldRun");
    shouldRun.setAccessible(true);
   
    for (String phraseString : phraseArray) {
      for (String comment : comments) {
       
        Set<String> phrases = new HashSet<String>(Arrays.asList(phraseString.split("[\\r\\n]+")));
        given(issue.getBody()).willReturn(comment);
        given(pr.getSkipBuildPhrases()).willReturn(phrases);
        boolean isMatch = false;
        for (String phrase : phrases) {
          isMatch = Pattern.matches(phrase, comment);
          if (isMatch) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.