Package org.junithelper.core.meta

Examples of org.junithelper.core.meta.MethodMeta


        TestMethodGeneratorImpl target = new TestMethodGeneratorImpl(config, lineBreakProvider);
        ClassMetaExtractor classMetaExtractor = new ClassMetaExtractor(config);
        String sourceCodeString = "package hoge.foo; import java.util.List; import java.util.Map; public class Sample { public int doSomething(String str, long longValue, List<String> list, Map<String,Object> map, java.util.HashMap<String, String> hashMap) throws Throwable { System.out.println(\"aaaa\") } }";
        ClassMeta targetClassMeta = classMetaExtractor.extract(sourceCodeString);
        target.initialize(targetClassMeta);
        MethodMeta targetMethodMeta = targetClassMeta.methods.get(0);
        TestMethodMeta testMethodMeta = target.getTestMethodMeta(targetMethodMeta);
        // when
        // then
        assertEquals("null", target.getArgValue(testMethodMeta, targetMethodMeta.argTypes.get(0),
                targetMethodMeta.argNames.get(0)));
View Full Code Here


        assertNotSame(res, arg);
    }

    @Test
    public void deepCopy_A$T_MethodInfo() throws Exception {
        MethodMeta arg = new MethodMeta();
        arg.argTypes.add(new ArgTypeMeta());
        arg.isStatic = true;
        arg.name = "hogehoge";
        MethodMeta res = ObjectUtil.deepCopy(arg);
        assertNotSame(arg.argTypes, res.argTypes);
        assertNotSame(arg.argTypes.get(0), res.argTypes.get(0));
        assertEquals(arg.isStatic, res.isStatic);
        assertEquals(arg.name, res.name);
    }
View Full Code Here

    return getTestMethodNamePrefix(testMethodMeta, null);
  }

  @Override
  public String getTestMethodNamePrefix(TestMethodMeta testMethodMeta, ExceptionMeta exception) {
    MethodMeta targetMethodMeta = testMethodMeta.methodMeta;
    // testing instantiation
    if (targetMethodMeta == null) {
      if (testMethodMeta.isTypeTest) {
        return "type";
      } else if (testMethodMeta.isInstantiationTest) {
View Full Code Here

    return getTestMethodNamePrefix(testMethodMeta, null);
  }

  @Override
  public String getTestMethodNamePrefix(TestMethodMeta testMethodMeta, ExceptionMeta exception) {
    MethodMeta targetMethodMeta = testMethodMeta.methodMeta;
    // testing instantiation
    if (targetMethodMeta == null) {
      if (testMethodMeta.isTypeTest) {
        return "type";
      } else if (testMethodMeta.isInstantiationTest) {
View Full Code Here

    return getTestMethodNamePrefix(testMethodMeta, null);
  }

  @Override
  public String getTestMethodNamePrefix(TestMethodMeta testMethodMeta, ExceptionMeta exception) {
    MethodMeta targetMethodMeta = testMethodMeta.methodMeta;
    // testing instantiation
    if (targetMethodMeta == null) {
      if (testMethodMeta.isTypeTest) {
        return "type";
      } else if (testMethodMeta.isInstantiationTest) {
View Full Code Here

    return getTestMethodNamePrefix(testMethodMeta, null);
  }

  @Override
  public String getTestMethodNamePrefix(TestMethodMeta testMethodMeta, ExceptionMeta exception) {
    MethodMeta targetMethodMeta = testMethodMeta.methodMeta;
    // testing instantiation
    if (targetMethodMeta == null) {
      if (testMethodMeta.isTypeTest) {
        return "type";
      } else if (testMethodMeta.isInstantiationTest) {
View Full Code Here

    // -----------------
    // for method signature
    Matcher mat = RegExp.PatternObject.MethodSignatureArea.matcher(sourceCodeString);
    while (mat.find()) {
      MethodMeta meta = new MethodMeta();
      String methodSignatureArea = mat.group(0)
          .replaceAll(StringValue.CarriageReturn, StringValue.Empty)
          .replaceAll(StringValue.LineFeed, StringValue.Space);

      // -----------------
View Full Code Here

    // -----------------
    // for method signature
    Matcher mat = RegExp.PatternObject.MethodSignatureArea.matcher(sourceCodeString);
    while (mat.find()) {
      MethodMeta meta = new MethodMeta();
      String methodSignatureArea = mat.group(0)
          .replaceAll(StringValue.CarriageReturn, StringValue.Empty)
          .replaceAll(StringValue.LineFeed, StringValue.Space);

      // -----------------
View Full Code Here

    // -----------------
    // for method signature
    Matcher mat = RegExp.PatternObject.MethodSignatureArea.matcher(sourceCodeString);
    while (mat.find()) {
      MethodMeta meta = new MethodMeta();
      String methodSignatureArea = mat.group(0).replaceAll(StringValue.CarriageReturn, StringValue.Empty)
          .replaceAll(StringValue.LineFeed, StringValue.Space);

      // -----------------
      // skip constructors
View Full Code Here

    // -----------------
    // for method signature
    Matcher mat = RegExp.PatternObject.MethodSignatureArea.matcher(sourceCodeString);
    while (mat.find()) {
      MethodMeta meta = new MethodMeta();
      String methodSignatureArea = mat.group(0).replaceAll(StringValue.CarriageReturn, StringValue.Empty)
          .replaceAll(StringValue.LineFeed, StringValue.Space);

      // -----------------
      // skip constructors
View Full Code Here

TOP

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

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.