Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 360925

Summary: Junit failures after thread report changes
Product: [Tools] MAT Reporter: Andrew Johnson <andrew_johnson>
Component: CoreAssignee: Andrew Johnson <andrew_johnson>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 1.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Andrew Johnson CLA 2011-10-14 03:41:00 EDT
Recent thread report changes seem to have caused the 15 junit failures seen in current builds:

https://hudson.eclipse.org/hudson/view/Tycho%20+%20Maven/job/tycho-mat-nightly/347/

It's reproducible by running with the tests plugin and typing into the search queries command line:  default_report org.eclipse.mat.tests:regression

	Test Result (15 failures / +15)

    * org.eclipse.mat.tests.snapshot.GeneralSnapshotTests.testRegressionReport[0]
    * org.eclipse.mat.tests.snapshot.GeneralSnapshotTests.testRegressionReport[1]
    * org.eclipse.mat.tests.snapshot.GeneralSnapshotTests.testRegressionReport[2]
    * org.eclipse.mat.tests.snapshot.GeneralSnapshotTests.testRegressionReport[3]
    * org.eclipse.mat.tests.snapshot.GeneralSnapshotTests.testRegressionReport[4]
    * org.eclipse.mat.tests.snapshot.GeneralSnapshotTests.testRegressionReport[5]
    * org.eclipse.mat.tests.snapshot.GeneralSnapshotTests.testRegressionReport[7]
    * org.eclipse.mat.tests.snapshot.GeneralSnapshotTests.testRegressionReport[8]
    * org.eclipse.mat.tests.snapshot.GeneralSnapshotTests.testRegressionReport[9]
    * org.eclipse.mat.tests.snapshot.GeneralSnapshotTests.testRegressionReport[10]
    
java.lang.ArrayIndexOutOfBoundsException: 0
	at org.eclipse.mat.query.refined.RefinedResultBuilder.setSortOrder(RefinedResultBuilder.java:220)
	at org.eclipse.mat.report.internal.QueryPart.addSortOrder(QueryPart.java:465)
	at org.eclipse.mat.report.internal.QueryPart.readParamsAndProcess(QueryPart.java:245)
	at org.eclipse.mat.report.internal.QueryPart.execute(QueryPart.java:151)
	at org.eclipse.mat.report.internal.SectionPart.execute(SectionPart.java:61)
	at org.eclipse.mat.report.TestSuite.execute(TestSuite.java:131)
	at org.eclipse.mat.report.internal.RunRegisterdReport.execute(RunRegisterdReport.java:50)
	at org.eclipse.mat.query.registry.ArgumentSet.execute(ArgumentSet.java:129)
	at org.eclipse.mat.snapshot.query.SnapshotQuery.execute(SnapshotQuery.java:192)
	at org.eclipse.mat.tests.snapshot.GeneralSnapshotTests.testRegressionReport(GeneralSnapshotTests.java:330)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
	at org.junit.runners.Suite.runChild(Suite.java:128)
	at org.junit.runners.Suite.runChild(Suite.java:24)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
	at org.junit.runners.Suite.runChild(Suite.java:128)
	at org.junit.runners.Suite.runChild(Suite.java:24)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
	at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
	at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
	at org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.run(OsgiSurefireBooter.java:72)
	at org.eclipse.tycho.surefire.osgibooter.HeadlessTestApplication.run(HeadlessTestApplication.java:21)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1384)
Comment 1 Andrew Johnson CLA 2011-10-14 03:42:34 EDT
The problem seems to be related to the changes in columns from 'Name','Instance' to 'Class Name'.

Which columns are better?
Should the exception be better when sorting on a wrong column name?
Comment 2 Andrew Johnson CLA 2011-10-20 06:37:51 EDT
The code has been fixed not to throw an exception if none of the columns for sorting are found.
Comment 3 Andrew Johnson CLA 2011-10-21 03:02:38 EDT
The column sorting was in regression.xml:
		<param key="sort_column" value="Name,Instance" />
I've changed the sort column names to "Name,Object / Stack Frame".
This is executed in GeneralSnapshotTests but the results are not checked there. When are the regression tests checked?
The change in column names and order will affect the regression test results.