Package atunit.core

Examples of atunit.core.IncompatibleAnnotationException


            MockFramework mockFramework = getMockFrameworkFor(c);

            // make sure we have one (and only one) @Unit field
            Field unitField = getUnitField(testFields);
            if (unitField.getAnnotation(Mock.class) != null) {
                throw new IncompatibleAnnotationException(Unit.class, Mock.class);
            }

            final Map<Field, Object> fieldValues = mockFramework.getValues(testFields.toArray(new Field[testFields.size()]));
            if (fieldValues.containsKey(unitField)) {
                throw new IncompatibleAnnotationException(Unit.class, unitField.getType());
            }

            container.createTest(c, fieldValues);

            for (Field field : fieldValues.keySet()) {
View Full Code Here


    final Set<Object> ignored = new HashSet<Object>();

    for ( Field field : fields ) {
      if ( Mockery.class.isAssignableFrom(field.getType())) {
        if ( field.getAnnotation(Mock.class) != null )
          throw new IncompatibleAnnotationException(Mock.class, field.getType());

        if ( Mockery.class.equals(field.getType())) {
          mockery = new Mockery();
        } else {
          mockery = (Mockery)field.getType().newInstance();
View Full Code Here

    final Set<Object> ignored = new HashSet<Object>();
   
    for ( Field field : fields ) {
      if ( Mockery.class.isAssignableFrom(field.getType())) {
        if ( field.getAnnotation(Mock.class) != null )
          throw new IncompatibleAnnotationException(Mock.class, field.getType());
       
        if ( Mockery.class.equals(field.getType())) {
          mockery = new JUnit4Mockery();
        } else {
          mockery = (Mockery)field.getType().newInstance();
View Full Code Here

    MockFramework mockFramework = getMockFrameworkFor(c);
       
    // make sure we have one (and only one) @Unit field
    Field unitField = getUnitField(testFields);
    if ( unitField.getAnnotation(Mock.class) != null ) {
      throw new IncompatibleAnnotationException(Unit.class, Mock.class);
    }
   
    final Map<Field,Object> fieldValues = mockFramework.getValues(testFields.toArray(new Field[0]));
    if ( fieldValues.containsKey(unitField)) {
      throw new IncompatibleAnnotationException(Unit.class, unitField.getType());
    }
   
    Object test = container.createTest(c, fieldValues);

    // any field values created by AtUnit but not injected by the container are injected here.
View Full Code Here

   
    atunit.Container containerAnno = testClass.getAnnotation(atunit.Container.class);
    atunit.ContainerClass containerClassAnno = testClass.getAnnotation(atunit.ContainerClass.class);
   
    if ( containerAnno != null && containerClassAnno != null )
      throw new IncompatibleAnnotationException(atunit.Container.class, atunit.ContainerClass.class);

    if ( containerAnno != null ) {
      switch ( containerAnno.value() ) {
        case GUICE: containerClass = GuiceContainer.class; break;
        case SPRING: containerClass = SpringContainer.class; break;
View Full Code Here

   
    atunit.MockFramework mockFrameworkAnno = testClass.getAnnotation(atunit.MockFramework.class);
    atunit.MockFrameworkClass mockFrameworkClassAnno = testClass.getAnnotation(atunit.MockFrameworkClass.class);
   
    if ( mockFrameworkAnno != null && mockFrameworkClassAnno != null )
      throw new IncompatibleAnnotationException(atunit.MockFramework.class, atunit.MockFrameworkClass.class);

    if ( mockFrameworkAnno != null ) {
      switch ( mockFrameworkAnno.value() ) {
        case EASYMOCK: mockFrameworkClass = EasyMockFramework.class; break;
        case JMOCK: mockFrameworkClass = JMockFramework.class; break;
View Full Code Here

TOP

Related Classes of atunit.core.IncompatibleAnnotationException

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.