# Copyright (c) Microsoft Corporation.  All rights reserved.
#
# FUNCTIONS
#    Unit tests for RxHpcServer
#
############################################################################################
.setUp <- function()
{
}

.tearDown <- function()
{
}

"test.RxHpcServer.valid.arg.autoCleanup" <- function()
{
	checkTrue(validObject(RxHpcServer(autoCleanup = TRUE), test = TRUE))
	checkTrue(validObject(RxHpcServer(autoCleanup = FALSE), test = TRUE))
	checkException(RxHpcServer(autoCleanup = "yes"), silent = TRUE)
	checkException(RxHpcServer(autoCleanup = c(TRUE, FALSE)), silent = TRUE)
	checkException(RxHpcServer(autoCleanup = NULL), silent = TRUE)
	checkException(RxHpcServer(autoCleanup = NA), silent = TRUE)
	checkException(RxHpcServer(autoCleanup = pi), silent = TRUE)
	checkException(RxHpcServer(autoCleanup = logical(0)), silent = TRUE)
}

#"test.RxLsfCluster.valid.arg.autoCleanup" <- function()
#{
	#checkTrue(validObject(RxLsfCluster(autoCleanup = TRUE), test = TRUE))
	#checkTrue(validObject(RxLsfCluster(autoCleanup = FALSE), test = TRUE))
	#checkException(RxLsfCluster(autoCleanup = "yes"), silent = TRUE)
	#checkException(RxLsfCluster(autoCleanup = c(TRUE, FALSE)), silent = TRUE)
	#checkException(RxLsfCluster(autoCleanup = NULL), silent = TRUE)
	#checkException(RxLsfCluster(autoCleanup = NA), silent = TRUE)
	#checkException(RxLsfCluster(autoCleanup = pi), silent = TRUE)
	#checkException(RxLsfCluster(autoCleanup = logical(0)), silent = TRUE)
#}
#

"test.RxHpcServer.valid.arg.configFile" <- function()
{
	checkTrue(validObject(RxHpcServer(configFile = NULL), test = TRUE))
    
    # if the configFile is not the right type or length we default to a system.file
    # for the RevoScaleR package. However, a warning is thrown. Below, we convert that
    # warning into an error so that we can catch illegal values and then set it back to 
    # its original value.
    oldWarn <- options(warn = 2L)
	on.exit(options(oldWarn), add = TRUE)
	checkException(RxHpcServer(configFile = tempfile(pattern = ".rxConfig")), silent = TRUE)
	checkException(RxHpcServer(configFile = NA), silent = TRUE)
	checkException(RxHpcServer(configFile = pi), silent = TRUE)
	checkException(RxHpcServer(configFile = c("one","two")), silent = TRUE)
	checkException(RxHpcServer(configFile = character(0)), silent = TRUE)
}


#"test.RxLsfCluster.valid.arg.configFile" <- function()
#{
	#checkTrue(validObject(RxLsfCluster(configFile = NULL), test = TRUE))
    #
    ## if the configFile is not the right type or length we default to a system.file
    ## for the RevoScaleR package. However, a warning is thrown. Below, we convert that
    ## warning into an error so that we can catch illegal values and then set it back to 
    ## its original value.
    #oldWarn <- options(warn = 2L)
	#on.exit(options(oldWarn), add = TRUE)
	#checkException(RxLsfCluster(configFile = tempfile(pattern = ".rxConfig")), silent = TRUE)
	#checkException(RxLsfCluster(configFile = NA), silent = TRUE)
	#checkException(RxLsfCluster(configFile = pi), silent = TRUE)
	#checkException(RxLsfCluster(configFile = c("one","two")), silent = TRUE)
	#checkException(RxLsfCluster(configFile = character(0)), silent = TRUE)
#}


