本文整理汇总了Java中javax.swing.text.html.parser.ContentModel.first方法的典型用法代码示例。如果您正苦于以下问题:Java ContentModel.first方法的具体用法?Java ContentModel.first怎么用?Java ContentModel.first使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.text.html.parser.ContentModel
的用法示例。
在下文中一共展示了ContentModel.first方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import javax.swing.text.html.parser.ContentModel; //导入方法依赖的package包/类
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);
}
示例2: testFirstObject059
import javax.swing.text.html.parser.ContentModel; //导入方法依赖的package包/类
/**
* Test method for 'org.apache.harmony.swing.tests.javax.swing.text.parser.ContentModel.first(Object)'
* ContentModel(43,ContentModel(42,null)) parameter: ContentModel(43,null)
* expected: NullPointerException
*/
public void testFirstObject059() {
try {
ContentModel cm2 = new ContentModel(42, null);
cm = new ContentModel(43, cm2);
cm.first(cm2);
fail("Should raise NullPointerException");
} catch (NullPointerException e) {
// Expected
}
}
示例3: testFirst009
import javax.swing.text.html.parser.ContentModel; //导入方法依赖的package包/类
/**
* Test method for 'org.apache.harmony.swing.tests.javax.swing.text.parser.ContentModel.first()'
* Parameters type=Integer.MAX_VALUE, ContentModel() Expected result is
* ClassCastException
*/
public void testFirst009() {
try {
ContentModel cm2 = new ContentModel();
cm = new ContentModel(Integer.MAX_VALUE, cm2);
Element result = cm.first();
fail("Should raise ClassCastException, but was returned:" + result);
} catch (ClassCastException e) {
// Expected
}
}
示例4: testFirst016
import javax.swing.text.html.parser.ContentModel; //导入方法依赖的package包/类
/**
* Test method for 'org.apache.harmony.swing.tests.javax.swing.text.parser.ContentModel.first()'
* Parameters type=0, ContentModel(0,ContentModel()) Expected result is
* ClassCastException
*/
public void testFirst016() {
try {
ContentModel cm2 = new ContentModel();
ContentModel cm3 = new ContentModel(0, cm2);
cm = new ContentModel(0, cm3);
Element result = cm.first();
fail("Should raise ClassCastException, but was returned:" + result);
} catch (ClassCastException e) {
// Expected
}
}
示例5: testFirst017
import javax.swing.text.html.parser.ContentModel; //导入方法依赖的package包/类
/**
* Test method for 'org.apache.harmony.swing.tests.javax.swing.text.parser.ContentModel.first()'
* Parameters type=Integer.MIN_VALUE,
* ContentModel(Integer.MAX_VALUE,ContentModel()) Expected result is
* ClassCastException
*/
public void testFirst017() {
try {
ContentModel cm2 = new ContentModel();
ContentModel cm3 = new ContentModel(Integer.MAX_VALUE, cm2);
cm = new ContentModel(Integer.MIN_VALUE, cm3);
Element result = cm.first();
fail("Should raise ClassCastException, but was returned:" + result);
} catch (ClassCastException e) {
// Expected
}
}
示例6: testFirst018
import javax.swing.text.html.parser.ContentModel; //导入方法依赖的package包/类
/**
* Test method for 'org.apache.harmony.swing.tests.javax.swing.text.parser.ContentModel.first()'
* Parameters type=Integer.MAX_VALUE,
* ContentModel(Integer.MIN_VALUE,ContentModel()) Expected result is
* ClassCastException
*/
public void testFirst018() {
try {
ContentModel cm2 = new ContentModel();
ContentModel cm3 = new ContentModel(Integer.MIN_VALUE, cm2);
cm = new ContentModel(Integer.MAX_VALUE, cm3);
Element result = cm.first();
fail("Should raise ClassCastException, but was returned:" + result);
} catch (ClassCastException e) {
// Expected
}
}
示例7: testFirstObject017
import javax.swing.text.html.parser.ContentModel; //导入方法依赖的package包/类
/**
* Test method for 'org.apache.harmony.swing.tests.javax.swing.text.parser.ContentModel.first(Object)'
* ContentModel(124, ContentModel()) parameter is same contentModel
* Expected: ClassCastException
*/
public void testFirstObject017() {
try {
ContentModel cm2 = new ContentModel();
cm = new ContentModel(124, cm2);
cm.first(cm);
fail("Should raise ClassCastException");
} catch (ClassCastException e) {
// Expected
}
}
示例8: testFirstObject018
import javax.swing.text.html.parser.ContentModel; //导入方法依赖的package包/类
/**
* Test method for 'org.apache.harmony.swing.tests.javax.swing.text.parser.ContentModel.first(Object)'
* ContentModel(38, ContentModel()) parameter is same contentModel Expected:
* ClassCastException
*/
public void testFirstObject018() {
try {
ContentModel cm2 = new ContentModel();
cm = new ContentModel(38, cm2);
cm.first(cm);
fail("Should raise ClassCastException");
} catch (ClassCastException e) {
// Expected
}
}
示例9: testFirstObject019
import javax.swing.text.html.parser.ContentModel; //导入方法依赖的package包/类
/**
* Test method for 'org.apache.harmony.swing.tests.javax.swing.text.parser.ContentModel.first(Object)'
* ContentModel(124, ContentModel()) parameter is ContentModel() Expected:
* ClassCastException
*/
public void testFirstObject019() {
try {
ContentModel cm2 = new ContentModel();
cm = new ContentModel(124, cm2);
boolean result = cm.first(cm2);
fail("Should raise ClassCastException, but was returned:" + result);
} catch (ClassCastException e) {
// Expected
}
}
示例10: testFirstObject020
import javax.swing.text.html.parser.ContentModel; //导入方法依赖的package包/类
/**
* Test method for 'org.apache.harmony.swing.tests.javax.swing.text.parser.ContentModel.first(Object)'
* ContentModel(38, ContentModel()) parameter is ContentModel() Expected:
* ClassCastException
*/
public void testFirstObject020() {
try {
ContentModel cm2 = new ContentModel();
cm = new ContentModel(38, cm2);
boolean result = cm.first(cm2);
fail("Should raise ClassCastException, but was returned:" + result);
} catch (ClassCastException e) {
// Expected
}
}
示例11: testFirstObject021
import javax.swing.text.html.parser.ContentModel; //导入方法依赖的package包/类
/**
* Test method for 'org.apache.harmony.swing.tests.javax.swing.text.parser.ContentModel.first(Object)'
* ContentModel(124, ContentModel()) parameter is "" Expected:
* ClassCastException
*/
public void testFirstObject021() {
try {
ContentModel cm2 = new ContentModel();
cm = new ContentModel(124, cm2);
cm.first("");
fail("Should raise ClassCastException");
} catch (ClassCastException e) {
// Expected
}
}
示例12: testFirstObject022
import javax.swing.text.html.parser.ContentModel; //导入方法依赖的package包/类
/**
* Test method for 'org.apache.harmony.swing.tests.javax.swing.text.parser.ContentModel.first(Object)'
* ContentModel(38, ContentModel()) parameter is "" Expected:
* ClassCastException
*/
public void testFirstObject022() {
try {
ContentModel cm2 = new ContentModel();
cm = new ContentModel(38, cm2);
cm.first(dtd);
fail("Should raise NullPointerException");
} catch (NullPointerException e) {
// Expected
}
}
示例13: testFirstObject026
import javax.swing.text.html.parser.ContentModel; //导入方法依赖的package包/类
/**
* Test method for 'org.apache.harmony.swing.tests.javax.swing.text.parser.ContentModel.first(Object)'
* ContentModel(42,null); parameter is same ContentModel expected:
* NullPointerException
*/
public void testFirstObject026() {
try {
cm = new ContentModel(42, null);
cm.first(cm);
fail("Should raise NullPointerException");
} catch (NullPointerException e) {
// Expected
}
}
示例14: testFirstObject027
import javax.swing.text.html.parser.ContentModel; //导入方法依赖的package包/类
/**
* Test method for 'org.apache.harmony.swing.tests.javax.swing.text.parser.ContentModel.first(Object)'
* ContentModel(43,null); parameter is null expected: NullPointerException
*/
public void testFirstObject027() {
try {
cm = new ContentModel(43, null);
cm.first(null);
fail("Should raise NullPointerException");
} catch (NullPointerException e) {
// Expected
}
}
示例15: testFirstObject029
import javax.swing.text.html.parser.ContentModel; //导入方法依赖的package包/类
/**
* Test method for 'org.apache.harmony.swing.tests.javax.swing.text.parser.ContentModel.first(Object)'
* ContentModel(63,null); parameter is null expected: NullPointerException
*/
public void testFirstObject029() {
try {
cm = new ContentModel(63, null);
cm.first(null);
fail("Should raise NullPointerException");
} catch (NullPointerException e) {
// Expected
}
}