View Javadoc

1   /*
2    * EL4J, the Extension Library for the J2EE, adds incremental enhancements to
3    * the spring framework, http://el4j.sf.net
4    * Copyright (C) 2005 by ELCA Informatique SA, Av. de la Harpe 22-24,
5    * 1000 Lausanne, Switzerland, http://www.elca.ch
6    *
7    * EL4J is published under the GNU Lesser General Public License (LGPL)
8    * Version 2.1. See http://www.gnu.org/licenses/
9    *
10   * This program is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13   * GNU Lesser General Public License for more details.
14   *
15   * For alternative licensing, please contact info@elca.ch
16   */
17  package ch.elca.el4j.tests.remoting.jaxws;
18  
19  import org.junit.Test;
20  
21  import static org.junit.Assert.assertTrue;
22  
23  import com.xmlme.webservices.ShakespeareSoap;
24  
25  /**
26   * This class is a test for JAX-WS using classes generated by wsimport.
27   *
28   * @svnLink $Revision: 4181 $;$Date: 2010-10-28 09:12:24 +0200 (Do, 28. Okt 2010) $;$Author: sstelca $;$URL: https://el4j.svn.sourceforge.net/svnroot/el4j/branches/el4j_3_1/el4j/framework/tests/remoting_jaxws/functional-tests/src/test/java/ch/elca/el4j/tests/remoting/jaxws/ShakespeareTest.java $
29   *
30   * @author Stefan Wismer (SWI)
31   */
32  public class ShakespeareTest extends AbstractJaxwsTest {
33  	
34  	/** {@inheritDoc} */
35  	@Override
36  	protected String[] getIncludeConfigLocations() {
37  		return new String[] {"classpath*:mandatory/*.xml",
38  			"classpath*:scenarios/db/raw/*.xml",
39  			"classpath*:scenarios/dataaccess/*.xml",
40  			"classpath*:scenarios/dataaccess/hibernate/*.xml",
41  			"classpath*:scenarios/dataaccess/hibernate/refdb/*.xml",
42  			"scenarios/client/remotingtests-jaxws-shakespeare-config.xml"};
43  	}
44  	
45  	/**
46  	 * Test ShakeSpeareService.
47  	 */
48  	@Test
49  	public void testShakeSpeareService() {
50  		ShakespeareSoap s = getShakespeare();
51  		String speech = s.getSpeech("To be, or not to be");
52  		assertTrue(speech.startsWith("<SPEECH><PLAY>HAMLET</PLAY><SPEAKER>HAMLET</SPEAKER>"
53  			+ "To be, or not to be: that is the question: Whether 'tis nobler"));
54  		assertTrue(speech.endsWith("in thy orisons Be all my sins remember'd.</SPEECH>"));
55  	}
56  	
57  	/**
58  	 * Get the Shakespeare to use.
59  	 * @return Shakespeare to use
60  	 */
61  	public ShakespeareSoap getShakespeare() {
62  		return (ShakespeareSoap) getApplicationContext().getBean("shakespeare");
63  	}
64  }