Re: [osgi-dev] enRoute workspace debugging

2019-02-02 Thread Ferry Huberts via osgi-dev
You could try and turn off sources and see what happens.

-sources: false

I use
-sources: ${if;${gestalt;batch};false;true}
in my Gradle build, to have sources in the bundles when building in
bndtools, and no sources when building in gradle/jenkins


On 02/02/2019 14:57, Ferry Huberts via osgi-dev wrote:
> Maybe it is inconvenient, but I think that strictly speaking that is
> absolutely right, since those java files correspond to what is actually
> running.
> 
> On 02/02/2019 14:52, Thomas Driessen via osgi-dev wrote:
>> It seems those are the .java files within the OSGI-OPT folder of the
>> generated  bundle/.jar.
>> But I have no idea why Eclipse picks those up when it is debugging. 
>> I used the enroute archetypes and didn't change anything.
>> Maybe it's just a setting somewhere in Eclipse that has to be changed or
>> within the pom files, I don't know :(
>>
>> Am Sa., 2. Feb. 2019 um 03:55 Uhr schrieb Raymond Auge via osgi-dev
>> mailto:osgi-dev@mail.osgi.org>>:
>>
>> The bigger question is why I'm the world are there java files in
>> target? target is the build directory. We are there source files in
>> there?
>>
>> - Ray
>>
>> On Fri, Feb 1, 2019, 13:47 Paul F Fraser via osgi-dev
>> mailto:osgi-dev@mail.osgi.org> wrote:
>>
>> Thomas,
>> Thank goodness someone else has experienced this. I thought it
>> was my problem only.
>> I mentioned this on this list previously but so far no response.
>> Paul
>>
>>
>> On 2/02/2019 3:54 am, Thomas Driessen via osgi-dev wrote:
>>> Hi,
>>>
>>> now that I'm using the enroute maven workspace I stumbled upon
>>> another issue.
>>>
>>> When I'm debugging and a breakpoint is hit, then Eclipse does
>>> not open the respective .java file in my project,
>>> but the java file from the target folder. 
>>> Now each time I want to change breakpoints/code/etc. I have to
>>> go back to the workspace .java file.
>>> Is there a way to tell Eclipse to use the workspace .java file
>>> instead of the target folder .java file for debugging?
>>>
>>> Kind regards,
>>> Thomas
>>>
>>> ___
>>> OSGi Developer Mail List
>>> osgi-dev@mail.osgi.org <mailto:osgi-dev@mail.osgi.org>
>>> https://mail.osgi.org/mailman/listinfo/osgi-dev
>>
>>
>> ___
>> OSGi Developer Mail List
>> osgi-dev@mail.osgi.org <mailto:osgi-dev@mail.osgi.org>
>> https://mail.osgi.org/mailman/listinfo/osgi-dev
>>
>> ___
>> OSGi Developer Mail List
>> osgi-dev@mail.osgi.org <mailto:osgi-dev@mail.osgi.org>
>> https://mail.osgi.org/mailman/listinfo/osgi-dev
>>
>>
>> ___
>> OSGi Developer Mail List
>> osgi-dev@mail.osgi.org
>> https://mail.osgi.org/mailman/listinfo/osgi-dev
>>
> 

-- 
Ferry Huberts
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] enRoute workspace debugging

2019-02-02 Thread Ferry Huberts via osgi-dev
Maybe it is inconvenient, but I think that strictly speaking that is
absolutely right, since those java files correspond to what is actually
running.

