### Question:
ScriptingServiceImpl extends AbstractService implements
		ScriptingService { @Override public synchronized List<ScriptContext> load(File scriptDescriptor) throws Exception { Preconditions.checkNotNull(scriptDescriptor, "scriptDescriptor"); final JAXBContext c = JAXBContext.newInstance(ScriptInfo.class, ScriptList.class); final Unmarshaller u = c.createUnmarshaller(); final ScriptList list = (ScriptList) u.unmarshal(scriptDescriptor); final List<ScriptContext> contexts = CollectionFactory.newList(); for (ScriptInfo si : list.getScriptInfos()) { final ScriptContext context = createContext(si, null); if (context != null) { this.contexts.add(context); context.init(); contexts.add(context); } } return contexts; } @Inject  ScriptingServiceImpl(Injector injector); @Override synchronized List<ScriptContext> load(File scriptDescriptor); @Override synchronized Collection<ScriptContext> getScriptContexts(); @Override void reload();  }### Answer:
@Test public void testLoading() throws Exception { final List<ScriptContext> contexts = service.load(new File( "src/test/resources/scripting/testcase.xml")); Assert.assertEquals(1, contexts.size()); }
@Test public void testCreatingInstance() throws Exception { final List<ScriptContext> contexts = service.load(new File( "src/test/resources/scripting/testcase.xml")); Assert.assertEquals(1, contexts.size()); final ScriptContext context = contexts.get(0); Class<?> clazz = context.getClassLoader().loadClass( "test.ScriptingCompilerTest"); Assert.assertNotNull(clazz.newInstance()); Assert.assertNotNull(clazz); Assert.assertEquals("test.ScriptingCompilerTest", clazz.getName()); }