"test.RxHpcServer.valid.arg.consoleOutput" <- function()
{
	checkTrue(validObject(RxHpcServer(consoleOutput = TRUE), test = TRUE))
	checkTrue(validObject(RxHpcServer(consoleOutput = FALSE), test = TRUE))
	checkException(RxHpcServer(consoleOutput = "yes"), silent = TRUE)
	checkException(RxHpcServer(consoleOutput = c(TRUE, FALSE)), silent = TRUE)
	checkException(RxHpcServer(consoleOutput = NULL), silent = TRUE)
	checkException(RxHpcServer(consoleOutput = NA), silent = TRUE)
	checkException(RxHpcServer(consoleOutput = pi), silent = TRUE)
	checkException(RxHpcServer(consoleOutput = logical(0)), silent = TRUE)
}


#"test.RxLsfCluster.valid.arg.consoleOutput" <- function()
#{
	#checkTrue(validObject(RxLsfCluster(consoleOutput = TRUE), test = TRUE))
	#checkTrue(validObject(RxLsfCluster(consoleOutput = FALSE), test = TRUE))
	#checkException(RxLsfCluster(consoleOutput = "yes"), silent = TRUE)
	#checkException(RxLsfCluster(consoleOutput = c(TRUE, FALSE)), silent = TRUE)
	#checkException(RxLsfCluster(consoleOutput = NULL), silent = TRUE)
	#checkException(RxLsfCluster(consoleOutput = NA), silent = TRUE)
	#checkException(RxLsfCluster(consoleOutput = pi), silent = TRUE)
	#checkException(RxLsfCluster(consoleOutput = logical(0)), silent = TRUE)
#}


"test.RxHpcServer.valid.arg.dataDistType" <- function()
{
	checkTrue(validObject(RxHpcServer(dataDistType = "all"), test = TRUE))
	checkTrue(validObject(RxHpcServer(dataDistType = "split"), test = TRUE))
	checkTrue(validObject(RxHpcServer(dataDistType = "AlL"), test = TRUE))
	checkTrue(validObject(RxHpcServer(dataDistType = "SpLiT"), test = TRUE))
	checkException(RxHpcServer(dataDistType = "unsupported"), silent = TRUE)
	checkException(RxHpcServer(dataDistType = c("all", "split")), silent = TRUE)
	checkException(RxHpcServer(dataDistType = NULL), silent = TRUE)
	checkException(RxHpcServer(dataDistType = NA), silent = TRUE)
	checkException(RxHpcServer(dataDistType = pi), silent = TRUE)
	checkException(RxHpcServer(dataDistType = character(0)), silent = TRUE)
}


#"test.RxLsfCluster.valid.arg.dataDistType" <- function()
#{
	#checkTrue(validObject(RxLsfCluster(dataDistType = "all"), test = TRUE))
	#checkTrue(validObject(RxLsfCluster(dataDistType = "split"), test = TRUE))
	#checkTrue(validObject(RxLsfCluster(dataDistType = "AlL"), test = TRUE))
	#checkTrue(validObject(RxLsfCluster(dataDistType = "SpLiT"), test = TRUE))
	#checkException(RxLsfCluster(dataDistType = "unsupported"), silent = TRUE)
	#checkException(RxLsfCluster(dataDistType = c("all", "split")), silent = TRUE)
	#checkException(RxLsfCluster(dataDistType = NULL), silent = TRUE)
	#checkException(RxLsfCluster(dataDistType = NA), silent = TRUE)
	#checkException(RxLsfCluster(dataDistType = pi), silent = TRUE)
	#checkException(RxLsfCluster(dataDistType = character(0)), silent = TRUE)
#}


