KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis2 > storage > impl > AbstractStorageTest


1 package org.apache.axis2.storage.impl;
2
3 import junit.framework.TestCase;
4 import org.apache.axis2.storage.AxisStorage;
5
6 /*
7  * Copyright 2004,2005 The Apache Software Foundation.
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  *
22  */

23 public abstract class AbstractStorageTest extends TestCase{
24     protected AxisStorage storage;
25     protected Object JavaDoc testValueObject;
26
27     public void testPutAndGet(){
28         try {
29             Object JavaDoc key = storage.put(testValueObject);
30             assertEquals(testValueObject,storage.get(key));
31             assertEquals(testValueObject,storage.remove(key));
32             assertNull(storage.get(key));
33         } catch (Exception JavaDoc e) {
34             fail(e.getMessage());
35         }
36     }
37
38     protected void tearDown() throws Exception JavaDoc {
39         storage.clean();
40         storage = null;
41
42     }
43 }
44
Popular Tags