• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Data.class constructor requirements

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Data.class needs to implement the DB interface. Does this mean the Data.class can have any constructor you like? e.g.

DB database = new Data("filename.db");

or

DB database = new Data(new File("filename.db"));

or even

DB database = new Data();//where the database file is hardcoded in the Data.class

How will the automated test tool create an instance of our Data.class???
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!

I have two constructors coded:

Data():
call anyInitDb(dataSource) with dataSource as String from property file || hard coded, also default db file
AND
Constructor with the path to the data file Data(String dataSource) call the same anyInitDb(dataSource)...

Best regards...
 
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Layne Wakerell:
The Data.class needs to implement the DB interface. Does this mean the Data.class can have any constructor you like? e.g.

DB database = new Data("filename.db");

or

DB database = new Data(new File("filename.db"));

or even

DB database = new Data();//where the database file is hardcoded in the Data.class

How will the automated test tool create an instance of our Data.class???



You can have as many or as few constructors as you like. And they can be in format you like too, which is nice.
[ July 07, 2007: Message edited by: Mark Smyth ]
 
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Layne,

Don't worry abut the test automate. The test automate will get (build) a Data instance and in a way or other.

Regards,
M
 
I found a beautiful pie. And a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic