CAMEL-13979 - create camel-robotframework component - #3172
Conversation
oscerd
left a comment
There was a problem hiding this comment.
Can you please add a Spring Boot Integration test too? LGTM, just minor things.
| <artifactId>camel-ribbon</artifactId> | ||
| <version>${project.version}</version> | ||
| </dependency> | ||
| <dependency> |
There was a problem hiding this comment.
Here you are missing the stater
| ### Options | ||
|
|
||
| // component options: START | ||
|
|
There was a problem hiding this comment.
I think this must be populated anyway.
There was a problem hiding this comment.
i ran full build but those were not populated. doing it again. let me see if they will get populated. will update soon.
There was a problem hiding this comment.
Is not going to work I guess, I think there is a bug in the maven plugin, when it checks for the for the Schema JSON file that is generated from the schema endpoint parameter, it checks with case sensitivity, since your schema is scheme = "RobotFramework", it failed to load the json file since it was expecting the name to be without uppercase robotframework.json. To workaround it, can you please change the schema name to robotframework and run the full build again? I will fix that small bug later
There was a problem hiding this comment.
Update: I was wrong here, in fact your schema name should be in small case
| @UriParams | ||
| public class RobotFrameworkCamelConfiguration implements Cloneable { | ||
|
|
||
| /** |
There was a problem hiding this comment.
This can be moved to getter/setter section, same for all the javadoc
|
|
||
| public interface RobotFrameworkCamelConstants { | ||
|
|
||
| public final String ROBOT_CAMEL_EXCHANGE_NAME = "exchange"; |
There was a problem hiding this comment.
It doesn't seem generic enough as name, same for the others ROBOT_VAR
There was a problem hiding this comment.
moved them into utils and left what's used to set headers and whatnot..
| # limitations under the License. | ||
| # | ||
|
|
||
| class=org.apache.camel.component.robotframework.RobotFrameworkComponent |
There was a problem hiding this comment.
In camel 3 this is not needed anymore, it will be autogenerated during the build
|
|
||
| if (configuration.getXunitFile() == null) { | ||
| String testCasesFolderName = path; | ||
| configuration.setXunitFile(new File("TEST-" + testCasesFolderName.replace(' ', '_') + ".xml")); |
There was a problem hiding this comment.
I was wondering, wouldn't be better to have test files created under target folder?
There was a problem hiding this comment.
Also I saw some other files being created when I ran the tests:
Output: /Users/oalsafi/Work/Apache/camel/components/camel-robotframework/output.xml
XUnit: /Users/oalsafi/Work/Apache/camel/components/camel-robotframework/TEST-src/test/resources/org/apache/camel/component/robotframework/set_variable_camel_exchange.robot.xml
Log: /Users/oalsafi/Work/Apache/camel/components/camel-robotframework/log.html
Report: /Users/oalsafi/Work/Apache/camel/components/camel-robotframework/report.html
So I was wondering as well for these files if they should be created under target?
There was a problem hiding this comment.
not neccessary. that option can be user-configured. for unit tests, i set that option to get them generated in target folder.
| if (variablesToAdd == null) { | ||
| return; | ||
| } | ||
| String[] splittedVariabledToAdd = variablesToAdd.split(","); |
There was a problem hiding this comment.
nit: I think you meant here splitVariablesToAdd?
| String[] splittedVariabledToAdd = variablesToAdd.split(","); | |
| String[] splitVariablesToAdd = variablesToAdd.split(","); |
| } | ||
|
|
||
| public void add(String... values) { | ||
| for (String value : values) { |
There was a problem hiding this comment.
Do you think is better to replace it with Collection.addAll?
| for (String value : values) { | |
| arguments.addAll(Arrays.asList(values)); |
| } | ||
|
|
||
| public boolean isSingleton() { | ||
| return true; |
There was a problem hiding this comment.
I think you don't need to override since is by default set to true
| generatedArguments.addFileToArguments(configuration.getXunitFile(), "-x"); | ||
| generatedArguments.addFlagToArguments(true, "--xunitskipnoncritical"); | ||
|
|
||
| generatedArguments.add(path); |
There was a problem hiding this comment.
Do you think it would make sense to have the code responsible path creation separated into a different function:
| generatedArguments.add(path); | |
| generatedArguments.add(createPath()); |
There was a problem hiding this comment.
The purpose is here to just decompose the function and give more readability and make the code more conscious. However, if you think it doesn't make sense, then is fine
|
|
||
| if (configuration.getXunitFile() == null) { | ||
| String testCasesFolderName = path; | ||
| configuration.setXunitFile(new File("TEST-" + testCasesFolderName.replace(' ', '_') + ".xml")); |
There was a problem hiding this comment.
Can we just do like this?:
| configuration.setXunitFile(new File("TEST-" + testCasesFolderName.replace(' ', '_') + ".xml")); | |
| configuration.setXunitFile(new File("TEST-" + path.replace(' ', '_') + ".xml")); |
and remove testCasesFolderName?
| /** | ||
| * Represents a RobotFramework endpoint. | ||
| */ | ||
| @UriEndpoint(firstVersion = "3.0.0-SNAPSHOT", scheme = "RobotFramework", title = "RobotFramework", syntax = "robotframework:resourceUri", label = "test execution") |
| /** | ||
| * Represents a RobotFramework endpoint. | ||
| */ | ||
| @UriEndpoint(firstVersion = "3.0.0-SNAPSHOT", scheme = "RobotFramework", title = "RobotFramework", syntax = "robotframework:resourceUri", label = "test execution") |
| // either from a directory or from a file | ||
| String path = getResourceUri(); | ||
| ObjectHelper.notNull(path, "resourceUri"); | ||
| log.info("RobotFrameworkEndpoint resourceUri:{}", path); |
0937055 to
2b13243
Compare
|
updated as per comments. @oscerd @omarsmak @davsclaus , could you have a look? |
|
I would prefer |
|
@davsclaus robotframework is kind of popular with robotframework name. not robot-framework. so even though i agree, it might be good to keep robotframework name as it is. for title, you are right, i will update it. |
camel-robotframework component: rebase and polish add karaf feature for robotframework component docs and cleanup Fix CS CR changes
2b13243 to
009fc03
Compare
|
@onderson ah okay about the naming then |
|
Thanks guys. merging and closing. |
camel-robotframework component: rebase and polish
add karaf feature for robotframework component
docs and cleanup
Fix CS