JcrValue implements javax.jcr.Value { @Override public double getDouble() throws ValueFormatException { try { double convertedValue = factories().getDoubleFactory().create(value); return convertedValue; } catch (RuntimeException error) { throw createValueFormatException(double.class); } } JcrValue( ValueFactories factories,
              int type,
              Object value );   JcrValue( ValueFactories factories,
              Value value ); @Override boolean getBoolean(); @Override Calendar getDate(); @Override BigDecimal getDecimal(); @Override double getDouble(); @Override long getLong(); @Override @SuppressWarnings("deprecation") InputStream getStream(); @Override BinaryValue getBinary(); @Override String getString(); @Override int getType(); @Override int hashCode(); @Override boolean equals( Object obj ); @Override String toString();  }
@Test( expected = ValueFormatException.class ) public void shouldNotProvideDoubleForBoolean() throws Exception { value.getDouble(); }
@Test public void shouldProvideDoubleForDate() throws Exception { Date date = new Date(); assertThat(new JcrValue(factories, PropertyType.DATE, date).getDouble(), is((double)date.getTime())); }
@Test public void shouldProvideDoubleForDouble() throws Exception { assertThat(new JcrValue(factories, PropertyType.DOUBLE, 1.2).getDouble(), is(1.2)); }
@Test public void shouldProvideDoubleForLong() throws Exception { assertThat(new JcrValue(factories, PropertyType.LONG, 1L).getDouble(), is(1.0)); }
@Test public void shouldProvideDoubleForString() throws Exception { assertThat(new JcrValue(factories, PropertyType.STRING, "1").getDouble(), is(1.0)); }
@Test( expected = ValueFormatException.class ) public void shouldNotProvideDoubleForInvalidString() throws Exception { new JcrValue(factories, PropertyType.STRING, "true").getDouble(); }
@Test( expected = ValueFormatException.class ) public void shouldNotProvideDoubleForUuid() throws Exception { new JcrValue(factories, PropertyType.STRING, UUID.randomUUID()).getDouble(); }