This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package models | |
import javax.persistence.* | |
@Entity (name="Agreement") | |
@Table (name="agreement") | |
@EntityListeners ([QIdSetter.class]) | |
class AgreementJpaImpl extends QIdEntityImpl implements Agreement { | |
@ManyToOne (targetEntity=PartyJpaImpl.class) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') | |
describe Scm::OnHandReportsController do | |
#Delete these examples and add some real ones | |
it "should use Scm::OnHandReportsController" do | |
controller.should be_an_instance_of(Scm::OnHandReportsController) | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Caused by: org.jruby.rack.RackInitializationException: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String; | |
from file:/Users/mark/opt/JBoss-4.0.2/server/default/tmp/deploy/tmp4851618238755102823mori.ear-contents/mori.war/WEB-INF/lib/jruby-rack-0.9.7.jar!/jruby/rack/rails.rb:113:in `setup_relative_url_root' | |
from file:/Users/mark/opt/JBoss-4.0.2/server/default/tmp/deploy/tmp4851618238755102823mori.ear-contents/mori.war/WEB-INF/lib/jruby-rack-0.9.7.jar!/jruby/rack/rails.rb:48:in `load_environment' | |
from file:/Users/mark/opt/JBoss-4.0.2/server/default/tmp/deploy/tmp4851618238755102823mori.ear-contents/mori.war/WEB-INF/lib/jruby-rack-0.9.7.jar!/jruby/rack/rails.rb:38:in `to_app' | |
from file:/Users/mark/opt/JBoss-4.0.2/server/default/tmp/deploy/tmp4851618238755102823mori.ear-contents/mori.war/WEB-INF/lib/jruby-rack-0.9.7.jar!/jruby/rack/rails.rb:186:in `new' | |
from <script>:2 | |
from file:/Users/mark/opt/JBoss-4.0.2/server/default/tmp/deploy/tmp485161823875510 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HapagLloydMoveDocWrapper < DocWrapperBase | |
property :carrier_description, :string, './td[1]' | |
property :location, :string, './td[2]' | |
multi_property :time_of_move, ['./td[3]','./td[4]'] do |x| | |
Time.parse("#{x[0]} #{x[1]}".strip) | |
end | |
property :status, :raw, './td[1]' do |node_list| | |
node = node_list.first | |
if node.attribute("class") && node.attribute("class").content =~ /strong/ | |
'ACTUAL' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A { | |
def foo = "A" | |
def printFoo () { | |
println foo | |
} | |
} | |
class B extends A { | |
def foo = "B" | |
def printFoo () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class A { | |
private String foo = "A"; | |
public void printFoo () { | |
System.out.println(foo); | |
} | |
} | |
public class B extends A { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// With the Category annotation this throws a ValidationError | |
// Without the annotation everything runs as exepected | |
@Category(Object) | |
class Base { | |
def errors = [] | |
def foo () { | |
errors = [] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.springframework.beans.BeanUtils | |
import java.lang.reflect.Field; | |
import java.lang.reflect.Method; | |
@Category(Object) | |
class PropertyUtils { | |
def getPropertyValue (Class clazz, String name, Object ob) { | |
Method getter = BeanUtils.findDeclaredMethod(clazz, getGetterName(name), null) | |
try { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
org.jruby.rack.RackInitializationException: Valid types are [:development, :runtime], not nil | |
from /Users/enablelabs/opt/jboss/server/default/tmp/deploy/tmp2213791091804345453mori.ear-contents/mori.war/WEB-INF/gems/gems/bundler-1.0.7/lib/bundler/resolver.rb:359:in `new' | |
from /Users/enablelabs/opt/jboss/server/default/tmp/deploy/tmp2213791091804345453mori.ear-contents/mori.war/WEB-INF/gems/gems/bundler-1.0.7/lib/bundler/resolver.rb:359:in `search' | |
from /Users/enablelabs/opt/jboss/server/default/tmp/deploy/tmp2213791091804345453mori.ear-contents/mori.war/WEB-INF/gems/gems/bundler-1.0.7/lib/bundler/resolver.rb:354:in `gems_size' | |
from /Users/enablelabs/opt/jboss/server/default/tmp/deploy/tmp2213791091804345453mori.ear-contents/mori.war/WEB-INF/gems/gems/bundler-1.0.7/lib/bundler/resolver.rb:179:in `resolve' | |
from /Users/enablelabs/opt/jboss/server/default/tmp/deploy/tmp2213791091804345453mori.ear-contents/mori.war/WEB-INF/gems/gems/bundler-1.0.7/lib/bundler/resolver.rb:175:in `each' | |
from /Users/enablelabs/op |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# My first attempt at using both Mocha and RSpec mocks in a project. | |
module Spec | |
module Adapters | |
module MockFramework | |
# Mocha::Standalone was deprecated as of Mocha 0.9.7. | |
begin | |
include Mocha::API | |
rescue NameError |