Exemplo n.º 1
0
 public static void runGame() {
   try {
     engine.run();
   } catch (InvalidMoveException e) {
     ExceptionHandler.handle(e);
   }
 }
  @Test
  public void testAbstractFactory() {

    CarFactory carFactory = new LuxuryCarFactory();
    Engine engine = carFactory.createEngine();
    engine.run();
    engine.start();
  }
Exemplo n.º 3
0
 public static void main(String[] args) {
   CarFactory factory = new LuxuryCarFactory();
   Engine e = factory.createEngine();
   e.run();
   e.start();
 }