Six Stars

Test my custom component

Hello,

 

I want to developed a component with your new kit: https://talend.github.io/component-runtime/main/1.0.1/index.html. Now I want to test the component. First it is very bad that I have to close Talend studio when I want to deploy my component over maven. Second I want to write a Junit Test, in your documentation you write: "The Job.component() method is provided by Talend Component Kit" but where??? In which package you deploy that method? My dependencies are: component-api, component-runtime-junit. 

 

And can you please commit a complete example of a custom component on github?

1 ACCEPTED SOLUTION

Accepted Solutions
Employee

Re: Test my custom component

Hi Benjamin,

 

The Job class is in package org.talend.sdk.component.runtime.manager.chain. It is part of component-runtime-manager which is a transitive dependency of component-runtime-junit so you should be already set up to use it.

 

We will be working on providing ready to use examples in the coming weeks to complete the documentation already available online.

 

Side note: to start testing components more unitarily you don't need the Job API until you mix multiple components in the same "job". Until you hit that need, you can directly use the SimpleComponentRule. If you use the starter application to create your initial component(s) skeleton(s), then you can select in the facet box (first step) the facet "Testing" to have some skeleton of that pattern.

Romain
Talend Component Kit Documentation: https://talend.github.io/component-runtime/
1 REPLY
Employee

Re: Test my custom component

Hi Benjamin,

 

The Job class is in package org.talend.sdk.component.runtime.manager.chain. It is part of component-runtime-manager which is a transitive dependency of component-runtime-junit so you should be already set up to use it.

 

We will be working on providing ready to use examples in the coming weeks to complete the documentation already available online.

 

Side note: to start testing components more unitarily you don't need the Job API until you mix multiple components in the same "job". Until you hit that need, you can directly use the SimpleComponentRule. If you use the starter application to create your initial component(s) skeleton(s), then you can select in the facet box (first step) the facet "Testing" to have some skeleton of that pattern.

Romain
Talend Component Kit Documentation: https://talend.github.io/component-runtime/