Closed GoogleCodeExporter closed 9 years ago
Hi again,
I temporarily replaced the implementation of JTreeDriver#splitPath.
It uses an escape character.
I hope it helps other people who have encountered the same problem.
I would still prefer if paths were given as arrays.
Here's the method:
private String[] splitPath(final String path) {
List<String> result = new ArrayList<String>();
String pathElement = "";
int i = 0;
int pathLength = path.length();
while (i < pathLength) {
char c = path.charAt(i++);
if (c == ESCAPE_CHARACTER) {
pathElement += path.charAt(i++);
} else {
if (c == SEPARATOR_CHARACTER) {
result.add(pathElement);
pathElement = "";
} else {
pathElement += c;
}
}
}
result.add(pathElement);
return result.toArray(new String[result.size()]);
}
where
private static final char ESCAPE_CHARACTER = '\\';
private static final char SEPARATOR_CHARACTER = '/';
are fields of JTreeDriver.
I hope it helps,
Csabi
Original comment by csaba.ju...@gmail.com
on 10 Jul 2008 at 1:38
Hi Csabi,
JTreeFixture has a method 'separator(String)' that allows you to change the
separator. I think that will fix your problem. Please let me know if that is
the case.
Cheers,
-Alex
Original comment by Alex.Rui...@gmail.com
on 10 Jul 2008 at 2:21
Hi Alex,
Using the separator(String) method did fix the problem in my use case, but I'm
getting the path elements from resource bundles.
One could presume that certain characters, like '~' or '+' for example, never
appear
in path elements, but I'm not sure.
What do you think?
Best regards,
Csabi
Original comment by csaba.ju...@gmail.com
on 11 Jul 2008 at 9:20
Hi Csabi,
It is really hard to tell. So far I haven't seen those characters in path
elements.
What are your thoughts about closing this bug?
Thanks!
-Alex
Original comment by Alex.Rui...@gmail.com
on 14 Jul 2008 at 7:09
Hi Alex,
You're probably right.
If a test would fail because of this, I'm sure I would find a separator.
This really isn't a bug, so you can close it right away.
I didn't even realize this was a bug report. :)
I guess I just wanted some insight into some design decisions.
Thanks and sorry for keeping you busy with this one,
Csabi
Original comment by csaba.ju...@gmail.com
on 15 Jul 2008 at 12:27
Hi Csabi,
No need to apologize. In fact, I prefer using this issue page rather the mailing
list. Sometimes I have too much e-mail that is difficult to recognize any
FEST-related one. On the other hand, having an issue in the issue page is a lot
easier to handle. Please feel free to file any issues if you have any
questions/comments/suggestions! :)
Thank you for helping us improve FEST!
Best regards,
-Alex
Original comment by Alex.Rui...@gmail.com
on 15 Jul 2008 at 12:32
Oops, forgot to close issue.
Original comment by Alex.Rui...@gmail.com
on 15 Jul 2008 at 12:32
Hi Alex,
I've done some thinking.
In my initial post I've said that having an array of Strings instead of a single
String to represent the path would be useful, but it would mean that methods
which
accept several paths, like selectPaths, would need to accept a two-dimensional
array,
which would really be ugly.
I've also said that using an array would allow the use of not only Strings, but
regular expressions too. An alternative providing similar functionality could
be a
method on tree node fixtures (see issue 185) to return fixtures for all child
nodes
whose text (read by a JTreeCellReader) matches a regular expression.
Best regards,
Csabi
Original comment by csaba.ju...@gmail.com
on 16 Sep 2008 at 1:24
Set the module as a label, instead of being part of the title.
Original comment by Alex.Rui...@gmail.com
on 1 Dec 2008 at 2:07
Original issue reported on code.google.com by
csaba.ju...@gmail.com
on 10 Jul 2008 at 9:00