harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Zhang" <zhanghuang...@gmail.com>
Subject Re: [vote][p-unit] Are there any objections of using the tool?
Date Fri, 29 Jun 2007 00:36:18 GMT
Hi Alexei,

Thanks a lot for your comments! Please see my answers inline. Thanks!

On 6/28/07, Alexei Fedotov <alexei.fedotov@gmail.com> wrote:
>
> Andrew,
>
> From licensing point of view I believe the rest be ok. All other
> dependencies has LGPL license so we may continue using PDF reports for
> Harmony.


That's great!

>From technical point of view I'm still looking into the code. Here is
> a small proof: I found that runner variable in private
> AbstractChartReporter.consumeChildData() is unused.


Sorry, I can't find it?  I also think the core codebase should be zero
warning. There's no warning here.

I'm now thinking of a specific watcher for GC stress tests which would
> be called HeapUtilizationWatcher which isn't much different from your
> memory watcher. I have a solid intention to use p-unit, though it
> would take some time for me to adopt it. I will try to speed up a bit.


I hope you will find it easy to adopt it. :) That's my  original goal, very
easy for anyone who is familiar with java unit test.  :)

P.S.
> The bug about JUnitAnnotationTestClass is verified. Thanks!
>
> P.P.S.
> I have not worked much with localization before, and I don't think it
> is of any priority for now. Anyway, I've got few comments about this
> and it is up to you if they worth to be considered. I find it more
> convenient to see something like reporter.overview instead of
> reporter.02 for localized string keys. If this is automatically
> generated staff, we probably need to patch Eclipse itself. :-) Also,
> the NON-NLS-1 comment in the following lines is confusing. I thought
> the comment is suited for cases when one doesn't use
> Messages.getString()

punit/src/org/punit/assertion/Assert.java:                      fail(
> Messages.getString("Assert.2")
> + expected); //$NON-NLS-1$


It's generated by eclipse. I think $NON-NLS-1$ here is for "Assert.2".
The convention is very similar as Harmony. :)

I'd like to adopt one convention. :) But personally, I also like the key to
be meaningful.
Or maybe anyone can tell me the adavantage of using auto-generated key?

P.S About the fork seperate jvm and timeout - I think we can do that in ant?

Thanks again for your comments!

