Skip to content

Instantly share code, notes, and snippets.

View sjednac's full-sized avatar

Szymon Jednac sjednac

View GitHub Profile
@sjednac
sjednac / checkstyle-pre-commit.py
Last active June 23, 2016 09:30
Checkstyle pre-commit hook
#! /usr/bin/env python
# -*- encoding: utf-8 -*-
import os
# Config
checkstyle_jar = os.getenv('CHECKSTYLE_JAR', "checkstyle-5.7-all.jar")
checkstyle_cfg = os.getenv('CHECKSTYLE_CFG', "checkstyle.xml")
failing_test_should_prevent_commit = True
@sjednac
sjednac / SpringPrototypeBeanInjectionTest.java
Last active January 5, 2017 20:13
Spring prototype bean injection using javax.inject.Provider (JSR-330)
package com.example;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;