@Test public void testPackageBuilder() { PackageBuilder builder = new PackageBuilder(); builder.name("nuxeo-automation").version("5.3.2").type(PackageType.ADDON); builder.title("Nuxeo Automation").description("The automation framework"); builder.platform("dm-5.3.2"); builder.dependency("nuxeo-core:5.3.2"); builder.conflict("package-that-does-not-exist"); builder.provide("virtual-package"); builder.classifier("OpenSource"); builder.installer("MyInstaller", true); builder.addLicense("My License"); String xml = builder.buildManifest(); XMap xmap = StandaloneUpdateService.createXmap(); try { xmap.load(new ByteArrayInputStream(xml.getBytes())); } catch (IOException e) { fail("Could not create package definition"); } try { File file = builder.build(); assertTrue(file.exists()); } catch (IOException e) { fail("Could not create package file"); } }
public PackageBuilder() { def = new PackageDefinitionImpl(); platforms = new ArrayList<>(); dependencies = new ArrayList<>(); optionalDependencies = new ArrayList<>(); conflicts = new ArrayList<>(); provides = new ArrayList<>(); entries = new LinkedHashMap<>(); installForms = new ArrayList<>(); validationForms = new ArrayList<>(); uninstallForms = new ArrayList<>(); }
PackageBuilder { public PackageBuilder() { def = new PackageDefinitionImpl(); platforms = new ArrayList<>(); dependencies = new ArrayList<>(); optionalDependencies = new ArrayList<>(); conflicts = new ArrayList<>(); provides = new ArrayList<>(); entries = new LinkedHashMap<>(); installForms = new ArrayList<>(); validationForms = new ArrayList<>(); uninstallForms = new ArrayList<>(); } }
PackageBuilder { public PackageBuilder() { def = new PackageDefinitionImpl(); platforms = new ArrayList<>(); dependencies = new ArrayList<>(); optionalDependencies = new ArrayList<>(); conflicts = new ArrayList<>(); provides = new ArrayList<>(); entries = new LinkedHashMap<>(); installForms = new ArrayList<>(); validationForms = new ArrayList<>(); uninstallForms = new ArrayList<>(); } PackageBuilder(); }
PackageBuilder { public PackageBuilder() { def = new PackageDefinitionImpl(); platforms = new ArrayList<>(); dependencies = new ArrayList<>(); optionalDependencies = new ArrayList<>(); conflicts = new ArrayList<>(); provides = new ArrayList<>(); entries = new LinkedHashMap<>(); installForms = new ArrayList<>(); validationForms = new ArrayList<>(); uninstallForms = new ArrayList<>(); } PackageBuilder(); PackageBuilder name(String name); PackageBuilder version(Version version); PackageBuilder version(String version); PackageBuilder type(String type); PackageBuilder type(PackageType type); PackageBuilder title(String title); PackageBuilder description(String description); PackageBuilder classifier(String classifier); PackageBuilder vendor(String vendor); PackageBuilder installer(TaskDefinition task); PackageBuilder installer(String type, boolean restart); PackageBuilder uninstaller(TaskDefinition task); PackageBuilder uninstaller(String type, boolean restart); PackageBuilder hotReloadSupport(boolean hotReloadSupport); PackageBuilder requireTermsAndConditionsAcceptance(boolean requireTermsAndConditionsAcceptance); PackageBuilder validator(String validator); PackageBuilder platform(String platform); PackageBuilder dependency(String expr); PackageBuilder optionalDependency(String expr); PackageBuilder conflict(String expr); PackageBuilder provide(String expr); PackageBuilder addInstallForm(FormDefinition form); PackageBuilder addUninstallForm(FormDefinition form); PackageBuilder addValidationForm(FormDefinition form); PackageBuilder addLicense(String content); PackageBuilder addLicense(InputStream in); PackageBuilder addInstallScript(String content); PackageBuilder addInstallScript(InputStream in); PackageBuilder addUninstallScript(String content); PackageBuilder addUninstallScript(InputStream in); PackageBuilder addTermsAndConditions(String content); PackageBuilder addTermsAndConditions(InputStream in); PackageBuilder addEntry(String path, InputStream in); String buildManifest(); File build(); }
PackageBuilder { public PackageBuilder() { def = new PackageDefinitionImpl(); platforms = new ArrayList<>(); dependencies = new ArrayList<>(); optionalDependencies = new ArrayList<>(); conflicts = new ArrayList<>(); provides = new ArrayList<>(); entries = new LinkedHashMap<>(); installForms = new ArrayList<>(); validationForms = new ArrayList<>(); uninstallForms = new ArrayList<>(); } PackageBuilder(); PackageBuilder name(String name); PackageBuilder version(Version version); PackageBuilder version(String version); PackageBuilder type(String type); PackageBuilder type(PackageType type); PackageBuilder title(String title); PackageBuilder description(String description); PackageBuilder classifier(String classifier); PackageBuilder vendor(String vendor); PackageBuilder installer(TaskDefinition task); PackageBuilder installer(String type, boolean restart); PackageBuilder uninstaller(TaskDefinition task); PackageBuilder uninstaller(String type, boolean restart); PackageBuilder hotReloadSupport(boolean hotReloadSupport); PackageBuilder requireTermsAndConditionsAcceptance(boolean requireTermsAndConditionsAcceptance); PackageBuilder validator(String validator); PackageBuilder platform(String platform); PackageBuilder dependency(String expr); PackageBuilder optionalDependency(String expr); PackageBuilder conflict(String expr); PackageBuilder provide(String expr); PackageBuilder addInstallForm(FormDefinition form); PackageBuilder addUninstallForm(FormDefinition form); PackageBuilder addValidationForm(FormDefinition form); PackageBuilder addLicense(String content); PackageBuilder addLicense(InputStream in); PackageBuilder addInstallScript(String content); PackageBuilder addInstallScript(InputStream in); PackageBuilder addUninstallScript(String content); PackageBuilder addUninstallScript(InputStream in); PackageBuilder addTermsAndConditions(String content); PackageBuilder addTermsAndConditions(InputStream in); PackageBuilder addEntry(String path, InputStream in); String buildManifest(); File build();  }