// Path: core/src/main/java/com/github/phantomthief/util/MoreReflection.java
// @Nullable
// public static StackTraceElement getCallerPlace() {
//     return getCallerPlace(MoreReflection.class);
// }


import static com.github.phantomthief.util.MoreReflection.getCallerPlace;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import org.junit.jupiter.api.Test;
package com.github.phantomthief.util;



/**
 * @author w.vela
 * Created on 2018-06-13.
 */
class MoreReflectionTest {

    @Test
    void test() {
        MyTest.test();
        MyTest.test2();
    }

    @Test
    void testKotlinCaller() {
        KotlinCaller.test1();
    }

    @Test
    void testCaller() {
        StackTraceElement callerPlace = MyTest.test3();
        assertNotNull(callerPlace);
        assertEquals("MoreReflectionTest.java", callerPlace.getFileName());

        callerPlace = MyTest2.test41();
        assertNotNull(callerPlace);
        assertEquals("MoreReflectionTest.java", callerPlace.getFileName());
    }

    static class MyTest {

        @Deprecated
        static void test() {
// Path: core/src/main/java/com/github/phantomthief/util/MoreReflection.java
// @Nullable
// public static StackTraceElement getCallerPlace() {
//     return getCallerPlace(MoreReflection.class);
// }


// Path: core/src/test/java/com/github/phantomthief/util/MoreReflectionTest.java
import static com.github.phantomthief.util.MoreReflection.getCallerPlace;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import org.junit.jupiter.api.Test;

package com.github.phantomthief.util;



/**
 * @author w.vela
 * Created on 2018-06-13.
 */
class MoreReflectionTest {

    @Test
    void test() {
        MyTest.test();
        MyTest.test2();
    }

    @Test
    void testKotlinCaller() {
        KotlinCaller.test1();
    }

    @Test
    void testCaller() {
        StackTraceElement callerPlace = MyTest.test3();
        assertNotNull(callerPlace);
        assertEquals("MoreReflectionTest.java", callerPlace.getFileName());

        callerPlace = MyTest2.test41();
        assertNotNull(callerPlace);
        assertEquals("MoreReflectionTest.java", callerPlace.getFileName());
    }

    static class MyTest {

        @Deprecated
        static void test() {
            System.err.println(getCallerPlace());