Empire static 'init'

13 views
Skip to first unread message

Davide Sottara

unread,
Jan 17, 2018, 7:50:50 AM1/17/18
to Empire
Testing Empire 1.0, I have written a JUnit Test with different test cases, using different annotated class models and different implementation modules (Jena, Sesame).  
In particular, I use the annotations on sets of interfaces, providing matching implementation classes, listed in 'empire.annotation.index' for Empire to pick them up.

While each test works individually, they start failing when I run them as a suite...

I have noticed that Empire can be (re)initialized using Empire.init(...), resetting the internal modules and even the singleton instance injector.
However, once the Empire singleton is instantiated, there is no apparent way to change: 
  • the (Properties)AnnotationProvider and thus the value of the configuration properties
  • the RdfGenerator class caches, in particular TYPES_TO_CLASS.
So, I could not find an easy way to instantiate different persistence providers with different models. 
Notice that the failure is not evident, since Empire will still generate implementing classes for the annotated interfaces
Is this on purpose, or is something missing?

Thank you in advance
Davide

 

Michael Grove

unread,
Jan 17, 2018, 7:52:13 AM1/17/18
to empir...@googlegroups.com
The original intent was that init would only be called once.

Cheers,

Mike

--
You received this message because you are subscribed to the Google Groups "Empire" group.
To unsubscribe from this group and stop receiving emails from it, send an email to empire-rdf+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages