[appengine-java] Re: ApiProxyLocalImpl.getService question [junit]

2009-09-22 Thread Pion

Based on these threads
http://groups.google.com/group/google-appengine-java/browse_thread/thread/96baed75e3c30a58/00d5afb2e0445882?lnk=gst&q=DataNucleus+plugin#00d5afb2e0445882

I did
Logger.getLogger("DataNucleus.Plugin").setLevel(Level.OFF);
Logger.getLogger("DataNucleus.Persistence").setLevel(Level.OFF);

The messages are off.

On Sep 22, 9:43 am, Pion  wrote:
> I just did the following on the Eclipse-Galileo:
>
> o Click on the Eclipse menu bar "Windows -> Preferences -> General ->
> Capabilitiies". I then enabled the "Class Update"
> o Click on  the Eclipse menu bar "Help -> Software Update -> Manage
> Configurations". I then expanded the plugins.
> o There is no DataNucleus plugin installed.
>
> I don't recall explicitly installing DataNucleus plugin unless GAE or
> something else installed as part of their installations.
>
> Also, I tried the following:
> o Wrote a populate() method to populate my database (from scratch) in
> regular environment (not using junit). It worked fine -- the database
> was created.
>
> o Called the same populate() method above in junit environment. It did
> not create the database.
>
> Thanks.
>
> On Sep 22, 9:08 am, Toby Reyelts  wrote:
>
> > Can you check and see if you have the Eclipse DataNucleus plugin installed?
> > If so, can you try disabling it?
>
> > On Tue, Sep 22, 2009 at 11:34 AM, Pion  wrote:
>
> > > Thanks, Toby.
>
> > > I have changed the code to
> > >              FooServiceImpl server = new FooServiceImpl ();
>
> > > Also, I changed the GWT servlet test method to
>
> > >        public String unitTest() {
> > >                PersistenceManager pm = PMF.get().getPersistenceManager();
> > >                return "unitTest";
> > >        }
>
> > > I implemented/copied the TestEnvironment, LocalServiceTestCase and
> > > LocalDatastoreTestCase classes mentioned on
> > >http://code.google.com/appengine/docs/java/howto/unittesting.html.
>
> > > Now, I receive the following DataNucleus.Plugin warning and error
> > > messages below.
>
> > > Again, thanks for your help.
>
> > > 08:20:35,881 WARN  [DataNucleus.Plugin] - Extension Point
> > > "org.eclipse.ui.views" not registered, but plugin
> > > "org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
> > > configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
> > > refers to it.
> > > 08:20:35,881 WARN  [DataNucleus.Plugin] - Extension Point
> > > "org.eclipse.ui.views" not registered, but plugin
> > > "org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
> > > configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
> > > refers to it.
> > > 0 [main] WARN DataNucleus.Plugin  - Extension Point
> > > "org.eclipse.ui.views" not registered, but plugin
> > > "org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
> > > configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
> > > refers to it.
> > > 08:20:35,883 WARN  [DataNucleus.Plugin] - Extension Point
> > > "org.eclipse.ui.perspectiveExtensions" not registered, but plugin
> > > "org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
> > > configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
> > > refers to it.
> > > 08:20:35,883 WARN  [DataNucleus.Plugin] - Extension Point
> > > "org.eclipse.ui.perspectiveExtensions" not registered, but plugin
> > > "org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
> > > configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
> > > refers to it.
> > > 2 [main] WARN DataNucleus.Plugin  - Extension Point
> > > "org.eclipse.ui.perspectiveExtensions" not registered, but plugin
> > > "org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
> > > configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
> > > refers to it.
> > > 08:20:35,884 WARN  [DataNucleus.Plugin] - Extension Point
> > > "org.eclipse.ui.preferencePages" not registered, but plugin
> > > "org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
> > > configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
> > > refers to it.
> > > 08:20:35,884 WARN  [DataNucleus.Plugin] - Extension Point
> > > "org.eclipse.ui.preferencePages" not registered, but plugin
> > > "org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
> > > configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
> > > refers to it.
> > > 3 [main] WARN DataNucleus.Plugin  - Extension Point
> > > "org.eclipse.ui.preferencePages" not registered, but plugin
> > > "org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
> > > configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
> > > refers to it.
> > > 08:20:35,884 WARN  [DataNucleus.Plugin] - Extension Point
> > > "org.eclipse.ui.keywords" not registered, but plugin
> > > "org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
> > > configuration/org.eclip

