Package org.apache.tapestry5.jpa

Examples of org.apache.tapestry5.jpa.EntityManagerManager


    @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

        }

        // Let subclasses do more.
        configure(config);

        renderSupport.addInit("autocompleter", new JSONArray(id, menuId, link.toAbsoluteURI(), config));
    }
View Full Code Here

        "class", "t-autocomplete-menu");
        writer.end();

        Link link = resources.createEventLink(EVENT_NAME);

        JSONObject config = new JSONObject();
        config.put("paramName", PARAM_NAME);
        config.put("indicator", loaderId);

        if (resources.isBound("minChars"))
            config.put("minChars", minChars);

        if (resources.isBound("frequency"))
            config.put("frequency", frequency);

        if (resources.isBound("tokens"))
        {
            for (int i = 0; i < tokens.length(); i++)
            {
                config.accumulate("tokens", tokens.substring(i, i + 1));
            }
        }

        // Let subclasses do more.
        configure(config);
View Full Code Here

        map.put("alpha", validator);
        map.put("beta", validator);

        replay();

        FieldValidatorSource source = new FieldValidatorSourceImpl(messagesSource, coercer, null, map, null);

        try
        {
            source.createValidator(field, "foo", null);
            unreachable();
        }
        catch (IllegalArgumentException ex)
        {
            assertEquals(ex.getMessage(), "Unknown validator type 'foo'.  Configured validators are alpha, beta.");
View Full Code Here

        train_getValueType(validator, Object.class);
        validator.validate(field, null, formatter, inputValue);

        replay();

        FieldValidatorSource source = new FieldValidatorSourceImpl(messagesSource, coercer, fs, map, null);

        FieldValidator fieldValidator = source.createValidator(field, "required", null);

        fieldValidator.validate(inputValue);

        verify();
    }
View Full Code Here

        train_getValueType(validator, Object.class);
        validator.validate(field, null, formatter, inputValue);

        replay();

        FieldValidatorSource source = new FieldValidatorSourceImpl(messagesSource, coercer, fs, map, null);

        FieldValidator fieldValidator = source.createValidator(field, "required", null);

        fieldValidator.validate(inputValue);

        verify();
    }
View Full Code Here

        train_getValueType(validator, Object.class);
        validator.validate(field, null, formatter, inputValue);

        replay();

        FieldValidatorSource source = new FieldValidatorSourceImpl(messagesSource, coercer, fs, map, null);

        FieldValidator fieldValidator = source.createValidator(field, "required", null);

        fieldValidator.validate(inputValue);

        verify();
    }
View Full Code Here

        MarkupWriter writer = factory.newPartialMarkupWriter(contentType);

        generateResponseMarkup(writer, matchesHolder.get());

        return new TextStreamResponse(contentType.toString(), writer.toString());
    }
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.