Пример #1
0
 @Test
 public void testSingleton() {
   try {
     assertTrue(PrimeTable.getPrimeTable(limit) == primeTable);
     PrimeTable tempTable = PrimeTable.getPrimeTable(limit);
     assertTrue(primeTable.equals(tempTable));
   } catch (BadLimitException e) {
     System.out.println(e.getMessage());
     System.out.println(e.getStackTrace());
   }
 }
Пример #2
0
 @Before
 public void primeTableInit() {
   limit = 1;
   try {
     primeTable = PrimeTable.getPrimeTable(limit);
     table = primeTable.getTable();
   } catch (BadLimitException e) {
     System.out.println(e.getMessage());
     System.out.println(e.getStackTrace());
   }
 }