Package org.jmock

Examples of org.jmock.Mockery.mock()


  }

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


public class SessionBeanInterfaceModifierTest extends TestCase {
    public void testShouldRemoveEJBObjectInterfaceAndAddRemoteInterface() throws Exception {
        Mockery context = new Mockery();

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

        context.checking(new Expectations() {
            {
                one(facade).removeInterface("org.superbiz.StoreBean", "javax.ejb.SessionBean");
                one(facade).removeInterface("org.superbiz.Store", "javax.ejb.EJBObject");
View Full Code Here

    }

    public void testShouldRemoveEJBLocalObjectInterfaceAndAddLocalInterface() throws Exception {
        Mockery context = new Mockery();

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

        context.checking(new Expectations() {
            {
                one(facade).removeInterface("org.superbiz.StoreBean", "javax.ejb.SessionBean");
                one(facade).removeInterface("org.superbiz.Store", "javax.ejb.EJBLocalObject");
View Full Code Here

    }

    public void testShouldOnlyRemoveSessionBeanInterfaceIfNoRemoteOrLocalInterfaceSopecified() throws Exception {
        Mockery context = new Mockery();

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

        context.checking(new Expectations() {
            {
                one(facade).removeInterface("org.superbiz.StoreBean", "javax.ejb.SessionBean");
            }
View Full Code Here

    }

    public void testShouldNotThrowExceptionOnNullEjbClassName() throws Exception {
        Mockery context = new Mockery();

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

        AppModule module = new TestFixture().getAppModule("emptysession-ejb-jar.xml", null);
        new SessionBeanInterfaceModifier(facade).convert(module);

        context.assertIsSatisfied();
View Full Code Here

public class EntityBeanConverterTest 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");
    InputSource ejbJarSrc = new InputSource(is);

        AppModule appModule = new TestFixture().getAppModule(ejbJarSrc, null);
    new EntityBeanConverter(jdtFacade).convert(appModule);
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");
    InputSource ejbJarSrc = new InputSource(is);

        AppModule appModule = new TestFixture().getAppModule(ejbJarSrc, null);
    new EntityBeanConverter(jdtFacade).convert(appModule);
View Full Code Here

 
  public void testShouldNotThrowExceptionForEmptyRelationship() throws Exception {
    Mockery context = new Mockery();
   
    IJDTFacade jdtFacade = context.mock(IJDTFacade.class);
    InputStream is = getClass().getResourceAsStream("emptyrelationship-ejb-jar.xml");
    InputSource ejbJarSrc = new InputSource(is);

        AppModule appModule = new TestFixture().getAppModule(ejbJarSrc, null);
    new EntityBeanConverter(jdtFacade).addRelationshipAnnotations(appModule);
View Full Code Here

  }
 
  public void testAddAnnotationsForOneToManyRelationship() throws Exception {
    Mockery context = new Mockery();
   
    final IJDTFacade jdtFacade = context.mock(IJDTFacade.class);
    InputStream is = getClass().getResourceAsStream("onetomany-ejb-jar.xml");
    InputSource ejbJarSrc = new InputSource(is);

        AppModule appModule = new TestFixture().getAppModule(ejbJarSrc, null);
   
View Full Code Here

  }
 
  public void testAddAnnotationsForManyToManyRelationship() throws Exception {
    Mockery context = new Mockery();
   
    final IJDTFacade jdtFacade = context.mock(IJDTFacade.class);
    InputStream is = getClass().getResourceAsStream("manytomany-ejb-jar.xml");
    InputSource ejbJarSrc = new InputSource(is);

        AppModule appModule = new TestFixture().getAppModule(ejbJarSrc, null);
   
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.