Package org.hibernate.annotations.common.reflection.java

Examples of org.hibernate.annotations.common.reflection.java.JavaReflectionManager.toXClass()


    List<Contained<String>> contained;
  }

  public void test2StepsGenerics() throws Exception {
    JavaReflectionManager factory = new JavaReflectionManager();
    XClass container = factory.toXClass( Container.class );
    XProperty contained = container.getDeclaredProperties( XClass.ACCESS_FIELD ).get( 0 );
    assertTrue( contained.isTypeResolved() );
    XProperty generic = contained.getType().getDeclaredProperties( XClass.ACCESS_FIELD ).get( 0 );
    assertTrue( generic.isTypeResolved() );
  }
View Full Code Here


    assertTrue( generic.isTypeResolved() );
  }

  public void test2StepsGenericsCollection() throws Exception {
    JavaReflectionManager factory = new JavaReflectionManager();
    XClass container = factory.toXClass( ContainerWithCollection.class );
    XProperty collection = container.getDeclaredProperties( XClass.ACCESS_FIELD ).get( 0 );
    assertTrue( collection.isTypeResolved() );
    XClass elementClass = collection.getElementClass();
    XProperty generic = elementClass.getDeclaredProperties( XClass.ACCESS_FIELD ).get( 0 );
    assertTrue( generic.isTypeResolved() );
View Full Code Here

* @author Emmanuel Bernard
*/
public class DeepGenericsInheritance extends TestCase {
  public void test2StepsGenerics() throws Exception {
    JavaReflectionManager factory = new JavaReflectionManager();
    XClass subclass2 = factory.toXClass( Subclass2.class );
    XClass dummySubclass = factory.toXClass( DummySubclass.class );
    XClass superclass = subclass2.getSuperclass();
    XClass supersuperclass = superclass.getSuperclass();
    assertTrue( supersuperclass.getDeclaredProperties( "field" ).get( 1 ).isTypeResolved() );
    assertEquals( dummySubclass, supersuperclass.getDeclaredProperties( "field" ).get( 1 ).getType() );
View Full Code Here

*/
public class DeepGenericsInheritance extends TestCase {
  public void test2StepsGenerics() throws Exception {
    JavaReflectionManager factory = new JavaReflectionManager();
    XClass subclass2 = factory.toXClass( Subclass2.class );
    XClass dummySubclass = factory.toXClass( DummySubclass.class );
    XClass superclass = subclass2.getSuperclass();
    XClass supersuperclass = superclass.getSuperclass();
    assertTrue( supersuperclass.getDeclaredProperties( "field" ).get( 1 ).isTypeResolved() );
    assertEquals( dummySubclass, supersuperclass.getDeclaredProperties( "field" ).get( 1 ).getType() );

View Full Code Here

public class UnorderedIdScanTest {

  @Test
  public void naturalSortAnnotationsRead() {
    ReflectionManager reflectionManager = new JavaReflectionManager();
    XClass mappedXClass = reflectionManager.toXClass( PersonWithBrokenSocialSecurityNumber.class );
    tryCreatingDocumentBuilder( mappedXClass, reflectionManager );
    //No assertions needed: we just verify the previous statements won't throw an exception
  }

  @Test
View Full Code Here

  }

  @Test
  public void invertedSortAnnotationsRead() {
    JavaReflectionManager reflectionManager = new TrickedJavaReflectionManager( PersonWithBrokenSocialSecurityNumber.class );
    XClass mappedXClass = reflectionManager.toXClass( PersonWithBrokenSocialSecurityNumber.class );
    XClass reverted = new DeclaredMethodsReverter( mappedXClass );
    tryCreatingDocumentBuilder( reverted, reflectionManager );
    //No assertions needed: we just verify the previous statements won't throw an exception
  }
View Full Code Here

  public void testIsSearchEnabled() throws Exception {
    ReflectionManager reflectionManager = new JavaReflectionManager();

    assertTrue(
        "Should be a search enabled class",
        ReflectionHelper.containsSearchAnnotations( reflectionManager.toXClass( A.class ) )
    );
    assertTrue(
        "Should be a search enabled class",
        ReflectionHelper.containsSearchAnnotations( reflectionManager.toXClass( B.class ) )
    );
View Full Code Here

        "Should be a search enabled class",
        ReflectionHelper.containsSearchAnnotations( reflectionManager.toXClass( A.class ) )
    );
    assertTrue(
        "Should be a search enabled class",
        ReflectionHelper.containsSearchAnnotations( reflectionManager.toXClass( B.class ) )
    );
    assertTrue(
        "Should be a search enabled class",
        ReflectionHelper.containsSearchAnnotations( reflectionManager.toXClass( C.class ) )
    );
View Full Code Here

        "Should be a search enabled class",
        ReflectionHelper.containsSearchAnnotations( reflectionManager.toXClass( B.class ) )
    );
    assertTrue(
        "Should be a search enabled class",
        ReflectionHelper.containsSearchAnnotations( reflectionManager.toXClass( C.class ) )
    );
    assertTrue(
        "Should be a search enabled class",
        ReflectionHelper.containsSearchAnnotations( reflectionManager.toXClass( D.class ) )
    );
View Full Code Here

        "Should be a search enabled class",
        ReflectionHelper.containsSearchAnnotations( reflectionManager.toXClass( C.class ) )
    );
    assertTrue(
        "Should be a search enabled class",
        ReflectionHelper.containsSearchAnnotations( reflectionManager.toXClass( D.class ) )
    );

    assertFalse(
        "Should not be a search enabled class",
        ReflectionHelper.containsSearchAnnotations( reflectionManager.toXClass( E.class ) )
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.