Java Code Examples for javax.swing.text.html.parser.DTD#getDTD()

The following examples show how to use javax.swing.text.html.parser.DTD#getDTD() . 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: bug8074956.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    final DTD html32 = DTD.getDTD("html32");
    ContentModel contentModel = new ContentModel('&', new ContentModel());

    Element elem1 = html32.getElement("html-element");
    contentModel.first(elem1);

    Element elem2 = html32.getElement("test-element");
    // Shouldn't throw ArrayIndexOutOfBoundsException
    contentModel.first(elem2);
}
 
Example 2
Source File: bug8074956.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    final DTD html32 = DTD.getDTD("html32");
    ContentModel contentModel = new ContentModel('&', new ContentModel());

    Element elem1 = html32.getElement("html-element");
    contentModel.first(elem1);

    Element elem2 = html32.getElement("test-element");
    // Shouldn't throw ArrayIndexOutOfBoundsException
    contentModel.first(elem2);
}
 
Example 3
Source File: bug8074956.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    final DTD html32 = DTD.getDTD("html32");
    ContentModel contentModel = new ContentModel('&', new ContentModel());

    Element elem1 = html32.getElement("html-element");
    contentModel.first(elem1);

    Element elem2 = html32.getElement("test-element");
    // Shouldn't throw ArrayIndexOutOfBoundsException
    contentModel.first(elem2);
}
 
Example 4
Source File: bug8074956.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    final DTD html32 = DTD.getDTD("html32");
    ContentModel contentModel = new ContentModel('&', new ContentModel());

    Element elem1 = html32.getElement("html-element");
    contentModel.first(elem1);

    Element elem2 = html32.getElement("test-element");
    // Shouldn't throw ArrayIndexOutOfBoundsException
    contentModel.first(elem2);
}
 
Example 5
Source File: bug8074956.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    final DTD html32 = DTD.getDTD("html32");
    ContentModel contentModel = new ContentModel('&', new ContentModel());

    Element elem1 = html32.getElement("html-element");
    contentModel.first(elem1);

    Element elem2 = html32.getElement("test-element");
    // Shouldn't throw ArrayIndexOutOfBoundsException
    contentModel.first(elem2);
}
 
Example 6
Source File: bug8074956.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    final DTD html32 = DTD.getDTD("html32");
    ContentModel contentModel = new ContentModel('&', new ContentModel());

    Element elem1 = html32.getElement("html-element");
    contentModel.first(elem1);

    Element elem2 = html32.getElement("test-element");
    // Shouldn't throw ArrayIndexOutOfBoundsException
    contentModel.first(elem2);
}
 
Example 7
Source File: bug8074956.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    final DTD html32 = DTD.getDTD("html32");
    ContentModel contentModel = new ContentModel('&', new ContentModel());

    Element elem1 = html32.getElement("html-element");
    contentModel.first(elem1);

    Element elem2 = html32.getElement("test-element");
    // Shouldn't throw ArrayIndexOutOfBoundsException
    contentModel.first(elem2);
}
 
Example 8
Source File: bug8074956.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    final DTD html32 = DTD.getDTD("html32");
    ContentModel contentModel = new ContentModel('&', new ContentModel());

    Element elem1 = html32.getElement("html-element");
    contentModel.first(elem1);

    Element elem2 = html32.getElement("test-element");
    // Shouldn't throw ArrayIndexOutOfBoundsException
    contentModel.first(elem2);
}
 
