recoverOriginalLibrary( "LibraryWithSaveStateTest_BackUP.xml", "LibraryWithSaveStateTest.xml" );
libraryHandle = null;
	public void testErrorLibraryNeedsSave( ) throws Exception	{		openDesign( "DesignWithSaveStateTest.xml" ); //$NON-NLS-1$		openLibrary( "LibraryWithSaveStateTest.xml" );//$NON-NLS-1$		LabelHandle labelHandle = designHandle.getElementFactory( ).newLabel(				"new test label" );//$NON-NLS-1$		designHandle.getBody( ).add( labelHandle );		assertTrue( designHandle.needsSave( ) );		assertTrue( designHandle.getCommandStack( ).canUndo( ) );		assertFalse( designHandle.getCommandStack( ).canRedo( ) );		ActivityStack stack = (ActivityStack) designHandle.getCommandStack( );		File f = new File( getClassFolder( ) + INPUT_FOLDER				+ "LibraryWithSaveStateTest.xml" );//$NON-NLS-1$		RandomAccessFile raf = new RandomAccessFile( f, "rw" );//$NON-NLS-1$		// Seek to end of file		raf.seek( 906 );		// Append to the end		raf.writeBytes( "<label id=\"21\"/>" );//$NON-NLS-1$		raf.close( );		// reloadlibrary		try		{			designHandle.reloadLibrary( libraryHandle );			fail( );		}		catch ( DesignFileException e )		{		}		assertTrue( stack.canUndo( ) );		assertFalse( stack.canRedo( ) );		assertEquals( 1, stack.getCurrentTransNo( ) );		assertTrue( designHandle.needsSave( ) );		// restore file		libraryHandle.close( );		recoverOriginalLibrary(				"LibraryWithSaveStateTest_BackUP.xml", "LibraryWithSaveStateTest.xml" );//$NON-NLS-1$//$NON-NLS-2$	}