01: /*
02: * Copyright 2001-2004 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.apache.commons.codec;
18:
19: import junit.framework.TestCase;
20:
21: /**
22: * @version $Id: BinaryEncoderAbstractTest.java,v 1.9 2004/04/19 01:14:28 ggregory Exp $
23: * @author Apache Software Foundation
24: */
25: public abstract class BinaryEncoderAbstractTest extends TestCase {
26:
27: public BinaryEncoderAbstractTest(String name) {
28: super (name);
29: }
30:
31: protected abstract BinaryEncoder makeEncoder();
32:
33: // ------------------------------------------------------------------------
34:
35: public void testEncodeEmpty() throws Exception {
36: BinaryEncoder encoder = makeEncoder();
37: encoder.encode(new byte[0]);
38: }
39:
40: public void testEncodeNull() throws Exception {
41: BinaryEncoder encoder = makeEncoder();
42: try {
43: encoder.encode(null);
44: } catch (EncoderException ee) {
45: // An exception should be thrown
46: }
47: }
48: }
|