Package pymontecarlo.program.nistmonte.options.detector

Source Code of pymontecarlo.program.nistmonte.options.detector.TimeDetectorTest

package pymontecarlo.program.nistmonte.options.detector;

import static org.junit.Assert.assertEquals;
import gov.nist.microanalysis.NISTMonte.MonteCarloSS;

import java.io.File;
import java.io.IOException;
import java.util.Properties;


import org.junit.Before;
import org.junit.Test;

import pymontecarlo.util.TestCase;
import pymontecarlo.util.hdf5.HDF5FileWriter;
import pymontecarlo.util.hdf5.HDF5Group;

public class TimeDetectorTest extends TestCase {

    private TimeDetector det;

    private File resultsFile;



    @Before
    public void setUp() throws Exception {
        det = new TimeDetector();
        resultsFile = createTempFile("h5");

        MonteCarloSS mcss = getMonteCarloSS();
        det.setup(mcss);

        mcss.runTrajectory();
    }



    @Test
    public void testSaveResults() throws Exception {
        HDF5Group root = HDF5Group.createRoot();
        det.saveResults(root, "det1");
        HDF5FileWriter.write(root, resultsFile, true);
    }



    @Test
    public void testCreateLog() throws IOException {
        Properties props = new Properties();
        det.createLog(props);
        assertEquals(0, props.size());
    }

}
TOP

Related Classes of pymontecarlo.program.nistmonte.options.detector.TimeDetectorTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.