Running ‘test.R’
Running the tests in ‘tests/test.R’ failed.
Complete output:
  > library(testthat)
  > library(mockr)
  
  Attaching package: 'mockr'
  
  The following object is masked from 'package:testthat':
  
      with_mock
  
  > library(corehunter)
  Loading required package: rJava
  > 
  > test_check("corehunter")
  Error in .jcall("java/lang/Class", "Ljava/lang/Class;", "forName", cl,  : 
    RcallMethod: cannot determine object class
  ── 1. Failure: arguments are checked (@testAnalysis.R#11)  ─────────────────────
  `evaluateCore(1:10, testData(), "obj")` threw an error with unexpected message.
  Expected match: "'chobj'"
  Actual message: "Java Exception <no description because toString() failed>.jfindClass(as.character(class))new(\"jobjRef\", jobj = <pointer: 0x45eaae8>, jclass = \"java/lang/Throwable\")"
  
  Error in .jcall("java/lang/Class", "Ljava/lang/Class;", "forName", cl,  : 
    RcallMethod: cannot determine object class
  ── 2. Failure: arguments are checked (@testAnalysis.R#12)  ─────────────────────
  `evaluateCore(123456, testData(), objective("EN", "PD"))` threw an error with unexpected message.
  Expected match: "unable to select"
  Actual message: "Java Exception <no description because toString() failed>.jfindClass(as.character(class))new(\"jobjRef\", jobj = <pointer: 0x45eaae8>, jclass = \"java/lang/Throwable\")"
  
  Error in .jcall("java/lang/Class", "Ljava/lang/Class;", "forName", cl,  : 
    RcallMethod: cannot determine object class
  ── 3. Error: (unknown) (@testAnalysis.R#15)  ───────────────────────────────────
  no field, method or inner class called 'handled' 
  1: test_that("larger cores are more representative but have higher redundancy", {
         data <- testData()
         objs <- list(objective("EN", "CE"), objective("AN", "PD"))
         for (obj in objs) {
             core.small <- testSampleCore(data, size = 5, obj)
             core.large <- testSampleCore(data, size = 95, obj)
             expect_gte(evaluateCore(core.small, data, obj), evaluateCore(core.large, 
                 data, obj))
         }
     }) at testthat/testAnalysis.R:15
  2: test_code(desc, code, env = parent.frame())
  3: tryCatch(withCallingHandlers({
         eval(code, test_env)
         if (!handled && !is.null(test)) {
             skip_empty()
         }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
         message = handle_message, error = handle_error), error = handle_fatal, skip = function(e) {
     })
  4: tryCatchList(expr, classes, parentenv, handlers)
  5: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), names[nh], 
         parentenv, handlers[[nh]])
  6: doTryCatch(return(expr), name, parentenv, handler)
  7: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  9: value[[3L]](cond)
  10: isTRUE(e$handled)
  11: e$handled
  12: `$.Throwable`(e, "handled")
  13: ._jobjRef_dollar(x[["jobj"]], name)
  14: stop(sprintf("no field, method or inner class called '%s' ", name))
  
  Error in .jcall("java/lang/Class", "Ljava/lang/Class;", "forName", cl,  : 
    RcallMethod: cannot determine object class
  ── 4. Failure: arguments are checked (@testData.R#10)  ─────────────────────────
  `distances(file = 123)` threw an error with unexpected message.
  Expected match: "should be a file path"
  Actual message: "java.lang.StackOverflowError"
  
  Error in .jcall("java/lang/Class", "Ljava/lang/Class;", "forName", cl,  : 
    RcallMethod: cannot determine object class
  ── 5. Failure: arguments are checked (@testData.R#11)  ─────────────────────────
  `distances(file = "i/do/not/exist")` threw an error with unexpected message.
  Expected match: "does not exist"
  Actual message: "java.lang.StackOverflowError"
  
  Error in .jcall("java/lang/Class", "Ljava/lang/Class;", "forName", cl,  : 
    RcallMethod: cannot determine object class
  ── 6. Failure: arguments are checked (@testData.R#12)  ─────────────────────────
  `distances(data = "whoops")` threw an error with unexpected message.
  Expected match: "a matrix or a data frame"
  Actual message: "java.lang.StackOverflowError"
  
  Error in .jcall("java/lang/Class", "Ljava/lang/Class;", "forName", cl,  : 
    RcallMethod: cannot determine object class
  ── 7. Failure: arguments are checked (@testData.R#13)  ─────────────────────────
  `distances(matrix(letters[1:25], nrow = 5, ncol = 5))` threw an error with unexpected message.
  Expected match: "should be numeric"
  Actual message: "java.lang.StackOverflowError"
  
  Error in .jcall("java/lang/Class", "Ljava/lang/Class;", "forName", cl,  : 
    RcallMethod: cannot determine object class
  ── 8. Failure: arguments are checked (@testData.R#14)  ─────────────────────────
  `distances(matrix(0, nrow = 5, ncol = 5))` threw an error with unexpected message.
  Expected match: "names are required"
  Actual message: "java.lang.StackOverflowError"
  
  Error in .jcall("java/lang/Class", "Ljava/lang/Class;", "forName", cl,  : 
    RcallMethod: cannot determine object class
  ── 9. Failure: arguments are checked (@testData.R#17)  ─────────────────────────
  `distances(m)` threw an error with unexpected message.
  Expected match: "matrix should be symmetric"
  Actual message: "java.lang.StackOverflowError"
  
  ── 10. Error: (unknown) (@testData.R#20)  ──────────────────────────────────────
  no field, method or inner class called 'handled' 
  1: test_that("class", {
         expect_is(distanceData(), "chdist")
         expect_is(distanceData()$data, "matrix")
     }) at testthat/testData.R:20
  2: test_code(desc, code, env = parent.frame())
  3: tryCatch(withCallingHandlers({
         eval(code, test_env)
         if (!handled && !is.null(test)) {
             skip_empty()
         }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
         message = handle_message, error = handle_error), error = handle_fatal, skip = function(e) {
     })
  4: tryCatchList(expr, classes, parentenv, handlers)
  5: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), names[nh], 
         parentenv, handlers[[nh]])
  6: doTryCatch(return(expr), name, parentenv, handler)
  7: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  9: value[[3L]](cond)
  10: isTRUE(e$handled)
  11: e$handled
  12: `$.Throwable`(e, "handled")
  13: ._jobjRef_dollar(x[["jobj"]], name)
  14: stop(sprintf("no field, method or inner class called '%s' ", name))
  
  ── 11. Error: (unknown) (@testExecution.R#7)  ──────────────────────────────────
  no field, method or inner class called 'handled' 
  1: test_that("arguments are checked", {
         expect_error(sampleCore(), "no default")
         expect_error(sampleCore(data = "abc"), "class 'chdata'")
         data <- testData()
         expect_error(sampleCore(data, size = -1), ">= 2")
         expect_error(sampleCore(data, size = 0), ">= 2")
         expect_error(sampleCore(data, size = 1/data$size), ">= 2")
         expect_error(sampleCore(data, size = 1), ">= 2")
         expect_error(sampleCore(data, size = 1.4), ">= 2")
         expect_error(sampleCore(data, size = data$size), "< 218")
         expect_error(sampleCore(data, size = data$size + sample(1:10, size = 1)), "< 218")
         expect_error(sampleCore(data, size = "abc"), "should be numeric")
         expect_error(sampleCore(data, obj = "abc"), "class 'chobj'")
         expect_error(sampleCore(data, obj = list(123)), "class 'chobj'")
         expect_error(sampleCore(data, obj = list(objective("SH"), objective("SH"))), 
             "Duplicate objectives.")
         expect_error(sampleCore(data, indices = "no"), "logical")
         expect_error(sampleCore(data, verbose = "yes"), "logical")
         expect_error(sampleCore(data, time = "abc"), "numeric")
         expect_error(sampleCore(data, impr.time = "def"), "numeric")
         expect_error(sampleCore(data, time = 0), "positive")
         expect_error(sampleCore(data, impr.time = -1), "positive")
         expect_error(sampleCore(data, mode = "foo"), "one of")
     }) at testthat/testExecution.R:7
  2: test_code(desc, code, env = parent.frame())
  3: tryCatch(withCallingHandlers({
         eval(code, test_env)
         if (!handled && !is.null(test)) {
             skip_empty()
         }
     }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
         message = handle_message, error = handle_error), error = handle_fatal, skip = function(e) {
     })
  4: tryCatchList(expr, classes, parentenv, handlers)
  5: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), names[nh], 
         parentenv, handlers[[nh]])
  6: doTryCatch(return(expr), name, parentenv, handler)
  7: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  9: value[[3L]](cond)
  10: isTRUE(e$handled)
  11: e$handled
  12: `$.Throwable`(e, "handled")
  13: ._jobjRef_dollar(x[["jobj"]], name)
  14: stop(sprintf("no field, method or inner class called '%s' ", name))
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 24 SKIPPED: 0 WARNINGS: 6 FAILED: 11
  1. Failure: arguments are checked (@testAnalysis.R#11) 
  2. Failure: arguments are checked (@testAnalysis.R#12) 
  3. Error: (unknown) (@testAnalysis.R#15) 
  4. Failure: arguments are checked (@testData.R#10) 
  5. Failure: arguments are checked (@testData.R#11) 
  6. Failure: arguments are checked (@testData.R#12) 
  7. Failure: arguments are checked (@testData.R#13) 
  8. Failure: arguments are checked (@testData.R#14) 
  9. Failure: arguments are checked (@testData.R#17) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted