I recently played around a bit with the various utPLSQL annotations and found them pretty powerful.
I’m pretty sure I will write some more about how you can use annotations like
--%context to make your tests more expressive, but today I just want to showcase some techniques and tell the story of the original Star Wars movies.
For the interesting part is completely in the package specification I will skip the body in the highlighted code here. Each procedure implementation only contains a call to
dbms_output.put_line with some text.
You can get the whole example as always from my github.
When I did my presentation at APEX Connect, Erik van Roon explained another pitfall of my MINUS approach to compare the content of two views to me – something some people already tried to show me and failed (well, I failed getting the point).
Let’s start with the same situation as in the last example, a small list of Star Wars characters and the movie episodes in which they appear:
|1||Darth Vader||3, 4, 5, 6|
|2||Luke Skywalker||4, 5, 6, 7, 8|
Now let’s assume we are forced to do overwork by the sithlord in charge, it’s 3 am, we are terribly tired and create a new view but miss the
group by statement:
Last week, I received the official feedback that I am now accepted to the Oracle ACE program, listed in the directory of groundbreakers and allowed to use this logo:
Im am very honored and grateful to receive this award and be a member of a group of over 450 Oracle experts around the world who love to share their knowledge.
For me, it’s a kind of “pat on the back” and a confirmation that what I write and talk about is seen as helpful for others – which is a huge motivation for me and has always be a main goal.
When I started to blog nearly two years ago, it was first of all for myself, because I enjoy writing about things that intrigue or bother me, but I wanted to do it in a way that probably could be helpful for others.
This very same motivation is still behind every post I write, it’s the reason I started my #100CodeExamples-Challenge (I’m still motivated to fulfil it, just not sure how long it’ll take) and it’s also the reason I started to present about stuff I care for.
I genuinely enjoy public talking (although it’s been very scary, too), but I want to do it in a way that is helpful and probably even entertaining for others.
Being an Oracle ACE now is an affirmation for me that I’m on the right track and that some people think I’m doing it well. That feels good and I appreciate and enjoy it, especially because everything I do in that matter is 100% voluntary.
One of the really great features of utPLSQL are contexts. They allow to further organize tests inside a test suite (which can also be organized hierarchically by suitepaths).
Contexts can help with several things:
- They can reduce the setup/teardown time (things can be done once per context instead of before every test)
- They can help to reveal the intention by grouping several tests
- They can be used to avoid duplication
For this example we build upon the active deathstar protocol which in our case controls how the security system reacts to an unknown, hooded person (you all know that hooded strangers on a deathstar are always undercover jedi).