fixture-monkey icon indicating copy to clipboard operation
fixture-monkey copied to clipboard

When putting a value through reflect, a permission denied Exception is thrown.

Open han-sy opened this issue 3 years ago • 1 comments

Hello, I am applying fixture monkey and strangely it works fine locally, but I get a complie error on the linux server.

error while writing /home1/irteam/.../P...Test$...Test1$...Test$1.class (Permission denied)

I tried taking a stacktrace, but I can't find any detailed information. It seems that Permission denied occurs when you put a value through Relection.

fixture.giveMeBuilder(Attachment::class.java)
                .setExp(
                    Attachment::fileType,
                    Arbitraries.of(FileType.FILE, FileType.VIDEO, FileType.IMAGE)
                )
                .sampleList(30)
class Attachment(
    val fileType: FileType,  
) 

The fixture monkey version uses a snapshot version as shown below.

testImplementation("com.navercorp.fixturemonkey.snapshot:fixture-monkey-starter:0.4.0-dd71410")
testImplementation("com.navercorp.fixturemonkey.snapshot:fixture-monkey-kotlin:0.4.0-dd71410")
testImplementation("com.navercorp.fixturemonkey.snapshot:fixture-monkey-mockito:0.4.0-dd71410")
testImplementation("com.navercorp.fixturemonkey.snapshot:fixture-monkey-jackson:0.4.0-dd71410")

Do you have any solution?

=========================================================================== 안녕하세요 fixture monkey 를 적용중인데 이상하게 local 에서는 괜찮은데, linux 서버위에서 complie 에러가 납니다.

error while writing /home1/irteam/.../P...Test$...테스트1$... 테스트한다$1.class (Permission denied)

stacktrace 를 찍어봐도 자세한 정보가 안나오는데요. Relection 을 통해 값을 넣어줄 때 Permission denied 발생하는 것으로 보입니다.

fixture.giveMeBuilder(Attachment::class.java)
                .setExp(
                    Attachment::fileType,
                    Arbitraries.of(FileType.FILE, FileType.VIDEO, FileType.IMAGE)
                )
                .sampleList(30)
class Attachment(
    val fileType: FileType,  
) 

fixture monkey 버전은 아래와 같이 스냅샷 버전을 쓰고 있습니다.

		testImplementation("com.navercorp.fixturemonkey.snapshot:fixture-monkey-starter:0.4.0-dd71410")
		testImplementation("com.navercorp.fixturemonkey.snapshot:fixture-monkey-kotlin:0.4.0-dd71410")
		testImplementation("com.navercorp.fixturemonkey.snapshot:fixture-monkey-mockito:0.4.0-dd71410")
		testImplementation("com.navercorp.fixturemonkey.snapshot:fixture-monkey-jackson:0.4.0-dd71410")

혹시 해결 방법이 있을까요?

han-sy avatar Aug 05 '22 08:08 han-sy

자문자답.. @Nested inner class 로 test 를 만들었을때 발생하네요. inner class 에서 빼니까 잘 됩니다~

han-sy avatar Aug 05 '22 09:08 han-sy

It might be related to this issue https://github.com/naver/fixture-monkey/issues/548

seongahjo avatar Jan 26 '23 11:01 seongahjo

It is resolved by #548

seongahjo avatar Nov 13 '23 02:11 seongahjo