KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > xmldb > levelzero > BinaryTest


1 // You can redistribute this software and/or modify it under the terms of
2
// the Ozone Library License version 1 published by ozone-db.org.
3
//
4
// The original code and portions created by SMB are
5
// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
6
//
7

8 package test.xmldb.levelzero;
9
10 import test.xmldb.*;
11 import junit.framework.*;
12
13 import org.xmldb.api.modules.BinaryResource;
14 /**
15  * @author Per Nyfelt
16  */

17 public class BinaryTest extends XMLDBTestCase implements LevelZeroTestConstants {
18
19     /** Creates new BinaryTest */
20     public BinaryTest(String JavaDoc name) {
21         super(name);
22     }
23
24    /**
25      * test all scenarios for using binary data, this is optional for Core Level 1
26      */

27     public void testBinary() {
28         try {
29             String JavaDoc id = "LevelZeroTest-img";
30             byte[] content = new byte[1];
31             insertBinaryContent(id, content);
32             retrieveBinaryResource(id);
33
34         } catch (Exception JavaDoc e) {
35             fail( e.getMessage( ) );
36         }
37     }
38
39     private void insertBinaryContent(String JavaDoc id, byte[] content) throws Exception JavaDoc {
40     }
41    // support for Binary Resource is optional
42
private byte[] retrieveBinaryResource(String JavaDoc id) throws Exception JavaDoc {
43         throw new Exception JavaDoc("LevelZeroTest.updateSAXDocument() - Not implemented yet");
44         //BinaryResource resource = (BinaryResource) col.getResource(id);
45
// Return value of getContent must be defined in the specific language mapping
46
// for the language used. For Java this is byte[]
47
// byte[] img = resource.getContent();
48
}
49 }
50
Popular Tags