/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/* @test
* @bug 4313887 6838333
* @summary Sanity test for Sun-specific FILE_TREE watch event modifier
* @library ..
*/
public class FileTreeModifier {
{
try {
} catch (InterruptedException x) {
// should not happen
throw new RuntimeException(x);
}
throw new RuntimeException("unexpected event");
throw new RuntimeException("unexpected context");
}
// create directories
// Test ENTRY_CREATE with FILE_TREE modifier.
// create file in a/b/c and check we get create event
// Test ENTRY_DELETE with FILE_TREE modifier.
if (k != key)
throw new RuntimeException("Existing key not returned");
// Test changing registration to ENTRY_CREATE without modifier
if (k != key)
throw new RuntimeException("Existing key not returned");
// check that key is not queued
try {
} catch (InterruptedException e) {
throw new RuntimeException();
}
throw new RuntimeException("WatchKey not expected to be polled");
// create bar and check we get create event
// Test changing registration to <all> with FILE_TREE modifier
if (k != key)
throw new RuntimeException("Existing key not returned");
// modify bar and check we get modify event
}
}
return;
}
try {
} finally {
}
}
}