@Override public long getLong(final String name) throws JMSException { return message.getLong(name); }
public long getLong(String name) throws JMSException { return ((MapMessage) message).getLong(name); }
public long getLong(String name) throws JMSException { return ((MapMessage) message).getLong(name); }
/** * Get * @param name The name * @return The value * @exception JMSException Thrown if an error occurs */ public long getLong(final String name) throws JMSException { if (_log.isTraceEnabled()) { _log.trace("getLong(" + name + ")"); } return ((MapMessage)_message).getLong(name); }
/** * Get * * @param name The name * @return The value * @throws JMSException Thrown if an error occurs */ @Override public long getLong(final String name) throws JMSException { if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("getLong(" + name + ")"); } return ((MapMessage) message).getLong(name); }
/** * Get * * @param name The name * @return The value * @throws JMSException Thrown if an error occurs */ @Override public long getLong(final String name) throws JMSException { if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("getLong(" + name + ")"); } return ((MapMessage) message).getLong(name); }
protected Event demapEvent(MapMessage mapMessage, String moduleName, String componentName, List<Payload> payloads, List<String> eventFieldNames) throws JMSException, EventDeserialisationException { String eventId = null; int priority = -1; Date timestamp = null; for(String fieldName : eventFieldNames){ if (fieldName.equals(EVENT_FIELD_ID)){ eventId=mapMessage.getString(EVENT_FIELD_ID); } else if (fieldName.equals(EVENT_FIELD_PRIORITY)){ priority=mapMessage.getInt(EVENT_FIELD_PRIORITY); } else if (fieldName.equals(EVENT_FIELD_TIMESTAMP)){ timestamp=new Date(mapMessage.getLong(EVENT_FIELD_TIMESTAMP)); } else{ throw new EventDeserialisationException("Unknown map entry ["+fieldName+"]"); } } return new Event(eventId, priority, timestamp, payloads); }
if (reply != null && reply.itemExists("size")) { try { return reply.getLong("size"); } catch (NumberFormatException e) { return super.getSize();
@Override protected void assertEquivalent(final Message m, final int mode, final boolean redelivery) throws JMSException { super.assertEquivalent(m, mode, redelivery); MapMessage mm = (MapMessage) m; ProxyAssertSupport.assertEquals(true, mm.getBoolean("boolean")); ProxyAssertSupport.assertEquals((byte) 3, mm.getByte("byte")); byte[] bytes = mm.getBytes("bytes"); ProxyAssertSupport.assertEquals((byte) 3, bytes[0]); ProxyAssertSupport.assertEquals((byte) 4, bytes[1]); ProxyAssertSupport.assertEquals((byte) 5, bytes[2]); ProxyAssertSupport.assertEquals((char) 6, mm.getChar("char")); ProxyAssertSupport.assertEquals(new Double(7.0), new Double(mm.getDouble("double"))); ProxyAssertSupport.assertEquals(new Float(8.0f), new Float(mm.getFloat("float"))); ProxyAssertSupport.assertEquals(9, mm.getInt("int")); ProxyAssertSupport.assertEquals(10L, mm.getLong("long")); ProxyAssertSupport.assertEquals("this is an object", mm.getObject("object")); ProxyAssertSupport.assertEquals((short) 11, mm.getShort("short")); ProxyAssertSupport.assertEquals("this is a string", mm.getString("string")); } }
private void receiveMapMessage(boolean useCore) throws Exception { MapMessage mapMessage = (MapMessage) receiveMessage(useCore); boolean booleanVal = mapMessage.getBoolean("boolean-type"); assertTrue(booleanVal); byte byteVal = mapMessage.getByte("byte-type"); assertEquals((byte) 10, byteVal); byte[] bytesVal = mapMessage.getBytes("bytes-type"); byte[] originVal = TEXT.getBytes(); assertEquals(originVal.length, bytesVal.length); for (int i = 0; i < bytesVal.length; i++) { assertTrue(bytesVal[i] == originVal[i]); } char charVal = mapMessage.getChar("char-type"); assertEquals('A', charVal); double doubleVal = mapMessage.getDouble("double-type"); assertEquals(55.3D, doubleVal, 0.1D); float floatVal = mapMessage.getFloat("float-type"); assertEquals(79.1F, floatVal, 0.1F); int intVal = mapMessage.getInt("int-type"); assertEquals(37, intVal); long longVal = mapMessage.getLong("long-type"); assertEquals(56652L, longVal); Object objectVal = mapMessage.getObject("object-type"); Object origVal = new String("VVVV"); assertTrue(objectVal.equals(origVal)); short shortVal = mapMessage.getShort("short-type"); assertEquals((short) 333, shortVal); String strVal = mapMessage.getString("string-type"); assertEquals(TEXT, strVal); }
assertTrue(floatVal.equals(Float.valueOf(4.5F))); assertEquals(40, mapMessage.getInt("aint")); assertEquals(80L, mapMessage.getLong("along")); assertEquals(65, mapMessage.getShort("ashort")); assertEquals("hello", mapMessage.getString("astring"));
@Override protected void assertEquivalent(final Message m, final int mode, final boolean redelivery) throws JMSException { super.assertEquivalent(m, mode, redelivery); MapMessage map = (MapMessage) m; ProxyAssertSupport.assertTrue(map.getBoolean("boolean1")); ProxyAssertSupport.assertEquals(map.getChar("char1"), 'c'); ProxyAssertSupport.assertEquals(map.getDouble("double1"), 1.0D, 0.0D); ProxyAssertSupport.assertEquals(map.getFloat("float1"), 2.0F, 0.0F); ProxyAssertSupport.assertEquals(map.getInt("int1"), 3); ProxyAssertSupport.assertEquals(map.getLong("long1"), 4L); ProxyAssertSupport.assertEquals(map.getObject("object1"), obj); ProxyAssertSupport.assertEquals(map.getShort("short1"), (short) 5); ProxyAssertSupport.assertEquals(map.getString("string1"), "stringvalue"); } }
ProxyAssertSupport.assertEquals(myShort, m2.getShort("myShort")); ProxyAssertSupport.assertEquals(myInt, m2.getInt("myInt")); ProxyAssertSupport.assertEquals(myLong, m2.getLong("myLong")); ProxyAssertSupport.assertEquals(myFloat, m2.getFloat("myFloat"), 0); ProxyAssertSupport.assertEquals(myDouble, m2.getDouble("myDouble"), 0); m2.getLong("myBool"); ProxyAssertSupport.fail(); } catch (MessageFormatException e) { ProxyAssertSupport.assertEquals(myByte, m2.getLong("myByte")); ProxyAssertSupport.assertEquals(String.valueOf(myByte), m2.getString("myByte")); ProxyAssertSupport.assertEquals(myShort, m2.getLong("myShort")); ProxyAssertSupport.assertEquals(String.valueOf(myShort), m2.getString("myShort")); ProxyAssertSupport.assertEquals(myInt, m2.getLong("myInt")); ProxyAssertSupport.assertEquals(String.valueOf(myInt), m2.getString("myInt")); m2.getLong("myFloat"); ProxyAssertSupport.fail(); } catch (MessageFormatException e) { ProxyAssertSupport.assertEquals(myShort, m3.getShort("myShort")); ProxyAssertSupport.assertEquals(myInt, m3.getInt("myInt")); ProxyAssertSupport.assertEquals(myLong, m3.getLong("myLong")); ProxyAssertSupport.assertEquals(myFloat, m3.getFloat("myFloat"), 0); ProxyAssertSupport.assertEquals(myDouble, m3.getDouble("myDouble"), 0);
assertTrue(floatVal.equals(Float.valueOf(4.5F))); assertEquals(40, mapMessage.getInt("aint")); assertEquals(80L, mapMessage.getLong("along")); assertEquals(65, mapMessage.getShort("ashort")); assertEquals("hello", mapMessage.getString("astring"));