test_class.declarator: tavern = new Tavern()
test_class.modifier: private
test_class.original_string: private Tavern tavern = new Tavern();
test_class.type: Tavern
test_class.var_name: tavern
test_class.file: tavern-core/src/test/java/com/dianping/tavern/TavernTest.java
test_class.identifier: TavernTest
test_case.body: @Test
  	public void testInit() throws IOException {
          MockServletContext servletContext = new MockServletContext();
          tavern.addPlugin(new SpringTavernPlugin());
          servletContext.addInitParameter("contextConfigLocation","classpath*:spring/appcontext-*.xml");
          tavern.setServletContext(servletContext);
  		tavern.init();
          tavern.resolve();
          Application currentApplication = Tavern.getCurrentApplication(getClass());
          TestBean bean = currentApplication.getBean("testBean");
          assertNotNull(bean);
          bean = currentApplication.getBean(TestBean.class);
          assertNotNull(bean);
      }
test_case.class_method_signature: TavernTest.testInit()
test_case.full_signature: @Test public void testInit()
test_case.identifier: testInit
test_case.invocations: addPlugin addInitParameter setServletContext init resolve getCurrentApplication getClass getBean assertNotNull getBean assertNotNull
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testInit()
focal_class.declarator: plugins = new ArrayList<TavernPlugin>()
focal_class.modifier: private static
focal_class.original_string: private static List<TavernPlugin> plugins = new ArrayList<TavernPlugin>();
focal_class.type: List<TavernPlugin>
focal_class.var_name: plugins
focal_class.declarator: pluginClazzSet = new HashSet<Class<?>>()
focal_class.modifier: private static
focal_class.original_string: private static Set<Class<?>> pluginClazzSet = new HashSet<Class<?>>();
focal_class.type: Set<Class<?>>
focal_class.var_name: pluginClazzSet
focal_class.declarator: GLOBAL_APPLICATION = "_global"
focal_class.modifier: public static final
focal_class.original_string: public static final String GLOBAL_APPLICATION = "_global";
focal_class.type: String
focal_class.var_name: GLOBAL_APPLICATION
focal_class.declarator: tavernApplicationContainer = TavernApplicationContainer.getInstance()
focal_class.modifier: private
focal_class.original_string: private TavernApplicationContainer tavernApplicationContainer = TavernApplicationContainer.getInstance();
focal_class.type: TavernApplicationContainer
focal_class.var_name: tavernApplicationContainer
focal_class.declarator: applicationList = new ArrayList<Application>()
focal_class.modifier: private
focal_class.original_string: private List<Application> applicationList = new ArrayList<Application>();
focal_class.type: List<Application>
focal_class.var_name: applicationList
focal_class.declarator: parser = getParser()
focal_class.modifier: private
focal_class.original_string: private ApplicationConfigParser parser = getParser();
focal_class.type: ApplicationConfigParser
focal_class.var_name: parser
focal_class.declarator: servletContext
focal_class.modifier: private
focal_class.original_string: private ServletContext servletContext;
focal_class.type: ServletContext
focal_class.var_name: servletContext
focal_class.file: tavern-core/src/main/java/com/dianping/tavern/Tavern.java
focal_class.identifier: Tavern
focal_class.class_method_signature: Tavern.contexts()
focal_class.full_signature: public static TavernApplicationContainer contexts()
focal_class.identifier: contexts
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: TavernApplicationContainer
focal_class.signature: TavernApplicationContainer contexts()
focal_class.class_method_signature: Tavern.getCurrentApplication(Class<?> clazz)
focal_class.full_signature: public static Application getCurrentApplication(Class<?> clazz)
focal_class.identifier: getCurrentApplication
focal_class.modifiers: public static
focal_class.parameters: (Class<?> clazz)
focal_class.return: Application
focal_class.signature: Application getCurrentApplication(Class<?> clazz)
focal_class.class_method_signature: Tavern.getCurrentApplication(String clazzName)
focal_class.full_signature: public static Application getCurrentApplication(String clazzName)
focal_class.identifier: getCurrentApplication
focal_class.modifiers: public static
focal_class.parameters: (String clazzName)
focal_class.return: Application
focal_class.signature: Application getCurrentApplication(String clazzName)
focal_class.class_method_signature: Tavern.getRoottApplication()
focal_class.full_signature: public static Application getRoottApplication()
focal_class.identifier: getRoottApplication
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: Application
focal_class.signature: Application getRoottApplication()
focal_class.class_method_signature: Tavern.init()
focal_class.full_signature: public void init()
focal_class.identifier: init
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void init()
focal_class.class_method_signature: Tavern.run()
focal_class.full_signature: public void run()
focal_class.identifier: run
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void run()
focal_class.class_method_signature: Tavern.resolve()
focal_class.full_signature: public void resolve()
focal_class.identifier: resolve
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void resolve()
focal_class.class_method_signature: Tavern.destroy()
focal_class.full_signature: public void destroy()
focal_class.identifier: destroy
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void destroy()
focal_class.class_method_signature: Tavern.addPlugin(TavernPlugin plugin)
focal_class.full_signature: public static void addPlugin(TavernPlugin plugin)
focal_class.identifier: addPlugin
focal_class.modifiers: public static
focal_class.parameters: (TavernPlugin plugin)
focal_class.return: void
focal_class.signature: void addPlugin(TavernPlugin plugin)
focal_class.class_method_signature: Tavern.getParser()
focal_class.full_signature: protected ApplicationConfigParser getParser()
focal_class.identifier: getParser
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: ApplicationConfigParser
focal_class.signature: ApplicationConfigParser getParser()
focal_class.class_method_signature: Tavern.setServletContext(ServletContext servletContext)
focal_class.full_signature: public void setServletContext(ServletContext servletContext)
focal_class.identifier: setServletContext
focal_class.modifiers: public
focal_class.parameters: (ServletContext servletContext)
focal_class.return: void
focal_class.signature: void setServletContext(ServletContext servletContext)
focal_method.body: public void init() throws IOException {
          Enumeration<URL> resources = getClass().getClassLoader().getResources("app.xml");
          while (resources.hasMoreElements()) {
              URL url = resources.nextElement();
              URLConnection urlConnection = url.openConnection();
              urlConnection.connect();
              ApplicationConfig config = parser.parse(urlConnection.getInputStream());
              Assert.notNull(config.getName(), "Name of application must not be null!");
              Application application = new Application(config, ResourceUtils.extractJarFileURL(url).toString());
              tavernApplicationContainer.register(application);
              applicationList.add(application);
          }
          ApplicationConfig globalConfig = new ApplicationConfig();
          globalConfig.setName(GLOBAL_APPLICATION);
          Application globalApplication = new Application(globalConfig, null);
          globalApplication.setRoot(true);
          tavernApplicationContainer.register(globalApplication);
          applicationList.add(globalApplication);
          for (Application application : applicationList) {
              PluginContext pluginContext = new PluginContext(application, tavernApplicationContainer, servletContext);
              for (TavernPlugin plugin : plugins) {
                  plugin.init(pluginContext);
              }
          }
      }
focal_method.class_method_signature: Tavern.init()
focal_method.full_signature: public void init()
focal_method.identifier: init
focal_method.invocations: getResources getClassLoader getClass hasMoreElements nextElement openConnection connect parse getInputStream notNull getName toString extractJarFileURL register add setName setRoot register add init
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void init()