Examples of newCompilationUnit()


Examples of org.eclipse.jdt.core.dom.AST.newCompilationUnit()

  public CompilationUnit generateEnum(Classifier clazz,
      String sourceDirectoryPackageName) {
    this.sourceDirectoryPackageName = sourceDirectoryPackageName;

    AST ast = AST.newAST(AST.JLS3);
    CompilationUnit cu = ast.newCompilationUnit();

    generatePackage(clazz, ast, cu);
    EnumDeclaration ed = generateEnum(clazz, ast, cu);
    generateAttributes(clazz, ast, ed);
    generateConstructor(clazz, ast, ed);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.AST.newCompilationUnit()

  }

  @Test
  public void testGenerateClassCheckedExceptionWithNoInheritance() {
    AST ast = AST.newAST(AST.JLS3);
    CompilationUnit cu = ast.newCompilationUnit();

    TypeDeclaration typeDeclaration = exceptionGenerator.generateClass(
        clazz, ast, cu);

    assertEquals(typeDeclaration.toString(),
View Full Code Here

Examples of org.eclipse.jdt.core.dom.AST.newCompilationUnit()

    when(clazzGeneralization.getQualifiedName()).thenReturn(
        "de::test::SuperCompanyException");
    when(clazz.getGeneralizations()).thenReturn(generalizations);

    AST ast = AST.newAST(AST.JLS3);
    CompilationUnit cu = ast.newCompilationUnit();

    TypeDeclaration typeDeclaration = exceptionGenerator.generateClass(
        clazz, ast, cu);

    assertEquals(typeDeclaration.toString(),
View Full Code Here

Examples of org.eclipse.jdt.core.dom.AST.newCompilationUnit()

        Answers.RETURNS_DEEP_STUBS.get());
    when(clazz.getOwnedTemplateSignature()).thenReturn(templateSignature);
    when(templateSignature.getParameters()).thenReturn(templateParameters);

    AST ast = AST.newAST(AST.JLS3);
    CompilationUnit cu = ast.newCompilationUnit();

    TypeDeclaration typeDeclaration = exceptionGenerator.generateClass(
        clazz, ast, cu);

    assertEquals(typeDeclaration.toString(),
View Full Code Here

Examples of org.eclipse.jdt.core.dom.AST.newCompilationUnit()

  }

  @Test
  public void testGenerateClassUncheckedExceptionWithNoInheritance() {
    AST ast = AST.newAST(AST.JLS3);
    CompilationUnit cu = ast.newCompilationUnit();

    exceptionGenerator.setCheckedException(false);
    TypeDeclaration typeDeclaration = exceptionGenerator.generateClass(
        clazz, ast, cu);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.AST.newCompilationUnit()

    when(clazzGeneralization2.getQualifiedName()).thenReturn(
        "de::test::SuperDuperCompanyException");
    when(clazz.getGeneralizations()).thenReturn(generalizations);

    AST ast = AST.newAST(AST.JLS3);
    CompilationUnit cu = ast.newCompilationUnit();

    exceptionGenerator.setCheckedException(false);
    try {
      exceptionGenerator.generateClass(clazz, ast, cu);
      assertTrue(false);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.AST.newCompilationUnit()

    when(clazzGeneralization.getQualifiedName()).thenReturn(
        "de::test::SuperCompanyException");
    when(clazz.getGeneralizations()).thenReturn(generalizations);

    AST ast = AST.newAST(AST.JLS3);
    CompilationUnit cu = ast.newCompilationUnit();

    exceptionGenerator.setCheckedException(false);
    TypeDeclaration typeDeclaration = exceptionGenerator.generateClass(
        clazz, ast, cu);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.AST.newCompilationUnit()

        Answers.RETURNS_DEEP_STUBS.get());
    when(clazz.getOwnedTemplateSignature()).thenReturn(templateSignature);
    when(templateSignature.getParameters()).thenReturn(templateParameters);

    AST ast = AST.newAST(AST.JLS3);
    CompilationUnit cu = ast.newCompilationUnit();

    exceptionGenerator.setCheckedException(false);
    TypeDeclaration typeDeclaration = exceptionGenerator.generateClass(
        clazz, ast, cu);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.AST.newCompilationUnit()

  @SuppressWarnings("unchecked")
  @Test
  public void testGenerateAssociationEndUpperCardinalityMultiplesIsUnique() {
    AST ast = AST.newAST(AST.JLS3);
    ast.newCompilationUnit();
    TypeDeclaration td = ast.newTypeDeclaration();
    td.setInterface(true);
    Modifier modifier = ast
        .newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD);
    td.modifiers().add(modifier);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.AST.newCompilationUnit()

  @SuppressWarnings("unchecked")
  @Test
  public void testGenerateAssociationEndUpperCardinalityMultiplesDefault() {
    AST ast = AST.newAST(AST.JLS3);
    ast.newCompilationUnit();
    TypeDeclaration td = ast.newTypeDeclaration();
    td.setInterface(true);
    Modifier modifier = ast
        .newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD);
    td.modifiers().add(modifier);
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.