Package org.zanata.webtrans.shared.rpc

Examples of org.zanata.webtrans.shared.rpc.ReplaceText


            return;
        }

        final String searchText = display.getFilterTextBox().getValue();
        boolean caseSensitive = display.getCaseSensitiveChk().getValue();
        ReplaceText action =
                new ReplaceText(transUnits, searchText, replacement,
                        caseSensitive);
        PreviewReplaceText previewAction = new PreviewReplaceText(action);
        dispatcher.execute(previewAction,
                new AsyncCallback<PreviewReplaceTextResult>() {
View Full Code Here


        }

        final String searchText = display.getFilterTextBox().getValue();
        final String replacement = display.getReplacementTextBox().getValue();
        boolean caseSensitive = display.getCaseSensitiveChk().getValue();
        ReplaceText action =
                new ReplaceText(transUnits, searchText, replacement,
                        caseSensitive);
        dispatcher.execute(action, new AsyncCallback<UpdateTransUnitResult>() {

            @Override
            public void onFailure(Throwable e) {
View Full Code Here

    @Test
    public void testExecute() throws Exception {
        TransUnit transUnit =
                TestFixture.makeTransUnit(1, ContentState.NeedReview, "target");
        PreviewReplaceText action =
                new PreviewReplaceText(new ReplaceText(transUnit, "target",
                        "replace", true));

        PreviewReplaceTextResult result = handler.execute(action, null);

        verify(identity).checkLoggedIn();
View Full Code Here

    @Test
    public void canReplaceTextCaseInsensitively() throws ActionException {
        TransUnit transUnit =
                transUnitBuilder.addTargets("abc", "AbC", "ABC").build();
        ReplaceText action =
                new ReplaceText(transUnit, "abc", "123", CASE_INSENSITIVE);

        handler.execute(action, context);

        ArgumentCaptor<UpdateTransUnit> captor =
                ArgumentCaptor.forClass(UpdateTransUnit.class);
View Full Code Here

    @Test
    public void canReplaceTextCaseSensitively() throws ActionException {
        TransUnit transUnit =
                transUnitBuilder.addTargets("abc", "AbC", "ABC").build();
        ReplaceText action =
                new ReplaceText(transUnit, "abc", "123", CASE_SENSITIVE);

        handler.execute(action, context);

        ArgumentCaptor<UpdateTransUnit> captor =
                ArgumentCaptor.forClass(UpdateTransUnit.class);
View Full Code Here

    }

    @Test(expectedExceptions = { ActionException.class })
    public void willThrowExceptionIfSearchTextIsEmpty() throws ActionException {
        TransUnit transUnit = transUnitBuilder.build();
        ReplaceText action =
                new ReplaceText(transUnit, "", "123", CASE_SENSITIVE);
        handler.execute(action, context);
    }
View Full Code Here

    }

    @Test(expectedExceptions = { ActionException.class })
    public void willThrowExceptionIfReplaceTextIsEmpty() throws ActionException {
        TransUnit transUnit = transUnitBuilder.build();
        ReplaceText action =
                new ReplaceText(transUnit, "abc", null, CASE_SENSITIVE);
        handler.execute(action, context);
    }
View Full Code Here

TOP

Related Classes of org.zanata.webtrans.shared.rpc.ReplaceText

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.