> On jan. 24, 2017, 2:50 du, Peter Bacsko wrote:
> > core/src/test/java/org/apache/oozie/util/TestStringSerializationUtil.java, 
> > line 39
> > <https://reviews.apache.org/r/55879/diff/1/?file=1613538#file1613538line39>
> >
> >     I'd prefer a deterministic behaviour in an unit test.
> >     
> >     I think it's better to use Strings.repeat() from Guava.
> 
> Peter Cseh wrote:
>     I like the idea of random testing as it might bring out issues we're not 
> think about. E.g. that some charaters are represented with more than 2 bytes 
> in UTF-8

In that case, tests are not reproducible. It makes sense though, but if it 
fails, you won't know which was the input that caused the failure.

IMO it's better to supply a string which causes characters to be serialized 
with different byte lengths (1/2/3), then repeat this string until the desired 
length is not reached.

Example:

public static String TEST_STRING = "aabcdef?úéá?üó\u0800\u0850\u0900"; 

The last three chars will be encoded to a 3-byte sequence.


- Peter


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55879/#review162812
-----------------------------------------------------------


On jan. 24, 2017, 4:30 du, Peter Cseh wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55879/
> -----------------------------------------------------------
> 
> (Updated jan. 24, 2017, 4:30 du)
> 
> 
> Review request for oozie.
> 
> 
> Repository: oozie-git
> 
> 
> Description
> -------
> 
> Config-default.xml longer than 64k results in java.io.UTFDataFormatException  
> https://issues.apache.org/jira/browse/OOZIE-2777
> 
> 
> Diffs
> -----
> 
>   core/src/main/java/org/apache/oozie/util/StringSerializationUtil.java 
> PRE-CREATION 
>   core/src/main/java/org/apache/oozie/workflow/lite/LiteWorkflowInstance.java 
> 2b13e6701226b7236d101d738aba6b6ebbabf4e5 
>   core/src/main/java/org/apache/oozie/workflow/lite/NodeDef.java 
> 496b0086f840c0c6fc60a74bdb3dc382c4db2612 
>   core/src/test/java/org/apache/oozie/command/wf/TestSubmitXCommand.java 
> 47ff8ca2751926bb728ea3eba5d7fe11282c3176 
>   core/src/test/java/org/apache/oozie/util/TestStringSerializationUtil.java 
> PRE-CREATION 
>   core/src/test/java/org/apache/oozie/workflow/lite/TestLiteWorkflowApp.java 
> PRE-CREATION 
>   
> core/src/test/java/org/apache/oozie/workflow/lite/TestLiteWorkflowAppParser.java
>  a3c7b142d08101e2bb03737871db939133bd3cd2 
>   core/src/test/resources/oldWorkFlowApp.serialized PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/55879/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Peter Cseh
> 
>

Reply via email to