@Test
 public void testIsNbRepositoryRepo() {
   assertFalse(
       BugtrackingUtil.isNbRepository(
           TestKit.getRepository(new BUTestRepository("enembenem")).getUrl()));
   assertTrue(BugtrackingUtil.isNbRepository("https://netbeans.org/bugzilla"));
 }
Пример #2
0
  private IssueCache<DummyIssue, Object> getCache() {
    IssueCache.IssueAccessor ia =
        new IssueCache.IssueAccessor() {

          @Override
          public String getID(Object issueData) {
            throw new UnsupportedOperationException("Not supported yet.");
          }

          @Override
          public Object createIssue(Object issueData) {
            throw new UnsupportedOperationException("Not supported yet.");
          }

          @Override
          public void setIssueData(Object issue, Object issueData) {
            throw new UnsupportedOperationException("Not supported yet.");
          }

          @Override
          public Map getAttributes(Object issue) {
            throw new UnsupportedOperationException("Not supported yet.");
          }

          @Override
          public String getRecentChanges(Object issue) {
            throw new UnsupportedOperationException("Not supported yet.");
          }

          @Override
          public long getLastModified(Object issue) {
            throw new UnsupportedOperationException("Not supported yet.");
          }

          @Override
          public long getCreated(Object issue) {
            throw new UnsupportedOperationException("Not supported yet.");
          }
        };
    RepositoryImpl impl =
        TestKit.getRepository(new DummyRepository(DummyBugtrackingConnector.instance, "dummy"));
    return new IssueCache<DummyIssue, Object>("dummy", ia, null, impl.getRepository());
  }
 @Test(expected = NullPointerException.class)
 public void testIsNbRepositoryRepoNullUrl() {
   assertFalse(
       BugtrackingUtil.isNbRepository(TestKit.getRepository(new BUTestRepository(null)).getUrl()));
 }
 @Test(expected = NullPointerException.class)
 public void testIsNbRepositoryNullRepo() {
   BUTestRepository repo = null;
   assertFalse(BugtrackingUtil.isNbRepository(TestKit.getRepository(repo).getUrl()));
 }