diff options
| author | Martin Ritchie <ritchiem@apache.org> | 2008-02-25 03:22:39 +0000 |
|---|---|---|
| committer | Martin Ritchie <ritchiem@apache.org> | 2008-02-25 03:22:39 +0000 |
| commit | 882a98c31e6ceb34e41c67562da9069dfb4cfda1 (patch) | |
| tree | 18fe60f49ea4bff315ffd635715e2f8fff0261b7 /java/common/src/test | |
| parent | ce3001f7df64a793e231efab13d3163d0df7be50 (diff) | |
| download | qpid-python-882a98c31e6ceb34e41c67562da9069dfb4cfda1.tar.gz | |
QPID-806 : Added startsWith and endsWith methods to AMQShortString, including test.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/M2.1@630723 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/common/src/test')
| -rw-r--r-- | java/common/src/test/java/org/apache/qpid/framing/AMQShortStringTest.java | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/java/common/src/test/java/org/apache/qpid/framing/AMQShortStringTest.java b/java/common/src/test/java/org/apache/qpid/framing/AMQShortStringTest.java new file mode 100644 index 0000000000..0ea2c8b9c1 --- /dev/null +++ b/java/common/src/test/java/org/apache/qpid/framing/AMQShortStringTest.java @@ -0,0 +1,62 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.qpid.framing; + +import junit.framework.TestCase; +public class AMQShortStringTest extends TestCase +{ + + AMQShortString Hello = new AMQShortString("Hello"); + AMQShortString Hell = new AMQShortString("Hell"); + AMQShortString Goodbye = new AMQShortString("Goodbye"); + AMQShortString Good = new AMQShortString("Good"); + AMQShortString Bye = new AMQShortString("Bye"); + + public void testStartsWith() + { + assertTrue(Hello.startsWith(Hell)); + + assertFalse(Hell.startsWith(Hello)); + + assertTrue(Goodbye.startsWith(Good)); + + assertFalse(Good.startsWith(Goodbye)); + } + + public void testEndWith() + { + assertFalse(Hell.endsWith(Hello)); + + assertTrue(Goodbye.endsWith(new AMQShortString("bye"))); + + assertFalse(Goodbye.endsWith(Bye)); + } + + + public void testEquals() + { + assertEquals(Goodbye, new AMQShortString("Goodbye")); + assertEquals(new AMQShortString("A"), new AMQShortString("A")); + assertFalse(new AMQShortString("A").equals(new AMQShortString("a"))); + } + + +} |
