summaryrefslogtreecommitdiff
path: root/java/common/src/test
diff options
context:
space:
mode:
authorRobert Godfrey <rgodfrey@apache.org>2007-05-24 09:57:00 +0000
committerRobert Godfrey <rgodfrey@apache.org>2007-05-24 09:57:00 +0000
commit2c5428300dbf8e0025b8e8cb010ff5e818c1a77e (patch)
tree16d48352f7aac669beaa10ec3d750038e15cad6f /java/common/src/test
parent13a373d975a60d45b2dd6de4c3cc821296330e16 (diff)
downloadqpid-python-2c5428300dbf8e0025b8e8cb010ff5e818c1a77e.tar.gz
QPID-482 : Small performance tweaks
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/M2@541247 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/common/src/test')
-rw-r--r--java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java33
1 files changed, 32 insertions, 1 deletions
diff --git a/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java b/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java
index 6160dc1843..38a2ae6256 100644
--- a/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java
+++ b/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java
@@ -777,6 +777,8 @@ public class PropertyFieldTableTest extends TestCase
*/
public void testCheckPropertyNamehasMaxLength()
{
+ String oldVal =System.getProperty("STRICT_AMQP");
+ System.setProperty("STRICT_AMQP","true");
FieldTable table = new FieldTable();
StringBuffer longPropertyName = new StringBuffer(129);
@@ -797,6 +799,14 @@ public class PropertyFieldTableTest extends TestCase
}
// so length should be zero
Assert.assertEquals(0, table.getEncodedSize());
+ if(oldVal != null)
+ {
+ System.setProperty("STRICT_AMQP",oldVal);
+ }
+ else
+ {
+ System.clearProperty("STRICT_AMQP");
+ }
}
@@ -805,12 +815,14 @@ public class PropertyFieldTableTest extends TestCase
*/
public void testCheckPropertyNameStartCharacterIsLetter()
{
+ String oldVal =System.getProperty("STRICT_AMQP");
+ System.setProperty("STRICT_AMQP","true");
FieldTable table = new FieldTable();
//Try a name that starts with a number
try
{
- table.setObject("1", "String");
+ table.setObject("1", "String");
fail("property name must start with a letter");
}
catch (IllegalArgumentException iae)
@@ -819,6 +831,14 @@ public class PropertyFieldTableTest extends TestCase
}
// so length should be zero
Assert.assertEquals(0, table.getEncodedSize());
+ if(oldVal != null)
+ {
+ System.setProperty("STRICT_AMQP",oldVal);
+ }
+ else
+ {
+ System.clearProperty("STRICT_AMQP");
+ }
}
@@ -827,6 +847,8 @@ public class PropertyFieldTableTest extends TestCase
*/
public void testCheckPropertyNameStartCharacterIsHashorDollar()
{
+ String oldVal =System.getProperty("STRICT_AMQP");
+ System.setProperty("STRICT_AMQP","true");
FieldTable table = new FieldTable();
//Try a name that starts with a number
@@ -839,9 +861,18 @@ public class PropertyFieldTableTest extends TestCase
{
fail("property name are allowed to start with # and $s");
}
+ if(oldVal != null)
+ {
+ System.setProperty("STRICT_AMQP",oldVal);
+ }
+ else
+ {
+ System.clearProperty("STRICT_AMQP");
+ }
}
+
/**
* Additional test to test the contents of the table
*/