Package gov.nysenate.openleg.tests

Source Code of gov.nysenate.openleg.tests.TestSetup

package gov.nysenate.openleg.tests;

import gov.nysenate.openleg.Environment;
import gov.nysenate.openleg.util.Storage;

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

import org.junit.*;

public abstract class TestSetup
{
  protected static Environment env;
  protected static File sobiDirectory;
  protected static Storage storage;

  @BeforeClass
  public static void initalSetup()
  {
    loadProperties();
    sobiDirectory = new File("src/test/resources/sobi");
   
    storage = new Storage(env.getStorageDirectory());
  }

  @Before
  public void setup()
  {
    try {
      env.reset();
    }
    catch (IOException e) {
      e.printStackTrace();
    }
  }
 
  private static void loadProperties()
  {
    Properties prop = new Properties();
      try {
        prop.load(new FileInputStream("src/test/resources/properties"));
        env = new Environment(prop.getProperty("environment"));
      }
      catch (IOException ex) {
        ex.printStackTrace();
        }
  }
}
TOP

Related Classes of gov.nysenate.openleg.tests.TestSetup

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.