Package org.hibernate.bytecode

Examples of org.hibernate.bytecode.ReflectionOptimizer$InstantiationOptimizer


    super( string );
  }

  public void testReflectionOptimization() {
    BytecodeProviderImpl provider = new BytecodeProviderImpl();
    ReflectionOptimizer optimizer = provider.getReflectionOptimizer(
        Bean.class,
            BeanReflectionHelper.getGetterNames(),
            BeanReflectionHelper.getSetterNames(),
            BeanReflectionHelper.getTypes()
    );
    assertNotNull( optimizer );
    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


    super( string );
  }

  public void testReflectionOptimization() {
    BytecodeProviderImpl provider = new BytecodeProviderImpl();
    ReflectionOptimizer optimizer = provider.getReflectionOptimizer(
        Bean.class,
            BeanReflectionHelper.getGetterNames(),
            BeanReflectionHelper.getSetterNames(),
            BeanReflectionHelper.getTypes()
    );
    assertNotNull( optimizer );
    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

    super( string );
  }

  public void testReflectionOptimization() {
    BytecodeProviderImpl provider = new BytecodeProviderImpl();
    ReflectionOptimizer optimizer = provider.getReflectionOptimizer(
        Bean.class,
            BeanReflectionHelper.getGetterNames(),
            BeanReflectionHelper.getSetterNames(),
            BeanReflectionHelper.getTypes()
    );
    assertNotNull( optimizer );
    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

    super( string );
  }

  public void testReflectionOptimization() {
    BytecodeProviderImpl provider = new BytecodeProviderImpl();
    ReflectionOptimizer optimizer = provider.getReflectionOptimizer(
        Bean.class,
            BeanReflectionHelper.getGetterNames(),
            BeanReflectionHelper.getSetterNames(),
            BeanReflectionHelper.getTypes()
    );
    assertNotNull( optimizer );
    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

TOP

Related Classes of org.hibernate.bytecode.ReflectionOptimizer$InstantiationOptimizer

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.