use of org.mule.runtime.extension.internal.loader.DefaultExtensionLoadingContext in project mule by mulesoft.
the class JavaDeclarationDelegateTestCase method listOfResultsOperationWithoutGenerics.
@Test
public void listOfResultsOperationWithoutGenerics() throws Exception {
ExtensionDeclarer declarer = loaderFor(HeisenbergWithListOfResultOperations.class).declare(new DefaultExtensionLoadingContext(getClass().getClassLoader(), getDefault(emptySet())));
OperationDeclaration operation = getOperation(declarer.getDeclaration(), "listOfResultsWithoutGenerics");
MetadataType outputType = operation.getOutput().getType();
assertThat(outputType, is(instanceOf(ArrayType.class)));
assertMessageType(((ArrayType) outputType).getType(), TYPE_BUILDER.anyType().build(), TYPE_BUILDER.anyType().build());
}
use of org.mule.runtime.extension.internal.loader.DefaultExtensionLoadingContext in project mule by mulesoft.
the class JavaDeclarationDelegateTestCase method messageOperationWithoutGenerics.
@Test
public void messageOperationWithoutGenerics() throws Exception {
ExtensionDeclarer declarer = loaderFor(HeisenbergWithGenericlessMessageOperation.class).declare(new DefaultExtensionLoadingContext(HeisenbergWithSameOperationsAndConfigs.class.getClassLoader(), getDefault(emptySet())));
OperationDeclaration operation = getOperation(declarer.getDeclaration(), "noGenerics");
assertThat(operation.getOutput().getType(), is(instanceOf(AnyType.class)));
assertThat(operation.getOutputAttributes().getType(), is(instanceOf(AnyType.class)));
}
use of org.mule.runtime.extension.internal.loader.DefaultExtensionLoadingContext in project mule by mulesoft.
the class JavaDeclarationDelegateTestCase method listOfResultsOperation.
@Test
public void listOfResultsOperation() throws Exception {
ExtensionDeclarer declarer = loaderFor(HeisenbergWithListOfResultOperations.class).declare(new DefaultExtensionLoadingContext(getClass().getClassLoader(), getDefault(emptySet())));
OperationDeclaration operation = getOperation(declarer.getDeclaration(), "listOfResults");
MetadataType outputType = operation.getOutput().getType();
assertThat(outputType, is(instanceOf(ArrayType.class)));
assertMessageType(((ArrayType) outputType).getType(), TYPE_LOADER.load(Integer.class), TYPE_LOADER.load(IntegerAttributes.class));
assertThat(operation.getOutputAttributes().getType(), is(instanceOf(VoidType.class)));
}
use of org.mule.runtime.extension.internal.loader.DefaultExtensionLoadingContext in project mule by mulesoft.
the class DisplayDeclarationEnricherTestCase method setUp.
@Before
public void setUp() {
String version = getProductVersion();
ClassLoader cl = getClass().getClassLoader();
DefaultExtensionLoadingContext loadingCtx = new DefaultExtensionLoadingContext(cl, DSL_CTX);
DefaultJavaModelLoaderDelegate heisenbergLoader = new DefaultJavaModelLoaderDelegate(HeisenbergExtension.class, version);
DefaultJavaModelLoaderDelegate marvelLoader = new DefaultJavaModelLoaderDelegate(MarvelExtension.class, version);
heisenbergDeclarer = heisenbergLoader.declare(loadingCtx);
marvelDeclarer = marvelLoader.declare(loadingCtx);
DisplayDeclarationEnricher enricher = new DisplayDeclarationEnricher();
enricher.enrich(new DefaultExtensionLoadingContext(heisenbergDeclarer, cl, DSL_CTX));
enricher.enrich(new DefaultExtensionLoadingContext(marvelDeclarer, cl, DSL_CTX));
}
use of org.mule.runtime.extension.internal.loader.DefaultExtensionLoadingContext in project mule by mulesoft.
the class JavaConfigurationDeclarationEnricherTestCase method setUp.
@Before
public void setUp() {
ExtensionDeclarer declarer = new DefaultJavaModelLoaderDelegate(HeisenbergExtension.class, getProductVersion()).declare(new DefaultExtensionLoadingContext(getClass().getClassLoader(), getDefault(emptySet())));
new JavaConfigurationDeclarationEnricher().enrich(new DefaultExtensionLoadingContext(declarer, this.getClass().getClassLoader(), getDefault(emptySet())));
declaration = declarer.getDeclaration();
}
Aggregations