01: // $Id: ProviderTest.java,v 1.2 2004/05/12 17:26:51 anicoara Exp $
02: // =====================================================================
03: //
04: // (history at end)
05: //
06:
07: package ch.ethz.prose;
08:
09: // used packages
10: import junit.framework.*;
11: import ch.ethz.jvmai.JVMAspectInterface;
12: import ch.ethz.jvmai.Provider;
13:
14: /**
15: * JUnit testcase for class JikesRVMProvider.
16: *
17: * @version $Revision: 1.2 $
18: * @author Stephan Markwalder
19: */
20: public class ProviderTest extends TestCase {
21:
22: /**
23: * Construct test with given name.
24: * @param name test name
25: */
26: public ProviderTest(String name) {
27: super (name);
28: }
29:
30: /**
31: * Set up fixture.
32: */
33: protected void setUp() {
34: }
35:
36: public void testProvider() {
37: String providerClassName = System
38: .getProperty("ch.ethz.prose.JVMAIProvider");
39: if (providerClassName == null)
40: throw new Error(
41: "system-property 'ch.ethz.prose.JVMAIProvider' not set!");
42: Provider provider = null;
43: try {
44: Class providerClass = Class.forName(providerClassName);
45: provider = (Provider) providerClass.newInstance();
46: } catch (Exception e) {
47: provider = null;
48: }
49: assertTrue("provider works with the current virtual machine",
50: provider != null);
51: JVMAspectInterface aspectInterface = provider
52: .getAspectInterface();
53: assertTrue("aspcet-interface is not null",
54: aspectInterface != null);
55: }
56:
57: /**
58: * Test suite.
59: * @return test instance
60: */
61: public static Test suite() {
62: return new TestSuite(ProviderTest.class);
63: }
64:
65: }
66:
67: //======================================================================
68: //
69: // $Log: ProviderTest.java,v $
70: // Revision 1.2 2004/05/12 17:26:51 anicoara
71: // Adapt Junit tests to 3.8.1 version and the new package structure
72: //
73: // Revision 1.1.1.1 2003/07/02 15:30:42 apopovic
74: // Imported from ETH Zurich
75: //
76: // Revision 1.1 2003/05/05 14:02:31 popovici
77: // renaming from runes to prose
78: //
79: // Revision 1.2 2003/03/04 18:36:08 popovici
80: // Organization of imprts
81: //
82: // Revision 1.1 2003/03/04 12:10:28 popovici
83: // Moved from inf/jvmai (whitebox location) to inf/runes/ (bb location)
84: //
85: // Revision 1.3 2002/02/19 11:28:19 smarkwal
86: // Error is thrown if system-property specifying the provider is not set
87: //
88: // Revision 1.2 2002/02/15 12:27:46 smarkwal
89: // doesn't rely anymore on Provider.getProvider(...)
90: //
91: // Revision 1.1 2002/02/05 11:13:22 smarkwal
92: // Initial revision
93: //
94: //
|