Example 9
Source File: bug6938813.java    From openjdk-jdk8u with GNU General Public License v2.0 3 votes vote down vote up
private static void validate() throws Exception {
    AppContext appContext = AppContext.getAppContext();

    assertTrue(DTD.getDTD(DTD_KEY).getName().equals(DTD_KEY), "DTD.getDTD() mixed AppContexts");

    // Spoil hash value
    DTD invalidDtd = DTD.getDTD("invalid DTD");

    DTD.putDTDHash(DTD_KEY, invalidDtd);

    assertTrue(DTD.getDTD(DTD_KEY) == invalidDtd, "Something wrong with DTD.getDTD()");

    Object dtdKey = getParserDelegator_DTD_KEY();

    assertTrue(appContext.get(dtdKey) == null, "ParserDelegator mixed AppContexts");

    // Init default DTD
    new ParserDelegator();

    Object dtdValue = appContext.get(dtdKey);

    assertTrue(dtdValue != null, "ParserDelegator.defaultDTD isn't initialized");

    // Try reinit default DTD
    new ParserDelegator();

    assertTrue(dtdValue == appContext.get(dtdKey), "ParserDelegator.defaultDTD created a duplicate");

    HTMLEditorKit htmlEditorKit = new HTMLEditorKit();

    if (styleSheet == null) {
        // First AppContext
        styleSheet = htmlEditorKit.getStyleSheet();

        assertTrue(styleSheet != null, "htmlEditorKit.getStyleSheet() returns null");
        assertTrue(htmlEditorKit.getStyleSheet() == styleSheet, "Something wrong with htmlEditorKit.getStyleSheet()");
    } else {
        assertTrue(htmlEditorKit.getStyleSheet() != styleSheet, "HtmlEditorKit.getStyleSheet() mixed AppContexts");
    }
}
 
Example 10
Source File: bug6938813.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 3 votes vote down vote up
private static void validate() throws Exception {
    AppContext appContext = AppContext.getAppContext();

    assertTrue(DTD.getDTD(DTD_KEY).getName().equals(DTD_KEY), "DTD.getDTD() mixed AppContexts");

    // Spoil hash value
    DTD invalidDtd = DTD.getDTD("invalid DTD");

    DTD.putDTDHash(DTD_KEY, invalidDtd);

    assertTrue(DTD.getDTD(DTD_KEY) == invalidDtd, "Something wrong with DTD.getDTD()");

    Object dtdKey = getParserDelegator_DTD_KEY();

    assertTrue(appContext.get(dtdKey) == null, "ParserDelegator mixed AppContexts");

    // Init default DTD
    new ParserDelegator();

    Object dtdValue = appContext.get(dtdKey);

    assertTrue(dtdValue != null, "ParserDelegator.defaultDTD isn't initialized");

    // Try reinit default DTD
    new ParserDelegator();

    assertTrue(dtdValue == appContext.get(dtdKey), "ParserDelegator.defaultDTD created a duplicate");

    HTMLEditorKit htmlEditorKit = new HTMLEditorKit();

    if (styleSheet == null) {
        // First AppContext
        styleSheet = htmlEditorKit.getStyleSheet();

        assertTrue(styleSheet != null, "htmlEditorKit.getStyleSheet() returns null");
        assertTrue(htmlEditorKit.getStyleSheet() == styleSheet, "Something wrong with htmlEditorKit.getStyleSheet()");
    } else {
        assertTrue(htmlEditorKit.getStyleSheet() != styleSheet, "HtmlEditorKit.getStyleSheet() mixed AppContexts");
    }
}
 
Example 11
Source File: bug6938813.java    From jdk8u60 with GNU General Public License v2.0 3 votes vote down vote up
private static void validate() throws Exception {
    AppContext appContext = AppContext.getAppContext();

    assertTrue(DTD.getDTD(DTD_KEY).getName().equals(DTD_KEY), "DTD.getDTD() mixed AppContexts");

    // Spoil hash value
    DTD invalidDtd = DTD.getDTD("invalid DTD");

    DTD.putDTDHash(DTD_KEY, invalidDtd);

    assertTrue(DTD.getDTD(DTD_KEY) == invalidDtd, "Something wrong with DTD.getDTD()");

    Object dtdKey = getParserDelegator_DTD_KEY();

    assertTrue(appContext.get(dtdKey) == null, "ParserDelegator mixed AppContexts");

    // Init default DTD
    new ParserDelegator();

    Object dtdValue = appContext.get(dtdKey);

    assertTrue(dtdValue != null, "ParserDelegator.defaultDTD isn't initialized");

    // Try reinit default DTD
    new ParserDelegator();

    assertTrue(dtdValue == appContext.get(dtdKey), "ParserDelegator.defaultDTD created a duplicate");

    HTMLEditorKit htmlEditorKit = new HTMLEditorKit();

    if (styleSheet == null) {
        // First AppContext
        styleSheet = htmlEditorKit.getStyleSheet();

        assertTrue(styleSheet != null, "htmlEditorKit.getStyleSheet() returns null");
        assertTrue(htmlEditorKit.getStyleSheet() == styleSheet, "Something wrong with htmlEditorKit.getStyleSheet()");
    } else {
        assertTrue(htmlEditorKit.getStyleSheet() != styleSheet, "HtmlEditorKit.getStyleSheet() mixed AppContexts");
    }
}
 