"test.RxHpcServer.valid.arg.dataPath" <- function()
{
	checkTrue(validObject(RxHpcServer(dataPath = c("C:/foo")), test = TRUE))
	checkTrue(validObject(RxHpcServer(dataPath = c("C:/foo","D:\\bar")), test = TRUE))
	checkTrue(validObject(RxHpcServer(dataPath = NULL), test = TRUE))
	checkException(RxHpcServer(dataPath = ""), silent = TRUE)
	checkException(RxHpcServer(dataPath = c("C:/foo", "")), silent = TRUE)
	checkException(RxHpcServer(dataPath = pi), silent = TRUE)
	checkException(RxHpcServer(dataPath = NA), silent = TRUE)
	checkException(RxHpcServer(dataPath = "\\\\shared\\dir"), silent = TRUE)
	checkException(RxHpcServer(dataPath = character(0)), silent = TRUE)
}


#"test.RxLsfCluster.valid.arg.dataPath" <- function()
#{
	#checkTrue(validObject(RxLsfCluster(dataPath = c("C:/foo")), test = TRUE))
	#checkTrue(validObject(RxLsfCluster(dataPath = c("C:/foo","D:\\bar")), test = TRUE))
	#checkTrue(validObject(RxLsfCluster(dataPath = NULL), test = TRUE))
	#checkException(RxLsfCluster(dataPath = ""), silent = TRUE)
	#checkException(RxLsfCluster(dataPath = c("C:/foo", "")), silent = TRUE)
	#checkException(RxLsfCluster(dataPath = pi), silent = TRUE)
	#checkException(RxLsfCluster(dataPath = NA), silent = TRUE)
	#checkException(RxLsfCluster(dataPath = "\\\\shared\\dir"), silent = TRUE)
	#checkException(RxLsfCluster(dataPath = character(0)), silent = TRUE)
#}


"test.RxHpcServer.valid.arg.exclusive" <- function()
{
	checkTrue(validObject(RxHpcServer(exclusive = TRUE), test = TRUE))
	checkTrue(validObject(RxHpcServer(exclusive = FALSE), test = TRUE))
	checkException(RxHpcServer(exclusive = "yes"), silent = TRUE)
	checkException(RxHpcServer(exclusive = c(TRUE, FALSE)), silent = TRUE)
	checkException(RxHpcServer(exclusive = NULL), silent = TRUE)
	checkException(RxHpcServer(exclusive = NA), silent = TRUE)
	checkException(RxHpcServer(exclusive = pi), silent = TRUE)
	checkException(RxHpcServer(exclusive = logical(0)), silent = TRUE)
}



#"test.RxLsfCluster.valid.arg.exclusive" <- function()
#{
	#checkTrue(validObject(RxLsfCluster(exclusive = TRUE), test = TRUE))
	#checkTrue(validObject(RxLsfCluster(exclusive = FALSE), test = TRUE))
	#checkException(RxLsfCluster(exclusive = "yes"), silent = TRUE)
	#checkException(RxLsfCluster(exclusive = c(TRUE, FALSE)), silent = TRUE)
	#checkException(RxLsfCluster(exclusive = NULL), silent = TRUE)
	#checkException(RxLsfCluster(exclusive = NA), silent = TRUE)
	#checkException(RxLsfCluster(exclusive = pi), silent = TRUE)
	#checkException(RxLsfCluster(exclusive = logical(0)), silent = TRUE)
#}


"test.RxHpcServer.valid.arg.headNode" <- function()
{
	checkTrue(validObject(RxHpcServer(headNode = ""), test = TRUE))
	checkTrue(validObject(RxHpcServer(headNode = "\\\\cluster-head"), test = TRUE))
	checkException(RxHpcServer(headNode = NULL), silent = TRUE)
	checkException(RxHpcServer(headNode = NA), silent = TRUE)
	checkException(RxHpcServer(headNode = pi), silent = TRUE)
	checkException(RxHpcServer(headNode = c("one","two")), silent = TRUE)
	checkException(RxHpcServer(headNode = character(0)), silent = TRUE)
}


