source: DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/rest/ResourcesTest.java @ 3722

Last change on this file since 3722 was 3722, checked in by olhsha, 11 years ago

adding schemaLocation property via customising marshaller. Works, however the value of the schema location is not picked up from context.xml

File size: 2.0 KB
Line 
1/*
2 * Copyright (C) 2013 DASISH
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
17 */
18package eu.dasish.annotation.backend.rest;
19
20import com.sun.jersey.spi.spring.container.servlet.SpringServlet;
21import com.sun.jersey.test.framework.JerseyTest;
22import com.sun.jersey.test.framework.WebAppDescriptor;
23import org.jmock.Mockery;
24import org.springframework.web.context.ContextLoaderListener;
25import org.springframework.web.context.WebApplicationContext;
26
27/**
28 *
29 * @author olhsha
30 */
31public class ResourcesTest extends JerseyTest{
32   
33    protected Mockery mockeryRest;   
34    final protected WebApplicationContext webAppContext;
35   
36    public ResourcesTest(String packageName) {
37       
38        // debug
39       
40       
41        super(new WebAppDescriptor.Builder(packageName)
42                .servletClass(SpringServlet.class)
43                .contextParam("contextConfigLocation", "classpath*:spring-test-config/**/*.xml")
44                .contextListenerClass(ContextLoaderListener.class)
45                .build());
46
47        // Get the web application context that has been instantiated in the Grizzly container
48        webAppContext = ContextLoaderListener.getCurrentWebApplicationContext();
49
50        // Get the context and mock objects from the context by their type
51        mockeryRest = webAppContext.getBean(Mockery.class);
52    }
53
54}
Note: See TracBrowser for help on using the repository browser.