Skip to content

Instantly share code, notes, and snippets.

View abstractj's full-sized avatar

Bruno Oliveira da Silva abstractj

View GitHub Profile
@abstractj
abstractj / it_works_on_my_machine
Created January 19, 2012 04:50
it_works_on_my_machine
➜ integration-tests (TORQUE-514) ✗ mvn -s ../support/settings.xml -Dspec=spec/alacarte_jobs_spec.rb test
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.torquebox:torquebox-integration-tests:jar:2.0.0.beta3-SNAPSHOT
[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin de.saumya.mojo:jruby-maven-plugin @ line 417, column 15
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
@abstractj
abstractj / jboss_thread
Created January 18, 2012 01:38
jboss_thread
final JBossThreadFactory threadFactory = new JBossThreadFactory(new ThreadGroup("org.projectodd.polyglot.jobs");
ScheduledExecutorService service = Executors.newScheduledThreadPool(1, threadFactory);
@abstractj
abstractj / BaseTriggerListener
Created January 18, 2012 01:33
BaseTriggerListener
/*
* Copyright 2008-2011 Red Hat, Inc, and individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@abstractj
abstractj / long_running_job.rb
Created January 16, 2012 16:18
integration_test
class LongRunningJob
include TorqueBox::Injectors
def initialize(opts)
@options = opts
@polish = inject( Java::pl.softwaremine.ThingThree )
@response_queue = inject( '/queue/response' )
@init_params_queue = inject( '/queue/init_params' )
@init_params_queue.publish( @options )
@abstractj
abstractj / DynamicScheduling
Created January 14, 2012 21:54
DynamicScheduling
schedule = TorqueBox::Jobs::Schedule.new('MyJobClass')
scheduler.at 'Sat Jan 14 07:53:43 +0900 2009'
or
scheduler.at '0 52 15 * * ?'
or
scheduler.at '20 m'
@abstractj
abstractj / maven
Created January 10, 2012 17:41
maven
ERROR] Failed to execute goal on project torquebox-messaging: Could not resolve dependencies for project rubygems:torquebox-messaging:java-gem:2.0.0.beta3-SNAPSHOT: Could not find artifact rubygems:torquebox-transactions:gem:2.0.0.beta3-SNAPSHOT in jboss-public-repository-group (http://repository.jboss.org/nexus/content/groups/public/) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
@abstractj
abstractj / houston
Created January 10, 2012 15:05
houston
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.torquebox.core.util.ReflectionHelperTest
log4j:WARN No appenders could be found for logger (org.jboss.logging).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 11.404 sec
Running org.torquebox.core.app.processors.RuntimePoolInstallerTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.406 sec
/*
* Copyright 2008-2011 Red Hat, Inc, and individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@abstractj
abstractj / build_steps
Created January 4, 2012 12:52
modules_build
➜ torquebox (2x-dev) cd modules/jobs
➜ jobs (2x-dev) mvn -s ../../support/settings.xml clean package
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building TorqueBox Jobs Module 2.0.0.beta2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4:clean (default-clean) @ torquebox-jobs ---
@abstractj
abstractj / local-tx-datasource
Created November 25, 2011 20:38
local-tx-datasource
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>DefaultDSBotelhos</jndi-name>
<connection-url>jdbc:mysql://127.0.0.1:3306/meh</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>root</user-name>
<password>root</password>