From 1dca5b6cae964ac769e672aaf2bae3c84d6a0966 Mon Sep 17 00:00:00 2001 From: James Perkins Date: Fri, 19 Jan 2018 15:44:08 -0800 Subject: [PATCH] Upgrade dependencies and fix test that breaks with Java 9. --- pom.xml | 3 ++- .../org/jboss/logmanager/LogManagerTests.java | 15 ++------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/pom.xml b/pom.xml index 6ed25de5..aa7da8c6 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ org.jboss jboss-parent - 21 + 25 @@ -146,6 +146,7 @@ **/*Tests.java + -Djdk.attach.allowAttachSelf=true true org.jboss.logmanager.LogManager diff --git a/src/test/java/org/jboss/logmanager/LogManagerTests.java b/src/test/java/org/jboss/logmanager/LogManagerTests.java index 010f6dee..bdf3cdb3 100644 --- a/src/test/java/org/jboss/logmanager/LogManagerTests.java +++ b/src/test/java/org/jboss/logmanager/LogManagerTests.java @@ -19,7 +19,6 @@ package org.jboss.logmanager; -import java.lang.reflect.Method; import java.util.Arrays; import java.util.Collection; import java.util.Collections; @@ -57,22 +56,12 @@ public class LogManagerTests extends AbstractTest { @Test public void testLevelReplacement() throws Exception { - // Get the static method to find the level by name - Method method = null; - try { - method = java.util.logging.Level.class.getDeclaredMethod("findLevel", String.class); - method.setAccessible(true); - } catch (NoSuchMethodException ignore) { - } // Validate each level for (java.util.logging.Level l : levels) { java.util.logging.Level level = java.util.logging.Level.parse(l.getName()); Assert.assertEquals(l, level); - if (method != null) { - // Hack to check the level by int - level = (java.util.logging.Level) method.invoke(null, Integer.toString(level.intValue())); - Assert.assertEquals(l, level); - } + level = java.util.logging.Level.parse(Integer.toString(l.intValue())); + Assert.assertEquals(l, level); } }