Code example for PropertyResourceBundle

Methods: getStringkeySet

0
        charset = Charset.forName("UTF-8");
        cbuffer = charset.decode(ByteBuffer.wrap(content.getBytes("UTF-8")));
        chars = new char[cbuffer.limit()];
        cbuffer.get(chars);
 
        prb = new PropertyResourceBundle(new CharArrayReader(chars));
        assertEquals(2, prb.keySet().size());
        assertEquals("one", prb.getString("p1"));
        assertEquals("good_feature", prb.getString("feature"));
 
        try { 
            new PropertyResourceBundle((Reader) null);
            fail("Should throw NullPointerException");
        } catch (NullPointerException e) {
            // expected 
        } 
    } 
 
    /** 
	 * @tests java.util.PropertyResourceBundle#getKeys() 
Experience pair programming with AI  Get Codota for Java