#"test.RxLsfCluster.valid.arg.queue" <- function()
#{
	#checkException(RxLsfCluster(queue = ""), silent = TRUE)
	#checkTrue(validObject(RxLsfCluster(queue = "asdf"), test = TRUE))
	#checkException(RxLsfCluster(queue = NULL), silent = TRUE)
	#checkException(RxLsfCluster(queue = NA), silent = TRUE)
	#checkException(RxLsfCluster(queue = pi), silent = TRUE)
	#checkException(RxLsfCluster(queue = c("one","two")), silent = TRUE)
	#checkException(RxLsfCluster(queue = character(0)), silent = TRUE)
#}


"test.RxHpcServer.valid.arg.maxElems" <- function()
{
	checkTrue(validObject(RxHpcServer(maxElems = -1L), test = TRUE))
	checkTrue(validObject(RxHpcServer(maxElems = -1), test = TRUE))
	checkTrue(validObject(RxHpcServer(maxElems = -1.0000000), test = TRUE))
	checkException(RxHpcServer(maxElems = Inf), silent = TRUE)
	checkException(RxHpcServer(maxElems = pi), silent = TRUE)
	checkException(RxHpcServer(minElems = -1L, maxElems = 0L), silent = TRUE)
	checkException(RxHpcServer(minElems = -1L, maxElems = integer(0)), silent = TRUE)
}


#"test.RxLsfCluster.valid.arg.maxElems" <- function()
#{
	#checkTrue(validObject(RxLsfCluster(maxElems = -1L), test = TRUE))
	#checkTrue(validObject(RxLsfCluster(maxElems = -1), test = TRUE))
	#checkTrue(validObject(RxLsfCluster(maxElems = -1.0000000), test = TRUE))
	#checkException(RxLsfCluster(maxElems = Inf), silent = TRUE)
	#checkException(RxLsfCluster(maxElems = pi), silent = TRUE)
	#checkException(RxLsfCluster(minElems = -1L, maxElems = 0L), silent = TRUE)
	#checkException(RxLsfCluster(minElems = -1L, maxElems = integer(0)), silent = TRUE)
#}


"test.RxHpcServer.valid.arg.minElems" <- function()
{
	checkTrue(validObject(RxHpcServer(minElems = -1L), test = TRUE))
	checkTrue(validObject(RxHpcServer(minElems = -1), test = TRUE))
	checkTrue(validObject(RxHpcServer(minElems = -1.0000000), test = TRUE))
	checkException(RxHpcServer(minElems = Inf, maxElems = Inf), silent = TRUE)
	checkException(RxHpcServer(minElems = pi), silent = TRUE)
	checkException(RxHpcServer(minElems = 0L, maxElems = 1L), silent = TRUE)
	checkException(RxHpcServer(minElems = -1L, maxElems = 0L), silent = TRUE)
	checkException(RxHpcServer(minElems = integer(0)), silent = TRUE)
}


#"test.RxLsfCluster.valid.arg.minElems" <- function()
#{
	#checkTrue(validObject(RxLsfCluster(minElems = -1L), test = TRUE))
	#checkTrue(validObject(RxLsfCluster(minElems = -1), test = TRUE))
	#checkTrue(validObject(RxLsfCluster(minElems = -1.0000000), test = TRUE))
	#checkException(RxLsfCluster(minElems = Inf, maxElems = Inf), silent = TRUE)
	#checkException(RxLsfCluster(minElems = pi), silent = TRUE)
	#checkException(RxLsfCluster(minElems = 0L, maxElems = 1L), silent = TRUE)
	#checkException(RxLsfCluster(minElems = -1L, maxElems = 0L), silent = TRUE)
	#checkException(RxLsfCluster(minElems = integer(0)), silent = TRUE)
#}


