Java Code Examples for javax.imageio.spi.ImageWriterSpi#getFileSuffixes()

The following examples show how to use javax.imageio.spi.ImageWriterSpi#getFileSuffixes() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SpiTest.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public void testImageWriterSpiConstructor() {
    resetConstructorArguments();

    checkImageWriterSpiConstructor(true);
    vendorName = "My Vendor";
    checkImageWriterSpiConstructor(true);
    version = "My Version";
    checkImageWriterSpiConstructor(true);
    names = new String[0];
    checkImageWriterSpiConstructor(true);
    names = new String[1];
    names[0] = "My Format Name";
    checkImageWriterSpiConstructor(true);
    writerClassName = "com.mycompany.Writer";
    checkImageWriterSpiConstructor(true);
    outputTypes = new Class[0];
    checkImageWriterSpiConstructor(true);
    outputTypes = new Class[1];
    outputTypes[0] = Object.class;
    // Now it should work
    checkImageWriterSpiConstructor(false);

    // Test normalization of zero-length arrays
    suffixes = new String[0];
    MIMETypes = new String[0];
    readerSpiNames = new String[0];
    extraStreamMetadataFormatNames = new String[0];
    extraStreamMetadataFormatClassNames = new String[0];
    extraImageMetadataFormatNames = new String[0];
    extraImageMetadataFormatClassNames = new String[0];

    ImageWriterSpi spi = constructImageWriterSpi();
    if (spi.getFileSuffixes() != null) {
        error("Failed to normalize suffixes!");
    }
    if (spi.getMIMETypes() != null) {
        error("Failed to normalize MIMETypes!");
    }
    if (spi.getImageReaderSpiNames() != null) {
        error("Failed to normalize readerSpiNames!");
    }
    if (spi.getExtraStreamMetadataFormatNames() != null) {
        error("Failed to normalize extraStreamMetadataFormatNames!");
    }
    if (spi.getExtraImageMetadataFormatNames() != null) {
        error("Failed to normalize extraImageMetadataFormatNames!");
    }
}
 
Example 2
Source File: SpiTest.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
public void testImageWriterSpiConstructor() {
    resetConstructorArguments();

    checkImageWriterSpiConstructor(true);
    vendorName = "My Vendor";
    checkImageWriterSpiConstructor(true);
    version = "My Version";
    checkImageWriterSpiConstructor(true);
    names = new String[0];
    checkImageWriterSpiConstructor(true);
    names = new String[1];
    names[0] = "My Format Name";
    checkImageWriterSpiConstructor(true);
    writerClassName = "com.mycompany.Writer";
    checkImageWriterSpiConstructor(true);
    outputTypes = new Class[0];
    checkImageWriterSpiConstructor(true);
    outputTypes = new Class[1];
    outputTypes[0] = Object.class;
    // Now it should work
    checkImageWriterSpiConstructor(false);

    // Test normalization of zero-length arrays
    suffixes = new String[0];
    MIMETypes = new String[0];
    readerSpiNames = new String[0];
    extraStreamMetadataFormatNames = new String[0];
    extraStreamMetadataFormatClassNames = new String[0];
    extraImageMetadataFormatNames = new String[0];
    extraImageMetadataFormatClassNames = new String[0];

    ImageWriterSpi spi = constructImageWriterSpi();
    if (spi.getFileSuffixes() != null) {
        error("Failed to normalize suffixes!");
    }
    if (spi.getMIMETypes() != null) {
        error("Failed to normalize MIMETypes!");
    }
    if (spi.getImageReaderSpiNames() != null) {
        error("Failed to normalize readerSpiNames!");
    }
    if (spi.getExtraStreamMetadataFormatNames() != null) {
        error("Failed to normalize extraStreamMetadataFormatNames!");
    }
    if (spi.getExtraImageMetadataFormatNames() != null) {
        error("Failed to normalize extraImageMetadataFormatNames!");
    }
}