-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #2560: Improves execution run-time of IT tests by performing d…
…eployment only once per test module
- Loading branch information
Showing
212 changed files
with
1,582 additions
and
1,823 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
...-persistence/src/test/java/edu/harvard/iq/dataverse/common/AuthenticatedUserUtilTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,12 @@ | ||
package edu.harvard.iq.dataverse.persistence.config; | ||
|
||
import edu.harvard.iq.dataverse.persistence.config.EMailValidator; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
import org.junit.runners.Parameterized.Parameters; | ||
import org.junit.jupiter.params.ParameterizedTest; | ||
import org.junit.jupiter.params.provider.Arguments; | ||
import org.junit.jupiter.params.provider.MethodSource; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
import java.util.stream.Stream; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
/** | ||
* @author philip durbin | ||
|
@@ -18,57 +15,48 @@ | |
* @author stephen kraffmiller | ||
* @author alex scheitlin | ||
*/ | ||
@RunWith(Parameterized.class) | ||
public class EMailValidatorTest { | ||
|
||
public boolean isValid; | ||
public String email; | ||
|
||
public EMailValidatorTest(boolean isValid, String email) { | ||
this.isValid = isValid; | ||
this.email = email; | ||
} | ||
|
||
@Parameters | ||
public static Collection<Object[]> parameters() { | ||
return Arrays.asList(new Object[][]{ | ||
{true, "[email protected]"}, | ||
public static Stream<Arguments> parameters() { | ||
return Stream.of( | ||
Arguments.of(true, "[email protected]"), | ||
|
||
// @todo How can this be a valid email address? | ||
{true, " [email protected]"}, | ||
Arguments.of(true, " [email protected]"), | ||
|
||
// @todo How can this be a valid email address? | ||
{true, "[email protected] "}, | ||
Arguments.of(true, "[email protected] "), | ||
|
||
{false, "elisah.da [email protected]"}, | ||
{false, "[email protected];[email protected]"}, | ||
Arguments.of(false, "elisah.da [email protected]"), | ||
Arguments.of(false, "[email protected];[email protected]"), | ||
|
||
/** | ||
* These examples are all from https://randomuser.me and seem to be | ||
* valid according to | ||
* http://sphinx.mythic-beasts.com/~pdw/cgi-bin/emailvalidate (except | ||
* رونیکا.محمدخان@example.com). | ||
*/ | ||
{true, "miché[email protected]"}, | ||
{true, "begü[email protected]"}, | ||
{true, "lótus.gonç[email protected]"}, | ||
{true, "lótus.gonçalves@éxample.com"}, | ||
{true, "begü[email protected]"}, | ||
{true, "رونیکا.محمدخان@example.com"}, | ||
{false, "lótus.gonç[email protected]óm"}, | ||
{false, "[email protected]"}, | ||
{false, ""}, | ||
{false, null}, | ||
Arguments.of(true, "miché[email protected]"), | ||
Arguments.of(true, "begü[email protected]"), | ||
Arguments.of(true, "lótus.gonç[email protected]"), | ||
Arguments.of(true, "lótus.gonçalves@éxample.com"), | ||
Arguments.of(true, "begü[email protected]"), | ||
Arguments.of(true, "رونیکا.محمدخان@example.com"), | ||
Arguments.of(false, "lótus.gonç[email protected]óm"), | ||
Arguments.of(false, "[email protected]"), | ||
Arguments.of(false, ""), | ||
Arguments.of(false, null), | ||
|
||
// add tests for 4601 | ||
{true, "[email protected]"}, | ||
{true, "[email protected]"}, | ||
{true, "[email protected]"}, | ||
}); | ||
Arguments.of(true, "[email protected]"), | ||
Arguments.of(true, "[email protected]"), | ||
Arguments.of(true, "[email protected]") | ||
); | ||
} | ||
|
||
@Test | ||
public void testIsEmailValid() { | ||
@ParameterizedTest | ||
@MethodSource("parameters") | ||
public void testIsEmailValid(boolean isValid, String email) { | ||
assertEquals(isValid, EMailValidator.isEmailValid(email, null)); | ||
} | ||
|
||
|
4 changes: 2 additions & 2 deletions
4
...rsistence/src/test/java/edu/harvard/iq/dataverse/persistence/config/URLValidatorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../test/java/edu/harvard/iq/dataverse/persistence/datafile/license/LicenseRepositoryIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 17 additions & 30 deletions
47
...istence/src/test/java/edu/harvard/iq/dataverse/persistence/dataset/DatasetAuthorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../java/edu/harvard/iq/dataverse/persistence/dataset/DatasetCitationsCountRepositoryIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.