Subversion Repositories DevTools

Rev

Rev 7033 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

package com.erggroup.buildtool.utf;

import static org.junit.Assert.*;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import com.erggroup.buildtool.ripple.BuildTestResults;
import com.erggroup.buildtool.ripple.ReportingData;

public class BuildTestResultsTest
{
    Logger mLogger = LoggerFactory.getLogger(BuildTestResultsTest.class);
    ReportingData mReporting = new ReportingData();
    BuildTestResults btr;
    
    @BeforeClass
    public static void setUpBeforeClass() throws Exception
    {
    }

    @AfterClass
    public static void tearDownAfterClass() throws Exception
    {
    }

    @Before
    public void setUp() throws Exception
    {
        
    }

    @After
    public void tearDown() throws Exception
    {
    }

    @Test
    public void nonExistDirectory()
    {
        btr = new BuildTestResults("WillNotExist", mReporting, mLogger);
        assertFalse("Did not detect bad directory", btr.mResultsFound);
    }
    
    @Test
    public void basicTests()
    {
        mReporting.packageName = "buildTests";
        mReporting.packageVersion = "Test1" ;
        System.out.println("Working Directory = " + System.getProperty("user.dir"));
        btr = new BuildTestResults("work", mReporting, mLogger);

        assertTrue("Did not find files in directory", btr.mResultsFound);
        
        //System.out.println("Test count:" + btr.mTestResults.size());
        assertTrue("Incorrect number of tests found", btr.mTestResults.size() == 8);

        BuildTestResults.testResultData data =  btr.mTestResults.get(1);
        assertTrue("Bad Target", data.platform.equals("TARGET1"));
        assertTrue("Bad Duration", data.duration == 2000);

    }

}