Package org.jmock

Examples of org.jmock.Mockery.mock()


  public GedapiServletTest( String testName ) throws ServletException
    {
        super( testName );
        LOG.finest("Running GedapiServletTest... Please be patient...");
      Mockery context = new Mockery();
      final ServletConfig servletConfig = context.mock(ServletConfig.class);
      //final ServletContext servletContext = context.mock(ServletContext.class);

      //try
      //{
        context.checking(new Expectations()
View Full Code Here


                        final String eTag, final String xNetworkReload,
                        final String requestMethod, final String errorMessage, final int testID)
      throws IOException, ServletException
  {
    Mockery context = new Mockery();
    final HttpServletRequest httpRequest = context.mock(HttpServletRequest.class);
    final HttpServletResponse httpResponse = context.mock(HttpServletResponse.class);
    final ByteArrayOutputStream out = new ByteArrayOutputStream();
    final PrintWriter httpResponseWriter = new PrintWriter(out);
   
      //try
View Full Code Here

                        final String requestMethod, final String errorMessage, final int testID)
      throws IOException, ServletException
  {
    Mockery context = new Mockery();
    final HttpServletRequest httpRequest = context.mock(HttpServletRequest.class);
    final HttpServletResponse httpResponse = context.mock(HttpServletResponse.class);
    final ByteArrayOutputStream out = new ByteArrayOutputStream();
    final PrintWriter httpResponseWriter = new PrintWriter(out);
   
      //try
      //{
View Full Code Here

  public GLinkServletTest( String testName )
    {
        super( testName );
        System.out.println("Running GLinkServletTest... Please be patient...");
      Mockery context = new Mockery();
      final ServletConfig servletConfig = context.mock(ServletConfig.class);
      //final ServletContext servletContext = context.mock(ServletContext.class);

      try
      {
        // DONE: need to setup an initial context here so that the correct DataSource object
View Full Code Here

public class EntityBeanUsageConverterTest extends TestCase {
    public void testShouldGenerateEntityManagerCodeForUsageOfEntityBean() throws Exception {
        Mockery context = new Mockery();

        final IJDTFacade facade = context.mock(IJDTFacade.class);

        context.checking(new Expectations() {
            {
                one(facade).addField("org.superbiz.StoreBean", "emf", "javax.persistence.EntityManagerFactory");
View Full Code Here

public class EjbReferencesConverterTest extends TestCase {
  public void testShouldNotThrowAnExceptionWhenProcessingAnEmptyEjbJar() throws Exception {
    Mockery context = new Mockery();
   
    IJDTFacade jdtFacade = context.mock(IJDTFacade.class);
    InputStream is = getClass().getResourceAsStream("empty-ejb-jar.xml");
    ClassLoader classLoader = getClass().getClassLoader();
   
    InputSource ejbJarSrc = new InputSource(is);
    EjbJar ejbJar = (EjbJar) JaxbJavaee.unmarshal(EjbJar.class, ejbJarSrc.getByteStream());
View Full Code Here

  }
 
  public void testShouldNotThrowAnExceptionWhenProcessingAnEmptyEnterpriseBeansElement() throws Exception {
    Mockery context = new Mockery();
   
    IJDTFacade jdtFacade = context.mock(IJDTFacade.class);
    InputStream is = getClass().getResourceAsStream("nobeans-ejb-jar.xml");
    ClassLoader classLoader = getClass().getClassLoader();
   
    InputSource ejbJarSrc = new InputSource(is);
    EjbJar ejbJar = (EjbJar) JaxbJavaee.unmarshal(EjbJar.class, ejbJarSrc.getByteStream());
View Full Code Here

  }

  public void testShouldNotThrowAnExceptionIfSessionBeanHasNoRemoteAndNoLocalClasses() throws Exception {
    Mockery context = new Mockery();
   
    IJDTFacade jdtFacade = context.mock(IJDTFacade.class);
    InputStream is = getClass().getResourceAsStream("badsession-ejb-jar.xml");
    ClassLoader classLoader = getClass().getClassLoader();
   
    InputSource ejbJarSrc = new InputSource(is);
    EjbJar ejbJar = (EjbJar) JaxbJavaee.unmarshal(EjbJar.class, ejbJarSrc.getByteStream());
View Full Code Here

  }
 
  public void testShouldNotThrowAnExceptionIfSessionBeanIsEmpty() throws Exception {
    Mockery context = new Mockery();
   
    IJDTFacade jdtFacade = context.mock(IJDTFacade.class);
    InputStream is = getClass().getResourceAsStream("emptysession-ejb-jar.xml");
    ClassLoader classLoader = getClass().getClassLoader();
   
    InputSource ejbJarSrc = new InputSource(is);
    EjbJar ejbJar = (EjbJar) JaxbJavaee.unmarshal(EjbJar.class, ejbJarSrc.getByteStream());
View Full Code Here

  }
 
  public void testShouldAddDIAnnotationForRemoteInterface() throws Exception {
    Mockery context = new Mockery();
   
    final IJDTFacade jdtFacade = context.mock(IJDTFacade.class);
    InputStream is = getClass().getResourceAsStream("single-session-bean.xml");
    ClassLoader classLoader = getClass().getClassLoader();
   
    InputSource ejbJarSrc = new InputSource(is);
    EjbJar ejbJar = (EjbJar) JaxbJavaee.unmarshal(EjbJar.class, ejbJarSrc.getByteStream());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.