Subversion Repositories DevTools

Rev

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