Thanks!!
Got it worked using classpath.
placing context.xml in WEB-INF/classes and use classpath:context.xml in bean definition.
Thanks
Thanks!!
Got it worked using classpath.
placing context.xml in WEB-INF/classes and use classpath:context.xml in bean definition.
Thanks
How do we call a function from a service.java file from bean.
I am done with constructor using <constructor-arg> tag and for setters <property> tags...
how a call a method?
For example:
in bean.xml file:Code:public class loginService implements loginInterface { @Override public void login_function(String a, String b, String c) { // TODO Auto-generated method stub loginDAO.login(a,b,c); } }
<bean id="login" class="loginService">
</bean>
This wont work....
How do we call a service method from bean and also hoe do we pass parameters to it?
i have Mainservlet file in default package..
also mapped it in web.xml file and added <bean id="main" class="MainServlet"></bean> in beans.xml
Then why i get the above exception???
Code:SEVERE: Error loading WebappClassLoader delegate: false repositories: /WEB-INF/classes/ ----------> Parent Classloader: org.apache.catalina.loader.StandardClassLoader@4c0da7c3 MainServlet java.lang.ClassNotFoundException: MainServlet at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1438) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1284) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1068) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:791) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:127) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
How to Start :-
1. Import Maven dependency
<dependency>
<groupId>net.javacrumbs</groupId>
<artifactId>spring-ws-test</artifactId>
<version>0.21</version>
</dependency>
2. Write your test
@RunWith(SpringJUnit4ClassRunner.class)
//load your standard Spring configuration
@ContextConfiguration(locations={"classpath:spring/applicationContext.xml"})
//Add the listener
@TestExecutionListeners({WsMockControlTestExecutio nListener.class, DependencyInjectionTestExecutionListener.class})
public class AirlineWsClient4Test {
//inject the class under the test
@Autowired
private AirlineWsClient client;
//inject mock control
@Autowired
private WsMockControl mockControl;
@Test
public void testCall()
{
//teach mock what to do
mockControl.expectRequest("expected-request.xml")
.returnResponse("response-to-be-returned.xml");
//call WS client code
long ticketId = client.bookFlight(input,params,here);
assertEquals(123456L, ticketId);
//verify all the calls
mockControl.verify();
}
}
3. And you are done. The library will verify that your Spring configuration is correct, that the request generated by your code corresponds to what you expect and the framework will return the response specified in the "response-to-be-returned.xml" file. Everything in memory, without any HTTP connection so it's reasonably fast.
If you need more functional test style configuration, please read functional test reference.
Last edited by ericlewis107; Apr 4th, 2012 at 06:42 AM. Reason: not written step