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");
}
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");
}
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, "ソフィーの申請");
}
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, "ソフィソフィー");
}
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, "ソフィーの申請");
}
Aggregations