Search in sources :

Example 1 with ServiceFileBuilder

use of org.mule.runtime.module.service.builder.ServiceFileBuilder in project mule by mulesoft.

the class AbstractDeploymentTestCase method installService.

private void installService(String serviceName, String serviceProviderClassName, File serviceJarFile) throws IOException {
    final ServiceFileBuilder echoService = new ServiceFileBuilder(serviceName).withServiceProviderClass(serviceProviderClassName).usingLibrary(serviceJarFile.getAbsolutePath());
    File installedService = new File(services, echoService.getArtifactFile().getName());
    copyFile(echoService.getArtifactFile(), installedService);
}
Also used : ServiceFileBuilder(org.mule.runtime.module.service.builder.ServiceFileBuilder) FileUtils.toFile(org.apache.commons.io.FileUtils.toFile) TestServicesUtils.buildExpressionLanguageServiceFile(org.mule.functional.services.TestServicesUtils.buildExpressionLanguageServiceFile) File(java.io.File) TestServicesUtils.buildSchedulerServiceFile(org.mule.functional.services.TestServicesUtils.buildSchedulerServiceFile) FileUtils.copyFile(org.apache.commons.io.FileUtils.copyFile)

Example 2 with ServiceFileBuilder

use of org.mule.runtime.module.service.builder.ServiceFileBuilder in project mule by mulesoft.

the class ServiceDescriptorFactoryTestCase method createServiceDescriptor.

@Test
public void createServiceDescriptor() throws Exception {
    File servicesFolder = getServicesFolder();
    assertThat(servicesFolder.mkdirs(), is(true));
    final ServiceFileBuilder fooService = new ServiceFileBuilder(SERVICE_NAME).withServiceProviderClass(PROVIDER_CLASS_NAME);
    unzip(fooService.getArtifactFile(), getServiceFolder(SERVICE_NAME));
    ServiceDescriptor descriptor = serviceDescriptorFactory.create(getServiceFolder(SERVICE_NAME), empty());
    assertThat(descriptor.getName(), equalTo(SERVICE_NAME));
    assertThat(descriptor.getServiceProviderClassName(), equalTo(PROVIDER_CLASS_NAME));
    assertThat(descriptor.getRootFolder(), equalTo(getServiceFolder(SERVICE_NAME)));
}
Also used : ServiceFileBuilder(org.mule.runtime.module.service.builder.ServiceFileBuilder) File(java.io.File) Test(org.junit.Test)

Example 3 with ServiceFileBuilder

use of org.mule.runtime.module.service.builder.ServiceFileBuilder in project mule by mulesoft.

the class FileSystemServiceProviderDiscovererTestCase method installService.

private void installService(String serviceName, Class<? extends ServiceProvider> providerClass, boolean corrupted) throws Exception {
    final ServiceFileBuilder fooService = new ServiceFileBuilder(serviceName).withServiceProviderClass(providerClass.getName());
    if (corrupted) {
        fooService.corrupted();
    }
    File installedService = new File(getServicesFolder(), fooService.getArtifactFile().getName());
    moveFile(fooService.getArtifactFile(), installedService);
}
Also used : ServiceFileBuilder(org.mule.runtime.module.service.builder.ServiceFileBuilder) FileUtils.moveFile(org.apache.commons.io.FileUtils.moveFile) File(java.io.File)

Aggregations

File (java.io.File)3 ServiceFileBuilder (org.mule.runtime.module.service.builder.ServiceFileBuilder)3 FileUtils.copyFile (org.apache.commons.io.FileUtils.copyFile)1 FileUtils.moveFile (org.apache.commons.io.FileUtils.moveFile)1 FileUtils.toFile (org.apache.commons.io.FileUtils.toFile)1 Test (org.junit.Test)1 TestServicesUtils.buildExpressionLanguageServiceFile (org.mule.functional.services.TestServicesUtils.buildExpressionLanguageServiceFile)1 TestServicesUtils.buildSchedulerServiceFile (org.mule.functional.services.TestServicesUtils.buildSchedulerServiceFile)1