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

update from version 1.31 to version 1.32 throws on all tests NoClassDefFound javax/persistence/Entity (reopen) #442

Closed
avaysberg opened this Issue Aug 14, 2017 · 2 comments

Comments

2 participants
@avaysberg

avaysberg commented Aug 14, 2017

Please provide the following information:
I prepare the new issue, because i cannot reopen old: #438

  • Version of JMockit that was used:
    1.32
  • Description of the problem:
    if I updated to use version 1.32 or high i receive Exception NoClassDefFound and if i move back to 1.31 it works fine:

TestPaging.testGetSize » NoClassDefFound javax/persistence/Entity

it happens, some art of dependencies (Tomcat embedded) in class path:

<dependencies>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.9.9</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jmockit</groupId>
            <artifactId>jmockit</artifactId>
            <version>1.32</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-jasper</artifactId>
            <version>7.0.47</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-core</artifactId>
            <version>7.0.47</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-logging-juli</artifactId>
            <version>7.0.47</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-logging-log4j</artifactId>
            <version>7.0.47</version>
        </dependency>
    </dependencies>

Than if i change the jmockit to v. 1.31 it works, but if I change it to 1.32 than it throws the exception bei the call the class TestMockupService

public class TestMockupService {
    @Injectable
    private String host = "test";
    @Injectable
    private int port = 7778;
    @Tested
    private MockingService mockingService;


    @Test
    public void testSendTest(@Mocked OutputStream outputStream) throws Exception {
        MockSocket mockSocket = new MockSocket();
        mockSocket.setOutputStream(outputStream);
        Assert.assertTrue(mockingService.sendTest());
    }

    /**
     * Test method for {@link testng.mocking.MockingService#sendUserName()}.
     */
    @Test
    public void testSendUserName(@Mocked OutputStream outputStream) throws Exception {
        MockSocket mockSocket = new MockSocket();
        mockSocket.setOutputStream(outputStream);
        Assert.assertTrue(mockingService.sendUserName());
    }
}



The Project for reproduce this bug: bug-update-from131-132.zip

Regards

@rliesenfeld

This comment has been minimized.

Show comment
Hide comment
@rliesenfeld

rliesenfeld Aug 14, 2017

Member

Thanks!

Unfortunately, I can't reproduce the failure. I opened the project in IntelliJ IDEA, then executed the test class, both from IntelliJ and from Maven. In both cases, the test passes. I used JDK 1.8.0_131.

Member

rliesenfeld commented Aug 14, 2017

Thanks!

Unfortunately, I can't reproduce the failure. I opened the project in IntelliJ IDEA, then executed the test class, both from IntelliJ and from Maven. In both cases, the test passes. I used JDK 1.8.0_131.

@rliesenfeld

This comment has been minimized.

Show comment
Hide comment
@rliesenfeld

rliesenfeld Aug 14, 2017

Member

Ah, wait. With those commented out dependencies, the failure starts to occur.

Member

rliesenfeld commented Aug 14, 2017

Ah, wait. With those commented out dependencies, the failure starts to occur.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.