Hi Oliver,

As for my use case, I want to relocate the file generated by pax (or copy 
it) in a specific folder so I can view its contents while debugging, 
nothing too big or fancy. I initially thought such a task would be easy to 
do. As for the symbolic name, my fault: yes I meant the probe name, not the 
symbolic name. Sorry for the confusion.

On Wednesday, April 8, 2020 at 8:54:15 PM UTC+2, Oliver Lietz wrote:
>
> On Tuesday, April 7, 2020 6:39:17 PM CEST Massimo Bono wrote: 
> > Hi all, 
>
> Hi Massimo, 
>
> > I'm exploring the pax-exam project because* I want to change the 
> location 
> > of the pax-exam probe generated* (location in the file system and 
> possibly 
> > its name): I'm using a karaf container to actually test and in that 
> project 
> > in order to configure the probe itself I need to specify a method 
> annotated 
> > with "@ProbeBuilder". By looking where the annotation "@ProbeBuilder" 
> was 
> > actually used I discovered the methods `overwriteWithUserDefinition` and 
> > `createProbeBuilder` in `TestProbeBuilder` which , apparently, creates a 
> > probe implementation from a template (i.e., system.createProbe()). 
> Looking 
> > at the method interface it seems that I just need to change the tem dir 
> via 
> > the method `setTempDir`. 
> > 
> > However, there is a problem: the associated method `getTempDir`, 
> > technically used to retrieve such a temp directory, is not used in the 
> > project at all (or at least, a search in my IDE gave no usage result). 
> > 
> > Since I couldn't find usages of `getTempDir` method, I turn my attention 
> on 
> > `system.createProbe()`. The only implementation I found was in 
> > `ReactorManager.createProbeBuilder`. 
> > Here I noticed that the `tempDir` field of the pax-probe is populated by 
> a 
> > temporary folder via the line `cache = createTemp(new 
> > File(work.getWorkingDirectory()));` whereas the `store` variable may 
> > represents an abstract storage location. Inspecting further the standard 
> > implementation of `TestProbeBuilderImpl.build()` seems to reveal that 
> such 
> > a variable is responsible to decide where the probe is actually stored. 
> > 
> > In particular, it seems that  the only implementation of `Store`, 
> > `TemporaryStore`, actually creates the probe in temp file via 
> > `createTempFile` and only then transfer it in a given location 
> > `TemporaryStore.getLocation()`. So changing the return value of such a 
> > method should do the trick. 
> > 
> > 
> > My questions are: 
> >  - what is the real purpose of `getTempDir` method in 
> `TestProbeBuilder`? 
> > Is is really useless or it has an implicit need? 
> >  - I've noticed that both the filename of such a probe and its symbolic 
> > name are hardcoded? Do you know any location in pax-exam (or karaf) 
> where 
> > such hardcoded names are used? I ask this because if I can, I would like 
> to 
> > change them :) 
> >  - Is it indeed safe to change the instance of `Store` with another that 
> > allows me to change the actual probe-location? 
> >  - If I want to add some javadoc documentation in some classes (like the 
> > totally undocumented `TestProbeBuilder`), what are the contribution 
> rules? 
> > Can you give me a link to them so I can read them? On pax-exam site I 
> > couldn't find them, but maybe I'm just stupid :D 
> > 
> > Thanks for any kind reply 
>
> Why do you want to access the probe as file? 
> You can change the symbolic name via TestProbeBuilder. 
>
> Regards, 
> O. 
>
>
>
>
>

-- 
-- 
------------------
OPS4J - http://www.ops4j.org - [email protected]

--- 
You received this message because you are subscribed to the Google Groups 
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ops4j/12a618f4-7445-4840-9022-312893d02504%40googlegroups.com.

Reply via email to