From: <me...@us...> - 2002-10-05 16:30:16
|
Update of /cvsroot/cayenne/cayenne/src/tests/java/org/objectstyle/cayenne/util In directory usw-pr-cvs1:/tmp/cvs-serv4769/src/tests/java/org/objectstyle/cayenne/util Modified Files: AllTests.java Added Files: RequestDequeueTst.java Log Message: created unit tests for RequestDequeue --- NEW FILE: RequestDequeueTst.java --- /* ==================================================================== * * The ObjectStyle Group Software License, Version 1.0 * * Copyright (c) 2002 The ObjectStyle Group * and individual authors of the software. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, if * any, must include the following acknowlegement: * "This product includes software developed by the * ObjectStyle Group (http://objectstyle.org/)." * Alternately, this acknowlegement may appear in the software itself, * if and wherever such third-party acknowlegements normally appear. * * 4. The names "ObjectStyle Group" and "Cayenne" * must not be used to endorse or promote products derived * from this software without prior written permission. For written * permission, please contact an...@ob.... * * 5. Products derived from this software may not be called "ObjectStyle" * nor may "ObjectStyle" appear in their names without prior written * permission of the ObjectStyle Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE OBJECTSTYLE GROUP OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the ObjectStyle Group. For more * information on the ObjectStyle Group, please see * <http://objectstyle.org/>. * */ package org.objectstyle.cayenne.util; import org.objectstyle.cayenne.CayenneTestCase; /** * @author Andrei Adamchik */ public class RequestDequeueTst extends CayenneTestCase { /** * Constructor for RequestDequeueTst. * * @param arg0 */ public RequestDequeueTst(String arg0) { super(arg0); } public void testDequeueEventCode() throws Exception { RequestDequeue dequeue = new RequestDequeue(); dequeue.setDequeueEventCode(RequestDequeue.QUEUE_FULL); assertEquals(RequestDequeue.QUEUE_FULL, dequeue.getDequeueEventCode()); } public void testDequeueSuccess() throws Exception { RequestDequeue dequeue = new RequestDequeue(); dequeue.setDequeueEventCode(RequestDequeue.DEQUEUE_SUCCESS); assertTrue(dequeue.isDequeueSuccess()); } public void testQueueFull() throws Exception { RequestDequeue dequeue = new RequestDequeue(); dequeue.setDequeueEventCode(RequestDequeue.QUEUE_FULL); assertTrue(dequeue.isQueueFull()); } public void testTimedOut() throws Exception { RequestDequeue dequeue = new RequestDequeue(); dequeue.setDequeueEventCode(RequestDequeue.WAIT_TIMED_OUT); assertTrue(dequeue.isTimedOut()); } public void testDequeueEventObject() throws Exception { RequestDequeue dequeue = new RequestDequeue(); Object obj = new Object(); dequeue.setDequeueEventObject(obj); assertSame(obj, dequeue.getDequeueEventObject()); } } Index: AllTests.java =================================================================== RCS file: /cvsroot/cayenne/cayenne/src/tests/java/org/objectstyle/cayenne/util/AllTests.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- AllTests.java 10 Sep 2002 19:49:18 -0000 1.2 +++ AllTests.java 5 Oct 2002 16:30:10 -0000 1.3 @@ -65,6 +65,7 @@ suite.addTestSuite(NameConverterTst.class); suite.addTestSuite(ResourceLocatorTst.class); suite.addTestSuite(CayenneMapTst.class); + suite.addTestSuite(RequestDequeueTst.class); return suite; } } |