Package org.jmock

Examples of org.jmock.Mockery.mock()


  }

  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() {
View Full Code Here


  }
 
  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);
       
View Full Code Here

    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

    new EntityBeanConverter(jdtFacade).addTableAnnotation(entityBean, entity);
  }
 
  public void testShouldAddTableAnnotation() throws Exception {
    Mockery context = new Mockery();
    final IJDTFacade jdtFacade = context.mock(IJDTFacade.class);

        AppModule appModule = new TestFixture().getAppModule("basicentity-ejb-jar.xml", "basicentity-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

    new EntityBeanConverter(jdtFacade).addTableAnnotation(entityBean, entity);
  }
 
  public void testShouldAddColumnAnnotation() throws Exception {
    Mockery context = new Mockery();
    final IJDTFacade jdtFacade = context.mock(IJDTFacade.class);

        AppModule appModule = new TestFixture().getAppModule("basicentity-ejb-jar.xml", "basicentity-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

    new EntityBeanConverter(jdtFacade).addBasicAnnotations(entityBean, entity.getAttributes().getBasic());
  }

  public void testShouldAddIdAnnotation() throws Exception {
    Mockery context = new Mockery();
    final IJDTFacade jdtFacade = context.mock(IJDTFacade.class);

        String ejbJarFilename = "basicentity-ejb-jar.xml";
        String openejbJarFilename = "basicentity-openejb-jar.xml";

        AppModule appModule = new TestFixture().getAppModule(ejbJarFilename, openejbJarFilename);
View Full Code Here

public class EntityBeanPojoConverterTest extends TestCase {
    public void testShouldConvertEntityToPojo() throws Exception {
        Mockery context = new Mockery();
        final Sequence sequence = context.sequence("sequence");

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

        context.checking(new Expectations() {
            {
                one(facade).removeAbstractModifierFromClass("org.superbiz.ProductBean");
                inSequence(sequence);
View Full Code Here

    public void testShouldConvertEntityWithOneToManyToPojo() throws Exception {
        Mockery context = new Mockery();
        final Sequence sequence = context.sequence("sequence");

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

        context.checking(new Expectations() {
            {
                one(facade).removeAbstractModifierFromClass("org.superbiz.OrderBean");
                inSequence(sequence);
View Full Code Here

    public void testShouldConvertEntityWithOneToOneToPojo() throws Exception {
        Mockery context = new Mockery();
        final Sequence sequence = context.sequence("sequence");

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

        context.checking(new Expectations() {
            {
                one(facade).removeAbstractModifierFromClass("org.superbiz.ProductBean");
                inSequence(sequence);
View Full Code Here

    public void testShouldConvertEntityWithManyToManyToPojo() throws Exception {
        Mockery context = new Mockery();
        final Sequence sequence = context.sequence("sequence");

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

        context.checking(new Expectations() {
            {
                one(facade).removeAbstractModifierFromClass("org.superbiz.ProductBean");
                inSequence(sequence);
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.