git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1900949 13f79535-47bb-0310-9956-ffa450edef68tags/fop-2_8
import java.io.IOException; | import java.io.IOException; | ||||
import java.io.OutputStream; | import java.io.OutputStream; | ||||
import org.apache.fop.afp.Completable; | |||||
import org.apache.fop.afp.util.BinaryUtils; | import org.apache.fop.afp.util.BinaryUtils; | ||||
/** | /** | ||||
* the document's current environment. The Medium Map's effect on current environment | * the document's current environment. The Medium Map's effect on current environment | ||||
* parameter values lasts until a new Medium Map is invoked. | * parameter values lasts until a new Medium Map is invoked. | ||||
*/ | */ | ||||
public class InvokeMediumMap extends AbstractNamedAFPObject { | |||||
public class InvokeMediumMap extends AbstractNamedAFPObject implements Completable { | |||||
/** | /** | ||||
* Constructor for the Invoke Medium Map | * Constructor for the Invoke Medium Map | ||||
os.write(data); | os.write(data); | ||||
} | } | ||||
public void setComplete(boolean complete) { | |||||
} | |||||
public boolean isComplete() { | |||||
return true; | |||||
} | |||||
} | } |
Assert.assertEquals((byte)data.read(), InvokeMediumMap.Type.MAP); | Assert.assertEquals((byte)data.read(), InvokeMediumMap.Type.MAP); | ||||
Assert.assertEquals((byte)data.read(), InvokeMediumMap.Category.MEDIUM_MAP); | Assert.assertEquals((byte)data.read(), InvokeMediumMap.Category.MEDIUM_MAP); | ||||
} | } | ||||
@Test | |||||
public void testMediumMapBeforePageGroupOnDocument() throws Exception { | |||||
ds = new DataStream(new Factory(), paintState, outStream); | |||||
ds.startDocument(); | |||||
ds.createInvokeMediumMap("test"); | |||||
ds.startPageGroup(); | |||||
ds.startPage(1, 1, 0, 1, 1); | |||||
ds.endPage(); | |||||
ds.endPageGroup(); | |||||
ds.endDocument(); | |||||
ByteArrayInputStream data = new ByteArrayInputStream(outStream.toByteArray()); | |||||
data.skip(21); | |||||
Assert.assertEquals((byte)data.read(), InvokeMediumMap.Type.MAP); | |||||
Assert.assertEquals((byte)data.read(), InvokeMediumMap.Category.MEDIUM_MAP); | |||||
} | |||||
} | } |