[appengine-java] Re: ApiProxyLocalImpl.getService question [junit]

2009-09-22 Thread Pion

I just did the following on the Eclipse-Galileo:

o Click on the Eclipse menu bar "Windows -> Preferences -> General ->
Capabilitiies". I then enabled the "Class Update"
o Click on  the Eclipse menu bar "Help -> Software Update -> Manage
Configurations". I then expanded the plugins.
o There is no DataNucleus plugin installed.

I don't recall explicitly installing DataNucleus plugin unless GAE or
something else installed as part of their installations.

Also, I tried the following:
o Wrote a populate() method to populate my database (from scratch) in
regular environment (not using junit). It worked fine -- the database
was created.

o Called the same populate() method above in junit environment. It did
not create the database.

Thanks.


On Sep 22, 9:08 am, Toby Reyelts  wrote:
> Can you check and see if you have the Eclipse DataNucleus plugin installed?
> If so, can you try disabling it?
>
> On Tue, Sep 22, 2009 at 11:34 AM, Pion  wrote:
>
> > Thanks, Toby.
>
> > I have changed the code to
> >              FooServiceImpl server = new FooServiceImpl ();
>
> > Also, I changed the GWT servlet test method to
>
> >        public String unitTest() {
> >                PersistenceManager pm = PMF.get().getPersistenceManager();
> >                return "unitTest";
> >        }
>
> > I implemented/copied the TestEnvironment, LocalServiceTestCase and
> > LocalDatastoreTestCase classes mentioned on
> >http://code.google.com/appengine/docs/java/howto/unittesting.html.
>
> > Now, I receive the following DataNucleus.Plugin warning and error
> > messages below.
>
> > Again, thanks for your help.
>
> > 08:20:35,881 WARN  [DataNucleus.Plugin] - Extension Point
> > "org.eclipse.ui.views" not registered, but plugin
> > "org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
> > configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
> > refers to it.
> > 08:20:35,881 WARN  [DataNucleus.Plugin] - Extension Point
> > "org.eclipse.ui.views" not registered, but plugin
> > "org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
> > configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
> > refers to it.
> > 0 [main] WARN DataNucleus.Plugin  - Extension Point
> > "org.eclipse.ui.views" not registered, but plugin
> > "org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
> > configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
> > refers to it.
> > 08:20:35,883 WARN  [DataNucleus.Plugin] - Extension Point
> > "org.eclipse.ui.perspectiveExtensions" not registered, but plugin
> > "org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
> > configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
> > refers to it.
> > 08:20:35,883 WARN  [DataNucleus.Plugin] - Extension Point
> > "org.eclipse.ui.perspectiveExtensions" not registered, but plugin
> > "org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
> > configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
> > refers to it.
> > 2 [main] WARN DataNucleus.Plugin  - Extension Point
> > "org.eclipse.ui.perspectiveExtensions" not registered, but plugin
> > "org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
> > configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
> > refers to it.
> > 08:20:35,884 WARN  [DataNucleus.Plugin] - Extension Point
> > "org.eclipse.ui.preferencePages" not registered, but plugin
> > "org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
> > configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
> > refers to it.
> > 08:20:35,884 WARN  [DataNucleus.Plugin] - Extension Point
> > "org.eclipse.ui.preferencePages" not registered, but plugin
> > "org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
> > configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
> > refers to it.
> > 3 [main] WARN DataNucleus.Plugin  - Extension Point
> > "org.eclipse.ui.preferencePages" not registered, but plugin
> > "org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
> > configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
> > refers to it.
> > 08:20:35,884 WARN  [DataNucleus.Plugin] - Extension Point
> > "org.eclipse.ui.keywords" not registered, but plugin
> > "org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
> > configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
> > refers to it.
> > 08:20:35,884 WARN  [DataNucleus.Plugin] - Extension Point
> > "org.eclipse.ui.keywords" not registered, but plugin
> > "org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
> > configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
> > refers to it.
> > 3 [main] WARN DataNucleus.Plugin  - Extension Point
> > "org.eclipse.ui.keywords" not registered, but plugin
> > "org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
> > configuration/org.eclipse.os

