01: // You can redistribute this software and/or modify it under the terms of
02: // the Ozone Library License version 1 published by ozone-db.org.
03: //
04: // The original code and portions created by SMB are
05: // Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
06: //
07:
08: package test.xmldb.levelzero;
09:
10: import test.xmldb.*;
11: import junit.framework.*;
12:
13: import org.xmldb.api.modules.BinaryResource;
14:
15: /**
16: * @author Per Nyfelt
17: */
18: public class BinaryTest extends XMLDBTestCase implements
19: LevelZeroTestConstants {
20:
21: /** Creates new BinaryTest */
22: public BinaryTest(String name) {
23: super (name);
24: }
25:
26: /**
27: * test all scenarios for using binary data, this is optional for Core Level 1
28: */
29: public void testBinary() {
30: try {
31: String id = "LevelZeroTest-img";
32: byte[] content = new byte[1];
33: insertBinaryContent(id, content);
34: retrieveBinaryResource(id);
35:
36: } catch (Exception e) {
37: fail(e.getMessage());
38: }
39: }
40:
41: private void insertBinaryContent(String id, byte[] content)
42: throws Exception {
43: }
44:
45: // support for Binary Resource is optional
46: private byte[] retrieveBinaryResource(String id) throws Exception {
47: throw new Exception(
48: "LevelZeroTest.updateSAXDocument() - Not implemented yet");
49: //BinaryResource resource = (BinaryResource) col.getResource(id);
50: // Return value of getContent must be defined in the specific language mapping
51: // for the language used. For Java this is byte[]
52: // byte[] img = resource.getContent();
53: }
54: }
|