[ 
https://issues.apache.org/jira/browse/LENS-534?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14528088#comment-14528088
 ] 

Himanshu Gahlaut commented on LENS-534:
---------------------------------------

Will it create more reusable code if we create a method in UpdatePeriod as 
below:
{code:java}
UpdatePeriod {

 
 public boolean inSyncWithDateString(final String dateString) {
   return formatStr().replaceAll("'", "").length() != dateString.length();
 }

}
{code}

and then use this method in TimePartition class as below:

{code:java}
if (!updatePeriod.inSyncWithDateString(dateString)) {
    // throw exception
}

{code}

> TestTimePartition#testTimeRange is failing in master branch
> -----------------------------------------------------------
>
>                 Key: LENS-534
>                 URL: https://issues.apache.org/jira/browse/LENS-534
>             Project: Apache Lens
>          Issue Type: Bug
>            Reporter: Himanshu Gahlaut
>            Assignee: Rajat Khandelwal
>            Priority: Blocker
>         Attachments: LENS-534.patch
>
>
> TestTimePartition#testTimeRange is failing in master branch for QUARTERLY 
> update period.
> Today's date is May 4. The same test case is passing when machine's current 
> date is changed to April 30 which is the date of last commit in master branch.
> Multiple contributors have experienced this and it is blocking further 
> commits into master branch.
> Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.821 sec <<< 
> FAILURE! - in org.apache.lens.cube.metadata.TestTimePartition
> testTimeRange(org.apache.lens.cube.metadata.TestTimePartition)  Time elapsed: 
> 0.168 sec  <<< FAILURE!
> java.lang.AssertionError: expected [10] but found [9]
>       at org.testng.Assert.fail(Assert.java:94)
>       at org.testng.Assert.failNotEquals(Assert.java:494)
>       at org.testng.Assert.assertEquals(Assert.java:123)
>       at org.testng.Assert.assertEquals(Assert.java:265)
>       at org.testng.Assert.assertEquals(Assert.java:275)
>       at 
> org.apache.lens.cube.metadata.TestTimePartition.testTimeRange(TestTimePartition.java:112)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to