Package com.netflix.governator.guice.mocks

Examples of com.netflix.governator.guice.mocks.AnnotatedFineGrainedLazySingletonObject


        Injector    injector = lifecycleInjectorBuilder.createInjector();

        Assert.assertEquals(AnnotatedFineGrainedLazySingletonObject.constructorCount.get(), 0);
        Assert.assertEquals(AnnotatedFineGrainedLazySingletonObject.postConstructCount.get(), 0);

        AnnotatedFineGrainedLazySingletonObject instance = injector.getInstance(AnnotatedFineGrainedLazySingletonObject.class);
        Assert.assertEquals(AnnotatedFineGrainedLazySingletonObject.constructorCount.get(), 1);
        Assert.assertEquals(AnnotatedFineGrainedLazySingletonObject.postConstructCount.get(), 1);

        AnnotatedFineGrainedLazySingletonObject instance2 = injector.getInstance(AnnotatedFineGrainedLazySingletonObject.class);
        Assert.assertEquals(AnnotatedFineGrainedLazySingletonObject.constructorCount.get(), 1);
        Assert.assertEquals(AnnotatedFineGrainedLazySingletonObject.postConstructCount.get(), 1);

        Assert.assertSame(instance, instance2);
    }
View Full Code Here


        InjectedAnnotatedProvider injectedProvider = injector.getInstance(InjectedAnnotatedProvider.class);
        Assert.assertEquals(AnnotatedFineGrainedLazySingletonObject.constructorCount.get(), 0);
        Assert.assertEquals(AnnotatedFineGrainedLazySingletonObject.postConstructCount.get(), 0);

        AnnotatedFineGrainedLazySingletonObject instance = injectedProvider.provider.get();
        Assert.assertEquals(AnnotatedFineGrainedLazySingletonObject.constructorCount.get(), 1);
        Assert.assertEquals(AnnotatedFineGrainedLazySingletonObject.postConstructCount.get(), 1);

        AnnotatedFineGrainedLazySingletonObject instance2 = injectedProvider.provider.get();
        Assert.assertEquals(AnnotatedFineGrainedLazySingletonObject.constructorCount.get(), 1);
        Assert.assertEquals(AnnotatedFineGrainedLazySingletonObject.postConstructCount.get(), 1);

        Assert.assertSame(instance, instance2);
    }
View Full Code Here

TOP

Related Classes of com.netflix.governator.guice.mocks.AnnotatedFineGrainedLazySingletonObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.