Subversion Repositories DevTools

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
6914 dpurdie 1
package com.erggroup.buildtool.utf;
2
 
3
import static org.junit.Assert.*;
4
 
5
import org.apache.log4j.Logger;
6
import org.junit.After;
7
import org.junit.AfterClass;
8
import org.junit.Before;
9
import org.junit.BeforeClass;
10
import org.junit.Test;
11
 
12
import com.erggroup.buildtool.ripple.BuildTestResults;
13
import com.erggroup.buildtool.ripple.ReportingData;
14
 
15
public class BuildTestResultsTest
16
{
17
    Logger mLogger = Logger.getLogger(BuildTestResultsTest.class);
18
    ReportingData mReporting = new ReportingData();
19
    BuildTestResults btr;
20
 
21
    @BeforeClass
22
    public static void setUpBeforeClass() throws Exception
23
    {
24
    }
25
 
26
    @AfterClass
27
    public static void tearDownAfterClass() throws Exception
28
    {
29
    }
30
 
31
    @Before
32
    public void setUp() throws Exception
33
    {
34
 
35
    }
36
 
37
    @After
38
    public void tearDown() throws Exception
39
    {
40
    }
41
 
42
    @Test
43
    public void nonExistDirectory()
44
    {
45
        btr = new BuildTestResults("WillNotExist", mReporting, mLogger);
46
        assertFalse("Did not detect bad directory", btr.mResultsFound);
47
    }
48
 
49
    @Test
50
    public void basicTests()
51
    {
52
        mReporting.packageName = "buildTests";
53
        mReporting.packageVersion = "Test1" ;
54
        System.out.println("Working Directory = " + System.getProperty("user.dir"));
55
        btr = new BuildTestResults("work", mReporting, mLogger);
56
 
57
        assertTrue("Did not find files in directory", btr.mResultsFound);
58
 
59
        //System.out.println("Test count:" + btr.mTestResults.size());
60
        assertTrue("Incorrect number of tests found", btr.mTestResults.size() == 8);
61
 
62
        BuildTestResults.testResultData data =  btr.mTestResults.get(1);
63
        assertTrue("Bad Target", data.platform.equals("TARGET1"));
64
        assertTrue("Bad Duration", data.duration == 2000);
65
 
66
    }
67
 
68
}