removed old, unused test cases

Former-commit-id: 57e354d428df6eeed595afddc08359d72bef3067
This commit is contained in:
Jeremy Long
2014-12-27 06:44:17 -05:00
parent 5d920e4b44
commit cc7ebe6d52
2 changed files with 0 additions and 811 deletions

View File

@@ -1,210 +0,0 @@
/*
* This file is part of dependency-check-maven.
*
* 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.
*
* Copyright (c) 2013 Jeremy Long. All Rights Reserved.
*/
package org.owasp.dependencycheck.maven;
import org.apache.maven.plugin.testing.AbstractMojoTestCase;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
* TODO - figure out how to get the test harness to work. ATM no tests are running.
*
* @author Jeremy Long <jeremy.long@owasp.org>
*/
public class DependencyCheckMojoTest extends AbstractMojoTestCase {
public DependencyCheckMojoTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
//
// /**
// * Test of execute method, of class DependencyCheckMojo.
// */
// @Test
// public void testExecute() throws Exception {
// System.out.println("execute");
// DependencyCheckMojo instance = new DependencyCheckMojo();
// instance.execute();
// // TODO review the generated test code and remove the default call to fail.
// fail("The test case is a prototype.");
// }
//
// /**
// * Test of generate method, of class DependencyCheckMojo.
// */
// @Test
// public void testGenerate_Sink_Locale() throws Exception {
// System.out.println("generate");
// org.codehaus.doxia.sink.Sink sink = null;
// Locale locale = null;
// DependencyCheckMojo instance = new DependencyCheckMojo();
// instance.generate(sink, locale);
// // TODO review the generated test code and remove the default call to fail.
// fail("The test case is a prototype.");
// }
/**
* Test of generate method, of class DependencyCheckMojo.
*/
@Test
public void testGenerate_Sink_SinkFactory_Locale() throws Exception {
//can't get the test-harness to work.
// File samplePom = new File(this.getClass().getClassLoader().getResource("sample.xml").toURI());
// DependencyCheckMojo mojo = (DependencyCheckMojo) lookupMojo("check", samplePom);
// assertNotNull("Unable to load mojo", mojo);
//
// File out = mojo.getReportOutputDirectory();
// OutputStream os = new FileOutputStream(out);
// MySink sink = new MySink(os);
// Locale locale = new Locale("en");
//
//
// mojo.generate(sink, null, locale);
// sink.close();
}
// /**
// * Test of getOutputName method, of class DependencyCheckMojo.
// */
// @Test
// public void testGetOutputName() {
// System.out.println("getOutputName");
// DependencyCheckMojo instance = new DependencyCheckMojo();
// String expResult = "";
// String result = instance.getOutputName();
// assertEquals(expResult, result);
// // TODO review the generated test code and remove the default call to fail.
// fail("The test case is a prototype.");
// }
//
// /**
// * Test of getCategoryName method, of class DependencyCheckMojo.
// */
// @Test
// public void testGetCategoryName() {
// System.out.println("getCategoryName");
// DependencyCheckMojo instance = new DependencyCheckMojo();
// String expResult = "";
// String result = instance.getCategoryName();
// assertEquals(expResult, result);
// // TODO review the generated test code and remove the default call to fail.
// fail("The test case is a prototype.");
// }
//
// /**
// * Test of getName method, of class DependencyCheckMojo.
// */
// @Test
// public void testGetName() {
// System.out.println("getName");
// Locale locale = null;
// DependencyCheckMojo instance = new DependencyCheckMojo();
// String expResult = "";
// String result = instance.getName(locale);
// assertEquals(expResult, result);
// // TODO review the generated test code and remove the default call to fail.
// fail("The test case is a prototype.");
// }
//
// /**
// * Test of setReportOutputDirectory method, of class DependencyCheckMojo.
// */
// @Test
// public void testSetReportOutputDirectory() {
// System.out.println("setReportOutputDirectory");
// File directory = null;
// DependencyCheckMojo instance = new DependencyCheckMojo();
// instance.setReportOutputDirectory(directory);
// // TODO review the generated test code and remove the default call to fail.
// fail("The test case is a prototype.");
// }
//
// /**
// * Test of getReportOutputDirectory method, of class DependencyCheckMojo.
// */
// @Test
// public void testGetReportOutputDirectory() {
// System.out.println("getReportOutputDirectory");
// DependencyCheckMojo instance = new DependencyCheckMojo();
// File expResult = null;
// File result = instance.getReportOutputDirectory();
// assertEquals(expResult, result);
// // TODO review the generated test code and remove the default call to fail.
// fail("The test case is a prototype.");
// }
//
// /**
// * Test of getDescription method, of class DependencyCheckMojo.
// */
// @Test
// public void testGetDescription() {
// System.out.println("getDescription");
// Locale locale = null;
// DependencyCheckMojo instance = new DependencyCheckMojo();
// String expResult = "";
// String result = instance.getDescription(locale);
// assertEquals(expResult, result);
// // TODO review the generated test code and remove the default call to fail.
// fail("The test case is a prototype.");
// }
//
// /**
// * Test of isExternalReport method, of class DependencyCheckMojo.
// */
// @Test
// public void testIsExternalReport() {
// System.out.println("isExternalReport");
// DependencyCheckMojo instance = new DependencyCheckMojo();
// boolean expResult = false;
// boolean result = instance.isExternalReport();
// assertEquals(expResult, result);
// // TODO review the generated test code and remove the default call to fail.
// fail("The test case is a prototype.");
// }
//
// /**
// * Test of canGenerateReport method, of class DependencyCheckMojo.
// */
// @Test
// public void testCanGenerateReport() {
// System.out.println("canGenerateReport");
// DependencyCheckMojo instance = new DependencyCheckMojo();
// boolean expResult = false;
// boolean result = instance.canGenerateReport();
// assertEquals(expResult, result);
// // TODO review the generated test code and remove the default call to fail.
// fail("The test case is a prototype.");
// }
}

