Skip to content

Instantly share code, notes, and snippets.

View odrotbohm's full-sized avatar
👨‍💻
@ home

Oliver Drotbohm odrotbohm

👨‍💻
@ home
View GitHub Profile
[INFO] Surefire report directory: /Users/olivergierke/Documents/workspace/spring-data-couchbase/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.springframework.data.couchbase.cache.CouchbaseCacheManagerTests
2013-07-29 10:49:10,346 INFO ontext.support.GenericApplicationContext: 503 - Refreshing org.springframework.context.support.GenericApplicationContext@2880cac9: startup date [Mon Jul 29 10:49:10 CEST 2013]; root of context hierarchy
2013-07-29 10:49:10,836 INFO ctory.support.DefaultListableBeanFactory: 577 - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@627a4489: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotat
$ ps -xo pid,ppid,stat,command | grep Skype
85267 185 ?E (Skype)
79202 339 R+ grep Skype
$ kill -9 85267
$ ps -xo pid,ppid,stat,command | grep Skype
85267 185 ?E (Skype)
79220 339 R+ grep Skype
/*
* Copyright 2008-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
@Test
public void foo() {
TypeBasedAggregationOperationContext context = new TypeBasedAggregationOperationContext(Foo.class,
new MongoMappingContext(), new QueryMapper(converter));
Aggregation aggregation = newAggregation(Foo.class, group("bar.name"));
aggregation.toDbObject("foo", context);
}
@odrotbohm
odrotbohm / gist:6193121
Created August 9, 2013 12:06
Optional sample
public Location whereIs( String employeeName ){
employeeDAO.findProjectFor(employeeName)
.map( p -> ProjectDAO.findCustomerFor( p ) )
.map( c -> CustomerDAO.findLocationFor( c ) )
.orElse( HomeBase.Location );
}
@odrotbohm
odrotbohm / ConcreteTest.java
Created August 10, 2013 13:44
Sample code to show apparent bug in Spring test context framework
@Transactional
public class ConcreteTest extends TestBase {
@Before
public void setUp() {
// Create sample data in the database
}
// Further test methods
}
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import org.junit.Test;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Configuration;
@Target(ElementType.PARAMETER)
@interface MyAnnotation {
@Min(1)
int value() default 10;
}
aused by: org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embdedded Tomcat
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:80)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.<init>(TomcatEmbeddedServletContainer.java:52)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getTomcatEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:259)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:140)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:152)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134)
at org.springframework.
/*
* 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.
* 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