"test.RxHpcServer.valid.arg.priority" <- function()
{
	checkTrue(validObject(RxHpcServer(priority = 0L), test = TRUE))
	checkTrue(validObject(RxHpcServer(priority = 1L), test = TRUE))
	checkTrue(validObject(RxHpcServer(priority = 2L), test = TRUE))
	checkTrue(validObject(RxHpcServer(priority = 3L), test = TRUE))
	checkTrue(validObject(RxHpcServer(priority = 4L), test = TRUE))
	checkTrue(validObject(RxHpcServer(priority = 0), test = TRUE))
	checkTrue(validObject(RxHpcServer(priority = 1), test = TRUE))
	checkTrue(validObject(RxHpcServer(priority = 2), test = TRUE))
	checkTrue(validObject(RxHpcServer(priority = 3), test = TRUE))
	checkTrue(validObject(RxHpcServer(priority = 4), test = TRUE))
	checkException(RxHpcServer(priority = 5 - .Machine[["double.eps"]] * 10), silent = TRUE)
	checkException(RxHpcServer(priority = pi), silent = TRUE)
	checkException(RxHpcServer(priority = -1L), silent = TRUE)
	checkException(RxHpcServer(priority = 5L), silent = TRUE)
	checkException(RxHpcServer(priority = -1), silent = TRUE)
	checkException(RxHpcServer(priority = 5), silent = TRUE)
	checkException(RxHpcServer(priority = "cow"), silent = TRUE)
	checkException(RxHpcServer(priority = NA), silent = TRUE)
	checkException(RxHpcServer(priority = NULL), silent = TRUE)
	checkException(RxHpcServer(priority = 2:3), silent = TRUE)
	checkException(RxHpcServer(priority = integer(0)), silent = TRUE)
}


"test.RxHpcServer.valid.arg.nodes" <- function()
{
	checkTrue(validObject(RxHpcServer(nodes = c("compute1","compute2","compute3")), test = TRUE))
	checkTrue(validObject(RxHpcServer(nodes = "compute1,compute2,compute3"), test = TRUE))
	checkTrue(validObject(RxHpcServer(nodes = "compute1, compute2 ,  compute3"), test = TRUE))
	checkTrue(validObject(RxHpcServer(nodes = NULL), test = TRUE))
	checkException(RxHpcServer(nodes = "" ), silent = TRUE)
	checkException(RxHpcServer(nodes = pi ), silent = TRUE)
}


#"test.RxLsfCluster.valid.arg.nodes" <- function()
#{
	#checkTrue(validObject(RxLsfCluster(nodes = c("compute1","compute2","compute3")), test = TRUE))
	#checkTrue(validObject(RxLsfCluster(nodes = "compute1,compute2,compute3"), test = TRUE))
	#checkTrue(validObject(RxLsfCluster(nodes = "compute1, compute2 ,  compute3"), test = TRUE))
	#checkTrue(validObject(RxLsfCluster(nodes = NULL), test = TRUE))
	#checkException(RxLsfCluster(nodes = "" ), silent = TRUE)
	#checkException(RxLsfCluster(nodes = pi ), silent = TRUE)
#}


"test.RxHpcServer.valid.arg.revoPath" <- function()
{
	checkTrue(validObject(RxHpcServer(revoPath = "//AllShare//username"), test = TRUE))
	checkTrue(validObject(RxHpcServer(revoPath = NULL), test = TRUE))
	checkException(RxHpcServer(revoPath = NA), silent = TRUE)
	checkException(RxHpcServer(revoPath = pi), silent = TRUE)
	checkException(RxHpcServer(revoPath = c("one","two")), silent = TRUE)
	checkException(RxHpcServer(revoPath = ""), silent = TRUE)
	checkException(RxHpcServer(revoPath = character(0)), silent = TRUE)    
}


#"test.RxLsfCluster.valid.arg.revoPath" <- function()
#{
	#checkTrue(validObject(RxLsfCluster(revoPath = "//AllShare//username"), test = TRUE))
	#checkTrue(validObject(RxLsfCluster(revoPath = NULL), test = TRUE))
	#checkException(RxLsfCluster(revoPath = NA), silent = TRUE)
	#checkException(RxLsfCluster(revoPath = pi), silent = TRUE)
	#checkException(RxLsfCluster(revoPath = c("one","two")), silent = TRUE)
	#checkException(RxLsfCluster(revoPath = ""), silent = TRUE)
	#checkException(RxLsfCluster(revoPath = character(0)), silent = TRUE)    
