Lines 74-85
Link Here
|
74 |
//assertGC("", ref); |
74 |
//assertGC("", ref); |
75 |
} |
75 |
} |
76 |
|
76 |
|
77 |
public void testEventsDelivery81746() throws Exception { |
77 |
public void testEventsDelivery81746() throws Exception { |
|
|
78 |
doEventsDelivery81746(1); |
79 |
} |
80 |
|
81 |
public void testEventsDeliveryInInnerAtomicActions82459() throws Exception { |
82 |
doEventsDelivery81746(2); |
83 |
} |
84 |
|
85 |
private void doEventsDelivery81746(final int howDeep) throws Exception { |
78 |
checkSetUp(); |
86 |
checkSetUp(); |
79 |
final FileObject fold = getTestFolder1(root); |
87 |
final FileObject fold = getTestFolder1(root); |
80 |
if (fold.getFileSystem().isReadOnly()) { |
88 |
if (fold.getFileSystem().isReadOnly()) { |
81 |
return; |
89 |
return; |
82 |
} |
90 |
} |
|
|
91 |
class L extends FileChangeAdapter { |
92 |
public int cnt; |
93 |
|
94 |
public void fileDataCreated(FileEvent fe) { |
95 |
cnt++; |
96 |
} |
97 |
} |
98 |
|
83 |
final FileChangeListener noFileDataCreatedListener = new FileChangeAdapter(){ |
99 |
final FileChangeListener noFileDataCreatedListener = new FileChangeAdapter(){ |
84 |
public void fileDataCreated(FileEvent fe) { |
100 |
public void fileDataCreated(FileEvent fe) { |
85 |
fail(); |
101 |
fail(); |
Lines 96-105
Link Here
|
96 |
} |
112 |
} |
97 |
}; |
113 |
}; |
98 |
|
114 |
|
|
|
115 |
final L countingL = new L(); |
99 |
try { |
116 |
try { |
100 |
fold.getFileSystem().addFileChangeListener(listener1); |
117 |
fold.getFileSystem().addFileChangeListener(listener1); |
|
|
118 |
fold.addFileChangeListener(countingL); |
119 |
fold.getFileSystem().addFileChangeListener(countingL); |
101 |
fold.getFileSystem().runAtomicAction(new FileSystem.AtomicAction(){ |
120 |
fold.getFileSystem().runAtomicAction(new FileSystem.AtomicAction(){ |
|
|
121 |
private int stillDeep = howDeep; |
122 |
|
102 |
public void run() throws java.io.IOException { |
123 |
public void run() throws java.io.IOException { |
|
|
124 |
if (--stillDeep > 0) { |
125 |
fold.getFileSystem().runAtomicAction(this); |
126 |
assertEquals("No events in inner actions", 0, countingL.cnt); |
127 |
return; |
128 |
} |
129 |
|
130 |
|
103 |
fold.createData("file1"); |
131 |
fold.createData("file1"); |
104 |
fold.createData("file2"); |
132 |
fold.createData("file2"); |
105 |
} |
133 |
} |