// Path: src/main/java/ru/vyarus/guice/ext/ExtAnnotationsModule.java
// @SuppressWarnings("checkstyle:ClassDataAbstractionCoupling")
// public class ExtAnnotationsModule extends AbstractModule {
// 
//     private Matcher<Object> typeMatcher;
// 
//     /**
//      * Default module constructor to check annotations on all beans.
//      */
//     public ExtAnnotationsModule() {
//         this(Matchers.any());
//     }
// 
//     /**
//      * Constructs annotation module with annotation scan limited to provided package.
//      * (used mainly for startup performance optimization)
//      *
//      * @param pkg package to limit beans, where annotations processed
//      */
//     public ExtAnnotationsModule(final String pkg) {
//         this(new ObjectPackageMatcher<Object>(pkg));
//     }
// 
//     /**
//      * Constructs annotation module with custom bean matcher for annotations processing.
//      *
//      * @param typeMatcher matcher to select beans for annotations processing
//      */
//     public ExtAnnotationsModule(final Matcher<Object> typeMatcher) {
//         this.typeMatcher = typeMatcher;
//     }
// 
//     @Override
//     protected void configure() {
//         final DestroyableManager manager = configureManager(new DestroyableManager());
// 
//         bindListener(typeMatcher, new GeneralTypeListener<Destroyable>(
//                 Destroyable.class, new DestroyableTypeProcessor(manager)));
// 
//         bindListener(typeMatcher, new AnnotatedMethodTypeListener<PostConstruct>(
//                 PostConstruct.class, new PostConstructAnnotationProcessor()));
// 
//         bindListener(typeMatcher, new AnnotatedMethodTypeListener<PreDestroy>(
//                 PreDestroy.class, new PreDestroyAnnotationProcessor(manager)));
// 
//         bindListener(typeMatcher, new AnnotatedFieldTypeListener<Log>(
//                 Log.class, new Slf4jLogAnnotationProcessor()));
//     }
// 
// 
//     /**
//      * Registers destroyable manager in injector and adds shutdown hook to process destroy on jvm shutdown.
//      *
//      * @param manager destroyable manager instance
//      * @return manager instance
//      */
//     protected DestroyableManager configureManager(final DestroyableManager manager) {
//         bind(DestroyableManager.class).toInstance(manager);
//         // if logic will not call destroy at least it will be called before jvm shutdown
//         Runtime.getRuntime().addShutdownHook(new Thread(manager));
//         return manager;
//     }
// }


import com.google.inject.Guice;
import org.junit.Assert;
import org.junit.Test;
import ru.vyarus.guice.ext.ExtAnnotationsModule;
import javax.annotation.PostConstruct;
package ru.vyarus.guice.ext.postconstruct;



/**
 * @author Vyacheslav Rusakov
 * @since 20.12.2014
 */
public class InheritanceTest {

    @Test
    public void testInheritance() throws Exception {
// Path: src/main/java/ru/vyarus/guice/ext/ExtAnnotationsModule.java
// @SuppressWarnings("checkstyle:ClassDataAbstractionCoupling")
// public class ExtAnnotationsModule extends AbstractModule {
// 
//     private Matcher<Object> typeMatcher;
// 
//     /**
//      * Default module constructor to check annotations on all beans.
//      */
//     public ExtAnnotationsModule() {
//         this(Matchers.any());
//     }
// 
//     /**
//      * Constructs annotation module with annotation scan limited to provided package.
//      * (used mainly for startup performance optimization)
//      *
//      * @param pkg package to limit beans, where annotations processed
//      */
//     public ExtAnnotationsModule(final String pkg) {
//         this(new ObjectPackageMatcher<Object>(pkg));
//     }
// 
//     /**
//      * Constructs annotation module with custom bean matcher for annotations processing.
//      *
//      * @param typeMatcher matcher to select beans for annotations processing
//      */
//     public ExtAnnotationsModule(final Matcher<Object> typeMatcher) {
//         this.typeMatcher = typeMatcher;
//     }
// 
//     @Override
//     protected void configure() {
//         final DestroyableManager manager = configureManager(new DestroyableManager());
// 
//         bindListener(typeMatcher, new GeneralTypeListener<Destroyable>(
//                 Destroyable.class, new DestroyableTypeProcessor(manager)));
// 
//         bindListener(typeMatcher, new AnnotatedMethodTypeListener<PostConstruct>(
//                 PostConstruct.class, new PostConstructAnnotationProcessor()));
// 
//         bindListener(typeMatcher, new AnnotatedMethodTypeListener<PreDestroy>(
//                 PreDestroy.class, new PreDestroyAnnotationProcessor(manager)));
// 
//         bindListener(typeMatcher, new AnnotatedFieldTypeListener<Log>(
//                 Log.class, new Slf4jLogAnnotationProcessor()));
//     }
// 
// 
//     /**
//      * Registers destroyable manager in injector and adds shutdown hook to process destroy on jvm shutdown.
//      *
//      * @param manager destroyable manager instance
//      * @return manager instance
//      */
//     protected DestroyableManager configureManager(final DestroyableManager manager) {
//         bind(DestroyableManager.class).toInstance(manager);
//         // if logic will not call destroy at least it will be called before jvm shutdown
//         Runtime.getRuntime().addShutdownHook(new Thread(manager));
//         return manager;
//     }
// }


// Path: src/test/java/ru/vyarus/guice/ext/postconstruct/InheritanceTest.java
import com.google.inject.Guice;
import org.junit.Assert;
import org.junit.Test;
import ru.vyarus.guice.ext.ExtAnnotationsModule;
import javax.annotation.PostConstruct;

package ru.vyarus.guice.ext.postconstruct;



/**
 * @author Vyacheslav Rusakov
 * @since 20.12.2014
 */
public class InheritanceTest {

    @Test
    public void testInheritance() throws Exception {
        Bean bean = Guice.createInjector(new ExtAnnotationsModule()).getInstance(Bean.class);