/*
* 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 6508981
* @summary cleanup file separator handling in JavacFileManager
* (This test is specifically to test the new impl of inferBinaryName)
* @build p.A
* @run main TestInferBinaryName
*/
/**
* Verify the various implementations of inferBinaryName, but configuring
* different instances of a file manager, getting a file object, and checking
* the impl of inferBinaryName for that file object.
*/
public class TestInferBinaryName {
static final boolean IGNORE_SYMBOL_FILE = false;
static final boolean USE_SYMBOL_FILE = true;
static final boolean DONT_USE_ZIP_FILE_INDEX = false;
static final boolean USE_ZIP_FILE_INDEX = true;
new TestInferBinaryName().run();
}
//System.err.println(System.getProperties());
if (errors > 0)
}
test("testDirectory",
}
test("testSymbolArchive",
}
test("testZipArchive",
}
test("testZipFileIndexArchive",
}
test("testZipFileIndexArchive2",
}
/**
* @param testName for debugging
* @param fm suitably configured file manager
* @param testClassName the classname to test
* @param implClassName the expected classname of the JavaFileObject impl,
* used for checking that we are checking the expected impl of
* inferBinaryName
*/
errors++;
return;
}
}
boolean symFileKind,
boolean zipFileIndexKind)
throws IOException {
if (symFileKind == IGNORE_SYMBOL_FILE)
return fm;
}
if (f.length() > 0)
}
//System.err.println("path: " + path);
return path;
}
errors++;
}
}
private int errors;
}
class A { }