Examples of AnnotationBuilder


Examples of org.exolab.castor.builder.AnnotationBuilder

            sourceCode.add("return array;");
        }
       
        // add custom annotations
        for (int i = 0; i < annotationBuilders.length; i++) {
            AnnotationBuilder annotationBuilder = annotationBuilders[i];
            annotationBuilder.addFieldGetterAnnotations(fieldInfo, method);
        }

        jClass.addMethod(method);
    }
View Full Code Here

Examples of org.exolab.castor.builder.AnnotationBuilder

//        if (useJava50) {
//            Java5HacksHelper.addOverrideAnnotations(method.getSignature());
//        }
       
        for (int i = 0; i < annotationBuilders.length; i++) {
            AnnotationBuilder annotationBuilder = annotationBuilders[i];
            annotationBuilder.addFieldGetterAnnotations(fieldInfo, method);
        }
       
        jClass.addMethod(method);
        createGetterComment(fieldInfo, method.getJDocComment());
        jsc = method.getSourceCode();
View Full Code Here

Examples of org.hibernate.tool.hbm2x.pojo.AnnotationBuilder

    assertEquals(null,findFirstString( "cascade={}", new File(getOutputDir(), "org/hibernate/tool/hbm2x/Article.java") ));
  }
   
  public void testAnnotationBuilder() {

    AnnotationBuilder builder =  AnnotationBuilder.createAnnotation("SingleCleared").resetAnnotation( "Single" );
   
    assertEquals("@Single", builder.getResult());
   
    builder = AnnotationBuilder.createAnnotation("javax.persistence.OneToMany")
            .addAttribute("willbecleared", (String)null)
            .resetAnnotation("javax.persistence.OneToMany")
          .addAttribute("cascade", new String[] { "val1", "val2"})
          .addAttribute("fetch", "singleValue");
   
    assertEquals("@javax.persistence.OneToMany(cascade={val1, val2}, fetch=singleValue)", builder.getResult());
   
    builder = AnnotationBuilder.createAnnotation("javax.persistence.OneToMany");
    builder.addAttribute("cascade", (String[])null);
    builder.addAttribute("fetch", (String)null);
   
    assertEquals("@javax.persistence.OneToMany", builder.getResult());

    builder = AnnotationBuilder.createAnnotation("abc");
    ArrayList list = new ArrayList();
    list.add(new Integer(42));
    list.add( new String("xxx") );
    builder.addQuotedAttributes( "it", list.iterator() );
   
    assertEquals("@abc(it={\"42\", \"xxx\"})", builder.getResult());   
 
    List columns = new ArrayList();
    columns.add("first");
    columns.add("second");
   
    AnnotationBuilder constraint = AnnotationBuilder.createAnnotation( "UniqueConstraint" );
    constraint.addQuotedAttributes( "columnNames", new IteratorTransformer(columns.iterator()) {
      public Object transform(Object object) {         
        return object.toString();
      }
    });
    constraint.addAttribute( "single", "value" );
   
    String attribute = constraint.getAttributeAsString("columnNames");
    assertEquals("{\"first\", \"second\"}", attribute);
   
    assertEquals("value", constraint.getAttributeAsString( "single" ));
   
  }
View Full Code Here

Examples of org.jbehave.core.configuration.AnnotationBuilder

public class NeedleAnnotationBuilderBehaviour {

  @Test
  public void shouldBuildConfigurationFromAnnotationsUsingConfigureAndGuiceConverters() {
    final AnnotationBuilder builderAnnotated = new NeedleAnnotationBuilder(
        AnnotatedUsingConfigureAndNeedleConverters.class);
    final Configuration configuration = builderAnnotated
        .buildConfiguration();
    assertThatCustomObjectIsConverted(configuration.parameterConverters());
    assertThatDateIsConvertedWithFormat(
        configuration.parameterConverters(), new SimpleDateFormat(
            "yyyy-MM-dd"));
View Full Code Here

Examples of org.jbehave.core.configuration.AnnotationBuilder

    assertThat(table.getHeaders(), hasItems("one", "two"));
  }

  @Test
  public void shouldBuildDefaultConfigurationIfAnnotationOrAnnotatedValuesNotPresent() {
    final AnnotationBuilder builderNotAnnotated = new NeedleAnnotationBuilder(
        NotAnnotated.class);
    assertThatConfigurationIs(builderNotAnnotated.buildConfiguration(),
        new MostUsefulConfiguration());
    final AnnotationBuilder builderAnnotatedWithoutModules = new NeedleAnnotationBuilder(
        AnnotatedWithoutInjectors.class);
    assertThatConfigurationIs(
        builderAnnotatedWithoutModules.buildConfiguration(),
        new MostUsefulConfiguration());
  }
View Full Code Here

Examples of org.jbehave.core.configuration.AnnotationBuilder

        .storyReporterBuilder().reportFailureTrace()));
  }

  @Test
  public void shouldBuildCandidateStepsFromAnnotationsUsingNeedle() {
    final AnnotationBuilder builderAnnotated = new NeedleAnnotationBuilder(
        AnnotatedUsingNeedle.class);
    final Configuration configuration = builderAnnotated
        .buildConfiguration();
    assertTrue(builderAnnotated.buildCandidateSteps(configuration)
        .isEmpty());
  }
View Full Code Here

Examples of org.jbehave.core.configuration.AnnotationBuilder

        .isEmpty());
  }

  @Test
  public void shouldBuildCandidateStepsFromAnnotationsUsingStepsAndNeedle() {
    final AnnotationBuilder builderAnnotated = new NeedleAnnotationBuilder(
        AnnotatedUsingStepsAndNeedle.class);
    final Configuration configuration = builderAnnotated
        .buildConfiguration();
    assertThatStepsInstancesAre(
        builderAnnotated.buildCandidateSteps(configuration),
        FooSteps.class);
  }
View Full Code Here

Examples of org.jbehave.core.configuration.AnnotationBuilder

        FooSteps.class);
  }

  @Test
  public void shouldBuildCandidateStepsFromAnnotationsUsingStepsAndGuiceAndConverters() {
    final AnnotationBuilder builderAnnotated = new NeedleAnnotationBuilder(
        AnnotatedUsingConfigureAndNeedleConverters.class);
    final Configuration configuration = builderAnnotated
        .buildConfiguration();
    assertThatStepsInstancesAre(
        builderAnnotated.buildCandidateSteps(configuration),
        FooSteps.class);
  }
View Full Code Here

Examples of org.jbehave.core.configuration.AnnotationBuilder

        FooSteps.class);
  }

  @Test
  public void shouldBuildEmptyStepsListIfAnnotationOrAnnotatedValuesNotPresent() {
    final AnnotationBuilder builderNotAnnotated = new NeedleAnnotationBuilder(
        NotAnnotated.class);
    assertThatStepsInstancesAre(builderNotAnnotated.buildCandidateSteps());

    final AnnotationBuilder builderAnnotatedWithoutLocations = new NeedleAnnotationBuilder(
        AnnotatedWithoutInjectors.class);
    assertThatStepsInstancesAre(builderAnnotatedWithoutLocations
        .buildCandidateSteps());
  }
View Full Code Here

Examples of org.jbehave.core.configuration.AnnotationBuilder

        .buildCandidateSteps());
  }

  @Test
  public void shouldBuildStepsList() {
    final AnnotationBuilder builderAnnotated = new NeedleAnnotationBuilder(
        AnnotatedMultipleSteps.class);
    final List<CandidateSteps> actual = builderAnnotated
        .buildCandidateSteps();
    assertThatStepsInstancesAre(actual, FooStepsWithDependency.class,
        FooSteps.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.