PersistentBundleInfoBuilder { public static PersistentBundle build(Resource resource) throws IOException { return build(resource, true, true); } private  PersistentBundleInfoBuilder(); static PersistentBundle build(Resource resource); static PersistentBundle build(Resource resource, boolean calculateChecksum, boolean checkTransformationRequired);  }
@Test public void testBuildNonBundle() throws IOException { PersistentBundle info = build("non-bundle"); assertNull(info); }
@Test public void testBuildNonDxBundle() throws IOException { PersistentBundle info = build("non-dx-bundle"); logger.info("Module info parsed for {}: {}", info.getResource(), info); assertEquals(null, info.getGroupId()); assertEquals("org.apache.commons.codec", info.getSymbolicName()); assertEquals("1.8.0", info.getVersion()); assertEquals("org.apache.commons.codec/1.8.0", info.getKey()); assertEquals("Commons Codec", info.getDisplayName()); }
@Test public void testBuildDxModuleLegacy() throws IOException { PersistentBundle info = build("dx-module-legacy"); assertNull(info); }
@Test public void testBuildDxModuleReleased() throws IOException { PersistentBundle info = build("dx-module-released"); logger.info("Module info parsed for {}: {}", info.getResource(), info); assertEquals("org.jahia.modules", info.getGroupId()); assertEquals("article", info.getSymbolicName()); assertEquals("2.0.2", info.getVersion()); assertEquals("org.jahia.modules/article/2.0.2", info.getKey()); assertEquals("Jahia Article", info.getDisplayName()); assertEquals("f1bffece4ed8f547d99685b65f9c9570", info.getChecksum()); }
@Test public void testBuildDxModuleSnapshot() throws IOException { PersistentBundle info = build("dx-module-snapshot"); logger.info("Module info parsed for {}: {}", info.getResource(), info); assertEquals("org.jahia.modules", info.getGroupId()); assertEquals("external-provider-modules", info.getSymbolicName()); assertEquals("3.1.0.SNAPSHOT", info.getVersion()); assertEquals("org.jahia.modules/external-provider-modules/3.1.0.SNAPSHOT", info.getKey()); assertEquals("Jahia External Provider Modules", info.getDisplayName()); }