You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sebb <se...@gmail.com> on 2013/03/18 22:14:42 UTC

Re: svn commit: r1457788 - in /commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils: ./ mime/ mime/MimeUtilityTestCase.java

On 18 March 2013 14:56,  <si...@apache.org> wrote:
> Author: simonetripodi
> Date: Mon Mar 18 14:56:34 2013
> New Revision: 1457788
>
> URL: http://svn.apache.org/r1457788
> Log:
> [FILEUPLOAD-232] started importing MimeUtility test case from http://svn.apache.org/repos/asf/geronimo/specs/tags/geronimo-javamail_1.4_spec-1.4/src/test/java/javax/mail/internet/MimeUtilityTest.java
>
> Added:
>     commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/
>     commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/
>     commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java   (with props)
>
> Added: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java
> URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java?rev=1457788&view=auto
> ==============================================================================
> --- commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java (added)
> +++ commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java Mon Mar 18 14:56:34 2013
> @@ -0,0 +1,42 @@
> +/*
> + * Licensed to the Apache Software Foundation (ASF) under one or more
> + * contributor license agreements.  See the NOTICE file distributed with
> + * this work for additional information regarding copyright ownership.
> + * The ASF licenses this file to You under the Apache License, Version 2.0
> + * (the "License"); you may not use this file except in compliance with
> + * the License.  You may obtain a copy of the License at
> + *
> + *      http://www.apache.org/licenses/LICENSE-2.0
> + *
> + * Unless required by applicable law or agreed to in writing, software
> + * distributed under the License is distributed on an "AS IS" BASIS,
> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> + * See the License for the specific language governing permissions and
> + * limitations under the License.
> + */
> +package org.apache.commons.fileupload.utils.mime;
> +
> +import static org.junit.Assert.assertEquals;
> +
> +import org.apache.commons.fileupload.util.mime.MimeUtility;
> +import org.junit.Test;
> +
> +/**
> + * @since 1.3
> + */
> +public final class MimeUtilityTestCase {
> +
> +    @Test
> +    public void testEncodeText() throws Exception {
> +        assertEncoded("abc", "abc");
> +
> +        assertEncoded(" hé! àèôu !!!", "=?UTF-8?Q?_h=C3=A9!_=C3=A0=C3=A8=C3=B4u_!!!?=");
> +
> +        assertEncoded(" hé! àèôu !!!", "=?UTF-8?B?IGjDqSEgw6DDqMO0dSAhISE=?=");
> +    }
> +
> +    private static void assertEncoded(String expected, String encoded) throws Exception {
> +        assertEquals(expected, MimeUtility.decodeText(encoded));
> +    }
> +
> +}
>
> Propchange: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java
> ------------------------------------------------------------------------------
>     svn:eol-style = native
>
> Propchange: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java
> ------------------------------------------------------------------------------
>     svn:keywords = Date Author Id Revision HeadURL

Best not to enable Date or HeadURL; they are both dependent on the
user's settings (Locale and http/https)

Not sure there is a use-case for Author either.

For a short way to identify a file version, use $Revision$; for the
longer version use $Id$
I don't think there's any need for anything else.

> Propchange: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils/mime/MimeUtilityTestCase.java
> ------------------------------------------------------------------------------
>     svn:mime-type = text/plain
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: svn commit: r1457788 - in /commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils: ./ mime/ mime/MimeUtilityTestCase.java

Posted by sebb <se...@gmail.com>.
It's all getting a bit unnecessary here.

My comment was about a new file; I did not see the point of including
properties that are not going to be used.
I did not veto the commit; it was just an observation.

Having said that, if the properties are set it might suggest that they
can be used.

But so long as the properties aren't actually used, the only downside
is the trivial amount of extra disk space needed to store the
property, and possibly a tiny extra processing load when the SVN
client checks for usage of the property.