Example 12
Source File: bug6938813.java    From jdk8u-jdk with GNU General Public License v2.0 3 votes vote down vote up
private static void validate() throws Exception {
    AppContext appContext = AppContext.getAppContext();

    assertTrue(DTD.getDTD(DTD_KEY).getName().equals(DTD_KEY), "DTD.getDTD() mixed AppContexts");

    // Spoil hash value
    DTD invalidDtd = DTD.getDTD("invalid DTD");

    DTD.putDTDHash(DTD_KEY, invalidDtd);

    assertTrue(DTD.getDTD(DTD_KEY) == invalidDtd, "Something wrong with DTD.getDTD()");

    Object dtdKey = getParserDelegator_DTD_KEY();

    assertTrue(appContext.get(dtdKey) == null, "ParserDelegator mixed AppContexts");

    // Init default DTD
    new ParserDelegator();

    Object dtdValue = appContext.get(dtdKey);

    assertTrue(dtdValue != null, "ParserDelegator.defaultDTD isn't initialized");

    // Try reinit default DTD
    new ParserDelegator();

    assertTrue(dtdValue == appContext.get(dtdKey), "ParserDelegator.defaultDTD created a duplicate");

    HTMLEditorKit htmlEditorKit = new HTMLEditorKit();

    if (styleSheet == null) {
        // First AppContext
        styleSheet = htmlEditorKit.getStyleSheet();

        assertTrue(styleSheet != null, "htmlEditorKit.getStyleSheet() returns null");
        assertTrue(htmlEditorKit.getStyleSheet() == styleSheet, "Something wrong with htmlEditorKit.getStyleSheet()");
    } else {
        assertTrue(htmlEditorKit.getStyleSheet() != styleSheet, "HtmlEditorKit.getStyleSheet() mixed AppContexts");
    }
}
 
Example 13
Source File: bug6938813.java    From jdk8u-jdk with GNU General Public License v2.0 3 votes vote down vote up
private static void validate() throws Exception {
    AppContext appContext = AppContext.getAppContext();

    assertTrue(DTD.getDTD(DTD_KEY).getName().equals(DTD_KEY), "DTD.getDTD() mixed AppContexts");

    // Spoil hash value
    DTD invalidDtd = DTD.getDTD("invalid DTD");

    DTD.putDTDHash(DTD_KEY, invalidDtd);

    assertTrue(DTD.getDTD(DTD_KEY) == invalidDtd, "Something wrong with DTD.getDTD()");

    Object dtdKey = getParserDelegator_DTD_KEY();

    assertTrue(appContext.get(dtdKey) == null, "ParserDelegator mixed AppContexts");

    // Init default DTD
    new ParserDelegator();

    Object dtdValue = appContext.get(dtdKey);

    assertTrue(dtdValue != null, "ParserDelegator.defaultDTD isn't initialized");

    // Try reinit default DTD
    new ParserDelegator();

    assertTrue(dtdValue == appContext.get(dtdKey), "ParserDelegator.defaultDTD created a duplicate");

    HTMLEditorKit htmlEditorKit = new HTMLEditorKit();

    if (styleSheet == null) {
        // First AppContext
        styleSheet = htmlEditorKit.getStyleSheet();

        assertTrue(styleSheet != null, "htmlEditorKit.getStyleSheet() returns null");
        assertTrue(htmlEditorKit.getStyleSheet() == styleSheet, "Something wrong with htmlEditorKit.getStyleSheet()");
    } else {
        assertTrue(htmlEditorKit.getStyleSheet() != styleSheet, "HtmlEditorKit.getStyleSheet() mixed AppContexts");
    }
}
 
