This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 68866 - Failures in org.netbeans.core.projects.ValidateLayerConsistencyTesttestAreAttributesFine,testValidShadows
Summary: Failures in org.netbeans.core.projects.ValidateLayerConsistencyTesttestAreAtt...
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Options&Settings (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Jan Jancura
URL:
Keywords: TEST
Depends on:
Blocks:
 
Reported: 2005-11-16 23:43 UTC by charlweed
Modified: 2008-12-23 00:39 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description charlweed 2005-11-16 23:43:57 UTC
org.netbeans.core.projects.ValidateLayerConsistencyTest	

On the surface, this looks like the old issues from september of last year:
Issue 46753
Issue 48770

Details for failed test/tests with errors:

testAreAttributesFine:

      junit.framework.AssertionFailedError: Some attributes in files are unreadable[
    File MultiFileObject@11f5ff9[Keymaps/NetBeans/D-BACK_QUOTE.shadow] attribute
name originalFile, 
    File MultiFileObject@d60225[Keymaps/Emacs/D-BACK_QUOTE.shadow] attribute
name originalFile]
	at junit.framework.Assert.fail(Assert.java:47)
	at
org.netbeans.core.projects.ValidateLayerConsistencyTest.testAreAttributesFine(ValidateLayerConsistencyTest.java:89)
	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:585)
	at junit.framework.TestCase.runTest(TestCase.java:154)
	at org.netbeans.junit.NbTestCase.runBare(NbTestCase.java:136)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:118)
	at org.netbeans.junit.NbTestCase.access$001(NbTestCase.java:33)
	at org.netbeans.junit.NbTestCase$1.run(NbTestCase.java:105)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
	at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
	at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

   

testValidShadows:

      junit.framework.AssertionFailedError: Some shadow files in NetBeans
profile are broken:[
File MultiFileObject@11f5ff9[Keymaps/NetBeans/D-BACK_QUOTE.shadow] is not a
valid DataShadow., 
File MultiFileObject@d60225[Keymaps/Emacs/D-BACK_QUOTE.shadow] is not a valid
DataShadow.]
	at junit.framework.Assert.fail(Assert.java:47)
	at
org.netbeans.core.projects.ValidateLayerConsistencyTest.testValidShadows(ValidateLayerConsistencyTest.java:124)
	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:585)
	at junit.framework.TestCase.runTest(TestCase.java:154)
	at org.netbeans.junit.NbTestCase.runBare(NbTestCase.java:136)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:118)
	at org.netbeans.junit.NbTestCase.access$001(NbTestCase.java:33)
	at org.netbeans.junit.NbTestCase$1.run(NbTestCase.java:105)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
	at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
	at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Comment 1 Jesse Glick 2005-11-17 01:03:57 UTC
Passes fine for me, and we would have noticed immediately if it were failing
since this test is part of the commit validation run by the continuous build.
Also I inspected the relevant files:

ide/defaults/src/org/netbeans/modules/defaults/mf-layer.xml
core/windows/src/org/netbeans/core/windows/actions/RecentViewListAction.java

and everything looks as it should; no changes to either in the last five days.

Perhaps you have corrupted, or incorrectly patched, sources?
Comment 2 charlweed 2005-11-18 19:55:30 UTC
For what it's worth, 
I tried this again on the same PC, and again on another windows XP machine, both
with a complely clean checkout. I get the same failures.
I do NOT get the failures on a Linux box.
I suspect it is a CVS/binary/line-termination/file-attributes problem, but I
have not confirmed this.


Charles
Comment 3 Jesse Glick 2005-11-18 20:14:36 UTC
x
Comment 4 Jesse Glick 2005-11-18 20:22:23 UTC
Looking at the test this time, I see that in testAreAttributesFine - though
*not* in testValidShadows, which is new as of 1.20 (2005/09/20) - there is an
explicit exclusion for this file:

if ("Shortcuts/D-BACK_QUOTE.shadow".equals(fo.getPath())) {
    // #46753
    continue;
}

But of course the above filename no longer exists - was changed when keymaps
were introduced.

