use of org.apache.camel.ComponentConfiguration in project camel by apache.
the class LanguageComponentConfigurationAndDocumentationTest method testComponentConfiguration.
@Test
public void testComponentConfiguration() throws Exception {
LanguageComponent comp = context.getComponent("language", LanguageComponent.class);
EndpointConfiguration conf = comp.createConfiguration("language:simple:foo?transform=false");
assertEquals("false", conf.getParameter("transform"));
ComponentConfiguration compConf = comp.createComponentConfiguration();
String json = compConf.createParameterJsonSchema();
assertNotNull(json);
assertTrue(json.contains("\"languageName\": { \"kind\": \"path\", \"displayName\": \"Language Name\", \"group\": \"producer\", \"required\": true"));
assertTrue(json.contains("\"script\": { \"kind\": \"parameter\", \"displayName\": \"Script\", \"group\": \"producer\", \"type\": \"string\""));
}
use of org.apache.camel.ComponentConfiguration in project camel by apache.
the class TestComponentConfigurationAndDocumentationTest method testComponentConfiguration.
@Test
public void testComponentConfiguration() throws Exception {
TestComponent comp = context.getComponent("test", TestComponent.class);
EndpointConfiguration conf = comp.createConfiguration("test:my:foo?timeout=1000");
assertEquals("1000", conf.getParameter("timeout"));
ComponentConfiguration compConf = comp.createComponentConfiguration();
String json = compConf.createParameterJsonSchema();
assertNotNull(json);
assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"displayName\": \"Name\", \"group\": \"producer\", \"required\": true"));
assertTrue(json.contains("\"retainFirst\": { \"kind\": \"parameter\", \"displayName\": \"Retain First\", \"group\": \"producer\", \"label\": \"producer\""));
}
use of org.apache.camel.ComponentConfiguration in project camel by apache.
the class SalesforceComponentConfigurationIntegrationTest method testEndpointCompletion.
@Test
public void testEndpointCompletion() throws Exception {
Component component = context().getComponent(componentName);
ComponentConfiguration configuration = component.createComponentConfiguration();
// get operation names
assertCompletionOptions(configuration.completeEndpointPath(""), "getVersions", "getResources", "getGlobalObjects", "getBasicInfo", "getDescription", "getSObject", "createSObject", "updateSObject", "deleteSObject", "getSObjectWithId", "upsertSObject", "deleteSObjectWithId", "getBlobField", "query", "queryMore", "queryAll", "search", "apexCall", "recent", "createJob", "getJob", "closeJob", "abortJob", "createBatch", "getBatch", "getAllBatches", "getRequest", "getResults", "createBatchQuery", "getQueryResultIds", "getQueryResult", "getRecentReports", "getReportDescription", "executeSyncReport", "executeAsyncReport", "getReportInstances", "getReportResults", "limits", "approval", "approvals", "composite-batch", "composite-tree", "[PushTopicName]");
// get filtered operation names
assertCompletionOptions(configuration.completeEndpointPath("get"), "getVersions", "getResources", "getGlobalObjects", "getBasicInfo", "getDescription", "getSObject", "getSObjectWithId", "getBlobField", "getJob", "getBatch", "getAllBatches", "getRequest", "getResults", "getQueryResultIds", "getQueryResult", "getRecentReports", "getReportDescription", "getReportInstances", "getReportResults");
/* TODO support parameter completion
// get ALL REST operation parameters
// TODO support operation specific parameter completion
assertCompletionOptions(configuration.completeEndpointPath("getSObject?"),
"apiVersion", "httpClient", "format", "sObjectName", "sObjectId", "sObjectFields",
"sObjectIdName", "sObjectIdValue", "sObjectBlobFieldName", "sObjectClass", "sObjectQuery", "sObjectSearch");
// get filtered REST parameters
assertCompletionOptions(configuration.completeEndpointPath("getSObject?format=XML&"),
"apiVersion", "httpClient", "sObjectName", "sObjectId", "sObjectFields",
"sObjectIdName", "sObjectIdValue", "sObjectBlobFieldName", "sObjectClass", "sObjectQuery", "sObjectSearch");
// get ALL Bulk operation parameters
// TODO support operation specific parameter completion
assertCompletionOptions(configuration.completeEndpointPath("createJob?"),
"apiVersion", "httpClient", "sObjectQuery", "contentType", "jobId", "batchId", "resultId");
// get filtered Bulk operation parameters
assertCompletionOptions(configuration.completeEndpointPath("createJob?contentType=XML&"),
"apiVersion", "httpClient", "sObjectQuery", "jobId", "batchId", "resultId");
// get ALL topic parameters for consumers
assertCompletionOptions(configuration.completeEndpointPath("myTopic?"),
"apiVersion", "httpClient", "updateTopic", "notifyForFields", "notifyForOperations");
// get filtered topic parameters for consumers
assertCompletionOptions(configuration.completeEndpointPath("myTopic?updateTopic=true&"),
"apiVersion", "httpClient", "notifyForFields", "notifyForOperations");
// get parameters from partial name
assertCompletionOptions(configuration.completeEndpointPath("getSObject?sObject"),
"sObjectName", "sObjectId", "sObjectFields",
"sObjectIdName", "sObjectIdValue", "sObjectBlobFieldName", "sObjectClass", "sObjectQuery", "sObjectSearch");
*/
// get sObjectName values, from scanned DTO packages
assertCompletionOptions(configuration.completeEndpointPath("getSObject?sObjectName="), "Account", "Asset", "Contact", "Task", "Line_Item__c", "Merchandise__c", "Document", "MSPTest");
// get sObjectFields values, from scanned DTO
assertCompletionOptions(configuration.completeEndpointPath("getSObject?sObjectName=Merchandise__c&sObjectFields="), "Description__c", "Price__c", "Total_Inventory__c", "attributes", "Id", "OwnerId", "IsDeleted", "Name", "CreatedDate", "CreatedById", "LastModifiedDate", "LastModifiedById", "SystemModstamp", "LastActivityDate", "LastViewedDate", "LastReferencedDate");
// get sObjectClass values, from scanned DTO packages
assertCompletionOptions(configuration.completeEndpointPath("getSObject?sObjectClass="), Account.class.getName(), Asset.class.getName(), Contact.class.getName(), Task.class.getName(), Line_Item__c.class.getName(), Merchandise__c.class.getName(), Document.class.getName(), MSPTest.class.getName(), QueryRecordsLine_Item__c.class.getName());
}
use of org.apache.camel.ComponentConfiguration in project camel by apache.
the class BeanComponentConfigurationAndDocumentationTest method testComponentConfiguration.
@Test
public void testComponentConfiguration() throws Exception {
BeanComponent comp = context.getComponent("bean", BeanComponent.class);
EndpointConfiguration conf = comp.createConfiguration("bean:foo?method=bar");
assertEquals("bar", conf.getParameter("method"));
ComponentConfiguration compConf = comp.createComponentConfiguration();
String json = compConf.createParameterJsonSchema();
assertNotNull(json);
assertTrue(json.contains("\"method\": { \"kind\": \"parameter\", \"displayName\": \"Method\", \"group\": \"producer\", \"type\": \"string\""));
assertTrue(json.contains("\"cache\": { \"kind\": \"parameter\", \"displayName\": \"Cache\", \"group\": \"advanced\", \"label\": \"advanced\", \"type\": \"boolean\""));
}
use of org.apache.camel.ComponentConfiguration in project camel by apache.
the class BrowseComponentConfigurationAndDocumentationTest method testComponentConfiguration.
@Test
public void testComponentConfiguration() throws Exception {
BrowseComponent comp = context.getComponent("browse", BrowseComponent.class);
EndpointConfiguration conf = comp.createConfiguration("browse:seda:foo?synchronous=true");
assertEquals("true", conf.getParameter("synchronous"));
ComponentConfiguration compConf = comp.createComponentConfiguration();
String json = compConf.createParameterJsonSchema();
assertNotNull(json);
assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"displayName\": \"Name\", \"group\": \"common\", \"required\": true, \"type\": \"string\""));
assertTrue(json.contains("\"synchronous\": { \"kind\": \"parameter\", \"displayName\": \"Synchronous\", \"group\": \"advanced\", \"label\": \"advanced\", \"type\": \"boolean\""));
}
Aggregations