blob: 1a64df1844eb4d5b7bf2ff1af9d17f86d13e7ee4 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2009, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.wst.css.core.tests.testfiles;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import junit.framework.TestCase;
import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
public class CSSModelLoadTest extends TestCase {
private static final String HTML4_CSS = "html4.css";
public CSSModelLoadTest() {
super("CSS Model Loading Suite");
}
public void testLoadCSSfromStream() throws UnsupportedEncodingException, IOException {
InputStream input = null;
input = CSSModelLoadTest.class.getResourceAsStream(HTML4_CSS);
IStructuredModel model = StructuredModelManager.getModelManager().getModelForEdit(HTML4_CSS, input, null);
assertNotNull(model);
assertTrue("IStructuredModel was not a ICSSModel", model instanceof ICSSModel);
assertTrue("contents are incomplete", model.getStructuredDocument().get().indexOf("Basic HTML style information") > 4);
model.releaseFromEdit();
}
}