Kotlin Unit Testing
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Use Java reflection to help test private methods.
https://phauer.com/2018/best-practices-unit-testing-kotlin/
https://medium.com/mindorks/how-to-unit-test-private-methods-in-java-and-kotlin-d3cae49dccd
Java Unit Testing
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
import static org.junit.Assert.*;
assertEquals
assertArrayEquals
Use reflection to test private methods.
References
https://javarevisited.blogspot.com/2018/09/junit-testing-tips-constructor-is-called-before-test-methods.html
https://medium.com/mindorks/how-to-unit-test-private-methods-in-java-and-kotlin-d3cae49dccd
Use Kotlin as a Scripting Language
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Run kotlinc to enter REPL of kotlin.
kscript Scripting enhancements for Kotlin
Hands on the urllib Module in Python
Comments¶
It is suggested that you use the requests module instead of urllib unless you want to have minimal 3rd-party dependencies.
You have to explicit import
urllib.requestin order to use it in Python 3. Please refer to https://bugs.python.org/issue36701 for more discussions. This is how Python 3 intends to work generally speaking. Of course, there are a few exceptions such asos.path