use of io.qameta.allure.Description in project mule by mulesoft.
the class ApplicationDeploymentTestCase method deploysAppWithNotExportedPackage.
@Test
@Issue("MULE-13756")
@Description("Tests that code called form application's Processor can access internal resources/packages of the application")
public void deploysAppWithNotExportedPackage() throws Exception {
ApplicationFileBuilder nonExposingAppFileBuilder = new ApplicationFileBuilder("non-exposing-app").configuredWith(EXPORTED_PACKAGES, "org.bar1").configuredWith(EXPORTED_RESOURCES, "test-resource.txt").definedBy("app-with-loads-app-resource-plugin-config.xml").containingClass(loadsAppResourceCallbackClassFile, "org/foo/LoadsAppResourceCallback.class").containingClass(barUtils1ClassFile, "org/bar1/BarUtils.class").containingClass(barUtils2ClassFile, "org/bar2/BarUtils.class").containingResource("test-resource.txt", "test-resource.txt").containingResource("test-resource.txt", "test-resource-not-exported.txt");
addPackedAppFromBuilder(nonExposingAppFileBuilder);
startDeployment();
assertApplicationDeploymentSuccess(applicationDeploymentListener, nonExposingAppFileBuilder.getId());
executeApplicationFlow("main");
}
use of io.qameta.allure.Description in project mule by mulesoft.
the class ApplicationDeploymentTestCase method deploysAppWithNotExportedPackageAndPluginWithInterceptors.
@Test
@Issue("MULE-13756")
@Description("Tests that code called form plugin's ProcessorInterceptor cannot access internal resources/packages of the application")
public void deploysAppWithNotExportedPackageAndPluginWithInterceptors() throws Exception {
File loadsAppResourceInterceptorFactoryClassFile = new SingleClassCompiler().compile(getResourceFile("/org/foo/LoadsAppResourceInterceptorFactory.java"));
File loadsAppResourceInterceptorClassFile = new SingleClassCompiler().compile(getResourceFile("/org/foo/LoadsAppResourceInterceptor.java"));
ArtifactPluginFileBuilder loadsAppResourceInterceptorPlugin = new ArtifactPluginFileBuilder("loadsAppResourceInterceptorPlugin").configuredWith(EXPORTED_CLASS_PACKAGES_PROPERTY, "org.lalala").containingClass(loadsAppResourceInterceptorFactoryClassFile, "org/foo/LoadsAppResourceInterceptorFactory.class").containingClass(loadsAppResourceInterceptorClassFile, "org/foo/LoadsAppResourceInterceptor.class").containingResource("registry-bootstrap-loads-app-resource-pif.properties", "META-INF/org/mule/runtime/core/config/registry-bootstrap.properties");
ApplicationFileBuilder nonExposingAppFileBuilder = new ApplicationFileBuilder("non-exposing-app").configuredWith(EXPORTED_PACKAGES, "org.bar1").configuredWith(EXPORTED_RESOURCES, "test-resource.txt").definedBy("app-with-plugin-bootstrap.xml").containingClass(barUtils1ClassFile, "org/bar1/BarUtils.class").containingClass(barUtils2ClassFile, "org/bar2/BarUtils.class").containingResource("test-resource.txt", "test-resource.txt").containingResource("test-resource.txt", "test-resource-not-exported.txt").dependingOn(loadsAppResourceInterceptorPlugin);
addPackedAppFromBuilder(nonExposingAppFileBuilder);
startDeployment();
assertApplicationDeploymentSuccess(applicationDeploymentListener, nonExposingAppFileBuilder.getId());
executeApplicationFlow("main");
}
use of io.qameta.allure.Description in project mule by mulesoft.
the class BytesStreamingExtensionTestCase method streamingStrategyParameterInSource.
@Test
@Description("Streaming source has a streaming strategy parameter")
public void streamingStrategyParameterInSource() throws Exception {
ParameterModel streamingParameter = getStreamingStrategyParameterModel(() -> getConfigurationModel().getSourceModel("bytes-caster").get());
assertStreamingStrategyParameter(streamingParameter);
}
use of io.qameta.allure.Description in project mule by mulesoft.
the class BytesStreamingExtensionTestCase method streamingStrategyParameterInOperation.
@Test
@Description("Streaming operation has a streaming strategy parameter")
public void streamingStrategyParameterInOperation() throws Exception {
ParameterModel streamingParameter = getStreamingStrategyParameterModel(() -> getConfigurationModel().getOperationModel("toStream").get());
assertStreamingStrategyParameter(streamingParameter);
}
use of io.qameta.allure.Description in project mule by mulesoft.
the class BytesStreamingExtensionTestCase method streamProviderSerialization.
@Test
@Description("A stream provider is serialized as a byte[]")
public void streamProviderSerialization() throws Exception {
CursorStreamProvider provider = (CursorStreamProvider) flowRunner("toStream").keepStreamsOpen().withPayload(data).run().getMessage().getPayload().getValue();
byte[] bytes = muleContext.getObjectSerializer().getInternalProtocol().serialize(provider);
bytes = muleContext.getObjectSerializer().getInternalProtocol().deserialize(bytes);
assertThat(new String(bytes, Charset.defaultCharset()), equalTo(data));
}
Aggregations