punit/src/org/punit/assertion/Assert.java:              fail(
> Messages.getString("Assert.0")
> + expected + Messages.getString("Assert.1") + actual); //$NON-NLS-1$
> //$NON-NLS-2$
> punit/src/org/punit/reporter/stream/StreamLogger.java:          sb.append(
> Messages.getString("logger.01"));
> //$NON-NLS-1$
> punit/src/org/punit/reporter/stream/StreamLogger.java:          sb.append(
> Messages.getString("logger.02"));
> //$NON-NLS-1$
> punit/src/org/punit/reporter/stream/StreamLogger.java:          sb.append(
> Messages.getString("logger.03"));
> //$NON-NLS-1$
> punit/src/org/punit/reporter/stream/StreamLogger.java:
> sb.append(Messages.getString("logger.04"));
> //$NON-NLS-1$
> punit/src/org/punit/reporter/stream/StreamLogger.java:
> sb.append(Messages.getString("logger.05"));
> //$NON-NLS-1$
> punit/src/org/punit/reporter/stream/StreamLogger.java:          sb.append(
> Messages.getString("logger.06"));
> //$NON-NLS-1$
> punit/src/org/punit/runner/ConcurrentRunner.java:               return
> Messages.getString("runner.03"); //$NON-NLS-1$
> punit/src/org/punit/runner/SoloRunner.java:             return
> Messages.getString("runner.01"); //$NON-NLS-1$
> punit/src/org/punit/util/RunnerUtil.java:                       throw new
> IllegalArgumentException(Messages.getString("runner.05"));
> //$NON-NLS-1$
> punit/src/org/punit/watcher/MemoryWatcher.java:         return
> Messages.getString("watcher.03"); //$NON-NLS-1$
> punit/src/org/punit/watcher/MemoryWatcher.java:         return
> Messages.getString("watcher.01"); //$NON-NLS-1$
> punit/src/org/punit/watcher/TimeWatcher.java:           return
> Messages.getString("watcher.04"); //$NON-NLS-1$
> punit/src/org/punit/watcher/TimeWatcher.java:           return
> Messages.getString("watcher.02"); //$NON-NLS-1$
> punit.extension
> /src/org/punit/reporter/chart/AbstractChartReporter.java:
> sb.append(Messages.getString("reporter.01"));
> //$NON-NLS-1$
> punit.extension/src/org/punit/reporter/chart/OverviewReporter.java:
> return
> Messages.getString("reporter.02"); //$NON-NLS-1$
> punit.extension
> /src/org/punit/reporter/chart/pdf/PDFRender.java:
> paragraph.add(new
> Chunk(Messages.getString("PDFRender.01"), PDFConstants.H1_FONT));
> //$NON-NLS-1$
> punit.extension
> /src/org/punit/reporter/chart/pdf/PDFRender.java:
> paragraph.add(new
> Chunk(Messages.getString("PDFRender.02"),
> PDFConstants.H1_FONT));//$NON-NLS-1$
>
> On 6/28/07, Andrew Zhang <zhanghuangzhu@gmail.com> wrote:
> > Hi All,
> >
> > Any feedback on Loop test framework? I'm going to release p-unit soon
> under
> > AL2.0.
> >
> > Thanks!
> >
> > On 6/26/07, Alexei Fedotov <alexei.fedotov@gmail.com> wrote:
> > >
> > > All,
> > >
> > > I'm thinking of taking advantage of p-unit.I found this tool coded
> > > with good skill and enthusiasm, so it's a good opportunity for both
> > > projects to join efforts.
> > >
> > > Both copyright holders are our committers, and the tool is to be
> > > re-licensed under AL 2.0 license. Please drop a mail to this thread if
> > > you see any objections for establishing a dependency from this tool.
> > >
> > > Thanks.
> > >
> > > On 6/26/07, Andrew Zhang <zhanghuangzhu@gmail.com> wrote:
> > > > On 6/26/07, Alexei Fedotov <alexei.fedotov@gmail.com> wrote:
> > > > >
> > > > > Andrew,
> > > > >
> > > > > That's great. You are really quick. I was still thinking when your
> > > > > solution came up. I was able to build the project and run tests
> one by
> > > > > one, though I wasn't able to use the perfect Eclipse plugin for
> JUnit
> > > > > tests. Probably it could make sense to use just an ordinary junit
> for
> > > > > testing p-unit itself.
> > > > >
> > > > > 1. I've just realized that I cannot link stress tests with p-unit
> > > > > while it is GPLed. So it's better to change a license. GPL with
> > > > > exception is ok, but it's safer to have BSD-like license. Actually
> > > > > this is the only comment which prevents me from using punit, all
> > > > > others are mostly for better understanding of your concept.
> > > >
> > > >
> > > > Hi Alexei,
> > > >
> > > > No problem. I'll change the license for the next release!
> > > >
> > > > AL2.0 should be safe, right?
> > > >
> > > > 2. Do you think "toStop" and "toAbort" from my requirements are the
> > > > > best terms? We can change them until there is not too much code
> > > > > developed. A typical use case is the following. I give a test a
> fair
> > > > > time to loop (= first timer) and a small type to stop gracefully
> (=
> > > > > second timer). The variant named them "toWork", "toAbort". Another
> > > > > variant which comes to my mind is "toLoop", "toStop". What do you
> > > > > think?
> > > >
> > > > 3. What do you think of using junit.extensions.TestDecorator for
> > > > > building complex tests on the top of the primitive ones?
> > > >
> > > >
> > > >
> > > > I must miss something here. For which  scenario(Loop or
> Concurrent?), do
> > > we
> > > > need toAbort? As my understanding, tearDown will stop the test case
> > > > gracefully. Do we need this special setting? (But I saw the same
> > > requirement
> > > > before, because the user's logic code is dependent of timestamp, and
> the
> > > > test runner have to be slow enough to run it concurrently :) )
> > > >
> > > > Thanks!
> > > >
> > > >
> > > > On 6/25/07, Andrew Zhang <zhanghuangzhu@gmail.com> wrote:
> > > > > > On 6/22/07, Alexei Fedotov <alexei.fedotov@gmail.com>
wrote:
> > > > > > >
> > > > > > > Andrew,
> > > > > > > Thanks for your explanations.
> > > > > > >
> > > > > > > Let me address the main problem I see to migrate a stress
test
> > > suite
> > > > > > > to p-unit. To which extend may I count on your support
at
> further
> > > > > > > p-unit development? I listed very specific functionality
which
> > > > > > > probably didn't suite well your original idea.
> > > > > >
> > > > > >
> > > > > > Hi Alexei,
> > > > > >
> > > > > > Would you please check the latest sample code
> samples.LoopTestSamplein
> > > > > > punit.sample project? Is it the same as the original idea of
> toStop,
> > > > > > toAbort? Thanks!
> > > > > >
> > > > > > On 6/22/07, Andrew Zhang <zhanghuangzhu@gmail.com> wrote:
> > > > > > > > On 6/22/07, Alexei Fedotov <alexei.fedotov@gmail.com>
wrote:
> > > > > > > > >
> > > > > > > > > Andrew,
> > > > > > > > > This is very interesting. Thank you for the reference.
> > > > > > > >
> > > > > > > >
> > > > > > > > Hi Alexei,  please see my comments inline
> > > > > > > >
> > > > > > > > I've got few questions trying to understand your framework.
> > > > > > > > > 1. Why an interface Watcher extends Serializable?
> > > > > > > >
> > > > > > > >
> > > > > > > > Because it's for performance comparison between different
> vms.
> > > The
> > > > > > > runner
> > > > > > > > will be serialized, so that the vm can load the right
> runner.
> > > You
> > > > > can
> > > > > > > > consider it like serializing the configuration for
the vm.
> > > > > > > >
> > > > > > > > 2. Is there any project which uses p-unit for testing?
Why
> have
> > > you
> > > > > > > started
> > > > > > > > > it?
> > > > > > > >
> > > > > > > >
> > > > > > > > Polepos (https://sourceforge.net/projects/polepos)
is going
> to
> > > > > refactor
> > > > > > > its
> > > > > > > > code to use p-unit.
> > > > > > > >
> > > > > > > > And I know serveral community members use p-unit to
test
> > > concurrency
> > > > > > > > performance(by running the existing JUnit tests).
> > > > > > > >
> > > > > > > > I started it because I found that I can't do something
as I
> want
> > > > > with
> > > > > > > JUnit,
> > > > > > > > :) like concurrency, performance test. Why do I have
to
> start
> > > > > thread,
> > > > > > > and
> > > > > > > > join, and check the result at the end of join everytime?
why
> do
> > > I
> > > > > need
> > > > > > > to
> > > > > > > > use System.currentMilliseconds and sysout... :)  So
I wrote
> > > p-unit.
> > > > > > > >
> > > > > > > > 3. Running tests in several VM is great, but how could
I
> compare
> > > > > these
> > > > > > > > > results?
> > > > > > > >
> > > > > > > >
> > > > > > > > There're serveral build-in reports in p-unit. The
most
> > > > > straightforward
> > > > > > > one
> > > > > > > > is pdf format, which contains performance chart. The
results
> of
> > > > > > > different vm
> > > > > > > > for the same method are shown in the same page, so
that you
> can
> > > know
> > > > > > > which
> > > > > > > > one is better easily. It's also easy to plugin your
own
> report
> > > by
> > > > > > > > implementing  PUnitEventListener.
> > > > > > > >
> > > > > > > > 4. If I need to increase a parameter until the test
fails
> and
> > > then
> > > > > > > > > report the final value as a test performance
metrics how
> this
> > > > > should
> > > > > > > > > be done in p-unit?
> > > > > > > >
> > > > > > > >
> > > > > > > > hm... this functionality is not supported in p-unit....
> > > > > > > >
> > > > > > > > Thanks!
> > > > > > > >
> > > > > > > > On 6/22/07, Andrew Zhang <zhanghuangzhu@gmail.com>
wrote:
> > > > > > > > > > On 6/21/07, Alexei Fedotov <alexei.fedotov@gmail.com>
> wrote:
> > > > > > > > > > >
> > > > > > > > > > > Hello Vladimir,
> > > > > > > > > > >
> > > > > > > > > > > Could yout please give few hints how
one should write
> > > > > performance
> > > > > > > > > > > tests using the harness? I found an
option
> "-performance"
> > > but
> > > > > > > cannot
> > > > > > > > > > > see anything else. I wonder how a testcase
could
> report a
> > > > > > > performance
> > > > > > > > > > > metrics.
> > > > > > > > > > >
> > > > > > > > > > > Actually I'm thinking now of reviving
comparative
> stress
> > > > > testing
> > > > > > > > > approach.
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > Hi Alexei,
> > > > > > > > > >
> > > > > > > > > > Do you have a chance to look at p-unit,
(
> > > > > > > http://p-unit.sourceforge.net/
> > > > > > > > > )?
> > > > > > > > > >
> > > > > > > > > > I think it fulfills most of the requests
listed in the
> > > > > documents.
> > > > > > > > > >
> > > > > > > > > > Another advantage of p-unit is that it can
compare the
> > > > > performance
> > > > > > > > > between
> > > > > > > > > > different vms.
> > > > > > > > > >
> > > > > > > > > > One problem may be the license (GPL now,
going to change
> the
> > > > > license
> > > > > > > to
> > > > > > > > > GPL
> > > > > > > > > > v3). If we really take it serious, I can
relicense it
> > > > > immediately.
> > > > > > > > > >
> > > > > > > > > > [1]
> > > > > > > > > > >
> > > > > > > > >
> > > > > > >
> > > > >
> > >
> http://mail-archives.apache.org/mod_mbox/harmony-dev/200605.mbox/%3C6694B22B6436BC43B429958787E4549802012354@mssmsx402nb%3E
> > > > > > > > > > >
> > > > > > > > > > > --
> > > > > > > > > > > With best regards,
> > > > > > > > > > > Alexei,
> > > > > > > > > > > ESSD, Intel
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > Best regards,
> > > > > > > > > > Andrew Zhang
> > > > > > > > > >
> > > > > > > > > > http://zhanghuangzhu.blogspot.com/
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > With best regards,
> > > > > > > > > Alexei,
> > > > > > > > > ESSD, Intel
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > Best regards,
> > > > > > > > Andrew Zhang
> > > > > > > >
> > > > > > > > http://zhanghuangzhu.blogspot.com/
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > With best regards,
> > > > > > > Alexei,
> > > > > > > ESSD, Intel
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Best regards,
> > > > > > Andrew Zhang
> > > > > >
> > > > > > http://zhanghuangzhu.blogspot.com/
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > With best regards,
> > > > > Alexei,
> > > > > ESSD, Intel
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Best regards,
> > > > Andrew Zhang
> > > >
> > > > http://zhanghuangzhu.blogspot.com/
> > > >
> > >
> > >
> > > --
> > > With best regards,
> > > Alexei,
> > > ESSD, Intel
> > >
> >
> >
> >
> > --
> > Best regards,
> > Andrew Zhang
> >
> > http://zhanghuangzhu.blogspot.com/
> >
>
>
> --
> With best regards,
> Alexei,
> ESSD, Intel
>



-- 
Best regards,
Andrew Zhang

http://zhanghuangzhu.blogspot.com/

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message