Package org.junithelper.core.meta

Examples of org.junithelper.core.meta.ConstructorMeta


        ExtInstantiation ins = new ExtInstantiation("com.example.Bean");
        ins.importList.add("com.example.BeanFactory");
        ins.assignCode = "BeanFactory.getInstance()";
        config.extConfiguration.extInstantiations.add(ins);
        TestMethodMeta testMethodMeta = new TestMethodMeta();
        ConstructorMeta cons = new ConstructorMeta();
        cons.argNames.add("bean");
        ArgTypeMeta argType = new ArgTypeMeta();
        argType.name = "com.example.Bean";
        argType.nameInMethodName = "Bean";
        cons.argTypes.add(argType);
View Full Code Here


        ExtInstantiation ins = new ExtInstantiation("com.example.Bean");
        ins.importList.add("com.example.BeanFactory");
        ins.assignCode = "BeanFactory.getInstance();";
        config.extConfiguration.extInstantiations.add(ins);
        TestMethodMeta testMethodMeta = new TestMethodMeta();
        ConstructorMeta cons = new ConstructorMeta();
        cons.argNames.add("bean");
        ArgTypeMeta argType = new ArgTypeMeta();
        argType.name = "com.example.Bean";
        argType.nameInMethodName = "Bean";
        cons.argTypes.add(argType);
View Full Code Here

    }

    @Test
    public void getInstantiationSourceCode_A$Configuration$ClassMeta$ConstructorMeta() throws Exception {
        ClassMeta classMeta = targetClassMeta;
        ConstructorMeta constructorMeta = target.getFirstConstructor(classMeta);
        String actual = target.getInstantiationSourceCode(config, classMeta, constructorMeta);
        assertEquals("    Sample target = new Sample();\r\n", actual);
    }
View Full Code Here

    public void getInstantiationSourceCode_A$Configuration$ClassMeta$ConstructorMeta_Issue69() throws Exception {
        // given
        ClassMeta classMeta = new ClassMeta();
        classMeta.name = "Sample";
        classMeta.importedList.add("java.util.Calendar");
        ConstructorMeta cons = new ConstructorMeta();
        cons.argNames.add("cal");
        ArgTypeMeta argType = new ArgTypeMeta();
        argType.name = "Calendar";
        argType.nameInMethodName = "Calendar";
        cons.argTypes.add(argType);
        classMeta.constructors.add(cons);
        ConstructorMeta constructorMeta = target.getFirstConstructor(classMeta);
        Configuration config = new Configuration();
        config.isExtensionEnabled = true;
        ExtInstantiation ins = new ExtInstantiation("java.util.Calendar");
        ins.assignCode = "Calendar.getInstance()";
        config.extConfiguration.extInstantiations.add(ins);
View Full Code Here

    }

    @Test
    public void getFirstConstructor_A$ClassMeta() throws Exception {
        ClassMeta classMeta = targetClassMeta;
        ConstructorMeta actual = target.getFirstConstructor(classMeta);
        assertNotNull(actual);
    }
View Full Code Here

      testMethod.isTypeTest = true;
      dest.add(testMethod);
    }
    // is testing instantiation required
    if (!targetClassMeta.isEnum && targetClassMeta.constructors.size() > 0) {
      ConstructorMeta notPrivateConstructor = null;
      for (ConstructorMeta constructor : targetClassMeta.constructors) {
        if (constructor.accessModifier != AccessModifier.Private) {
          notPrivateConstructor = constructor;
          break;
        }
View Full Code Here

      meta.isTypeTest = true;
      addTestMethodMetaToListIfNotExists(dest, meta);
    }
    // is testing instantiation required
    if (!targetClassMeta.isEnum && targetClassMeta.constructors.size() > 0) {
      ConstructorMeta notPrivateConstructor = null;
      for (ConstructorMeta constructor : targetClassMeta.constructors) {
        if (constructor.accessModifier != AccessModifier.Private) {
          notPrivateConstructor = constructor;
          break;
        }
View Full Code Here

      meta.isTypeTest = true;
      addTestMethodMetaToListIfNotExists(dest, meta);
    }
    // is testing instantiation required
    if (!targetClassMeta.isEnum && targetClassMeta.constructors.size() > 0) {
      ConstructorMeta notPrivateConstructor = null;
      for (ConstructorMeta constructor : targetClassMeta.constructors) {
        if (constructor.accessModifier != AccessModifier.Private) {
          notPrivateConstructor = constructor;
          break;
        }
View Full Code Here

    methodMetaExtractor.initialize(classMeta, sourceCodeString);
    constructorMetaExtractor.initialize(classMeta, sourceCodeString);
    List<ConstructorMeta> constructorMetaList
        = constructorMetaExtractor.extract(sourceCodeString);
    if (constructorMetaList.size() == 0) {
      ConstructorMeta defaultConstructor = new ConstructorMeta();
      constructorMetaList.add(defaultConstructor);
    }
    return constructorMetaList;
  }
View Full Code Here

      testMethod.isTypeTest = true;
      dest.add(testMethod);
    }
    // is testing instantiation required
    if (!targetClassMeta.isEnum && targetClassMeta.constructors.size() > 0) {
      ConstructorMeta notPrivateConstructor = null;
      for (ConstructorMeta constructor : targetClassMeta.constructors) {
        if (constructor.accessModifier != AccessModifier.Private) {
          notPrivateConstructor = constructor;
          break;
        }
View Full Code Here

TOP

Related Classes of org.junithelper.core.meta.ConstructorMeta

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.