Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8130484

InstrumentationImpl.transform hangs while running jmockit test case w/ inner cls

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 7u75
    • core-svc

      FULL PRODUCT VERSION :
      Packaged: 04062014
      Platform: Windows
      JDK: OpenJDK
      Version: 1.7.0_45
      Author: asmurthy
      Notes: Packaged with DCEVM

      ADDITIONAL OS VERSION INFORMATION :
      Window 7 Enterprise
      Version 6.1 (Build 7601: service Pack 1)

      A DESCRIPTION OF THE PROBLEM :
      With OpenJDK, When running Jmockit test cases, JVM hangs with class initialization phase.
      With OracleJDK, it works fine with same code(No JVM hangs).

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      IDE: Eclipse Kepler (Version: Kepler Service Release 1, Build id: 20130919-0819)
      1. Create a new maven project and add junit, jmockit dependency with below lines:
      <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.8.1</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>com.googlecode.jmockit</groupId>
      <artifactId>jmockit</artifactId>
      <version>1.5</version>
      <scope>test</scope>
      </dependency>
      2. Create a simple test case, with @before method, new a inner class.
      3. Run test cases with OpenJDK.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      No hangs with OpenJDK
      ACTUAL -
      Hangs on line 424 of class: InstrumentationImpl.transform after run into native method InstrumentationImpl.redefineClasses0


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      Test case:
      package com.ebay.jmockit.demo.jdemo;

      import static org.junit.Assert.assertEquals;
      import mockit.Verifications;

      import org.junit.Before;
      import org.junit.Test;

      /**
       * Unit test for simple App.
       */
      public class AppTest
      {

      @Before
      public void setUpExpectations(){
      new Verifications() {
      {



      }
      };
      }

      @Test
      public void first_demo ()
      {

      assertEquals("demo"!=null, true);

      }
      }


      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Use OracleJDK instead of OpenJDK.

            aroy Abhijit Roy (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: