Sounds like you are making good progress.

On Sat, Jun 6, 2009 at 10:45 PM, Bobby <[email protected]> wrote:
>
> The GoogleAccounts module is working well and is pretty close to what
> it needs to be:
> http://code.google.com/p/gwt-gdata/source/browse/trunk/gdata/src/com/google/gwt/accounts
>
> I was able to create jUnit test cases that impersonate user
> authentication - the GData JS API AuthSub implementation performs
> authentication by redirecting to a Google Accounts page, performing
> auth and then redirecting back to the referring URL, passing along a
> session token which gets stored in a cookie. To make the
> authentication work i am setting the cookie directly which has the
> same effect but allows the jUnit tests to work smoothly:
> http://code.google.com/p/gwt-gdata/source/browse/trunk/gdata/test/com/google/accounts/client/UserTest.java
>
> Now i can write unit tests for the services which read/write data with
> a test account.
>
> I'm debating whether i should split the GWT-Gdata module into multiple
> sub modules. For example, instead of having one large GWT module at
> com.google.gwt.gdata, have com.google.gwt.gdata be a base module
> inherited by specialized modules such as:
>
> com.google.gwt.gdata.calendar
> com.google.gwt.gdata.blogger
> com.google.gwt.gdata.contacts
> com.google.gwt.gdata.finance
> ...etc
>
> The reason is that, from my experience, you end up using GData to
> interact with either Calendar or Documents for example, rather than
> all of the GData systems, so it seems more natural to have a module
> per GData system.

In the Gears API, we ran into a similar issue.  Should we break out
the Gears components into separate modules?

In that case we decided that it was a burden on the user to have to
find and import the correct module.  GWT does dead code stripping, so
there is no penalty at runtime for including parts of the API you
don't use.  We put everything under one com.google.gwt.gears.client
package in the end.

In the GData case, I could see that developers are less likely to use
features from across multiple packages, so I could go either way, but
as far as runtime performance goes, there is no difference either way.
 As far as convenience goes, having everything under one module makes
the setting up of your project's module easier.

