javax.jms.Message.getDoubleProperty()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(10.0k)|赞(0)|评价(0)|浏览(106)

本文整理了Java中javax.jms.Message.getDoubleProperty()方法的一些代码示例,展示了Message.getDoubleProperty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.getDoubleProperty()方法的具体详情如下:
包路径:javax.jms.Message
类名称:Message
方法名:getDoubleProperty

Message.getDoubleProperty介绍

[英]Returns the value of the double property with the specified name.
[中]返回具有指定名称的double属性的值。

代码示例

代码示例来源:origin: org.jboss.jbossas/jboss-as-connector

public double getDoubleProperty(String name) throws JMSException
{
 return message.getDoubleProperty(name);
}

代码示例来源:origin: org.apache.tomee/openejb-core

@Override
public double getDoubleProperty(final String name) throws JMSException {
  return message.getDoubleProperty(name);
}

代码示例来源:origin: org.jboss.genericjms/generic-jms-ra-jar

public double getDoubleProperty(String name) throws JMSException {
  return message.getDoubleProperty(name);
}

代码示例来源:origin: org.apache.qpid/qpid-jca

/**
* Get property
* @param name The name
* @return The value
* @exception JMSException Thrown if an error occurs
*/
public double getDoubleProperty(final String name) throws JMSException
{
 if (_log.isTraceEnabled())
 {
   _log.trace("getDoubleProperty(" + name + ")");
 }
 return _message.getDoubleProperty(name);
}

代码示例来源:origin: apache/activemq-artemis

/**
* Get property
*
* @param name The name
* @return The value
* @throws JMSException Thrown if an error occurs
*/
@Override
public double getDoubleProperty(final String name) throws JMSException {
 if (ActiveMQRALogger.LOGGER.isTraceEnabled()) {
   ActiveMQRALogger.LOGGER.trace("getDoubleProperty(" + name + ")");
 }
 return message.getDoubleProperty(name);
}

代码示例来源:origin: org.apache.activemq/artemis-ra

/**
* Get property
*
* @param name The name
* @return The value
* @throws JMSException Thrown if an error occurs
*/
@Override
public double getDoubleProperty(final String name) throws JMSException {
 if (ActiveMQRALogger.LOGGER.isTraceEnabled()) {
   ActiveMQRALogger.LOGGER.trace("getDoubleProperty(" + name + ")");
 }
 return message.getDoubleProperty(name);
}

代码示例来源:origin: objectweb-joramtests/joramtests

/**
* if a property is set as a <code>float</code>, 
* it can also be read as a <code>double</code>.
*/
public void testFloat2Double()
{
 try
 {
   Message message = senderSession.createMessage();
   message.setFloatProperty("prop", 127.0F);
   assertEquals(127.0, message.getDoubleProperty("prop"), 0);
 }
 catch (JMSException e)
 {
   fail(e);
 }
}

代码示例来源:origin: objectweb-joramtests/joramtests

/**
* if a property is set as a <code>java.lang.String</code>, 
* it can also be read as a <code>double</code> as long as the <code>String</code>
* is a correct representation of a <code>double</code> (e.g. <code>"3.14159"</code>).
*/
public void testString2Double_1()
{
 try
 {
   Message message = senderSession.createMessage();
   message.setStringProperty("pi", "3.14159");
   assertEquals(3.14159, message.getDoubleProperty("pi"), 0);
 }
 catch (JMSException e)
 {
   fail(e);
 }
}

代码示例来源:origin: objectweb-joramtests/joramtests

/**
* if a property is set as a <code>double</code>, 
* it can also be read as a <code>double</code>.
*/
public void testDouble2Double()
{
 try
 {
   Message message = senderSession.createMessage();
   message.setDoubleProperty("prop", 127.0);
   assertEquals(127.0, message.getDoubleProperty("prop"), 0);
 }
 catch (JMSException e)
 {
   fail(e);
 }
}

代码示例来源:origin: apache/activemq-artemis

/**
* Test that an attempt to get a <code>double</code> property which does not exist throw
* a <code>java.lang.NullPointerException</code>
*/
@Test
public void testGetDoubleProperty() {
 try {
   Message message = senderSession.createMessage();
   message.getDoubleProperty("prop");
   Assert.fail("Should raise a NullPointerException.\n");
 } catch (NullPointerException e) {
 } catch (JMSException e) {
   fail(e);
 }
}

代码示例来源:origin: apache/activemq-artemis

/**
* if a property is set as a <code>double</code>,
* it can also be read as a <code>double</code>.
*/
@Test
public void testDouble2Double() {
 try {
   Message message = senderSession.createMessage();
   message.setDoubleProperty("prop", 127.0);
   Assert.assertEquals(127.0, message.getDoubleProperty("prop"), 0);
 } catch (JMSException e) {
   fail(e);
 }
}

代码示例来源:origin: apache/activemq-artemis

/**
* if a property is set as a <code>float</code>,
* it can also be read as a <code>double</code>.
*/
@Test
public void testFloat2Double() {
 try {
   Message message = senderSession.createMessage();
   message.setFloatProperty("prop", 127.0F);
   Assert.assertEquals(127.0, message.getDoubleProperty("prop"), 0);
 } catch (JMSException e) {
   fail(e);
 }
}

代码示例来源:origin: apache/activemq-artemis

/**
* if a property is set as a <code>java.lang.String</code>,
* it can also be read as a <code>double</code> as long as the <code>String</code>
* is a correct representation of a <code>double</code> (e.g. <code>"3.14159"</code>).
*/
@Test
public void testString2Double_1() {
 try {
   Message message = senderSession.createMessage();
   message.setStringProperty("pi", "3.14159");
   Assert.assertEquals(3.14159, message.getDoubleProperty("pi"), 0);
 } catch (JMSException e) {
   fail(e);
 }
}

