Examples of Mockery


Examples of org.jmock.Mockery

        context.assertIsSatisfied();
    }

    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");
            }
        });

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

        context.assertIsSatisfied();
    }
View Full Code Here

Examples of org.jmock.Mockery

        context.assertIsSatisfied();
    }

    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

Examples of org.jmock.Mockery

import org.jmock.Mockery;
import org.xml.sax.InputSource;

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

Examples of org.jmock.Mockery

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

Examples of org.jmock.Mockery

    new EntityBeanConverter(jdtFacade).convert(appModule);
  }

 
  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

Examples of org.jmock.Mockery

        AppModule appModule = new TestFixture().getAppModule(ejbJarSrc, null);
    new EntityBeanConverter(jdtFacade).addRelationshipAnnotations(appModule);
  }
 
  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);
   
    context.checking(new Expectations() {
      {
        Map<String, Object> oneToManyProperties = new HashMap<String,Object>();
        oneToManyProperties.put("targetEntity", "org.superbiz.OrderLineBean");
        one(jdtFacade).addMethodAnnotation("org.superbiz.OrderBean", "getOrderLine", new String[0], OneToMany.class, oneToManyProperties);
View Full Code Here

Examples of org.jmock.Mockery

   
    new EntityBeanConverter(jdtFacade).addRelationshipAnnotations(appModule);
  }
 
  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);
   
    context.checking(new Expectations() {
      {
        Map<String, Object> oneToManyProperties = new HashMap<String,Object>();
        oneToManyProperties.put("targetEntity", "org.superbiz.ProductBean");
        one(jdtFacade).addMethodAnnotation("org.superbiz.OrderLineBean", "getProduct", new String[0], ManyToMany.class, oneToManyProperties);
      }
View Full Code Here

Examples of org.jmock.Mockery

   
    new EntityBeanConverter(jdtFacade).addRelationshipAnnotations(appModule);
  }

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

        AppModule appModule = new TestFixture().getAppModule(ejbJarSrc, null);
    context.checking(new Expectations() {
      {
        Map<String, Object> oneToManyProperties = new HashMap<String,Object>();
        oneToManyProperties.put("targetEntity", "org.superbiz.ProductBean");
        one(jdtFacade).addMethodAnnotation("org.superbiz.OrderLineBean", "getProduct", new String[0], OneToOne.class, oneToManyProperties);
      }
View Full Code Here

Examples of org.jmock.Mockery

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

        AppModule appModule = new TestFixture().getAppModule(ejbJarSrc, null);
       
    context.checking(new Expectations() {
      {
        Map<String, Object> oneToManyProperties = new HashMap<String,Object>();
        oneToManyProperties.put("targetEntity", "org.superbiz.ProductBean");
        one(jdtFacade).addMethodAnnotation("org.superbiz.OrderLineBean", "getProduct", new String[0], ManyToOne.class, oneToManyProperties);

        Map<String, Object> manyToOneProperties = new HashMap<String,Object>();
        manyToOneProperties.put("targetEntity", "org.superbiz.OrderLineBean");
        one(jdtFacade).addMethodAnnotation("org.superbiz.ProductBean", "getOrderLine", new String[0], OneToMany.class, manyToOneProperties);
      }
    });
   
    new EntityBeanConverter(jdtFacade).addRelationshipAnnotations(appModule);
   
    context.assertIsSatisfied();
  }
View Full Code Here

Examples of org.jmock.Mockery

   
    context.assertIsSatisfied();
  }
 
  public void testShouldNotThrowExceptionIfTableNameIsMissing() throws Exception {
    Mockery context = new Mockery();
    IJDTFacade jdtFacade = context.mock(IJDTFacade.class);

        AppModule appModule = new TestFixture().getAppModule("notablename-ejb-jar.xml", "notablename-openejb-jar.xml");
    Entity entity = appModule.getCmpMappings().getEntityMap().get("openejb.java.lang.Product");
    EntityBean entityBean = (EntityBean) appModule.getEjbModules().get(0).getEjbJar().getEnterpriseBean("ProductEJB");
   
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.