On 02/02/2019 14:52, Thomas Driessen via osgi-dev wrote:
> It seems those are the .java files within the OSGI-OPT folder of the
> generated  bundle/.jar.
> But I have no idea why Eclipse picks those up when it is debugging. 
> I used the enroute archetypes and didn't change anything.
> Maybe it's just a setting somewhere in Eclipse that has to be changed or
> within the pom files, I don't know :(
> 
> Am Sa., 2. Feb. 2019 um 03:55 Uhr schrieb Raymond Auge via osgi-dev
> mailto:osgi-dev@mail.osgi.org>>:
> 
> The bigger question is why I'm the world are there java files in
> target? target is the build directory. We are there source files in
> there?
> 
> - Ray
> 
> On Fri, Feb 1, 2019, 13:47 Paul F Fraser via osgi-dev
> mailto:osgi-dev@mail.osgi.org> wrote:
> 
> Thomas,
> Thank goodness someone else has experienced this. I thought it
> was my problem only.
> I mentioned this on this list previously but so far no response.
> Paul
> 
> 
> On 2/02/2019 3:54 am, Thomas Driessen via osgi-dev wrote:
>> Hi,
>>
>> now that I'm using the enroute maven workspace I stumbled upon
>> another issue.
>>
>> When I'm debugging and a breakpoint is hit, then Eclipse does
>> not open the respective .java file in my project,
>> but the java file from the target folder. 
>> Now each time I want to change breakpoints/code/etc. I have to
>> go back to the workspace .java file.
>> Is there a way to tell Eclipse to use the workspace .java file
>> instead of the target folder .java file for debugging?
>>
>> Kind regards,
>> Thomas
>>
>> ___
>> OSGi Developer Mail List
>> osgi-dev@mail.osgi.org 
>> https://mail.osgi.org/mailman/listinfo/osgi-dev
> 
> 
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org 
> https://mail.osgi.org/mailman/listinfo/osgi-dev
> 
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org 
> https://mail.osgi.org/mailman/listinfo/osgi-dev
> 
> 
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev
> 

-- 
Ferry Huberts
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] How to mock annotation based configs with defaults

2018-04-27 Thread Ferry Huberts via osgi-dev
Ah that link is dead.
You can get it here now: https://github.com/99soft/miyamoto

On 27/04/18 17:54, Ferry Huberts via osgi-dev wrote:
> I use https://code.google.com/p/miyamoto/ in my unit tests. Will work in
> other contexts as well.
> 
> 
> On 27/04/18 14:59, João Assunção via osgi-dev wrote:
>> I'm using a custom version of Peter
>> Kriens aQute.configurable.Configurable. Initially, I was using it only
>> for unit testing but now when I need to run DS components in a plain
>> java application (non OSGi).
>>
>> Regards,
>> João Assunção
>>
>> Email: joao.assun...@exploitsys.com <mailto:joao.assun...@exploitsys.com>
>> Mobile: +351 916968984
>> Phone: +351 211933149
>> Web: www.exploitsys.com <http://www.exploitsys.com>
>>
>>
>>
>> On Fri, Apr 27, 2018 at 12:11 PM, Tim Ward via osgi-dev
>> <osgi-dev@mail.osgi.org <mailto:osgi-dev@mail.osgi.org>> wrote:
>>
>> Have you tried using the OSGi converter?
>>
>> You can fill a map with properties and then just:
>>
>> Converters.standardConverter().convert(map).to(MessagingEndpoint.class)
>>
>> This will honour the defaults from the annotation - see 707.4.4.4.5
>> of the compendium. The closest link I can give
>> is 
>> https://osgi.org/specification/osgi.cmpn/7.0.0/util.converter.html#util.converter-maps
>> 
>> <https://osgi.org/specification/osgi.cmpn/7.0.0/util.converter.html#util.converter-maps>
>>
>>
>> Tim
>>
>>> On 27 Apr 2018, at 12:06, Christian Schneider via osgi-dev
>>> <osgi-dev@mail.osgi.org <mailto:osgi-dev@mail.osgi.org>> wrote:
>>>
>>> I am using DS components with type safe configs like below.
>>> My innermost tests should run outside of OSGi. So I am using Mockito
>>> to inject dependencies into my component. 
>>>
>>> For configs I use
>>>
>>> @Mock
>>> MessagingEndpoint;
>>>
>>> In the test I then define behaviour like:
>>>
>>> when(config.endpoint()).thenReturn("http://localhost:8082
>>> <http://localhost:8082/>");
>>>
>>>
>>> This works but you do not get the default values. So you have to
>>> set all config attributes. 
>>>
>>> Is there a better way to simulate such configs?
>>>
>>> Christian
>>>
>>> -
>>> @ObjectClassDefinition(name = "My config")
>>> public@interface MessagingEndpoint{
>>>
>>>     @AttributeDefinition
>>>     String endpoint() default "http://localhost:8176
>>> <http://localhost:8176/>";
>>>
>>>     @AttributeDefinition
>>>     int connectTimeout() default 5000;
>>> }
>>>
>>> -- 
>>> -- 
>>> Christian Schneider
>>> http://www.liquid-reality.de <http://www.liquid-reality.de/>
>>>
>>> Computer Scientist
>>> http://www.adobe.com <http://www.adobe.com/>
>>>
>>> ___
>>> OSGi Developer Mail List
>>> osgi-dev@mail.osgi.org <mailto:osgi-dev@mail.osgi.org>
>>> https://mail.osgi.org/mailman/listinfo/osgi-dev
>>> <https://mail.osgi.org/mailman/listinfo/osgi-dev>
>>
>>
>> ___
>> OSGi Developer Mail List
>> osgi-dev@mail.osgi.org <mailto:osgi-dev@mail.osgi.org>
>> https://mail.osgi.org/mailman/listinfo/osgi-dev
>> <https://mail.osgi.org/mailman/listinfo/osgi-dev>
>>
>>
>>
>>
>> ___
>> OSGi Developer Mail List
>> osgi-dev@mail.osgi.org
>> https://mail.osgi.org/mailman/listinfo/osgi-dev
>>
> 

-- 
Ferry Huberts
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] How to mock annotation based configs with defaults

