@Override public synchronized void start(StartContext context) throws StartException { serviceTarget = context.getChildTarget(); arqService.registerArquillianConfig(this); for (String testClass : testClasses) { ServiceTargetAssociation.setServiceTarget(testClass, serviceTarget); } }
@Override public synchronized void stop(StopContext context) { context.getController().setMode(Mode.REMOVE); arqService.unregisterArquillianConfig(this); for (String testClass : testClasses) { ServiceTargetAssociation.clearServiceTarget(testClass); } }
Class<?> loadClass(String className) throws ClassNotFoundException { if (testClasses.contains(className) == false) throw new ClassNotFoundException("Class '" + className + "' not found in: " + testClasses); Module module = depUnit.getAttachment(Attachments.MODULE); BundleAssociation.setBundle(getAssociatedBundle(module)); Class<?> testClass = module.getClassLoader().loadClass(className); ServiceTargetAssociation.setServiceTarget(serviceTarget); return testClass; }