Class JavaBuilderTest


  • public class JavaBuilderTest
    extends Object
    JavaBuilderTest Created: 29 oct. 2009
    Author:
    Florian Desbois - desbois@codelutin.com
    • Constructor Detail

      • JavaBuilderTest

        public JavaBuilderTest()
    • Method Detail

      • testGetModel

        public void testGetModel()
        Test of getModel. No test needed : model created in modelBuilder instanciated in constructor (ObjectModelBuilder).
        See Also:
        ObjectModelBuilderTest.testGetModel()
      • testAddImport

        public void testAddImport()
        Test of addImport method, of class JavaBuilder. Prerequisite : existing classifier in model. - Add a simple type to import. - Add a type to import with generic (List of Category) : two imports are added. NOTE : Use of ImportsManager addImport() method and GeneratorUtil getTypesList() method.
        See Also:
        GeneratorUtilTest.testGetTypesList()
      • testCreateClass

        public void testCreateClass()
        Test of createClass method, of class JavaBuilder. No test needed : call of createClass in ObjectModelBuilder
        See Also:
        ObjectModelBuilderTest.testCreateClass()
      • testCreateAbstractClass

        public void testCreateAbstractClass()
        Test of createAbstractClass method, of class JavaBuilder. Prerequisite : none. - Create an abstract class.
      • testSetSuperClass

        public void testSetSuperClass()
        Test of setSuperClass method, of class JavaBuilder. Only one superclass can be set. Check imports on superclass qualified name
        See Also:
        ObjectModelBuilderTest.testAddSuperclass()
      • testAddInterface

        public void testAddInterface()
        Test of addInterface method, of class JavaBuilder. Check imports on adding interface : imports added on interfaceQualifiedName
        See Also:
        ObjectModelBuilderTest.testAddInterface()
      • testAddConstant

        public void testAddConstant()
        Test of addConstant method, of class JavaBuilder. Prerequisite : existing classifier in model. - Add a public constant attribute (static, final)
      • testAddAttribute

        public void testAddAttribute()
        Test of addAttribute method, of class JavaBuilder. Check imports on adding attribute : imports added on type and value.
        See Also:
        ObjectModelBuilderTest.testAddAttribute()
      • testAddAttributeObjectModelClassifierObjectModelAttribute

        public void testAddAttributeObjectModelClassifierObjectModelAttribute()
        Test of addAttribute method, of class JavaBuilder. Prerequisite : existing classifier in model. - Add an attribute from an existing one
      • testAddConstructor

        public void testAddConstructor()
        Test of addConstructor method, of class JavaBuilder. Prerequisite : existing class in model. - Add a constructor to an existing class. NOTE : operation.getReturnType doesn't get the good type (ie. "void")
      • testAddOperation

        public void testAddOperation()
        Test of addOperation method, of class JavaBuilder. Check imports on adding operation : returnType of the operation
        See Also:
        ObjectModelBuilderTest.testAddOperation()
      • testAddParameter

        public void testAddParameter()
        Test of addParameter method, of class JavaBuilder. Check imports on adding parameter : type of the parameter
        See Also:
        ObjectModelBuilderTest.testAddParameter()
      • testAddException

        public void testAddException()
        Test of addException method, of class JavaBuilder. Check imports on adding exception : exception name
        See Also:
        ObjectModelBuilderTest.testAddException()
      • testSetOperationBody

        public void testSetOperationBody()
        Test of setOperationBody method, of class JavaBuilder. No body code for an abstract operation : throw an IllegalArgumentException
        See Also:
        ObjectModelBuilderTest.testSetOperationBody()