View Javadoc

    1   /*
    2    * This file is part of dependency-check-core.
    3    *
    4    * Dependency-check-core is free software: you can redistribute it and/or modify it
    5    * under the terms of the GNU General Public License as published by the Free
    6    * Software Foundation, either version 3 of the License, or (at your option) any
    7    * later version.
    8    *
    9    * Dependency-check-core is distributed in the hope that it will be useful, but
    10   * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    11   * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    12   * details.
    13   *
    14   * You should have received a copy of the GNU General Public License along with
    15   * dependency-check-core. If not, see http://www.gnu.org/licenses/.
    16   *
    17   * Copyright (c) 2013 Jeremy Long. All Rights Reserved.
    18   */
    19  package org.owasp.dependencycheck.data.update;
    20
    21  import java.net.MalformedURLException;
    22  import org.junit.After;
    23  import org.junit.AfterClass;
    24  import org.junit.Before;
    25  import org.junit.BeforeClass;
    26  import org.junit.Test;
    27  import static org.junit.Assert.*;
    28  import org.owasp.dependencycheck.data.UpdateException;
    29  import org.owasp.dependencycheck.utils.DownloadFailedException;
    30
    31  /**
    32   *
    33   * @author Jeremy Long (jeremy.long@owasp.org)
    34   */
    35  public class StandardUpdateTaskIntegrationTest {
    36
    37      public StandardUpdateTaskIntegrationTest() {
    38      }
    39
    40      @BeforeClass
    41      public static void setUpClass() {
    42      }
    43
    44      @AfterClass
    45      public static void tearDownClass() {
    46      }
    47
    48      @Before
    49      public void setUp() {
    50      }
    51
    52      @After
    53      public void tearDown() {
    54      }
    55
    56      public StandardUpdateTask getStandardUpdateTask() throws MalformedURLException, DownloadFailedException, UpdateException {
    57          DataStoreMetaInfo props = new DataStoreMetaInfo();
    58          StandardUpdateTask instance = new StandardUpdateTask(props);
    59          return instance;
    60      }
    61
    62      /**
    63       * Test of update method, of class StandardUpdateTask.
    64       */
    65      @Test
    66      public void testUpdate() throws Exception {
    67          StandardUpdateTask instance = getStandardUpdateTask();
    68          instance.update();
    69          //TODO make this an actual test
    70      }
    71
    72      /**
    73       * Test of updatesNeeded method, of class StandardUpdateTask.
    74       */
    75      @Test
    76      public void testUpdatesNeeded() throws Exception {
    77          StandardUpdateTask instance = getStandardUpdateTask();
    78          Updateable result = instance.updatesNeeded();
    79          assertNotNull(result);
    80      }
    81  }