Skip to content

Instantly share code, notes, and snippets.

View britt's full-sized avatar

Britt Crawford britt

View GitHub Profile
@Test
public void shouldLoadAllBeansFromSpringContext() throws Exception {
for(String bean : new String[]{"productInputFormat", "upgradingMapper", "upgradeJob"})
Assert.assertNotNull(context.getBean(bean));
}
$: << File.dirname(__FILE__)
require 'spec_helper'
describe "Product REST Service findByUpdateDate" do
before(:each) do
end
it 'should only find products created within the date ran ge given' do
public BookInfoJaxBImpl(BookInfo bookInfo) {
if(bookInfo==null)
throw new IllegalArgumentException("BookInfo passed into the constructor cannot be null.");
else
load(bookInfo);
}
private void load(BookInfo bookInfo) {
//load the values of BookInfo into this instance
}
javascript:(function(){var k=" -site:experts-exchange.com -site:swik.net";if(document.f){document.f.q.value=document.f.q.value+k;}else{document.gs.q.value=document.gs.q.value+k}})()
javascript:(
function(){
var k=" -site:expertsexchange.com -site:swik.net";
if(document.f){
document.f.q.value=document.f.q.value+k;
}else{
document.gs.q.value=document.gs.q.value+k
}})()
public String[] getJobNames() {
return Transform.map(new Unary<JobConf, String>(){
public String f(JobConf item) {
return item.getJobName();
}
}, context.getBeansOfType(JobConf.class).values()).toArray(new String[]{});
}
def get_job_names
context.getBeansOfType(JobConf).collect do |beanGetJobName,bean|
bean.getJobName
end
end
CmdUtils.CreateCommand({
name: "subscribe",
description: "Subscribe to a feed for the current page in Google Reader -- I didn't write this. I found it on the web somewhere (that I've now forgotten) and just pasted it here to test Gists Ubiquity command functionality.",
help: "Subscribe to a feed for the current page in Google Reader (does same thing as their bookmarklet)",
execute: function(tags) {
var document = context.focusedWindow.document;
var b=document.body;
var GR________bookmarklet_domain='http://www.google.com';
if (b&&!document.xmlVersion) {
void(z=document.createElement('script'));
// HiveDB uses a partition by key strategy so you must select a relevant
// property of the data to use to split the data set. We call this the
// partitioning key. Ideally, this should be a dimension or relationship
// that you never need to join across since HiveDB does not support joins
// across shards.
//
// Insert the partitioning key in order to allocate it to a shard.
// [In this example we are partitioning silverware by type.]
hive.directory().insertPrimaryIndexKey(spork.getType());
config.gem "rspec", :version => ">= 1.2.6", :lib => 'spec'
config.gem "rspec-rails", :version => ">= 1.2.6", :lib => 'spec/rails'