Code example for PropertyResourceBundle

Methods: getString, keySet

0
		assertEquals("one", prb.getString("p1"));
		assertEquals("iso-8859-1", prb.getString("charset"));
 
		propertiesStream = new ByteArrayInputStream("p1=one\ncharset=UTF-8"
				.getBytes("UTF-8"));
		prb = new PropertyResourceBundle(propertiesStream);
		assertEquals(2, prb.keySet().size());
		assertEquals("UTF-8", prb.getString("charset"));
 
		try { 
			new PropertyResourceBundle((InputStream) null);
			fail("Should throw NullPointerException");
		} catch (NullPointerException e) {
			// expected 
		} 
	} 
 
    /** 
	 * @throws IOException 
	 * @tests {@link java.util.PropertyResourceBundle#PropertyResourceBundle(java.io.Reader)} 
	 * @since 1.6