From 1399e0b42af7a565f34b9a2441f0a079e6ab3854 Mon Sep 17 00:00:00 2001 From: Narayan Kamath Date: Wed, 13 Nov 2013 13:05:58 +0000 Subject: Fix a few failures in FileURLConnectionTest. Some tests still fail, but they appear to be valid tests. There are at least two separate issues here : - ClassLoader#getResource seems to be constructing a bogus URL (at least in this context). findResource returns a non null URL, but URL#openStream throws. - URLs with fragments (#foo) don't appear to work correctly. Change-Id: Iabf03e49c56659039feb85a0e528efcaaed0b49d --- .../src/test/resources/resources/test.doc | 20 ++++++++++++++++++++ .../src/test/resources/resources/test.htx | 22 ++++++++++++++++++++++ .../src/test/resources/resources/test.java | 20 ++++++++++++++++++++ .../src/test/resources/resources/test.rtf | 20 ++++++++++++++++++++ .../src/test/resources/resources/test.xml | 22 ++++++++++++++++++++++ 5 files changed, 104 insertions(+) create mode 100644 harmony-tests/src/test/resources/resources/test.doc create mode 100644 harmony-tests/src/test/resources/resources/test.htx create mode 100644 harmony-tests/src/test/resources/resources/test.java create mode 100644 harmony-tests/src/test/resources/resources/test.rtf create mode 100644 harmony-tests/src/test/resources/resources/test.xml (limited to 'harmony-tests/src/test/resources') diff --git a/harmony-tests/src/test/resources/resources/test.doc b/harmony-tests/src/test/resources/resources/test.doc new file mode 100644 index 0000000..9d88f15 --- /dev/null +++ b/harmony-tests/src/test/resources/resources/test.doc @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/* A bogus doc file used to see if we can detect + * file type based on its file extension. + */ \ No newline at end of file diff --git a/harmony-tests/src/test/resources/resources/test.htx b/harmony-tests/src/test/resources/resources/test.htx new file mode 100644 index 0000000..2aa810e --- /dev/null +++ b/harmony-tests/src/test/resources/resources/test.htx @@ -0,0 +1,22 @@ + + +/* + * 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. + */ + +/* A bogus html file used to see if we can detect + * file type based on its file extension / content. + */ \ No newline at end of file diff --git a/harmony-tests/src/test/resources/resources/test.java b/harmony-tests/src/test/resources/resources/test.java new file mode 100644 index 0000000..3ea4660 --- /dev/null +++ b/harmony-tests/src/test/resources/resources/test.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/* A bogus java file used to see if we can detect + * file type based on its file extension. + */ \ No newline at end of file diff --git a/harmony-tests/src/test/resources/resources/test.rtf b/harmony-tests/src/test/resources/resources/test.rtf new file mode 100644 index 0000000..aa1d82d --- /dev/null +++ b/harmony-tests/src/test/resources/resources/test.rtf @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/* A bogus RTF file used to see if we can detect + * file type based on its file extension. + */ \ No newline at end of file diff --git a/harmony-tests/src/test/resources/resources/test.xml b/harmony-tests/src/test/resources/resources/test.xml new file mode 100644 index 0000000..cb5c342 --- /dev/null +++ b/harmony-tests/src/test/resources/resources/test.xml @@ -0,0 +1,22 @@ + + + + + \ No newline at end of file -- cgit v1.1