8000 Filter classes and methods generated by AspectJ by larsgrefer · Pull Request #1501 · jacoco/jacoco · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Filter classes and methods generated by AspectJ #1501

8000
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions org.jacoco.core.test.validation.aspectj/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2009, 2023 Mountainminds GmbH & Co. KG and Contributors
This program and the accompanying materials are made available under
the terms of the Eclipse Public License 2.0 which is available at
http://www.eclipse.org/legal/epl-2.0

SPDX-License-Identifier: EPL-2.0

Contributors:
Lars Grefer - initial API and implementation
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.jacoco</groupId>
<artifactId>org.jacoco.core.test.validation</artifactId>
<version>0.8.11-SNAPSHOT</version>
<relativePath>../org.jacoco.core.test.validation</relativePath>
</parent>

<artifactId>org.jacoco.core.test.validation.aspectj</artifactId>

<name>JaCoCo :: Test :: Core :: Validation AspectJ</name>

<properties>
<aspectj.version>1.9.20</aspectj.version>
</properties>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>org.jacoco.core.test</artifactId>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>dev.aspectj</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.13.1</version>
<executions>
<execution>
<goals>
<goal>compile</goal> <!-- use this goal to weave all your main classes -->
<goal>test-compile</goal> <!-- use this goal to weave all your test classes -->
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
<configuration>
<complianceLevel>${maven.compiler.source}</complianceLevel>
</configuration>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*******************************************************************************
* Copyright (c) 2009, 2023 Mountainminds GmbH & Co. KG and Contributors
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Lars Grefer
*
*******************************************************************************/
package org.jacoco.core.test.validation.aspectj;

import org.jacoco.core.test.validation.Source;
import org.jacoco.core.test.validation.ValidationTestBase;
import org.jacoco.core.test.validation.aspectj.targets.AdvisedAspectTarget;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class AdvisedAspectTargetTest extends ValidationTestBase {
public AdvisedAspectTargetTest() {
super(AdvisedAspectTarget.class);
}

@Test
public void assert_no_missed_lines() {
assertEquals(0,
getSource().getCoverage().getLineCounter().getMissedCount());
}

@Test
public void assert_no_missed_instructions() {

for (Source.Line line : getSource().getLines()) {
if (line.getCoverage().getInstructionCounter()
.getMissedCount() != 0) {
System.out.println("missed instructions on line " + line.getNr()
+ " " + line.getText());
}
}

assertEquals(0, getSource().getCoverage().getInstructionCounter()
.getMissedCount());
}
}
Original file lin 6D47 e number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*******************************************************************************
* Copyright (c) 2009, 2023 Mountainminds GmbH & Co. KG and Contributors
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Lars Grefer
*
*******************************************************************************/
package org.jacoco.core.test.validation.aspectj;

