Michael Hanl | e56bb89 | 2016-05-25 17:34:41 +0200 | [diff] [blame] | 1 | import com.sun.jersey.api.client.ClientResponse; |
| 2 | import com.sun.jersey.test.framework.JerseyTest; |
| 3 | import com.sun.jersey.test.framework.spi.container.TestContainerFactory; |
| 4 | import com.sun.jersey.test.framework.spi.container.grizzly.web.GrizzlyWebTestContainerFactory; |
| 5 | import de.ids_mannheim.korap.config.BeansFactory; |
| 6 | import org.junit.AfterClass; |
| 7 | import org.junit.BeforeClass; |
| 8 | import org.junit.Test; |
| 9 | |
| 10 | /** |
| 11 | * @author hanl |
| 12 | * @date 29/07/2015 |
| 13 | */ |
| 14 | @Deprecated |
| 15 | public class JerseyTest1 extends JerseyTest { |
| 16 | |
| 17 | public JerseyTest1 () { |
| 18 | super("de.ids_mannheim.korap.web.service", |
| 19 | "de.ids_mannheim.korap.web.utils"); |
| 20 | } |
| 21 | |
| 22 | |
| 23 | @BeforeClass |
| 24 | public static void setup () { |
| 25 | BeansFactory.loadClasspathContext(); |
| 26 | } |
| 27 | |
| 28 | |
| 29 | @AfterClass |
| 30 | public static void close () { |
| 31 | BeansFactory.closeApplication(); |
| 32 | } |
| 33 | |
| 34 | |
| 35 | @Override |
| 36 | protected TestContainerFactory getTestContainerFactory () { |
| 37 | return new GrizzlyWebTestContainerFactory(); |
| 38 | } |
| 39 | |
| 40 | |
| 41 | @Test |
| 42 | public void testFieldsInSearch () { |
| 43 | ClientResponse response = resource().path("v0.1/search") |
| 44 | .queryParam("q", "[base=Wort]").queryParam("ql", "poliqarp") |
| 45 | .get(ClientResponse.class); |
| 46 | System.out.println("response " + response); |
| 47 | } |
| 48 | } |