Package net.sf.redmine_mylyn.internal.api.parser

Source Code of net.sf.redmine_mylyn.internal.api.parser.IssuesParserTest

package net.sf.redmine_mylyn.internal.api.parser;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

import java.io.InputStream;

import net.sf.redmine_mylyn.api.model.Configuration;
import net.sf.redmine_mylyn.internal.api.PartialIssueValidator;
import net.sf.redmine_mylyn.internal.api.parser.adapter.type.Issues;
import net.sf.redmine_mylyn.internal.api.parser.mock.ConfigurationMock;

import org.apache.commons.httpclient.HttpStatus;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class IssuesParserTest {

  InputStream input;
  IssuesParser testee;
 
  @Before
  public void setUp() throws Exception {
    input = getClass().getResourceAsStream(PartialIssueValidator.RESOURCE_FILE);
    Configuration conf = new ConfigurationMock();
    testee = new IssuesParser(conf);
  }

  @After
  public void tearDown() throws Exception {
    input.close();
  }

  @Test
  public void testParseResponse() throws Exception {
    Issues ct = testee.parseResponse(input, HttpStatus.SC_OK);
   
    assertNotNull(ct);
    assertNotNull(ct.getAll());
    assertEquals(PartialIssueValidator.COUNT, ct.getAll().size());
   
    PartialIssueValidator.validate1(ct.getAll().get(5));
  }
 
}
TOP

Related Classes of net.sf.redmine_mylyn.internal.api.parser.IssuesParserTest

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.