use of com.meterware.httpunit.WebTable in project maven-plugins by apache.
the class DependenciesReportTest method testReport.
/**
* Test report
*
* @throws Exception if any
*/
public void testReport() throws Exception {
generateReport("dependencies", "dependencies-plugin-config.xml");
assertTrue("Test html generated", getGeneratedReport("dependencies.html").exists());
URL reportURL = getGeneratedReport("dependencies.html").toURI().toURL();
assertNotNull(reportURL);
// HTTPUnit
WebRequest request = new GetMethodWebRequest(reportURL.toString());
WebResponse response = WEB_CONVERSATION.getResponse(request);
// Basic HTML tests
assertTrue(response.isHTML());
assertTrue(response.getContentLength() > 0);
// Test the Page title
String expectedTitle = prepareTitle(getString("report.dependencies.name"), getString("report.dependencies.title"));
assertEquals(expectedTitle, response.getTitle());
// Test the tables
WebTable[] webTables = response.getTables();
assertEquals(webTables.length, 1);
assertEquals(webTables[0].getColumnCount(), 5);
assertEquals(webTables[0].getRowCount(), 1 + getTestMavenProject().getDependencies().size());
// Test the texts
TextBlock[] textBlocks = response.getTextBlocks();
assertEquals(getString("report.dependencies.title"), textBlocks[0].getText());
assertEquals("test", textBlocks[1].getText());
assertEquals(getString("report.dependencies.intro.test"), textBlocks[2].getText());
assertEquals(getString("report.dependencies.transitive.title"), textBlocks[3].getText());
assertEquals(getString("report.dependencies.transitive.nolist"), textBlocks[4].getText());
assertEquals(getString("report.dependencies.graph.title"), textBlocks[5].getText());
assertEquals(getString("report.dependencies.graph.tree.title"), textBlocks[6].getText());
assertEquals(getString("report.dependencies.graph.tables.licenses"), textBlocks[7].getText());
}
use of com.meterware.httpunit.WebTable in project maven-plugins by apache.
the class DependencyManagementReportTest method testReport.
/**
* Test report
*
* @throws Exception if any
*/
public void testReport() throws Exception {
generateReport("dependency-management", "dependency-management-plugin-config.xml");
assertTrue("Test html generated", getGeneratedReport("dependency-management.html").exists());
URL reportURL = getGeneratedReport("dependency-management.html").toURI().toURL();
assertNotNull(reportURL);
// HTTPUnit
WebRequest request = new GetMethodWebRequest(reportURL.toString());
WebResponse response = WEB_CONVERSATION.getResponse(request);
// Basic HTML tests
assertTrue(response.isHTML());
assertTrue(response.getContentLength() > 0);
// Test the Page title
String expectedTitle = prepareTitle(getString("report.dependency-management.name"), getString("report.dependency-management.title"));
assertEquals(expectedTitle, response.getTitle());
// Test the tables
WebTable[] webTables = response.getTables();
assertEquals(webTables.length, 1);
assertEquals(webTables[0].getColumnCount(), 5);
assertEquals(webTables[0].getRowCount(), 1 + getTestMavenProject().getDependencyManagement().getDependencies().size());
// Test the texts
TextBlock[] textBlocks = response.getTextBlocks();
assertEquals(getString("report.dependency-management.title"), textBlocks[0].getText());
assertEquals("test", textBlocks[1].getText());
}
use of com.meterware.httpunit.WebTable in project maven-plugins by apache.
the class PluginManagementReportTest method testReport.
/**
* Test report
*
* @throws Exception if any
*/
public void testReport() throws Exception {
generateReport("plugin-management", "plugin-management-plugin-config.xml");
assertTrue("Test html generated", getGeneratedReport("plugin-management.html").exists());
URL reportURL = getGeneratedReport("plugin-management.html").toURI().toURL();
assertNotNull(reportURL);
// HTTPUnit
WebRequest request = new GetMethodWebRequest(reportURL.toString());
WebResponse response = WEB_CONVERSATION.getResponse(request);
// Basic HTML tests
assertTrue(response.isHTML());
assertTrue(response.getContentLength() > 0);
// Test the Page title
String expectedTitle = prepareTitle(getString("report.plugin-management.name"), getString("report.plugin-management.title"));
assertEquals(expectedTitle, response.getTitle());
// Test the tables
WebTable[] webTables = response.getTables();
assertEquals(1, webTables.length);
assertEquals(3, webTables[0].getColumnCount());
assertEquals(3, webTables[0].getRowCount());
// Test the texts
TextBlock[] textBlocks = response.getTextBlocks();
assertEquals(getString("report.plugin-management.title"), textBlocks[0].getText());
}
Aggregations