#}


"test.RxHpcServer.valid.arg.shareDir" <- function()
{
	checkTrue(validObject(RxHpcServer(shareDir = ""), test = TRUE))
	checkTrue(validObject(RxHpcServer(shareDir = "//AllShare//username"), test = TRUE))
	checkException(RxHpcServer(shareDir = NULL), silent = TRUE)
	checkException(RxHpcServer(shareDir = NA), silent = TRUE)
	checkException(RxHpcServer(shareDir = pi), silent = TRUE)
	checkException(RxHpcServer(shareDir = c("one","two")), silent = TRUE)
	checkException(RxHpcServer(shareDir = character(0)), silent = TRUE)
}


#"test.RxLsfCluster.valid.arg.shareDir" <- function()
#{
	#checkTrue(validObject(RxLsfCluster(shareDir = ""), test = TRUE))
	#checkTrue(validObject(RxLsfCluster(shareDir = "//AllShare//username"), test = TRUE))
	#checkException(RxLsfCluster(shareDir = NULL), silent = TRUE)
	#checkException(RxLsfCluster(shareDir = NA), silent = TRUE)
	#checkException(RxLsfCluster(shareDir = pi), silent = TRUE)
	#checkException(RxLsfCluster(shareDir = c("one","two")), silent = TRUE)
	#checkException(RxLsfCluster(shareDir = character(0)), silent = TRUE)
#}


"test.RxHpcServer.valid.arg.wait" <- function()
{
	checkTrue(validObject(RxHpcServer(wait = TRUE), test = TRUE))
	checkTrue(validObject(RxHpcServer(wait = FALSE), test = TRUE))
	checkException(RxHpcServer(wait = "yes"), silent = TRUE)
	checkException(RxHpcServer(wait = c(TRUE, FALSE)), silent = TRUE)
	checkException(RxHpcServer(wait = NULL), silent = TRUE)
	checkException(RxHpcServer(wait = NA), silent = TRUE)
	checkException(RxHpcServer(wait = pi), silent = TRUE)
	checkException(RxHpcServer(wait = logical(0)), silent = TRUE)
}


#"test.RxLsfCluster.valid.arg.wait" <- function()
#{
	#checkTrue(validObject(RxLsfCluster(wait = TRUE), test = TRUE))
	#checkTrue(validObject(RxLsfCluster(wait = FALSE), test = TRUE))
	#checkException(RxLsfCluster(wait = "yes"), silent = TRUE)
	#checkException(RxLsfCluster(wait = c(TRUE, FALSE)), silent = TRUE)
	#checkException(RxLsfCluster(wait = NULL), silent = TRUE)
	#checkException(RxLsfCluster(wait = NA), silent = TRUE)
	#checkException(RxLsfCluster(wait = pi), silent = TRUE)
	#checkException(RxLsfCluster(wait = logical(0)), silent = TRUE)
#}


"test.RxHpcServer.valid.arg.workingDir" <- function()
{
	checkTrue(validObject(RxHpcServer(workingDir = NULL), test = TRUE))
	checkTrue(validObject(RxHpcServer(workingDir = "//AllShare//username"), test = TRUE))
	checkException(RxHpcServer(workingDir = ""), silent = TRUE)
	checkException(RxHpcServer(workingDir = NA), silent = TRUE)
	checkException(RxHpcServer(workingDir = pi), silent = TRUE)
	checkException(RxHpcServer(workingDir = c("one","two")), silent = TRUE)
	checkException(RxHpcServer(workingDir = character(0)), silent = TRUE)
}


