Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 10743 invoked from network); 21 Jan 2002 17:08:21 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 21 Jan 2002 17:08:21 -0000 Received: (qmail 25545 invoked by uid 97); 21 Jan 2002 17:05:32 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 25528 invoked by uid 97); 21 Jan 2002 17:05:31 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 23507 invoked by uid 97); 21 Jan 2002 06:25:53 -0000 Date: 20 Jan 2002 14:25:41 -0000 Message-ID: <20020120142541.52150.qmail@icarus.apache.org> From: froehlich@apache.org To: jakarta-commons-sandbox-cvs@apache.org Subject: cvs commit: jakarta-commons-sandbox/simplestore/src/test/org/apache/commons/simplestore TestSoftRefMemoryStore.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N froehlich 02/01/20 06:25:41 Added: simplestore/src/test/org/apache/commons/simplestore TestSoftRefMemoryStore.java Log: added new test case Revision Changes Path 1.1 jakarta-commons-sandbox/simplestore/src/test/org/apache/commons/simplestore/TestSoftRefMemoryStore.java Index: TestSoftRefMemoryStore.java =================================================================== /***************************************************************************** * Copyright (C) The Apache Software Foundation. All rights reserved. * * ------------------------------------------------------------------------- * * This software is published under the terms of the Apache Software License * * version 1.1, a copy of which has been included with this distribution in * * the LICENSE file. * *****************************************************************************/ package org.apache.commons.simplestore; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import java.util.Map; import java.util.HashMap; /** * @author Gerhard Froehlich * g-froehlich@gmx.de * @version $Id: TestSoftRefMemoryStore.java,v 1.1 2002/01/20 14:25:41 froehlich Exp $ */ public class TestSoftRefMemoryStore extends TestMap { public TestSoftRefMemoryStore(String testName) { super(testName); } public static Test suite() { return new TestSuite(TestSoftRefMemoryStore.class); } public static void main(String args[]) { String[] testCaseName = { TestSoftRefMemoryStore.class.getName() }; junit.textui.TestRunner.main(testCaseName); } public Map makeMap() { MRUMemoryStore mrustore = new MRUMemoryStore(10); SoftRefMemoryStore store = new SoftRefMemoryStore(mrustore,10); return store; } public void setUp() { map = makeMap(); } public void testNewMap() { assertTrue("New map is empty", map.isEmpty()); assertEquals("New map has size zero", map.size(), 0); } public void testSearch() { System.out.println("Testing MRUMemoryStore with WeakReferences"); map.put("first", "First Item"); map.put("second", "Second Item"); assertEquals("Top item is 'Second Item'", map.get("first"), "First Item"); assertEquals("Next Item is 'First Item'", map.get("second"), "Second Item"); } } -- To unsubscribe, e-mail: For additional commands, e-mail: