You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@falcon.apache.org by PRAGYA MITTAL <mi...@gmail.com> on 2015/09/17 13:01:31 UTC
Review Request 38459: Make validity end date optional for feed /
process
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/38459/
-----------------------------------------------------------
Review request for Falcon and Ajay Yadava.
Bugs: FALCON-1417
https://issues.apache.org/jira/browse/FALCON-1417
Repository: falcon-git
Description
-------
Added optional date functionality.
Diffs
-----
common/src/main/java/org/apache/falcon/entity/parser/CrossEntityValidations.java 2696552
common/src/main/java/org/apache/falcon/entity/parser/FeedEntityParser.java 992fc51
common/src/main/java/org/apache/falcon/entity/parser/ProcessEntityParser.java 48a4286
common/src/main/java/org/apache/falcon/util/DateUtil.java e736340
common/src/test/java/org/apache/falcon/entity/parser/FeedEntityParserTest.java d203b7c
common/src/test/java/org/apache/falcon/entity/parser/ProcessEntityParserTest.java 77f6a77
Diff: https://reviews.apache.org/r/38459/diff/
Testing
-------
Added test cases for the same.
Thanks,
PRAGYA MITTAL
Re: Review Request 38459: Make validity end date optional for feed /
process
Posted by PRAGYA MITTAL <mi...@gmail.com>.
> On Sept. 17, 2015, 3:17 p.m., Balu Vellanki wrote:
> > common/src/main/java/org/apache/falcon/util/DateUtil.java, line 40
> > <https://reviews.apache.org/r/38459/diff/1/?file=1075910#file1075910line40>
> >
> > JavaDoc command does not pass checkstyle.
Will fix this. Need to remove the extra line.
> On Sept. 17, 2015, 3:17 p.m., Balu Vellanki wrote:
> > common/src/main/java/org/apache/falcon/util/DateUtil.java, line 43
> > <https://reviews.apache.org/r/38459/diff/1/?file=1075910#file1075910line43>
> >
> > Is enum preferred over a static method?
I added enum to provide the flexibility of more than one option for end date. Static method will also work as of now.
- PRAGYA
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/38459/#review99388
-----------------------------------------------------------
On Sept. 17, 2015, 11:01 a.m., PRAGYA MITTAL wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/38459/
> -----------------------------------------------------------
>
> (Updated Sept. 17, 2015, 11:01 a.m.)
>
>
> Review request for Falcon and Ajay Yadava.
>
>
> Bugs: FALCON-1417
> https://issues.apache.org/jira/browse/FALCON-1417
>
>
> Repository: falcon-git
>
>
> Description
> -------
>
> Added optional date functionality.
>
>
> Diffs
> -----
>
> common/src/main/java/org/apache/falcon/entity/parser/CrossEntityValidations.java 2696552
> common/src/main/java/org/apache/falcon/entity/parser/FeedEntityParser.java 992fc51
> common/src/main/java/org/apache/falcon/entity/parser/ProcessEntityParser.java 48a4286
> common/src/main/java/org/apache/falcon/util/DateUtil.java e736340
> common/src/test/java/org/apache/falcon/entity/parser/FeedEntityParserTest.java d203b7c
> common/src/test/java/org/apache/falcon/entity/parser/ProcessEntityParserTest.java 77f6a77
>
> Diff: https://reviews.apache.org/r/38459/diff/
>
>
> Testing
> -------
>
> Added test cases for the same.
>
>
> Thanks,
>
> PRAGYA MITTAL
>
>
Re: Review Request 38459: Make validity end date optional for feed /
process
Posted by Balu Vellanki <bv...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/38459/#review99388
-----------------------------------------------------------
common/src/main/java/org/apache/falcon/util/DateUtil.java (line 40)
<https://reviews.apache.org/r/38459/#comment156264>
JavaDoc command does not pass checkstyle.
common/src/main/java/org/apache/falcon/util/DateUtil.java (line 43)
<https://reviews.apache.org/r/38459/#comment156266>
Is enum preferred over a static method?
- Balu Vellanki
On Sept. 17, 2015, 11:01 a.m., PRAGYA MITTAL wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/38459/
> -----------------------------------------------------------
>
> (Updated Sept. 17, 2015, 11:01 a.m.)
>
>
> Review request for Falcon and Ajay Yadava.
>
>
> Bugs: FALCON-1417
> https://issues.apache.org/jira/browse/FALCON-1417
>
>
> Repository: falcon-git
>
>
> Description
> -------
>
> Added optional date functionality.
>
>
> Diffs
> -----
>
> common/src/main/java/org/apache/falcon/entity/parser/CrossEntityValidations.java 2696552
> common/src/main/java/org/apache/falcon/entity/parser/FeedEntityParser.java 992fc51
> common/src/main/java/org/apache/falcon/entity/parser/ProcessEntityParser.java 48a4286
> common/src/main/java/org/apache/falcon/util/DateUtil.java e736340
> common/src/test/java/org/apache/falcon/entity/parser/FeedEntityParserTest.java d203b7c
> common/src/test/java/org/apache/falcon/entity/parser/ProcessEntityParserTest.java 77f6a77
>
> Diff: https://reviews.apache.org/r/38459/diff/
>
>
> Testing
> -------
>
> Added test cases for the same.
>
>
> Thanks,
>
> PRAGYA MITTAL
>
>
Re: Review Request 38459: Make validity end date optional for feed /
process
Posted by pavan kumar kolamuri <pa...@gmail.com>.
> On Sept. 17, 2015, 12:20 p.m., pavan kumar kolamuri wrote:
> > common/src/main/java/org/apache/falcon/entity/parser/ProcessEntityParser.java, line 85
> > <https://reviews.apache.org/r/38459/diff/1/?file=1075909#file1075909line85>
> >
> > Before setting process end time shouldn't we check feed end times of this process ? Feed end time might be less than this right ?
>
> Balu Vellanki wrote:
> There are two ways to handle the scenario where a process is being submitted with it's feed having an endtime.
> 1) Get feed's endtime and use it for process.
> or
> 2) Set the end to DateUtil.OPTIONAL_DATE.NEVER.getDate() and let process validation throw an exception.
>
> I think that Falcon should not make assumptions about user intent in option (1), so prefer option 2.
>
> pavan kumar kolamuri wrote:
> I agree balu, but there is chance that it will always throw exception, if the feed end time is set and this feature will never come into useful.
>
> PRAGYA MITTAL wrote:
> As of now validity check is applied for the first instance of the process.So, IMO falcon would never check for feed end date to be less than process end date. I have raised a JIRA for the same. https://issues.apache.org/jira/browse/FALCON-1400. Can you please site an example where the check would fail?
>
> PRAGYA MITTAL wrote:
> I have added testProcessEndTimeOptional() test case for the same and it passes without throwing any exception.
Suppose the feed end date is 2100 year and we set process end date around 9999 , If we have validations in falcon for process w.r.t to feed end time it will always fail throwing exception. But it looks like validity check is only for the first instance of the process, then it won't fail.
- pavan kumar
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/38459/#review99373
-----------------------------------------------------------
On Sept. 18, 2015, 6:39 a.m., PRAGYA MITTAL wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/38459/
> -----------------------------------------------------------
>
> (Updated Sept. 18, 2015, 6:39 a.m.)
>
>
> Review request for Falcon and Ajay Yadava.
>
>
> Bugs: FALCON-1417
> https://issues.apache.org/jira/browse/FALCON-1417
>
>
> Repository: falcon-git
>
>
> Description
> -------
>
> Added optional date functionality.
>
>
> Diffs
> -----
>
> common/src/main/java/org/apache/falcon/entity/parser/CrossEntityValidations.java 2696552
> common/src/main/java/org/apache/falcon/entity/parser/FeedEntityParser.java 992fc51
> common/src/main/java/org/apache/falcon/entity/parser/ProcessEntityParser.java 48a4286
> common/src/main/java/org/apache/falcon/util/DateUtil.java e736340
> common/src/test/java/org/apache/falcon/entity/parser/FeedEntityParserTest.java d203b7c
> common/src/test/java/org/apache/falcon/entity/parser/ProcessEntityParserTest.java 77f6a77
>
> Diff: https://reviews.apache.org/r/38459/diff/
>
>
> Testing
> -------
>
> Added test cases for the same.
>
>
> Thanks,
>
> PRAGYA MITTAL
>
>
Re: Review Request 38459: Make validity end date optional for feed /
process
Posted by PRAGYA MITTAL <mi...@gmail.com>.
> On Sept. 17, 2015, 12:20 p.m., pavan kumar kolamuri wrote:
> > common/src/main/java/org/apache/falcon/entity/parser/ProcessEntityParser.java, line 85
> > <https://reviews.apache.org/r/38459/diff/1/?file=1075909#file1075909line85>
> >
> > Before setting process end time shouldn't we check feed end times of this process ? Feed end time might be less than this right ?
>
> Balu Vellanki wrote:
> There are two ways to handle the scenario where a process is being submitted with it's feed having an endtime.
> 1) Get feed's endtime and use it for process.
> or
> 2) Set the end to DateUtil.OPTIONAL_DATE.NEVER.getDate() and let process validation throw an exception.
>
> I think that Falcon should not make assumptions about user intent in option (1), so prefer option 2.
>
> pavan kumar kolamuri wrote:
> I agree balu, but there is chance that it will always throw exception, if the feed end time is set and this feature will never come into useful.
As of now validity check is applied for the first instance of the process.So, IMO falcon would never check for feed end date to be less than process end date. I have raised a JIRA for the same. https://issues.apache.org/jira/browse/FALCON-1400. Can you please site an example where the check would fail?
- PRAGYA
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/38459/#review99373
-----------------------------------------------------------
On Sept. 17, 2015, 11:01 a.m., PRAGYA MITTAL wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/38459/
> -----------------------------------------------------------
>
> (Updated Sept. 17, 2015, 11:01 a.m.)
>
>
> Review request for Falcon and Ajay Yadava.
>
>
> Bugs: FALCON-1417
> https://issues.apache.org/jira/browse/FALCON-1417
>
>
> Repository: falcon-git
>
>
> Description
> -------
>
> Added optional date functionality.
>
>
> Diffs
> -----
>
> common/src/main/java/org/apache/falcon/entity/parser/CrossEntityValidations.java 2696552
> common/src/main/java/org/apache/falcon/entity/parser/FeedEntityParser.java 992fc51
> common/src/main/java/org/apache/falcon/entity/parser/ProcessEntityParser.java 48a4286
> common/src/main/java/org/apache/falcon/util/DateUtil.java e736340
> common/src/test/java/org/apache/falcon/entity/parser/FeedEntityParserTest.java d203b7c
> common/src/test/java/org/apache/falcon/entity/parser/ProcessEntityParserTest.java 77f6a77
>
> Diff: https://reviews.apache.org/r/38459/diff/
>
>
> Testing
> -------
>
> Added test cases for the same.
>
>
> Thanks,
>
> PRAGYA MITTAL
>
>
Re: Review Request 38459: Make validity end date optional for feed /
process
Posted by pavan kumar kolamuri <pa...@gmail.com>.
> On Sept. 17, 2015, 12:20 p.m., pavan kumar kolamuri wrote:
> > common/src/main/java/org/apache/falcon/entity/parser/ProcessEntityParser.java, line 85
> > <https://reviews.apache.org/r/38459/diff/1/?file=1075909#file1075909line85>
> >
> > Before setting process end time shouldn't we check feed end times of this process ? Feed end time might be less than this right ?
>
> Balu Vellanki wrote:
> There are two ways to handle the scenario where a process is being submitted with it's feed having an endtime.
> 1) Get feed's endtime and use it for process.
> or
> 2) Set the end to DateUtil.OPTIONAL_DATE.NEVER.getDate() and let process validation throw an exception.
>
> I think that Falcon should not make assumptions about user intent in option (1), so prefer option 2.
I agree balu, but there is chance that it will always throw exception, if the feed end time is set and this feature will never come into useful.
- pavan kumar
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/38459/#review99373
-----------------------------------------------------------
On Sept. 17, 2015, 11:01 a.m., PRAGYA MITTAL wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/38459/
> -----------------------------------------------------------
>
> (Updated Sept. 17, 2015, 11:01 a.m.)
>
>
> Review request for Falcon and Ajay Yadava.
>
>
> Bugs: FALCON-1417
> https://issues.apache.org/jira/browse/FALCON-1417
>
>
> Repository: falcon-git
>
>
> Description
> -------
>
> Added optional date functionality.
>
>
> Diffs
> -----
>
> common/src/main/java/org/apache/falcon/entity/parser/CrossEntityValidations.java 2696552
> common/src/main/java/org/apache/falcon/entity/parser/FeedEntityParser.java 992fc51
> common/src/main/java/org/apache/falcon/entity/parser/ProcessEntityParser.java 48a4286
> common/src/main/java/org/apache/falcon/util/DateUtil.java e736340
> common/src/test/java/org/apache/falcon/entity/parser/FeedEntityParserTest.java d203b7c
> common/src/test/java/org/apache/falcon/entity/parser/ProcessEntityParserTest.java 77f6a77
>
> Diff: https://reviews.apache.org/r/38459/diff/
>
>
> Testing
> -------
>
> Added test cases for the same.
>
>
> Thanks,
>
> PRAGYA MITTAL
>
>
Re: Review Request 38459: Make validity end date optional for feed /
process
Posted by PRAGYA MITTAL <mi...@gmail.com>.
> On Sept. 17, 2015, 12:20 p.m., pavan kumar kolamuri wrote:
> > common/src/main/java/org/apache/falcon/entity/parser/ProcessEntityParser.java, line 85
> > <https://reviews.apache.org/r/38459/diff/1/?file=1075909#file1075909line85>
> >
> > Before setting process end time shouldn't we check feed end times of this process ? Feed end time might be less than this right ?
>
> Balu Vellanki wrote:
> There are two ways to handle the scenario where a process is being submitted with it's feed having an endtime.
> 1) Get feed's endtime and use it for process.
> or
> 2) Set the end to DateUtil.OPTIONAL_DATE.NEVER.getDate() and let process validation throw an exception.
>
> I think that Falcon should not make assumptions about user intent in option (1), so prefer option 2.
>
> pavan kumar kolamuri wrote:
> I agree balu, but there is chance that it will always throw exception, if the feed end time is set and this feature will never come into useful.
>
> PRAGYA MITTAL wrote:
> As of now validity check is applied for the first instance of the process.So, IMO falcon would never check for feed end date to be less than process end date. I have raised a JIRA for the same. https://issues.apache.org/jira/browse/FALCON-1400. Can you please site an example where the check would fail?
I have added testProcessEndTimeOptional() test case for the same and it passes without throwing any exception.
- PRAGYA
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/38459/#review99373
-----------------------------------------------------------
On Sept. 17, 2015, 11:01 a.m., PRAGYA MITTAL wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/38459/
> -----------------------------------------------------------
>
> (Updated Sept. 17, 2015, 11:01 a.m.)
>
>
> Review request for Falcon and Ajay Yadava.
>
>
> Bugs: FALCON-1417
> https://issues.apache.org/jira/browse/FALCON-1417
>
>
> Repository: falcon-git
>
>
> Description
> -------
>
> Added optional date functionality.
>
>
> Diffs
> -----
>
> common/src/main/java/org/apache/falcon/entity/parser/CrossEntityValidations.java 2696552
> common/src/main/java/org/apache/falcon/entity/parser/FeedEntityParser.java 992fc51
> common/src/main/java/org/apache/falcon/entity/parser/ProcessEntityParser.java 48a4286
> common/src/main/java/org/apache/falcon/util/DateUtil.java e736340
> common/src/test/java/org/apache/falcon/entity/parser/FeedEntityParserTest.java d203b7c
> common/src/test/java/org/apache/falcon/entity/parser/ProcessEntityParserTest.java 77f6a77
>
> Diff: https://reviews.apache.org/r/38459/diff/
>
>
> Testing
> -------
>
> Added test cases for the same.
>
>
> Thanks,
>
> PRAGYA MITTAL
>
>
Re: Review Request 38459: Make validity end date optional for feed /
process
Posted by Balu Vellanki <bv...@hortonworks.com>.
> On Sept. 17, 2015, 12:20 p.m., pavan kumar kolamuri wrote:
> > common/src/main/java/org/apache/falcon/entity/parser/ProcessEntityParser.java, line 85
> > <https://reviews.apache.org/r/38459/diff/1/?file=1075909#file1075909line85>
> >
> > Before setting process end time shouldn't we check feed end times of this process ? Feed end time might be less than this right ?
There are two ways to handle the scenario where a process is being submitted with it's feed having an endtime.
1) Get feed's endtime and use it for process.
or
2) Set the end to DateUtil.OPTIONAL_DATE.NEVER.getDate() and let process validation throw an exception.
I think that Falcon should not make assumptions about user intent in option (1), so prefer option 2.
- Balu
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/38459/#review99373
-----------------------------------------------------------
On Sept. 17, 2015, 11:01 a.m., PRAGYA MITTAL wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/38459/
> -----------------------------------------------------------
>
> (Updated Sept. 17, 2015, 11:01 a.m.)
>
>
> Review request for Falcon and Ajay Yadava.
>
>
> Bugs: FALCON-1417
> https://issues.apache.org/jira/browse/FALCON-1417
>
>
> Repository: falcon-git
>
>
> Description
> -------
>
> Added optional date functionality.
>
>
> Diffs
> -----
>
> common/src/main/java/org/apache/falcon/entity/parser/CrossEntityValidations.java 2696552
> common/src/main/java/org/apache/falcon/entity/parser/FeedEntityParser.java 992fc51
> common/src/main/java/org/apache/falcon/entity/parser/ProcessEntityParser.java 48a4286
> common/src/main/java/org/apache/falcon/util/DateUtil.java e736340
> common/src/test/java/org/apache/falcon/entity/parser/FeedEntityParserTest.java d203b7c
> common/src/test/java/org/apache/falcon/entity/parser/ProcessEntityParserTest.java 77f6a77
>
> Diff: https://reviews.apache.org/r/38459/diff/
>
>
> Testing
> -------
>
> Added test cases for the same.
>
>
> Thanks,
>
> PRAGYA MITTAL
>
>
Re: Review Request 38459: Make validity end date optional for feed /
process
Posted by pavan kumar kolamuri <pa...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/38459/#review99373
-----------------------------------------------------------
common/src/main/java/org/apache/falcon/entity/parser/ProcessEntityParser.java (line 85)
<https://reviews.apache.org/r/38459/#comment156252>
Before setting process end time shouldn't we check feed end times of this process ? Feed end time might be less than this right ?
- pavan kumar kolamuri
On Sept. 17, 2015, 11:01 a.m., PRAGYA MITTAL wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/38459/
> -----------------------------------------------------------
>
> (Updated Sept. 17, 2015, 11:01 a.m.)
>
>
> Review request for Falcon and Ajay Yadava.
>
>
> Bugs: FALCON-1417
> https://issues.apache.org/jira/browse/FALCON-1417
>
>
> Repository: falcon-git
>
>
> Description
> -------
>
> Added optional date functionality.
>
>
> Diffs
> -----
>
> common/src/main/java/org/apache/falcon/entity/parser/CrossEntityValidations.java 2696552
> common/src/main/java/org/apache/falcon/entity/parser/FeedEntityParser.java 992fc51
> common/src/main/java/org/apache/falcon/entity/parser/ProcessEntityParser.java 48a4286
> common/src/main/java/org/apache/falcon/util/DateUtil.java e736340
> common/src/test/java/org/apache/falcon/entity/parser/FeedEntityParserTest.java d203b7c
> common/src/test/java/org/apache/falcon/entity/parser/ProcessEntityParserTest.java 77f6a77
>
> Diff: https://reviews.apache.org/r/38459/diff/
>
>
> Testing
> -------
>
> Added test cases for the same.
>
>
> Thanks,
>
> PRAGYA MITTAL
>
>
Re: Review Request 38459: Make validity end date optional for feed /
process
Posted by Ajay Yadava <aj...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/38459/#review99933
-----------------------------------------------------------
Ship it!
Ship It!
- Ajay Yadava
On Sept. 18, 2015, 6:39 a.m., PRAGYA MITTAL wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/38459/
> -----------------------------------------------------------
>
> (Updated Sept. 18, 2015, 6:39 a.m.)
>
>
> Review request for Falcon and Ajay Yadava.
>
>
> Bugs: FALCON-1417
> https://issues.apache.org/jira/browse/FALCON-1417
>
>
> Repository: falcon-git
>
>
> Description
> -------
>
> Added optional date functionality.
>
>
> Diffs
> -----
>
> common/src/main/java/org/apache/falcon/entity/parser/CrossEntityValidations.java 2696552
> common/src/main/java/org/apache/falcon/entity/parser/FeedEntityParser.java 992fc51
> common/src/main/java/org/apache/falcon/entity/parser/ProcessEntityParser.java 48a4286
> common/src/main/java/org/apache/falcon/util/DateUtil.java e736340
> common/src/test/java/org/apache/falcon/entity/parser/FeedEntityParserTest.java d203b7c
> common/src/test/java/org/apache/falcon/entity/parser/ProcessEntityParserTest.java 77f6a77
>
> Diff: https://reviews.apache.org/r/38459/diff/
>
>
> Testing
> -------
>
> Added test cases for the same.
>
>
> Thanks,
>
> PRAGYA MITTAL
>
>
Re: Review Request 38459: Make validity end date optional for feed /
process
Posted by PRAGYA MITTAL <mi...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/38459/
-----------------------------------------------------------
(Updated Sept. 18, 2015, 6:39 a.m.)
Review request for Falcon and Ajay Yadava.
Changes
-------
Removed extra line causing the patch to fail.
Bugs: FALCON-1417
https://issues.apache.org/jira/browse/FALCON-1417
Repository: falcon-git
Description
-------
Added optional date functionality.
Diffs (updated)
-----
common/src/main/java/org/apache/falcon/entity/parser/CrossEntityValidations.java 2696552
common/src/main/java/org/apache/falcon/entity/parser/FeedEntityParser.java 992fc51
common/src/main/java/org/apache/falcon/entity/parser/ProcessEntityParser.java 48a4286
common/src/main/java/org/apache/falcon/util/DateUtil.java e736340
common/src/test/java/org/apache/falcon/entity/parser/FeedEntityParserTest.java d203b7c
common/src/test/java/org/apache/falcon/entity/parser/ProcessEntityParserTest.java 77f6a77
Diff: https://reviews.apache.org/r/38459/diff/
Testing
-------
Added test cases for the same.
Thanks,
PRAGYA MITTAL