View File

@@ -1,601 +0,0 @@
/*
* This file is part of dependency-check-maven.
*
* 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.
*
* Copyright (c) 2013 Jeremy Long. All Rights Reserved.
*/
package org.owasp.dependencycheck.maven;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.maven.doxia.logging.Log;
import org.apache.maven.doxia.sink.Sink;
import org.apache.maven.doxia.sink.SinkEventAttributes;
/**
*
* @author Jeremy Long <jeremy.long@owasp.org>
*/
public class MySink implements Sink {
private OutputStreamWriter out = null;
public MySink(OutputStream os) {
out = new OutputStreamWriter(os);
}
private void writeTag(String tag) {
try {
out.write(tag);
} catch (IOException ex) {
Logger.getLogger(MySink.class.getName()).log(Level.SEVERE, "Error writing a tag; unable to generate the report");
Logger.getLogger(MySink.class.getName()).log(Level.FINE, null, ex);
}
}
public void head() {
writeTag("<head>");
}
public void head_() {
writeTag("</head>");
}
public void title() {
writeTag("<title>");
}
public void title_() {
writeTag("</title>");
}
public void author() {
writeTag("<author>");
}
public void author_() {
writeTag("</author>");
}
public void date() {
writeTag("<time>");
}
public void date_() {
writeTag("</time>");
}
public void body() {
writeTag("<body>");
}
public void body_() {
writeTag("</body>");
}
public void sectionTitle() {
writeTag("<h1>");
}
public void sectionTitle_() {
writeTag("</h1>");
}
public void section1() {
writeTag("<div>");
}
public void section1_() {
writeTag("</div>");
}
public void sectionTitle1() {
writeTag("<h2>");
}
public void sectionTitle1_() {
writeTag("</h2>");
}
public void section2() {
writeTag("<div>");
}
public void section2_() {
writeTag("</div>");
}
public void sectionTitle2() {
writeTag("<h3>");
}
public void sectionTitle2_() {
writeTag("</h3>");
}
public void section3() {
writeTag("<div>");
}
public void section3_() {
writeTag("</div>");
}
public void sectionTitle3() {
writeTag("<h4>");
}
public void sectionTitle3_() {
writeTag("</h4>");
}
public void section4() {
writeTag("<div>");
}
public void section4_() {
writeTag("</div>");
}
public void sectionTitle4() {
writeTag("<h5>");
}
public void sectionTitle4_() {
writeTag("</h5>");
}
public void section5() {
writeTag("<div>");
}
public void section5_() {
writeTag("</div>");
}
public void sectionTitle5() {
writeTag("<h6>");
}
public void sectionTitle5_() {
writeTag("</h6>");
}
public void list() {
writeTag("<ul>");
}
public void list_() {
writeTag("</ul>");
}
public void listItem() {
writeTag("<li>");
}
public void listItem_() {
writeTag("</li>");
}
public void numberedList(int numbering) {
writeTag("<ol>");
}
public void numberedList_() {
writeTag("</ol>");
}
public void numberedListItem() {
writeTag("<li>");
}
public void numberedListItem_() {
writeTag("</li>");
}
public void definitionList() {
writeTag("<dl>");
}
public void definitionList_() {
writeTag("</dl>");
}
public void definitionListItem() {
writeTag("<dt>");
}
public void definitionListItem_() {
writeTag("</dt>");
}
public void definition() {
writeTag("<dd>");
}
public void definition_() {
writeTag("</dd>");
}
public void definedTerm() {
writeTag("<dt>");
}
public void definedTerm_() {
writeTag("</dt>");
}
public void figure() {
throw new UnsupportedOperationException("Not supported yet.");
}
public void figure_() {
throw new UnsupportedOperationException("Not supported yet.");
}
public void figureCaption() {
throw new UnsupportedOperationException("Not supported yet.");
}
public void figureCaption_() {
throw new UnsupportedOperationException("Not supported yet.");
}
public void figureGraphics(String name) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void table() {
writeTag("<table>");
}
public void table_() {
writeTag("</table>");
}
public void tableRows(int[] justification, boolean grid) {
writeTag("<tr>");
}
public void tableRows_() {
writeTag("</tr>");
}
public void tableRow() {
writeTag("<tr>");
}
public void tableRow_() {
writeTag("</tr>");
}
public void tableCell() {
writeTag("<td>");
}
public void tableCell(String width) {
writeTag("<td>");
}
public void tableCell_() {
writeTag("</td>");
}
public void tableHeaderCell() {
writeTag("<th>");
}
public void tableHeaderCell(String width) {
writeTag("<th>");
}
public void tableHeaderCell_() {
writeTag("</th>");
}
public void tableCaption() {
writeTag("<caption>");
}
public void tableCaption_() {
writeTag("</caption>");
}
public void paragraph() {
writeTag("<p>");
}
public void paragraph_() {
writeTag("</p>");
}
public void verbatim(boolean boxed) {
writeTag("<pre>");
}
public void verbatim_() {
writeTag("</pre>");
}
public void horizontalRule() {
writeTag("<hr/>");
}
public void pageBreak() {
writeTag("<br/>");
}
public void anchor(String name) {
writeTag("<a href=\"" + name + "\">");
}
public void anchor_() {
writeTag("</a>");
}
public void link(String name) {
writeTag("<link href=\"" + name + "\">");
}
public void link_() {
writeTag("</link>");
}
public void italic() {
writeTag("<i>");
}
public void italic_() {
writeTag("</i>");
}
public void bold() {
writeTag("<b>");
}
public void bold_() {
writeTag("</b>");
}
public void monospaced() {
writeTag("<pre>");
}
public void monospaced_() {
writeTag("</pre>");
}
public void lineBreak() {
writeTag("<br>");
}
public void nonBreakingSpace() {
writeTag("&nbsp;");
}
public void text(String text) {
try {
//TODO add HTML Encoding - or figure out how to get the doxia xhtmlsink to work.
out.write(text);
} catch (IOException ex) {
Logger.getLogger(MySink.class.getName()).log(Level.SEVERE, "Error writing a text; unable to generate the report");
Logger.getLogger(MySink.class.getName()).log(Level.FINE, null, ex);
}
}
public void rawText(String text) {
try {
out.write(text);
} catch (IOException ex) {
Logger.getLogger(MySink.class.getName()).log(Level.SEVERE, "Error writing raw text; unable to generate the report");
Logger.getLogger(MySink.class.getName()).log(Level.FINE, null, ex);
}
}
public void flush() {
try {
out.flush();
} catch (IOException ex) {
Logger.getLogger(MySink.class.getName()).log(Level.FINEST, null, ex);
}
}
public void close() {
flush();
try {
out.close();
} catch (IOException ex) {
Logger.getLogger(MySink.class.getName()).log(Level.FINEST, null, ex);
}
}
@Override
public void head(SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void title(SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void author(SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void date(SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void body(SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void section(int i, SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void section_(int i) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void sectionTitle(int i, SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void sectionTitle_(int i) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void list(SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void listItem(SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void numberedList(int i, SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void numberedListItem(SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void definitionList(SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void definitionListItem(SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void definition(SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void definedTerm(SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void figure(SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void figureCaption(SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void figureGraphics(String string, SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void table(SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void tableRow(SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void tableCell(SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void tableHeaderCell(SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void tableCaption(SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void paragraph(SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void verbatim(SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void horizontalRule(SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void anchor(String string, SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void link(String string, SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void lineBreak(SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void text(String string, SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void comment(String string) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void unknown(String string, Object[] os, SinkEventAttributes sea) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void enableLogging(Log log) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
}