Skip to content

Commit

Permalink
#58: fixed broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ypujante committed Jun 24, 2013
1 parent 6d37b6e commit 1356f5e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public class TestConsoleServerPackager extends BasePackagerTest
{
ShellImpl.createTempShell { Shell shell ->

def driverResource = shell.saveContent('/drivers/db.driver', 'this is the driver')
def driverResource = shell.saveContent('/drivers/db-driver.jar', 'this is the driver')

def metaModel = """
fabrics['f1'] = [
Expand Down Expand Up @@ -258,7 +258,7 @@ JVM_SIZE="-Xmx555m"
"/${jettyDistribution}/contexts/glu-jetty-context.xml": DEFAULT_GLU_JETTY_CONTEXT,
"/${jettyDistribution}/lib": DIRECTORY,
"/${jettyDistribution}/lib/ext": DIRECTORY,
"/${jettyDistribution}/lib/ext/db.driver": "this is the driver",
"/${jettyDistribution}/lib/ext/db-driver.jar": "this is the driver",
"/${jettyDistribution}/lib/acme.jar": 'this is the jar',
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,14 @@ public class TestMetaModel extends GroovyTestCase
],
"consoles": [
{
"configTokens": {
"dataSource": "\\ndataSource.dbCreate ='update'\\ndataSource.url=\\"jdbc:hsqldb:file:\${System.properties['user.dir']}/database/prod;shutdown=true\\"\\n"
},
"host": "localhost",
"name": "tutorialConsole",
"plugins": [
"org.linkedin.glu.orchestration.engine.plugins.builtin.StreamFileContentPlugin"
],
"version": "@glu.version@"
}
],
Expand All @@ -77,24 +83,24 @@ public class TestMetaModel extends GroovyTestCase
"checksum": "JSHZAn5IQfBVp1sy0PgA36fT_fD",
"keyPassword": "nWVxpMg6Tkv",
"storePassword": "nacEn92x8-1",
"uri": "keys/agent.keystore"
"uri": "agent.keystore"
},
"agentTrustStore": {
"checksum": "JSHZAn5IQfBVp1sy0PgA36fT_fD",
"checksum": "CvFUauURMt-gxbOkkInZ4CIV50y",
"keyPassword": "nWVxpMg6Tkv",
"storePassword": "nacEn92x8-1",
"uri": "keys/agent.keystore"
"uri": "agent.truststore"
},
"consoleKeyStore": {
"checksum": "JSHZAn5IQfBVp1sy0PgA36fT_fD",
"checksum": "wxiKSyNAHN2sOatUG2qqIpuVYxb",
"keyPassword": "nWVxpMg6Tkv",
"storePassword": "nacEn92x8-1",
"uri": "keys/console.keystore"
"uri": "console.keystore"
},
"consoleTrustStore": {
"checksum": "qUFMIePiJhz8i7Ow9lZmN5pyZjl",
"storePassword": "nacEn92x8-1",
"uri": "keys/console.truststore"
"uri": "console.truststore"
}
},
"zooKeeperCluster": "tutorialZooKeeperCluster"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ class ShellExec
else
{
if(command.startsWith('file:'))
command -= 'file'
command -= 'file:'
}

_commandLine = command
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ public class TestShell extends GroovyTestCase
def pwdDir = shell.mkdirs("/pwd")
checkShellExec(shell, [command: ["pwd"], pwd: "/pwd"], 0, "${pwdDir.file.canonicalPath}\n", "")

ProcessBuilder pb = new ProcessBuilder(ShellExec.buildCommandLine('pwd'))
ProcessBuilder pb = new ProcessBuilder(ShellExec.buildCommandLine(['pwd']))
pb.directory(shell.toResource("/pwdDoNotExist").file)
String errorMessage = null
try
Expand All @@ -283,17 +283,17 @@ public class TestShell extends GroovyTestCase
checkShellExec(shell, [command: ["pwd"], pwd: "/pwdDoNotExist", failOnError: false], 2, "", "${errorMessage}")

// testing env
checkShellExec(shell, [command: ['echo $HOME']], 0, "${System.getenv().HOME}\n", "")
checkShellExec(shell, [command: 'echo $HOME'], 0, "${System.getenv().HOME}\n", "")

// changing environment variable
def homeDir = shell.mkdirs("/home")
checkShellExec(shell, [command: ['echo $HOME'], env: [HOME: homeDir.file.canonicalPath]], 0, "${homeDir.file.canonicalPath}\n", "")
checkShellExec(shell, [command: 'echo $HOME', env: [HOME: homeDir.file.canonicalPath]], 0, "${homeDir.file.canonicalPath}\n", "")

// removing environment variable
checkShellExec(shell, [command: ['echo $HOME'], env: [HOME: null]], 0, "\n", "")
checkShellExec(shell, [command: 'echo $HOME', env: [HOME: null]], 0, "\n", "")

// not inheriting
checkShellExec(shell, [command: ['echo $HOME'], inheritEnv: false], 0, "\n", "")
checkShellExec(shell, [command: 'echo $HOME', inheritEnv: false], 0, "\n", "")
}
}

Expand Down

0 comments on commit 1356f5e

Please sign in to comment.