0 Replies Latest reply on Aug 26, 2016 5:42 AM by prameelapodigiri

    Switchyard application testing using Junit

    prameelapodigiri

      Hi Team ,

       

        I have written code to test switch yard application using junit.Please find the attached piece of code.

       

      @RunWith(SwitchYardRunner.class)

      @SwitchYardTestCaseConfig(config = "META-INF/switchyard.xml")

      public class FMJobReaderJunit {

      //logic

      }

       

      For this i am getting class not found exception.

      java.lang.Exception: org.switchyard.SwitchYardException: SWITCHYARD039606: Unable to instantiate strategy class: org.switchyard.remote.cluster.HAClusterStrategy

        at org.switchyard.test.SwitchYardRunner.createTest(SwitchYardRunner.java:64)

        at org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:244)

        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)

        at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:241)

        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)

        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

       

      Caused by: java.lang.ClassNotFoundException: org.switchyard.remote.cluster.HAClusterStrategy

        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)

        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

        at java.security.AccessController.doPrivileged(Native Method)

        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)

        at org.switchyard.component.sca.SCAInvoker.createLoadBalancer(SCAInvoker.java:276)

        ... 25 more

       

      Please help me to resolve this issue.

       

      Thanks

      -Prameela