>
> Bobby
>
>
>
>
> On May 30, 10:21 pm, Bobby <[email protected]> wrote:
>> I eliminated the Date errors by making use of a 
>> DateHelper:http://code.google.com/p/gwt-gdata/source/browse/trunk/gdata/src/com/...
>>
>> Here's how i'm using 
>> it:http://code.google.com/p/gwt-gdata/source/browse/trunk/gdata/src/com/...
>>
>> I convert Dates to milliseconds since 1970 before passing them between
>> Java and JS.
>>
>> Bobby
>>
>> On May 30, 5:04 pm, Eric Ayers <[email protected]> wrote:
>>
>>
>>
>> > I don't think GWT does anything useful when you pass a Java Date
>> > object into JSNI.  You may want to pass the # of milliseconds since
>> > 1970 instead.
>>
>> > On Sat, May 30, 2009 at 2:03 AM, Bobby <[email protected]> wrote:
>>
>> > > I'm seeing some weird behavior whenever java.util.Date is used. The
>> > > following DateTime class in GData wraps around a date:
>> > >http://code.google.com/p/gwt-gdata/source/browse/trunk/gdata/src/com/...
>>
>> > > The newInstance method receives a java.util.Date.:
>>
>> > >  public static native DateTime newInstance(Date date, boolean
>> > > dateOnly) /*-{
>> > >     return new $wnd.google.gdata.DateTime(
>> > >       date,
>> > >       dateOnly
>> > >     );
>> > >   }-*/;
>>
>> > > Whenever i call this method it fails. If i replace it with the
>> > > following, then it works:
>>
>> > >  public static native DateTime newInstance(Date date, boolean
>> > > dateOnly) /*-{
>> > >     return new $wnd.google.gdata.DateTime(
>> > >       new Date(), //pass static JS date instead
>> > >       dateOnly
>> > >     );
>> > >   }-*/;
>>
>> > > So the date object passed in from Java causes a failure whereas a
>> > > regular JS date doesn't. I looked at the Date parameter passed in from
>> > > Java and it looked like a regular JS date - when printed, a regular
>> > > date string is displayed.
>> > > In web mode jUnit hangs on newInstance(new Date(), true/false) because
>> > > a JS exception occurs. In hosted mode the following exception is
>> > > thrown:
>>
>> > > [WARN] Malformed JSNI reference 'getFullYear'; expect subsequent
>> > > failures
>> > > java.lang.NoSuchFieldError: getFullYear
>> > >        at com.google.gwt.dev.shell.CompilingClassLoader
>> > > $DispatchClassInfoOracle.getDispId(CompilingClassLoader.java:119)
>> > >        at com.google.gwt.dev.shell.CompilingClassLoader.getDispId
>> > > (CompilingClassLoader.java:531)
>> > >        at com.google.gwt.dev.shell.ie.IDispatchProxy.getIDsOfNames
>> > > (IDispatchProxy.java:124)
>> > >        at com.google.gwt.dev.shell.ie.IDispatchImpl.GetIDsOfNames
>> > > (IDispatchImpl.java:273)
>> > >        at com.google.gwt.dev.shell.ie.IDispatchImpl.method5
>> > > (IDispatchImpl.java:189)
>> > >        at org.eclipse.swt.internal.ole.win32.COMObject.callback5
>> > > (COMObject.java:108)
>> > >        at org.eclipse.swt.internal.ole.win32.COM.VtblCall(Native Method)
>> > >        at 
>> > > org.eclipse.swt.internal.ole.win32.IDispatch.Invoke(IDispatch.java:
>> > > 64)
>> > >        at 
>> > > org.eclipse.swt.ole.win32.OleAutomation.invoke(OleAutomation.java:
>> > > 493)
>> > >        at 
>> > > org.eclipse.swt.ole.win32.OleAutomation.invoke(OleAutomation.java:
>> > > 417)
>> > >        at com.google.gwt.dev.shell.ie.ModuleSpaceIE6.doInvokeOnWindow
>> > > (ModuleSpaceIE6.java:67)
>> > >        at com.google.gwt.dev.shell.ie.ModuleSpaceIE6.doInvoke
>> > > (ModuleSpaceIE6.java:152)
>> > >        at 
>> > > com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:
>> > > 447)
>> > >        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid
>> > > (ModuleSpace.java:248)
>> > >        at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid
>> > > (JavaScriptHost.java:107)
>> > >        at com.google.gwt.gdata.client.app.Edited$.setValue$(Edited.java)
>> > >        at com.google.gwt.gdata.client.app.EditedTest.testProperties
>> > > (EditedTest.java:42)
>> > >        at 
>> > > com.google.gwt.gdata.client.app.__EditedTest_unitTestImpl.doRunTest
>> > > (transient source for
>> > > com.google.gwt.gdata.client.app.__EditedTest_unitTestImpl:7)
>> > >        at junit.framework.TestCase.runTest(TestCase.java:62)
>> > >        at 
>> > > com.google.gwt.junit.client.GWTTestCase.runBare(GWTTestCase.java:
>> > > 178)
>> > >        at com.google.gwt.junit.client.GWTTestCase.__doRunTest
>> > > (GWTTestCase.java:116)
>> > >        at 
>> > > com.google.gwt.junit.client.impl.GWTRunner.runTest(GWTRunner.java:
>> > > 188)
>> > >        at com.google.gwt.junit.client.impl.GWTRunner.doRunTest
>> > > (GWTRunner.java:163)
>> > >        at 
>> > > com.google.gwt.junit.client.impl.GWTRunner.access$3(GWTRunner.java:
>> > > 157)
>> > >        at com.google.gwt.junit.client.impl.GWTRunner
>> > > $JUnitHostListener.onSuccess(GWTRunner.java:61)
>> > >        at com.google.gwt.junit.client.impl.GWTRunner
>> > > $JUnitHostListener.onSuccess(GWTRunner.java:1)
>> > >        at
>> > > com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceiv­­ed
>> > > (RequestCallbackAdapter.java:215)
>> > >        at com.google.gwt.http.client.Request.fireOnResponseReceivedImpl
>> > > (Request.java:254)
>> > >        at 
>> > > com.google.gwt.http.client.Request.fireOnResponseReceivedAndCatch
>> > > (Request.java:226)
>> > >        at com.google.gwt.http.client.Request.fireOnResponseReceived
>> > > (Request.java:217)
>> > >        at sun.reflect.GeneratedMethodAccessor27.invoke(Unknown Source)
>> > >        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> > >        at java.lang.reflect.Method.invoke(Unknown Source)
>> > >        at 
>> > > com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:
>> > > 103)
>> > >        at com.google.gwt.dev.shell.ie.IDispatchImpl.callMethod
>> > > (IDispatchImpl.java:126)
>> > >        at com.google.gwt.dev.shell.ie.IDispatchProxy.invoke
>> > > (IDispatchProxy.java:155)
>> > >        at com.google.gwt.dev.shell.ie.IDispatchImpl.Invoke
>> > > (IDispatchImpl.java:294)
>> > >        at com.google.gwt.dev.shell.ie.IDispatchImpl.method6
>> > > (IDispatchImpl.java:194)
>> > >        at org.eclipse.swt.internal.ole.win32.COMObject.callback6
>> > > (COMObject.java:117)
>> > >        at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native 
>> > > Method)
>> > >        at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1925)
>> > >        at 
>> > > org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966)
>> > >        at com.google.gwt.dev.GWTShell.pumpEventLoop(GWTShell.java:720)
>> > >        at 
>> > > com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:654)
>> > >        at com.google.gwt.junit.JUnitShell.runTest(JUnitShell.java:150)
>> > >        at 
>> > > com.google.gwt.junit.client.GWTTestCase.runTest(GWTTestCase.java:
>> > > 219)
>> > >        at junit.framework.TestCase.runBare(TestCase.java:130)
>> > >        at junit.framework.TestResult$1.protect(TestResult.java:106)
>> > >        at junit.framework.TestResult.runProtected(TestResult.java:124)
>> > >        at junit.framework.TestResult.run(TestResult.java:109)
>> > >        at junit.framework.TestCase.run(TestCase.java:120)
>> > >        at 
>> > > com.google.gwt.junit.client.GWTTestCase.run(GWTTestCase.java:132)
>> > >        at junit.framework.TestSuite.runTest(TestSuite.java:230)
>> > >        at junit.framework.TestSuite.run(TestSuite.java:225)
>> > >        at junit.framework.TestSuite.runTest(TestSuite.java:230)
>> > >        at junit.framework.TestSuite.run(TestSuite.java:225)
>> > >        at
>> > > org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run
>> > > (JUnit3TestReference.java:130)
>> > >        at org.eclipse.jdt.internal.junit.runner.TestExecution.run
>> > > (TestExecution.java:38)
>> > >        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
>> > > (RemoteTestRunner.java:460)
>> > >        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
>> > > (RemoteTestRunner.java:673)
>> > >        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run
>> > > (RemoteTestRunner.java:386)
>> > >        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main
>> > > (RemoteTestRunner.java:196)
>>
>> > > Any idea why this might be happening? Is it IE6 related?
>>
>> > > Bobby
>>
>> > > On May 29, 2:03 am, Bobby <[email protected]> wrote:
>> > >> Thanks that was it.
>>
>> > >> Bobby
>>
>> > >> On May 26, 9:01 am, Thomas Broyer <[email protected]> wrote:
>>
>> > >> > On 26 mai, 14:56, Eric Ayers <[email protected]> wrote:
>>
>> > >> > > The read-only link starts with http, but there may be an error in 
>> > >> > > the URL:
>>
>> > >> > >http://gwt-google-apis.googlecode.com/svn/trunk/ajaxloader/ajaxloader...
>>
>> > >> > > (2 instances of the string ajaxloader in the path)
>>
>> > >> > ...and given where Bobby sets his svn:external, it should even 
>> > >> > behttp://gwt-google-apis.googlecode.com/svn/trunk/ajaxloader/ajaxloader...quoted
>> > >> >  text -
>>
>> > >> - Show quoted text -
>>
>> > --
>> > Eric Z. Ayers - GWT Team - Atlanta, GA 
>> > USAhttp://code.google.com/webtoolkit/-Hide quoted text -
>>
>> > - Show quoted text -- Hide quoted text -
>>
>> - Show quoted text -
> >
>



-- 
Eric Z. Ayers - GWT Team - Atlanta, GA USA
http://code.google.com/webtoolkit/

--~--~---------~--~----~------------~-------~--~----~
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