Skip to content

Commit

Permalink
Unit test #4
Browse files Browse the repository at this point in the history
  • Loading branch information
seregamazur committed Apr 23, 2018
1 parent 77d0698 commit 60d32ba
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
6 changes: 1 addition & 5 deletions src/java/utils/GeneratorNumber.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,13 @@ public int getNumber() {
}

public void read() {

Properties props = new Properties();
InputStream input = null;
try {
File f = new File("settings.properties");
input = new FileInputStream(f);
props.load(input);
input.close();
} catch (IOException ex) {
java.util.logging.Logger.getLogger(GeneratorNumber.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
} catch (IOException ex) { java.util.logging.Logger.getLogger(GeneratorNumber.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);}
setDigits(Integer.parseInt(props.getProperty("DigitsCount")));
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/model/ComputerGeneratorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class ComputerGeneratorTest {
@Test
public void testGenerateAndCheck() {
InputGetter.setInputNumber(12345);
gen.read();
gen.setDigits(5);
generator.setGenerateStatus(ComputerGenerator.GenerateStatus.GENERATING);
while (generator.getGenerateStatus() != ComputerGenerator.GenerateStatus.FINISHED) {
generator.generateAndCheck(gen);
Expand Down
4 changes: 2 additions & 2 deletions src/test/utils/GeneratorNumberTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ public class GeneratorNumberTest {
@Test
public void testRead() {
gen.read();
Logger.getLogger(GeneratorNumber.class.getName()).log(Level.ALL, "");

}

@Test
public void testGenerate() {
gen.getNumber();
}


}

0 comments on commit 60d32ba

Please sign in to comment.