-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix11k #38
Fix11k #38
Conversation
Can one of the admins verify this patch? |
ok to test |
add sheetalk to whitelist |
|
||
def makeClosureSettings(config: Config) = { | ||
val source = config.getStringList("source").asScala | ||
val destination = config.getStringList("destination").asScala |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
destination
will be always one. Hence it should not be a list.
@@ -180,10 +197,18 @@ abstract class ReportSettings(val title: String, val accountMatch: Option[Seq[St | |||
abstract class ExportSettings(val accountMatch: Option[Seq[String]], val outFiles: Seq[String]) extends AccountMatcher { | |||
} | |||
|
|||
abstract class ClosureExportSettings1(val source: Seq[String], val destination: String) extends closureMatcher { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why you need this abstract class. If not required, plz remove it.
Important: You need to check for an error condition: If the same account is present in more than one closure source, then it is an error. For example,
should throw an error, because Income will be matched twice! |
retest this please |
val destClosureSort = destClosure.toSeq.sortBy(_.accountName.toString) | ||
srcClosureSort ++: destClosureSort | ||
} | ||
val closure = LedgerExportData(latestDate, closureEntries.head) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are calling closureEntries.head, which will only export the first closure.
What about the remaining closures?
Sir,Can you tell me,Which comment I have not solved ??? |
You can solve it by writing a unit test case for it. In the test cases we are not using the |
" Important: You need to check for an error condition: If the same account is present in more than one closure source, then it is an error. For example, closures += { closures += { should throw an error, because Income will be matched twice! "This one I have not solved.As 'config' is not returning list of 'closures'. |
Sir, |
good, now you have to modify the testcase to handle the exception. See this tip: http://alvinalexander.com/scala/scalatest-testing-expected-exceptions-intercept-testfailedexception |
Done |
if (sourceNames.contains(srcEntry._1)) { | ||
throw new Exception("Duplicate Source Names") | ||
} else { | ||
sourceNames = sourceNames :+ srcEntry._1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are modifying a var
inside a map
application. Remember map
should not have side-effects.
I suggest you separate out the check for sourceNames into a separate function and use foreach
whenever you need a side-effect.
Sir, |
Thanks for the effort. The way you have defined the new function is not ideal. But explaining over email is difficult. I will make some changes directly, squash the commits and push directly to master. |
k sir |
Superceded by #39 |
No description provided.