#91 - Polishing.
Guard tests requiring connectivity to GitHub with assumptions.
This commit is contained in:
@@ -15,8 +15,13 @@
|
||||
*/
|
||||
package org.springframework.data.release.build;
|
||||
|
||||
import java.io.IOException;
|
||||
import static org.junit.Assume.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
@@ -24,12 +29,7 @@ import org.springframework.data.release.AbstractIntegrationTests;
|
||||
import org.springframework.data.release.git.GitOperations;
|
||||
import org.springframework.data.release.io.Workspace;
|
||||
import org.springframework.data.release.model.ArtifactVersion;
|
||||
import org.springframework.data.release.model.Iteration;
|
||||
import org.springframework.data.release.model.ModuleIteration;
|
||||
import org.springframework.data.release.model.Phase;
|
||||
import org.springframework.data.release.model.Projects;
|
||||
import org.springframework.data.release.model.ReleaseTrains;
|
||||
import org.springframework.data.release.model.TrainIteration;
|
||||
import org.xmlbeam.ProjectionFactory;
|
||||
import org.xmlbeam.io.XBFileIO;
|
||||
|
||||
@@ -43,6 +43,19 @@ public class MavenIntegrationTests extends AbstractIntegrationTests {
|
||||
@Autowired MavenBuildSystem maven;
|
||||
@Autowired GitOperations git;
|
||||
|
||||
@BeforeClass
|
||||
public static void beforeClass() {
|
||||
|
||||
try {
|
||||
URL url = new URL("https://github.com");
|
||||
URLConnection urlConnection = url.openConnection();
|
||||
urlConnection.connect();
|
||||
urlConnection.getInputStream().close();
|
||||
} catch (IOException e) {
|
||||
assumeTrue("Test requires connectivity to GitHub:" + e.toString(), false);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void modifiesParentPomCorrectly() throws IOException {
|
||||
|
||||
@@ -67,19 +80,6 @@ public class MavenIntegrationTests extends AbstractIntegrationTests {
|
||||
// System.out.println(projection.asString(pom));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testname() throws Exception {
|
||||
|
||||
git.update(ReleaseTrains.HOPPER);
|
||||
|
||||
TrainIteration iteration = new TrainIteration(ReleaseTrains.HOPPER, Iteration.M1);
|
||||
ModuleIteration build = iteration.getModule(Projects.BUILD);
|
||||
UpdateInformation information = UpdateInformation.of(iteration, Phase.PREPARE);
|
||||
|
||||
maven.updateProjectDescriptors(build, information);
|
||||
maven.prepareVersion(build, Phase.PREPARE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void findsSnapshotDependencies() throws Exception {
|
||||
|
||||
|
||||
@@ -17,7 +17,13 @@ package org.springframework.data.release.cli;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assume.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.release.AbstractIntegrationTests;
|
||||
@@ -32,6 +38,19 @@ public class ReleaseCommandsIntegrationTests extends AbstractIntegrationTests {
|
||||
@Autowired ReleaseCommands releaseCommands;
|
||||
@Autowired GitOperations git;
|
||||
|
||||
@BeforeClass
|
||||
public static void beforeClass() {
|
||||
|
||||
try {
|
||||
URL url = new URL("https://github.com");
|
||||
URLConnection urlConnection = url.openConnection();
|
||||
urlConnection.connect();
|
||||
urlConnection.getInputStream().close();
|
||||
} catch (IOException e) {
|
||||
assumeTrue("Test requires connectivity to GitHub:" + e.toString(), false);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void predictsReleaseTrainCorrectly() throws Exception {
|
||||
|
||||
|
||||
@@ -17,8 +17,14 @@ package org.springframework.data.release.git;
|
||||
|
||||
import static org.hamcrest.Matchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assume.*;
|
||||
import static org.springframework.data.release.model.Projects.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.release.AbstractIntegrationTests;
|
||||
@@ -32,6 +38,19 @@ public class GitOperationsIntegrationTests extends AbstractIntegrationTests {
|
||||
|
||||
@Autowired GitOperations gitOperations;
|
||||
|
||||
@BeforeClass
|
||||
public static void beforeClass() {
|
||||
|
||||
try {
|
||||
URL url = new URL("https://github.com");
|
||||
URLConnection urlConnection = url.openConnection();
|
||||
urlConnection.connect();
|
||||
urlConnection.getInputStream().close();
|
||||
} catch (IOException e) {
|
||||
assumeTrue("Test requires connectivity to GitHub:" + e.toString(), false);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void updatesGitRepositories() throws Exception {
|
||||
gitOperations.update(ReleaseTrains.GOSLING);
|
||||
|
||||
Reference in New Issue
Block a user