#"test.RxLsfCluster.valid.arg.workingDir" <- function()
#{
	#checkTrue(validObject(RxLsfCluster(workingDir = NULL), test = TRUE))
	#checkTrue(validObject(RxLsfCluster(workingDir = "//AllShare//username"), test = TRUE))
	#checkException(RxLsfCluster(workingDir = ""), silent = TRUE)
	#checkException(RxLsfCluster(workingDir = NA), silent = TRUE)
	#checkException(RxLsfCluster(workingDir = pi), silent = TRUE)
	#checkException(RxLsfCluster(workingDir = c("one","two")), silent = TRUE)
	#checkException(RxLsfCluster(workingDir = character(0)), silent = TRUE)
#}


#"test.RxLsfCluster.valid.arg.serviceClassName" <- function()
#{
	#checkTrue(validObject(RxLsfCluster(serviceClassName = NULL), test = TRUE))
	#checkTrue(validObject(RxLsfCluster(serviceClassName = "foo"), test = TRUE))
	#checkTrue(validObject(RxLsfCluster(serviceClassName = ""), test = TRUE))
	#checkException(RxLsfCluster(serviceClassName = NA), silent = TRUE)
	#checkException(RxLsfCluster(serviceClassName = pi), silent = TRUE)
	#checkException(RxLsfCluster(serviceClassName = c("one","two")), silent = TRUE)
	#checkException(RxLsfCluster(serviceClassName = character(0)), silent = TRUE)
#}

#"test.RxLsfCluster.valid.arg.clientShareDir" <- function()
#{
	#checkTrue(validObject(RxLsfCluster(clientShareDir = NULL), test = TRUE))
	#checkTrue(validObject(RxLsfCluster(clientShareDir = "foo"), test = TRUE))
	#checkTrue(validObject(RxLsfCluster(clientShareDir = ""), test = TRUE))
	#checkException(RxLsfCluster(clientShareDir = NA), silent = TRUE)
	#checkException(RxLsfCluster(clientShareDir = pi), silent = TRUE)
	#checkException(RxLsfCluster(clientShareDir = c("one","two")), silent = TRUE)
	#checkException(RxLsfCluster(clientShareDir = character(0)), silent = TRUE)
#}

#"test.RxLsfCluster.valid.arg.clusterMpiPath" <- function()
#{
	#checkTrue(validObject(RxLsfCluster(clusterMpiPath = NULL), test = TRUE))
	#checkTrue(validObject(RxLsfCluster(clusterMpiPath = "foo"), test = TRUE))
	#checkTrue(validObject(RxLsfCluster(clusterMpiPath = ""), test = TRUE))
	#checkException(RxLsfCluster(clusterMpiPath = NA), silent = TRUE)
	#checkException(RxLsfCluster(clusterMpiPath = pi), silent = TRUE)
	#checkException(RxLsfCluster(clusterMpiPath = c("one","two")), silent = TRUE)
	#checkException(RxLsfCluster(clusterMpiPath = character(0)), silent = TRUE)
#}


"test.RxHpcServer.recall" <- function()
{
    HPC1 <- RxHpcServer( 
        dataPath = "dataPath1", 
        headNode = "headNode1", 
        revoPath = paste( R.home(), "bin","x64\\", sep="\\" ),
        shareDir = "\\AllShare\\user1", 
        nodes = "compute1", 
        consoleOutput = TRUE,
        autoCleanup = FALSE)
    
    HPC2 <- RxHpcServer(
        HPC1,
        dataPath = "dataPath2", 
        headNode = "headNode2", 
        autoCleanup = TRUE)
    
    checkEquals(HPC2@dataPath, "dataPath2")
    checkEquals(HPC2@headNode, "HEADNODE2")
    checkEquals(HPC2@dataPath, "dataPath2")
    checkEquals(HPC2@shareDir, "\\AllShare\\user1")
    checkEquals(HPC2@nodes, "COMPUTE1")
    checkEquals(HPC2@consoleOutput, TRUE)
    checkEquals(HPC2@autoCleanup, TRUE)
	checkEquals(HPC2@description, "mshpc")
}