import org.jacoco.core.test.validation.Source;
import org.jacoco.core.test.validation.ValidationTestBase;
import org.jacoco.core.test.validation.aspectj.targets.AfterReturningExecutionTarget;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class AfterReturningExecutionTargetTest extends ValidationTestBase {
public AfterReturningExecutionTargetTest() {
super(AfterReturningExecutionTarget.class);
}

@Test
public void assert_no_missed_lines() {
assertEquals(0,
getSource().getCoverage().getLineCounter().getMissedCount());
}

@Test
public void assert_no_missed_instructions() {

for (Source.Line line : getSource().getLines()) {
if (line.getCoverage().getInstructionCounter()
.getMissedCount() != 0) {
System.out.println("missed instructions on line " + line.getNr()
+ " " + line.getText());
}
}

assertEquals(0, getSource().getCoverage().getInstructionCounter()
.getMissedCount());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*******************************************************************************
* Copyright (c) 2009, 2023 Mountainminds GmbH & Co. KG and Contributors
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Lars Grefer
*
*******************************************************************************/
package org.jacoco.core.test.validation.aspectj;

import org.jacoco.core.test.validation.Source;
import org.jacoco.core.test.validation.ValidationTestBase;
import org.jacoco.core.test.validation.aspectj.targets.AfterReturningExecutionTarget;
import org.jacoco.core.test.validation.aspectj.targets.AfterThrowingExecutionTarget;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class AfterThrowingExecutionTargetTest extends ValidationTestBase {
public AfterThrowingExecutionTargetTest() {
super(AfterThrowingExecutionTarget.class);
}

@Test
public void assert_no_missed_lines() {
assertEquals(0,
getSource().getCoverage().getLineCounter().getMissedCount());
}

@Test
public void assert_no_missed_instructions() {

for (Source.Line line : getSource().getLines()) {
if (line.getCoverage().getInstructionCounter()
.getMissedCount() != 0) {
System.out.println("missed instructions on line " + line.getNr()
+ " " + line.getText());
}
}

assertEquals(0, getSource().getCoverage().getInstructionCounter()
.getMissedCount());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*******************************************************************************
* Copyright (c) 2009, 2023 Mountainminds GmbH & Co. KG and Contributors
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Lars Grefer
*
*******************************************************************************/
package org.jacoco.core.test.validation.aspectj;

import org.jacoco.core.test.validation.Source;
import org.jacoco.core.test.validation.ValidationTestBase;
import org.jacoco.core.test.validation.aspectj.targets.AroundCallTarget;
import org.jacoco.core.test.validation.aspectj.targets.AroundExecutionTarget;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class AroundCallTargetTest extends ValidationTestBase {
public AroundCallTargetTest() {
super(AroundCallTarget.class);
}

@Test
public void assert_no_missed_lines() {
assertEquals(0,
getSource().getCoverage().getLineCounter().getMissedCount());
}

@Test
public void assert_no_missed_instructions() {

for (Source.Line line : getSource().getLines()) {
if (line.getCoverage().getInstructionCounter()
.getMissedCount() != 0) {
System.out.println("missed instructions on line " + line.getNr()
+ " " + line.getText());
}
}

assertEquals(0, getSource().getCoverage().getInstructionCounter()
.getMissedCount());
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*******************************************************************************
* Copyright (c) 2009, 2023 Mountainminds GmbH & Co. KG and Contributors
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Lars Grefer
*
*******************************************************************************/
package org.jacoco.core.test.validation.aspectj;

import org.jacoco.core.test.validation.Source;
import org.jacoco.core.test.validation.ValidationTestBase;
import org.jacoco.core.test.validation.aspectj.targets.AroundExecutionTarget;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class AroundExecutionTargetTest extends ValidationTestBase {
public AroundExecutionTargetTest() {
super(AroundExecutionTarget.class);
}

@Test
public void assert_no_missed_lines() {
assertEquals(0,
getSource().getCoverage().getLineCounter().getMissedCount());
}

@Test
public void assert_no_missed_instructions() {

for (Source.Line line : getSource().getLines()) {
if (line.getCoverage().getInstructionCounter()
.getMissedCount() != 0) {
System.out.println("missed instructions on line " + line.getNr()
+ " " + line.getText());
}
}

assertEquals(0, getSource().getCoverage().getInstructionCounter()
.getMissedCount());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*******************************************************************************
* Copyright (c) 2009, 2023 Mountainminds GmbH & Co. KG and Contributors
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Lars Grefer
*
*******************************************************************************/
package org.jacoco.core.test.validation.aspectj;

import org.jacoco.core.test.validation.Source;
import org.jacoco.core.test.validation.ValidationTestBase;
import org.jacoco.core.test.validation.aspectj.targets.AspectTarget;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class AspectTargetTest extends ValidationTestBase {
public AspectTargetTest() {
super(AspectTarget.class);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*******************************************************************************
* Copyright (c) 2009, 2023 Mountainminds GmbH & Co. KG and Contributors
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Lars Grefer
*
*******************************************************************************/
package org.jacoco.core.test.validation.aspectj;

import org.jacoco.core.test.validation.Source;
import org.jacoco.core.test.validation.ValidationTestBase;
import org.jacoco.core.test.validation.aspectj.targets.BeforeExecutionTarget;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class BeforeExecutionTargetTest extends ValidationTestBase {
public BeforeExecutionTargetTest() {
super(BeforeExecutionTarget.class);
}

@Test
public void assert_no_missed_lines() {
assertEquals(0,
getSource().getCoverage().getLineCounter().getMissedCount());
}

@Test
public void assert_no_missed_instructions() {

for (Source.Line line : getSource().getLines()) {
if (line.getCoverage().getInstructionCounter()
.getMissedCount() != 0) {
System.out.println("missed instructions on line " + line.getNr()
+ " " + line.getText());
}
}

assertEquals(0, getSource().getCoverage().getInstructionCounter()
.getMissedCount());
}
}
Loading
0