use of org.mule.runtime.extension.internal.loader.ExtensionModelFactory in project mule by mulesoft.
the class ExtensionDescriptionDocumenterTestCase method loadDocumentationFromFile.
@Test
public void loadDocumentationFromFile() {
ClassLoader cl = currentThread().getContextClassLoader();
ExtensionLoadingContext ctx = new DefaultExtensionLoadingContext(cl, getDefault(emptySet()));
DefaultJavaModelLoaderDelegate loader = new DefaultJavaModelLoaderDelegate(extensionClass, "1.0.0-dev");
loader.declare(ctx);
ExtensionDescriptionsEnricher enricher = new ExtensionDescriptionsEnricher();
enricher.enrich(ctx);
ExtensionModelFactory factory = new ExtensionModelFactory();
ExtensionModel extensionModel = factory.create(ctx);
assertDescribedExtensionModel(extensionModel);
}
use of org.mule.runtime.extension.internal.loader.ExtensionModelFactory in project mule by mulesoft.
the class TestConnectionFailuresTestCase method mockedExtension.
private ExtensionModel mockedExtension(final String name, final String config, final String connectionProvider) {
final ExtensionDeclarer extensionDeclarer = new ExtensionDeclarer();
extensionDeclarer.named(name).onVersion("4.0.0").fromVendor("MuleSoft testcase").withCategory(Category.COMMUNITY).withConfig(config).withConnectionProvider(connectionProvider).withConnectionManagementType(ConnectionManagementType.NONE);
return new ExtensionModelFactory().create(new DefaultExtensionLoadingContext(extensionDeclarer, currentThread().getContextClassLoader(), new NullDslResolvingContext()));
}
Aggregations