@Override public boolean readBoolean() throws JMSException { return message.readBoolean(); }
public boolean readBoolean() throws JMSException { return ((BytesMessage) message).readBoolean(); }
public boolean readBoolean() throws JMSException { return ((BytesMessage) message).readBoolean(); }
/** * Read * @return The value * @exception JMSException Thrown if an error occurs */ public boolean readBoolean() throws JMSException { if (_log.isTraceEnabled()) { _log.trace("readBoolean()"); } return ((BytesMessage)_message).readBoolean(); }
/** * Read * * @return The value * @throws JMSException Thrown if an error occurs */ @Override public boolean readBoolean() throws JMSException { if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("readBoolean()"); } return ((BytesMessage) message).readBoolean(); }
/** * Read * * @return The value * @throws JMSException Thrown if an error occurs */ @Override public boolean readBoolean() throws JMSException { if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("readBoolean()"); } return ((BytesMessage) message).readBoolean(); }
final Class<?> parameterType = recordProperty.getParameterTypes()[i]; if (boolean.class.equals(parameterType)) { values[i] = message.readBoolean(); } else if (Boolean.class.equals(parameterType)) { values[i] = Boolean.valueOf(message.readBoolean()); } else if (byte.class.equals(parameterType)) { values[i] = message.readByte();
final Class<?> parameterType = recordProperty.getParameterTypes()[i]; if (boolean.class.equals(parameterType)) { values[i] = message.readBoolean(); } else if (Boolean.class.equals(parameterType)) { values[i] = Boolean.valueOf(message.readBoolean()); } else if (byte.class.equals(parameterType)) { values[i] = message.readByte();
@Test public void testSendReceiveBytesMessage() throws Exception { // Receive a message with the JMS API connection.start(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); ActiveMQDestination destination = createDestination(session, destinationType); MessageConsumer consumer = session.createConsumer(destination); MessageProducer producer = session.createProducer(destination); BytesMessage message = session.createBytesMessage(); message.writeBoolean(true); message.writeBoolean(false); producer.send(message); // Make sure only 1 message was delivered. BytesMessage m = (BytesMessage) consumer.receive(1000); assertNotNull(m); assertTrue(m.readBoolean()); assertFalse(m.readBoolean()); assertNull(consumer.receiveNoWait()); }
return booleanMessage.readBoolean(); case BYTE: if (!(message instanceof BytesMessage)) {
@Test public void testBytesMessage() throws Exception { // Receive a message with the JMS API connection.start(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); destination = createDestination(session, destinationType); MessageConsumer consumer = session.createConsumer(destination); MessageProducer producer = session.createProducer(destination); // Send the message { BytesMessage message = session.createBytesMessage(); message.writeBoolean(true); producer.send(message); } // Check the message { BytesMessage message = (BytesMessage) consumer.receive(1000); assertNotNull(message); assertTrue(message.readBoolean()); try { message.readByte(); fail("Expected exception not thrown."); } catch (MessageEOFException e) { } } assertNull(consumer.receiveNoWait()); }
@Override protected void assertEquivalent(final Message m, final int mode, final boolean redelivered) throws JMSException { super.assertEquivalent(m, mode, redelivered); BytesMessage bm = (BytesMessage) m; ProxyAssertSupport.assertEquals(true, bm.readBoolean()); ProxyAssertSupport.assertEquals((byte) 3, bm.readByte()); byte[] bytes = new byte[3]; bm.readBytes(bytes); ProxyAssertSupport.assertEquals((byte) 4, bytes[0]); ProxyAssertSupport.assertEquals((byte) 5, bytes[1]); ProxyAssertSupport.assertEquals((byte) 6, bytes[2]); ProxyAssertSupport.assertEquals((char) 7, bm.readChar()); ProxyAssertSupport.assertEquals(new Double(8.0), new Double(bm.readDouble())); ProxyAssertSupport.assertEquals(new Float(9.0), new Float(bm.readFloat())); ProxyAssertSupport.assertEquals(10, bm.readInt()); ProxyAssertSupport.assertEquals(11L, bm.readLong()); ProxyAssertSupport.assertEquals((short) 12, bm.readShort()); ProxyAssertSupport.assertEquals("this is an UTF String", bm.readUTF()); }
assertEquals("failed at " + i, bytesData[i], rawBytes[i]); assertTrue(bytesMessage.readBoolean()); assertEquals(99999L, bytesMessage.readLong()); assertEquals('h', bytesMessage.readChar());
m.readBoolean(); ProxyAssertSupport.fail(); } catch (javax.jms.MessageNotReadableException e) { ProxyAssertSupport.assertEquals(myBool, m2.readBoolean()); ProxyAssertSupport.assertEquals(myByte, m2.readByte()); ProxyAssertSupport.assertEquals(myShort, m2.readShort()); ProxyAssertSupport.assertEquals(myBytes[4], bytes2[2]); ProxyAssertSupport.assertEquals(myBool, m2.readBoolean()); ProxyAssertSupport.assertEquals(myByte, m2.readByte()); ProxyAssertSupport.assertEquals(myShort, m2.readShort()); m2.readBoolean(); ProxyAssertSupport.fail(); } catch (MessageEOFException e) { m2.readBoolean(); int unsignedByte = m2.readUnsignedByte();