diff --git a/alitheia/core/alitheia.log b/alitheia/core/alitheia.log new file mode 100644 index 000000000..e69de29bb diff --git a/alitheia/core/hibernate.log b/alitheia/core/hibernate.log new file mode 100644 index 000000000..e69de29bb diff --git a/alitheia/core/perf.log b/alitheia/core/perf.log new file mode 100644 index 000000000..e69de29bb diff --git a/alitheia/core/pom.xml b/alitheia/core/pom.xml index 4203d2dda..38fca6737 100644 --- a/alitheia/core/pom.xml +++ b/alitheia/core/pom.xml @@ -67,6 +67,22 @@ + + org.projectlombok + lombok + 1.14.8 + provided + + + org.mockito + mockito-all + 1.9.5 + + + junit + junit + 4.11 + org.osgi org.osgi.core diff --git a/alitheia/core/rest.log b/alitheia/core/rest.log new file mode 100644 index 000000000..e69de29bb diff --git a/alitheia/core/src/main/java/eu/sqooss/impl/service/cluster/ClusterNodeServiceImpl.java b/alitheia/core/src/main/java/eu/sqooss/impl/service/cluster/ClusterNodeServiceImpl.java index 5f8f77478..eebae712d 100644 --- a/alitheia/core/src/main/java/eu/sqooss/impl/service/cluster/ClusterNodeServiceImpl.java +++ b/alitheia/core/src/main/java/eu/sqooss/impl/service/cluster/ClusterNodeServiceImpl.java @@ -95,53 +95,6 @@ public String getClusterNodeName(){ return thisNode.getName(); } - /** - * Assign a StoredProject to a ClusterNode - * Reasonable causes of failure: - * 1.NULL passed server - * 2.NULL passed project - * 3.Assignment is locked (server is working on project) - * - * @param node the cluster node target - * @param project stored project to assign - * @return - */ - public boolean assignProject(ClusterNode node, StoredProject project) throws ClusterNodeActionException { - // check if valid server passed - if (node==null) { - throw new ClusterNodeActionException("Request to assign a project to a null clusternode"); - } - // check if valid project passed - if (project==null) { - throw new ClusterNodeActionException("Request to assign a null project to a clusternode"); - } - - try { - // check if project is already assigned to any ClusterNode - ClusterNode assignment = project.getClusternode(); - if (assignment == null) { - // new project assignment - logger.info("Assigning project " + project.getName() + " to " - + node.getName()); - node.getProjects().add(project); - } else { - logger.info("Moving project " + project.getName() + " from " - + assignment.getName() + " to " - + node.getName()); - if (assignment.getId() == node.getId()) { - logger.info("No need to move " + project.getName() - + " - Already assigned!"); - return true; - } - } - } catch (Exception e) { - throw new ClusterNodeActionException("Failed to assign project [" - + project.getName() + "] to clusternode [" + node.getName() - + "]"); - } - return true; - } - /** * Assign a StoredProject to this ClusterNode * @param project project to assign @@ -149,7 +102,7 @@ public boolean assignProject(ClusterNode node, StoredProject project) throws Clu */ public boolean assignProject(StoredProject project) throws ClusterNodeActionException { try { - return assignProject(thisNode, project); + return thisNode.assignProject(logger, thisNode, project); } catch (ClusterNodeActionException ex) { throw ex; } @@ -316,7 +269,7 @@ public void doGet(HttpServletRequest request, HttpServletResponse response) } } try { - if (assignProject(node,project)){ + if (thisNode.assignProject(logger, node, project)){ content = createXMLResponse(null, "Project " + project.getName() + " assigned to " + node.getName(), HttpServletResponse.SC_OK); sendXMLResponse(response, HttpServletResponse.SC_OK, content); } diff --git a/alitheia/core/src/main/java/eu/sqooss/impl/service/db/DBServiceImpl.java b/alitheia/core/src/main/java/eu/sqooss/impl/service/db/DBServiceImpl.java index 546b4addd..244d526c0 100644 --- a/alitheia/core/src/main/java/eu/sqooss/impl/service/db/DBServiceImpl.java +++ b/alitheia/core/src/main/java/eu/sqooss/impl/service/db/DBServiceImpl.java @@ -126,7 +126,7 @@ public class DBServiceImpl implements DBService, AlitheiaCoreService { private AtomicBoolean isInitialised = new AtomicBoolean(false); private Properties conProp = new Properties(); - private void logSQLException(SQLException e) { + protected void logSQLException(SQLException e) { while (e != null) { String message = String.format("SQLException: SQL State:%s, Error Code:%d, Message:%s", @@ -136,7 +136,7 @@ private void logSQLException(SQLException e) { } } - private void logExceptionAndTerminateSession( Exception e ) { + protected void logExceptionAndTerminateSession( Exception e ) { if ( e instanceof JDBCException ) { JDBCException jdbce = (JDBCException) e; logSQLException(jdbce.getSQLException()); @@ -159,7 +159,7 @@ private void logExceptionAndTerminateSession( Exception e ) { } - private boolean checkSession() { + protected boolean checkSession() { if ( !isDBSessionActive() ) { logger.warn("Trying to call a DBService method without an active session"); try { @@ -172,7 +172,7 @@ private boolean checkSession() { return true; } - private boolean getJDBCConnection() { + protected boolean getJDBCConnection() { String driver = conProp.getProperty("hibernate.connection.driver_class"); try { Driver d = (Driver)Class.forName(driver).newInstance(); @@ -210,7 +210,7 @@ private boolean getJDBCConnection() { } } - private boolean initHibernate(URL configFileURL) { + protected boolean initHibernate(URL configFileURL) { logger.info("Initializing Hibernate with URL <" + configFileURL + ">"); if (configFileURL == null) { @@ -308,7 +308,7 @@ public T findObjectByIdForUpdate(Class daoClass, long id } @SuppressWarnings("unchecked") - private T doFindObjectById(Class daoClass, long id, boolean useLock) { + protected T doFindObjectById(Class daoClass, long id, boolean useLock) { if ( !checkSession() ) return null; @@ -330,7 +330,7 @@ public List findObjectsByPropertiesForUpdate(Class da } @SuppressWarnings("unchecked") - private List doFindObjectsByProperties(Class daoClass, Map properties, boolean useLock) { + protected List doFindObjectsByProperties(Class daoClass, Map properties, boolean useLock) { if( !checkSession() ) return Collections.emptyList(); diff --git a/alitheia/core/src/main/java/eu/sqooss/impl/service/fds/FDSServiceImpl.java b/alitheia/core/src/main/java/eu/sqooss/impl/service/fds/FDSServiceImpl.java index e28fb7ea3..eae5842fc 100644 --- a/alitheia/core/src/main/java/eu/sqooss/impl/service/fds/FDSServiceImpl.java +++ b/alitheia/core/src/main/java/eu/sqooss/impl/service/fds/FDSServiceImpl.java @@ -554,13 +554,11 @@ public OnDiskCheckout getCheckout(ProjectVersion pv, String path) // Search for a cached checkout that could be updated /*Set c = checkoutCache.keySet(); OnDiskCheckoutImpl updatable = null; - for (String s : c) { if (cacheKeyProject(s).equals(pv.getProject())) { ProjectVersion cached = cacheKeyProjectVersion(s); if (cached.lt(pv)) { updatable = (OnDiskCheckoutImpl) getCheckoutFromCache(cached); - if (checkoutHandles.get(updatable) == 1) { try { updateCheckout(updatable, pv); @@ -574,7 +572,6 @@ public OnDiskCheckout getCheckout(ProjectVersion pv, String path) } } } - // No updatable checkout found, create synchronized (pv) { if (!cacheContains(pv)) @@ -642,12 +639,10 @@ public void releaseCheckout(OnDiskCheckout c) { logger.warn("Attempting to release null checkout"); return; } - if (!checkoutCache.contains(c)) { logger.warn("Attempting to release not cached checkout"); return; } - returnCheckout(c); */ File root = null; @@ -709,4 +704,3 @@ public boolean startUp() { } // vi: ai nosi sw=4 ts=4 expandtab - diff --git a/alitheia/core/src/main/java/eu/sqooss/impl/service/updater/UpdaterServiceImpl.java b/alitheia/core/src/main/java/eu/sqooss/impl/service/updater/UpdaterServiceImpl.java index 75148b1fe..1584bb19d 100644 --- a/alitheia/core/src/main/java/eu/sqooss/impl/service/updater/UpdaterServiceImpl.java +++ b/alitheia/core/src/main/java/eu/sqooss/impl/service/updater/UpdaterServiceImpl.java @@ -47,10 +47,8 @@ import java.util.concurrent.ConcurrentMap; import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; import eu.sqooss.core.AlitheiaCore; -import eu.sqooss.service.cluster.ClusterNodeActionException; import eu.sqooss.service.cluster.ClusterNodeService; import eu.sqooss.service.db.ClusterNode; import eu.sqooss.service.db.DBService; @@ -71,17 +69,22 @@ public class UpdaterServiceImpl implements UpdaterService, JobStateListener { - private Logger logger = null; + protected Logger logger = null; private AlitheiaCore core = null; private BundleContext context; private DBService dbs = null; /* Maps project-ids to the jobs that have been scheduled for * each update target*/ - private ConcurrentMap> scheduledUpdates; + protected ConcurrentMap> scheduledUpdates; /* List of registered updaters */ - private BidiMap> updaters; + protected BidiMap> updaters; + + protected List jobs; + protected BidiMap toSchedule; + protected DependencyJob oldDepJob; + protected List updForStage; /* UpdaterService interface methods*/ /** {@inheritDoc} */ @@ -205,6 +208,7 @@ public synchronized boolean isUpdateRunning(StoredProject p, Updater u) { return false; } + /* AlitheiaCoreService interface methods*/ @Override public void shutDown() { @@ -292,11 +296,11 @@ private boolean checkDependencies(Updater upd) { } return met; } - + /** * Add an update job of the given type or the specific updater for the project. */ - private boolean update(StoredProject project, UpdaterStage stage, Updater updater) { + protected boolean update(StoredProject project, UpdaterStage stage, Updater updater) { ClusterNodeService cns = null; @@ -306,7 +310,8 @@ private boolean update(StoredProject project, UpdaterStage stage, Updater update } /// ClusterNode Checks - Clone to MetricActivatorImpl - cns = core.getClusterNodeService(); + cns = getClusterNodeService(); + if (cns==null) { logger.warn("ClusterNodeService reference not found " + "- ClusterNode assignment checks will be ignored"); @@ -356,168 +361,202 @@ private boolean update(StoredProject project, UpdaterStage stage, Updater update * stages. The result of this loop is a list of jobs with properly set * dependencies to ensure correct execution. */ - List jobs = new LinkedList(); - BidiMap toSchedule = new BidiMap(); - DependencyJob oldDepJob = null; - try { - for (UpdaterStage us : stages) { - - // Topologically sort updaters within the same stage - List updForStage = new ArrayList(); - updForStage.addAll(getUpdaters(project, us)); - GraphTS graph = - new GraphTS(updForStage.size()); - BidiMap idx = - new BidiMap(); - - //Construct a adjacency matrix for dependencies - for (Updater u : updForStage) { - if (!checkDependencies(u)) - return false; - if (!idx.containsKey(u)) { - int n = graph.addVertex(u); - idx.put(u, n); - } + return setListOfJobs(stages, project, updater); + } + + protected ClusterNodeService getClusterNodeService() { + return core.getClusterNodeService(); + } + + protected boolean setListOfJobs(List stages, StoredProject project, Updater updater) { + jobs = new LinkedList(); + toSchedule = new BidiMap(); + oldDepJob = null; + + try { + for (UpdaterStage us : stages) { + + // Topologically sort updaters within the same stage + updForStage = new ArrayList(); + updForStage.addAll(getUpdaters(project, us)); + GraphTS graph = + new GraphTS(updForStage.size()); + BidiMap idx = + new BidiMap(); + + //Construct a adjacency matrix for dependencies + for (Updater u : updForStage) { + if (!checkDependencies(u)) + return false; + if (!idx.containsKey(u)) { + int n = graph.addVertex(u); + idx.put(u, n); + } + + for (String dependency : u.dependencies()) { + Updater dep = getUpdaterByMnemonic(dependency); + + // Updaters are allowed to introduce self depedencies + if (u.equals(dep)) { + continue; + } + + if (!idx.containsKey(dep)) { + int n = graph.addVertex(dep); + idx.put(dep, n); + } + graph.addEdge(idx.get(u), idx.get(dep)); + } + } + + // Topo-sort + updForStage = graph.topo(); + + // We now have updaters in correct execution order + DependencyJob depJob = new DependencyJob(us.toString()); + + scheduleUpdaters(project, updater, depJob); + + if (oldDepJob != null) + depJob.addDependency(oldDepJob); + + jobs.add(depJob); + oldDepJob = depJob; + } + + //Enqueue jobs + enqueueJobs(project); + } catch (SchedulerException e) { + logger.error("Cannot schedule update job(s):" + e.getMessage(), e); + return false; + } catch (InstantiationException e) { + logger.error("Cannot instantiate updater:" + e.getMessage(), e); + return false; + } catch (IllegalAccessException e) { + logger.error("Cannot load updater class:" + e.getMessage(), e); + return false; + } + + return true; + } + + protected void enqueueBlockOfScheduler(List toQueue) throws SchedulerException { + AlitheiaCore.getInstance().getScheduler().enqueueBlock(toQueue); + } + + protected void scheduleUpdaters(StoredProject project, Updater updater, DependencyJob depJob) + throws SchedulerException, InstantiationException, IllegalAccessException { + + List deps = new ArrayList(); + + if (updater != null) + deps = Arrays.asList(updater.dependencies()); + + for (Updater u : updForStage) { + /* + * Ignore the current in case we have an updater specified + * as argument unless the updater is the same as the + * argument of the current updater is a dependency to the + * one we have as argument :-) + */ + if (updater != null && + !updater.equals(u) && + !deps.contains(u.mnem())) { + continue; + } - for (String dependency : u.dependencies()) { - Updater dep = getUpdaterByMnemonic(dependency); + // Create an updater job + MetadataUpdater upd = getMetadataUpdater(u); + setUpdateParams(upd, project, logger); + - // Updaters are allowed to introduce self depedencies - if (u.equals(dep)) { - continue; - } + UpdaterJob uj = null; + /* + * If an update has already been scheduled for a specific + * updater, just re-use this job for dependency tracking. + * Also put the job in the queue of jobs that are about to + * be scheduled to allow other jobs to declare dependencies + * to it. If in the mean time the dependent job finishes + * execution, the dependee will just continue execution. + */ + if (isUpdateRunning(project, u)) { + uj = scheduledUpdates.get(project.getId()).get(u); + } else { + uj = new UpdaterJob(upd); + uj.addJobStateListener(this); + toSchedule.put(u, uj); + } - if (!idx.containsKey(dep)) { - int n = graph.addVertex(dep); - idx.put(dep, n); - } - graph.addEdge(idx.get(u), idx.get(dep)); - } - } + // Add dependency to stage level job + depJob.addDependency(uj); + jobs.add(uj); + + if (isUpdateRunning(project, u)) + continue; + + //Add dependency to previous stage dependency job + if (oldDepJob != null) + uj.addDependency(oldDepJob); - // Topo-sort - updForStage = graph.topo(); - - // We now have updaters in correct execution order - DependencyJob depJob = new DependencyJob(us.toString()); - - List deps = new ArrayList(); - if (updater != null) - deps = Arrays.asList(updater.dependencies()); - - for (Updater u : updForStage) { - /* - * Ignore the current in case we have an updater specified - * as argument unless the updater is the same as the - * argument of the current updater is a dependency to the - * one we have as argument :-) - */ - if (updater != null && - !updater.equals(u) && - !deps.contains(u.mnem())) { - continue; - } + // Add dependencies to previously scheduled jobs + // within the same stage + List> dependencies = + new ArrayList>(); - // Create an updater job - MetadataUpdater upd = updaters.get(u).newInstance(); - upd.setUpdateParams(project, logger); - - UpdaterJob uj = null; - /* - * If an update has already been scheduled for a specific - * updater, just re-use this job for dependency tracking. - * Also put the job in the queue of jobs that are about to - * be scheduled to allow other jobs to declare dependencies - * to it. If in the mean time the dependent job finishes - * execution, the dependee will just continue execution. - */ - if (isUpdateRunning(project, u)) { - uj = scheduledUpdates.get(project.getId()).get(u); - } else { - uj = new UpdaterJob(upd); - uj.addJobStateListener(this); - toSchedule.put(u, uj); - } + for (String s : u.dependencies()) { + dependencies.add(updaters.get(getUpdaterByMnemonic(s))); + } - // Add dependency to stage level job - depJob.addDependency(uj); - jobs.add(uj); - - if (isUpdateRunning(project, u)) + for (Class d : dependencies) { + for (Job j : jobs) { + if (!(j instanceof UpdaterJob)) continue; - - //Add dependency to previous stage dependency job - if (oldDepJob != null) - uj.addDependency(oldDepJob); - - // Add dependencies to previously scheduled jobs - // within the same stage - List> dependencies = - new ArrayList>(); - - for (String s : u.dependencies()) { - dependencies.add(updaters.get(getUpdaterByMnemonic(s))); - } - - for (Class d : dependencies) { - for (Job j : jobs) { - if (!(j instanceof UpdaterJob)) - continue; - if (((UpdaterJob) j).getUpdater().getClass().equals(d)) { - uj.addDependency(j); - } - } + if (((UpdaterJob) j).getUpdater().getClass().equals(d)) { + uj.addDependency(j); } } - - if (oldDepJob != null) - depJob.addDependency(oldDepJob); - - jobs.add(depJob); - oldDepJob = depJob; } - - //Enqueue jobs - List toQueue = new ArrayList(); - for (Job job : jobs) { - if (!scheduledUpdates.containsKey(project.getId())) - scheduledUpdates.put(project.getId(), - new HashMap()); - - //Don't schedule a job that has been scheduled before - Collection schedJobs = scheduledUpdates.get(project.getId()).values(); - boolean dontSchedule = false; - for (Job j : schedJobs) { - if (job.equals(j)) { - dontSchedule = true; - break; - } + } + } + + protected MetadataUpdater getMetadataUpdater(Updater u) throws InstantiationException, IllegalAccessException { + return updaters.get(u).newInstance(); + } + + protected void setUpdateParams(MetadataUpdater upd, StoredProject project, Logger logger) { + upd.setUpdateParams(project, logger); + } + + protected void enqueueJobs(StoredProject project) throws SchedulerException { + List toQueue = new ArrayList(); + for (Job job : jobs) { + if (!scheduledUpdates.containsKey(project.getId())) + scheduledUpdates.put(project.getId(), + new HashMap()); + + //Don't schedule a job that has been scheduled before + Collection schedJobs = scheduledUpdates.get(project.getId()).values(); + boolean dontSchedule = false; + for (Job j : schedJobs) { + if (job.equals(j)) { + dontSchedule = true; + break; } + } - if (dontSchedule) { - logger.warn("Job " + job + " has been scheduled before, ignoring"); - continue; - } - toQueue.add(job); - //DependencyJobs don't need to be tracked - if (!(job instanceof UpdaterJob)) - continue; - scheduledUpdates.get(project.getId()).put( - toSchedule.getKey(job), (UpdaterJob)job); + if (dontSchedule) { + logger.warn("Job " + job + " has been scheduled before, ignoring"); + continue; } - AlitheiaCore.getInstance().getScheduler().enqueueBlock(toQueue); - } catch (SchedulerException e) { - logger.error("Cannot schedule update job(s):" + e.getMessage(), e); - return false; - } catch (InstantiationException e) { - logger.error("Cannot instantiate updater:" + e.getMessage(), e); - return false; - } catch (IllegalAccessException e) { - logger.error("Cannot load updater class:" + e.getMessage(), e); - return false; + toQueue.add(job); + //DependencyJobs don't need to be tracked + if (!(job instanceof UpdaterJob)) + continue; + scheduledUpdates.get(project.getId()).put( + toSchedule.getKey(job), (UpdaterJob)job); } - return true; + enqueueBlockOfScheduler(toQueue); } /** @@ -585,9 +624,9 @@ public synchronized void jobStateChanged(Job j, State newState) { } /*Dummy jobs to ensure correct sequencing of jobs within updater stages */ - private class DependencyJob extends Job { + protected class DependencyJob extends Job { private String name; - private DependencyJob(){}; + protected DependencyJob(){}; public DependencyJob(String name) { this.name = name;} public long priority() {return 0;} protected void run() throws Exception {} diff --git a/alitheia/core/src/main/java/eu/sqooss/impl/service/webadmin/AbstractView.java b/alitheia/core/src/main/java/eu/sqooss/impl/service/webadmin/AbstractView.java index f79c95031..34eeb6e60 100644 --- a/alitheia/core/src/main/java/eu/sqooss/impl/service/webadmin/AbstractView.java +++ b/alitheia/core/src/main/java/eu/sqooss/impl/service/webadmin/AbstractView.java @@ -107,7 +107,7 @@ public AbstractView(BundleContext bundlecontext, VelocityContext vc) { this.vc = vc; this.bc = bundlecontext; - sobjCore = AlitheiaCore.getInstance(); + sobjCore = getCore(); // Retrieve the instances of the core components if (sobjCore != null) { @@ -161,6 +161,10 @@ public AbstractView(BundleContext bundlecontext, VelocityContext vc) { sobjLogger.debug("Could not get the security manager's instance."); } } + + public AlitheiaCore getCore() { + return AlitheiaCore.getInstance(); + } /** * Initializes the various resource bundle with the specified locale. diff --git a/alitheia/core/src/main/java/eu/sqooss/impl/service/webadmin/PluginsView.java b/alitheia/core/src/main/java/eu/sqooss/impl/service/webadmin/PluginsView.java index 9a582edb4..4c86b406b 100644 --- a/alitheia/core/src/main/java/eu/sqooss/impl/service/webadmin/PluginsView.java +++ b/alitheia/core/src/main/java/eu/sqooss/impl/service/webadmin/PluginsView.java @@ -265,8 +265,8 @@ else if (reqValAction.equals(actValConAddProp)) { // Create configuration property else { try { - if (selPI.addConfigEntry( - sobjDB, + if (new PluginConfiguration().addConfigEntry( + selPI, reqValPropName, reqValPropDescr, reqValPropType, @@ -785,8 +785,7 @@ else if (selPI != null) { + i.getPluginVersion() + "\n"); b.append(sp(--in) + "\n"); // Extended plug-in information - b.append(renderPluginAttributes( - i, reqValShowProp, reqValShowActv, in)); + b.append(renderPluginAttributes(i, reqValShowProp, reqValShowActv, in)); } } //------------------------------------------------------------ @@ -820,8 +819,7 @@ else if (selPI != null) { + i.getPluginVersion() + "\n"); b.append(sp(--in) + "\n"); // Extended plug-in information - b.append(renderPluginAttributes( - i, reqValShowProp, reqValShowActv, in)); + b.append(renderPluginAttributes(i, reqValShowProp, reqValShowActv, in)); } } //------------------------------------------------------------ @@ -936,7 +934,7 @@ else if (selPI != null) { * * @return The table as HTML presentation. */ - private static String renderPluginAttributes( + protected static String renderPluginAttributes( PluginInfo pluginInfo, boolean showProperties, boolean showActivators, diff --git a/alitheia/core/src/main/java/eu/sqooss/service/abstractmetric/AbstractMetric.java b/alitheia/core/src/main/java/eu/sqooss/service/abstractmetric/AbstractMetric.java index 73df1f9fb..babfb3a4b 100644 --- a/alitheia/core/src/main/java/eu/sqooss/service/abstractmetric/AbstractMetric.java +++ b/alitheia/core/src/main/java/eu/sqooss/service/abstractmetric/AbstractMetric.java @@ -745,8 +745,8 @@ protected final void addConfigEntry(String name, String defValue, } // Create property else { - if (pi.addConfigEntry( - db, name, msg, type.toString(), defValue)) { + if (new PluginConfiguration().addConfigEntry( + pi, name, msg, type.toString(), defValue)) { // Update the Plug-in Admin's information pa.pluginUpdated(pa.getPlugin(pi)); } diff --git a/alitheia/core/src/main/java/eu/sqooss/service/admin/AdminActionBase.java b/alitheia/core/src/main/java/eu/sqooss/service/admin/AdminActionBase.java index 342a3b6fa..c041f4f63 100644 --- a/alitheia/core/src/main/java/eu/sqooss/service/admin/AdminActionBase.java +++ b/alitheia/core/src/main/java/eu/sqooss/service/admin/AdminActionBase.java @@ -61,7 +61,7 @@ public final Map errors() { } @Override - public final Map results() { + public Map results() { return result; } @@ -107,7 +107,7 @@ protected final void error(String key, Object o) throws Exception { throw new Exception(o.toString()); } - protected final void error(Exception e) throws Exception { + public final void error(Exception e) throws Exception { if (error == null) error = new HashMap(); error.put("exception", e); diff --git a/alitheia/core/src/main/java/eu/sqooss/service/admin/actions/RunTimeInfo.java b/alitheia/core/src/main/java/eu/sqooss/service/admin/actions/RunTimeInfo.java index 047146e8c..05ce2ad02 100644 --- a/alitheia/core/src/main/java/eu/sqooss/service/admin/actions/RunTimeInfo.java +++ b/alitheia/core/src/main/java/eu/sqooss/service/admin/actions/RunTimeInfo.java @@ -56,17 +56,14 @@ public String descr() { @Override public void execute() throws Exception { super.execute(); - try { - SchedulerStats s = AlitheiaCore.getInstance().getScheduler() - .getSchedulerStats(); - result.put("sched.jobs.failed", s.getFailedJobs()); - result.put("sched.jobs.wait", s.getWaitingJobs()); - result.put("sched.jobs.finished", s.getFinishedJobs()); - result.put("sched.threads.idle", s.getIdleWorkerThreads()); - result.put("sched.threads.total", s.getWorkerThreads()); - } catch (Exception e) { - error(e); - } + + SchedulerStats schedulerStats = getSchedulerStats(); + schedulerStats.statsForExecute(this); finished("Info retrieved"); } + + public SchedulerStats getSchedulerStats() { + SchedulerStats schedulerStats = AlitheiaCore.getInstance().getScheduler().getSchedulerStats(); + return schedulerStats; + } } diff --git a/alitheia/core/src/main/java/eu/sqooss/service/cluster/ClusterNodeService.java b/alitheia/core/src/main/java/eu/sqooss/service/cluster/ClusterNodeService.java index 9519843b7..017bf5b6a 100644 --- a/alitheia/core/src/main/java/eu/sqooss/service/cluster/ClusterNodeService.java +++ b/alitheia/core/src/main/java/eu/sqooss/service/cluster/ClusterNodeService.java @@ -36,7 +36,6 @@ import eu.sqooss.core.AlitheiaCoreService; import eu.sqooss.service.db.StoredProject; -import eu.sqooss.service.db.ClusterNode; /** * The clusternode service is the gateway in Alitheia to control the clusternode @@ -94,10 +93,6 @@ public static String[] toStringArray() { // assign a project to this ClusterNode boolean assignProject(StoredProject project) throws ClusterNodeActionException; - // assign a project to that ClusterNode - boolean assignProject(ClusterNode node, StoredProject project) throws ClusterNodeActionException; - - /** * Check if project is assigned to this ClusterNode * @param project the project to check diff --git a/alitheia/core/src/main/java/eu/sqooss/service/db/ClusterNode.java b/alitheia/core/src/main/java/eu/sqooss/service/db/ClusterNode.java index 1439add8e..e37c7aaac 100644 --- a/alitheia/core/src/main/java/eu/sqooss/service/db/ClusterNode.java +++ b/alitheia/core/src/main/java/eu/sqooss/service/db/ClusterNode.java @@ -51,7 +51,9 @@ import javax.xml.bind.annotation.XmlRootElement; import eu.sqooss.core.AlitheiaCore; +import eu.sqooss.service.cluster.ClusterNodeActionException; import eu.sqooss.service.db.DAObject; +import eu.sqooss.service.logging.Logger; /** * A node in a Alitheia Core cluster installation @@ -129,4 +131,52 @@ public static ClusterNode thisNode() { return getClusteNodeByName(hostname); } + + /** + * Assign a StoredProject to a ClusterNode + * Reasonable causes of failure: + * 1.NULL passed server + * 2.NULL passed project + * 3.Assignment is locked (server is working on project) + * + * @param node the cluster node target + * @param project stored project to assign + * @return + */ + public boolean assignProject(Logger logger, ClusterNode node, StoredProject project) throws ClusterNodeActionException { + // check if valid server passed + if (node==null) { + throw new ClusterNodeActionException("Request to assign a project to a null clusternode"); + } + // check if valid project passed + if (project==null) { + throw new ClusterNodeActionException("Request to assign a null project to a clusternode"); + } + + try { + // check if project is already assigned to any ClusterNode + ClusterNode assignment = project.getClusternode(); + if (assignment == null) { + // new project assignment + logger.info("Assigning project " + project.getName() + " to " + + node.getName()); + node.getProjects().add(project); + } else { + logger.info("Moving project " + project.getName() + " from " + + assignment.getName() + " to " + + node.getName()); + if (assignment.getId() == node.getId()) { + logger.info("No need to move " + project.getName() + + " - Already assigned!"); + return true; + } + } + } catch (Exception e) { + throw new ClusterNodeActionException("Failed to assign project [" + + project.getName() + "] to clusternode [" + node.getName() + + "]"); + } + return true; + } + } diff --git a/alitheia/core/src/main/java/eu/sqooss/service/db/PluginConfiguration.java b/alitheia/core/src/main/java/eu/sqooss/service/db/PluginConfiguration.java index 5456f9885..e00bf7a02 100644 --- a/alitheia/core/src/main/java/eu/sqooss/service/db/PluginConfiguration.java +++ b/alitheia/core/src/main/java/eu/sqooss/service/db/PluginConfiguration.java @@ -48,6 +48,8 @@ import javax.persistence.Table; import eu.sqooss.core.AlitheiaCore; +import eu.sqooss.service.pa.PluginInfo; +import eu.sqooss.service.pa.PluginInfo.ConfigurationType; @Entity @Table(name="PLUGIN_CONFIGURATION") @@ -164,4 +166,82 @@ public static boolean updConfigurationEntry(Plugin p, HashMap na return true; } + + /** + * Adds a new configuration property for this metric plug-in by creating + * a new database record for it. + * + * @param db the DB components object + * @param name the configuration property's name + * @param description the configuration property's description + * @param type the configuration property's type + * @param value the configuration property's value + * + * @return true upon successful append, of false + * when a corresponding database record can not be created. + * + * @throws Exception upon incorrect value's syntax, + * invalid property's type, or invalid property's name. + */ + public boolean addConfigEntry(PluginInfo pluginInfo, String name, + String description, String type, String value) throws Exception { + // Check for an invalid name + if (name == null) { + throw new Exception("Invalid name!"); + } + + // Check for invalid type + if ((type == null) + || (ConfigurationType.fromString(type) == null)) { + throw new Exception("Invalid type!"); + } + + // Check for invalid value + if (value == null) { + throw new Exception("Invalid value!"); + } + // Check for invalid boolean value + else if (type.equals(ConfigurationType.BOOLEAN.toString())) { + if ((value.equals("true") == false) + && (value.equals("false") == false)) { + throw new Exception("Not a valid boolean value!"); + } + } + // Check for an invalid integer value + else if (type.equals(ConfigurationType.INTEGER.toString())) { + try { + Integer.valueOf(value); + } catch (NumberFormatException nfe) { + throw new Exception("Not a valid integer value!"); + } + } + + // Check for an invalid double value + else if (type.equals(ConfigurationType.DOUBLE.toString())) { + try { + Double.valueOf(value); + } catch (NumberFormatException nfe) { + throw new Exception("Not a valid double value!"); + } + } + + // Add the new configuration property + boolean addConfiguration = addConfiguration(pluginInfo, name, description, type, value); + + return addConfiguration; + } + + protected boolean addConfiguration(PluginInfo pluginInfo, String name, String description, String type, String value) { + PluginConfiguration newParam = new PluginConfiguration(); + newParam.setName(name); + newParam.setMsg((description != null) ? description : ""); + newParam.setType(type); + newParam.setValue(value); + + Plugin p = Plugin.getPluginByHashcode(pluginInfo.getHashcode()); + newParam.setPlugin(p); + + return p.getConfigurations().add(newParam); + } + } diff --git a/alitheia/core/src/main/java/eu/sqooss/service/pa/PluginInfo.java b/alitheia/core/src/main/java/eu/sqooss/service/pa/PluginInfo.java index 6ea33d4f5..3f68a6f60 100644 --- a/alitheia/core/src/main/java/eu/sqooss/service/pa/PluginInfo.java +++ b/alitheia/core/src/main/java/eu/sqooss/service/pa/PluginInfo.java @@ -43,7 +43,6 @@ import eu.sqooss.service.abstractmetric.AlitheiaPlugin; import eu.sqooss.service.db.DAObject; import eu.sqooss.service.db.DBService; -import eu.sqooss.service.db.Plugin; import eu.sqooss.service.db.PluginConfiguration; import eu.sqooss.service.util.StringUtils; @@ -309,81 +308,6 @@ else if (type.equals(ConfigurationType.DOUBLE)) { return false; } - /** - * Adds a new configuration property for this metric plug-in by creating - * a new database record for it. - * - * @param db the DB components object - * @param name the configuration property's name - * @param description the configuration property's description - * @param type the configuration property's type - * @param value the configuration property's value - * - * @return true upon successful append, of false - * when a corresponding database record can not be created. - * - * @throws Exception upon incorrect value's syntax, - * invalid property's type, or invalid property's name. - */ - public boolean addConfigEntry( - DBService db, - String name, - String description, - String type, - String value) - throws Exception { - // Check for an invalid name - if (name == null) { - throw new Exception("Invalid name!"); - } - - // Check for invalid type - if ((type == null) - || (ConfigurationType.fromString(type) == null)) { - throw new Exception("Invalid type!"); - } - - // Check for invalid value - if (value == null) { - throw new Exception("Invalid value!"); - } - // Check for invalid boolean value - else if (type.equals(ConfigurationType.BOOLEAN.toString())) { - if ((value.equals("true") == false) - && (value.equals("false") == false)) { - throw new Exception("Not a valid boolean value!"); - } - } - // Check for an invalid integer value - else if (type.equals(ConfigurationType.INTEGER.toString())) { - try { - Integer.valueOf(value); - } catch (NumberFormatException nfe) { - throw new Exception("Not a valid integer value!"); - } - } - - // Check for an invalid double value - else if (type.equals(ConfigurationType.DOUBLE.toString())) { - try { - Double.valueOf(value); - } catch (NumberFormatException nfe) { - throw new Exception("Not a valid double value!"); - } - } - - // Add the new configuration property - PluginConfiguration newParam = - new PluginConfiguration(); - newParam.setName(name); - newParam.setMsg((description != null) ? description : ""); - newParam.setType(type); - newParam.setValue(value); - Plugin p = Plugin.getPluginByHashcode(hashcode); - newParam.setPlugin(p); - return p.getConfigurations().add(newParam); -} - /** * Removes an existing configuration property of this metric plug-in by * deleting its database record. diff --git a/alitheia/core/src/main/java/eu/sqooss/service/scheduler/SchedulerStats.java b/alitheia/core/src/main/java/eu/sqooss/service/scheduler/SchedulerStats.java index f4b9a1beb..77364beda 100644 --- a/alitheia/core/src/main/java/eu/sqooss/service/scheduler/SchedulerStats.java +++ b/alitheia/core/src/main/java/eu/sqooss/service/scheduler/SchedulerStats.java @@ -38,7 +38,7 @@ import java.util.List; import java.util.Vector; -import org.apache.commons.collections.list.SynchronizedList; +import eu.sqooss.service.admin.actions.RunTimeInfo; public class SchedulerStats { // the number of jobs currently in the scheduler @@ -173,4 +173,16 @@ public synchronized List getRunJobs() { } return jobDescr; } + + public void statsForExecute(RunTimeInfo runTimeInfo) throws Exception { + try { + runTimeInfo.results().put("sched.jobs.failed", getFailedJobs()); + runTimeInfo.results().put("sched.jobs.wait", getWaitingJobs()); + runTimeInfo.results().put("sched.jobs.finished", getFinishedJobs()); + runTimeInfo.results().put("sched.threads.idle", getIdleWorkerThreads()); + runTimeInfo.results().put("sched.threads.total", getWorkerThreads()); + } catch (Exception e) { + runTimeInfo.error(e); + } + } } diff --git a/alitheia/core/src/test/java/eu/sqooss/impl/service/db/DBServiceImplTest.java b/alitheia/core/src/test/java/eu/sqooss/impl/service/db/DBServiceImplTest.java new file mode 100644 index 000000000..e51f1a55c --- /dev/null +++ b/alitheia/core/src/test/java/eu/sqooss/impl/service/db/DBServiceImplTest.java @@ -0,0 +1,247 @@ +package eu.sqooss.impl.service.db; + +import static org.hamcrest.CoreMatchers.not; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; + +import java.sql.SQLException; +import java.util.List; + +import org.hibernate.QueryException; +import org.junit.Before; +import org.junit.Test; + +import eu.sqooss.service.db.DAObject; + +public class DBServiceImplTest { + + private DummyDBServiceImpl testDBServiceImpl; + + private DummyLogger testLogger; + + @Before + public void setUp() { + testLogger = new DummyLogger(); + testDBServiceImpl = new DummyDBServiceImpl(null, null, testLogger); + } + + @Test + public void testSubDBServiceImplNoArgs() { + testDBServiceImpl = new DummyDBServiceImpl(); + assertThat(null, not(testDBServiceImpl)); + } + + @Test + public void testSubDBServiceImpl(){ + assertThat(null, not(testDBServiceImpl)); + assertEquals(testLogger, testDBServiceImpl.logger()); + } + + @Test + public void testGetJDBCConnection() { + boolean connection = testDBServiceImpl.getJDBCConnection(); + assertFalse(connection); + } + + @Test + public void testInitHibernate() { + boolean hibernate = testDBServiceImpl.initHibernate(null); + assertFalse(hibernate); + } + + @Test + public void testFindObjectById() { + DAObject testDAObject = testDBServiceImpl.findObjectById(null, 0); + assertEquals(1, testDAObject.getId()); + } + + @Test + public void testFindObjectByIdForUpdate() { + DAObject testDAObject = testDBServiceImpl.findObjectByIdForUpdate(null, 0); + assertEquals(1, testDAObject.getId()); + } + + @Test + public void testFindObjectsByProperties() { + DAObject testDAObject = testDBServiceImpl.findObjectsByProperties(null, null).get(0); + assertEquals(1, testDAObject.getId()); + } + + @Test + public void testFindObjectsByPropertiesForUpdate() { + DAObject testDAObject = testDBServiceImpl.findObjectsByPropertiesForUpdate(null, null).get(0); + assertEquals(1, testDAObject.getId()); + } + + @Test + public void testDoFindObjectsByProperties() { + DAObject testDAObject = testDBServiceImpl.doFindObjectsByProperties(null, null, false).get(0); + assertEquals(1, testDAObject.getId()); + } + + @Test + public void testDoSQL() throws SQLException { + List testList = testDBServiceImpl.doSQL(""); + assertTrue(testList.isEmpty()); + } + + @Test + public void testDoSQLTwoArgs() throws SQLException { + List testList = testDBServiceImpl.doSQL("", null); + assertTrue(testList.isEmpty()); + } + + @Test + public void testCallProcedure() throws QueryException, SQLException { + assertEquals(1, testDBServiceImpl.callProcedure("", null, null)); + } + + @Test + public void testDoHQL() { + List testList = testDBServiceImpl.doHQL(""); + assertTrue(testList.isEmpty()); + } + + @Test + public void testDoHQLTwoArgs() { + List testList = testDBServiceImpl.doHQL("", null); + assertTrue(testList.isEmpty()); + } + + @Test + public void testDoHQLThreeArgsInt() { + List testList = testDBServiceImpl.doHQL("", null, 0); + assertTrue(testList.isEmpty()); + } + + @Test + public void testDoHQLThreeArgsBool() { + List testList = testDBServiceImpl.doHQL("", null, false); + assertTrue(testList.isEmpty()); + } + + @Test + public void testDoHQLThreeArgsObj() { + List testList = testDBServiceImpl.doHQL("", null, null); + assertTrue(testList.isEmpty()); + } + + @Test + public void testDoHQLSixArgs() { + List testList = testDBServiceImpl.doHQL("", null, null, false, 0, 0); + assertTrue(testList.isEmpty()); + } + + @Test + public void testAddRecord() { + boolean added = testDBServiceImpl.addRecord(null); + assertFalse(added); + } + + @Test + public void testDeleteRecord() { + boolean deleted = testDBServiceImpl.deleteRecord(null); + assertFalse(deleted); + } + + @Test + public void testAddRecords() { + boolean added = testDBServiceImpl.addRecords(null); + assertFalse(added); + } + + @Test + public void testDeleteRecords() { + boolean deleted = testDBServiceImpl.deleteRecords(null); + assertFalse(deleted); + } + + @Test + public void testStartDBSession() { + boolean started = testDBServiceImpl.startDBSession(); + assertFalse(started); + } + + @Test + public void testCommitDBSession() { + boolean commited = testDBServiceImpl.commitDBSession(); + assertFalse(commited); + } + + @Test + public void testRollbackDBSession() { + boolean back = testDBServiceImpl.rollbackDBSession(); + assertFalse(back); + } + + @Test + public void testFlushDBSession() { + boolean flushed = testDBServiceImpl.flushDBSession(); + assertFalse(flushed); + } + + @Test + public void testIsDBSessionActive() { + boolean active = testDBServiceImpl.isDBSessionActive(); + assertFalse(active); + } + + @Test + public void testAttachObjectToDBService() { + DAObject testDAObject = testDBServiceImpl.attachObjectToDBSession(null); + assertEquals(1, testDAObject.getId()); + } + + @Test + public void testExecuteUpdate() { + int update = testDBServiceImpl.executeUpdate("", null); + assertEquals(1, update); + } + + @Test + public void testStartUp() { + boolean started = testDBServiceImpl.startUp(); + assertFalse(started); + } + + @Test + public void testShutDown() { + testDBServiceImpl.shutDown(); + assertFalse(testDBServiceImpl.shutDown); + } + + @Test + public void testSetInitParams() { + DummyLogger testLogger = new DummyLogger(); + testDBServiceImpl.setInitParams(null, testLogger); + + assertEquals(testLogger, testDBServiceImpl.logger()); + } + + @Test + public void testLogSQLException() { + testDBServiceImpl.logSQLException(null); + assertEquals("sqle", testLogger.getMessage()); + } + + @Test + public void testLogExceptionAndTerminateSession() { + testDBServiceImpl.logExceptionAndTerminateSession(null); + assertEquals("e", testLogger.getMessage()); + } + + @Test + public void testCheckSession() { + boolean session = testDBServiceImpl.checkSession(); + assertFalse(session); + } + + @Test + public void testDoFindObjectById() { + DAObject testDAObject = testDBServiceImpl.doFindObjectById(null, 0, false); + assertEquals(1, testDAObject.getId()); + } + +} diff --git a/alitheia/core/src/test/java/eu/sqooss/impl/service/db/DummyDBServiceImpl.java b/alitheia/core/src/test/java/eu/sqooss/impl/service/db/DummyDBServiceImpl.java new file mode 100644 index 000000000..846e8d052 --- /dev/null +++ b/alitheia/core/src/test/java/eu/sqooss/impl/service/db/DummyDBServiceImpl.java @@ -0,0 +1,263 @@ +package eu.sqooss.impl.service.db; + +import java.net.URL; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +import org.hibernate.QueryException; +import org.hibernate.SessionFactory; +import org.osgi.framework.BundleContext; + +import eu.sqooss.service.db.Bug; +import eu.sqooss.service.db.DAObject; +import eu.sqooss.service.logging.Logger; + + +public class DummyDBServiceImpl extends DBServiceImpl { + + private Logger logger; + + protected boolean shutDown; + + @Override + protected boolean getJDBCConnection() { + return false; + } + + @Override + protected boolean initHibernate(URL configFileURL) { + return false; + } + + public DummyDBServiceImpl() {} + + public DummyDBServiceImpl(Properties p, URL configFileURL, Logger l) { + this.logger = l; + } + + @Override + public T findObjectById(Class daoClass, long id) { + @SuppressWarnings("unchecked") + T t = (T) new Bug(); + t.setId(1); + + return t; + } + + @Override + public T findObjectByIdForUpdate(Class daoClass, long id) { + @SuppressWarnings("unchecked") + T t = (T) new Bug(); + t.setId(1); + + return t; + } + + @Override + public List findObjectsByProperties(Class daoClass, Map properties) { + ArrayList list = new ArrayList(); + @SuppressWarnings("unchecked") + T t = (T) new Bug(); + t.setId(1); + list.add(t); + + return list; + } + + @Override + public List findObjectsByPropertiesForUpdate(Class daoClass, Map properties) { + ArrayList list = new ArrayList(); + @SuppressWarnings("unchecked") + T t = (T) new Bug(); + t.setId(1); + list.add(t); + + return list; + } + + @Override + public List doFindObjectsByProperties(Class daoClass, Map properties, boolean useLock) { + ArrayList list = new ArrayList(); + @SuppressWarnings("unchecked") + T t = (T) new Bug(); + t.setId(1); + list.add(t); + + return list; + } + + @Override + public List doSQL(String sql) + throws SQLException { + ArrayList list = new ArrayList(); + return list; + } + + @Override + public List doSQL(String sql, Map params) + throws SQLException, QueryException { + ArrayList list = new ArrayList(); + return list; + } + + @Override + public int callProcedure(String procName, List args, Map params) + throws SQLException, QueryException { + return 1; + } + + @Override + public List doHQL(String hql) + throws QueryException { + ArrayList list = new ArrayList(); + return list; + } + + @Override + public List doHQL(String hql, Map params) + throws QueryException { + ArrayList list = new ArrayList(); + return list; + } + + @Override + public List doHQL(String hql, Map params, int limit) + throws QueryException { + ArrayList list = new ArrayList(); + return list; + } + + @Override + public List doHQL(String hql, Map params, boolean lockForUpdate) + throws QueryException { + ArrayList list = new ArrayList(); + return list; + } + + @Override + public List doHQL(String hql, Map params, + @SuppressWarnings("rawtypes") Map collectionParams) + throws QueryException { + ArrayList list = new ArrayList(); + return list; + } + + @Override + public List doHQL(String hql, Map params, + @SuppressWarnings("rawtypes") Map collectionParams, boolean lockForUpdate, int start, int limit) + throws QueryException { + ArrayList list = new ArrayList(); + return list; + } + + @Override + public boolean addRecord(DAObject record) { + return false; + } + + @Override + public boolean deleteRecord(DAObject record) { + return false; + } + + @Override + public boolean addRecords(List records) { + return false; + } + + @Override + public boolean deleteRecords(List records) { + return false; + } + + @Override + public Logger logger() { + return logger; + } + + @Override + public boolean startDBSession() { + return false; + } + + @Override + public boolean commitDBSession() { + return false; + } + + @Override + public boolean rollbackDBSession() { + return false; + } + + @Override + public boolean flushDBSession() { + return false; + } + + @Override + public boolean isDBSessionActive() { + return false; + } + + @Override + public T attachObjectToDBSession(T obj) { + @SuppressWarnings("unchecked") + T t = (T) new Bug(); + t.setId(1); + + return t; + } + + @Override + public int executeUpdate(String hql, Map params) + throws QueryException { + return 1; + } + + @Override + public boolean startUp() { + return false; + } + + @Override + public void shutDown() { + shutDown = false; + } + + @Override + public void setInitParams(BundleContext bc, Logger l) { + logger = l; + } + + @Override + public void logSQLException(SQLException e) { + String message = "sqle"; + logger.warn(message); + } + + @Override + public void logExceptionAndTerminateSession(Exception e) { + String message = "e"; + logger.warn(message); + } + + @Override + protected boolean checkSession() { + return false; + } + + @Override + public T doFindObjectById(Class daoClass, long id, boolean useLock) { + @SuppressWarnings("unchecked") + T t = (T) new Bug(); + t.setId(1); + + return t; + } + +} diff --git a/alitheia/core/src/test/java/eu/sqooss/impl/service/db/DummyLogger.java b/alitheia/core/src/test/java/eu/sqooss/impl/service/db/DummyLogger.java new file mode 100644 index 000000000..cdfc5efa0 --- /dev/null +++ b/alitheia/core/src/test/java/eu/sqooss/impl/service/db/DummyLogger.java @@ -0,0 +1,56 @@ +package eu.sqooss.impl.service.db; + +import eu.sqooss.service.logging.Logger; + + +public class DummyLogger implements Logger { + + private String message; + + public DummyLogger() {} + + public String getMessage() { + return message; + } + + @Override + public void debug(String message) { + // TODO Auto-generated method stub + + } + + @Override + public void info(String message) { + this.message = message; + } + + @Override + public void warn(String message) { + this.message = message; + } + + @Override + public void warn(String message, Exception e) { + // TODO Auto-generated method stub + + } + + @Override + public void error(String message) { + // TODO Auto-generated method stub + + } + + @Override + public void error(String message, Exception e) { + // TODO Auto-generated method stub + + } + + @Override + public String getName() { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/alitheia/core/src/test/java/eu/sqooss/impl/service/updater/DummyUpdaterServiceImpl.java b/alitheia/core/src/test/java/eu/sqooss/impl/service/updater/DummyUpdaterServiceImpl.java new file mode 100644 index 000000000..4d7218bb8 --- /dev/null +++ b/alitheia/core/src/test/java/eu/sqooss/impl/service/updater/DummyUpdaterServiceImpl.java @@ -0,0 +1,96 @@ +package eu.sqooss.impl.service.updater; + +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentMap; + +import eu.sqooss.impl.service.cluster.ClusterNodeServiceImpl; +import eu.sqooss.service.cluster.ClusterNodeService; +import eu.sqooss.service.db.StoredProject; +import eu.sqooss.service.logging.Logger; +import eu.sqooss.service.scheduler.Job; +import eu.sqooss.service.scheduler.SchedulerException; +import eu.sqooss.service.updater.MetadataUpdater; +import eu.sqooss.service.updater.Updater; +import eu.sqooss.service.util.BidiMap; + +public class DummyUpdaterServiceImpl extends UpdaterServiceImpl { + + public DummyUpdaterServiceImpl() {} + + @Override + public Set getUpdaters(StoredProject sp, UpdaterStage st) { + HashSet set = new HashSet(); + return set; + } + + @Override + public synchronized boolean isUpdateRunning(StoredProject p, Updater u) { + return false; + } + + @Override + protected ClusterNodeService getClusterNodeService() { + ClusterNodeService clusterNodeService = new ClusterNodeServiceImpl(); + return clusterNodeService; + } + + @Override + protected void enqueueBlockOfScheduler(List toQueue) throws SchedulerException {} + + @Override + protected MetadataUpdater getMetadataUpdater(Updater u) throws InstantiationException, IllegalAccessException { + return null; + } + + @Override + protected void setUpdateParams(MetadataUpdater upd, StoredProject project, Logger logger) {} + + + public void setLogger(Logger logger) { + this.logger = logger; + } + + public ConcurrentMap> getScheduledUpdates() { + return scheduledUpdates; + } + + public void setScheduledUpdates(ConcurrentMap> scheduledUpdates) { + this.scheduledUpdates = scheduledUpdates; + } + + public List getJobs() { + return jobs; + } + + public void setJobs(List jobs) { + this.jobs = jobs; + } + + public BidiMap getToSchedule() { + return toSchedule; + } + + public void setToSchedule(BidiMap toSchedule) { + this.toSchedule = toSchedule; + } + + public DependencyJob getOldDepJob() { + return oldDepJob; + } + + public List getUpdForStage() { + return updForStage; + } + + public void setUpdForStage(List updForStage) { + this.updForStage = updForStage; + } + + public void setUpdaters(BidiMap> updaters) { + this.updaters = updaters; + } + +} \ No newline at end of file diff --git a/alitheia/core/src/test/java/eu/sqooss/impl/service/updater/UpdaterServiceImplTest.java b/alitheia/core/src/test/java/eu/sqooss/impl/service/updater/UpdaterServiceImplTest.java new file mode 100644 index 000000000..c2d077ff1 --- /dev/null +++ b/alitheia/core/src/test/java/eu/sqooss/impl/service/updater/UpdaterServiceImplTest.java @@ -0,0 +1,114 @@ +package eu.sqooss.impl.service.updater; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; + +import org.junit.Before; +import org.junit.Test; + +import eu.sqooss.impl.service.db.DummyLogger; +import eu.sqooss.impl.service.updater.UpdaterServiceImpl.DependencyJob; +import eu.sqooss.service.db.DummyStoredProject; +import eu.sqooss.service.scheduler.Job; +import eu.sqooss.service.scheduler.SchedulerException; +import eu.sqooss.service.updater.MetadataUpdater; +import eu.sqooss.service.updater.Updater; +import eu.sqooss.service.updater.UpdaterService.UpdaterStage; +import eu.sqooss.service.util.BidiMap; +import static org.hamcrest.CoreMatchers.not; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertThat; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +public class UpdaterServiceImplTest { + + private DummyUpdaterServiceImpl testUpdaterServiceImpl; + + private DummyStoredProject testStoredProject; + + private Updater testUpdater; + + private DependencyJob testDependencyJob; + + private BidiMap> updaters; + + private BidiMap toSchedule; + + private ArrayList jobs; + + @Before + public void setUp() throws InstantiationException, IllegalAccessException { + testUpdaterServiceImpl = new DummyUpdaterServiceImpl(); + testStoredProject = new DummyStoredProject(); + testUpdater = mock(Updater.class); + testDependencyJob = testUpdaterServiceImpl.new DependencyJob(); + toSchedule = new BidiMap(); + jobs = new ArrayList(); + + when(testUpdater.dependencies()).thenReturn(new String[0]); + + ArrayList updForStorage = new ArrayList(); + updForStorage.add(testUpdater); + testUpdaterServiceImpl.setUpdForStage(updForStorage); + + testUpdaterServiceImpl.setUpdaters(updaters); + testUpdaterServiceImpl.setToSchedule(toSchedule); + testUpdaterServiceImpl.setJobs(jobs); + } + + @Test + public void testEnqueueJobs() throws SchedulerException { + jobs.add(testDependencyJob); + testUpdaterServiceImpl.setJobs(jobs); + + ConcurrentMap> scheduledUpdates = new ConcurrentHashMap>(); + testUpdaterServiceImpl.setScheduledUpdates(scheduledUpdates); + + testUpdaterServiceImpl.enqueueJobs(testStoredProject); + + boolean scheduledUpdatedEmpy = testUpdaterServiceImpl.getScheduledUpdates().isEmpty(); + assertFalse(scheduledUpdatedEmpy); + } + + @Test + public void testScheduleUpdaters() throws InstantiationException, IllegalAccessException, SchedulerException { + testUpdaterServiceImpl.scheduleUpdaters(testStoredProject, testUpdater, testDependencyJob); + + assertFalse(testUpdaterServiceImpl.getToSchedule().isEmpty()); + assertFalse(testUpdaterServiceImpl.getJobs().isEmpty()); + } + + @Test + public void testSetListOfJobs() { + List stages = new ArrayList(); + UpdaterStage updaterStage = UpdaterStage.DEFAULT; + stages.add(updaterStage); + + ConcurrentMap> scheduledUpdates = new ConcurrentHashMap>(); + testUpdaterServiceImpl.setScheduledUpdates(scheduledUpdates); + + testUpdaterServiceImpl.setListOfJobs(stages, testStoredProject, testUpdater); + + assertThat(null, not(testUpdaterServiceImpl.getOldDepJob())); + assertThat(null, not(testUpdaterServiceImpl.getUpdForStage())); + } + + @Test + public void testUpdate() { + DummyLogger testLogger = new DummyLogger(); + testUpdaterServiceImpl.setLogger(testLogger); + + ConcurrentMap> scheduledUpdates = new ConcurrentHashMap>(); + testUpdaterServiceImpl.setScheduledUpdates(scheduledUpdates); + + testUpdaterServiceImpl.update(testStoredProject, null, null); + + assertEquals("Request to update project:null stage:null updater:null", testLogger.getMessage()); + } + +} diff --git a/alitheia/core/src/test/java/eu/sqooss/impl/service/webadmin/PluginsViewTest.java b/alitheia/core/src/test/java/eu/sqooss/impl/service/webadmin/PluginsViewTest.java new file mode 100644 index 000000000..b91831747 --- /dev/null +++ b/alitheia/core/src/test/java/eu/sqooss/impl/service/webadmin/PluginsViewTest.java @@ -0,0 +1,40 @@ +package eu.sqooss.impl.service.webadmin; + +import static org.junit.Assert.assertEquals; + +import org.junit.Before; +import org.junit.Test; + +import eu.sqooss.service.db.DummyPluginInfo; + +public class PluginsViewTest { + + private DummyPluginInfo testPluginInfo; + + @Before + public void setUp() { + testPluginInfo = new DummyPluginInfo(); + } + + @Test + public void testRenderPluginAttributesEmptyBuilder() { + String render = PluginsView.renderPluginAttributes(testPluginInfo, false, false, 0); + assertEquals("", render); + } + + @Test + public void testRenderPluginAttributesShowProperties() { + String render = PluginsView.renderPluginAttributes(testPluginInfo, true, false, 0); + String expected = "  \n Property: " + + "null Type: null Value: null\n\n"; + + assertEquals(expected, render); + } + + @Test + public void testRenderPluginAttributesShowActivators() { + String render = PluginsView.renderPluginAttributes(testPluginInfo, false, true, 0); + assertEquals("", render); + } + +} \ No newline at end of file diff --git a/alitheia/core/src/test/java/eu/sqooss/rest/api/DummyMetricsResource.java b/alitheia/core/src/test/java/eu/sqooss/rest/api/DummyMetricsResource.java new file mode 100644 index 000000000..ba6f635d9 --- /dev/null +++ b/alitheia/core/src/test/java/eu/sqooss/rest/api/DummyMetricsResource.java @@ -0,0 +1,95 @@ +package eu.sqooss.rest.api; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import javax.ws.rs.PathParam; + +import eu.sqooss.service.abstractmetric.Result; +import eu.sqooss.service.db.Metric; +import eu.sqooss.service.db.MetricType; + +class DummyMetricsResource extends MetricsResource { + + public DummyMetricsResource() {} + + @Override + public List getMetrics() { + ArrayList list = new ArrayList(); + Metric metric = new Metric(); + metric.setId(1); + list.add(metric); + + return list; + } + + @Override + public List getMetricTypes() { + ArrayList list = new ArrayList(); + MetricType metricType = new MetricType(); + metricType.setId(1); + list.add(metricType); + + return list; + } + + @Override + public Metric getMetricById(@PathParam("id") Long id) { + Metric metric = new Metric(); + metric.setDescription("Metric"); + + return metric; + } + + @Override + public List getMetricResult(@PathParam("id") Long id, + @PathParam("rid") String resourceIds) { + ArrayList list = new ArrayList(); + Result result = new Result(); + result.setMetricId((long) 1); + list.add(result); + + return list; + } + + @Override + public List getResult(Metric m, String resourceIds) { + ArrayList list = new ArrayList(); + Result result = new Result(); + result.setMetricId((long) 1); + list.add(result); + + return list; + } + + @Override + public Metric getMetricByMnem(@PathParam("mnem") String name) { + Metric metric = new Metric(); + metric.setId((long) 1); + + return metric; + } + + @Override + public List getMetricResultByMnem(@PathParam("mnem") String name, + @PathParam("rid") String resourceIds) { + ArrayList list = new ArrayList(); + Result result = new Result(); + result.setMetricId((long) 1); + list.add(result); + + return list; + } + + @Override + public Set getMetricByType(@PathParam("type") String type) { + HashSet set = new HashSet(); + Metric metric = new Metric(); + set.add(metric); + + return set; + } + +} \ No newline at end of file diff --git a/alitheia/core/src/test/java/eu/sqooss/rest/api/DummyStoredProjectResource.java b/alitheia/core/src/test/java/eu/sqooss/rest/api/DummyStoredProjectResource.java new file mode 100644 index 000000000..66b6f7928 --- /dev/null +++ b/alitheia/core/src/test/java/eu/sqooss/rest/api/DummyStoredProjectResource.java @@ -0,0 +1,123 @@ +package eu.sqooss.rest.api; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import javax.ws.rs.PathParam; + +import eu.sqooss.service.db.ProjectFile; +import eu.sqooss.service.db.ProjectVersion; +import eu.sqooss.service.db.StoredProject; + +public class DummyStoredProjectResource extends StoredProjectResource { + + public DummyStoredProjectResource() {} + + @Override + public List getProjects() { + ArrayList list = new ArrayList(); + StoredProject storedProject = new StoredProject(); + storedProject.setId(1); + list.add(storedProject); + + return list; + } + + @Override + public StoredProject getProject(@PathParam("id") String id) { + StoredProject storedProject = new StoredProject(); + storedProject.setId(1); + + return storedProject; + } + + @Override + public List getAllVersions(@PathParam("id") Long id) { + ArrayList list = new ArrayList(); + ProjectVersion projectVersion = new ProjectVersion(); + projectVersion.setId(1); + list.add(projectVersion); + + return list; + } + + @Override + public List getVersions(@PathParam("id") Long id, + @PathParam("vid") String vid) { + ArrayList list = new ArrayList(); + ProjectVersion projectVersion = new ProjectVersion(); + projectVersion.setId(1); + list.add(projectVersion); + + return list; + } + + @Override + public ProjectVersion getVersion(@PathParam("id") String prid, + @PathParam("vid") String verid) { + ProjectVersion projectVersion = new ProjectVersion(); + projectVersion.setId(1); + + return projectVersion; + } + + @Override + public List getAllFiles(@PathParam("id") String prid, + @PathParam("vid") String verid) { + ArrayList list = new ArrayList(); + ProjectFile projectFile = new ProjectFile(); + projectFile.setId(1); + list.add(projectFile); + + return list; + } + + @Override + public List getFilesInDir(@PathParam("id") String prid, + @PathParam("vid") String verid, + @PathParam("dir") String path) { + ArrayList list = new ArrayList(); + ProjectFile projectFile = new ProjectFile(); + projectFile.setId(1); + list.add(projectFile); + + return list; + } + + @Override + public Set getChangedFiles(@PathParam("id") String prid, + @PathParam("vid") String verid) { + Set set = new HashSet(); + ProjectFile projectFile = new ProjectFile(); + projectFile.setName(""); + set.add(projectFile); + + return set; + } + + @Override + public List getDirs(@PathParam("id") String prid, + @PathParam("vid") String verid) { + ArrayList list = new ArrayList(); + ProjectFile projectFile = new ProjectFile(); + projectFile.setId(1); + list.add(projectFile); + + return list; + } + + @Override + public List getDirs(@PathParam("id") String prid, + @PathParam("vid") String verid, + @PathParam("dir") String path) { + ArrayList list = new ArrayList(); + ProjectFile projectFile = new ProjectFile(); + projectFile.setId(1); + list.add(projectFile); + + return list; + } + +} \ No newline at end of file diff --git a/alitheia/core/src/test/java/eu/sqooss/rest/api/MetricsResourceTest.java b/alitheia/core/src/test/java/eu/sqooss/rest/api/MetricsResourceTest.java new file mode 100644 index 000000000..c53e3d879 --- /dev/null +++ b/alitheia/core/src/test/java/eu/sqooss/rest/api/MetricsResourceTest.java @@ -0,0 +1,78 @@ +package eu.sqooss.rest.api; + +import static org.hamcrest.CoreMatchers.not; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; + +import java.util.Set; + +import org.junit.Before; +import org.junit.Test; + +import eu.sqooss.service.abstractmetric.Result; +import eu.sqooss.service.db.Metric; +import eu.sqooss.service.db.MetricType; + +public class MetricsResourceTest { + + private DummyMetricsResource dummyMetricsResource; + + @Before + public void setUp() { + dummyMetricsResource = new DummyMetricsResource(); + } + + @Test + public void testMetricsResource() { + assertThat(null, not(dummyMetricsResource)); + } + + @Test + public void testGetMetrics() { + Metric metric = dummyMetricsResource.getMetrics().get(0); + assertEquals(1, metric.getId()); + } + + @Test + public void testGetMetricTypes() { + MetricType metricType = dummyMetricsResource.getMetricTypes().get(0); + assertEquals(1, metricType.getId()); + } + + @Test + public void testGetMetricById() { + Metric metric = dummyMetricsResource.getMetricById((long) 1); + assertEquals("Metric", metric.getDescription()); + } + + @Test + public void testGetMetricResult() { + Result result = dummyMetricsResource.getMetricResult((long) 1, "").get(0); + assertEquals(1, result.getMetricId().intValue()); + } + + @Test + public void testGetResult() { + Result result = dummyMetricsResource.getResult(new Metric(), "").get(0); + assertEquals(1, result.getMetricId().intValue()); + } + + @Test + public void testGetMetricByMnem() { + Metric metric = dummyMetricsResource.getMetricByMnem(""); + assertEquals(1, metric.getId()); + } + + @Test + public void testGetMetricResultByMnem() { + Result result = dummyMetricsResource.getMetricResultByMnem("", "").get(0); + assertEquals(1, result.getMetricId().intValue()); + } + + @Test + public void testGetMetricByType() { + Set set = dummyMetricsResource.getMetricByType(""); + assertEquals(1, set.size()); + } + +} diff --git a/alitheia/core/src/test/java/eu/sqooss/rest/api/StoredProjectResourceTest.java b/alitheia/core/src/test/java/eu/sqooss/rest/api/StoredProjectResourceTest.java new file mode 100644 index 000000000..2703d3063 --- /dev/null +++ b/alitheia/core/src/test/java/eu/sqooss/rest/api/StoredProjectResourceTest.java @@ -0,0 +1,90 @@ +package eu.sqooss.rest.api; + +import static org.hamcrest.CoreMatchers.not; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; + +import java.util.Set; + +import org.junit.Before; +import org.junit.Test; + +import eu.sqooss.service.db.ProjectFile; +import eu.sqooss.service.db.ProjectVersion; +import eu.sqooss.service.db.StoredProject; + +public class StoredProjectResourceTest { + + private DummyStoredProjectResource dummyStoredProjectResource; + + @Before + public void setUp() { + dummyStoredProjectResource = new DummyStoredProjectResource(); + } + + @Test + public void testStoredProjectResource() { + assertThat(null, not(dummyStoredProjectResource)); + } + + @Test + public void testGetProjects() { + StoredProject storedProject = dummyStoredProjectResource.getProjects().get(0); + assertEquals(1, storedProject.getId()); + } + + @Test + public void testGetProject() { + StoredProject storedProject = dummyStoredProjectResource.getProject(""); + assertEquals(1, storedProject.getId()); + } + + @Test + public void testGetAllVersions() { + ProjectVersion projectVersion = dummyStoredProjectResource.getAllVersions((long) 1).get(0); + assertEquals(1, projectVersion.getId()); + } + + @Test + public void testGetVersions() { + ProjectVersion projectVersion = dummyStoredProjectResource.getVersions((long) 1, "").get(0); + assertEquals(1, projectVersion.getId()); + } + + @Test + public void testGetVersion() { + ProjectVersion projectVersion = dummyStoredProjectResource.getVersion("", ""); + assertEquals(1, projectVersion.getId()); + } + + @Test + public void testGetAllFiles() { + ProjectFile projectFile = dummyStoredProjectResource.getAllFiles("", "").get(0); + assertEquals(1, projectFile.getId()); + } + + @Test + public void testGetFilesInDir() { + ProjectFile projectFile = dummyStoredProjectResource.getFilesInDir("", "", "").get(0); + assertEquals(1, projectFile.getId()); + } + + @Test + public void testGetChangedFiles() { + Set set = dummyStoredProjectResource.getChangedFiles("", ""); + assertEquals(1, set.size()); + } + + @Test + public void testGetDirs2Param() { + ProjectFile projectFile = dummyStoredProjectResource.getDirs("", "").get(0); + assertEquals(1, projectFile.getId()); + } + + @Test + public void testGetDirs3Param() { + ProjectFile projectFile = dummyStoredProjectResource.getDirs("", "", "").get(0); + assertEquals(1, projectFile.getId()); + } + +} diff --git a/alitheia/core/src/test/java/eu/sqooss/service/admin/actions/DummyRunTimeInfo.java b/alitheia/core/src/test/java/eu/sqooss/service/admin/actions/DummyRunTimeInfo.java new file mode 100644 index 000000000..16d1fffa9 --- /dev/null +++ b/alitheia/core/src/test/java/eu/sqooss/service/admin/actions/DummyRunTimeInfo.java @@ -0,0 +1,28 @@ +package eu.sqooss.service.admin.actions; + +import java.util.HashMap; +import java.util.Map; + +import eu.sqooss.service.scheduler.SchedulerStats; + + +public class DummyRunTimeInfo extends RunTimeInfo { + + private Map results; + + public DummyRunTimeInfo() { + results = new HashMap(); + } + + @Override + public Map results() { + return results; + } + + @Override + public SchedulerStats getSchedulerStats() { + SchedulerStats schedulerStats = new SchedulerStats(); + return schedulerStats; + } + +} \ No newline at end of file diff --git a/alitheia/core/src/test/java/eu/sqooss/service/admin/actions/RunTimeInfoTest.java b/alitheia/core/src/test/java/eu/sqooss/service/admin/actions/RunTimeInfoTest.java new file mode 100644 index 000000000..a41103244 --- /dev/null +++ b/alitheia/core/src/test/java/eu/sqooss/service/admin/actions/RunTimeInfoTest.java @@ -0,0 +1,40 @@ +package eu.sqooss.service.admin.actions; + +import static org.hamcrest.CoreMatchers.not; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; + +import org.junit.Before; +import org.junit.Test; + +import eu.sqooss.service.admin.AdminAction.AdminActionStatus; +import eu.sqooss.service.scheduler.SchedulerStats; + +public class RunTimeInfoTest { + + private DummyRunTimeInfo testRunTimeInfo; + + @Before + public void setUp() { + testRunTimeInfo = new DummyRunTimeInfo(); + } + + @Test + public void testGetSchedulerStats() { + SchedulerStats testSchedulerStats = testRunTimeInfo.getSchedulerStats(); + assertThat(null, not(testSchedulerStats)); + } + + @Test + public void testExecute() { + try { + testRunTimeInfo.execute(); + AdminActionStatus expectedStatus = AdminActionStatus.FINISHED; + + assertEquals(expectedStatus, testRunTimeInfo.status()); + } catch (Exception e) { + e.printStackTrace(); + } + } + +} \ No newline at end of file diff --git a/alitheia/core/src/test/java/eu/sqooss/service/db/ClusterNodeTest.java b/alitheia/core/src/test/java/eu/sqooss/service/db/ClusterNodeTest.java new file mode 100644 index 000000000..c95beb69e --- /dev/null +++ b/alitheia/core/src/test/java/eu/sqooss/service/db/ClusterNodeTest.java @@ -0,0 +1,73 @@ +package eu.sqooss.service.db; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import eu.sqooss.impl.service.db.DummyLogger; +import eu.sqooss.service.cluster.ClusterNodeActionException; + +import org.junit.Before; +import org.junit.Test; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +public class ClusterNodeTest { + + private DummyClusterNode testClusterNode; + + private DummyLogger testLogger; + + private StoredProject testStoredProject; + + @Before + public void setUp() { + testClusterNode = new DummyClusterNode(); + testLogger = new DummyLogger(); + testStoredProject = mock(StoredProject.class); + } + + @Test + public void testAssignProjectNullClusterNode() { + try { + testClusterNode.assignProject(testLogger, null, testStoredProject); + } catch (ClusterNodeActionException e) { + assertEquals("[ClusterNode] Request to assign a project to a null clusternode", e.getMessage()); + } + } + + @Test + public void testAssignProjectNullStoredProject() { + try { + testClusterNode.assignProject(testLogger, testClusterNode, null); + } catch (ClusterNodeActionException e) { + assertEquals("[ClusterNode] Request to assign a null project to a clusternode", e.getMessage()); + } + } + + @Test + public void testAssignProjectClusterNodeInProjectNull() { + try { + boolean assignProject = testClusterNode.assignProject(testLogger, testClusterNode, testStoredProject); + + assertEquals("Assigning project null to null", testLogger.getMessage()); + assertTrue(assignProject); + } catch (ClusterNodeActionException e) { + e.printStackTrace(); + } + } + + @Test + public void testAssignProjectClusterNodeInProject() { + when(testStoredProject.getClusternode()).thenReturn(testClusterNode); + + try { + boolean assignProject = testClusterNode.assignProject(testLogger, testClusterNode, testStoredProject); + + assertEquals("No need to move null - Already assigned!", testLogger.getMessage()); + assertTrue(assignProject); + } catch (ClusterNodeActionException e) { + e.printStackTrace(); + } + } + +} \ No newline at end of file diff --git a/alitheia/core/src/test/java/eu/sqooss/service/db/DummyClusterNode.java b/alitheia/core/src/test/java/eu/sqooss/service/db/DummyClusterNode.java new file mode 100644 index 000000000..1abb2ada2 --- /dev/null +++ b/alitheia/core/src/test/java/eu/sqooss/service/db/DummyClusterNode.java @@ -0,0 +1,21 @@ +package eu.sqooss.service.db; + +import java.util.HashSet; +import java.util.Set; + +public class DummyClusterNode extends ClusterNode { + + private StoredProject storedProject; + + public DummyClusterNode() {} + + @Override + public Set getProjects() { + HashSet set = new HashSet(); + storedProject = new StoredProject(); + set.add(storedProject); + + return set; + } + +} \ No newline at end of file diff --git a/alitheia/core/src/test/java/eu/sqooss/service/db/DummyPluginConfiguration.java b/alitheia/core/src/test/java/eu/sqooss/service/db/DummyPluginConfiguration.java new file mode 100644 index 000000000..a6e840a99 --- /dev/null +++ b/alitheia/core/src/test/java/eu/sqooss/service/db/DummyPluginConfiguration.java @@ -0,0 +1,14 @@ +package eu.sqooss.service.db; + +import eu.sqooss.service.pa.PluginInfo; + +public class DummyPluginConfiguration extends PluginConfiguration { + + public DummyPluginConfiguration() {} + + @Override + protected boolean addConfiguration(PluginInfo pluginInfo, String name, String description, String type, String value) { + return false; + } + +} \ No newline at end of file diff --git a/alitheia/core/src/test/java/eu/sqooss/service/db/DummyPluginInfo.java b/alitheia/core/src/test/java/eu/sqooss/service/db/DummyPluginInfo.java new file mode 100644 index 000000000..913530e04 --- /dev/null +++ b/alitheia/core/src/test/java/eu/sqooss/service/db/DummyPluginInfo.java @@ -0,0 +1,27 @@ +package eu.sqooss.service.db; + +import java.util.HashSet; +import java.util.Set; + +import eu.sqooss.service.pa.PluginInfo; + +public class DummyPluginInfo extends PluginInfo { + + public DummyPluginInfo() {} + + @Override + public Set getConfiguration() { + HashSet set = new HashSet(); + PluginConfiguration pluginConfiguration = new PluginConfiguration(); + set.add(pluginConfiguration); + + return set; + } + + @Override + public Set> getActivationTypes() { + HashSet> set = new HashSet>(); + return set; + } + +} \ No newline at end of file diff --git a/alitheia/core/src/test/java/eu/sqooss/service/db/DummyStoredProject.java b/alitheia/core/src/test/java/eu/sqooss/service/db/DummyStoredProject.java new file mode 100644 index 000000000..18ddd73d6 --- /dev/null +++ b/alitheia/core/src/test/java/eu/sqooss/service/db/DummyStoredProject.java @@ -0,0 +1,7 @@ +package eu.sqooss.service.db; + +public class DummyStoredProject extends StoredProject { + + public DummyStoredProject() {} + +} \ No newline at end of file diff --git a/alitheia/core/src/test/java/eu/sqooss/service/db/PluginConfigurationTest.java b/alitheia/core/src/test/java/eu/sqooss/service/db/PluginConfigurationTest.java new file mode 100644 index 000000000..dc2cfe60e --- /dev/null +++ b/alitheia/core/src/test/java/eu/sqooss/service/db/PluginConfigurationTest.java @@ -0,0 +1,103 @@ +package eu.sqooss.service.db; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; + +import org.junit.Before; +import org.junit.Test; + +public class PluginConfigurationTest { + + private DummyPluginConfiguration testPluginConfiguration; + + private DummyPluginInfo testPluginInfo; + + @Before + public void setUp() { + testPluginConfiguration = new DummyPluginConfiguration(); + testPluginInfo = new DummyPluginInfo(); + } + + @Test + public void testAddConfigEntryInvalidName() { + try { + testPluginConfiguration.addConfigEntry(testPluginInfo, null, "", "", ""); + } catch (Exception e) { + assertEquals("Invalid name!", e.getMessage()); + } + } + + @Test + public void testAddConfigEntryInvalidType() { + try { + testPluginConfiguration.addConfigEntry(testPluginInfo, "", "", null, ""); + } catch (Exception e) { + assertEquals("Invalid type!", e.getMessage()); + } + } + + @Test + public void testAddConfigEntryInvalidConfigType() { + try { + testPluginConfiguration.addConfigEntry(testPluginInfo, "", "", "", ""); + } catch (Exception e) { + assertEquals("Invalid type!", e.getMessage()); + } + } + + @Test + public void testAddConfigEntryInvalidValue() { + try { + testPluginConfiguration.addConfigEntry(testPluginInfo, "", "", "BOOLEAN", null); + } catch (Exception e) { + assertEquals("Invalid value!", e.getMessage()); + } + } + + @Test + public void testAddConfigEntryInvalidBooleanValue() { + try { + testPluginConfiguration.addConfigEntry(testPluginInfo, "", "", "BOOLEAN", ""); + } catch (Exception e) { + assertEquals("Not a valid boolean value!", e.getMessage()); + } + } + + @Test + public void testAddConfigEntryInvalidIntegerValue() { + try { + testPluginConfiguration.addConfigEntry(testPluginInfo, "", "", "INTEGER", ""); + } catch (Exception e) { + assertEquals("Not a valid integer value!", e.getMessage()); + } + } + + @Test + public void testAddConfigEntryInvalidDoubleValue() { + try { + testPluginConfiguration.addConfigEntry(testPluginInfo, "", "", "DOUBLE", ""); + } catch (Exception e) { + assertEquals("Not a valid double value!", e.getMessage()); + } + } + + @Test + public void testAddConfiguration() { + boolean addConfiguration = testPluginConfiguration.addConfiguration(testPluginInfo, "", "", "", ""); + + assertFalse(addConfiguration); + } + + @Test + public void testAddConfigEntry() { + try { + boolean addConfigEntry = testPluginConfiguration.addConfigEntry(testPluginInfo, "", "", "BOOLEAN", "false"); + + assertFalse(addConfigEntry); + } catch (Exception e) { + e.printStackTrace(); + } + + } + +} \ No newline at end of file diff --git a/alitheia/core/src/test/java/eu/sqooss/service/scheduler/SchedulerStatsTest.java b/alitheia/core/src/test/java/eu/sqooss/service/scheduler/SchedulerStatsTest.java new file mode 100644 index 000000000..2a1b4ccf2 --- /dev/null +++ b/alitheia/core/src/test/java/eu/sqooss/service/scheduler/SchedulerStatsTest.java @@ -0,0 +1,33 @@ +package eu.sqooss.service.scheduler; + +import static org.junit.Assert.assertEquals; + +import org.junit.Before; +import org.junit.Test; + +import eu.sqooss.service.admin.actions.DummyRunTimeInfo; + +public class SchedulerStatsTest { + + private SchedulerStats testSchedulerStats; + + private DummyRunTimeInfo testRunTimeInfo; + + @Before + public void setUp() { + testSchedulerStats = new SchedulerStats(); + testRunTimeInfo = new DummyRunTimeInfo(); + } + + @Test + public void testStatsForExecute() throws Exception { + testSchedulerStats.statsForExecute(testRunTimeInfo); + + assertEquals((long) 0, testRunTimeInfo.results().get("sched.jobs.failed")); + assertEquals((long) 0, testRunTimeInfo.results().get("sched.jobs.wait")); + assertEquals((long) 0, testRunTimeInfo.results().get("sched.jobs.finished")); + assertEquals((long) 0, testRunTimeInfo.results().get("sched.threads.idle")); + assertEquals((long) 0, testRunTimeInfo.results().get("sched.threads.total")); + } + +} \ No newline at end of file diff --git a/alitheia/core/updater.log b/alitheia/core/updater.log new file mode 100644 index 000000000..e69de29bb diff --git a/alitheia/core/webadmin.log b/alitheia/core/webadmin.log new file mode 100644 index 000000000..e69de29bb diff --git a/metrics/contrib/maven-eclipse.xml b/metrics/contrib/maven-eclipse.xml new file mode 100644 index 000000000..9ff04ecea --- /dev/null +++ b/metrics/contrib/maven-eclipse.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/plug-ins/svn/src/main/java/eu/sqooss/plugins/updater/svn/SVNUpdaterImpl.java b/plug-ins/svn/src/main/java/eu/sqooss/plugins/updater/svn/SVNUpdaterImpl.java index 32e1a05a5..1d2bdc5e8 100644 --- a/plug-ins/svn/src/main/java/eu/sqooss/plugins/updater/svn/SVNUpdaterImpl.java +++ b/plug-ins/svn/src/main/java/eu/sqooss/plugins/updater/svn/SVNUpdaterImpl.java @@ -328,7 +328,7 @@ private void init() { " using default:" + this.hc); } - this.ommitFileless = (System.getProperty(OMMIT_NO_FILES_VERSIONS).equals("false"))?false:true; + this.ommitFileless = true;//(System.getProperty(OMMIT_NO_FILES_VERSIONS).equals("false"))?false:true; if (ommitFileless) info("Ommiting versions with no processed files"); diff --git a/pom.xml b/pom.xml index 12683f1ee..37870506e 100644 --- a/pom.xml +++ b/pom.xml @@ -49,16 +49,16 @@ 8443 - + - H2 + diff --git a/web/runner/bundles/downloaded_bundles.properties b/web/runner/bundles/downloaded_bundles.properties new file mode 100644 index 000000000..96bf2f143 --- /dev/null +++ b/web/runner/bundles/downloaded_bundles.properties @@ -0,0 +1,10 @@ +# +#Wed Dec 03 12:31:34 CET 2014 +mvn\:org.apache.felix/org.apache.felix.webconsole/1.2.8=org.apache.felix.webconsole_1.2.8.jar +mvn\:org.osgi/org.osgi.core/4.2.0=osgi.core_4.2.0.200908310645.jar +mvn\:eu.sqooss.alitheia/core/0.95-SNAPSHOT=eu.sqooss.alitheia.core_1.0.jar +mvn\:org.apache.felix/org.apache.felix.eventadmin/1.0.0=org.apache.felix.eventadmin_1.0.0.jar +mvn\:org.osgi/org.osgi.compendium/4.2.0=osgi.cmpn_4.2.0.200908310645.jar +mvn\:org.apache.felix/org.apache.felix.scr/1.0.8=org.apache.felix.scr_1.0.8.jar +mvn\:org.apache.felix/org.apache.felix.http.jetty/1.0.1=org.apache.felix.http.jetty_1.0.1.jar +link\:classpath\:runner-links/org.eclipse.osgi-3.6.0.link=org.eclipse.osgi_3.6.0.v20100517.jar diff --git a/web/runner/bundles/eu.sqooss.alitheia.core_1.0.jar b/web/runner/bundles/eu.sqooss.alitheia.core_1.0.jar new file mode 100644 index 000000000..7ca59b78d Binary files /dev/null and b/web/runner/bundles/eu.sqooss.alitheia.core_1.0.jar differ diff --git a/web/runner/bundles/org.apache.felix.eventadmin_1.0.0.jar b/web/runner/bundles/org.apache.felix.eventadmin_1.0.0.jar new file mode 100644 index 000000000..809b46214 Binary files /dev/null and b/web/runner/bundles/org.apache.felix.eventadmin_1.0.0.jar differ diff --git a/web/runner/bundles/org.apache.felix.http.jetty_1.0.1.jar b/web/runner/bundles/org.apache.felix.http.jetty_1.0.1.jar new file mode 100644 index 000000000..1537a61ed Binary files /dev/null and b/web/runner/bundles/org.apache.felix.http.jetty_1.0.1.jar differ diff --git a/web/runner/bundles/org.apache.felix.scr_1.0.8.jar b/web/runner/bundles/org.apache.felix.scr_1.0.8.jar new file mode 100644 index 000000000..536c5a28f Binary files /dev/null and b/web/runner/bundles/org.apache.felix.scr_1.0.8.jar differ diff --git a/web/runner/bundles/org.apache.felix.webconsole_1.2.8.jar b/web/runner/bundles/org.apache.felix.webconsole_1.2.8.jar new file mode 100644 index 000000000..4b50f8021 Binary files /dev/null and b/web/runner/bundles/org.apache.felix.webconsole_1.2.8.jar differ diff --git a/web/runner/bundles/org.eclipse.osgi_3.6.0.v20100517.jar b/web/runner/bundles/org.eclipse.osgi_3.6.0.v20100517.jar new file mode 100644 index 000000000..b2bd56eb2 Binary files /dev/null and b/web/runner/bundles/org.eclipse.osgi_3.6.0.v20100517.jar differ diff --git a/web/runner/bundles/osgi.cmpn_4.2.0.200908310645.jar b/web/runner/bundles/osgi.cmpn_4.2.0.200908310645.jar new file mode 100644 index 000000000..93219d14c Binary files /dev/null and b/web/runner/bundles/osgi.cmpn_4.2.0.200908310645.jar differ diff --git a/web/runner/bundles/osgi.core_4.2.0.200908310645.jar b/web/runner/bundles/osgi.core_4.2.0.200908310645.jar new file mode 100644 index 000000000..b986ac172 Binary files /dev/null and b/web/runner/bundles/osgi.core_4.2.0.200908310645.jar differ diff --git a/web/runner/deploy-pom.xml b/web/runner/deploy-pom.xml new file mode 100644 index 000000000..7097c075a --- /dev/null +++ b/web/runner/deploy-pom.xml @@ -0,0 +1,94 @@ + + + 4.0.0 + + eu + sqooss + 0.95-SNAPSHOT + + eu.sqooss.web.build + deployment + 0.95-SNAPSHOT + pom + SQO-OSS web frontend + Alitheia Core is a platform for conducting software engineering studies. + It integrates data from various sources such as from SVN, mailing lists and bug databases. + + Being a platform, and not a concrete implementation, means that by writing the appropriate plug-ins, + you can instruct Alitheia Core to produce any measurements you are interested into and maybe + integrate those measurements in high level quality evaluations. + http://www.sqo-oss.org/web + 2006 + + Organisation for Free and Open Source Software Greece + http://www.ellak.gr/ + + + + BSD 2-clause + http://en.wikipedia.org/wiki/BSD_licenses + + + + + gousiosg + Georgios Gousios + gousiosg@gmail.com + http://istlab.dmst.aueb.gr/~george + + + bkarak + Vassilios Karakoidas + vassilios.karakoidas@gmail.com + http://bkarak.wizhut.com/ + + + + scm:git:git://git.sqo-oss.org/sqo-oss.git/web + scm:git:ssh://git@git.sqo-oss.org:sqo-oss.git/web + http://git.sqo-oss.org/web/ + + + + ac-main + Alitheia Core Main Repository + dav:https://maven.sqo-oss.org/ + + + ac-snapshot + Alitheia Core snapshot repository + dav:https://maven.sqo-oss.org/snapshot + + + + 4 + eu.sqooss.service.cache.OnDiskCache + 8443 + alitheia + 8080 + slow + alitheia + MySQL + tmp + alitheia + c3p0 + false + localhost + + + + jboss + JBoss + http://repository.jboss.org/nexus/content/groups/public/ + + + + false + + central + Central Repository + https://repo.maven.apache.org/maven2 + + + diff --git a/web/runner/equinox/.options b/web/runner/equinox/.options new file mode 100644 index 000000000..e69de29bb diff --git a/web/runner/equinox/1417606295105.log b/web/runner/equinox/1417606295105.log new file mode 100644 index 000000000..46c8dfe87 --- /dev/null +++ b/web/runner/equinox/1417606295105.log @@ -0,0 +1,26 @@ +!SESSION 2014-12-03 12:31:34.762 ----------------------------------------------- +eclipse.buildId=unknown +java.version=1.7.0_71 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US +Command-line arguments: -console -configuration equinox + +!ENTRY eu.sqooss.alitheia.core 4 0 2014-12-03 12:31:35.737 +!MESSAGE +!STACK 0 +org.osgi.framework.BundleException: The bundle "eu.sqooss.alitheia.core_1.0.0 [7]" could not be resolved. Reason: Missing Constraint: Import-Package: javassist.util; version="0.0.0" + at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1317) + at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1301) + at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:319) + at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:374) + at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1067) + at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:561) + at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:546) + at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:459) + at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243) + at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:440) + at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227) + at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:337) + +!ENTRY org.eclipse.osgi 4 0 2014-12-03 12:31:35.743 +!MESSAGE Bundle initial@reference:file:../bundles/eu.sqooss.alitheia.core_1.0.jar/ was not resolved. diff --git a/web/runner/equinox/config.ini b/web/runner/equinox/config.ini new file mode 100644 index 000000000..07e7390ff --- /dev/null +++ b/web/runner/equinox/config.ini @@ -0,0 +1,50 @@ +################################################ +# ______ ________ __ __ # +# / __ / / __ / / / / / # +# / ___/ / __ / _\ \ _/ # +# / / / / / / / _\ \ # +# /__/ /__/ /__/ /_/ /_/ # +# # +# Pax Runner from OPS4J - http://www.ops4j.org # +################################################ + +############################## +# Equinox settings +############################## +eclipse.ignoreApp=true +osgi.syspath=. +osgi.clean=true +osgi.startLevel=6 +osgi.bundles.defaultStartLevel=5 +org.osgi.framework.executionenvironment=J2SE-1.2,J2SE-1.3,J2SE-1.4,J2SE-1.5,JRE-1.1,JavaSE-1.6,JavaSE-1.7,OSGi/Minimum-1.0,OSGi/Minimum-1.1,OSGi/Minimum-1.2 +org.osgi.framework.bootdelegation=java.* +org.osgi.framework.system.packages=javax.accessibility,javax.activation,javax.activity,javax.annotation,javax.annotation.processing,javax.crypto,javax.crypto.interfaces,javax.crypto.spec,javax.imageio,javax.imageio.event,javax.imageio.metadata,javax.imageio.plugins.bmp,javax.imageio.plugins.jpeg,javax.imageio.spi,javax.imageio.stream,javax.jws,javax.jws.soap,javax.lang.model,javax.lang.model.element,javax.lang.model.type,javax.lang.model.util,javax.management,javax.management.loading,javax.management.modelmbean,javax.management.monitor,javax.management.openmbean,javax.management.relation,javax.management.remote,javax.management.remote.rmi,javax.management.timer,javax.naming,javax.naming.directory,javax.naming.event,javax.naming.ldap,javax.naming.spi,javax.net,javax.net.ssl,javax.print,javax.print.attribute,javax.print.attribute.standard,javax.print.event,javax.rmi,javax.rmi.CORBA,javax.rmi.ssl,javax.script,javax.security.auth,javax.security.auth.callback,javax.security.auth.kerberos,javax.security.auth.login,javax.security.auth.spi,javax.security.auth.x500,javax.security.cert,javax.security.sasl,javax.sound.midi,javax.sound.midi.spi,javax.sound.sampled,javax.sound.sampled.spi,javax.sql,javax.sql.rowset,javax.sql.rowset.serial,javax.sql.rowset.spi,javax.swing,javax.swing.border,javax.swing.colorchooser,javax.swing.event,javax.swing.filechooser,javax.swing.plaf,javax.swing.plaf.basic,javax.swing.plaf.metal,javax.swing.plaf.multi,javax.swing.plaf.synth,javax.swing.table,javax.swing.text,javax.swing.text.html,javax.swing.text.html.parser,javax.swing.text.rtf,javax.swing.tree,javax.swing.undo,javax.tools,javax.transaction,javax.transaction.xa,javax.xml,javax.xml.bind,javax.xml.bind.annotation,javax.xml.bind.annotation.adapters,javax.xml.bind.attachment,javax.xml.bind.helpers,javax.xml.bind.util,javax.xml.crypto,javax.xml.crypto.dom,javax.xml.crypto.dsig,javax.xml.crypto.dsig.dom,javax.xml.crypto.dsig.keyinfo,javax.xml.crypto.dsig.spec,javax.xml.datatype,javax.xml.namespace,javax.xml.parsers,javax.xml.soap,javax.xml.stream,javax.xml.stream.events,javax.xml.stream.util,javax.xml.transform,javax.xml.transform.dom,javax.xml.transform.sax,javax.xml.transform.stax,javax.xml.transform.stream,javax.xml.validation,javax.xml.ws,javax.xml.ws.handler,javax.xml.ws.handler.soap,javax.xml.ws.http,javax.xml.ws.soap,javax.xml.ws.spi,javax.xml.xpath,org.ietf.jgss,org.omg.CORBA,org.omg.CORBA.DynAnyPackage,org.omg.CORBA.ORBPackage,org.omg.CORBA.TypeCodePackage,org.omg.CORBA.portable,org.omg.CORBA_2_3,org.omg.CORBA_2_3.portable,org.omg.CosNaming,org.omg.CosNaming.NamingContextExtPackage,org.omg.CosNaming.NamingContextPackage,org.omg.Dynamic,org.omg.DynamicAny,org.omg.DynamicAny.DynAnyFactoryPackage,org.omg.DynamicAny.DynAnyPackage,org.omg.IOP,org.omg.IOP.CodecFactoryPackage,org.omg.IOP.CodecPackage,org.omg.Messaging,org.omg.PortableInterceptor,org.omg.PortableInterceptor.ORBInitInfoPackage,org.omg.PortableServer,org.omg.PortableServer.CurrentPackage,org.omg.PortableServer.POAManagerPackage,org.omg.PortableServer.POAPackage,org.omg.PortableServer.ServantLocatorPackage,org.omg.PortableServer.portable,org.omg.SendingContext,org.omg.stub.java.rmi,org.w3c.dom,org.w3c.dom.bootstrap,org.w3c.dom.css,org.w3c.dom.events,org.w3c.dom.html,org.w3c.dom.ls,org.w3c.dom.ranges,org.w3c.dom.stylesheets,org.w3c.dom.traversal,org.w3c.dom.views ,org.xml.sax,org.xml.sax.ext,org.xml.sax.helpers + +############################## +# Client bundles to install +############################## +osgi.bundles=\ +reference:file:bundles/osgi.core_4.2.0.200908310645.jar@2:start,\ +reference:file:bundles/osgi.cmpn_4.2.0.200908310645.jar@2:start,\ +reference:file:bundles/org.apache.felix.webconsole_1.2.8.jar@2:start,\ +reference:file:bundles/org.apache.felix.scr_1.0.8.jar@2:start,\ +reference:file:bundles/org.apache.felix.http.jetty_1.0.1.jar@2:start,\ +reference:file:bundles/org.apache.felix.eventadmin_1.0.0.jar@2:start,\ +reference:file:bundles/eu.sqooss.alitheia.core_1.0.jar@3:start + +############################## +# System properties +############################## +eu.sqooss.scheduler.numthreads=4 +eu.sqooss.service.cache.impl=eu.sqooss.service.cache.OnDiskCache +org.osgi.service.http.port.secure=8443 +eu.sqooss.db.user=alitheia +org.osgi.service.http.port=8080 +eu.sqooss.metricactivator.sync=slow +eu.sqooss.db.passwd=alitheia +eu.sqooss.db=MySQL +eu.sqooss.service.cache.dir=tmp +eu.sqooss.db.schema=alitheia +eu.sqooss.db.conpool=c3p0 +eu.sqooss.log.perf=false +eu.sqooss.db.host=localhost diff --git a/web/runner/equinox/org.eclipse.osgi/.bundledata.1 b/web/runner/equinox/org.eclipse.osgi/.bundledata.1 new file mode 100644 index 000000000..ee370b85f Binary files /dev/null and b/web/runner/equinox/org.eclipse.osgi/.bundledata.1 differ diff --git a/web/runner/equinox/org.eclipse.osgi/.lazy.1 b/web/runner/equinox/org.eclipse.osgi/.lazy.1 new file mode 100644 index 000000000..750bec285 Binary files /dev/null and b/web/runner/equinox/org.eclipse.osgi/.lazy.1 differ diff --git a/web/runner/equinox/org.eclipse.osgi/.manager/.fileTable.4 b/web/runner/equinox/org.eclipse.osgi/.manager/.fileTable.4 new file mode 100644 index 000000000..887570e05 --- /dev/null +++ b/web/runner/equinox/org.eclipse.osgi/.manager/.fileTable.4 @@ -0,0 +1,6 @@ +#safe table +#Wed Dec 03 12:32:05 CET 2014 +.bundledata=1 +.state=0 +.lazy=0 +.crc20840e30.v1 diff --git a/web/runner/equinox/org.eclipse.osgi/.manager/.fileTable.5 b/web/runner/equinox/org.eclipse.osgi/.manager/.fileTable.5 new file mode 100644 index 000000000..890ec61b8 --- /dev/null +++ b/web/runner/equinox/org.eclipse.osgi/.manager/.fileTable.5 @@ -0,0 +1,6 @@ +#safe table +#Wed Dec 03 12:32:06 CET 2014 +.bundledata=1 +.state=1 +.lazy=1 +.crc3ab984dd.v1 diff --git a/web/runner/equinox/org.eclipse.osgi/.manager/.fileTableLock b/web/runner/equinox/org.eclipse.osgi/.manager/.fileTableLock new file mode 100644 index 000000000..e69de29bb diff --git a/web/runner/equinox/org.eclipse.osgi/.manager/.tmp4657324774424675664.instance b/web/runner/equinox/org.eclipse.osgi/.manager/.tmp4657324774424675664.instance new file mode 100644 index 000000000..e69de29bb diff --git a/web/runner/equinox/org.eclipse.osgi/.state.1 b/web/runner/equinox/org.eclipse.osgi/.state.1 new file mode 100644 index 000000000..cc3d11612 Binary files /dev/null and b/web/runner/equinox/org.eclipse.osgi/.state.1 differ diff --git a/web/runner/equinox/org.eclipse.osgi/bundles/3/1/.cp/commons-fileupload-1.1.1.jar b/web/runner/equinox/org.eclipse.osgi/bundles/3/1/.cp/commons-fileupload-1.1.1.jar new file mode 100644 index 000000000..fc5763d0d Binary files /dev/null and b/web/runner/equinox/org.eclipse.osgi/bundles/3/1/.cp/commons-fileupload-1.1.1.jar differ diff --git a/web/runner/equinox/org.eclipse.osgi/bundles/3/1/.cp/commons-io-1.4.jar b/web/runner/equinox/org.eclipse.osgi/bundles/3/1/.cp/commons-io-1.4.jar new file mode 100644 index 000000000..133dc6cb3 Binary files /dev/null and b/web/runner/equinox/org.eclipse.osgi/bundles/3/1/.cp/commons-io-1.4.jar differ diff --git a/web/runner/equinox/org.eclipse.osgi/bundles/3/1/.cp/json-20070829.jar b/web/runner/equinox/org.eclipse.osgi/bundles/3/1/.cp/json-20070829.jar new file mode 100644 index 000000000..6ac8fb841 Binary files /dev/null and b/web/runner/equinox/org.eclipse.osgi/bundles/3/1/.cp/json-20070829.jar differ diff --git a/web/runner/equinox/org.eclipse.osgi/bundles/3/1/.cp/org.apache.felix.bundlerepository-1.0.3.jar b/web/runner/equinox/org.eclipse.osgi/bundles/3/1/.cp/org.apache.felix.bundlerepository-1.0.3.jar new file mode 100644 index 000000000..7527a2342 Binary files /dev/null and b/web/runner/equinox/org.eclipse.osgi/bundles/3/1/.cp/org.apache.felix.bundlerepository-1.0.3.jar differ