001    /******************************************************************************
002     * Copyright (C) MActor Developers. All rights reserved.                        *
003     * ---------------------------------------------------------------------------*
004     * This file is part of MActor.                                               *
005     *                                                                            *
006     * MActor is free software; you can redistribute it and/or modify             *
007     * it under the terms of the GNU General Public License as published by       *
008     * the Free Software Foundation; either version 2 of the License, or          *
009     * (at your option) any later version.                                        *
010     *                                                                            *
011     * MActor is distributed in the hope that it will be useful,                  *
012     * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
013     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
014     * GNU General Public License for more details.                               *
015     *                                                                            *
016     * You should have received a copy of the GNU General Public License          *
017     * along with MActor; if not, write to the Free Software                      *
018     * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA *
019     ******************************************************************************/
020    package org.mactor.ui.gui.testrunner;
021    
022    import java.util.LinkedList;
023    
024    import org.mactor.framework.TestContext;
025    import org.mactor.framework.TestEvent;
026    import org.mactor.framework.TestSummary_old;
027    
028    public class TestProgressInfo {
029            private TestContext contex;
030            private LinkedList<TestEvent> log = new LinkedList<TestEvent>();
031            private TestSummary_old testSummary = null;
032            public TestProgressInfo(TestContext contex) {
033                    super();
034                    this.contex = contex;
035            }
036            public boolean addEvent(TestEvent event) {
037                    log.add(event);
038                    if (event.isTestCompleteEvent()) {
039                            testSummary = TestSummary_old.create(this.contex, log);
040                            this.log = null;
041                            this.contex = null;
042                            return true;
043                    }
044                    return false;
045            }
046            public boolean hasTestSummary() {
047                    return testSummary != null;
048            }
049            public LinkedList<TestEvent> getLog() {
050                    return log;
051            }
052            public TestSummary_old getTestSummary() {
053                    return testSummary;
054            }
055            public TestContext getContex() {
056                    return contex;
057            }
058    }