Package de.cesr.parma.tests

Source Code of de.cesr.parma.tests.TestXmlParameterReader

package de.cesr.parma.tests;

import static org.junit.Assert.*;

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

import de.cesr.parma.core.PmParameterManager;
import de.cesr.parma.definition.PmFrameworkPa;
import de.cesr.parma.reader.PmXmlParameterReader;

/**
* ParMa
*
* @author Sascha Holzhauer
* @date 20.05.2011
*
*/
public class TestXmlParameterReader {

  /**
   * @throws Exception
   * Created by Sascha Holzhauer on 20.05.2011
   */
  @Before
  public void setUp() throws Exception {
    PmParameterManager.reset();
    PmParameterManager.registerReader(new PmXmlParameterReader());
    PmParameterManager.setParameter(PmFrameworkPa.XML_PARAMETER_FILE, "./src/de/cesr/parma/tests/res/TestParameter.xml");
  }

  /**
   * @throws Exception
   * Created by Sascha Holzhauer on 20.05.2011
   */
  @After
  public void tearDown() throws Exception {
  }

  /**
   *
   * Created by Sascha Holzhauer on 20.05.2011
   */
  @Test
  public final void testInitParameters() {
    assertEquals("", 10, ((Integer)PmParameterManager.getParameter(PmBasicPa.NUM_AGENTS)).intValue());
    PmParameterManager.init();
    assertEquals("", 100, ((Integer) PmParameterManager.getParameter(PmBasicPa.NUM_AGENTS)).intValue());
  }

}
TOP

Related Classes of de.cesr.parma.tests.TestXmlParameterReader

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.