KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ch > ethz > prose > ProviderTest


1 // $Id: ProviderTest.java,v 1.2 2004/05/12 17:26:51 anicoara Exp $
2
// =====================================================================
3
//
4
// (history at end)
5
//
6

7 package ch.ethz.prose;
8
9 // 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
21 class ProviderTest extends TestCase {
22
23   /**
24    * Construct test with given name.
25    * @param name test name
26    */

27   public ProviderTest(String JavaDoc name)
28   {
29     super(name);
30   }
31
32
33   /**
34    * Set up fixture.
35    */

36   protected
37   void setUp()
38   {
39   }
40
41   public void testProvider()
42   {
43     String JavaDoc providerClassName = System.getProperty("ch.ethz.prose.JVMAIProvider");
44     if(providerClassName==null) throw new Error JavaDoc("system-property 'ch.ethz.prose.JVMAIProvider' not set!");
45     Provider provider = null;
46     try{
47       Class JavaDoc providerClass = Class.forName(providerClassName);
48       provider = (Provider)providerClass.newInstance();
49     } catch (Exception JavaDoc e) {
50       provider = null;
51     }
52     assertTrue("provider works with the current virtual machine",provider!=null);
53     JVMAspectInterface aspectInterface = provider.getAspectInterface();
54     assertTrue("aspcet-interface is not null",aspectInterface!=null);
55   }
56
57
58   /**
59    * Test suite.
60    * @return test instance
61    */

62   public static
63   Test suite()
64   {
65     return new TestSuite(ProviderTest.class);
66   }
67
68 }
69
70
71 //======================================================================
72
//
73
// $Log: ProviderTest.java,v $
74
// Revision 1.2 2004/05/12 17:26:51 anicoara
75
// Adapt Junit tests to 3.8.1 version and the new package structure
76
//
77
// Revision 1.1.1.1 2003/07/02 15:30:42 apopovic
78
// Imported from ETH Zurich
79
//
80
// Revision 1.1 2003/05/05 14:02:31 popovici
81
// renaming from runes to prose
82
//
83
// Revision 1.2 2003/03/04 18:36:08 popovici
84
// Organization of imprts
85
//
86
// Revision 1.1 2003/03/04 12:10:28 popovici
87
// Moved from inf/jvmai (whitebox location) to inf/runes/ (bb location)
88
//
89
// Revision 1.3 2002/02/19 11:28:19 smarkwal
90
// Error is thrown if system-property specifying the provider is not set
91
//
92
// Revision 1.2 2002/02/15 12:27:46 smarkwal
93
// doesn't rely anymore on Provider.getProvider(...)
94
//
95
// Revision 1.1 2002/02/05 11:13:22 smarkwal
96
// Initial revision
97
//
98
//
99
Popular Tags