Package org.hibernate.test.bytecode

Examples of org.hibernate.test.bytecode.Bean


    assertNotNull( optimizer.getInstantiationOptimizer() );
    assertNotNull( optimizer.getAccessOptimizer() );

    Object instance = optimizer.getInstantiationOptimizer().newInstance();
    assertEquals( instance.getClass(), Bean.class );
    Bean bean = ( Bean ) instance;

    optimizer.getAccessOptimizer().setPropertyValues( bean, BeanReflectionHelper.TEST_VALUES );
    assertEquals( bean.getSomeString(), BeanReflectionHelper.TEST_VALUES[0] );
    Object[] values = optimizer.getAccessOptimizer().getPropertyValues( bean );
    assertEquivalent( values, BeanReflectionHelper.TEST_VALUES );
  }
View Full Code Here


      );
      return;
    }
    Session s = openSession();
    s.beginTransaction();
    Bean bean = new Bean();
    bean.setSomeString( "my-bean" );
    s.save( bean );
    s.getTransaction().commit();
    s.close();

    s = openSession();
    s.beginTransaction();
    bean = ( Bean ) s.load( Bean.class, bean.getSomeString() );
    assertFalse( Hibernate.isInitialized( bean ) );
    try {
      bean.throwException();
      fail( "exception not thrown" );
    }
    catch ( ParseException e ) {
      // expected behavior
    }
View Full Code Here

    assertNotNull( optimizer.getInstantiationOptimizer() );
    assertNotNull( optimizer.getAccessOptimizer() );

    Object instance = optimizer.getInstantiationOptimizer().newInstance();
    assertEquals( instance.getClass(), Bean.class );
    Bean bean = ( Bean ) instance;

    optimizer.getAccessOptimizer().setPropertyValues( bean, BeanReflectionHelper.TEST_VALUES );
    assertEquals( bean.getSomeString(), BeanReflectionHelper.TEST_VALUES[0] );
    Object[] values = optimizer.getAccessOptimizer().getPropertyValues( bean );
    assertEquivalent( values, BeanReflectionHelper.TEST_VALUES );
  }
View Full Code Here

      reportSkip( "env not configured for cglib provider", "bytecode-provider InvocationTargetException handling" );
      return;
    }
    Session s = openSession();
    s.beginTransaction();
    Bean bean = new Bean();
    bean.setSomeString( "my-bean" );
    s.save( bean );
    s.getTransaction().commit();
    s.close();

    s = openSession();
    s.beginTransaction();
    bean = ( Bean ) s.load( Bean.class, bean.getSomeString() );
    assertFalse( Hibernate.isInitialized( bean ) );
    try {
      bean.throwException();
      fail( "exception not thrown" );
    }
    catch ( ParseException e ) {
      // expected behavior
    }
View Full Code Here

    assertNotNull( optimizer.getInstantiationOptimizer() );
    assertNotNull( optimizer.getAccessOptimizer() );

    Object instance = optimizer.getInstantiationOptimizer().newInstance();
    assertEquals( instance.getClass(), Bean.class );
    Bean bean = ( Bean ) instance;

    optimizer.getAccessOptimizer().setPropertyValues( bean, BeanReflectionHelper.TEST_VALUES );
    assertEquals( bean.getSomeString(), BeanReflectionHelper.TEST_VALUES[0] );
    Object[] values = optimizer.getAccessOptimizer().getPropertyValues( bean );
    assertEquivalent( values, BeanReflectionHelper.TEST_VALUES );
  }
View Full Code Here

    assertNotNull( optimizer.getInstantiationOptimizer() );
    assertNotNull( optimizer.getAccessOptimizer() );

    Object instance = optimizer.getInstantiationOptimizer().newInstance();
    assertEquals( instance.getClass(), Bean.class );
    Bean bean = ( Bean ) instance;

    optimizer.getAccessOptimizer().setPropertyValues( bean, BeanReflectionHelper.TEST_VALUES );
    assertEquals( bean.getSomeString(), BeanReflectionHelper.TEST_VALUES[0] );
    Object[] values = optimizer.getAccessOptimizer().getPropertyValues( bean );
    assertEquivalent( values, BeanReflectionHelper.TEST_VALUES );
  }
View Full Code Here

      );
      return;
    }
    Session s = openSession();
    s.beginTransaction();
    Bean bean = new Bean();
    bean.setSomeString( "my-bean" );
    s.save( bean );
    s.getTransaction().commit();
    s.close();

    s = openSession();
    s.beginTransaction();
    bean = ( Bean ) s.load( Bean.class, bean.getSomeString() );
    assertFalse( Hibernate.isInitialized( bean ) );
    try {
      bean.throwException();
      fail( "exception not thrown" );
    }
    catch ( ParseException e ) {
      // expected behavior
    }
View Full Code Here

      reportSkip( "env not configured for cglib provider", "bytecode-provider InvocationTargetException handling" );
      return;
    }
    Session s = openSession();
    s.beginTransaction();
    Bean bean = new Bean();
    bean.setSomeString( "my-bean" );
    s.save( bean );
    s.getTransaction().commit();
    s.close();

    s = openSession();
    s.beginTransaction();
    bean = ( Bean ) s.load( Bean.class, bean.getSomeString() );
    assertFalse( Hibernate.isInitialized( bean ) );
    try {
      bean.throwException();
      fail( "exception not thrown" );
    }
    catch ( ParseException e ) {
      // expected behavior
    }
View Full Code Here

      reportSkip( "env not configured for cglib provider", "bytecode-provider InvocationTargetException handling" );
      return;
    }
    Session s = openSession();
    s.beginTransaction();
    Bean bean = new Bean();
    bean.setSomeString( "my-bean" );
    s.save( bean );
    s.getTransaction().commit();
    s.close();

    s = openSession();
    s.beginTransaction();
    bean = ( Bean ) s.load( Bean.class, bean.getSomeString() );
    assertFalse( Hibernate.isInitialized( bean ) );
    try {
      bean.throwException();
      fail( "exception not thrown" );
    }
    catch ( ParseException e ) {
      // expected behavior
    }
View Full Code Here

      reportSkip( "env not configured for cglib provider", "bytecode-provider InvocationTargetException handling" );
      return;
    }
    Session s = openSession();
    s.beginTransaction();
    Bean bean = new Bean();
    bean.setSomeString( "my-bean" );
    s.save( bean );
    s.getTransaction().commit();
    s.close();

    s = openSession();
    s.beginTransaction();
    bean = ( Bean ) s.load( Bean.class, bean.getSomeString() );
    assertFalse( Hibernate.isInitialized( bean ) );
    try {
      bean.throwException();
      fail( "exception not thrown" );
    }
    catch ( ParseException e ) {
      // expected behavior
    }
View Full Code Here

TOP

Related Classes of org.hibernate.test.bytecode.Bean

Copyright © 2018 www.massapicom. 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.