<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace">Adding devel list, which was dropped by mistake.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 10, 2015 at 1:56 PM, Allon Mureinik <span dir="ltr"><<a href="mailto:amureini@redhat.com" target="_blank">amureini@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Wed, Dec 9, 2015 at 6:51 PM, Vojtech Szocs <span dir="ltr"><<a href="mailto:vszocs@redhat.com" target="_blank">vszocs@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Allon,<br>
<br>
not sure if you saw my email (below) but I was wondering<br>
what's your opinion about test method naming conventions.<br></blockquote></span><div><div class="gmail_default" style="font-family:monospace,monospace;display:inline">Generally agree with that, and I tried excluding them where possible - if I missed any, please say so.</div></div><span class=""><div><div class="gmail_default" style="font-family:monospace,monospace;display:inline"></div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Also, regarding patch <a href="https://gerrit.ovirt.org/#/c/49910/" rel="noreferrer" target="_blank">https://gerrit.ovirt.org/#/c/49910/</a><br>
why not simply exclude all Java files under src/test/java<br>
for all projects? (What's the advantage of having per-file<br>
exclude list of test classes?)<br></blockquote></span><div><div class="gmail_default" style="font-family:monospace,monospace;display:inline">I hat overly-broad exclusions.</div></div><div><div class="gmail_default" style="font-family:monospace,monospace;display:inline">There are a ton of badly named method in test classes, and I don't want to encourage any more.</div></div><div><div class="gmail_default" style="font-family:monospace,monospace;display:inline">Although if you think this is getting out of hand, we could just do that...</div></div><span class=""><div><div class="gmail_default" style="font-family:monospace,monospace;display:inline"></div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
To address other files, like "Other GWT-related classes"<br>
in [1] -- did you consider adding some source-level Java<br>
annotation like @DontCheckMethodNames or similar? (Again,<br>
avoid per-file exclude list of other classes.)<br></blockquote></span><div><div class="gmail_default" style="font-family:monospace,monospace">Yeah, but I don't want to have to write my own checker - this is a standard checkstyle check...</div></div><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
[1] <a href="https://gerrit.ovirt.org/#/c/49910/4/build-tools-root/checkstyles/src/main/resources/checkstyle-suppressions.xml" rel="noreferrer" target="_blank">https://gerrit.ovirt.org/#/c/49910/4/build-tools-root/checkstyles/src/main/resources/checkstyle-suppressions.xml</a><br>
<br>
Thanks,<br>
Vojtech<br>
<div><div><br>
<br>
----- Forwarded Message -----<br>
From: "Vojtech Szocs" <<a href="mailto:vszocs@redhat.com" target="_blank">vszocs@redhat.com</a>><br>
To: "devel" <<a href="mailto:devel@ovirt.org" target="_blank">devel@ovirt.org</a>><br>
Sent: Monday, December 7, 2015 8:00:36 PM<br>
Subject: [ovirt-devel] Question about <a href="https://gerrit.ovirt.org/#/c/49860/" rel="noreferrer" target="_blank">https://gerrit.ovirt.org/#/c/49860/</a><br>
<br>
Hi Allon!<br>
<br>
patch in $subject modifies test method name from:<br>
<br>
testGetLocaleFromStringString_withDefault<br>
<br>
to:<br>
<br>
testGetLocaleFromStringStringWithDefault<br>
<br>
I've always thought that Java test method names should be<br>
as much readable as possible, because in Java tests, the<br>
method name is used to describe the particular test case.<br>
<br>
(Unfortunately, Java test frameworks don't do a good job<br>
in this area.. please correct me if I'm wrong.)<br>
<br>
So with JS/Jasmine we can do this:<br>
<br>
describe('LocaleUtils', function () {<br>
it('should extract locale from given String', function () {<br>
// actual test code<br>
});<br>
});<br>
<br>
but in Java we usually do this:<br>
<br>
// <methodName>_<extraInfoForSpecificTestCase><br>
void testGetLocaleFromStringString_withDefault<br>
<br>
which is already far from readable, and this:<br>
<br>
testGetLocaleFromStringStringWithDefault<br>
<br>
makes it even worse.. Even though it complies with Java<br>
method naming convention, it totally obfuscates what is<br>
that particular test case about, which means people who<br>
want to maintain such tests need to spend time studying<br>
what the test is actually doing..<br>
<br>
What's your take on this?<br>
<br>
Regards,<br>
Vojtech<br>
</div></div>_______________________________________________<br>
Devel mailing list<br>
<a href="mailto:Devel@ovirt.org" target="_blank">Devel@ovirt.org</a><br>
<a href="http://lists.ovirt.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.ovirt.org/mailman/listinfo/devel</a><br>
</blockquote></div></div></div><br></div></div>
</blockquote></div><br></div>