Example 14
Source File: bug6938813.java    From TencentKona-8 with GNU General Public License v2.0 3 votes vote down vote up
private static void validate() throws Exception {
    AppContext appContext = AppContext.getAppContext();

    assertTrue(DTD.getDTD(DTD_KEY).getName().equals(DTD_KEY), "DTD.getDTD() mixed AppContexts");

    // Spoil hash value
    DTD invalidDtd = DTD.getDTD("invalid DTD");

    DTD.putDTDHash(DTD_KEY, invalidDtd);

    assertTrue(DTD.getDTD(DTD_KEY) == invalidDtd, "Something wrong with DTD.getDTD()");

    Object dtdKey = getParserDelegator_DTD_KEY();

    assertTrue(appContext.get(dtdKey) == null, "ParserDelegator mixed AppContexts");

    // Init default DTD
    new ParserDelegator();

    Object dtdValue = appContext.get(dtdKey);

    assertTrue(dtdValue != null, "ParserDelegator.defaultDTD isn't initialized");

    // Try reinit default DTD
    new ParserDelegator();

    assertTrue(dtdValue == appContext.get(dtdKey), "ParserDelegator.defaultDTD created a duplicate");

    HTMLEditorKit htmlEditorKit = new HTMLEditorKit();

    if (styleSheet == null) {
        // First AppContext
        styleSheet = htmlEditorKit.getStyleSheet();

        assertTrue(styleSheet != null, "htmlEditorKit.getStyleSheet() returns null");
        assertTrue(htmlEditorKit.getStyleSheet() == styleSheet, "Something wrong with htmlEditorKit.getStyleSheet()");
    } else {
        assertTrue(htmlEditorKit.getStyleSheet() != styleSheet, "HtmlEditorKit.getStyleSheet() mixed AppContexts");
    }
}
 
Example 15
Source File: bug6938813.java    From hottub with GNU General Public License v2.0 3 votes vote down vote up
private static void validate() throws Exception {
    AppContext appContext = AppContext.getAppContext();

    assertTrue(DTD.getDTD(DTD_KEY).getName().equals(DTD_KEY), "DTD.getDTD() mixed AppContexts");

    // Spoil hash value
    DTD invalidDtd = DTD.getDTD("invalid DTD");

    DTD.putDTDHash(DTD_KEY, invalidDtd);

    assertTrue(DTD.getDTD(DTD_KEY) == invalidDtd, "Something wrong with DTD.getDTD()");

    Object dtdKey = getParserDelegator_DTD_KEY();

    assertTrue(appContext.get(dtdKey) == null, "ParserDelegator mixed AppContexts");

    // Init default DTD
    new ParserDelegator();

    Object dtdValue = appContext.get(dtdKey);

    assertTrue(dtdValue != null, "ParserDelegator.defaultDTD isn't initialized");

    // Try reinit default DTD
    new ParserDelegator();

    assertTrue(dtdValue == appContext.get(dtdKey), "ParserDelegator.defaultDTD created a duplicate");

    HTMLEditorKit htmlEditorKit = new HTMLEditorKit();

    if (styleSheet == null) {
        // First AppContext
        styleSheet = htmlEditorKit.getStyleSheet();

        assertTrue(styleSheet != null, "htmlEditorKit.getStyleSheet() returns null");
        assertTrue(htmlEditorKit.getStyleSheet() == styleSheet, "Something wrong with htmlEditorKit.getStyleSheet()");
    } else {
        assertTrue(htmlEditorKit.getStyleSheet() != styleSheet, "HtmlEditorKit.getStyleSheet() mixed AppContexts");
    }
}
 
