newbieJunit
BAN USER- 1of 1 vote
AnswersWrite a Junit test for the following 2 methods in the class which test for properties file as well:
- newbieJunit in India
public class Test{
private HashMap<String, String> aTCN;
private static final String alpha= "alpha.";
private static final String beta = "beta.";
private Properties exporterConfig;
private static final ADFLogger LOG = ADFLoggerFactory.getLogger("R",R.class);
public Map<String, String> getATCN() {
if (aTCN== null) {
aTCN= new HashMap<>();
Properties demo= new Properties();
try {
demo.load(ClassLoader.getSystemResourceAsStream("r1.properties"));
} catch (IOException e) {
LOG.emitError("", e.getMessage());
}
for (String columnName : demo.stringPropertyNames()) {
aTCN.put(columnName.replace(beta, ""),
demo.getProperty(columnName).replace(alpha, ""));
}
}
return aTCN;
}
public Properties getEC() {
if (eC== null) {
try {
exporterConfig = new Properties();
exporterConfig.load(ClassLoader.getSystemResourceAsStream("r2.properties"));
} catch (IOException e) {
LOG.emitError("", e.getMessage());
}
}
return eC;
}
}
I was unable to figure out the same. Let me know if any one has any solution.| Report Duplicate | Flag | PURGE
Amazon Intern Testing
Repmarthahiggs71, Intern at Achieve Internet
Hi, I am Martha from Toledo, OH. Working with Top NYC consulting engineers by helping them design controls projects. Have ...
RepRussBDycus, Android test engineer at ABC TECH SUPPORT
I am working as a manager in Lionel Kiddie City company. I really enjoy my job. I like to play ...
Reppaynealiciam, Apple Phone Number available 24/7 for our Customers at Adap.tv
Hello I am Sarah Cote, and I live in Missouri, USA. Last year, Web trailblazer. Passionate entrepreneur. Subtly charming bacon ...
RepI am Frank, 29 year old. I have worked with numerous branches, including payroll and human resources, which allows me ...
Repalinehchavez, SHOT 1500 NIGHT 5000 Call girls in Munirka Metro 9711794795 at Apple
Hi, I am Aline From New York USA. I am working as a Real estate rental agent in an Energy ...
Reproseyasalazar, Animator at Achieve Internet
I have strong english language skills and communication skills.Good written and oral communication skills.I collect knowledge of Best ...
Repemilinarula, Dev Lead at ABC TECH SUPPORT
Hi, i've been spotting for about 4 years.Teamwork: works well as a member of a team, pitches in ...
Repaaronmdunlap6, Area Sales Manager at Achieve Internet
Hi, I am an HR Analyst with extensive experience delivering innovative solutions at the corporate level. Expertise in employee relations ...
Repileenjconnelly, Cloud Support Associate at Absolute Softech Ltd
I have extensive experience in providing breaking news and giving precise details to the viewers. Interested in leading/working with ...
Rephinescarol45, +27655765355 SSD MONEY CLEANING CHEMICAL +27655765355 BLACK MONEY IN JOHANNESBURG, OMAN, SAUDI ARABIA, SUDAN, Somalia ,Zimbabwe Botswana at 247quickbookshelp
I am Carol From San Diego USA, I am Working as a Personal assistant in a Castle Realty organization, I ...
Repdorarwoods, Kuwait airways reservations at Aspire Systems
I am an Application engineer in the network chef company. In my free time, I enjoy reading programming and technology ...
Repeffiefranke, Mail clerk at Envirotecture Design
Hello, I am Effie Mail clerk . I sort mail by department and category, utilizing sorting machines and similar administrative technology ...
Repmonicaralvarado94, Korean Air Change Flight at Athena Health
I am fond of reading stories then reading articles which are all about a story of a beautiful nature and ...
Repnnatashanaomi, Android test engineer at 247quickbookshelp
I am Marketing managers who play a crucial role in helping a business to promote and its customers. I manage ...