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

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

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.container.IssueCategories;
import net.sf.redmine_mylyn.internal.api.IssueCategoryValidator;

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

public class IssueCategoryParserTest {

  InputStream input;
  AttributeParser<IssueCategories> testee;
 
  @Before
  public void setUp() throws Exception {
    input = getClass().getResourceAsStream(IssueCategoryValidator.RESOURCE_FILE);
    testee = new  AttributeParser<IssueCategories>(IssueCategories.class);
  }
 
  @After
  public void tearDown() throws Exception {
    input.close();
  }

  @Test
  public void testParseResponse() throws Exception {
    IssueCategories categories = testee.parseResponse(input, HttpStatus.SC_OK);
   
    assertNotNull(categories);
    assertEquals(IssueCategoryValidator.COUNT, categories.getAll().size());
   
    IssueCategoryValidator.validate3(categories.getById(3));
  }

}
TOP

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

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.