amir-jakoby / crawler-commons

Automatically exported from code.google.com/p/crawler-commons
0 stars 0 forks source link

Let SimpleRobotRules and its members implements the Serializable interface #59

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
It will be very interesting that SimpleRobotRules and its members implements 
the Serializable interface, in order to store parsed robots.txt easily.

Original issue reported on code.google.com by josepmiq...@fav24.com on 29 Oct 2014 at 7:05

GoogleCodeExporter commented 8 years ago
Issue 58 has been merged into this issue.

Original comment by avrah...@gmail.com on 29 Oct 2014 at 7:41

GoogleCodeExporter commented 8 years ago
A simple unit test would be useful.

Original comment by kkrugler...@transpac.com on 22 Jan 2015 at 2:30

GoogleCodeExporter commented 8 years ago
Well, do you really think that is needed a unit test in this case?

If the answer is yes, would be enough to test its compatibility:

@Test
public void testIsSerializable() {
    assertTrue(SimpleRobotRules.class.isAssignableFrom(Serializable.class));
}

Thanks and regards,

    Josep Miquel

El 22/1/15 15:30, "crawler-commons@googlecode.com"
<crawler-commons@googlecode.com> escribi�:

Original comment by josepmiq...@fav24.com on 26 Jan 2015 at 12:43

GoogleCodeExporter commented 8 years ago
Hi Josep - it's not a big deal, but in writing Cascading code I've been bitten 
numerous times by either something not being serializable due to members not 
being serializable, or when custom serialization was needed having this not 
work properly. So I now always add a test to create & serialize via 
ObjectOutputStream to a byte array, then de-serialize and compare. In any case, 
I went ahead and added the test, and committed the mod.

Original comment by kkrugler...@transpac.com on 26 Jan 2015 at 1:17

GoogleCodeExporter commented 8 years ago
Committed revision 162

Original comment by kkrugler...@transpac.com on 26 Jan 2015 at 1:19