3 Replies Latest reply on Nov 10, 2004 4:35 PM by Joe Simone

    Running a junit test from inside of Eclipse 3.0

    Joe Simone Newbie

      I am porting our complete J2EE application to JBoss from Websphere. Our application passed all junit tests run from inside WS studio 5.1 (Eclipse 2.1).

      Now I am using JBoss 4.0 running inside of Eclipse 3.0.1 with the JBoss IDE 1.4. I have been able to do a clean build, deploy and start of the server. I am also using MySQL 4.1 and have successfully connected and created all the tables from the jbosscmp-jdbc.xml descriptor during deployment of the ear file.

      So now I am at the point where I would like to run a simple test case to create some data in one of the entity beans. (ie addCustomer).

      However, I am at a loss to understand how to get my junit test to connect to the remote session bean running inside the server.

      My jndi.properties looks like this:

      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.provider.url=jnp://localhost:1099
      java.naming.factory.url.pkgs=org.jboss.naming.client
      j2ee.clientName=junit-client

      And I have defined a jboss-client.xml that looks like this:

      <jboss-client>
      <jndi-name>junit-client</jndi-name>
      <ejb-ref>
      <ejb-ref-name>ejb/com/e2m/beans/session/ConferenceMgrHome</ejb-ref-name>
      <jndi-name>ejb/com/e2m/beans/session/ConferenceMgrHome</jndi-name>
      </ejb-ref>
      </jboss-client>

      But when I try to run the junit test case I get an exception from trying to get the initial context that says "junit-client not bound"

      Where do I put jboss-client file? I have it under META-INF in the ear, but I don't think it is correct. I checked the packaging xml and it is included in the build.

      I am using the JBoss quick start guide but I am finding that it is not too specific about this particular aspect of running a remote client.

      Any help or enlightenment is much appreciated.

      Kind regards,
      Joe

        • 1. Possibly good tunig switches on JBoss
          Joe Simone Newbie

          Hi,

          I am working on a project for comparing JBoss to SAP Netweaver using the SPECjAppServer2004 benchmark. Unfortunately allready at TxRate 6 our JBoss droduces 80% Load on the server and has response-times of over 10seconds. Its competitor only about produces half the load on the same system at this rate. If we compare BEAs response time of about 100ms to the 10seconds of JBoss this is a gigantic difference.

          At the moment we are trying to get the JRockit VM working. In previous JBoss 3.x tests response times were only 1/3 of the response times with the sun sdk. But even with 3 seconds response times the results are still far from good.

          The funny thing is that everything was fine at TxRate 3 (Good load and response times).

          Any Ideas of how I can reduce system load and response-times? Which are the parameters which could have an effect on this? I woud try them out.

          Thanks in advance,
          Christofer Dutz

          • 2. Re: Running a junit test from inside of Eclipse 3.0
            kornel csaszar Newbie

            This is what I have for JNDI:

            java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
            java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
            java.naming.provider.url=jnp://localhost:1099

            • 3. Re: Running a junit test from inside of Eclipse 3.0
              Joe Simone Newbie

              Try as I might, with or without

              j2ee.clientName=junit-client

              in the jndi.properties file, I am not able to run a single test case.

              Does anyone know how I can get this to work?
              Thanks,
              Joe