Return-Path: Delivered-To: apmail-jakarta-hivemind-cvs-archive@www.apache.org Received: (qmail 50018 invoked from network); 9 Jun 2004 14:49:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 9 Jun 2004 14:49:06 -0000 Received: (qmail 53191 invoked by uid 500); 9 Jun 2004 14:49:12 -0000 Delivered-To: apmail-jakarta-hivemind-cvs-archive@jakarta.apache.org Received: (qmail 53174 invoked by uid 500); 9 Jun 2004 14:49:11 -0000 Mailing-List: contact hivemind-cvs-help@jakarta.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: hivemind-dev@jakarta.apache.org Delivered-To: mailing list hivemind-cvs@jakarta.apache.org Received: (qmail 53152 invoked by uid 99); 9 Jun 2004 14:49:11 -0000 Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.27.1) with SMTP; Wed, 09 Jun 2004 07:49:11 -0700 Received: (qmail 49960 invoked by uid 1616); 9 Jun 2004 14:48:56 -0000 Date: 9 Jun 2004 14:48:56 -0000 Message-ID: <20040609144856.49959.qmail@minotaur.apache.org> From: hlship@apache.org To: jakarta-hivemind-cvs@apache.org Subject: cvs commit: jakarta-hivemind/framework/src/test/org/apache/hivemind/schema/rules TestIdTranslators.java X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N hlship 2004/06/09 07:48:56 Added: framework/src/test/org/apache/hivemind/schema/rules TestIdTranslators.java Log: Add two new translators: qualified-id and id-list. Revision Changes Path 1.1 jakarta-hivemind/framework/src/test/org/apache/hivemind/schema/rules/TestIdTranslators.java Index: TestIdTranslators.java =================================================================== // Copyright 2004 The Apache Software Foundation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package org.apache.hivemind.schema.rules; import org.apache.hivemind.internal.Module; import org.apache.hivemind.schema.Translator; import org.apache.hivemind.test.HiveMindTestCase; import org.easymock.MockControl; /** * Tests for {@link org.apache.hivemind.schema.rules.QualifiedIdTranslator} * and {@link org.apache.hivemind.schema.rules.IdListTranslator}. * * @author Howard Lewis Ship */ public class TestIdTranslators extends HiveMindTestCase { public void testNullId() { Translator t = new QualifiedIdTranslator(); assertNull(t.translate(null, null, null)); } public void testNonNullId() { MockControl c = MockControl.createStrictControl(Module.class); Module m = (Module) c.getMock(); m.getModuleId(); c.setReturnValue("foo.bar"); c.replay(); Translator t = new QualifiedIdTranslator(); assertEquals("foo.bar.Baz", t.translate(m, null, "Baz")); c.verify(); } public void testNullList() { Translator t = new IdListTranslator(); assertEquals(null, t.translate(null, null, null)); } public void testNonNullList() { MockControl c = MockControl.createStrictControl(Module.class); Module m = (Module) c.getMock(); m.getModuleId(); c.setReturnValue("foo.bar"); c.replay(); Translator t = new IdListTranslator(); assertEquals("foo.bar.Baz,zip.Zap", t.translate(m, null, "Baz,zip.Zap")); c.verify(); } } --------------------------------------------------------------------- To unsubscribe, e-mail: hivemind-cvs-unsubscribe@jakarta.apache.org For additional commands, e-mail: hivemind-cvs-help@jakarta.apache.org