users@jersey.java.net

[Jersey] Jersey Test Framework

From: Robert Naczinski <robert.naczinski_at_googlemail.com>
Date: Tue, 9 Aug 2011 08:18:26 +0200

Hello,

I try to use Jersey-testing framework. It's really cool. My pom.xml has:
..
<dependency>
            <groupId>com.sun.jersey.jersey-test-framework</groupId>
            <artifactId>jersey-test-framework-grizzly</artifactId>
            <version>${jersey.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.sun.grizzly</groupId>
            <artifactId>grizzly-servlet-webserver</artifactId>
            <version>1.9.8</version>
        </dependency>
...

Unfortunately I get when starting the test
java.lang.NoClassDefFoundError: org.glassfish.grizzly.Grizzly

What am I doing wrong?

My code is:

import org.junit.Test;

import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.test.framework.JerseyTest;
import com.sun.jersey.test.framework.spi.container.TestContainerException;

import static org.junit.Assert.*;

public class TestPropertyResource extends JerseyTest {

        public TestPropertyResource() throws TestContainerException {
                super("bla.resources.properties");
        }
        
         @Test
   public void testHelloWorld() {
       WebResource webResource = resource();
       String uri =
"services/property/beispielanwendung.properties?propertyName=property";
                         String responseMsg = webResource.path(uri).get(String.class);
       assertEquals("Hello World", responseMsg);
   }
}


Can someone give me a tip.

Robert