Example 16
Source File: bug6938813.java    From jdk8u-dev-jdk with GNU General Public License v2.0 3 votes vote down vote up
private static void validate() throws Exception {
    AppContext appContext = AppContext.getAppContext();

    assertTrue(DTD.getDTD(DTD_KEY).getName().equals(DTD_KEY), "DTD.getDTD() mixed AppContexts");

    // Spoil hash value
    DTD invalidDtd = DTD.getDTD("invalid DTD");

    DTD.putDTDHash(DTD_KEY, invalidDtd);

    assertTrue(DTD.getDTD(DTD_KEY) == invalidDtd, "Something wrong with DTD.getDTD()");

    Object dtdKey = getParserDelegator_DTD_KEY();

    assertTrue(appContext.get(dtdKey) == null, "ParserDelegator mixed AppContexts");

    // Init default DTD
    new ParserDelegator();

    Object dtdValue = appContext.get(dtdKey);

    assertTrue(dtdValue != null, "ParserDelegator.defaultDTD isn't initialized");

    // Try reinit default DTD
    new ParserDelegator();

    assertTrue(dtdValue == appContext.get(dtdKey), "ParserDelegator.defaultDTD created a duplicate");

    HTMLEditorKit htmlEditorKit = new HTMLEditorKit();

    if (styleSheet == null) {
        // First AppContext
        styleSheet = htmlEditorKit.getStyleSheet();

        assertTrue(styleSheet != null, "htmlEditorKit.getStyleSheet() returns null");
        assertTrue(htmlEditorKit.getStyleSheet() == styleSheet, "Something wrong with htmlEditorKit.getStyleSheet()");
    } else {
        assertTrue(htmlEditorKit.getStyleSheet() != styleSheet, "HtmlEditorKit.getStyleSheet() mixed AppContexts");
    }
}
 
Example 17
Source File: bug6938813.java    From openjdk-8-source with GNU General Public License v2.0 3 votes vote down vote up
private static void validate() throws Exception {
    AppContext appContext = AppContext.getAppContext();

    assertTrue(DTD.getDTD(DTD_KEY).getName().equals(DTD_KEY), "DTD.getDTD() mixed AppContexts");

    // Spoil hash value
    DTD invalidDtd = DTD.getDTD("invalid DTD");

    DTD.putDTDHash(DTD_KEY, invalidDtd);

    assertTrue(DTD.getDTD(DTD_KEY) == invalidDtd, "Something wrong with DTD.getDTD()");

    Object dtdKey = getParserDelegator_DTD_KEY();

    assertTrue(appContext.get(dtdKey) == null, "ParserDelegator mixed AppContexts");

    // Init default DTD
    new ParserDelegator();

    Object dtdValue = appContext.get(dtdKey);

    assertTrue(dtdValue != null, "ParserDelegator.defaultDTD isn't initialized");

    // Try reinit default DTD
    new ParserDelegator();

    assertTrue(dtdValue == appContext.get(dtdKey), "ParserDelegator.defaultDTD created a duplicate");

    HTMLEditorKit htmlEditorKit = new HTMLEditorKit();

    if (styleSheet == null) {
        // First AppContext
        styleSheet = htmlEditorKit.getStyleSheet();

        assertTrue(styleSheet != null, "htmlEditorKit.getStyleSheet() returns null");
        assertTrue(htmlEditorKit.getStyleSheet() == styleSheet, "Something wrong with htmlEditorKit.getStyleSheet()");
    } else {
        assertTrue(htmlEditorKit.getStyleSheet() != styleSheet, "HtmlEditorKit.getStyleSheet() mixed AppContexts");
    }
}
 
Example 18
Source File: bug6938813.java    From openjdk-8 with GNU General Public License v2.0 3 votes vote down vote up
private static void validate() throws Exception {
    AppContext appContext = AppContext.getAppContext();

    assertTrue(DTD.getDTD(DTD_KEY).getName().equals(DTD_KEY), "DTD.getDTD() mixed AppContexts");

    // Spoil hash value
    DTD invalidDtd = DTD.getDTD("invalid DTD");

    DTD.putDTDHash(DTD_KEY, invalidDtd);

    assertTrue(DTD.getDTD(DTD_KEY) == invalidDtd, "Something wrong with DTD.getDTD()");

    Object dtdKey = getParserDelegator_DTD_KEY();

    assertTrue(appContext.get(dtdKey) == null, "ParserDelegator mixed AppContexts");

    // Init default DTD
    new ParserDelegator();

    Object dtdValue = appContext.get(dtdKey);

    assertTrue(dtdValue != null, "ParserDelegator.defaultDTD isn't initialized");

    // Try reinit default DTD
    new ParserDelegator();

    assertTrue(dtdValue == appContext.get(dtdKey), "ParserDelegator.defaultDTD created a duplicate");

    HTMLEditorKit htmlEditorKit = new HTMLEditorKit();

    if (styleSheet == null) {
        // First AppContext
        styleSheet = htmlEditorKit.getStyleSheet();

        assertTrue(styleSheet != null, "htmlEditorKit.getStyleSheet() returns null");
        assertTrue(htmlEditorKit.getStyleSheet() == styleSheet, "Something wrong with htmlEditorKit.getStyleSheet()");
    } else {
        assertTrue(htmlEditorKit.getStyleSheet() != styleSheet, "HtmlEditorKit.getStyleSheet() mixed AppContexts");
    }
}
 
