org.eclipse.core.runtime.content.ITextContentDescriber Java Examples

The following examples show how to use org.eclipse.core.runtime.content.ITextContentDescriber. 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: XMLFormContentDescriberTester.java    From ice with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Test method for
 * {@link org.eclipse.ice.persistence.xml.XMLFormContentDescriber#describe(java.io.Reader, org.eclipse.core.runtime.content.IContentDescription)}
 * .
 */
@Test
public void testBadText() {
	// Test with bad text.
	try {
		assertEquals(ITextContentDescriber.INVALID, runTest("foo"));
	} catch (IOException e) {
		// Complain and fail since these cases should not have produced
		// IOExceptions.
		e.printStackTrace();
		fail();
	}

	return;
}
 
Example #2
Source File: XMLFormContentDescriberTester.java    From ice with Eclipse Public License 1.0 3 votes vote down vote up
/**
 * Test method for
 * {@link org.eclipse.ice.persistence.xml.XMLFormContentDescriber#describe(java.io.InputStream, org.eclipse.core.runtime.content.IContentDescription)}
 * .
 *
 * It is sufficient to only test the first describe() operation since it
 * delegates the work to the second.
 *
 * @throws IOException
 *             This exception is thrown if the stream cannot be read for
 *             some reason.
 */
@Test
public void testDescribe() throws IOException {

	// Test with valid text.
	assertEquals(ITextContentDescriber.VALID, runTest(getForm()));

	return;
}