Search in sources :

Example 1 with EncodedProperties

use of jp.ossc.nimbus.util.EncodedProperties in project nimbus by nimbus-org.

the class EncodedPropertiesTest method testEncodedPropertiesString.

/*
	 * void EncodedProperties のテスト(String)
	 */
public void testEncodedPropertiesString() throws IOException, Exception {
    EncodedProperties prop = new EncodedProperties("euc-jp");
    prop.loadFromFile("src/test/resources/jp/ossc/nimbus/util/test2.properties");
    String aa = prop.getProperty("test1");
    assertEquals(aa, "ソフィーの申請1_2");
    aa = prop.getProperty("test2");
    assertEquals(aa, "ソフィーの申請2_2");
    aa = prop.getProperty("test3");
    assertEquals(aa, "\\ソフィーの申請3_2 aabb ccdd");
    aa = prop.getProperty("test4");
    assertEquals(aa, "ソフィーの申請4_2");
}
Also used : EncodedProperties(jp.ossc.nimbus.util.EncodedProperties)

Example 2 with EncodedProperties

use of jp.ossc.nimbus.util.EncodedProperties in project nimbus by nimbus-org.

the class EncodedPropertiesTest method testGetEncoding.

public void testGetEncoding() throws Exception {
    EncodedProperties prop = new EncodedProperties();
    String enc = prop.getEncoding();
    assertEquals(enc, "ISO-8859-1");
    prop = new EncodedProperties("euc-jp");
    enc = prop.getEncoding();
    assertEquals(enc, "euc-jp");
}
Also used : EncodedProperties(jp.ossc.nimbus.util.EncodedProperties)

Example 3 with EncodedProperties

use of jp.ossc.nimbus.util.EncodedProperties in project nimbus by nimbus-org.

the class EncodedPropertiesTest method testLoadFromString.

public void testLoadFromString() throws IOException, Exception {
    EncodedProperties prop = new EncodedProperties();
    prop.loadFromString("test=ソフィーの申請");
    String aa = prop.getProperty("test");
    assertEquals(aa, "ソフィーの申請");
}
Also used : EncodedProperties(jp.ossc.nimbus.util.EncodedProperties)

Example 4 with EncodedProperties

use of jp.ossc.nimbus.util.EncodedProperties in project nimbus by nimbus-org.

the class EncodedPropertiesTest method testGetPropertyStringString.

/*
	 * String getProperty のテスト(String, String)
	 */
public void testGetPropertyStringString() throws IOException, Exception {
    EncodedProperties prop = new EncodedProperties("euc-jp");
    prop.loadFromFile("src/test/resources/jp/ossc/nimbus/util/test2.properties");
    String aa = prop.getProperty("test44", "ソフィソフィー");
    assertEquals(aa, "ソフィソフィー");
}
Also used : EncodedProperties(jp.ossc.nimbus.util.EncodedProperties)

Example 5 with EncodedProperties

use of jp.ossc.nimbus.util.EncodedProperties in project nimbus by nimbus-org.

the class EncodedPropertiesTest method testSetPropertyStringString.

/*
	 * Object setProperty のテスト(String, String)
	 */
public void testSetPropertyStringString() throws Exception {
    EncodedProperties prop = new EncodedProperties();
    prop.setProperty("test", "ソフィーの申請");
    String aa = prop.getProperty("test");
    assertEquals(aa, "ソフィーの申請");
}
Also used : EncodedProperties(jp.ossc.nimbus.util.EncodedProperties)

Aggregations

EncodedProperties (jp.ossc.nimbus.util.EncodedProperties)6