[appengine-java] Re: ApiProxyLocalImpl.getService question [junit]

2009-09-22 Thread Pion

Thanks, Toby.

I have changed the code to
  FooServiceImpl server = new FooServiceImpl ();

Also, I changed the GWT servlet test method to

public String unitTest() {
PersistenceManager pm = PMF.get().getPersistenceManager();
return "unitTest";
}

I implemented/copied the TestEnvironment, LocalServiceTestCase and
LocalDatastoreTestCase classes mentioned on
http://code.google.com/appengine/docs/java/howto/unittesting.html.

Now, I receive the following DataNucleus.Plugin warning and error
messages below.

Again, thanks for your help.

08:20:35,881 WARN  [DataNucleus.Plugin] - Extension Point
"org.eclipse.ui.views" not registered, but plugin
"org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
refers to it.
08:20:35,881 WARN  [DataNucleus.Plugin] - Extension Point
"org.eclipse.ui.views" not registered, but plugin
"org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
refers to it.
0 [main] WARN DataNucleus.Plugin  - Extension Point
"org.eclipse.ui.views" not registered, but plugin
"org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
refers to it.
08:20:35,883 WARN  [DataNucleus.Plugin] - Extension Point
"org.eclipse.ui.perspectiveExtensions" not registered, but plugin
"org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
refers to it.
08:20:35,883 WARN  [DataNucleus.Plugin] - Extension Point
"org.eclipse.ui.perspectiveExtensions" not registered, but plugin
"org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
refers to it.
2 [main] WARN DataNucleus.Plugin  - Extension Point
"org.eclipse.ui.perspectiveExtensions" not registered, but plugin
"org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
refers to it.
08:20:35,884 WARN  [DataNucleus.Plugin] - Extension Point
"org.eclipse.ui.preferencePages" not registered, but plugin
"org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
refers to it.
08:20:35,884 WARN  [DataNucleus.Plugin] - Extension Point
"org.eclipse.ui.preferencePages" not registered, but plugin
"org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
refers to it.
3 [main] WARN DataNucleus.Plugin  - Extension Point
"org.eclipse.ui.preferencePages" not registered, but plugin
"org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
refers to it.
08:20:35,884 WARN  [DataNucleus.Plugin] - Extension Point
"org.eclipse.ui.keywords" not registered, but plugin
"org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
refers to it.
08:20:35,884 WARN  [DataNucleus.Plugin] - Extension Point
"org.eclipse.ui.keywords" not registered, but plugin
"org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
refers to it.
3 [main] WARN DataNucleus.Plugin  - Extension Point
"org.eclipse.ui.keywords" not registered, but plugin
"org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-galileo/
configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/MANIFEST.MF
refers to it.
08:20:35,884 WARN  [DataNucleus.Plugin] - Extension Point
"org.eclipse.debug.core.launchConfigurationTypes" not registered, but
plugin "org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-
galileo/configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/
MANIFEST.MF refers to it.
08:20:35,884 WARN  [DataNucleus.Plugin] - Extension Point
"org.eclipse.debug.core.launchConfigurationTypes" not registered, but
plugin "org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-
galileo/configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/
MANIFEST.MF refers to it.
3 [main] WARN DataNucleus.Plugin  - Extension Point
"org.eclipse.debug.core.launchConfigurationTypes" not registered, but
plugin "org.eclipse.jdt.junit" defined in file:/D:/download/eclipse-
galileo/configuration/org.eclipse.osgi/bundles/308/1/.cp/META-INF/
MANIFEST.MF refers to it.
08:20:35,885 WARN  [DataNucleus.Plugin] - Extension Point
"org.eclipse.debug.core.launchConfigurationComparators" not
registered, but plugin "org.eclipse.jdt.junit" defined in file:/D:/
download/eclipse-galileo/configuration/org.eclipse.osgi/bundles/
308/1/.cp/META-INF/MANIFEST.MF refers to it.
08:20:35,885 WARN  [DataNucleus

[appengine-java] Re: ApiProxyLocalImpl.getService question [junit]

2009-09-22 Thread Toby Reyelts
ApiProxy gives you access to the dev_appserver's internal interfaces for the
services that Google provides, such as mail, urlfetch, memcache, xmpp,
etc... ApiProxy is entirely unrelated to GWT RemoteServiceServlets, which is
what your code is trying to use it for.
You only need to use our internal dev_appserver interfaces if you
specifically need to do something with the services that isn't supported on
prod via the standard interfaces. For example, in the page you referenced,
the code clears all record of sent messages:

mailService.clearSentMessages();


That capability makes no sense in production, but it is very useful for
testing locally.


On Tue, Sep 22, 2009 at 10:35 AM, Pion  wrote:

>
> This line fails:
>
>   FooServiceImpl server =  (FooServiceImpl ) proxy.getService
> ("com.foo.server");
>
> The server is null.
>
> On Sep 21, 6:48 pm, Pion  wrote:
> > I have the following server side code:
> >
> > package com.foo.server;
> > // code deleted for brevity
> > /**
> >  * The server side implementation of the RPC service.
> >  */
> > @SuppressWarnings("serial")
> > public class FooServiceImpl extends RemoteServiceServlet
> implements
> > FooService {
> > // code deleted for brevity
> > @Override
> > public String barTest() {
> > return "unitTest";
> > }
> > } // FooServiceImpl
> >
> > I copied/implemented the TestEnvironment and LocalServiceTestCase
> > classes as shown onhttp://
> code.google.com/appengine/docs/java/howto/unittesting.html.
> >
> > Then, I implemented the following:
> > public class ServerTest extends LocalServiceTestCase {
> >
> > ApiProxyLocalImpl proxy = (ApiProxyLocalImpl)
> > ApiProxy.getDelegate();
> > FooServiceImpl server =  (FooServiceImpl ) proxy.getService
> > ("com.foo.server");
> >
> > String result = barTest();  // produces
> > java.lang.NullPointerException
> > assertEquals("unitTest", result);
> >
> > } // ServerTest
> >
> > I got the java.lang.NullPointerException on this line "String result =
> > barTest();"
> >
> > My environments: GAE 1.25, GWT 1.7, Eclipse-Galileo on Windows Vista.
> >
> > I am new on this. What did I do wrong?
> >
> > Thanks in advance for your help.
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: ApiProxyLocalImpl.getService question [junit]

2009-09-22 Thread Pion

This line fails:

   FooServiceImpl server =  (FooServiceImpl ) proxy.getService
("com.foo.server");

The server is null.

On Sep 21, 6:48 pm, Pion  wrote:
> I have the following server side code:
>
>         package com.foo.server;
>         // code deleted for brevity
>         /**
>          * The server side implementation of the RPC service.
>          */
>         @SuppressWarnings("serial")
>         public class FooServiceImpl extends RemoteServiceServlet implements
> FooService {
>         // code deleted for brevity
>                 @Override
>                 public String barTest() {
>                         return "unitTest";
>                 }
>         } // FooServiceImpl
>
> I copied/implemented the TestEnvironment and LocalServiceTestCase
> classes as shown 
> onhttp://code.google.com/appengine/docs/java/howto/unittesting.html.
>
> Then, I implemented the following:
>         public class ServerTest extends LocalServiceTestCase {
>
>         ApiProxyLocalImpl proxy = (ApiProxyLocalImpl)
> ApiProxy.getDelegate();
>         FooServiceImpl server =  (FooServiceImpl ) proxy.getService
> ("com.foo.server");
>
>         String result = barTest();                      // produces
> java.lang.NullPointerException
>         assertEquals("unitTest", result);
>
>         } // ServerTest
>
> I got the java.lang.NullPointerException on this line "String result =
> barTest();"
>
> My environments: GAE 1.25, GWT 1.7, Eclipse-Galileo on Windows Vista.
>
> I am new on this. What did I do wrong?
>
> Thanks in advance for your help.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---