persistence@glassfish.java.net

Re: Misleading log output of entity-persistence-tests

From: Wonseok Kim <guruwons_at_gmail.com>
Date: Thu, 23 Nov 2006 22:05:35 +0900

Hi Michael,
Good idea! Go ahead and check in unless others show another concern.

Still I could see more detail logs in console if I want to debug by
modifying the level in persistence.xml. This is good. But I'm curious why
the standard out logging messages are not kept in testresults.txt and are
shown only in console. Is it my own problem?

Regards,
-Wonseok

On 11/23/06, Michael Bouschen <Michael.Bouschen_at_sun.com> wrote:
>
> Hi Wonseok,
>
> good catch!
>
> I looked at this issue yesterday and found the same places where the
> logging should be set to OFF: the "isolated1053" PU and the
> ddl-generation-testmodel PU. I like to propose two additional changes:
> (1) build.xml
> The build.xml specifies a system property -Dtoplink.logging.level=FINEST
> when calling the junit task. The system property specifies the default
> setting of toplink.logging.level used if there is no explicit setting in
> the PU. This is the reason why we see the FINEST logging in case the PU
> does not set this property. I propose to set the system property to
> INFO. Then the logging output from the javaSECMPInitializer disappears.
> (2) EntityMappingsMergeInheritedJUnitTestCase.java
> There are two System.out.println calls in the test case
> EntityMappingsMergeInheritedJUnitTestCase. I propose to remove them.
>
> Attached you find a patch file fix1564-061123.patch with my changes. It
> includes changes of the two persistence.xml files plus the changes
> described in (1) and (2). You can apply the changes to your workspace by
> running the patch command, e.g.
> % cd entity-persistence-tests
> % patch -p0 < fix1564-061123.patch
>
> Please have a look and let me now whether you like to do the check in or
> whether I should do so. I'm not sure whether we can check in right now.
> The glassfish repository has been closed according to Dinesh's message
> sent to the glassfish dev alias (subject "IMPORTANT: GlassFish
> v2/Appserver 9.1 M3 Feature Freeze date moved to 11/21/2006").
>
> Regards Michael
>
>
> > One more,
> > Still many FINE level messages are printed out due to "isolated1053"
> > PU in config/META-INF/persistence.xml.
> > I think it also should have OFF logging level by default as others.
> > Then, I can see more clean output.
> >
> > Please let me know if there is any concern.
> > Cheers,
> > -Wonseok
> >
> > On 11/23/06, *Wonseok Kim* <guruwons_at_gmail.com
> > <mailto:guruwons_at_gmail.com>> wrote:
> >
> > Hi All,
> >
> > I would like to make the logging level of ddl-generation model OFF
> > as I commented in the following issue.
> > If there is no concern, I will check it in soon.
> >
> > -Wonseok
> >
> > https://glassfish.dev.java.net/issues/show_bug.cgi?id=1564
> >
> > /------- Additional comments from guruwons
> > <mailto:guruwons_at_dev.java.net> Thu Nov 23 04:01:45 +0000 2006
> -------/
> >
> > Most of logging messages (including warning) comes from
> ddl-generation model. I
> > think the logging level of the model should be OFF by default as
> other models
> > like below.
> >
> >
> entity-persistence-tests/config/ddl-generation-testmodel/META-INF/persistence.xml
> >
> >
> >
> > <property name="toplink.logging.level" value="OFF"/>
> >
> > By the way, I'm curious why the logging output from console and
> testresult.txt
> > are different a little.
> >
> >
> >
>
>
>
> Index: build.xml
> ===================================================================
> RCS file: /cvs/glassfish/entity-persistence-tests/build.xml,v
> retrieving revision 1.12
> diff -c -r1.12 build.xml
> *** build.xml 7 Nov 2006 20:36:12 -0000 1.12
> --- build.xml 23 Nov 2006 10:41:27 -0000
> ***************
> *** 198,204 ****
> <target name="test" depends="init">
> <junit printsummary="yes" haltonfailure="yes" failureproperty="
> junit.failed" fork="yes" showoutput="true">
> <jvmarg value="-javaagent:${entity-persistence-agent.jar}"/>
> ! <jvmarg value="-Dtoplink.logging.level=FINEST"/>
> <classpath>
> <path refid="junit.classpath"/>
> </classpath>
> --- 198,204 ----
> <target name="test" depends="init">
> <junit printsummary="yes" haltonfailure="yes" failureproperty="
> junit.failed" fork="yes" showoutput="true">
> <jvmarg value="-javaagent:${entity-persistence-agent.jar}"/>
> ! <jvmarg value="-Dtoplink.logging.level=INFO"/>
> <classpath>
> <path refid="junit.classpath"/>
> </classpath>
> Index: config/META-INF/persistence.xml
> ===================================================================
> RCS file:
> /cvs/glassfish/entity-persistence-tests/config/META-INF/persistence.xml,v
> retrieving revision 1.26
> diff -c -r1.26 persistence.xml
> *** config/META-INF/persistence.xml 27 Oct 2006 20:49:16 -0000
> 1.26
> --- config/META-INF/persistence.xml 23 Nov 2006 10:41:27 -0000
> ***************
> *** 85,90 ****
> --- 85,91 ----
> <property name="toplink.jdbc.user"
> value="TEST_DATABASE_USER"/>
> <property name="toplink.jdbc.password"
> value="TEST_DATABASE_PASSWORD"/>
> <property name="toplink.cache.shared.default"
> value="false"/>
> + <property name="toplink.logging.level" value="OFF"/>
> </properties>
> </persistence-unit>
> </persistence>
> Index: config/ddl-generation-testmodel/META-INF/persistence.xml
> ===================================================================
> RCS file:
> /cvs/glassfish/entity-persistence-tests/config/ddl-generation-testmodel/META-INF/persistence.xml,v
> retrieving revision 1.5
> diff -c -r1.5 persistence.xml
> *** config/ddl-generation-testmodel/META-INF/persistence.xml 7 Nov 2006
> 20:36:12 -0000 1.5
> --- config/ddl-generation-testmodel/META-INF/persistence.xml 23 Nov
> 2006 10:41:27 -0000
> ***************
> *** 27,33 ****
> <property name="toplink.cache.size.default" value="500"/>
> <property name="toplink.cache.type.default" value="Full"/>
> <property name="toplink.session.customizer" value="
> oracle.toplink.essentials.testing.models.cmp3.advanced.Customizer"/>
> ! <!--property name="toplink.logging.level" value="FINEST"/-->
> <property name="toplink.orm.throw.exceptions" value="true"/>
> <property name="toplink.ddl-generation"
> value="drop-and-create-tables"/>
> <property name="toplink.create-ddl-jdbc-file-name"
> value="createDDL_ddlGeneration.jdbc"/>
> --- 27,33 ----
> <property name="toplink.cache.size.default" value="500"/>
> <property name="toplink.cache.type.default" value="Full"/>
> <property name="toplink.session.customizer" value="
> oracle.toplink.essentials.testing.models.cmp3.advanced.Customizer"/>
> ! <property name="toplink.logging.level" value="OFF"/>
> <property name="toplink.orm.throw.exceptions" value="true"/>
> <property name="toplink.ddl-generation"
> value="drop-and-create-tables"/>
> <property name="toplink.create-ddl-jdbc-file-name"
> value="createDDL_ddlGeneration.jdbc"/>
> Index:
> src/java/oracle/toplink/essentials/testing/tests/cmp3/xml/merge/inherited/EntityMappingsMergeInheritedJUnitTestCase.java
> ===================================================================
> RCS file:
> /cvs/glassfish/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/tests/cmp3/xml/merge/inherited/EntityMappingsMergeInheritedJUnitTestCase.java,v
> retrieving revision 1.3
> diff -c -r1.3 EntityMappingsMergeInheritedJUnitTestCase.java
> ***
> src/java/oracle/toplink/essentials/testing/tests/cmp3/xml/merge/inherited/EntityMappingsMergeInheritedJUnitTestCase.java 6
> Nov 2006 20:57:39 -0000 1.3
> ---
> src/java/oracle/toplink/essentials/testing/tests/cmp3/xml/merge/inherited/EntityMappingsMergeInheritedJUnitTestCase.java 23
> Nov 2006 10:41:28 -0000
> ***************
> *** 323,330 ****
> throw ex;
> }
>
> - System.out.println
> ("listenerPostPersistCount="+listenerPostPersistCount);
> - System.out.println("BeerListener.POST_PERSIST_COUNT=
> "+BeerListener.POST_PERSIST_COUNT);
> assertFalse("The listener callback method [PostPersist] was not
> called.", listenerPostPersistCount == BeerListener.POST_PERSIST_COUNT);
> }
>
> --- 323,328 ----
>
>
>