Package org.apache.tapestry5.jpa

Examples of org.apache.tapestry5.jpa.EntityManagerManager


    public void multiple_validators_via_specification() throws Exception
    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator required = mockValidator();
        Validator minLength = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        Messages messages = mockMessages();
        MessageFormatter requiredFormatter = mockMessageFormatter();
        MessageFormatter minLengthFormatter = mockMessageFormatter();
        Object inputValue = "input value";
View Full Code Here


    @Test
    public void validator_with_constraint() throws Exception
    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        Messages messages = mockMessages();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
View Full Code Here

            proxy = classFactory.createProxy(EntityManager.class, new ObjectCreator()
            {
                public Object createObject()
                {
                    final EntityManagerManager entityManagerManager = objectLocator
                            .getService(EntityManagerManager.class);

                    return JpaInternalUtils.getEntityManager(entityManagerManager, annotation);
                }
            }, "<EntityManagerProxy>");
View Full Code Here

    @Test
    public void undecorated()
    {
        final VoidService delegate = newMock(VoidService.class);
        final EntityManagerManager manager = newMock(EntityManagerManager.class);
        final JpaTransactionAdvisor advisor = newJpaTransactionAdvisor(manager);

        final AspectInterceptorBuilder<VoidService> builder = aspectDecorator.createBuilder(
                VoidService.class, delegate, "foo.Bar");
View Full Code Here

    @Test
    public void persistence_unit_name_missing()
    {
        final VoidService delegate = newMock(VoidService.class);
        final EntityManagerManager manager = newMock(EntityManagerManager.class);
        final JpaTransactionAdvisor advisor = newJpaTransactionAdvisor(manager);
        Map<String, EntityManager> managers = CollectionFactory.newMap();
        managers.put("A", newMock(EntityManager.class));
        managers.put("B", newMock(EntityManager.class));

        final AspectInterceptorBuilder<VoidService> builder = aspectDecorator.createBuilder(
                VoidService.class, delegate, "foo.Bar");

        advisor.addTransactionCommitAdvice(builder);

        final VoidService interceptor = builder.build();

        expect(manager.getEntityManagers()).andReturn(managers);

        replay();

        try
        {
View Full Code Here

    @Test
    public void persistence_unit_name_missing_single_unit_configured()
    {
        final VoidService delegate = newMock(VoidService.class);
        final EntityManagerManager manager = newMock(EntityManagerManager.class);
        final JpaTransactionAdvisor advisor = newJpaTransactionAdvisor(manager);
        final EntityTransaction transaction = newMock(EntityTransaction.class);
        EntityManager em = newMock(EntityManager.class);
        Map<String, EntityManager> managers = CollectionFactory.newMap();
        managers.put("A", em);

        final AspectInterceptorBuilder<VoidService> builder = aspectDecorator.createBuilder(
                VoidService.class, delegate, "foo.Bar");

        advisor.addTransactionCommitAdvice(builder);

        final VoidService interceptor = builder.build();

        expect(manager.getEntityManagers()).andReturn(managers);
        train_getTransaction(em, transaction, true);
        delegate.persistenceUnitNameMissing();
        train_commitActiveTransaction(transaction);

        replay();
View Full Code Here

    @Test
    public void persistence_unit_missing()
    {
        final VoidService delegate = newMock(VoidService.class);
        final EntityManagerManager manager = newMock(EntityManagerManager.class);
        final JpaTransactionAdvisor advisor = newJpaTransactionAdvisor(manager);
        Map<String, EntityManager> managers = CollectionFactory.newMap();
        managers.put("A", newMock(EntityManager.class));
        managers.put("B", newMock(EntityManager.class));

        final AspectInterceptorBuilder<VoidService> builder = aspectDecorator.createBuilder(
                VoidService.class, delegate, "foo.Bar");

        advisor.addTransactionCommitAdvice(builder);

        final VoidService interceptor = builder.build();

        expect(manager.getEntityManagers()).andReturn(managers);

        replay();

        try
        {
View Full Code Here

    @Test
    public void persistence_unit_missing_single_unit_configured()
    {
        final VoidService delegate = newMock(VoidService.class);
        final EntityManagerManager manager = newMock(EntityManagerManager.class);
        final JpaTransactionAdvisor advisor = newJpaTransactionAdvisor(manager);
        final EntityTransaction transaction = newMock(EntityTransaction.class);
        EntityManager em = newMock(EntityManager.class);
        Map<String, EntityManager> managers = CollectionFactory.newMap();
        managers.put("A", em);

        final AspectInterceptorBuilder<VoidService> builder = aspectDecorator.createBuilder(
                VoidService.class, delegate, "foo.Bar");

        advisor.addTransactionCommitAdvice(builder);

        final VoidService interceptor = builder.build();

        expect(manager.getEntityManagers()).andReturn(managers);
        train_getTransaction(em, transaction, true);
        delegate.persistenceUnitMissing();
        train_commitActiveTransaction(transaction);

        replay();
View Full Code Here

    @Test
    public void transaction_inactive()
    {
        final VoidService delegate = newMock(VoidService.class);
        final EntityManagerManager manager = newMock(EntityManagerManager.class);
        final JpaTransactionAdvisor advisor = newJpaTransactionAdvisor(manager);
        final EntityManager entityManager = newMock(EntityManager.class);
        final EntityTransaction transaction = newMock(EntityTransaction.class);

        final AspectInterceptorBuilder<VoidService> builder = aspectDecorator.createBuilder(
View Full Code Here

    @Test
    public void void_method()
    {
        final VoidService delegate = newMock(VoidService.class);
        final EntityManagerManager manager = newMock(EntityManagerManager.class);
        final JpaTransactionAdvisor advisor = newJpaTransactionAdvisor(manager);
        final EntityManager entityManager = newMock(EntityManager.class);
        final EntityTransaction transaction = newMock(EntityTransaction.class);

        final AspectInterceptorBuilder<VoidService> builder = aspectDecorator.createBuilder(
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.jpa.EntityManagerManager

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.