Is it possible that every NB developer using Windows has been ignoring a commit
validation failure for *months*?? Please tell me there is some other explanation...
Comment 5 Jaroslav Tulach 2005-11-22 13:33:06 UTC
Probably the simplest fix is to exclude the files in question from the test   
check as well. Hanzi, you have windows, so please do it. And try commit  
validation...  
  
The correct fix however would be similar to ide/applemenu module - e.g. to  
create a module that is enabled only on PlainUnix and register these shortcuts  
there, because the reason why these do not work on Windows is that they are 
conditionally disabled there (but still visible - e.g. just broken). Dafe had 
to do this before we had support for OS dependent modules and never got to the 
proper fix then. 
   
   
Comment 6 Jan Jancura 2005-11-29 08:05:54 UTC
probably some mistake. This is not my test, I do not understand this code, and I
do not know whats wrong. Yarda if you know how to fix it, just do it.
Comment 7 Jaroslav Tulach 2005-11-29 12:20:01 UTC
It may not be your test but it is your integration that makes it fail.  
Moreover you have windows, so you can verify that your fix is correct.  
 
"the simplest fix is to exclude the files in question from the test check" 
 
 
Comment 8 Jan Jancura 2005-11-29 14:37:55 UTC
I can not fix your test, because I do not understand whats wrong.
If the tests are not cirrect, fix them, please.
If I have some issue in my code, file me a bug with some explanation. 
Comment 9 Jaroslav Tulach 2005-11-30 06:46:17 UTC
Hanzi, please admit that you shall not commit your code without running the   
test and that it is your responsibility to fix either the code or the test.   
   
If you want to fix the problem in code, then remove declaration of   
Keymaps/NetBeans/D-BACK_QUOTE.shadow and Keymaps/Emacs/D-BACK_QUOTE.shadow  
from one of your layers.  
  
If you want to fix the problem in test, then try patch like this:  
Index: 
core/test/unit/src/org/netbeans/core/projects/ValidateLayerConsistencyTest.java 
=================================================================== 
RCS 
file: /cvs/core/test/unit/src/org/netbeans/core/projects/ValidateLayerConsistencyTest.java,v 
retrieving revision 1.20 
diff -u -r1.20 ValidateLayerConsistencyTest.java 
--- 
core/test/unit/src/org/netbeans/core/projects/ValidateLayerConsistencyTest.java     
20 Sep 2005 07:20:24 -0000      1.20 
+++ 
core/test/unit/src/org/netbeans/core/projects/ValidateLayerConsistencyTest.java     
30 Nov 2005 06:45:05 -0000 
@@ -70,8 +70,12 @@ 
                 continue; 
             } 
 
-            if ("Shortcuts/D-BACK_QUOTE.shadow".equals(fo.getPath())) { 
-                // #46753 
+            if ("Keymaps/NetBeans/D-BACK_QUOTE.shadow".equals(fo.getPath())) 
{ 
+                // #68866 
+                continue; 
+            } 
+            if ("Keymaps/Emacs/D-BACK_QUOTE.shadow".equals(fo.getPath())) { 
+                // #68866 
                 continue; 
             } 
 
I am sorry I cannot help you more, I do not have windows to verify that the 
above really fixes the problem. 
 
Comment 10 Jan Jancura 2005-11-30 07:20:55 UTC
You have made a big step in our conversation here, thanks!

But I still do not know what is the problem in my code:
> If you want to fix the problem in code, then remove declaration of   
> Keymaps/NetBeans/D-BACK_QUOTE.shadow and Keymaps/Emacs/D-BACK_QUOTE.shadow  
> from one of your layers.

Whats wrong here? I can not create two shadows for one DO in two different folders?
Comment 11 Jan Jancura 2005-12-06 15:32:32 UTC
Yarda explained me how to fix it...
Comment 12 Jan Jancura 2005-12-07 10:50:08 UTC
fixed:


IDE:-------------------------------------------------
IDE: [7.12.05 11:47] Committing "ValidateLayerConsistencyTest.java" started
Checking in ValidateLayerConsistencyTest.java;
/cvs/core/test/unit/src/org/netbeans/core/projects/ValidateLayerConsistencyTest.java,v
 <--  ValidateLayerConsistencyTest.java
new revision: 1.21; previous revision: 1.20
done