summaryrefslogtreecommitdiffstats
path: root/harmony-tests/src/test/resources
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2014-08-22 10:38:47 +0100
committerNarayan Kamath <narayan@google.com>2014-08-26 13:34:30 +0100
commitb0b81dfb681cf401b3fc108b9abe432ee6736164 (patch)
tree056c99617650bd6168e8bf27eabca765e99a71b4 /harmony-tests/src/test/resources
parent8f16ce1e62f93defc80308c3ee3cdb22ab4953c1 (diff)
downloadlibcore-b0b81dfb681cf401b3fc108b9abe432ee6736164.zip
libcore-b0b81dfb681cf401b3fc108b9abe432ee6736164.tar.gz
libcore-b0b81dfb681cf401b3fc108b9abe432ee6736164.tar.bz2
Move preference tests over from external/apache-harmony.
Also fixes all remaining failures. Most of them were due to us not setting "user.dir" and "user.home" correctly. Android has traditionally left those values blank. To fix these tests, we need to change the default prefs factory to one rooted at a temporary directory. Note that this change attempts the minimal possible cleanup (mainly style, commented code formatting etc.) to these files. bug: 13881847 (cherry picked from commit a152f62d4d81ef6500b3e02dbc381e2414f9a11f) Change-Id: Ie32a61e1b911dcd317c688f86e487f9ea778b31f
Diffstat (limited to 'harmony-tests/src/test/resources')
-rw-r--r--harmony-tests/src/test/resources/resources/prefs/java/util/prefs/userprefs-badencoding.xml65
-rw-r--r--harmony-tests/src/test/resources/resources/prefs/java/util/prefs/userprefs-badform.xml51
-rw-r--r--harmony-tests/src/test/resources/resources/prefs/java/util/prefs/userprefs.xml89
-rw-r--r--harmony-tests/src/test/resources/serialization/org/apache/harmony/tests/java/util/prefs/BackingStoreExceptionTest.golden.serbin0 -> 1547 bytes
-rw-r--r--harmony-tests/src/test/resources/serialization/org/apache/harmony/tests/java/util/prefs/InvalidPreferencesFormatExceptionTest.golden.serbin0 -> 1583 bytes
5 files changed, 205 insertions, 0 deletions
diff --git a/harmony-tests/src/test/resources/resources/prefs/java/util/prefs/userprefs-badencoding.xml b/harmony-tests/src/test/resources/resources/prefs/java/util/prefs/userprefs-badencoding.xml
new file mode 100644
index 0000000..182edc7
--- /dev/null
+++ b/harmony-tests/src/test/resources/resources/prefs/java/util/prefs/userprefs-badencoding.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="badencoding"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<!DOCTYPE preferences SYSTEM 'http://java.sun.com/dtd/preferences.dtd'>
+
+<preferences EXTERNAL_XML_VERSION="1.0">
+ <root type="user">
+ <map/>
+ <node name="tests">
+ <map/>
+ <node name="api">
+ <map/>
+ <node name="java">
+ <map/>
+ <node name="util">
+ <map/>
+ <node name="prefs">
+ <map>
+ <entry key="prefskey" value="newvalue"/>
+ <entry key="prefskey3" value="newvalue3"/>
+ </map>
+ <node name="mock">
+ <map/>
+ <node name="child">
+ <map>
+ <entry key="key2" value="value2"/>
+ </map>
+ <node name="grandson">
+ <map>
+ <entry key="key3" value="value3"/>
+ </map>
+ <node name="grandgrandson">
+ <map>
+ <entry key="key4"
+ value="value4"/>
+ </map>
+ </node>
+ </node>
+ </node>
+ </node>
+ </node>
+ </node>
+ </node>
+ </node>
+ </node>
+ </root>
+</preferences>
diff --git a/harmony-tests/src/test/resources/resources/prefs/java/util/prefs/userprefs-badform.xml b/harmony-tests/src/test/resources/resources/prefs/java/util/prefs/userprefs-badform.xml
new file mode 100644
index 0000000..da3aeb9
--- /dev/null
+++ b/harmony-tests/src/test/resources/resources/prefs/java/util/prefs/userprefs-badform.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<!DOCTYPE preferences SYSTEM 'http://java.sun.com/dtd/preferences.dtd'>
+
+<preferences EXTERNAL_XML_VERSION="1.0">
+ <root type="user">
+ <map/>
+ <node name="java">
+ <map/>
+ <node name="util">
+ <map/>
+ <node name="mock">
+ <map/>
+ <node name="child">
+ <map>
+ <entry key="key2" value="value2"/>
+ </map>
+ <node name="grandson">
+ <map>
+ <entry key="key3" value="value3"/>
+ </map>
+ <node name="grandgrandson">
+ <map>
+ <entry key="key4" value="value4"/>
+ </map>
+ </node>
+ </node>
+ </node>
+ </node>
+ </node>
+ </node>
+ </root>
diff --git a/harmony-tests/src/test/resources/resources/prefs/java/util/prefs/userprefs.xml b/harmony-tests/src/test/resources/resources/prefs/java/util/prefs/userprefs.xml
new file mode 100644
index 0000000..7bee4c7
--- /dev/null
+++ b/harmony-tests/src/test/resources/resources/prefs/java/util/prefs/userprefs.xml
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<!DOCTYPE preferences SYSTEM 'http://java.sun.com/dtd/preferences.dtd'>
+
+<preferences EXTERNAL_XML_VERSION="1.0">
+ <root type="user">
+ <map/>
+ <node name="org">
+ <map/>
+ <node name="apache">
+ <map/>
+ <node name="harmony">
+ <map/>
+ <node name="tests">
+ <map/>
+ <node name="java">
+ <map/>
+ <node name="util">
+ <map/>
+
+ <node name="prefs">
+ <map>
+ <entry key="prefskey"
+ value="newvalue"/>
+ <entry key="prefskey3"
+ value="newvalue3"/>
+ </map>
+
+ <node name="mock">
+ <map/>
+ <node name="child">
+ <map>
+ <entry key="key2"
+ value="value2"/>
+ </map>
+ <node name="grandson">
+ <map>
+ <entry key="key3"
+ value="value3"/>
+ </map>
+ <node name="grandgrandson">
+ <map>
+ <entry key="key4"
+ value="value4"/>
+ </map>
+ </node>
+ <!--grandgrandson-->
+ </node>
+ <!--grandson-->
+ </node>
+ <!--child-->
+ </node>
+ <!--mock-->
+
+ </node>
+ <!--prefs-->
+ </node>
+ <!--util-->
+ </node>
+ <!--java-->
+ </node>
+ <!--tests-->
+ </node>
+ <!--harmony-->
+ </node>
+ <!--apache-->
+ </node>
+ <!--org-->
+ </root>
+</preferences>
diff --git a/harmony-tests/src/test/resources/serialization/org/apache/harmony/tests/java/util/prefs/BackingStoreExceptionTest.golden.ser b/harmony-tests/src/test/resources/serialization/org/apache/harmony/tests/java/util/prefs/BackingStoreExceptionTest.golden.ser
new file mode 100644
index 0000000..4d26113
--- /dev/null
+++ b/harmony-tests/src/test/resources/serialization/org/apache/harmony/tests/java/util/prefs/BackingStoreExceptionTest.golden.ser
Binary files differ
diff --git a/harmony-tests/src/test/resources/serialization/org/apache/harmony/tests/java/util/prefs/InvalidPreferencesFormatExceptionTest.golden.ser b/harmony-tests/src/test/resources/serialization/org/apache/harmony/tests/java/util/prefs/InvalidPreferencesFormatExceptionTest.golden.ser
new file mode 100644
index 0000000..a15948d
--- /dev/null
+++ b/harmony-tests/src/test/resources/serialization/org/apache/harmony/tests/java/util/prefs/InvalidPreferencesFormatExceptionTest.golden.ser
Binary files differ