[FIX] external code tests updated/fixed

This pull request fixes the outdated external code examples in share and the test case
see #1011