@Test public void createPackage() throws IOException { boolean onlyMuleSources = false; boolean lightweightPackage = false; boolean attachMuleSources = true; boolean testPackage = false; builder.withPackagingOptions(new PackagingOptions(onlyMuleSources, lightweightPackage, attachMuleSources, testPackage)); builder.createPackage(fakeTargetFolder.getRoot().toPath(), destinationFile.toPath()); Path targetPath = fakeTargetFolder.getRoot().toPath(); verify(archiverMock, times(1)).addToRoot(targetPath.resolve(CLASSES.value()).toFile(), null, null); verify(archiverMock, times(1)).addMaven(targetPath.resolve(META_INF.value()).resolve(MAVEN.value()).toFile(), null, null); verify(archiverMock, times(1)).addMuleArtifact(targetPath.resolve(META_INF.value()).resolve(MULE_ARTIFACT.value()).toFile(), null, null); verify(archiverMock, times(1)).addMuleSrc(targetPath.resolve(META_INF.value()).resolve(MULE_SRC.value()).toFile(), null, null); verify(archiverMock, times(1)).addRepository(targetPath.resolve(REPOSITORY.value()).toFile(), null, null); verify(archiverMock, times(0)).addToRoot(targetPath.resolve(TEST_MULE.value()).toFile(), null, null); verify(archiverMock, times(0)).addToRoot(targetPath.resolve(TEST_CLASSES.value()).toFile(), null, null); verify(archiverMock, times(1)).setDestFile(destinationFile); verify(archiverMock, times(1)).createArchive(); }
@Override public void createPackage(Path originFolderPath, Path destinationPath) throws ArchiverException, IOException { checkArgument(originFolderPath != null, "The origin path must not be null"); checkArgument(originFolderPath.toFile().exists(), "The origin path must exists"); Path metaInfPath = originFolderPath.resolve(META_INF.value()); this .withClasses(originFolderPath.resolve(CLASSES.value()).toFile()) .withMaven(metaInfPath.resolve(MAVEN.value()).toFile()) .withMuleArtifact(metaInfPath.resolve(MULE_ARTIFACT.value()).toFile()) .withTestClasses(originFolderPath.resolve(TEST_CLASSES.value()).toFile()) .withTestMule(originFolderPath.resolve(TEST_MULE.value()).resolve(MUNIT.value()).toFile()) .withRepository(originFolderPath.resolve(REPOSITORY.value()).toFile()) .withMuleSrc(metaInfPath.resolve(MULE_SRC.value()).toFile()); this.createArchive(destinationPath); }
MulePackageBuilder implements PackageBuilder { @Override public void createPackage(Path originFolderPath, Path destinationPath) throws ArchiverException, IOException { checkArgument(originFolderPath != null, "The origin path must not be null"); checkArgument(originFolderPath.toFile().exists(), "The origin path must exists"); Path metaInfPath = originFolderPath.resolve(META_INF.value()); this .withClasses(originFolderPath.resolve(CLASSES.value()).toFile()) .withMaven(metaInfPath.resolve(MAVEN.value()).toFile()) .withMuleArtifact(metaInfPath.resolve(MULE_ARTIFACT.value()).toFile()) .withTestClasses(originFolderPath.resolve(TEST_CLASSES.value()).toFile()) .withTestMule(originFolderPath.resolve(TEST_MULE.value()).resolve(MUNIT.value()).toFile()) .withRepository(originFolderPath.resolve(REPOSITORY.value()).toFile()) .withMuleSrc(metaInfPath.resolve(MULE_SRC.value()).toFile()); this.createArchive(destinationPath); } }
MulePackageBuilder implements PackageBuilder { @Override public void createPackage(Path originFolderPath, Path destinationPath) throws ArchiverException, IOException { checkArgument(originFolderPath != null, "The origin path must not be null"); checkArgument(originFolderPath.toFile().exists(), "The origin path must exists"); Path metaInfPath = originFolderPath.resolve(META_INF.value()); this .withClasses(originFolderPath.resolve(CLASSES.value()).toFile()) .withMaven(metaInfPath.resolve(MAVEN.value()).toFile()) .withMuleArtifact(metaInfPath.resolve(MULE_ARTIFACT.value()).toFile()) .withTestClasses(originFolderPath.resolve(TEST_CLASSES.value()).toFile()) .withTestMule(originFolderPath.resolve(TEST_MULE.value()).resolve(MUNIT.value()).toFile()) .withRepository(originFolderPath.resolve(REPOSITORY.value()).toFile()) .withMuleSrc(metaInfPath.resolve(MULE_SRC.value()).toFile()); this.createArchive(destinationPath); }  }
MulePackageBuilder implements PackageBuilder { @Override public void createPackage(Path originFolderPath, Path destinationPath) throws ArchiverException, IOException { checkArgument(originFolderPath != null, "The origin path must not be null"); checkArgument(originFolderPath.toFile().exists(), "The origin path must exists"); Path metaInfPath = originFolderPath.resolve(META_INF.value()); this .withClasses(originFolderPath.resolve(CLASSES.value()).toFile()) .withMaven(metaInfPath.resolve(MAVEN.value()).toFile()) .withMuleArtifact(metaInfPath.resolve(MULE_ARTIFACT.value()).toFile()) .withTestClasses(originFolderPath.resolve(TEST_CLASSES.value()).toFile()) .withTestMule(originFolderPath.resolve(TEST_MULE.value()).resolve(MUNIT.value()).toFile()) .withRepository(originFolderPath.resolve(REPOSITORY.value()).toFile()) .withMuleSrc(metaInfPath.resolve(MULE_SRC.value()).toFile()); this.createArchive(destinationPath); }  MulePackageBuilder withClasses(File folder); MulePackageBuilder withTestClasses(File folder); MulePackageBuilder withTestMule(File folder); MulePackageBuilder withMaven(File folder); MulePackageBuilder withMuleSrc(File folder); MulePackageBuilder withMuleArtifact(File folder); MulePackageBuilder withRepository(File folder); MulePackageBuilder withRootResource(File resource); MulePackageBuilder withPackagingOptions(PackagingOptions packagingOptions); MulePackageBuilder withArchiver(MuleArchiver archiver); @Override void createPackage(Path originFolderPath, Path destinationPath); @Override void createPackage(Path destinationPath); }
MulePackageBuilder implements PackageBuilder { @Override public void createPackage(Path originFolderPath, Path destinationPath) throws ArchiverException, IOException { checkArgument(originFolderPath != null, "The origin path must not be null"); checkArgument(originFolderPath.toFile().exists(), "The origin path must exists"); Path metaInfPath = originFolderPath.resolve(META_INF.value()); this .withClasses(originFolderPath.resolve(CLASSES.value()).toFile()) .withMaven(metaInfPath.resolve(MAVEN.value()).toFile()) .withMuleArtifact(metaInfPath.resolve(MULE_ARTIFACT.value()).toFile()) .withTestClasses(originFolderPath.resolve(TEST_CLASSES.value()).toFile()) .withTestMule(originFolderPath.resolve(TEST_MULE.value()).resolve(MUNIT.value()).toFile()) .withRepository(originFolderPath.resolve(REPOSITORY.value()).toFile()) .withMuleSrc(metaInfPath.resolve(MULE_SRC.value()).toFile()); this.createArchive(destinationPath); }  MulePackageBuilder withClasses(File folder); MulePackageBuilder withTestClasses(File folder); MulePackageBuilder withTestMule(File folder); MulePackageBuilder withMaven(File folder); MulePackageBuilder withMuleSrc(File folder); MulePackageBuilder withMuleArtifact(File folder); MulePackageBuilder withRepository(File folder); MulePackageBuilder withRootResource(File resource); MulePackageBuilder withPackagingOptions(PackagingOptions packagingOptions); MulePackageBuilder withArchiver(MuleArchiver archiver); @Override void createPackage(Path originFolderPath, Path destinationPath); @Override void createPackage(Path destinationPath); static final String CLASSLOADER_MODEL_JSON; }