On 19 March 2013 11:30, Benedikt Ritter <br...@apache.org> wrote:
> Hi Simo,
>
>
> 2013/3/19 Simone Tripodi <si...@apache.org>
>
>> Hi Bene,
>>
>> >>
>> >> which is the side effect of having them enabled and not used?
>> >> we are no longer using Revision and Date for the known reason, so even
>> >> if they are enabled... what's the downside?
>> >>
>> >
>> > I'm playing the devil's advocate here: aren't you the guy you tries to
>> > avoid unnecessary code/config as much as possible? I'm thinking of our
>> > discussions regarding static imports... ;-) IMHO this also applies here.
>> >
>>
>> just for the sake of satisfying the lawyer inside you:
>>
>
> I don't see why this statement was necessary.
>
>
>>
>> I asked, accidentally without using the `please` word - and please
>> take note that it is not my usual habit -, to explain where the
>> _issue_ that needs to be fixed is, on having properties enabled that
>> are _not used_ - again, this is "unfortunately" my default SVN config
>> that has to be compliant not just with Commons, which is not the only
>> project I am involved in.
>>
>
> The problem with this is, that it is _unnecessary_, just like unused
> imports, unused local variables or unnecessary casts etc. are.
> This is only partly related to our discussion regarding the $Date$ keyword.
> Setting a keyword that we have decided not to use, just adds another
> argument for removing it.
>
> [fileupload] is probably in the same state like [beanutils] (and a lot of
> other components) so I guess, that all files have svn:keywords= Date
> Revision Id HeadURL.
> Making bulk changes like this is a bit tedious (I've learned that when
> changing from $Date$ to $Id$ in [beanutils]) but should be done.
> If I can help with the development of [fileupload] by going through all
> files and removing unnecessary keywords, I'll do that asap (probably this
> weekend).
> Agreed?
>
>
>>
>> In this case, my friend, you are overkilling the discussion and rather
>> than having a tech argumentation here, you are trying to put ME on the
>> debate - I don't understand what did you want to demonstrate with this
>> message, or maybe I want to refuse to understand.
>>
>> Ah, and BTW, at the time of static imports, there was not a problem
>> that needed a fix: we had two different opinions and you put efforts
>> on proving that mine was wrong, where at the end of the day what
>> emerged is that both are valid.
>>
>
> If this is what you took from our discussion I'm a bit surprised.
> As I indicated on the other thread [1], the discussion with you guys is one
> of the things that make the most fun (apart from the actual coding ;-).
> I have the feeling that discussions are a bit harsh lately, and I don't
> know where this is coming from...
> If you feel disturbed by my comments I'm sorry. That wasn't my intention.
>
> Getting back to our discussion (which I found very refreshing): I tried to
> make my point clear and of course _discussing_ always involves trying to
> convince others, that ones opinion is right (or getting convinced from the
> opposite).
> I didn't start the discussion (or any other discussion) just for the sake
> of discussing.
> This would be stealing your free time and that is certainly not what I want
> to do.
> I'm not the kind of guy that always wants to have the last word (I think
> you know that).
>
> Tanti saluti,
> Benedikt
>
> [1] http://markmail.org/message/o7ef6o4ahe23k5iu
>
>
>>
>> http://people.apache.org/~simonetripodi/
>> http://simonetripodi.livejournal.com/
>> http://twitter.com/simonetripodi
>> http://www.99soft.org/
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>>
>
>
> --
> http://people.apache.org/~britter/
> http://www.systemoutprintln.de/
> http://twitter.com/BenediktRitter
> http://github.com/britter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: svn commit: r1457788 - in /commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils: ./ mime/ mime/MimeUtilityTestCase.java

Posted by Benedikt Ritter <br...@apache.org>.
Hi Simo,


2013/3/19 Simone Tripodi <si...@apache.org>

> Hi Bene,
>
> >>
> >> which is the side effect of having them enabled and not used?
> >> we are no longer using Revision and Date for the known reason, so even
> >> if they are enabled... what's the downside?
> >>
> >
> > I'm playing the devil's advocate here: aren't you the guy you tries to
> > avoid unnecessary code/config as much as possible? I'm thinking of our
> > discussions regarding static imports... ;-) IMHO this also applies here.
> >
>
> just for the sake of satisfying the lawyer inside you:
>

I don't see why this statement was necessary.


>
> I asked, accidentally without using the `please` word - and please
> take note that it is not my usual habit -, to explain where the
> _issue_ that needs to be fixed is, on having properties enabled that
> are _not used_ - again, this is "unfortunately" my default SVN config
> that has to be compliant not just with Commons, which is not the only
> project I am involved in.
>

The problem with this is, that it is _unnecessary_, just like unused
imports, unused local variables or unnecessary casts etc. are.
This is only partly related to our discussion regarding the $Date$ keyword.
Setting a keyword that we have decided not to use, just adds another
argument for removing it.

[fileupload] is probably in the same state like [beanutils] (and a lot of
other components) so I guess, that all files have svn:keywords= Date
Revision Id HeadURL.
Making bulk changes like this is a bit tedious (I've learned that when
changing from $Date$ to $Id$ in [beanutils]) but should be done.
If I can help with the development of [fileupload] by going through all
files and removing unnecessary keywords, I'll do that asap (probably this
weekend).
Agreed?


>
> In this case, my friend, you are overkilling the discussion and rather
> than having a tech argumentation here, you are trying to put ME on the
> debate - I don't understand what did you want to demonstrate with this
> message, or maybe I want to refuse to understand.
>
> Ah, and BTW, at the time of static imports, there was not a problem
> that needed a fix: we had two different opinions and you put efforts
> on proving that mine was wrong, where at the end of the day what
> emerged is that both are valid.
>

