1 7 package ch.ethz.prose; 8 9 import junit.framework.*; 11 import ch.ethz.jvmai.JVMAspectInterface; 12 import ch.ethz.jvmai.Provider; 13 14 20 public 21 class ProviderTest extends TestCase { 22 23 27 public ProviderTest(String name) 28 { 29 super(name); 30 } 31 32 33 36 protected 37 void setUp() 38 { 39 } 40 41 public void testProvider() 42 { 43 String providerClassName = System.getProperty("ch.ethz.prose.JVMAIProvider"); 44 if(providerClassName==null) throw new Error ("system-property 'ch.ethz.prose.JVMAIProvider' not set!"); 45 Provider provider = null; 46 try{ 47 Class providerClass = Class.forName(providerClassName); 48 provider = (Provider)providerClass.newInstance(); 49 } catch (Exception 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 62 public static 63 Test suite() 64 { 65 return new TestSuite(ProviderTest.class); 66 } 67 68 } 69 70 71 | Popular Tags |