diff --git a/dist/6.x/ExecutionFlow_ConsoleExporter_v6.0.6.jar b/dist/6.x/ExecutionFlow_ConsoleExporter_v6.0.6.jar new file mode 100644 index 00000000..02fbd431 Binary files /dev/null and b/dist/6.x/ExecutionFlow_ConsoleExporter_v6.0.6.jar differ diff --git a/dist/6.x/ExecutionFlow_FileExporter_v6.0.6.jar b/dist/6.x/ExecutionFlow_FileExporter_v6.0.6.jar new file mode 100644 index 00000000..696d10ca Binary files /dev/null and b/dist/6.x/ExecutionFlow_FileExporter_v6.0.6.jar differ diff --git a/src/executionflow/runtime/collector/MethodCallsCollector.aj b/src/executionflow/runtime/collector/MethodCallsCollector.aj index 1d3b0b95..2d2bff51 100644 --- a/src/executionflow/runtime/collector/MethodCallsCollector.aj +++ b/src/executionflow/runtime/collector/MethodCallsCollector.aj @@ -80,7 +80,7 @@ public aspect MethodCallsCollector extends RuntimeCollector { // Join points //------------------------------------------------------------------------- before(): invokedSignature() { - if (isNativeMethod(thisJoinPoint) || !isValidSignature(thisJoinPoint)) + if (isNativeMethod(getSignature(thisJoinPoint)) || !isValidSignature(thisJoinPoint)) return; invoked = new InvokedInfo.Builder() @@ -90,7 +90,7 @@ public aspect MethodCallsCollector extends RuntimeCollector { } before(): invokedMethodByTestedInvoker() { - if (!isMethod(thisJoinPoint) || isNativeMethod(thisJoinPoint) || (invoked == null)) + if (!isMethod(thisJoinPoint) || isNativeMethod(getSignature(thisJoinPoint)) || (invoked == null)) return; collectMethod(extractMethodCalledSignature(thisJoinPoint)); @@ -102,6 +102,10 @@ public aspect MethodCallsCollector extends RuntimeCollector { //------------------------------------------------------------------------- // Methods //------------------------------------------------------------------------- + private String getSignature(JoinPoint jp) { + return jp.getSignature().toString(); + } + private boolean isValidSignature(JoinPoint jp) { String signature = jp.getSignature().toString(); @@ -124,21 +128,21 @@ public aspect MethodCallsCollector extends RuntimeCollector { return jp.getKind().equals("method-call"); } - private String getSignature(JoinPoint jp) { - if (jp.getSignature().getName().contains("")) - return jp.getSignature().getDeclaringTypeName(); - - StringBuilder signature = new StringBuilder(); - Signature jpSignature = jp.getSignature(); - - signature.append(jp.getSignature().getDeclaringTypeName()); - signature.append("."); - signature.append(jpSignature.getName()); - signature.append(jpSignature.toString() - .substring(jpSignature.toString().indexOf("("))); - - return signature.toString(); - } +// private String getSignature(JoinPoint jp) { +// if (jp.getSignature().getName().contains("")) +// return jp.getSignature().getDeclaringTypeName(); +// +// StringBuilder signature = new StringBuilder(); +// Signature jpSignature = jp.getSignature(); +// +// signature.append(jp.getSignature().getDeclaringTypeName()); +// signature.append("."); +// signature.append(jpSignature.getName()); +// signature.append(jpSignature.toString() +// .substring(jpSignature.toString().indexOf("("))); +// +// return signature.toString(); +// } private String removeReturnTypeFromSignature(String signature) { return signature.substring(signature.indexOf(' ') + 1); diff --git a/src/executionflow/runtime/collector/MethodCollector.aj b/src/executionflow/runtime/collector/MethodCollector.aj index 62e34d60..484a39b1 100644 --- a/src/executionflow/runtime/collector/MethodCollector.aj +++ b/src/executionflow/runtime/collector/MethodCollector.aj @@ -73,15 +73,15 @@ public aspect MethodCollector extends RuntimeCollector { return; String key = generateKey(thisJoinPoint); - + if (alreadyCollected(key)) return; - + collectSourceAndBinaryPaths(thisJoinPoint); if ((srcPath == null) || (classPath == null)) return; - + collectMethod(thisJoinPoint, key); } @@ -141,7 +141,7 @@ public aspect MethodCollector extends RuntimeCollector { private boolean isValidState(JoinPoint jp) { return (isStaticMethod(jp) || !constructorBelongsToTestMethod(jp)) && isMethodSignature(jp) - && !isNativeMethod(jp) + && !isNativeMethod(signature) && !belongsToTestMethod(jp); } @@ -248,7 +248,7 @@ public aspect MethodCollector extends RuntimeCollector { .invocationLine(getInvocationLine(jp)) .build(); methodInfo.setConcreteMethodSignature(getConcreteMethodSignature(jp)); - + System.out.println("5"); storeCollector(jp, methodInfo); collectedMethods.add(key); @@ -294,11 +294,11 @@ public aspect MethodCollector extends RuntimeCollector { } private void storeCollector(JoinPoint jp, InvokedInfo methodInfo) { - if (methodCollector.containsKey(getInvocationLine(jp))) { + if (methodCollector.containsKey(getInvocationLine(jp))) {System.out.println("6"); List list = methodCollector.get(getInvocationLine(jp)); list.add(new InvokedContainer(methodInfo, testMethodInfo)); } - else { + else { System.out.println("7"); List list = new ArrayList<>(); list.add(new InvokedContainer(methodInfo, testMethodInfo)); diff --git a/src/executionflow/runtime/collector/RuntimeCollector.aj b/src/executionflow/runtime/collector/RuntimeCollector.aj index 37e7e559..8620b746 100644 --- a/src/executionflow/runtime/collector/RuntimeCollector.aj +++ b/src/executionflow/runtime/collector/RuntimeCollector.aj @@ -130,20 +130,18 @@ public abstract aspect RuntimeCollector { // Methods //------------------------------------------------------------------------- /** - * Checks whether a method signature belongs to a native Java method or + * Checks whether a signature belongs to a native Java method or * if it is a JUnit method. * - * @param methodSignature Signature of the method + * @param signature Signature to be analyzed * * @return If the method is a native method or JUnit method */ - protected boolean isNativeMethod(JoinPoint jp) { - String signature = jp.getSignature().toString(); - + protected boolean isNativeMethod(String signature) { return (signature == null) - || signature.contains("java.") - || signature.contains("jdk.") - || signature.contains("org.junit.") + || signature.matches("^java\\..+") + || signature.matches("^jdk\\..+") + || signature.contains("^org\\.junit\\..+") || signature.matches(".+(\\$|\\.)[0-9]+.+"); } diff --git a/src/executionflow/runtime/collector/TestMethodCollector.aj b/src/executionflow/runtime/collector/TestMethodCollector.aj index cf053dec..fbb8ef3b 100644 --- a/src/executionflow/runtime/collector/TestMethodCollector.aj +++ b/src/executionflow/runtime/collector/TestMethodCollector.aj @@ -602,7 +602,7 @@ public aspect TestMethodCollector extends RuntimeCollector { methodCollector ); methodExecutionFlow.run(); - + ExecutionFlow constructorExecutionFlow = new ConstructorExecutionFlow( processingManager, constructorCollector.values()