Package ch.ethz.prose

Source Code of ch.ethz.prose.ProviderTest

// $Id: ProviderTest.java,v 1.4 2008/11/18 10:33:25 anicoara Exp $
// =====================================================================

package ch.ethz.prose;

// used packages
import junit.framework.*;
import ch.ethz.jvmai.JVMAspectInterface;
import ch.ethz.jvmai.Provider;

/**
* JUnit testcase for class JikesRVMProvider.
*
* @version $Revision: 1.4 $
* @author  Stephan Markwalder
*/
public class ProviderTest extends TestCase {
 
  /**
   * Construct test with given name.
   * @param name test name
   */
  public ProviderTest(String name) {
    super(name);
  }
 
  /**
   * Set up fixture.
   */
  protected void setUp() { }
 
  public void testProvider() {
    String providerClassName = System.getProperty("ch.ethz.prose.JVMAIProvider");
    if(providerClassName==null) throw new Error("system-property 'ch.ethz.prose.JVMAIProvider' not set!");
    Provider provider = null;
    try{
      Class providerClass = Class.forName(providerClassName);
      provider = (Provider)providerClass.newInstance();
    } catch (Exception e) {
      provider = null;
    }
    assertTrue("provider works with the current virtual machine",provider!=null);
    JVMAspectInterface aspectInterface = provider.getAspectInterface();
    assertTrue("aspcet-interface is not null",aspectInterface!=null);
  }
 
  /**
   * Test suite.
   * @return test instance
   */
  public static Test suite() {
    return new TestSuite(ProviderTest.class);
  }
 
}
TOP

Related Classes of ch.ethz.prose.ProviderTest

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.