Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running tests after Java upgrade to IBM Semeru jdk-17.0.6+10 (from jdk1.8.0_311.jdk) #393

Closed
thecrookster opened this issue Mar 16, 2023 · 9 comments
Assignees
Labels
Milestone

Comments

@thecrookster
Copy link

thecrookster commented Mar 16, 2023

With easymock 5.1.0, I had 7 errors, after trying out 5.2.0-SNAPSHOT it dropped to 4.

[ERROR] Errors: 
[ERROR]   CARootFolderTest.getExtensionsFolderPath:89->EasyMockSupport.createStrictMock:321->EasyMockSupport.strictMock:169 » Runtime java.lang.IllegalAccessException: no such field: com.ibm.bi.glass.services.UserProfileSettings$$$EasyMock$3.$callback/org.easymock.internal.ClassMockingData/putField
[ERROR]   CARootFolderTest.getExtensionsFolderPathUPSException:101->EasyMockSupport.createStrictMock:321->EasyMockSupport.strictMock:169 » Runtime java.lang.IllegalAccessException: no such field: com.ibm.bi.glass.services.UserProfileSettings$$$EasyMock$3.$callback/org.easymock.internal.ClassMockingData/putField
[ERROR]   CMStoreServiceTest.getCMStoreParametersFieldMockSuccess:94->EasyMockSupport.createStrictMock:321->EasyMockSupport.strictMock:169 » Runtime java.lang.IllegalAccessException: no such field: com.ibm.bi.json.JsonObject$$$EasyMock$2.$callback/org.easymock.internal.ClassMockingData/putField
[ERROR]   CMStoreServiceTest.getCMStoreParametersFieldSuccess:117->EasyMockSupport.createStrictMock:321->EasyMockSupport.strictMock:169 » Runtime java.lang.IllegalAccessException: no such field: com.ibm.bi.json.JsonObject$$$EasyMock$2.$callback/org.easymock.internal.ClassMockingData/putField
[INFO] 
[ERROR] Tests run: 281, Failures: 1, Errors: 4, Skipped: 0

This is with 5.1.0 (with 7 errors)

[ERROR] Errors: 
[ERROR]   CARootFolderTest.getExtensionsFolderPath:89->EasyMockSupport.mock:74 » Runtime java.lang.IllegalAccessException: no such field: com.ibm.bi.glass.services.UserProfileSettings$$$EasyMock$3.$callback/org.easymock.internal.ClassMockingData/putField
[ERROR]   CARootFolderTest.getExtensionsFolderPathUPSException:101->EasyMockSupport.createStrictMock:321->EasyMockSupport.strictMock:169 » Runtime java.lang.IllegalAccessException: no such field: com.ibm.bi.glass.services.UserProfileSettings$$$EasyMock$3.$callback/org.easymock.internal.ClassMockingData/putField
[ERROR]   SSOContextTest.testGetSSOContext_InitialContext:148 » Runtime java.lang.IllegalAccessException: no such field: javax.naming.InitialContext$$$EasyMock$44.$callback/org.easymock.internal.ClassMockingData/putField
[ERROR]   SSOContextTest.testGetSSOContext_InitialContext_and_config:170 » Runtime java.lang.IllegalAccessException: no such field: javax.naming.InitialContext$$$EasyMock$44.$callback/org.easymock.internal.ClassMockingData/putField
[ERROR]   SSOContextTest.testGetSSOContext_InitialContext_none:128 » Runtime java.lang.IllegalAccessException: no such field: javax.naming.InitialContext$$$EasyMock$44.$callback/org.easymock.internal.ClassMockingData/putField
[ERROR]   CMStoreServiceTest.getCMStoreParametersFieldMockSuccess:94->EasyMockSupport.createStrictMock:321->EasyMockSupport.strictMock:169 » Runtime java.lang.IllegalAccessException: no such field: com.ibm.bi.json.JsonObject$$$EasyMock$2.$callback/org.easymock.internal.ClassMockingData/putField
[ERROR]   CMStoreServiceTest.getCMStoreParametersFieldSuccess:117->EasyMockSupport.createStrictMock:321->EasyMockSupport.strictMock:169 » Runtime java.lang.IllegalAccessException: no such field: com.ibm.bi.json.JsonObject$$$EasyMock$2.$callback/org.easymock.internal.ClassMockingData/putField
[INFO] 
[ERROR] Tests run: 281, Failures: 1, Errors: 7, Skipped: 0

Appreciate any help on the remaining 4.

This might be related: #274

Thx
Shawn Crook
IBM

@thecrookster thecrookster changed the title Error running tests after Java upgrade to IBM Semeru jdk-17.0.6+10jdk-17.0.6+10 Error running tests after Java upgrade to IBM Semeru jdk-17.0.6+10 (from jdk1.8.0_311.jdk) Mar 16, 2023
@henri-tremblay
Copy link
Contributor

Thanks for reporting. Is it working on a Temurin JVM? And can you provide a simple failing testcase? That would be helpful to quickly reproduce.

@henri-tremblay henri-tremblay self-assigned this Mar 16, 2023
@henri-tremblay henri-tremblay added this to the 5.2.0 milestone Mar 16, 2023
@thecrookster
Copy link
Author

thecrookster commented Mar 16, 2023

I was able to fix the remaining 4 by changing the order of createStrictMock code (Although odd... I consider this issue closed now for my purposes)

For the other 3 errors (SSOContextTest), they go away by upgrading to candidate 5.2.0_SNAPSHOT (from 5.2.1)

This is the problematic line in each of the 3 SSOContextTest tests without the 5.2.0 local upgrade

EasyMock.createMock(InitialContext.class);
[ERROR]   SSOContextTest.testGetSSOContext_InitialContext:148 » Runtime java.lang.IllegalAccessException: no such field: javax.naming.InitialContext$$$EasyMock$44.$callback/org.easymock.internal.ClassMockingData/putField
[ERROR]   SSOContextTest.testGetSSOContext_InitialContext_and_config:170 » Runtime java.lang.IllegalAccessException: no such field: javax.naming.InitialContext$$$EasyMock$44.$callback/org.easymock.internal.ClassMockingData/putField
[ERROR]   SSOContextTest.testGetSSOContext_InitialContext_none:128 » Runtime java.lang.IllegalAccessException: no such field: javax.naming.InitialContext$$$EasyMock$44.$callback/org.easymock.internal.ClassMockingData/putField

@thecrookster
Copy link
Author

thecrookster commented Mar 16, 2023

Sample test snippit

import javax.naming.InitialContext;

import org.easymock.EasyMock;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

public class SSOContextTest {
	
	@Before
	public void setup() {
	}
	
	@After
	public void teardown() {
	}
	
	@Test
	public void myFailingTest() throws Exception {
		InitialContext context = EasyMock.createMock(InitialContext.class); //Problem fixed via 5.2.0 upgrade
	}

@thecrookster
Copy link
Author

thecrookster commented Mar 16, 2023

@henri-tremblay What PR in 5.2.0 fixes my issue? Thx
Can I overcome this issue without upgrading to 5.2.0 (It's not available yet LOL) ? If so... please let m know how. thx.

@thecrookster
Copy link
Author

@henri-tremblay When will 5.2.0 ship? Thx

@henri-tremblay
Copy link
Contributor

Hi. As soon I can.

@basil
Copy link

basil commented Aug 24, 2023

Friendly ping that a release of 5.2.0 with Java 21 support would be much appreciated. Thank you for your great work maintaining this component!

@henri-tremblay
Copy link
Contributor

Most probably fixed by #442

@henri-tremblay
Copy link
Contributor

It's out. Plese give it a spin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants