/**
* Test of moveItem method, of class org.netbeans.modules.palette.Category.
*/
public void testMoveItemAfter() throws IOException {
PaletteActions actions = new DummyActions();
PaletteController pc = PaletteFactory.createPalette( getRootFolderName(), actions );
Model model = pc.getModel();
Category[] categories = model.getCategories();
Category cat = categories[0];
Item[] itemsBeforeMove = cat.getItems();
Item source = itemsBeforeMove[0];
Item target = itemsBeforeMove[itemsBeforeMove.length-1];
cat.dropItem( createTransferable( source ), DnDConstants.ACTION_COPY_OR_MOVE, target, false );
Item[] itemsAfterMove = cat.getItems();
assertEquals( itemsBeforeMove.length, itemsAfterMove.length );
assertEquals( source.getName(), itemsAfterMove[itemsAfterMove.length-1].getName() );
assertEquals( itemsBeforeMove[1].getName(), itemsAfterMove[0].getName() );
assertEquals( target.getName(), itemsAfterMove[itemsAfterMove.length-1-1].getName() );
}
CategoryTest.java 文件源码
java
阅读 35
收藏 0
点赞 0
评论 0
项目:incubator-netbeans
作者:
评论列表
文章目录