1

I wrote a few utPL/SQL Test on a PL/SQL Package, put them into a maven project and let them execute by jenkins. I wonder if there is a way to get rid of the test packages created in the database? It feels a bit weird that the test artefacts stay in the database.

I would either consider a maven goal within the utPL/SQL Plugin to delete the created test packages or having a seperate goal, where I can execute PL/SQL to drop the packages. I would also appreciate other ideas.

APC
  • 144,005
  • 19
  • 170
  • 281
Matthias Baumgart
  • 905
  • 1
  • 9
  • 22

1 Answers1

0

As proposed in the Question I found one solution using the sql maven plugin to execute a sql statement. Adding this, dropping the package is executed within the test goal but after the utplsql tests are executed.

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>sql-maven-plugin</artifactId>

  <executions>
    <execution>
      <id>default-cli</id>
      <phase>test</phase>
      <goals><goal>execute</goal></goals>
      <configuration>
        <sqlCommand>DROP PACKAGE UT_PACKAGENAMEUNDERTEST</sqlCommand>
      </configuration>                
    </execution>
  </executions>
</plugin>

In the configuration I left out the jdbc driver configuration. It is analogue to the configuration of the utplsql plugin. Or simple have a look at http://mojo.codehaus.org/sql-maven-plugin/usage.html

Matthias Baumgart
  • 905
  • 1
  • 9
  • 22