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);
}
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)));
}
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);
}
Aggregations