From a10bf3e9c5495b4c8c69e0059b5901266df471dd Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Sun, 10 Aug 2014 12:08:52 -0700 Subject: [PATCH] Remove Java 6 litter --- .../jclouds/http/functions/ParseSaxTest.java | 31 ------------------- .../java/org/jclouds/utils/TestUtils.java | 5 --- 2 files changed, 36 deletions(-) diff --git a/core/src/test/java/org/jclouds/http/functions/ParseSaxTest.java b/core/src/test/java/org/jclouds/http/functions/ParseSaxTest.java index acf02e8799..bbe6150e1b 100644 --- a/core/src/test/java/org/jclouds/http/functions/ParseSaxTest.java +++ b/core/src/test/java/org/jclouds/http/functions/ParseSaxTest.java @@ -52,11 +52,6 @@ public class ParseSaxTest extends BaseHandlerTest { ParseSax createParser() { return factory.create(injector.getInstance(TestHandler.class)); } - - @DataProvider - public Object[][] runUnderJava6() { - return TestUtils.isJava6() ? SINGLE_NO_ARG_INVOCATION : NO_INVOCATIONS; - } @DataProvider public Object[][] runUnderJava7() { @@ -132,32 +127,6 @@ public class ParseSaxTest extends BaseHandlerTest { } } - @Test(dataProvider = "runUnderJava6") - public void testAddDetailsAndPropagateOkWithValidRequestResponseWithSAXParseException() throws ExecutionException, - InterruptedException, TimeoutException, IOException { - - ParseSax parser = createParser(); - HttpRequest request = HttpRequest.builder().method("GET").endpoint("http://foohost").build(); - HttpResponse response = HttpResponse.builder().statusCode(304).message("Not Modified").build(); - Locator locator = createMock(Locator.class); - expect(locator.getColumnNumber()).andReturn(1); - expect(locator.getLineNumber()).andReturn(1); - expect(locator.getPublicId()).andReturn("publicId"); - expect(locator.getSystemId()).andReturn("systemId"); - replay(locator); - Exception input = new SAXParseException("foo", locator); - verify(locator); - - try { - parser.setContext(request); - parser.addDetailsAndPropagate(response, input); - } catch (RuntimeException e) { - assertEquals(e.getMessage(), - "request: GET http://foohost HTTP/1.1; response: HTTP/1.1 304 Not Modified; error at 1:1 in document systemId; cause: org.xml.sax.SAXParseException: foo"); - assertEquals(e.getCause(), input); - } - } - @Test(dataProvider = "runUnderJava7") public void testAddDetailsAndPropagateOkWithValidRequestResponseWithSAXParseException_java7() throws ExecutionException, InterruptedException, TimeoutException, IOException { diff --git a/core/src/test/java/org/jclouds/utils/TestUtils.java b/core/src/test/java/org/jclouds/utils/TestUtils.java index 035f1be987..59d6c9dc89 100644 --- a/core/src/test/java/org/jclouds/utils/TestUtils.java +++ b/core/src/test/java/org/jclouds/utils/TestUtils.java @@ -29,11 +29,6 @@ public class TestUtils { public static final Object[][] NO_INVOCATIONS = new Object[0][0]; public static final Object[][] SINGLE_NO_ARG_INVOCATION = { new Object[0] }; - public static boolean isJava6() { - System.out.println(System.getProperty("java.version", "None??")); - return System.getProperty("java.version", "").contains("1.6."); - } - public static boolean isJava7() { System.out.println(System.getProperty("java.version", "None??")); return System.getProperty("java.version", "").contains("1.7.");