代码示例来源:origin: apache/activemq-artemis

/**
* if a property is set as a <code>short</code>,
* to get is as a <code>double</code> throws a <code>javax.jms.MessageFormatException</code>.
*/
@Test
public void testShort2Double() {
 try {
   Message message = senderSession.createMessage();
   message.setShortProperty("prop", (short) 127);
   message.getDoubleProperty("prop");
   Assert.fail("sec. 3.5.4 The unmarked cases [of Table 0-4] should raise a JMS MessageFormatException.\n");
 } catch (MessageFormatException e) {
 } catch (JMSException e) {
   fail(e);
 }
}

代码示例来源:origin: apache/activemq-artemis

/**
* if a property is set as a <code>long</code>,
* to get is as a <code>double</code> throws a <code>javax.jms.MessageFormatException</code>.
*/
@Test
public void testLong2Double() {
 try {
   Message message = senderSession.createMessage();
   message.setLongProperty("prop", 127L);
   message.getDoubleProperty("prop");
   Assert.fail("sec. 3.5.4 The unmarked cases [of Table 0-4] should raise a JMS MessageFormatException.\n");
 } catch (MessageFormatException e) {
 } catch (JMSException e) {
   fail(e);
 }
}

代码示例来源:origin: apache/activemq-artemis

/**
* if a property is set as a <code>int</code>,
* to get is as a <code>double</code> throws a <code>javax.jms.MessageFormatException</code>.
*/
@Test
public void testInt2Double() {
 try {
   Message message = senderSession.createMessage();
   message.setIntProperty("prop", 127);
   message.getDoubleProperty("prop");
   Assert.fail("sec. 3.5.4 The unmarked cases [of Table 0-4] should raise a JMS MessageFormatException.\n");
 } catch (MessageFormatException e) {
 } catch (JMSException e) {
   fail(e);
 }
}

代码示例来源:origin: apache/activemq-artemis

/**
* if a property is set as a <code>byte</code>,
* to get is as a <code>double</code> throws a <code>javax.jms.MessageFormatException</code>.
*/
@Test
public void testByte2Double() {
 try {
   Message message = senderSession.createMessage();
   message.setByteProperty("prop", (byte) 127);
   message.getDoubleProperty("prop");
   Assert.fail("sec. 3.5.4 The unmarked cases [of Table 0-4] should raise a JMS MessageFormatException.\n");
 } catch (MessageFormatException e) {
 } catch (JMSException e) {
   fail(e);
 }
}

代码示例来源:origin: apache/activemq-artemis

/**
* if a property is set as a <code>java.lang.String</code>,
* to get it as a <code>double</code> throws a <code>java.lang.NuberFormatException</code>
* if the <code>String</code> is not a correct representation for a <code>double</code>
* (e.g. <code>"not a number"</code>).
*/
@Test
public void testString2Double_2() {
 try {
   Message message = senderSession.createMessage();
   message.setStringProperty("pi", "not_a_number");
   message.getDoubleProperty("pi");
   Assert.fail("sec. 3.5.4 The String to numeric conversions must throw the java.lang.NumberFormatException " + " if the numeric's valueOf() method does not accept the String value as a valid representation.\n");
 } catch (java.lang.NumberFormatException e) {
 } catch (JMSException e) {
   fail(e);
 }
}

代码示例来源:origin: apache/activemq-artemis

/**
* if a property is set as a <code>boolean</code>,
* to get is as a <code>double</code> throws a <code>javax.jms.MessageFormatException</code>.
*/
@Test
public void testBoolean2Double() {
 try {
   Message message = senderSession.createMessage();
   // store a value that can't be converted to double
   message.setBooleanProperty("prop", true);
   message.getDoubleProperty("prop");
   Assert.fail("sec. 3.5.4 The unmarked cases [of Table 0-4] should raise a JMS MessageFormatException.\n");
 } catch (MessageFormatException e) {
 } catch (JMSException e) {
   fail(e);
 }
}

代码示例来源:origin: apache/activemq-artemis

protected void assertEquivalent(final Message m, final int mode, final boolean redelivered) throws JMSException {
 ProxyAssertSupport.assertNotNull(m);
 ProxyAssertSupport.assertEquals(true, m.getBooleanProperty("booleanProperty"));
 ProxyAssertSupport.assertEquals((byte) 3, m.getByteProperty("byteProperty"));
 ProxyAssertSupport.assertEquals(new Double(4.0), new Double(m.getDoubleProperty("doubleProperty")));
 ProxyAssertSupport.assertEquals(new Float(5.0f), new Float(m.getFloatProperty("floatProperty")));
 ProxyAssertSupport.assertEquals(6, m.getIntProperty("intProperty"));
 ProxyAssertSupport.assertEquals(7, m.getLongProperty("longProperty"));
 ProxyAssertSupport.assertEquals((short) 8, m.getShortProperty("shortProperty"));
 ProxyAssertSupport.assertEquals("this is a String property", m.getStringProperty("stringProperty"));
 ProxyAssertSupport.assertEquals("this is the correlation ID", m.getJMSCorrelationID());
 ProxyAssertSupport.assertEquals(ActiveMQServerTestCase.topic1, m.getJMSReplyTo());
 ProxyAssertSupport.assertEquals("someArbitraryType", m.getJMSType());
 ProxyAssertSupport.assertEquals(queue1, m.getJMSDestination());
 ProxyAssertSupport.assertEquals("JMS Redelivered property", m.getJMSRedelivered(), redelivered);
 ProxyAssertSupport.assertEquals(mode, m.getJMSDeliveryMode());
}

相关文章

微信公众号

最新文章

更多