true if using a JNDI datasource, or false for JDBC.
- */
- boolean getUseJndi();
-
- /**
- * @param useJndi
- * set to true to use a JNDI datasource, or false for JDBC.
- */
- void setUseJndi(final boolean useJndi);
-
- /**
- * @return the name of the JNDI datasource.
- */
- String getJndiName();
-
- /**
- * @param jndiName
- * true if using a JNDI datasource, or false for JDBC.
- */
- void setJndiName(final String jndiName);
-
- /**
- * @return the name of the JDBC driver class.
- */
- String getJdbcDriver();
-
- /**
- * @param jdbcDriver
- * the name of the JDBC driver class.
- */
- void setJdbcDriver(final String jdbcDriver);
-
- /**
- * @return the JDBC URL.
- */
- String getJdbcUrl();
-
- /**
- * @param jdbcUrl
- * the JDBC URL.
- */
- void setJdbcUrl(final String jdbcUrl);
-
- /**
- * @return the user for the JNDI datasource.
- */
- String getJndiUser();
-
- /**
- * @param username
- * the user for the JNDI datasource.
- */
- void setJndiUser(final String username);
-
- /**
- * @param password
- * the password for the JNDI datasource.
- */
- void setJndiPassword(final String password);
-
- /**
- * @return the user for the JDBC datasource.
- */
- String getJdbcUser();
-
- /**
- * @param username
- * the user for the JDBC datasource.
- */
- void setJdbcUser(final String username);
-
- /**
- * @return the password for the specified user.
- */
- String getJdbcPassword();
-
- /**
- * @param password
- * the password for the JDBC datasource.
- */
- void setJdbcPassword(final String password);
-
- /**
- * Checks the JDBC connection.
- *
- * @param jdbcDriver
- * the JDBC driver class.
- * @param jdbcUrl
- * the JDBC URL.
- * @param username
- * the JDBC user.
- * @param password
- * the JDBC password.
- * @return the validation result.
- * @throws IOException
- * if a problem occurs while connecting to the datasource.
- * @throws ServletException
- * if a problem occurs while processing the request.
- */
- FormValidation doTestJdbcConnection(@QueryParameter("audit2db.jdbcDriver") final String jdbcDriver,
- @QueryParameter("audit2db.jdbcUrl") final String jdbcUrl, @QueryParameter("audit2db.jdbcUser") final String username,
- @QueryParameter("audit2db.jdbcPassword") final String password) throws IOException, ServletException;
-
- /**
- * Generates the DDL.
- *
- * @param jdbcDriver
- * the JDBC driver class.
- * @param jdbcUrl
- * the JDBC URL.
- * @param username
- * the JDBC user.
- * @param password
- * the JDBC password.
- * @return the validation result.
- * @throws IOException
- * if a problem occurs while connecting to the datasource.
- * @throws ServletException
- * if a problem occurs while processing the request.
- */
- FormValidation doGenerateDdl(@QueryParameter("audit2db.jdbcDriver") final String jdbcDriver,
- @QueryParameter("audit2db.jdbcUrl") final String jdbcUrl, @QueryParameter("audit2db.jdbcUser") final String username,
- @QueryParameter("audit2db.jdbcPassword") final String password) throws IOException, ServletException;
-}
\ No newline at end of file
+ /**
+ * @return true if using a JNDI datasource, or false
+ *for JDBC.
+ */
+ boolean getUseJndi();
+
+ /**
+ * @param useJndi
+ * set to true to use a JNDI datasource, or
+ *false for JDBC.
+ */
+ void setUseJndi(final boolean useJndi);
+
+ /**
+ * @return the name of the JNDI datasource.
+ */
+ String getJndiName();
+
+ /**
+ * @param jndiName
+ * true if using a JNDI datasource, or
+ *false for JDBC.
+ */
+ void setJndiName(final String jndiName);
+
+ /**
+ * @return the name of the JDBC driver class.
+ */
+ String getJdbcDriver();
+
+ /**
+ * @param jdbcDriver
+ * the name of the JDBC driver class.
+ */
+ void setJdbcDriver(final String jdbcDriver);
+
+ /**
+ * @return the JDBC URL.
+ */
+ String getJdbcUrl();
+
+ /**
+ * @param jdbcUrl
+ * the JDBC URL.
+ */
+ void setJdbcUrl(final String jdbcUrl);
+
+ /**
+ * @return the user for the JNDI datasource.
+ */
+ String getJndiUser();
+
+ /**
+ * @param username
+ * the user for the JNDI datasource.
+ */
+ void setJndiUser(final String username);
+
+ /**
+ * @param password
+ * the password for the JNDI datasource.
+ */
+ void setJndiPassword(final String password);
+
+ /**
+ * @return the user for the JDBC datasource.
+ */
+ String getJdbcUser();
+
+ /**
+ * @param username
+ * the user for the JDBC datasource.
+ */
+ void setJdbcUser(final String username);
+
+ /**
+ * @return the password for the specified user.
+ */
+ String getJdbcPassword();
+
+ /**
+ * @param password
+ * the password for the JDBC datasource.
+ */
+ void setJdbcPassword(final String password);
+
+ /**
+ * Checks the JDBC connection.
+ *
+ * @param jdbcDriver
+ * the JDBC driver class.
+ * @param jdbcUrl
+ * the JDBC URL.
+ * @param username
+ * the JDBC user.
+ * @param password
+ * the JDBC password.
+ * @return the validation result.
+ * @throws IOException
+ * if a problem occurs while connecting to the datasource.
+ * @throws ServletException
+ * if a problem occurs while processing the request.
+ */
+ FormValidation doTestJdbcConnection(
+ @QueryParameter("audit2db.jdbcDriver") final String jdbcDriver,
+ @QueryParameter("audit2db.jdbcUrl") final
+ String jdbcUrl,
+ @QueryParameter("audit2db.jdbcUser") final
+ String username,
+ @QueryParameter("audit2db.jdbcPassword")
+ final String password) throws
+ IOException, ServletException;
+
+ /**
+ * Generates the DDL.
+ *
+ * @param jdbcDriver
+ * the JDBC driver class.
+ * @param jdbcUrl
+ * the JDBC URL.
+ * @param username
+ * the JDBC user.
+ * @param password
+ * the JDBC password.
+ * @return the validation result.
+ * @throws IOException
+ * if a problem occurs while connecting to the datasource.
+ * @throws ServletException
+ * if a problem occurs while processing the request.
+ */
+ FormValidation doGenerateDdl(
+ @QueryParameter("audit2db.jdbcDriver") final String jdbcDriver,
+ @QueryParameter("audit2db.jdbcUrl") final String
+ jdbcUrl,
+ @QueryParameter("audit2db.jdbcUser") final String
+ username,
+ @QueryParameter("audit2db.jdbcPassword") final
+ String password) throws
+ IOException, ServletException;
+}
diff --git a/src/main/java/org/jenkins/plugins/audit2db/DbAuditReportsDashboard.java b/src/main/java/org/jenkins/plugins/audit2db/DbAuditReportsDashboard.java
index 4d9b0b5..15dc377 100644
--- a/src/main/java/org/jenkins/plugins/audit2db/DbAuditReportsDashboard.java
+++ b/src/main/java/org/jenkins/plugins/audit2db/DbAuditReportsDashboard.java
@@ -2,6 +2,4 @@
import hudson.model.RootAction;
-public interface DbAuditReportsDashboard extends RootAction {
-
-}
+public interface DbAuditReportsDashboard extends RootAction {}
diff --git a/src/main/java/org/jenkins/plugins/audit2db/data/AuditReportsRepository.java b/src/main/java/org/jenkins/plugins/audit2db/data/AuditReportsRepository.java
index cc8f3fd..50c03d8 100644
--- a/src/main/java/org/jenkins/plugins/audit2db/data/AuditReportsRepository.java
+++ b/src/main/java/org/jenkins/plugins/audit2db/data/AuditReportsRepository.java
@@ -1,5 +1,5 @@
/**
- *
+ *
*/
package org.jenkins.plugins.audit2db.data;
@@ -10,59 +10,55 @@
/**
* @author Marco Scata
- *
+ *
*/
public interface AuditReportsRepository {
- /**
- * Retrieves a list of all the projects registered with the specified
- * Jenkins master that have had job instances executed between the specified
- * dates.
- *
- * @param masterHostName
- * the host name of the Jenkins master.
- * @param fromDate
- * the start (inclusive) of the date range.
- * @param toDate
- * the end (inclusive) of the date range.
- * @return a list of project names, never null.
- */
- Listnull.
+ */
+ Listnull.
- */
- Listnull.
+ */
+ Listnull.
- */
- Listnull.
+ */
+ Listnull.
- */
- BuildDetails getBuildDetailsById(String id);
-
- /**
- * Retrieves previously saved build details that match the given name.
- *
- * @param name
- * the build name
- * @return a list of matching build details if found, otherwise an empty
- * list.
- */
- Listnull.
- */
- Listnull.
- */
- BuildNode getBuildNodeByUrl(String url);
-
- /**
- * Retrieves the build details for the given Jenkins build.
- *
- * @param build
- * a reference to the Jenkins build.
- * @return the relevant build details if found, otherwise null.
- */
- BuildDetails getBuildDetailsForBuild(AbstractBuild, ?> build);
-
- /**
- * Retrieves a list of all the projects registered with the specified
- * Jenkins master that have had job instances executed between the specified
- * dates.
- *
- * @param masterHostName
- * the host name of the Jenkins master.
- * @param fromDate
- * the start (inclusive) of the date range.
- * @param toDate
- * the end (inclusive) of the date range.
- * @return a list of project names, never null.
- */
- Listnull.
- */
- Listnull.
- */
- Listnull.
- */
- Listnull.
+ */
+ BuildDetails getBuildDetailsById(String id);
+
+ /**
+ * Retrieves previously saved build details that match the given name.
+ *
+ * @param name
+ * the build name
+ * @return a list of matching build details if found, otherwise an empty
+ * list.
+ */
+ Listnull.
+ */
+ Listnull.
+ */
+ BuildNode getBuildNodeByUrl(String url);
+
+ /**
+ * Retrieves the build details for the given Jenkins build.
+ *
+ * @param build
+ * a reference to the Jenkins build.
+ * @return the relevant build details if found, otherwise null.
+ */
+ BuildDetails getBuildDetailsForBuild(AbstractBuild< ? , ? >build);
+
+ /**
+ * Retrieves a list of all the projects registered with the specified
+ * Jenkins master that have had job instances executed between the specified
+ * dates.
+ *
+ * @param masterHostName
+ * the host name of the Jenkins master.
+ * @param fromDate
+ * the start (inclusive) of the date range.
+ * @param toDate
+ * the end (inclusive) of the date range.
+ * @return a list of project names, never null.
+ */
+ Listnull.
+ */
+ Listnull.
+ */
+ Listnull.
+ */
+ Listnull if none is found.
+ */
+ public DbAuditReport getDynamic(final String name) {
+ Jenkins.getInstance().checkPermission(DbAuditPlugin.RUN);
- /**
- * Checks all registered reports and returns the one whose url name matches
- * the given name in the Stapler request. For example, a request for
- * "./myReport" will return the report whose getUrlName() methods returns
- * "myReport".
- *
- * @param name
- * the name parameter in the Stapler request.
- * @return the matching report, or null if none is found.
- */
- public DbAuditReport getDynamic(final String name) {
- Jenkins.getInstance().checkPermission(DbAuditPlugin.RUN);
- for (final DbAuditReport report : getAllReports()) {
- if (report.getUrlName().equals(name)) {
- return report;
- }
- }
- return null;
+ for (final DbAuditReport report : getAllReports()) {
+ if (report.getUrlName().equals(name)) {
+ return report;
+ }
}
+ return null;
+ }
- /**
- * @return all registered implementations of {@link DbAuditReport}.
- */
- public Listnull name pattern will match all names.
+ */
+ @Override
+ public Listnull name pattern will match all names.
- */
- @Override
- public Listnull if the
- * date string cannot be parsed.
- */
- public static Date stringToDate(final String dateString) {
- Date retval = null;
- if ((dateString != null) && !dateString.isEmpty()) {
- try {
- retval = DATE_FORMAT_NOTIME.parse(dateString);
- } catch (final ParseException e) {
- LOGGER.log(Level.WARNING, "Unable to parse date string "
- + dateString);
- }
- }
- return retval;
+ if (showTime) {
+ return DATE_FORMAT_NOTIME.format(date);
+ } else {
+ return DATE_FORMAT.format(date);
}
+ }
- private static Date getDefaultStartDate() {
- final Calendar cal = Calendar.getInstance();
- // start date = first day of this month
- cal.set(Calendar.DAY_OF_MONTH, 1);
- cal.set(Calendar.HOUR_OF_DAY, 0);
- cal.set(Calendar.MINUTE, 0);
- cal.set(Calendar.SECOND, 0);
- cal.set(Calendar.MILLISECOND, 0);
+ /**
+ * @param dateString
+ * a valid date string.
+ * @return the equivalent {@link Date} object, or null if the
+ * date string cannot be parsed.
+ */
+ public static Date stringToDate(final String dateString) {
+ Date retval = null;
- return cal.getTime();
+ if ((dateString != null) && !dateString.isEmpty()) {
+ try {
+ retval = DATE_FORMAT_NOTIME.parse(dateString);
+ } catch (final ParseException e) {
+ LOGGER.log(Level.WARNING, "Unable to parse date string "
+ + dateString);
+ }
}
+ return retval;
+ }
- private static Date getDefaultEndDate() {
- final Calendar cal = Calendar.getInstance();
- // end date = tonight
- cal.set(Calendar.HOUR_OF_DAY, 23);
- cal.set(Calendar.MINUTE, 59);
- cal.set(Calendar.SECOND, 59);
- cal.set(Calendar.MILLISECOND, 999);
+ private static Date getDefaultStartDate() {
+ final Calendar cal = Calendar.getInstance();
- return cal.getTime();
- }
+ // start date = first day of this month
+ cal.set(Calendar.DAY_OF_MONTH, 1);
+ cal.set(Calendar.HOUR_OF_DAY, 0);
+ cal.set(Calendar.MINUTE, 0);
+ cal.set(Calendar.SECOND, 0);
+ cal.set(Calendar.MILLISECOND, 0);
+
+ return cal.getTime();
+ }
+
+ private static Date getDefaultEndDate() {
+ final Calendar cal = Calendar.getInstance();
- public static String getStartDateParam(final String dateString) {
- Date date = stringToDate(dateString);
- if (null == date) {
- date = getDefaultStartDate();
- }
- return DATE_FORMAT_NOTIME.format(date);
+ // end date = tonight
+ cal.set(Calendar.HOUR_OF_DAY, 23);
+ cal.set(Calendar.MINUTE, 59);
+ cal.set(Calendar.SECOND, 59);
+ cal.set(Calendar.MILLISECOND, 999);
+
+ return cal.getTime();
+ }
+
+ public static String getStartDateParam(final String dateString) {
+ Date date = stringToDate(dateString);
+
+ if (null == date) {
+ date = getDefaultStartDate();
}
+ return DATE_FORMAT_NOTIME.format(date);
+ }
+
+ public static String getEndDateParam(final String dateString) {
+ Date date = stringToDate(dateString);
- public static String getEndDateParam(final String dateString) {
- Date date = stringToDate(dateString);
- if (null == date) {
- date = getDefaultEndDate();
- }
- return DATE_FORMAT_NOTIME.format(date);
+ if (null == date) {
+ date = getDefaultEndDate();
}
+ return DATE_FORMAT_NOTIME.format(date);
+ }
}
diff --git a/src/main/java/org/jenkins/plugins/audit2db/model/BuildDetails.java b/src/main/java/org/jenkins/plugins/audit2db/model/BuildDetails.java
index f82adfe..a4708b5 100644
--- a/src/main/java/org/jenkins/plugins/audit2db/model/BuildDetails.java
+++ b/src/main/java/org/jenkins/plugins/audit2db/model/BuildDetails.java
@@ -1,5 +1,5 @@
/**
- *
+ *
*/
package org.jenkins.plugins.audit2db.model;
@@ -8,52 +8,32 @@
/**
* Data model to map build details.
- *
+ *
* @author Marco Scata
- *
+ *
*/
public interface BuildDetails {
- String getId();
-
- void setId(String id);
-
- String getName();
-
- void setName(String name);
-
- String getFullName();
-
- void setFullName(String fullName);
-
- Date getStartDate();
-
- void setStartDate(Date start);
-
- Date getEndDate();
-
- void setEndDate(Date end);
-
- Long getDuration();
-
- void setDuration(Long duration);
-
- String getResult();
-
- void setResult(String result);
-
- String getUserId();
-
- void setUserId(String userId);
-
- String getUserName();
-
- void setUserName(String userName);
-
- List| LCOV - code coverage report | +|||||||||||||||||||||||||||||
|
+ |
+ |||||||||||||||||||||||||||||
+
|
+ |||||||||||||||||||||||||||||
|
+ |
+
|
+ + |
+ + | + | + | + | + | + | + | |
| Directory |
+ Line Coverage |
+ Functions |
+ Branches |
+ |||||
| + example + | +
+
|
+ 90.0 % | +9 / 10 | +100.0 % | +1 / 1 | +75.0 % | +3 / 4 | +|
| + example/methods + | +
+
|
+ 91.7 % | +11 / 12 | +100.0 % | +2 / 2 | +83.3 % | +5 / 6 | +|
|
+ |
+
| Generated by: LCOV version 1.11 | +
-
+
| ${%Executed On} | -${%Started} | -${%Finished} | -${%Status} | -${%Started By} | -${%Execution Parameters} | -|||
|---|---|---|---|---|---|---|---|---|
| ${details.node.name} | - -${details.endDate.toString().substring(0, 19)} | -${details.result} | -${details.userId} | -
-
|
-
| ${%Executed On} | +${%Started} | +${%Finished} | +${%Status} | +${%Started By} | +${%Execution Parameters} | +|||
|---|---|---|---|---|---|---|---|---|
| ${details.node.name} | + +
+ |
+ ${details.endDate.toString().substring(0, 19)} | +${details.result} | +${details.userId} | +
+
|
+