This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Spring provides several options for making a DataSource available to your application. | |
(1) Getting a DataSource from JNDI --> | |
<bean id=”dataSource” | |
class=”org.springframework.jndi.JndiObjectFactoryBean“> | |
<property name=”jndiName”> | |
<value>java:comp/env/jdbc/myDatasource</value> | |
</property> | |
</bean> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--(1) In web.xml (\WEB-INF\web.xml) add the following --> | |
<resource-ref> | |
<description> | |
Resource reference to a factory for java.sql.Connection | |
instances that may be used for talking to the database | |
that is configured in server.xml in TOMCAT. | |
For JBOSS- jboss-web.xml and *-ds.xml | |
</description> | |
<res-ref-name>jdbc/SampleDB</res-ref-name> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(JMock.class) | |
public class HomeControllerTest { | |
Mockery context = new JUnit4Mockery(); | |
//mock object : ContactDAO (using JMock) | |
ContactDAOInterface contactDAO = context.mock(ContactDAOInterface.class); | |
// Spring MVC controller | |
HomeController cc = new HomeController(); | |
// mock objects (using spring mock) | |
private MockHttpServletRequest request; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TemperatureServiceImple .java | |
package uk.co.mo.training.ws; | |
import javax.jws.WebService; | |
import org.springframework.stereotype.Service; | |
@SuppressWarnings("restriction") | |
@WebService(endpointInterface = "uk.co.mo.training.ws.TemperatureService",serviceName="temperatureService") | |
@Service | |
public class TemperatureServiceImple implements TemperatureService { |
NewerOlder