Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ticket 2073: add simple test for method IO.copyDirectory() #1075

Open
wants to merge 1 commit into
base: 1.4.x
Choose a base branch
from

Conversation

asolntsev
Copy link
Contributor

just a simple test showing that IO.copyDirectory() works as expected

(see ticket https://play.lighthouseapp.com/projects/57987/tickets/2073)

Copy link
Member

@xael-fry xael-fry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new test is failling

Testsuite: play.libs.IOTest
Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 0.003 sec
Testcase: copyDirectory_copiesFilesWithSpecialCharacterInName(play.libs.IOTest):	FAILED
 junit.framework.AssertionFailedError
at play.libs.IOTest.copyDirectory_copiesFilesWithSpecialCharacterInName(IOTest.java:19)
Test play.libs.IOTest FAILED

@flybyray
Copy link
Contributor

flybyray commented Jan 17, 2017

maybe you check again #1041 it is related to os language settings.
local test work if you have a LANG environment set but if you unset LANG it will fail.
the tests on travis run without LANG therefore it will fail there too.

it is related to:
http://stackoverflow.com/questions/5663709/how-to-fix-java-when-if-refused-to-open-a-file-with-special-charater-in-filename
http://stackoverflow.com/questions/3072376/how-can-i-open-files-containing-accents-in-java

the problem of the play framework library play.libs.IO is the
for (String child: source.list()) {
the string child gets wrong file name because of encoding problems.
my solution was not to rely on encoding at all, using the filetree walker of java. it suits best the recursive copying of files. you do not need the names you just need the file objects.

therefore check again #1041 before releasing 1.4.4 play

Sorry for this misleading hint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants