AsgardBundle { public String getBundleName() { return bundleName; } AsgardBundle(BundleConfiguration bundleConfiguration, ClassLoader parentClassLoader); synchronized void init(); Class<?> getSharedClass(String classFullName); String getBundleName(); BundleService getBundleService(); AsgardClassLoader getBundleClassLoader(); static final String PARAM_ERROR_NAME; }
@Test public void test_INIT_bundle() throws Exception { String bundleFileName = "/sample-auth-bundle1-2048-SNAPSHOT-release.zip"; URL url = AsgardBundleTest.class.getResource(bundleFileName); String moduleName = StringUtils.substringBeforeLast("sample-auth-bundle1-2048-SNAPSHOT-release.zip", ".zip"); String bundleExtractPath = BUNDLE_TEST_PATH + moduleName + "/"; AsgardBundle asgardBundle = initBundle(url.getFile()).getBundle(); assertThat(asgardBundle.getBundleName()).isEqualTo("sample-auth-bundle1-2048-SNAPSHOT-release"); File extractPath = new File(bundleExtractPath); assertThat(extractPath.exists()).isTrue(); File bundleClassPath = new File(bundleExtractPath + "BUNDLE-CLASS"); assertThat(bundleClassPath.exists() && bundleClassPath.isDirectory()).isTrue(); File bundleJarPath = new File(bundleExtractPath + "lib"); assertThat(bundleJarPath.exists() && bundleJarPath.isDirectory()).isTrue(); File metaInfPath = new File(bundleExtractPath + "META-INF"); assertThat(metaInfPath.exists() && metaInfPath.isDirectory()).isTrue(); }