You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ma...@apache.org on 2014/08/03 22:13:00 UTC
svn commit: r1615447 - in
/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/impl:
ReflectionComparison.java ReflectiveCallerClassUtilityTest.java
Author: mattsicker
Date: Sun Aug 3 20:13:00 2014
New Revision: 1615447
URL: http://svn.apache.org/r1615447
Log:
Rename reflection comparison unit test.
Added:
logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ReflectiveCallerClassUtilityTest.java
- copied, changed from r1615445, logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ReflectionComparison.java
Removed:
logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ReflectionComparison.java
Copied: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ReflectiveCallerClassUtilityTest.java (from r1615445, logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ReflectionComparison.java)
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ReflectiveCallerClassUtilityTest.java?p2=logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ReflectiveCallerClassUtilityTest.java&p1=logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ReflectionComparison.java&r1=1615445&r2=1615447&rev=1615447&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ReflectionComparison.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/ReflectiveCallerClassUtilityTest.java Sun Aug 3 20:13:00 2014
@@ -14,20 +14,25 @@
* See the license for the specific language governing permissions and
* limitations under the license.
*/
+
package org.apache.logging.log4j.core.impl;
+import org.junit.Before;
import org.junit.Test;
import sun.reflect.Reflection;
import static org.junit.Assert.assertSame;
+import static org.junit.Assume.assumeTrue;
-/**
- * Verifies that ReflectiveCallerClassUtility behaves as expected compared to {@code sun.reflect.Reflection}.
- */
-public class ReflectionComparison {
+public class ReflectiveCallerClassUtilityTest {
+
+ @Before
+ public void setUp() throws Exception {
+ assumeTrue(ReflectiveCallerClassUtility.isSupported());
+ }
@Test
- public void testBothMethodsReturnTheSame() {
+ public void testGetCaller() throws Exception {
for (int i = 1; i <= 6; i++) {
assertSame(String.format("%d is not the same", i),
Reflection.getCallerClass(i + ReflectiveCallerClassUtility.JAVA_7U25_COMPENSATION_OFFSET),
@@ -35,5 +40,4 @@ public class ReflectionComparison {
);
}
}
-
}