[ 
https://issues.apache.org/jira/browse/CAMEL-13954?focusedWorklogId=309631&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-309631
 ]

ASF GitHub Bot logged work on CAMEL-13954:
------------------------------------------

                Author: ASF GitHub Bot
            Created on: 10/Sep/19 08:51
            Start Date: 10/Sep/19 08:51
    Worklog Time Spent: 10m 
      Work Description: omarsmak commented on pull request #3157: CAMEL-13954: 
Set file-watch events explicitly instead of relying on relying on the the auto 
generated property configurator
URL: https://github.com/apache/camel/pull/3157
 
 
   **Scope of changes**
   
   - Due to [CAMEL-13954](https://issues.apache.org/jira/browse/CAMEL-13954), 
the auto generated property configurator will use the wrong method which is 
expected due to the param type. However, instead of that, we just set events 
manually using the correct method.
   - Change junit testing directory from the default to the `target` folder. 
   - Make sure to delete spring testing files after the tests.
   - Add and modify some testing cases 
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 309631)
    Remaining Estimate: 0h
            Time Spent: 10m

> Generated property configurator is using wrong method on endpoint 
> (camel-file-watch component)
> ----------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-13954
>                 URL: https://issues.apache.org/jira/browse/CAMEL-13954
>             Project: Camel
>          Issue Type: Bug
>    Affects Versions: 3.0.0.RC1
>            Reporter: Edem Tiassou
>            Priority: Major
>             Fix For: 3.0.0, 3.0.0.RC2
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Hi, I'am very new at Camel and I've being trying to use the component 
> camel-file-watch (version:3.0.0-RC1).
> When I set thing up with spring-boot, it does not seem to dectect file 
> systems events.
> With a little investigation, I found that the property conversion of events 
> from the uri scheme (file-watch://some-directory?events=DELETE,CREATE) to the 
> endpoint is calling
> (FileWatchEndpoint.java)
> public void setEvents(Set<FileEventEnum> events) {
> this.events = events;
> }
> Instead of
> (FileWatchEndpoint.java)
> @SuppressWarnings("unused") //called via reflection
> public void setEvents(String commaSeparatedEvents) {
> String[] stringArray = commaSeparatedEvents.split(",");
> Set<FileEventEnum> eventsSet = new HashSet<>();
> for (String event : stringArray) {
> eventsSet.add(FileEventEnum.valueOf(event.trim()));
> }
> events = eventsSet.isEmpty() ? new 
> HashSet<>(Arrays.asList(FileEventEnum.values())) : eventsSet;
> }
> (FileWatchEndpoint.java) events object declaration
> @UriParam(label = "consumer",
> enums = "CREATE,MODIFY,DELETE",
> description = "Comma separated list of events to watch.",
> defaultValue = "CREATE,MODIFY,DELETE")
> private Set<FileEventEnum> events = new 
> HashSet<>(Arrays.asList(FileEventEnum.values()));
> Basically the conversion from String to Set<FileEventEnum> fails and the 
> component is calling the first method listed above with Set<String> instead 
> of Set<FileEventEnum>
> I got it to work by adding a converter from String to Set<FileEventEnum> but 
> I feel like this should have been taken care of by the component.
> Let me know what you think



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to