Example 19
Source File: bug6938813.java    From jdk8u_jdk with GNU General Public License v2.0 3 votes vote down vote up
private static void validate() throws Exception {
    AppContext appContext = AppContext.getAppContext();

    assertTrue(DTD.getDTD(DTD_KEY).getName().equals(DTD_KEY), "DTD.getDTD() mixed AppContexts");

    // Spoil hash value
    DTD invalidDtd = DTD.getDTD("invalid DTD");

    DTD.putDTDHash(DTD_KEY, invalidDtd);

    assertTrue(DTD.getDTD(DTD_KEY) == invalidDtd, "Something wrong with DTD.getDTD()");

    Object dtdKey = getParserDelegator_DTD_KEY();

    assertTrue(appContext.get(dtdKey) == null, "ParserDelegator mixed AppContexts");

    // Init default DTD
    new ParserDelegator();

    Object dtdValue = appContext.get(dtdKey);

    assertTrue(dtdValue != null, "ParserDelegator.defaultDTD isn't initialized");

    // Try reinit default DTD
    new ParserDelegator();

    assertTrue(dtdValue == appContext.get(dtdKey), "ParserDelegator.defaultDTD created a duplicate");

    HTMLEditorKit htmlEditorKit = new HTMLEditorKit();

    if (styleSheet == null) {
        // First AppContext
        styleSheet = htmlEditorKit.getStyleSheet();

        assertTrue(styleSheet != null, "htmlEditorKit.getStyleSheet() returns null");
        assertTrue(htmlEditorKit.getStyleSheet() == styleSheet, "Something wrong with htmlEditorKit.getStyleSheet()");
    } else {
        assertTrue(htmlEditorKit.getStyleSheet() != styleSheet, "HtmlEditorKit.getStyleSheet() mixed AppContexts");
    }
}
 
Example 20
Source File: bug6938813.java    From dragonwell8_jdk with GNU General Public License v2.0 3 votes vote down vote up
private static void validate() throws Exception {
    AppContext appContext = AppContext.getAppContext();

    assertTrue(DTD.getDTD(DTD_KEY).getName().equals(DTD_KEY), "DTD.getDTD() mixed AppContexts");

    // Spoil hash value
    DTD invalidDtd = DTD.getDTD("invalid DTD");

    DTD.putDTDHash(DTD_KEY, invalidDtd);

    assertTrue(DTD.getDTD(DTD_KEY) == invalidDtd, "Something wrong with DTD.getDTD()");

    Object dtdKey = getParserDelegator_DTD_KEY();

    assertTrue(appContext.get(dtdKey) == null, "ParserDelegator mixed AppContexts");

    // Init default DTD
    new ParserDelegator();

    Object dtdValue = appContext.get(dtdKey);

    assertTrue(dtdValue != null, "ParserDelegator.defaultDTD isn't initialized");

    // Try reinit default DTD
    new ParserDelegator();

    assertTrue(dtdValue == appContext.get(dtdKey), "ParserDelegator.defaultDTD created a duplicate");

    HTMLEditorKit htmlEditorKit = new HTMLEditorKit();

    if (styleSheet == null) {
        // First AppContext
        styleSheet = htmlEditorKit.getStyleSheet();

        assertTrue(styleSheet != null, "htmlEditorKit.getStyleSheet() returns null");
        assertTrue(htmlEditorKit.getStyleSheet() == styleSheet, "Something wrong with htmlEditorKit.getStyleSheet()");
    } else {
        assertTrue(htmlEditorKit.getStyleSheet() != styleSheet, "HtmlEditorKit.getStyleSheet() mixed AppContexts");
    }
}