File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
test/src/com/rabbitmq/client/test Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,15 @@ def printClassInterfaces():
132132 print " }"
133133
134134
135+ def printClone (c ):
136+ print
137+ print """ public Object clone()
138+ throws CloneNotSupportedException
139+ {
140+ return super.clone();
141+ }""" % \
142+ {"n" : java_class_name (c .name )}
143+
135144 def printReadProperties (c ):
136145 print
137146 print """ public void readPropertiesFrom(ContentHeaderPropertyReader reader)
@@ -171,7 +180,7 @@ def printPropertyDebug(c):
171180
172181 def printClassProperties (c ):
173182 print
174- print " public static class %s extends AMQContentHeader {" % ( java_class_name (c .name ) + 'Properties' )
183+ print " public static class %s extends AMQContentHeader implements Cloneable {" % ( java_class_name (c .name ) + 'Properties' )
175184 #property fields
176185 for f in c .fields :
177186 print " public %s %s;" % (java_property_type (spec , f .domain ),java_field_name (f .name ))
@@ -196,6 +205,7 @@ def printClassProperties(c):
196205 print " public int getClassId() { return %i; }" % (c .index )
197206 print " public java.lang.String getClassName() { return \" %s\" ; }" % (c .name )
198207
208+ printClone (c )
199209 printReadProperties (c )
200210 printWriteProperties (c )
201211 printPropertyDebug (c )
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ public static TestSuite suite() {
4343 suite .addTest (AMQConnectionTest .suite ());
4444 suite .addTest (ValueOrExceptionTest .suite ());
4545 suite .addTest (BrokenFramesTest .suite ());
46+ suite .addTestSuite (ClonePropertiesTest .class );
4647 return suite ;
4748 }
4849}
You can’t perform that action at this time.
0 commit comments