1 22 package org.jboss.test.tm.mbean; 23 24 import org.jboss.system.ServiceMBeanSupport; 25 import org.jboss.test.tm.resource.Operation; 26 import org.jboss.util.NestedException; 27 28 34 public class TMTest 35 extends ServiceMBeanSupport 36 implements TMTestMBean 37 { 38 public void testOperations(String test, Operation[] ops) throws Exception 39 { 40 log.info("Starting test " + test); 41 Operation.start(log); 42 int i = 0; 43 try 44 { 45 for (;i < ops.length; ++i) 46 ops[i].perform(); 47 } 48 catch (Exception e) 49 { 50 throw new NestedException(test + " operation " + i, e); 51 } 52 finally 53 { 54 log.info("Finished test " + test); 55 try 56 { 57 Operation.end(); 58 } 59 finally 60 { 61 Operation.tidyUp(); 62 } 63 } 64 } 65 } 66 | Popular Tags |