If this is what you took from our discussion I'm a bit surprised.
As I indicated on the other thread [1], the discussion with you guys is one
of the things that make the most fun (apart from the actual coding ;-).
I have the feeling that discussions are a bit harsh lately, and I don't
know where this is coming from...
If you feel disturbed by my comments I'm sorry. That wasn't my intention.

Getting back to our discussion (which I found very refreshing): I tried to
make my point clear and of course _discussing_ always involves trying to
convince others, that ones opinion is right (or getting convinced from the
opposite).
I didn't start the discussion (or any other discussion) just for the sake
of discussing.
This would be stealing your free time and that is certainly not what I want
to do.
I'm not the kind of guy that always wants to have the last word (I think
you know that).

Tanti saluti,
Benedikt

[1] http://markmail.org/message/o7ef6o4ahe23k5iu


>
> http://people.apache.org/~simonetripodi/
> http://simonetripodi.livejournal.com/
> http://twitter.com/simonetripodi
> http://www.99soft.org/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
http://people.apache.org/~britter/
http://www.systemoutprintln.de/
http://twitter.com/BenediktRitter
http://github.com/britter

Re: svn commit: r1457788 - in /commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils: ./ mime/ mime/MimeUtilityTestCase.java

Posted by Simone Tripodi <si...@apache.org>.
Hi Bene,

>>
>> which is the side effect of having them enabled and not used?
>> we are no longer using Revision and Date for the known reason, so even
>> if they are enabled... what's the downside?
>>
>
> I'm playing the devil's advocate here: aren't you the guy you tries to
> avoid unnecessary code/config as much as possible? I'm thinking of our
> discussions regarding static imports... ;-) IMHO this also applies here.
>

just for the sake of satisfying the lawyer inside you:

I asked, accidentally without using the `please` word - and please
take note that it is not my usual habit -, to explain where the
_issue_ that needs to be fixed is, on having properties enabled that
are _not used_ - again, this is "unfortunately" my default SVN config
that has to be compliant not just with Commons, which is not the only
project I am involved in.

In this case, my friend, you are overkilling the discussion and rather
than having a tech argumentation here, you are trying to put ME on the
debate - I don't understand what did you want to demonstrate with this
message, or maybe I want to refuse to understand.

Ah, and BTW, at the time of static imports, there was not a problem
that needed a fix: we had two different opinions and you put efforts
on proving that mine was wrong, where at the end of the day what
emerged is that both are valid.

http://people.apache.org/~simonetripodi/
http://simonetripodi.livejournal.com/
http://twitter.com/simonetripodi
http://www.99soft.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: svn commit: r1457788 - in /commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils: ./ mime/ mime/MimeUtilityTestCase.java

Posted by Benedikt Ritter <br...@apache.org>.
Hi Simo,


2013/3/19 Simone Tripodi <si...@apache.org>

> > Best not to enable Date or HeadURL; they are both dependent on the
> > user's settings (Locale and http/https)
> >
> > Not sure there is a use-case for Author either.
> >
> > For a short way to identify a file version, use $Revision$; for the
> > longer version use $Id$
> > I don't think there's any need for anything else.
>
> which is the side effect of having them enabled and not used?
> we are no longer using Revision and Date for the known reason, so even
> if they are enabled... what's the downside?
>

I'm playing the devil's advocate here: aren't you the guy you tries to
avoid unnecessary code/config as much as possible? I'm thinking of our
discussions regarding static imports... ;-) IMHO this also applies here.

Regards,
Benedikt


>
> I don't have a way to profile svn config per project and this is the
> default config that SVN picks up to be compliant with the rest of the
> projects in ASF where I take part.
>
> http://people.apache.org/~simonetripodi/
> http://simonetripodi.livejournal.com/
> http://twitter.com/simonetripodi
> http://www.99soft.org/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
http://people.apache.org/~britter/
http://www.systemoutprintln.de/
http://twitter.com/BenediktRitter
http://github.com/britter

Re: svn commit: r1457788 - in /commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/utils: ./ mime/ mime/MimeUtilityTestCase.java

Posted by Simone Tripodi <si...@apache.org>.
> Best not to enable Date or HeadURL; they are both dependent on the
> user's settings (Locale and http/https)
>
> Not sure there is a use-case for Author either.
>
> For a short way to identify a file version, use $Revision$; for the
> longer version use $Id$
> I don't think there's any need for anything else.

which is the side effect of having them enabled and not used?
we are no longer using Revision and Date for the known reason, so even
if they are enabled... what's the downside?

I don't have a way to profile svn config per project and this is the
default config that SVN picks up to be compliant with the rest of the
projects in ASF where I take part.

http://people.apache.org/~simonetripodi/
http://simonetripodi.livejournal.com/
http://twitter.com/simonetripodi
http://www.99soft.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org