/*
* 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 4167874
* @library ../../../../com/sun/net/httpserver
* @build FileServerHandler
* @run shell build.sh
* @summary URL-downloaded jar files can consume all available file descriptors
*/
//
// needs two jar files test1.jar and test2.jar with following structure
//
// com/foo/TestClass1
//
}
}
// repeat test with different implementation
// of test.jar (whose TestClass.getValue() returns 2
// repeat test using a directory of files
}
// create a loader on jarfile (or directory), plus a http loader
// load a class , then look for a resource
// also load a class from http loader
// then close the loader
// check jar (or dir) can be deleted
// check existing classes can be loaded
// check boot classes can be loaded
if (res != expectedValue) {
}
// should find /resource1
throw new RuntimeException ("can't find com/foo/Resource1 in test1.jar");
}
// should NOT find /resource2 even though it is in jar
throw new RuntimeException ("com/foo/Resource2 unexpected in test1.jar");
}
// load tests
// now check we can delete the path
}
return httpServer;
}
return new URL(s);
}
);
httpServer.start();
}
}