Package org.hibernate.annotationfactory

Examples of org.hibernate.annotationfactory.AnnotationProxy


  public void setUp() {
    descriptor = new AnnotationDescriptor( TestAnnotation.class );
    descriptor.setValue( "stringElement", "x" );
    descriptor.setValue( "booleanElement", false );
    descriptor.setValue( "someOtherElement", "y" );
    ann = new AnnotationProxy( descriptor );
  }
View Full Code Here


  public void testConstructionFailsIfYouDoNotAssignValuesToAllTheElementsWithoutADefault() {
    try {
      AnnotationDescriptor desc = new AnnotationDescriptor( TestAnnotation.class );
      desc.setValue( "stringElement", "x" );
      desc.setValue( "booleanElement", false );
      new AnnotationProxy( desc );
      fail();
    }
    catch (Exception e) {
      assertEquals( "No value provided for someOtherElement", e.getMessage() );
    }
View Full Code Here

  public void testConstructionFailsIfYouDefineElementsThatAreNotInTheAnnotationInterface() {
    try {
      AnnotationDescriptor desc = new AnnotationDescriptor( Deprecated.class );
      desc.setValue( "wrongElement", "xxx" );
      new AnnotationProxy( desc );
      fail();
    }
    catch (Exception e) {
      assertTrue( e.getMessage().contains( "unknown elements" ) );
    }
View Full Code Here

  public void testThrowsARuntimeExceptionIfYouUseAnElementWhichIsNotInTheAnnotationInterface() {
    AnnotationDescriptor elements = new AnnotationDescriptor( TestAnnotation.class );
    elements.setValue( "anOddElement", "x" );
    try {
      new AnnotationProxy( elements );
      fail();
    }
    catch (RuntimeException e) {
    }
  }
View Full Code Here

TOP

Related Classes of org.hibernate.annotationfactory.AnnotationProxy

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.