unreachable variable for groovy script

1
0
-1

Hi.. I am doing a similar script to configure DB. Above is my script.

  1. public class ConfigurationDB {
  2. public static final instance = new ConfigurationDB ();
  3.  
  4. def String url
  5. def String server
  6. def String port
  7. def String database
  8. def String user
  9. def String password
  10.  
  11. static getInstance() {
  12. return instance;
  13. }
  14.  
  15. public ConfigurationDB () {
  16.  
  17. this.server = "localhost";
  18. this.port = "5432";
  19. this.database = "db";
  20. this.user = "user";
  21. this.password = "pass";
  22. this.url = "jdbc:postgresql://"+this.server+":"+this.port+"/"+this.database;
  23. }
  24. }

when I do the test separately for each value, I obtain the correct result for each one, but when I tried to test the total connector I have the next error:

  1. Tipo de Expresion no admitido para la prueba:
  2. Parametro de entrada script esta usando una expresion que contiene una referencia inalcanzable.
  3.  
  4. Type of expression unadmitted for the test:
  5. Imput Parameter 'script' is using a expression that contain a unreachable variable.

thank you.. regards...

No answers yet.
Notifications