#"test.RxAzureBurst.recall" <- function()
#{
    #Azure1 <- RxAzureBurst( 
        #dataPath = "dataPath1", 
        #headNode = "headNode1", 
        #revoPath = paste( R.home(), "bin","x64\\", sep="\\" ),
        #shareDir = "\\AllShare\\user1", 
        #nodes = "compute1", 
        #consoleOutput = TRUE,
        #autoCleanup = FALSE)
    #
    #Azure2 <- RxAzureBurst(
        #Azure1,
        #dataPath = "dataPath2", 
        #headNode = "headNode2", 
        #autoCleanup = TRUE)
    #
    #checkEquals(Azure2@dataPath, "dataPath2")
    #checkEquals(Azure2@headNode, "HEADNODE2")
    #checkEquals(Azure2@dataPath, "dataPath2")
    #checkEquals(Azure2@shareDir, "\\AllShare\\user1")
    #checkEquals(Azure2@nodes, "COMPUTE1")
    #checkEquals(Azure2@consoleOutput, TRUE)
    #checkEquals(Azure2@autoCleanup, TRUE)
	#checkEquals(Azure2@description, "azureburst")
	#
	#Azure3 <- RxAzureBurst(
        #Azure1,
        #groups = NULL)
	#
	#checkTrue(is.null(Azure3@groups))
	#
   #HPC1 <- RxHpcServer(
        #Azure1,
        #dataPath = "dataPath2", 
        #headNode = "headNode2", 
        #autoCleanup = TRUE)	
	#
    #checkEquals(HPC1@dataPath, "dataPath2")
    #checkEquals(HPC1@headNode, "HEADNODE2")
    #checkEquals(HPC1@shareDir, "\\AllShare\\user1")
    #checkEquals(HPC1@nodes, "COMPUTE1")
    #checkEquals(HPC1@consoleOutput, TRUE)
    #checkEquals(HPC1@autoCleanup, TRUE)
	#checkEquals(HPC1@description, "mshpc")	
	#
	#Azure4 <- RxAzureBurst(
        #HPC1,
        #dataPath = "dataPath3", 
        #headNode = "headNode3", 
        #autoCleanup = FALSE)	
	#
    #checkEquals(Azure4@dataPath, "dataPath3")
    #checkEquals(Azure4@headNode, "HEADNODE3")
    #checkEquals(Azure4@shareDir, "\\AllShare\\user1")
    #checkEquals(Azure4@nodes, "COMPUTE1")
    #checkEquals(Azure4@consoleOutput, TRUE)
    #checkEquals(Azure4@autoCleanup, FALSE)
	#checkEquals(Azure4@description, "azureburst")	
#}

#"test.RxLsfCluster.recall" <- function()
#{
    #LSF1 <- RxLsfCluster( 
        #dataPath = "dataPath1", 
        #queue = "myqueue", 
        #revoPath = "/usr/bin/R", 
        #shareDir = "/mnt/allshare", 
        #nodes = "compute1", 
        #consoleOutput = TRUE,
        #autoCleanup = FALSE)
    #
    #LSF2 <- RxLsfCluster(
        #LSF1,
        #dataPath = "dataPath2", 
        #queue = "myOtherQueue", 
        #autoCleanup = TRUE)
    #
    #checkEquals(LSF2@dataPath, "dataPath2")
    #checkEquals(LSF2@queue, "myOtherQueue")
    #checkEquals(LSF2@dataPath, "dataPath2")
    #checkEquals(LSF2@shareDir, "/mnt/allshare")
    #checkEquals(LSF2@nodes, "COMPUTE1")
    #checkEquals(LSF2@consoleOutput, TRUE)
    #checkEquals(LSF2@autoCleanup, TRUE)
	#
	#LSF3 <- RxLsfCluster(LSF1, queue = NULL)
#
	#checkEquals(LSF3@queue, "all")
#}