Examples of Localizable


Examples of com.google.i18n.Localizable

      // good
    }
  }

  public void testFromLocalizable() throws Exception {
    Localizable l = new TestLocalizable();

    HtmlClosures.fromLocalizable(l).write(out, createGxpContext(Locale.US, false));
    assertOutputEquals("[toString(en_US)]");

    HtmlClosures.fromLocalizable(l).write(out, createGxpContext(Locale.UK, false));
    assertOutputEquals("[toString(en_GB)]");

    // test proper escaping
    l = new Localizable() {
        public String toString(Locale locale) {
          return "foo < bar > baz & qux \" quux ' quuux";
        }
      };
View Full Code Here

Examples of com.google.i18n.Localizable

      // good
    }
  }

  public void testFromLocalizable() throws Exception {
    Localizable l = new TestLocalizable();

    PlaintextClosures.fromLocalizable(l).write(out, createGxpContext(Locale.US, false));
    assertOutputEquals("[toString(en_US)]");

    PlaintextClosures.fromLocalizable(l).write(out, createGxpContext(Locale.UK, false));
View Full Code Here

Examples of com.sun.xml.rpc.util.localization.Localizable

        // Make sure we're document/literal here.
        if (operation.getStyle() != com.sun.xml.rpc.wsdl.document.soap.SOAPStyle.DOCUMENT || operation.getUse() != com.sun.xml.rpc.wsdl.document.soap.SOAPUse.LITERAL) {
            String style = styleToString(operation.getStyle());
            String use = useToString(operation.getUse());
            Localizable msg = getMessage("stubgenerator.wrongStyleOrUse",
                                         operationName, style, use);
            commentWarning(msg);
            return;
        }

        if (!isValid(operation, usedTypes)) {
            Localizable msg = getMessage("stubgenerator.operationHasInvalidType",
                                         operationName);
            commentWarning(msg);
            return;
        }
View Full Code Here

Examples of org.apache.commons.math.exception.util.Localizable

    /**
     * Tests the printStackTrace() operation.
     */
    public void testPrintStackTrace() {
        Localizable outMsg = new DummyLocalizable("outer message");
        Localizable inMsg = new DummyLocalizable("inner message");
        MathException cause = new MathConfigurationException(inMsg);
        MathException ex = new MathException(cause, outMsg);
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        PrintStream ps = new PrintStream(baos);
        ex.printStackTrace(ps);
View Full Code Here

Examples of org.apache.commons.math.exception.util.Localizable

    /**
     * Test serialization
     */
    public void testSerialization() {
        Localizable outMsg = new DummyLocalizable("outer message");
        Localizable inMsg = new DummyLocalizable("inner message");
        MathException cause = new MathConfigurationException(inMsg);
        MathException ex = new MathException(cause, outMsg);
        MathException image = (MathException) TestUtils.serializeAndRecover(ex);

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        PrintStream ps = new PrintStream(baos);
        ex.printStackTrace(ps);
        String stack = baos.toString();

        ByteArrayOutputStream baos2 = new ByteArrayOutputStream();
        PrintStream ps2 = new PrintStream(baos2);
        image.printStackTrace(ps2);
        String stack2 = baos2.toString();

        // See if JDK supports nested exceptions.  If not, stack trace of
        // inner exception will not be serialized
        boolean jdkSupportsNesting = false;
        try {
            Throwable.class.getDeclaredMethod("getCause", new Class[0]);
            jdkSupportsNesting = true;
        } catch (NoSuchMethodException e) {
            jdkSupportsNesting = false;
        }

        if (jdkSupportsNesting) {
            assertEquals(stack, stack2);
        } else {
            assertTrue(stack2.indexOf(inMsg.getSourceString()) != -1);
            assertTrue(stack2.indexOf("MathConfigurationException") != -1);
        }
    }
View Full Code Here

Examples of org.jvnet.localizer.Localizable

            i = i.getPreviousBuild();
        }
        if (totalCount > 0) {
            int score = (int) ((100.0 * (totalCount - failCount)) / totalCount);

            Localizable description;
            if (failCount == 0) {
                description = Messages._Job_NoRecentBuildFailed();
            } else if (totalCount == failCount) {
                // this should catch the case where totalCount == 1
                // as failCount must be between 0 and totalCount
View Full Code Here

Examples of org.jvnet.localizer.Localizable

    public HealthReport getBuildHealth() {
        final int totalCount = getTotalCount();
        final int failCount = getFailCount();
        int score = (totalCount == 0) ? 100 : (int) (100.0 * (1.0 - ((double)failCount) / totalCount));
        Localizable description, displayName = Messages._AbstractTestResultAction_getDisplayName();
        if (totalCount == 0) {
          description = Messages._AbstractTestResultAction_zeroTestDescription(displayName);
        } else {
          description = Messages._AbstractTestResultAction_TestsDescription(displayName, failCount, totalCount);
        }
View Full Code Here

Examples of org.jvnet.localizer.Localizable

    @Test
    public void verifyNumberOfItems() {
        AnnotationProvider provider = mock(AnnotationProvider.class);
        DryHealthDescriptor healthDescriptor = new DryHealthDescriptor(NullHealthDescriptor.NULL_HEALTH_DESCRIPTOR);

        Localizable description = healthDescriptor.createDescription(provider);
        assertEquals(WRONG_DESCRIPTION, Messages.DRY_ResultAction_HealthReportNoItem(), description.toString());

        when(provider.getNumberOfAnnotations()).thenReturn(1);
        description = healthDescriptor.createDescription(provider);
        assertEquals(WRONG_DESCRIPTION, Messages.DRY_ResultAction_HealthReportSingleItem(), description.toString());

        when(provider.getNumberOfAnnotations()).thenReturn(2);
        description = healthDescriptor.createDescription(provider);
        assertEquals(WRONG_DESCRIPTION, Messages.DRY_ResultAction_HealthReportMultipleItem(2), description.toString());
    }
View Full Code Here

Examples of org.jvnet.localizer.Localizable

    @Test
    public void verifyNumberOfItems() {
        AnnotationProvider provider = mock(AnnotationProvider.class);
        FindBugsHealthDescriptor healthDescriptor = new FindBugsHealthDescriptor(NullHealthDescriptor.NULL_HEALTH_DESCRIPTOR);

        Localizable description = healthDescriptor.createDescription(provider);
        assertEquals(WRONG_DESCRIPTION, Messages.FindBugs_ResultAction_HealthReportNoItem(), description.toString());

        when(provider.getNumberOfAnnotations()).thenReturn(1);
        description = healthDescriptor.createDescription(provider);
        assertEquals(WRONG_DESCRIPTION, Messages.FindBugs_ResultAction_HealthReportSingleItem(), description.toString());

        when(provider.getNumberOfAnnotations()).thenReturn(2);
        description = healthDescriptor.createDescription(provider);
        assertEquals(WRONG_DESCRIPTION, Messages.FindBugs_ResultAction_HealthReportMultipleItem(2), description.toString());
    }
View Full Code Here

Examples of org.jvnet.localizer.Localizable

    /**
     * Diff Visualizers
     *
     */
    public static Localizable _Services_DiffVisualizers() {
        return new Localizable(holder, "Services/DiffVisualizers");
    }
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.