FileDocCategorySizeDatePackage
TestInteractiveInfo.javaAPI DocApache Poi 3.0.12803Thu May 31 18:46:28 BST 2007org.apache.poi.hslf.record

TestInteractiveInfo

public class TestInteractiveInfo extends TestCase
Tests that InteractiveInfoAtom works properly.
author
Nick Burch (nick at torchbox dot com)

Fields Summary
private byte[]
data_a
Constructors Summary
Methods Summary
public voidtestCreate()

    	InteractiveInfo ii = new InteractiveInfo();
    	InteractiveInfoAtom ia = ii.getInteractiveInfoAtom();
    	
    	// Set values
    	ia.setHyperlinkID(1);
    	ia.setSoundRef(0);
    	ia.setAction((byte)4);
    	ia.setHyperlinkType((byte)8);
    	
		// Check it's now the same as a
		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		ii.writeOut(baos);
		byte[] b = baos.toByteArray();
		
		assertEquals(data_a.length, b.length);
		for(int i=0; i<data_a.length; i++) {
			assertEquals(data_a[i],b[i]);
		}
    
public voidtestGetChildDetails()

		InteractiveInfo ii = new InteractiveInfo(data_a, 0, data_a.length);
		InteractiveInfoAtom ia = ii.getInteractiveInfoAtom();
		
		assertEquals(1, ia.getHyperlinkID());
    
public voidtestRecordType()

	
         
		InteractiveInfo ii = new InteractiveInfo(data_a, 0, data_a.length);
		assertEquals(4082, ii.getRecordType());
	
public voidtestWrite()

		InteractiveInfo ii = new InteractiveInfo(data_a, 0, data_a.length);
		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		ii.writeOut(baos);
		byte[] b = baos.toByteArray();

		assertEquals(data_a.length, b.length);
		for(int i=0; i<data_a.length; i++) {
			assertEquals(data_a[i],b[i]);
		}