Skip to content

Commit f21d43e

Browse files
committed
Don't run integration tests under Cobertura.
To fix running *MethodSecurityTest-s under Cobertura I run them with maven-failsafe-plugin with other integration tests instead of using maven-surefire-plugin which runs unit tests. Another way is to adding <aop:config proxy-target-class="true" /> to configuration (as proposed at http://stackoverflow.com/a/8392775/352708). But I dislike it because: - we need to modify configuration which needed only to tests when they runs under Cobertura - in this case we should add dependency to aspectjweaver
1 parent 8641b1b commit f21d43e

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

pom.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,17 @@
401401
</executions>
402402
</plugin>
403403

404+
<plugin>
405+
<groupId>org.apache.maven.plugins</groupId>
406+
<artifactId>maven-surefire-plugin</artifactId>
407+
<version>2.12</version>
408+
<configuration>
409+
<excludes>
410+
<exclude>ru/mystamps/web/service/*MethodSecurityTest.java</exclude>
411+
</excludes>
412+
</configuration>
413+
</plugin>
414+
404415
<plugin>
405416
<groupId>org.apache.maven.plugins</groupId>
406417
<artifactId>maven-failsafe-plugin</artifactId>

src/test/config/testng.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
22
<suite name="Functional tests on Selenium">
33

4+
<test name="Spring Security annotations tests">
5+
<classes>
6+
<class name="ru.mystamps.web.service.CountryServiceMethodSecurityTest" />
7+
<class name="ru.mystamps.web.service.SeriesServiceMethodSecurityTest" />
8+
</classes>
9+
</test>
10+
411
<test name="When authenticated user register account">
512
<classes>
613
<class name="ru.mystamps.web.tests.cases.WhenAuthenticatedUserRegisterAccount" />

0 commit comments

Comments
 (0)