Package org.zanata.seam

Examples of org.zanata.seam.SeamAutowire.use()


    @Override
    protected void prepareResources() {
        MockitoAnnotations.initMocks(this);
        SeamAutowire seamAutowire = getSeamAutowire();
        seamAutowire.use("entityManager", getEm()).use("session", getSession())
                .use("identity", Mockito.mock(ZanataIdentity.class))
                .useImpl(LocaleServiceImpl.class)
                .useImpl(CopyTransServiceImpl.class)
                .useImpl(DocumentServiceImpl.class)
                .useImpl(TranslationServiceImpl.class)
View Full Code Here


        ZanataCredentials credentials = new ZanataCredentials();
        credentials.setUsername("testuser");
        when(mockIdentity.getCredentials()).thenReturn(credentials);

        SeamAutowire seamAutowire = getSeamAutowire();
        seamAutowire.use("session", getSession()).use("identity", mockIdentity)
                .useImpl(CopyTransServiceImpl.class)
                .useImpl(LocaleServiceImpl.class)
                .simulateSessionContext(true);

        CopyTransResource copyTransResource =
View Full Code Here

    }

    @Override
    protected void prepareResources() {
        SeamAutowire seamAutowire = getSeamAutowire();
        seamAutowire.use("session", getSession()).use("identity", mockIdentity);

        ProjectService projectService =
                seamAutowire.autowire(ProjectService.class);

        resources.add(projectService);
View Full Code Here

    }

    @Override
    protected void prepareResources() {
        SeamAutowire seamAutowire = getSeamAutowire();
        seamAutowire.use("session", getSession());

        ProjectIterationService projectIterationService =
                seamAutowire.autowire(ProjectIterationService.class);

        resources.add(projectIterationService);
View Full Code Here

    IProjectsResource projectService;

    @Override
    protected void prepareResources() {
        SeamAutowire seamAutowire = getSeamAutowire();
        seamAutowire.use("session", getSession());

        ProjectsService projectsService =
                seamAutowire.autowire(ProjectsService.class);

        resources.add(projectsService);
View Full Code Here

    @Override
    protected void prepareResources() {
        MockitoAnnotations.initMocks(this);

        SeamAutowire seamAutowire = getSeamAutowire();
        seamAutowire.use("session", getSession()).use("entityManager", getEm())
                .use("identity", mockIdentity).useImpl(LocaleServiceImpl.class)
                .useImpl(CopyTransServiceImpl.class)
                .useImpl(DocumentServiceImpl.class)
                .useImpl(VersionStateCacheImpl.class)
                .useImpl(TranslationStateCacheImpl.class);
View Full Code Here

    @SuppressWarnings("serial")
    @Override
    protected void prepareResources() {
        SeamAutowire seamAutowire = getSeamAutowire();
        seamAutowire.use("session", getSession()).use("identity", mockIdentity)
                .use("translationWorkspaceManager", transWorspaceManager)
                .use("entityManager", super.getEm())
                .useImpl(CopyTransServiceImpl.class)
                .useImpl(TranslationServiceImpl.class)
                .useImpl(LocaleServiceImpl.class)
View Full Code Here

        when(
                transWorspaceManager
                        .getOrRegisterWorkspace(any(WorkspaceId.class)))
                .thenReturn(transWorkspace);

        seamAutowire.use(JpaIdentityStore.AUTHENTICATED_USER, translator); // use
                                                                           // a
                                                                           // given
                                                                           // authenticated
                                                                           // account
        seamAutowire.use("translationServiceImpl",
View Full Code Here

        seamAutowire.use(JpaIdentityStore.AUTHENTICATED_USER, translator); // use
                                                                           // a
                                                                           // given
                                                                           // authenticated
                                                                           // account
        seamAutowire.use("translationServiceImpl",
                seamAutowire.autowire(TranslationServiceImpl.class));// TODO
                                                                     // because
                                                                     // translationService
                                                                     // component
                                                                     // has
View Full Code Here

public class StatisticsResourceRestTest extends ZanataRestTest {

    @Override
    protected void prepareResources() {
        SeamAutowire seamAutowire = getSeamAutowire();
        seamAutowire.use("session", getSession())
                .use("entityManager", super.getEm())
                .useImpl(StatisticsServiceImpl.class);

        StatisticsResource statisticsResource =
                seamAutowire.autowire(StatisticsResource.class);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.