java.lang.Exception: BMUnit method configuration pushed without prior method configuration pop

50 Views Asked by At

I use byteman with Junit from maven.

I tested the hadoop project. I add some properties in the root pom.xml according to official site.

  <dependencies>
      <dependency>
        <groupId>com.byteman</groupId>
        <artifactId>myhelper</artifactId>
        <!-- <scope>test</scope> -->
        <version>1.0.0</version>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <scope>test</scope>
        <version>4.13.2</version>
      </dependency>
      <dependency>
            <groupId>org.jboss.byteman</groupId>
            <artifactId>byteman</artifactId>
            <!-- <scope>test</scope> -->
            <version>4.0.20</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.byteman</groupId>
            <artifactId>byteman-submit</artifactId>
            <scope>test</scope>
            <version>4.0.20</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.byteman</groupId>
            <artifactId>byteman-install</artifactId>
            <scope>test</scope>
            <version>4.0.20</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.byteman</groupId>
            <artifactId>byteman-bmunit</artifactId>
            <scope>test</scope>
            <version>4.0.20</version>
            <exclusions>
                <exclusion>
                    <groupId>org.testng</groupId>
                    <artifactId>testng</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
  </dependencies>

This is the code segment:

    @org.junit.runner.RunWith(org.jboss.byteman.contrib.bmunit.BMUnitRunner.class)
    @org.jboss.byteman.contrib.bmunit.BMUnitConfig(loadDirectory="target/test-classes")
    @org.jboss.byteman.contrib.bmunit.BMScript(value="check.btm")
    public class TestNestedMountPoint {
      private InodeTree inodeTree;
      private Configuration conf;
      private String mtName;
      private URI fsUri;

      static class TestNestMountPointFileSystem {
        public URI getUri() {
          return uri;
        }

        private URI uri;

        TestNestMountPointFileSystem(URI uri) {
          this.uri = uri;
        }
      }
    ...
    }

My check.btm content segments is:

RULE 8b6addaa-abcb-4c5a-b82a-88286b61da08
CLASS java.util.ArrayDeque
METHOD java.lang.Object getLast()
COMPILE
HELPER com.byteman.MyHelper 
AT ENTRY
BIND value: String =  Long.toString(System.currentTimeMillis()) +" " + Thread.currentThread().toString().replaceAll(" ","") + " " + Integer.toString(System.identityHashCode($0)) +" r =" + formatStack().toString().replaceAll("\n"," ") + "=\n" ;
IF true
DO writeLog(value);
ENDRULE 


RULE f92a477e-28f9-405b-8684-e411f0f3e1aa
CLASS java.util.ArrayDeque
METHOD java.lang.Object getLast()
COMPILE
HELPER com.byteman.MyHelper 
AT EXIT
BIND value: String =  Long.toString(System.currentTimeMillis()) +" " + Thread.currentThread().toString().replaceAll(" ","") + " " + Integer.toString(System.identityHashCode($0)) +" r =" + formatStack().toString().replaceAll("\n"," ") + "=\n" ;
IF true
DO writeLog(value);
ENDRULE
...

This is my error report.

\[ERROR\] testPathResolveToLinkFallBack(org.apache.hadoop.fs.viewfs.TestNestedMountPoint)  Time elapsed: 22.084 s  \<\<\< ERROR!
java.lang.Exception: BMUnit method configuration pushed without prior method configuration pop!
at org.jboss.byteman.contrib.bmunit.BMUnitConfigState.pushConfigurationState(BMUnitConfigState.java:750)
at org.jboss.byteman.contrib.bmunit.BMUnitRunner$6.evaluate(BMUnitRunner.java:261)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:405)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
0

There are 0 best solutions below