Search in sources :

Example 1 with DeclarationOperation

use of org.mule.runtime.extension.api.loader.xml.declaration.DeclarationOperation in project mule by mulesoft.

the class XmlExtensionLoaderWithDeclarationTestCase method assertDefaultModule.

private void assertDefaultModule(Optional<String> declarationPath) {
    final DeclarationOperation declaresOutput = new DeclarationOperation(STRING_TYPE, VOID_TYPE);
    final DeclarationOperation declaresAttributes = new DeclarationOperation(VOID_TYPE, NUMBER_TYPE);
    final DeclarationOperation declaresOutputAndAttributes = new DeclarationOperation(ANY_TYPE, BOOLEAN_TYPE);
    final DeclarationOperation declaresNothing = new DeclarationOperation(VOID_TYPE, VOID_TYPE);
    assertModule(declarationPath, declaresOutput, declaresAttributes, declaresOutputAndAttributes, declaresNothing);
}
Also used : DeclarationOperation(org.mule.runtime.extension.api.loader.xml.declaration.DeclarationOperation)

Example 2 with DeclarationOperation

use of org.mule.runtime.extension.api.loader.xml.declaration.DeclarationOperation in project mule by mulesoft.

the class XmlExtensionLoaderWithDeclarationTestCase method testModuleDoubleOperationRemapping_expectsTwoRemappedOperation.

@Test
public void testModuleDoubleOperationRemapping_expectsTwoRemappedOperation() {
    final DeclarationOperation declaresOutput = new DeclarationOperation(BaseTypeBuilder.create(MetadataFormat.JSON).binaryType().build(), BaseTypeBuilder.create(MetadataFormat.XML).numberType().build());
    final DeclarationOperation declaresAttributes = new DeclarationOperation(VOID_TYPE, NUMBER_TYPE);
    final DeclarationOperation declaresOutputAndAttributes = new DeclarationOperation(BaseTypeBuilder.create(MetadataFormat.XML).numberType().build(), VOID_TYPE);
    final DeclarationOperation declaresNothing = new DeclarationOperation(VOID_TYPE, VOID_TYPE);
    assertModule(of("modules/declaration/declaration-two-operations.json"), declaresOutput, declaresAttributes, declaresOutputAndAttributes, declaresNothing);
}
Also used : DeclarationOperation(org.mule.runtime.extension.api.loader.xml.declaration.DeclarationOperation) Test(org.junit.Test)

Example 3 with DeclarationOperation

use of org.mule.runtime.extension.api.loader.xml.declaration.DeclarationOperation in project mule by mulesoft.

the class XmlExtensionLoaderWithDeclarationTestCase method testModuleAllOperationRemapping_expectsAllRemappedOperation.

@Test
public void testModuleAllOperationRemapping_expectsAllRemappedOperation() {
    final DeclarationOperation declaresOutput = new DeclarationOperation(BaseTypeBuilder.create(MetadataFormat.JSON).binaryType().build(), BaseTypeBuilder.create(MetadataFormat.XML).numberType().build());
    final DeclarationOperation declaresAttributes = new DeclarationOperation(BaseTypeBuilder.create(MetadataFormat.XML).dateType().build(), BaseTypeBuilder.create(MetadataFormat.CSV).numberType().build());
    final DeclarationOperation declaresOutputAndAttributes = new DeclarationOperation(BaseTypeBuilder.create(MetadataFormat.XML).numberType().build(), VOID_TYPE);
    final DeclarationOperation declaresNothing = new DeclarationOperation(BaseTypeBuilder.create(MetadataFormat.JSON).stringType().build(), BaseTypeBuilder.create(MetadataFormat.CSV).stringType().build());
    assertModule(of("modules/declaration/declaration-all-operations.json"), declaresOutput, declaresAttributes, declaresOutputAndAttributes, declaresNothing);
}
Also used : DeclarationOperation(org.mule.runtime.extension.api.loader.xml.declaration.DeclarationOperation) Test(org.junit.Test)

Example 4 with DeclarationOperation

use of org.mule.runtime.extension.api.loader.xml.declaration.DeclarationOperation in project mule by mulesoft.

the class XmlExtensionLoaderWithDeclarationTestCase method testModuleSingleOperationRemapping_expectsOneRemappedOperation.

@Test
public void testModuleSingleOperationRemapping_expectsOneRemappedOperation() {
    final DeclarationOperation declaresOutput = new DeclarationOperation(BaseTypeBuilder.create(MetadataFormat.JSON).binaryType().build(), BaseTypeBuilder.create(MetadataFormat.XML).numberType().build());
    final DeclarationOperation declaresAttributes = new DeclarationOperation(VOID_TYPE, NUMBER_TYPE);
    final DeclarationOperation declaresOutputAndAttributes = new DeclarationOperation(ANY_TYPE, BOOLEAN_TYPE);
    final DeclarationOperation declaresNothing = new DeclarationOperation(VOID_TYPE, VOID_TYPE);
    assertModule(of("modules/declaration/declaration-one-operation.json"), declaresOutput, declaresAttributes, declaresOutputAndAttributes, declaresNothing);
}
Also used : DeclarationOperation(org.mule.runtime.extension.api.loader.xml.declaration.DeclarationOperation) Test(org.junit.Test)

Aggregations

DeclarationOperation (org.mule.runtime.extension.api.loader.xml.declaration.DeclarationOperation)4 Test (org.junit.Test)3