From 23fa5790f455ee43bd1ec0457360a52f3ee97a75 Mon Sep 17 00:00:00 2001 From: Tim Yates Date: Wed, 27 Feb 2013 15:57:55 +0000 Subject: [PATCH] Initial 2.0 commit --- .gitignore | 3 +- build.gradle | 150 ++++++++------ gradle.properties | 36 ++-- gradle/maven.gradle | 99 ++++++++++ gradle/setup.gradle | 5 + .../gradle-wrapper.jar} | Bin 45502 -> 46735 bytes .../gradle-wrapper.properties} | 4 +- gradlew | 6 +- src/main/conf/mod.json | 3 - .../com/bloidonia/vertx/mods/JdbcBusMod.java | 2 +- src/main/resources/mod.json | 4 + .../JavaScriptIntegrationTests.java | 31 +++ .../mods/tests/JavaScriptPersistorTest.java | 95 --------- .../javascript}/test_client.js | 186 +++++++++--------- src/test/resources/langs.properties | 13 -- 15 files changed, 337 insertions(+), 300 deletions(-) create mode 100644 gradle/maven.gradle create mode 100644 gradle/setup.gradle rename gradle/{wrapper.jar => wrapper/gradle-wrapper.jar} (72%) rename gradle/{wrapper.properties => wrapper/gradle-wrapper.properties} (81%) delete mode 100644 src/main/conf/mod.json create mode 100644 src/main/resources/mod.json create mode 100644 src/test/java/com/bloidonia/vertx/mods/integration/javascript/JavaScriptIntegrationTests.java delete mode 100644 src/test/java/com/bloidonia/vertx/mods/tests/JavaScriptPersistorTest.java rename src/test/resources/{ => integration_tests/javascript}/test_client.js (58%) delete mode 100644 src/test/resources/langs.properties diff --git a/.gitignore b/.gitignore index e1ed233..7835d4f 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ module.iml bin build -out \ No newline at end of file +out +mods \ No newline at end of file diff --git a/build.gradle b/build.gradle index 2c6fb27..53ebb57 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,8 @@ +import org.vertx.java.platform.PlatformLocator +import org.vertx.java.core.Handler + /* - * Copyright 2012 the original author or authors. + * Copyright 2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,43 +17,61 @@ * limitations under the License. */ +apply from: "gradle/maven.gradle" + apply plugin: 'java' +apply plugin: 'groovy' +apply plugin: 'idea' +apply plugin: 'eclipse' + +group = groupname +archivesBaseName = artifact defaultTasks = ['assemble'] sourceCompatibility = '1.7' targetCompatibility = '1.7' -jar.enabled = false // we don't need this +// We don't produce a jar +jar.enabled = false +assert configurations.archives.artifacts.removeAll { it.file == jar.archivePath } -compileJava.options.compilerArgs << "-Xlint:unchecked" << "-Werror" +configurations { + provided + testCompile.extendsFrom provided +} repositories { + mavenLocal() maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } mavenCentral() } -configurations { - provided -} - dependencies { + provided "io.vertx:vertx-core:$vertxVersion" + provided "io.vertx:vertx-platform:$vertxVersion" compile "c3p0:c3p0:$c3p0Version" compile "commons-dbutils:commons-dbutils:$dbutilsVersion" - provided "org.vert-x:vertx-core:$vertxVersion" - provided "org.vert-x:vertx-platform:$vertxVersion" - - testCompile "org.vert-x:vertx-core:$vertxVersion" - testCompile "org.vert-x:vertx-platform:$vertxVersion" - testCompile "org.vert-x:vertx-lang-java:$vertxVersion" - testCompile "org.vert-x:vertx-lang-rhino:$vertxVersion" - testCompile "org.mozilla:rhino:$rhinoVersion" testCompile "org.hsqldb:hsqldb:$hsqldbVersion" + testCompile "junit:junit:$junitVersion" + testCompile( "io.vertx:testtools:$toolsVersion" ) { + transitive = false + } +} + +// This sets up the classpath for +buildscript { - testCompile( "org.vert-x:vertx-testframework:$vertxVersion" ) { - transitive = false // don't need all of the other language deps + repositories { + mavenLocal() + maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } + mavenCentral() + } + + dependencies { + classpath "io.vertx:vertx-core:$vertxVersion" + classpath "io.vertx:vertx-platform:$vertxVersion" } - testCompile "junit:junit:$junitVersion" } sourceSets { @@ -59,73 +80,76 @@ sourceSets { } } -task prepareVertxModule( type:Copy, dependsOn: 'classes' ) { - into "build/mod/$modulename-v$version" - from 'build/classes/main' - from 'src/main/conf' +task copyMod( type:Copy, dependsOn: 'classes', description: 'Assemble the module into the local mods directory' ) { + into "mods/maven:$groupname:$artifact:$version" + from compileJava + from 'src/main/resources' into( 'lib' ) { from configurations.compile } } -// Package into build/libs/mod.zip -task distZip( type: Zip, dependsOn: 'prepareVertxModule' ) { +task modZip( type: Zip, dependsOn: 'pullInDeps', description: 'Package the module .zip file') { group = 'vert.x' - description = "Assembles a vert.x module in 'mod.zip' format" + description = "Assembles a vert.x module" destinationDir = project.file('build/libs') - archiveName = 'mod.zip' - from( project.file( "build/mod/${modulename}-v${version}" ) ).into( "${modulename}-v${version}" ) + archiveName = "${artifact}-${version}" + ".zip" + from copyMod } -// Check build/libs/mod.zip has a single root, and a mod.json entry -task dist( dependsOn: 'distZip' ) << { - def entries = new java.util.zip.ZipFile( project.file( 'build/libs/mod.zip' ) ).entries().collect { it.name } - def oneRoot = entries.every { it.startsWith "${modulename}-v${version}/" } - def modjson = entries.find { it == "${modulename}-v${version}/mod.json" } - if( !oneRoot ) { - throw new GradleException( "Invalid mod.zip. Multiple root folders located!" ) - } - else if( !modjson ) { - throw new GradleException( "Invalid mod.zip. Cannot locate ${modulename}-v${version}/mod.json" ) - } +artifacts { + archives modZip } -task prepareVertxTest(type: Sync, dependsOn: ['prepareVertxModule']) { - from 'build/mod' - into 'build/tmp/mod-test' +task cleanModsDir(type: Delete) { + delete 'mods' +} + +clean { + dependsOn cleanModsDir } test { - // Can't have the app on the vert.x classpath - classpath = files( classpath.findAll { - !( it.toString() ==~ /.+build\/(classes|resources)\/main$/ ) - } ) + dependsOn copyMod + // Remove any classpath entries for the module classes and resources- these must be picked up using the module classloader from + // inside the module, not from the system classpath + classpath -= sourceSets.main.output + classpath -= configurations.compile + +// classpath.each { +// File file -> +// println file.absolutePath +// } + + // Make sure tests are always run! + outputs.upToDateWhen { false } - // Some vert.x properties systemProperty 'vertx.test.timeout', 15 - systemProperty 'vertx.mods', "$projectDir/build/tmp/mod-test" systemProperty 'vertx.version', "$project.version" + systemProperty 'vertx.modulename', "maven:$groupname:$artifact:$version" // Show output testLogging.showStandardStreams = true - // No idea why we need to depend on testClasses... - dependsOn << [ 'testClasses', 'prepareVertxTest' ] + testLogging { exceptionFormat "full" } } -task collectDeps(type: Copy) { - group = 'vert.x' - description = 'conveniently collect dependencies for other IDEs' - destinationDir = file("build/deps") - into("compile") { - from configurations.compile - } - into("test") { - from configurations.testCompile - } +task runMod(dependsOn: copyMod, description: 'Run the module using all the build dependencies (not using installed vertx') << { + def pm = PlatformLocator.factory.createPlatformManager() + pm.deployModule("maven:$groupname:$artifact:$version", null, 1, new Handler() { + public void handle(String deploymentID) { + System.out.println("CTRL-C to stop server") + } + }); + Thread.sleep(Long.MAX_VALUE); } -task wrapper(type: Wrapper) { - gradleVersion = '1.1' - jarFile = 'gradle/wrapper.jar' -} \ No newline at end of file +task pullInDeps(dependsOn: copyMod, description: 'Pull in all the module dependencies for the module into the nested mods directory') << { + if (pullInDeps == 'true') { + def pm = PlatformLocator.factory.createPlatformManager() + def modName = "maven:$groupname:$artifact:$version" + System.out.println("Pulling in dependencies for module " + modName + " Please wait") + pm.pullInDependencies(modName) + System.out.println("Dependencies pulled into mods directory of module") + } +} diff --git a/gradle.properties b/gradle.properties index 4ca716f..b5c47a2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,29 +1,15 @@ -# -# Copyright 2011 the original author or authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# +groupname=com.bloidonia +artifact=mod-jdbc-persistor +version=2.0.0-SNAPSHOT -# Package properties -modulename=com.bloidonia.jdbc-persistor -version=1.2 +# Set to true if you want module dependencies to be pulled in and nested inside the module itself +pullInDeps=false + +gradleVersion=1.4 +vertxVersion=2.0.0-SNAPSHOT +toolsVersion=1.0.0-SNAPSHOT +junitVersion=4.10 -# Compile-time requirements -vertxVersion=1.3.1.final c3p0Version=0.9.1.2 dbutilsVersion=1.5 - -# Testing requirements -junitVersion=4.11 -rhinoVersion=1.7R4 -hsqldbVersion=2.2.9 \ No newline at end of file +hsqldbVersion=2.2.9 diff --git a/gradle/maven.gradle b/gradle/maven.gradle new file mode 100644 index 0000000..42bf893 --- /dev/null +++ b/gradle/maven.gradle @@ -0,0 +1,99 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +apply plugin: 'maven' +apply plugin: 'signing' + +if (!hasProperty('sonatypeUsername')) { + ext.sonatypeUsername = '' +} +if (!hasProperty('sonatypePassword')) { + ext.sonatypePassword = '' +} + +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// maven task configuration + +ext.isReleaseVersion = !version.endsWith("SNAPSHOT") + +signing { + required { isReleaseVersion && gradle.taskGraph.hasTask("uploadArchives") } + sign configurations.archives +} + +uploadArchives { + group 'build' + description = "Does a maven deploy of archives artifacts" + + repositories { + mavenDeployer { + setUniqueVersion(false) + + configuration = configurations.archives + + repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { + authentication(userName: sonatypeUsername, password: sonatypePassword) + } + + snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { + authentication(userName: sonatypeUsername, password: sonatypePassword) + } + + if (isReleaseVersion) { + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + } + + configurePom(pom) + } + } +} + +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// configuration methods + +def configurePom(def pom) { + pom.project { + description 'Vert.x module that provides JavaScript support using Rhino' + inceptionYear '2013' + packaging 'jar' + url 'http://vertx.io' + + developers { + developer { + id 'purplefox' + name 'Tim Fox' + // email 'tim@tfox.org' + } + } + + scm { + url 'https://github.com/vert-x/mod-lang-rhino' + } + + licenses { + license { + name 'The Apache Software License, Version 2.0' + url 'http://www.apache.org/licenses/LICENSE-2.0.txt' + distribution 'repo' + } + } + + properties { + setProperty('project.build.sourceEncoding', 'UTF8') + } + } +} + diff --git a/gradle/setup.gradle b/gradle/setup.gradle new file mode 100644 index 0000000..da1fcd7 --- /dev/null +++ b/gradle/setup.gradle @@ -0,0 +1,5 @@ + +task wrapper(type: Wrapper, description: "Create a Gradle self-download wrapper") { + group = 'Project Setup' + gradleVersion = rootProject.gradleVersion +} \ No newline at end of file diff --git a/gradle/wrapper.jar b/gradle/wrapper/gradle-wrapper.jar similarity index 72% rename from gradle/wrapper.jar rename to gradle/wrapper/gradle-wrapper.jar index 7f1e239c8466c730b569575c494a89e6bb4c416a..42d9b0e9c5872910311a1d035995ab8ec466e7ac 100644 GIT binary patch delta 9381 zcmZ8n1zeO%*GE#3ZkCc}=?)2{rMp8qB%~Xb5|D-^r39All192aMY=&yIwigZyzl+I z&oaLm{(EBP%$f7d%-NPT*r=bdXo@m$@W?PQPoKghQwxa1pi!gV*ZXWjqk=FnFsd=H z**T8}nR=y$9f8AVMp7Q&$lcv1MHfR@VYt=^Pkt;T){4j)*P~$n!iD#P< z(!o}4vy3Ksl#K88E|L5f4mtr=O*u6|!Vmoy`sa}Vk(L$I3+qCv z>2_OZq$>fkBNpM{O*w7KYEE7c2+S8CtsVLS1+So+SPLbLB&Q*#ROo2#%^SFL#<=Bi zlIthKb%0qm#V>Yb=uW}Gh@@D$`;zlhT?tq;W(%QMd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HxO^n=JMw0| zK{!zcEbN$om!%|EEhs64f|pb-Wj{*q&|i>gpJS(7d=8!?cXuRikmv3pfoy zs0<43*F?&wfrc`sE7^P*6vYDIE4xVLS+7KD3nA{mqs#Lxt^Whd2YazWxLwc=v!|M%~%VtJ>47}Hb!4&;fE)zz8wP4$UV88>oeKC}bFB=w779L1172r~{g0x| zY85ytvOnvPZz}ADqP~nvMai#;{u#MAp-f?Mq}5*JD=l^dOq+cPUeASISiKyne`azd hknRS!ItMV$XCT*7gCL{eqJua=ZUi8ZaPGyw{{tLfb9Dd! diff --git a/gradle/wrapper.properties b/gradle/wrapper/gradle-wrapper.properties similarity index 81% rename from gradle/wrapper.properties rename to gradle/wrapper/gradle-wrapper.properties index 9072525..43dc243 100644 --- a/gradle/wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Tue Aug 07 17:22:15 BST 2012 +#Mon Jan 28 08:12:12 GMT 2013 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=http\://services.gradle.org/distributions/gradle-1.1-bin.zip +distributionUrl=http\://services.gradle.org/distributions/gradle-1.4-bin.zip diff --git a/gradlew b/gradlew index 87089b1..15680c7 100755 --- a/gradlew +++ b/gradlew @@ -65,7 +65,7 @@ cd "`dirname \"$PRG\"`/" APP_HOME="`pwd -P`" cd "$SAVED" -CLASSPATH=$APP_HOME/gradle/wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then @@ -101,7 +101,7 @@ if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then warn "Could not set maximum file descriptor limit: $MAX_FD" fi else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + warn "Could not query businessSystem maximum file descriptor limit: $MAX_FD_LIMIT" fi fi @@ -161,4 +161,4 @@ function splitJvmOpts() { eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain --daemon "$@" diff --git a/src/main/conf/mod.json b/src/main/conf/mod.json deleted file mode 100644 index 3ae9e6d..0000000 --- a/src/main/conf/mod.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "com.bloidonia.vertx.mods.JdbcBusMod" -} \ No newline at end of file diff --git a/src/main/java/com/bloidonia/vertx/mods/JdbcBusMod.java b/src/main/java/com/bloidonia/vertx/mods/JdbcBusMod.java index 37fdce0..dbdd81a 100644 --- a/src/main/java/com/bloidonia/vertx/mods/JdbcBusMod.java +++ b/src/main/java/com/bloidonia/vertx/mods/JdbcBusMod.java @@ -31,7 +31,7 @@ public void start() { container.deployModule( "vertx.work-queue-v1.2", config, 1, new Handler() { public void handle( String response ) { - container.deployWorkerVerticle( JdbcProcessor.class.getName(), config, maxpool, new Handler() { + container.deployWorkerVerticle( JdbcProcessor.class.getName(), config, maxpool, false, new Handler() { public void handle( String response ) { // All done, send a message to this effect incase anyone cares. eb.send( String.format( "%s.ready", address ), new JsonObject() {{ diff --git a/src/main/resources/mod.json b/src/main/resources/mod.json new file mode 100644 index 0000000..216d69c --- /dev/null +++ b/src/main/resources/mod.json @@ -0,0 +1,4 @@ +{ + "main": "com.bloidonia.vertx.mods.JdbcBusMod", + "deploys":"vertx.work-queue-v1.2" +} \ No newline at end of file diff --git a/src/test/java/com/bloidonia/vertx/mods/integration/javascript/JavaScriptIntegrationTests.java b/src/test/java/com/bloidonia/vertx/mods/integration/javascript/JavaScriptIntegrationTests.java new file mode 100644 index 0000000..12fbb4c --- /dev/null +++ b/src/test/java/com/bloidonia/vertx/mods/integration/javascript/JavaScriptIntegrationTests.java @@ -0,0 +1,31 @@ +/* + * Copyright 2011-2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.bloidonia.vertx.mods.integration.javascript ; + +import org.vertx.testtools.ScriptClassRunner; +import org.vertx.testtools.TestVerticleInfo; +import org.vertx.testtools.VertxAssert; +import org.junit.Test; +import org.junit.runner.RunWith; + +@TestVerticleInfo(filenameFilter=".+\\.js", funcRegex="function[\\s]+(test[^\\s(]+)") +@RunWith(ScriptClassRunner.class) +public class JavaScriptIntegrationTests { + @Test + public void __vertxDummy() { + } +} \ No newline at end of file diff --git a/src/test/java/com/bloidonia/vertx/mods/tests/JavaScriptPersistorTest.java b/src/test/java/com/bloidonia/vertx/mods/tests/JavaScriptPersistorTest.java deleted file mode 100644 index 4c8ab94..0000000 --- a/src/test/java/com/bloidonia/vertx/mods/tests/JavaScriptPersistorTest.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.bloidonia.vertx.mods.tests ; - -/* - * Copyright 2011-2012 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import org.junit.Test; -import org.vertx.java.testframework.TestBase; - -public class JavaScriptPersistorTest extends TestBase { - - public static int sleep( int seconds, int id ) { - try { - Thread.sleep( seconds * 1000 ) ; - return id ; - } - catch( Exception e ) { - return -id ; - } - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - startApp("test_client.js"); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - } - - @Test - public void testConcurrency() throws Exception { - startTest(getMethodName()); - } - - @Test - public void testBatchedSimpleSelector() throws Exception { - startTest(getMethodName()); - } - - @Test - public void testSimpleSelect() throws Exception { - startTest(getMethodName()); - } - - @Test - public void testInvalidAction() throws Exception { - startTest(getMethodName()); - } - - @Test - public void testCreateAndInsert() throws Exception { - startTest(getMethodName()); - } - - @Test - public void testCreateAndInsertViaStmt() throws Exception { - startTest(getMethodName()); - } - - @Test - public void testHammerInsert() throws Exception { - startTest(getMethodName()); - } - - @Test - public void testHammerParallel() throws Exception { - startTest(getMethodName()); - } - - @Test - public void testRollback() throws Exception { - startTest(getMethodName()); - } - - @Test - public void testCommit() throws Exception { - startTest(getMethodName()); - } -} - diff --git a/src/test/resources/test_client.js b/src/test/resources/integration_tests/javascript/test_client.js similarity index 58% rename from src/test/resources/test_client.js rename to src/test/resources/integration_tests/javascript/test_client.js index 4086df3..90c1e6c 100644 --- a/src/test/resources/test_client.js +++ b/src/test/resources/integration_tests/javascript/test_client.js @@ -14,19 +14,17 @@ * limitations under the License. */ -load('test_utils.js') -load('vertx.js') - -var tu = new TestUtils(); +load("vertx.js"); +load("vertx_tests.js"); var eb = vertx.eventBus; -function testInvalidAction() { +function test_InvalidAction() { eb.send( 'test.persistor', { action: 'blahblahblah' }, function( reply ) { - tu.azzert( reply.status === 'error' ) ; - tu.testComplete() ; + vassert.azzert( reply.status === 'error' ) ; + vassert.testComplete() ; } ) } @@ -54,20 +52,20 @@ function testConcurrency() { "LANGUAGE JAVA DETERMINISTIC NO SQL EXTERNAL NAME " + "'CLASSPATH:com.bloidonia.vertx.mods.tests.JavaScriptPersistorTest.sleep'" }, function( reply ) { - tu.azzert( reply.status === 'ok', reply.message ) ; + vassert.azzert( reply.status === 'ok', reply.message ) ; var start = new Date() ; for( var i = 0 ; i < todo ; i++ ) { eb.send( 'test.persistor', { action: 'select', stmt: 'CALL sleep( 1, ' + ( i + 1 ) + ' )' }, function( reply ) { - tu.azzert( reply.status === 'ok' ) ; + vassert.azzert( reply.status === 'ok' ) ; done++ ; java.lang.System.out.println( "Done " + done + " (task " + reply.result[0][ '@p0' ] + " returned ok)" ) ; if( done == todo ) { var diff = new Date().getTime() - start.getTime() ; - tu.azzert( diff < 5000, 'Expected time delay to be less than 5s, but it was ' + ( diff / 1000 ) + 's' ) ; - tu.testComplete() ; + vassert.azzert( diff < 5000, 'Expected time delay to be less than 5s, but it was ' + ( diff / 1000 ) + 's' ) ; + vassert.testComplete() ; } } ) ; } @@ -80,9 +78,9 @@ function testSimpleSelect() { action: 'select', stmt: 'SELECT * FROM INFORMATION_SCHEMA.SYSTEM_USERS' }, function( reply ) { - tu.azzert( reply.status === 'ok' ) ; - tu.azzert( reply.result != undefined ) ; - tu.testComplete() ; + vassert.azzert( reply.status === 'ok' ) ; + vassert.azzert( reply.result != undefined ) ; + vassert.testComplete() ; } ) } @@ -97,9 +95,9 @@ function testBatchedSimpleSelector() { if( reply.status === 'more-exist' ) { replier( {}, createReplyHandler() ) ; } else { - tu.azzert( reply.status === 'ok' ) ; - tu.azzert( received === num, 'Expected ' + num + 'records in total. Got ' + received + ' insead' ) ; - tu.testComplete() ; + vassert.azzert( reply.status === 'ok' ) ; + vassert.azzert( received === num, 'Expected ' + num + 'records in total. Got ' + received + ' insead' ) ; + vassert.testComplete() ; } } } @@ -115,9 +113,9 @@ function testBatchedSimpleSelector() { stmt: 'INSERT INTO test ( name, age ) VALUES ( ?, ? )', values: values }, function( reply ) { - tu.azzert( reply.status === 'ok' ) ; - tu.azzert( reply.updated === num, 'updated should equal ' + num + ', actually was ' + reply.updated ) ; - tu.azzert( reply.result.length === num, 'should get back ' + num + ', primary keys' ) ; + vassert.azzert( reply.status === 'ok' ) ; + vassert.azzert( reply.updated === num, 'updated should equal ' + num + ', actually was ' + reply.updated ) ; + vassert.azzert( reply.result.length === num, 'should get back ' + num + ', primary keys' ) ; eb.send('test.persistor', { action: 'select', stmt: 'SELECT * FROM test ORDER BY age ASC', @@ -134,31 +132,31 @@ function testCreateAndInsert() { stmt: 'INSERT INTO test( name, age ) VALUES ( ?, ? )', values: [ [ 'tim', 65 ], [ 'dave', 29 ], [ 'mike', 42 ] ] }, function( reply ) { - tu.azzert( reply.status === 'ok' ) ; - tu.azzert( reply.result != undefined ) ; - tu.azzert( reply.result.length == 3 ) ; - tu.azzert( reply.result[ 0 ].ID == 1 ) ; - tu.azzert( reply.result[ 1 ].ID == 2 ) ; - tu.azzert( reply.result[ 2 ].ID == 3 ) ; + vassert.azzert( reply.status === 'ok' ) ; + vassert.azzert( reply.result != undefined ) ; + vassert.azzert( reply.result.length == 3 ) ; + vassert.azzert( reply.result[ 0 ].ID == 1 ) ; + vassert.azzert( reply.result[ 1 ].ID == 2 ) ; + vassert.azzert( reply.result[ 2 ].ID == 3 ) ; eb.send( 'test.persistor', { action: 'select', stmt: 'SELECT * FROM test ORDER BY age ASC' }, function( reply ) { - tu.azzert( reply.status === 'ok' ) ; - tu.azzert( reply.result.length == 3 ) ; - tu.azzert( reply.result[ 0 ].ID === 2 ) ; - tu.azzert( reply.result[ 0 ].NAME === 'dave' ) ; - tu.azzert( reply.result[ 0 ].AGE === 29 ) ; + vassert.azzert( reply.status === 'ok' ) ; + vassert.azzert( reply.result.length == 3 ) ; + vassert.azzert( reply.result[ 0 ].ID === 2 ) ; + vassert.azzert( reply.result[ 0 ].NAME === 'dave' ) ; + vassert.azzert( reply.result[ 0 ].AGE === 29 ) ; - tu.azzert( reply.result[ 1 ].ID === 3 ) ; - tu.azzert( reply.result[ 1 ].NAME === 'mike' ) ; - tu.azzert( reply.result[ 1 ].AGE === 42 ) ; + vassert.azzert( reply.result[ 1 ].ID === 3 ) ; + vassert.azzert( reply.result[ 1 ].NAME === 'mike' ) ; + vassert.azzert( reply.result[ 1 ].AGE === 42 ) ; - tu.azzert( reply.result[ 2 ].ID === 1 ) ; - tu.azzert( reply.result[ 2 ].NAME === 'tim' ) ; - tu.azzert( reply.result[ 2 ].AGE === 65 ) ; + vassert.azzert( reply.result[ 2 ].ID === 1 ) ; + vassert.azzert( reply.result[ 2 ].NAME === 'tim' ) ; + vassert.azzert( reply.result[ 2 ].AGE === 65 ) ; - tu.testComplete() ; + vassert.testComplete() ; } ) ; } ) ; } ) @@ -170,31 +168,31 @@ function testCreateAndInsertViaStmt() { action: 'insert', stmt: "INSERT INTO test( name, age ) VALUES ( 'tim', 65 ), ( 'dave', 29 ), ( 'mike', 42 )", }, function( reply ) { - tu.azzert( reply.status === 'ok' ) ; - tu.azzert( reply.result != undefined ) ; - tu.azzert( reply.result.length == 3 ) ; - tu.azzert( reply.result[ 0 ].ID != null ) ; - tu.azzert( reply.result[ 1 ].ID != null ) ; - tu.azzert( reply.result[ 2 ].ID != null ) ; + vassert.azzert( reply.status === 'ok' ) ; + vassert.azzert( reply.result != undefined ) ; + vassert.azzert( reply.result.length == 3 ) ; + vassert.azzert( reply.result[ 0 ].ID != null ) ; + vassert.azzert( reply.result[ 1 ].ID != null ) ; + vassert.azzert( reply.result[ 2 ].ID != null ) ; eb.send( 'test.persistor', { action: 'select', stmt: 'SELECT * FROM test ORDER BY age ASC' }, function( reply ) { - tu.azzert( reply.status === 'ok' ) ; - tu.azzert( reply.result.length == 3, 'Expected 3 results. Got ' + reply.result.length ) ; - tu.azzert( reply.result[ 0 ].ID != null ) ; - tu.azzert( reply.result[ 0 ].NAME === 'dave' ) ; - tu.azzert( reply.result[ 0 ].AGE === 29 ) ; + vassert.azzert( reply.status === 'ok' ) ; + vassert.azzert( reply.result.length == 3, 'Expected 3 results. Got ' + reply.result.length ) ; + vassert.azzert( reply.result[ 0 ].ID != null ) ; + vassert.azzert( reply.result[ 0 ].NAME === 'dave' ) ; + vassert.azzert( reply.result[ 0 ].AGE === 29 ) ; - tu.azzert( reply.result[ 1 ].ID != null ) ; - tu.azzert( reply.result[ 1 ].NAME === 'mike' ) ; - tu.azzert( reply.result[ 1 ].AGE === 42 ) ; + vassert.azzert( reply.result[ 1 ].ID != null ) ; + vassert.azzert( reply.result[ 1 ].NAME === 'mike' ) ; + vassert.azzert( reply.result[ 1 ].AGE === 42 ) ; - tu.azzert( reply.result[ 2 ].ID != null ) ; - tu.azzert( reply.result[ 2 ].NAME === 'tim' ) ; - tu.azzert( reply.result[ 2 ].AGE === 65 ) ; + vassert.azzert( reply.result[ 2 ].ID != null ) ; + vassert.azzert( reply.result[ 2 ].NAME === 'tim' ) ; + vassert.azzert( reply.result[ 2 ].AGE === 65 ) ; - tu.testComplete() ; + vassert.testComplete() ; } ) ; } ) ; } ) @@ -212,16 +210,16 @@ function testHammerInsert() { stmt: "INSERT INTO test( age ) VALUES ( ? )", values: valueList }, function( reply ) { - tu.azzert( reply.status === 'ok' ) ; - tu.azzert( reply.result != undefined ) ; - tu.azzert( reply.result.length == hammerSize ) ; + vassert.azzert( reply.status === 'ok' ) ; + vassert.azzert( reply.result != undefined ) ; + vassert.azzert( reply.result.length == hammerSize ) ; eb.send( 'test.persistor', { action: 'select', stmt: 'SELECT COUNT( * ) AS CNT FROM test' }, function( reply ) { - tu.azzert( reply.status === 'ok' ) ; - tu.azzert( reply.result[ 0 ].CNT === hammerSize ) ; - tu.testComplete() ; + vassert.azzert( reply.status === 'ok' ) ; + vassert.azzert( reply.result[ 0 ].CNT === hammerSize ) ; + vassert.testComplete() ; } ) ; } ) ; } ) @@ -242,18 +240,18 @@ function testHammerParallel() { stmt: "INSERT INTO test( age ) VALUES ( ? )", values: valueList }, function( reply ) { - tu.azzert( reply.status === 'ok' ) ; - tu.azzert( reply.result != undefined ) ; - tu.azzert( reply.result.length == hammerSize ) ; + vassert.azzert( reply.status === 'ok' ) ; + vassert.azzert( reply.result != undefined ) ; + vassert.azzert( reply.result.length == hammerSize ) ; received++ ; if( received === loops ) { eb.send( 'test.persistor', { action: 'select', stmt: 'SELECT COUNT( * ) AS CNT FROM test' }, function( reply ) { - tu.azzert( reply.status === 'ok' ) ; - tu.azzert( reply.result[ 0 ].CNT === hammerSize * loops, 'Expected ' + hammerSize * loops + '. Got ' + reply.result[ 0 ].CNT ) ; - tu.testComplete() ; + vassert.azzert( reply.status === 'ok' ) ; + vassert.azzert( reply.result[ 0 ].CNT === hammerSize * loops, 'Expected ' + hammerSize * loops + '. Got ' + reply.result[ 0 ].CNT ) ; + vassert.testComplete() ; } ) ; } } ) ; @@ -266,26 +264,26 @@ function testRollback() { eb.send( 'test.persistor', { action: 'transaction' }, function( reply, replier ) { - tu.azzert( reply.status === 'ok' ) ; - tu.azzert( reply.result == undefined ) ; + vassert.azzert( reply.status === 'ok' ) ; + vassert.azzert( reply.result == undefined ) ; replier( { action: 'insert', stmt: 'INSERT INTO test( name, age ) VALUES ( ?, ? )', values: [ [ 'tim', 65 ], [ 'dave', 29 ], [ 'mike', 42 ] ] }, function( reply, replier ) { - tu.azzert( reply.status === 'ok' ) ; - tu.azzert( reply.result.length == 3 ) ; + vassert.azzert( reply.status === 'ok' ) ; + vassert.azzert( reply.result.length == 3 ) ; replier( { action:'rollback' }, function( reply ) { - tu.azzert( reply.status === 'ok' ) ; + vassert.azzert( reply.status === 'ok' ) ; eb.send( 'test.persistor', { action: 'select', stmt: 'SELECT * FROM test ORDER BY age ASC' }, function( reply ) { - tu.azzert( reply.status === 'ok' ) ; - tu.azzert( reply.result.length == 0 ) ; - tu.testComplete() ; + vassert.azzert( reply.status === 'ok' ) ; + vassert.azzert( reply.result.length == 0 ) ; + vassert.testComplete() ; } ) ; } ) ; } ) ; @@ -298,37 +296,37 @@ function testCommit() { eb.send( 'test.persistor', { action: 'transaction' }, function( reply, replier ) { - tu.azzert( reply.status === 'ok' ) ; - tu.azzert( reply.result == undefined ) ; + vassert.azzert( reply.status === 'ok' ) ; + vassert.azzert( reply.result == undefined ) ; replier( { action: 'insert', stmt: 'INSERT INTO test( name, age ) VALUES ( ?, ? )', values: [ [ 'tim', 65 ], [ 'dave', 29 ], [ 'mike', 42 ] ] }, function( reply, replier ) { - tu.azzert( reply.status === 'ok' ) ; - tu.azzert( reply.result.length == 3 ) ; + vassert.azzert( reply.status === 'ok' ) ; + vassert.azzert( reply.result.length == 3 ) ; replier( { action:'commit' }, function( reply ) { - tu.azzert( reply.status === 'ok' ) ; + vassert.azzert( reply.status === 'ok' ) ; eb.send( 'test.persistor', { action: 'select', stmt: 'SELECT * FROM test ORDER BY age ASC' }, function( reply ) { - tu.azzert( reply.status === 'ok' ) ; - tu.azzert( reply.result.length == 3 ) ; - tu.azzert( reply.result[ 0 ].NAME == 'dave', 'Expected Dave first' ) ; - tu.azzert( reply.result[ 1 ].NAME == 'mike', 'Mike should be second' ) ; - tu.azzert( reply.result[ 2 ].NAME == 'tim', 'And Tim last' ) ; - tu.testComplete() ; + vassert.azzert( reply.status === 'ok' ) ; + vassert.azzert( reply.result.length == 3 ) ; + vassert.azzert( reply.result[ 0 ].NAME == 'dave', 'Expected Dave first' ) ; + vassert.azzert( reply.result[ 1 ].NAME == 'mike', 'Mike should be second' ) ; + vassert.azzert( reply.result[ 2 ].NAME == 'tim', 'And Tim last' ) ; + vassert.testComplete() ; } ) ; } ) ; } ) ; } ) ; } ) ; } -// -tu.registerTests( this ) ; + +initTests( this ) ; var persistorConfig = { address: 'test.persistor', url: 'jdbc:hsqldb:mem:' + vertx.generateUUID() + '?shutdown=true' } @@ -338,16 +336,16 @@ var readyAddress = persistorConfig.address + '.ready' var readyHandler = function( msg ) { if( msg.status === 'ok' ) { - tu.appReady(); + vassert.appReady(); eb.unregisterHandler( readyAddress, readyHandler ) ; } } ; +java.lang.System.out.println( ) ; + // This will get called by the jdbc-persistor when it has installed the work-queue eb.registerHandler( readyAddress, readyHandler ) ; - -vertx.deployModule('com.bloidonia.jdbc-persistor-v' + java.lang.System.getProperty('vertx.version'), persistorConfig, 1, function() {} ) ; - +vertx.deployModule(java.lang.System.getProperty( 'vertx.modulename' ), persistorConfig, 1, function() {} ) ; function vertxStop() { - tu.appStopped(); + vassert.appStopped(); } \ No newline at end of file diff --git a/src/test/resources/langs.properties b/src/test/resources/langs.properties deleted file mode 100644 index 797300b..0000000 --- a/src/test/resources/langs.properties +++ /dev/null @@ -1,13 +0,0 @@ -# Mapping between main file extensions and the verticle factory for the class - -java=org.vertx.java.deploy.impl.java.JavaVerticleFactory -class=org.vertx.java.deploy.impl.java.JavaVerticleFactory -js=org.vertx.java.deploy.impl.rhino.RhinoVerticleFactory -coffee=org.vertx.java.deploy.impl.rhino.RhinoVerticleFactory -rb=org.vertx.java.deploy.impl.jruby.JRubyVerticleFactory -groovy=org.vertx.groovy.deploy.impl.groovy.GroovyVerticleFactory -py=org.vertx.java.deploy.impl.jython.JythonVerticleFactory - -# Default - if none match this will be assumed - -default=org.vertx.java.deploy.impl.java.JavaVerticleFactory \ No newline at end of file