@Test(expected = RuntimeException.class) public void addPackageDescrDifferentPkgUUID() { String pkgUUID = generateUUID(); PackageDescr first = new PackageDescr(NAMESPACE); first.setPreferredPkgUUID(pkgUUID); assertTrue(first.getPreferredPkgUUID().isPresent()); compositePackageDescr.addPackageDescr(new ByteArrayResource(), first); assertTrue(compositePackageDescr.getPreferredPkgUUID().isPresent()); assertEquals(pkgUUID, compositePackageDescr.getPreferredPkgUUID().get()); pkgUUID = generateUUID(); PackageDescr second = new PackageDescr(NAMESPACE); second.setPreferredPkgUUID(pkgUUID); assertTrue(second.getPreferredPkgUUID().isPresent()); assertNotEquals(first.getPreferredPkgUUID().get(), second.getPreferredPkgUUID().get()); compositePackageDescr.addPackageDescr(new ByteArrayResource(), second); }
public void addPackageDescr(Resource resource, PackageDescr packageDescr) { if (!getNamespace().equals(packageDescr.getNamespace())) { throw new RuntimeException("Composing PackageDescr (" + packageDescr.getName() + ") in different namespaces (namespace=" + getNamespace() + " packageDescr=" + packageDescr.getNamespace() + ")" ); } internalAdd(resource, packageDescr); }
CompositePackageDescr extends PackageDescr { public void addPackageDescr(Resource resource, PackageDescr packageDescr) { if (!getNamespace().equals(packageDescr.getNamespace())) { throw new RuntimeException("Composing PackageDescr (" + packageDescr.getName() + ") in different namespaces (namespace=" + getNamespace() + " packageDescr=" + packageDescr.getNamespace() + ")" ); } internalAdd(resource, packageDescr); } }
CompositePackageDescr extends PackageDescr { public void addPackageDescr(Resource resource, PackageDescr packageDescr) { if (!getNamespace().equals(packageDescr.getNamespace())) { throw new RuntimeException("Composing PackageDescr (" + packageDescr.getName() + ") in different namespaces (namespace=" + getNamespace() + " packageDescr=" + packageDescr.getNamespace() + ")" ); } internalAdd(resource, packageDescr); } CompositePackageDescr();  CompositePackageDescr(Resource resource, PackageDescr packageDescr); }
CompositePackageDescr extends PackageDescr { public void addPackageDescr(Resource resource, PackageDescr packageDescr) { if (!getNamespace().equals(packageDescr.getNamespace())) { throw new RuntimeException("Composing PackageDescr (" + packageDescr.getName() + ") in different namespaces (namespace=" + getNamespace() + " packageDescr=" + packageDescr.getNamespace() + ")" ); } internalAdd(resource, packageDescr); } CompositePackageDescr();  CompositePackageDescr(Resource resource, PackageDescr packageDescr); void addPackageDescr(Resource resource, PackageDescr packageDescr); CompositeAssetFilter getFilter(); void addFilter( KnowledgeBuilderImpl.AssetFilter f ); }
CompositePackageDescr extends PackageDescr { public void addPackageDescr(Resource resource, PackageDescr packageDescr) { if (!getNamespace().equals(packageDescr.getNamespace())) { throw new RuntimeException("Composing PackageDescr (" + packageDescr.getName() + ") in different namespaces (namespace=" + getNamespace() + " packageDescr=" + packageDescr.getNamespace() + ")" ); } internalAdd(resource, packageDescr); } CompositePackageDescr();  CompositePackageDescr(Resource resource, PackageDescr packageDescr); void addPackageDescr(Resource resource, PackageDescr packageDescr); CompositeAssetFilter getFilter(); void addFilter( KnowledgeBuilderImpl.AssetFilter f );  }