Hello,

I'm trying to use Pax Exam Karaf (in Karaf 2.3.0). In my setup I use .xml
file in the Karaf deploy folder to instantiate beans and services; I also
use xbean-blueprint to make use of a custom xml namespace.

Now I want to make testing easier with Pax Exam (it's my first experience
with Pax Exam). I'm trying to achieve this by setting up the test
environment like this:

@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class TestMonitor {

        @Configuration
        public static Option[] configuration() throws Exception {
                System.out.print("Before configuration of karaf");
                return new Option[] {
                                karafDistributionConfiguration()
                                                .frameworkUrl(
                                                                
"mvn:org.apache.karaf/apache-karaf/2.3.0/zip")
                                                
.karafVersion("2.3.0").name("TestKaraf")
                                                .unpackDirectory(new 
File("target/paxexam/unpack")),
                                junitBundles(),
                                mavenBundle("org.apache.geronimo.specs", 
"geronimo-jta_1.1_spec",
"1.1.1"),
                                mavenBundle("org.apache.geronimo.specs", 
"geronimo-jms_1.1_spec",
"1.1.1"),
                                mavenBundle("org.apache.xbean", 
"xbean-blueprint", "3.12"),
                                mavenBundle("mypackage", 
"status-tables","0.0.1-SNAPSHOT"),
                                provision("file:C:\\Documents and
Settings\\Neduz\\workspace\\StatusTables.xml") 
                        };
        }


Instead of "provision" I also tried "org.ops4j.pax.exam.CoreOptions.bundle",
but this doesn't seem to instantiate the beans & services defined in the XML

I use this to get a reference to the "StatusTable" created in the XML file:

         @Inject
         private StatusTable statusTable;

But this always results in:
test:TestMonitor.test:KarafTestContainer{mvn:org.apache.karaf/apache-karaf/2.3.0/zip}(mypackage.tests.TestMonitor)
 
Time elapsed: 28.11 sec  <<< ERROR!
org.ops4j.pax.swissbox.framework.ServiceLookupException: gave up waiting for
service mypackage.StatusTable

How can I properly get an blueprint xml "interpreted" in a pax-exam-karaf
environment? 

Kind regards,

Tom Mercelis



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Pax-Exam-Karaf-deploy-blueprint-XML-files-tp4026693.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Reply via email to