commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brentwor...@apache.org
Subject cvs commit: jakarta-commons/math/src/test/org/apache/commons/math/linear MatrixIndexExceptionTest.java InvalidMatrixExceptionTest.java
Date Tue, 27 Apr 2004 16:51:52 GMT
brentworden    2004/04/27 09:51:52

  Added:       math/src/test/org/apache/commons/math/linear
                        MatrixIndexExceptionTest.java
                        InvalidMatrixExceptionTest.java
  Log:
  Unit tests.
  
  Revision  Changes    Path
  1.1                  jakarta-commons/math/src/test/org/apache/commons/math/linear/MatrixIndexExceptionTest.java
  
  Index: MatrixIndexExceptionTest.java
  ===================================================================
  /*
   * Copyright 2003-2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package org.apache.commons.math.linear;
  
  import junit.framework.TestCase;
  
  /**
   * @version $Revision: 1.1 $ $Date: 2004/04/27 16:51:52 $
   */
  public class MatrixIndexExceptionTest extends TestCase {
      /**
       * 
       */
      public void testConstructor(){
          MatrixIndexException ex = new MatrixIndexException();
          assertNull(ex.getCause());
          assertNull(ex.getMessage());
      }
      
      /**
       * 
       */
      public void testConstructorMessage(){
          String msg = "message";
          MatrixIndexException ex = new MatrixIndexException(msg);
          assertNull(ex.getCause());
          assertEquals(msg, ex.getMessage());
      }
      
      /**
       * 
       */
      public void testConstructorMessageCause(){
          String outMsg = "outer message";
          String inMsg = "inner message";
          Exception cause = new Exception(inMsg);
          MatrixIndexException ex = new MatrixIndexException(outMsg, cause);
          assertEquals(outMsg, ex.getMessage());
          assertEquals(cause, ex.getCause());
      }
      
      /**
       * 
       */
      public void testConstructorCause(){
          String inMsg = "inner message";
          Exception cause = new Exception(inMsg);
          MatrixIndexException ex = new MatrixIndexException(cause);
          assertEquals(cause, ex.getCause());
      }
  }
  
  
  
  1.1                  jakarta-commons/math/src/test/org/apache/commons/math/linear/InvalidMatrixExceptionTest.java
  
  Index: InvalidMatrixExceptionTest.java
  ===================================================================
  /*
   * Copyright 2003-2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package org.apache.commons.math.linear;
  
  import junit.framework.TestCase;
  
  /**
   * @version $Revision: 1.1 $ $Date: 2004/04/27 16:51:52 $
   */
  public class InvalidMatrixExceptionTest extends TestCase {
      /**
       * 
       */
      public void testConstructor(){
          InvalidMatrixException ex = new InvalidMatrixException();
          assertNull(ex.getCause());
          assertNull(ex.getMessage());
      }
      
      /**
       * 
       */
      public void testConstructorMessage(){
          String msg = "message";
          InvalidMatrixException ex = new InvalidMatrixException(msg);
          assertNull(ex.getCause());
          assertEquals(msg, ex.getMessage());
      }
      
      /**
       * 
       */
      public void testConstructorMessageCause(){
          String outMsg = "outer message";
          String inMsg = "inner message";
          Exception cause = new Exception(inMsg);
          InvalidMatrixException ex = new InvalidMatrixException(outMsg, cause);
          assertEquals(outMsg, ex.getMessage());
          assertEquals(cause, ex.getCause());
      }
      
      /**
       * 
       */
      public void testConstructorCause(){
          String inMsg = "inner message";
          Exception cause = new Exception(inMsg);
          InvalidMatrixException ex = new InvalidMatrixException(cause);
          assertEquals(cause, ex.getCause());
      }
  }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message