Package modelo.excepciones

Examples of modelo.excepciones.ExcepcionPiezaDesconocida


  }

  @Test
  public final void tesExcepcionPiezaDesconocida() {
    try {
      throw new ExcepcionPiezaDesconocida('X');
    } catch (Exception ex) {
      if (ex instanceof ExcepcionPiezaDesconocida)
        assertEquals('X',((ExcepcionPiezaDesconocida) ex).getLetra());
      else fail("Se esperaba ExcepcionPiezaDesconocida, pero se capturo "+ex.getClass().getSimpleName());
    }
View Full Code Here


      return aux;
     
    }
    catch (ClassNotFoundException e)
    {
      throw new ExcepcionPiezaDesconocida(p.charAt(0));
    }
    catch (SecurityException e)
    {
      throw new ExcepcionPiezaDesconocida(p.charAt(0));
    }
    catch (NoSuchMethodException e)
    {
      throw new ExcepcionPiezaDesconocida(p.charAt(0));
    }
    catch (InstantiationException e)
    {
      throw new ExcepcionPiezaDesconocida(p.charAt(0));
    }
    catch (InvocationTargetException e)
    {
      throw new ExcepcionPiezaDesconocida(p.charAt(0));
    }
    catch (IllegalAccessException e)
    {
      throw new ExcepcionPiezaDesconocida(p.charAt(0));
    }
    catch (IllegalArgumentException e)
    {
      throw new ExcepcionPiezaDesconocida(p.charAt(0));
    }
  }
View Full Code Here

   
    if(pieza!=null)
      coloca= FactoriaPieza.creaPieza(pieza.charAt(0), color);
   
    if(coloca==null)
      throw new ExcepcionPiezaDesconocida(pieza.charAt(0));
   
    try
    {
      Coordenada coor= new Coordenada(casilla.charAt(0), Integer.parseInt(Character.toString(casilla.charAt(1))));
      Casilla cas= PartidaAjedrez.getInstancia().getTablero().getCasillaAt(coor);
View Full Code Here

TOP

Related Classes of modelo.excepciones.ExcepcionPiezaDesconocida

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.