summaryrefslogtreecommitdiff
path: root/platform/structuralsearch/testData/java/after1.java
blob: 156cc38f997ac1e592d303739990329eac16f77a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
 * Created on Jan 30, 2004
 *
 */
package somepackage;

/**
 * Title: ForecastSummaryReportTest
 */
public class ForecastSummaryReportTest extends SOTestCase {

    ForecastSummaryReport oReport = null;
    ScheduleGroupData oSkdgrp = null;
    SODate oStart = null;
    SODate oEnd = null;
    SODateInterval oDateRange = null;


    /**
     * Constructor for ForecastSummaryReportTest.
     *
     * @param arg0
     */
    public ForecastSummaryReportTest(String arg0) {
        super(arg0);
    }

    public static void main(String[] args) {
        junit.textui.TestRunner.run(ForecastSummaryReportTest.class);
    }

    /*
     * @see TestCase#setUp()
     */
    protected void setUp() throws Exception {
        super.setUp();
        try {
            oSkdgrp = ScheduleGroupData.getScheduleGroupData(new Integer(1001));
            oDateRange = new SODateInterval(new SODate("01/23/2004"), new SODate("01/30/2004"));
            oReport = new ForecastSummaryReport(oSkdgrp.getCorporateEntity(), oDateRange);
        } catch (Exception e) {
            System.out.println("Unhandled exception in Setup:" + e);
            fail();
        }

    }

    /*
     * @see TestCase#tearDown()
     */
    protected void tearDown() throws Exception {
        super.tearDown();
        oReport = null;
    }

    public void testForecastSummaryReport() {
        try {
            ForecastSummaryReport testReport = new ForecastSummaryReport(oSkdgrp.getCorporateEntity(), oDateRange);
            assertNotNull(testReport);
        } catch (RetailException e) {
            e.printStackTrace();
            fail("RetailException: Could not create ForecastSummaryReport(CorporateEntity, SODateInterval)");
        }
    }

    public void testSetIncludeSublocationsFlag() {
        oReport.setIncludeSublocationsFlag(true);
        assertTrue(oReport.isIncludeSublocationsFlagSet());
    }

    public void testIsIncludeSublocationsFlagSet() {
        oReport.setIncludeSublocationsFlag(false);
        assertFalse(oReport.isIncludeSublocationsFlagSet());
        oReport.setIncludeSublocationsFlag(true);
        assertTrue(oReport.isIncludeSublocationsFlagSet());
    }

    public void testRefresh() throws RetailException {
        oReport.refresh();
        assertNotNull(oReport);
    }
}