2018-04-27 Thread Ferry Huberts via osgi-dev
I use https://code.google.com/p/miyamoto/ in my unit tests. Will work in
other contexts as well.


On 27/04/18 14:59, João Assunção via osgi-dev wrote:
> I'm using a custom version of Peter
> Kriens aQute.configurable.Configurable. Initially, I was using it only
> for unit testing but now when I need to run DS components in a plain
> java application (non OSGi).
> 
> Regards,
> João Assunção
> 
> Email: joao.assun...@exploitsys.com 
> Mobile: +351 916968984
> Phone: +351 211933149
> Web: www.exploitsys.com 
> 
> 
> 
> On Fri, Apr 27, 2018 at 12:11 PM, Tim Ward via osgi-dev
> > wrote:
> 
> Have you tried using the OSGi converter?
> 
> You can fill a map with properties and then just:
> 
> Converters.standardConverter().convert(map).to(MessagingEndpoint.class)
> 
> This will honour the defaults from the annotation - see 707.4.4.4.5
> of the compendium. The closest link I can give
> is 
> https://osgi.org/specification/osgi.cmpn/7.0.0/util.converter.html#util.converter-maps
> 
> 
> 
> 
> Tim
> 
>> On 27 Apr 2018, at 12:06, Christian Schneider via osgi-dev
>> > wrote:
>>
>> I am using DS components with type safe configs like below.
>> My innermost tests should run outside of OSGi. So I am using Mockito
>> to inject dependencies into my component. 
>>
>> For configs I use
>>
>> @Mock
>> MessagingEndpoint;
>>
>> In the test I then define behaviour like:
>>
>> when(config.endpoint()).thenReturn("http://localhost:8082
>> ");
>>
>>
>> This works but you do not get the default values. So you have to
>> set all config attributes. 
>>
>> Is there a better way to simulate such configs?
>>
>> Christian
>>
>> -
>> @ObjectClassDefinition(name = "My config")
>> public@interface MessagingEndpoint{
>>
>>     @AttributeDefinition
>>     String endpoint() default "http://localhost:8176
>> ";
>>
>>     @AttributeDefinition
>>     int connectTimeout() default 5000;
>> }
>>
>> -- 
>> -- 
>> Christian Schneider
>> http://www.liquid-reality.de 
>>
>> Computer Scientist
>> http://www.adobe.com 
>>
>> ___
>> OSGi Developer Mail List
>> osgi-dev@mail.osgi.org 
>> https://mail.osgi.org/mailman/listinfo/osgi-dev
>> 
> 
> 
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org 
> https://mail.osgi.org/mailman/listinfo/osgi-dev
> 
> 
> 
> 
> 
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev
> 

-- 
Ferry Huberts
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev