-
Notifications
You must be signed in to change notification settings - Fork 542
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
[SUREFIRE-2010] Parameterized Selection Does not Work #476
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.apache.maven.surefire.its.jiras; | ||
|
||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import org.apache.maven.surefire.its.fixture.OutputValidator; | ||
import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; | ||
import org.junit.Test; | ||
|
||
public class Surefire2010ParameterizedSelectionDoesNotWorkIT extends SurefireJUnit4IntegrationTestCase | ||
{ | ||
@Test | ||
public void testJUnit4() { | ||
OutputValidator validator = unpack("surefire-2010-parameterized-selection-does-not-work").executeTest(); | ||
} | ||
|
||
public void testJUnit5() { | ||
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Licensed to the Apache Software Foundation (ASF) under one | ||
~ or more contributor license agreements. See the NOTICE file | ||
~ distributed with this work for additional information | ||
~ regarding copyright ownership. The ASF licenses this file | ||
~ to you under the Apache License, Version 2.0 (the | ||
~ "License"); you may not use this file except in compliance | ||
~ with the License. You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, | ||
~ software distributed under the License is distributed on an | ||
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
~ KIND, either express or implied. See the License for the | ||
~ specific language governing permissions and limitations | ||
~ under the License. | ||
--> | ||
<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/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Due to this parent POM specifies There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, I've added the |
||
<groupId>org.apache.maven.surefire</groupId> | ||
<artifactId>it-parent</artifactId> | ||
<version>1.0</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
<groupId>org.apache.maven.plugins.surefire</groupId> | ||
<artifactId>jiras-surefire-2010</artifactId> | ||
<version>1.0</version> | ||
<url>http://maven.apache.org</url> | ||
<developers> | ||
<developer> | ||
<id>DaGeRe</id> | ||
<name>David Georg Reichelt (DaGeRe)</name> | ||
<email>[email protected]</email> | ||
<roles> | ||
<role>Committer</role> | ||
</roles> | ||
<timezone>Europe/Berlin</timezone> | ||
</developer> | ||
</developers> | ||
<dependencies> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.13.2</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-params</artifactId> | ||
<version>5.8.2</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package de.dagere.peass; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
import org.junit.runners.Parameterized.Parameters; | ||
|
||
@RunWith(Parameterized.class) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be nice to adjust the code style in these files well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank, I've imported the style and hopefully reformatted it correctly. |
||
public class ExampleTestJUnit4 { | ||
|
||
@Parameters | ||
public static Collection<Object[]> data() { | ||
return Arrays.asList(new Object[][] { | ||
{ 0 }, { 1 } | ||
}); | ||
} | ||
|
||
int value; | ||
|
||
public ExampleTestJUnit4(int value) { | ||
this.value = value; | ||
} | ||
|
||
@Test | ||
public void test() { | ||
System.out.println(value); | ||
} | ||
|
||
@Test | ||
public void anotherTest() { | ||
System.out.println("3 (and value ignored)"); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package de.dagere.peass; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.params.ParameterizedTest; | ||
import org.junit.jupiter.params.provider.ValueSource; | ||
|
||
public class ExampleTestJUnit5 { | ||
|
||
@ParameterizedTest | ||
@ValueSource(ints = { 0, 1 }) | ||
public void test(final int value) { | ||
System.out.println(value); | ||
} | ||
|
||
@Test | ||
public void anotherTest() { | ||
System.out.println("3"); | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OutputValidator validator =
is useless.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this was only for starting. The plan is to run it once with all tests and than with a selector.
Now, I've added
which unfortunately fails.