001: /* Copyright (C) 2004 - 2007 db4objects Inc. http://www.db4o.com
002:
003: This file is part of the db4o open source object database.
004:
005: db4o is free software; you can redistribute it and/or modify it under
006: the terms of version 2 of the GNU General Public License as published
007: by the Free Software Foundation and as clarified by db4objects' GPL
008: interpretation policy, available at
009: http://www.db4o.com/about/company/legalpolicies/gplinterpretation/
010: Alternatively you can write to db4objects, Inc., 1900 S Norfolk Street,
011: Suite 350, San Mateo, CA 94403, USA.
012:
013: db4o is distributed in the hope that it will be useful, but WITHOUT ANY
014: WARRANTY; without even the implied warranty of MERCHANTABILITY or
015: FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
016: for more details.
017:
018: You should have received a copy of the GNU General Public License along
019: with this program; if not, write to the Free Software Foundation, Inc.,
020: 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
021: package com.db4o.db4ounit.jre5.collections;
022:
023: import com.db4o.collections.*;
024: import com.db4o.db4ounit.common.ta.*;
025:
026: public class ArrayMap4TATestCase extends
027: TransparentActivationTestCaseBase {
028:
029: public static void main(String[] args) {
030: new ArrayMap4TATestCase().runSolo();
031: }
032:
033: protected void store() throws Exception {
034: ArrayMap4<String, Integer> map = new ArrayMap4<String, Integer>();
035: ArrayMap4Asserter.putData(map);
036: store(map);
037: }
038:
039: @SuppressWarnings("unchecked")
040: private ArrayMap4<String, Integer> retrieveOnlyInstance() {
041: ArrayMap4<String, Integer> map = CollectionsUtil
042: .retrieveMapFromDB(db(), reflector());
043: return map;
044: }
045:
046: public void testClear() {
047: ArrayMap4<String, Integer> map = retrieveOnlyInstance();
048:
049: ArrayMap4Asserter.assertClear(map);
050: }
051:
052: public void testClone() {
053: ArrayMap4<String, Integer> map = retrieveOnlyInstance();
054:
055: ArrayMap4Asserter.assertClone(map);
056: }
057:
058: public void testContainsKey() {
059: ArrayMap4<String, Integer> map = retrieveOnlyInstance();
060:
061: ArrayMap4Asserter.assertContainsKey(map);
062: }
063:
064: public void testContainsValue() {
065: ArrayMap4<String, Integer> map = retrieveOnlyInstance();
066:
067: ArrayMap4Asserter.assertContainsValue(map);
068: }
069:
070: public void testEntrySet() {
071: ArrayMap4<String, Integer> map = retrieveOnlyInstance();
072:
073: ArrayMap4Asserter.assertEntrySet(map);
074: }
075:
076: public void testGet() {
077: ArrayMap4<String, Integer> map = retrieveOnlyInstance();
078:
079: ArrayMap4Asserter.assertGet(map);
080: }
081:
082: public void testIsEmpty() {
083: ArrayMap4<String, Integer> map = retrieveOnlyInstance();
084:
085: ArrayMap4Asserter.assertIsEmpty(map);
086: }
087:
088: public void testKeySet() {
089: ArrayMap4<String, Integer> map = retrieveOnlyInstance();
090:
091: ArrayMap4Asserter.assertKeySet(map);
092: }
093:
094: public void testPut() {
095: ArrayMap4<String, Integer> map = retrieveOnlyInstance();
096:
097: ArrayMap4Asserter.assertPut(map);
098: }
099:
100: public void testPutAll() {
101: ArrayMap4<String, Integer> map = retrieveOnlyInstance();
102:
103: ArrayMap4Asserter.assertPutAll(map);
104: }
105:
106: public void testRemove_FromHead() {
107: ArrayMap4<String, Integer> map = retrieveOnlyInstance();
108:
109: ArrayMap4Asserter.assertRemove_FromHead(map);
110: }
111:
112: public void testRemove_FromEnd() {
113: ArrayMap4<String, Integer> map = retrieveOnlyInstance();
114:
115: ArrayMap4Asserter.assertRemove_FromEnd(map);
116: }
117:
118: public void testRemove_FromMiddle() {
119: ArrayMap4<String, Integer> map = retrieveOnlyInstance();
120:
121: ArrayMap4Asserter.assertRemove_FromMiddle(map);
122: }
123:
124: public void testSize() {
125: ArrayMap4<String, Integer> map = retrieveOnlyInstance();
126:
127: ArrayMap4Asserter.assertSize(map);
128: }
129:
130: public void testValues() {
131: ArrayMap4<String, Integer> map = retrieveOnlyInstance();
132:
133: ArrayMap4Asserter.assertValues(map);
134: }
135:
136: public void testEquals() {
137: ArrayMap4<String, Integer> map = retrieveOnlyInstance();
138:
139: ArrayMap4Asserter.assertEquals(map);
140: }
141:
142: public void testIncreaseSize() {
143: ArrayMap4<String, Integer> map = retrieveOnlyInstance();
144:
145: ArrayMap4Asserter.assertIncreaseSize(map);
146: }
147: }
|