        (stb03-servlets-servlet-filters)
        (stb04-database-access)
        (stb06-dont-use-transaction-service)
+       (stb07-close-all-resources)
+       (stb14-search-during-bootstrap)
        (stb18-prefer-automatic-transactions)
        (stb10-threading)
        (stb12-logging)
      )
-     (stb07-stb14-search-apis)
+     []
    )])

                       ")]
    (standard-validation "STB06" res false "The technology does not use the TransactionService.")))


(defn- stb18-prefer-automatic-transactions
  []
  (let [res (cy/tquery "
                         START n=NODE(*)
                         MATCH (n)-->(m)
                         WHERE HAS(n.name)
                           AND HAS(m.name)
                           AND m.name IN [
                                          'org.alfresco.repo.transaction.RetryingTransactionHelper',
                                          'org.alfresco.service.transaction.TransactionService'
                                         ]
                        RETURN n.name AS ClassName, COLLECT(DISTINCT m.name) AS APIs
                         ORDER BY n.name
                       ")]
    (standard-validation "STB18" res false "The technology does not manually demarcate transactions.")))

(defn- stb10-threading
  []

                         ORDER BY n.name
                       ")]
    (standard-validation "STB12" res true "The technology does not use improper logging techniques.")))

(defn- stb14-search-during-bootstrap
  []
  (let [res (cy/tquery "
                         START n=NODE(*)
                         MATCH (n)-->(m)
                         WHERE HAS(n.name)
                           AND HAS(m.name)
                           AND m.name IN [
                                           'org.alfresco.service.cmr.search.SearchService',
                                           'org.alfresco.service.cmr.search.ResultSet'
                                         ]
                        RETURN n.name AS ClassName, COLLECT(DISTINCT m.name) AS APIs
                         ORDER BY n.name
                       ")]
  (standard-validation "STB14" res true "The technology does not use the Search APIs." #(if (empty? %) true nil))))

(defn- stb18-prefer-automatic-transactions
  []
  (let [res (cy/tquery "
                         START n=NODE(*)
                         MATCH (n)-->(m)
                         WHERE HAS(n.name)
                           AND HAS(m.name)
                           AND m.name IN [
                                          'org.alfresco.repo.transaction.RetryingTransactionHelper',
                                          'org.alfresco.service.transaction.TransactionService'
                                         ]
                        RETURN n.name AS ClassName, COLLECT(DISTINCT m.name) AS APIs
                         ORDER BY n.name
                       ")]
    (standard-validation "STB18" res false "The technology does not manually demarcate transactions.")))

(defn validate
  "Runs all binary-based validations."
