I've been struggling with this for a bit as well.  I haven't figured
out the best solution for doing this but I have found a hack for the
time being.  It does seem like Jarrod was correct in that when tests
are running the host html file is not being used.  So using the
gwtSetUp() method I've quickly hacked in the values of the Dictionary
I want.  The code looks like the following:

    public static final String DICTIONARY_NAME = "ResouceMessages";
    public static final String KEY = "key";
    public static final String VALUE = "value";

    @Override
    public void gwtSetUp() {
        Element bodyElem = RootPanel.getBodyElement();

        Element script = DOM.createElement("script");
        StringBuilder builder = new StringBuilder();
        builder.append("var ").append(DICTIONARY_NAME).append("=
{\"").append(KEY).append("\": \"")
                .append(VALUE).append("\"};");

        script.setInnerText(builder.toString());
        DOM.appendChild(bodyElem, script);
    }

    public void testSimpleTest() {
        Dictionary dictionary = Dictionary.getDictionary(DICTIONARY_NAME);
        assertEquals(VALUE, dictionary.get(KEY));
    }

Like I said it is just a hack and ideally we could specify the
host.html file to use.  Another option would be to read in the
contents of the host.html and add its elements as children of the
RootPanel bodyElem but that could cause other problems.

Micah

On Wed, Feb 17, 2010 at 6:14 AM, Lucas de Oliveira
<[email protected]> wrote:
> Hi,
> I'm running into the same scenario. Have you found any solution?
>
> thanks!
>
>
> --
> Lucas de Oliveira Arantes
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to