Examples of ListResourceBundle


Examples of java.util.ListResourceBundle

        mockConfig.stubs().method("getPortletContext").will(returnValue(mockCtx.proxy()));
        mockCtx.stubs().method("getInitParameterNames").will(returnValue(Collections.enumeration(initParams.keySet())));
        setupStub(initParams, mockCtx, "getInitParameter");
        mockConfig.stubs().method("getInitParameterNames").will(returnValue(Collections.enumeration(initParams.keySet())));
        setupStub(initParams, mockConfig, "getInitParameter");
        mockConfig.stubs().method("getResourceBundle").will(returnValue(new ListResourceBundle() {
            protected Object[][] getContents() {
                return new String[][]{{"javax.portlet.title", "MyTitle"}};
            }
        }));
    }
View Full Code Here

Examples of java.util.ListResourceBundle

        throws MissingResourceException
    {
        m_resourceBundleName = resourceBundle;
        Locale locale = getLocale();

        ListResourceBundle lrb;

        try
        {

            ResourceBundle rb =
View Full Code Here

Examples of java.util.ListResourceBundle

        in.put("2", "B");
        in.put("3", "C");
        in.put("4", "D");
        in.put("5", "E");

        final ResourceBundle b = new ListResourceBundle() {
            @Override
            public Object[][] getContents() {
                final Object[][] contents = new Object[ in.size() ][2];
                final Iterator<String> i = in.keySet().iterator();
                int n = 0;
View Full Code Here

Examples of java.util.ListResourceBundle

        mockCtx.stubs().method("getInitParameterNames").will(returnValue(Collections.enumeration(initParams.keySet())));
        setupStub(initParams, mockCtx, "getInitParameter");
        mockConfig.stubs().method("getInitParameterNames").will(returnValue(Collections.enumeration(initParams.keySet())));
        setupStub(initParams, mockConfig, "getInitParameter");

        mockConfig.stubs().method("getResourceBundle").will(returnValue(new ListResourceBundle() {
            protected Object[][] getContents() {
                return new String[][]{{"javax.portlet.title", "MyTitle"}};
            }
        }));
    }
View Full Code Here

Examples of java.util.ListResourceBundle

        }
       
        portletContext = new MockPortletContext(new DefaultResourceLoader());
        portletConfig = new MockPortletConfig(portletContext);
        ((MockPortletConfig) portletConfig).addInitParameter("stylesheet", "/test-rss.xsl");
        ResourceBundle bundle = new ListResourceBundle()
        {
            protected Object[][] getContents()
            {
                return new Object[][] {
                    {"javax.portlet.title", "RSS Portlet"},
View Full Code Here

Examples of java.util.ListResourceBundle

    mockCtx.stubs().method("getInitParameterNames").will(returnValue(Collections.enumeration(initParams.keySet())));
    setupStub(initParams, mockCtx, "getInitParameter");
    mockConfig.stubs().method("getInitParameterNames").will(
        returnValue(Collections.enumeration(initParams.keySet())));
    setupStub(initParams, mockConfig, "getInitParameter");
    mockConfig.stubs().method("getResourceBundle").will(returnValue(new ListResourceBundle() {
      protected Object[][] getContents() {
        return new String[][] { { "javax.portlet.title", "MyTitle" } };
      }
    }));
  }
View Full Code Here

Examples of java.util.ListResourceBundle

    mockCtx.stubs().method("getInitParameterNames").will(returnValue(Collections.enumeration(initParams.keySet())));
    setupStub(initParams, mockCtx, "getInitParameter");
    mockConfig.stubs().method("getInitParameterNames").will(
        returnValue(Collections.enumeration(initParams.keySet())));
    setupStub(initParams, mockConfig, "getInitParameter");
    mockConfig.stubs().method("getResourceBundle").will(returnValue(new ListResourceBundle() {
      protected Object[][] getContents() {
        return new String[][] { { "javax.portlet.title", "MyTitle" } };
      }
    }));
  }
View Full Code Here

Examples of java.util.ListResourceBundle

        in.put("2", "B");
        in.put("3", "C");
        in.put("4", "D");
        in.put("5", "E");

        final ResourceBundle b = new ListResourceBundle() {
            @Override
            public Object[][] getContents() {
                final Object[][] contents = new Object[ in.size() ][2];
                final Iterator<String> i = in.keySet().iterator();
                int n = 0;
View Full Code Here

Examples of java.util.ListResourceBundle

     * @return A <code>ResourceBundle</code> containing mandatory and
     *         optional resource information.
     */
    public ResourceBundle getResourceBundle(Locale locale) {
  final Locale l = locale;
        return new ListResourceBundle() {
            public Object[][] getContents() {
                return getResources(l);
            }
        }; // from return statement
    }
View Full Code Here

Examples of java.util.ListResourceBundle

    private BreakIterator createTestIterator(int kind) {
        final String bname = "com.ibm.icu.dev.test.rbbi.BreakIteratorRules_en_US_TEST";

        BreakIterator iter = null;

        ListResourceBundle bundle = null;
        try {
            Class cls = Class.forName(bname);
            bundle = (ListResourceBundle)cls.newInstance();
        }
        catch (Exception e) {
            errln("could not create bundle: " + bname + "exception: " + e.getMessage());
            return null;
        }
       
        final String[] kindNames = {
            "Character", "Word", "Line", "Sentence"
        };
        String rulesName = kindNames[kind] + "BreakRules";
        String dictionaryName = kindNames[kind] + "BreakDictionary";
       
        String[] classNames = bundle.getStringArray("BreakIteratorClasses");
        String rules = bundle.getString(rulesName);
        if (classNames[kind].equals("RuleBasedBreakIterator")) {
            iter = new RuleBasedBreakIterator(rules);
        }
        else if (classNames[kind].equals("DictionaryBasedBreakIterator")) {
            try {
                String dictionaryPath = bundle.getString(dictionaryName);
                InputStream dictionary = bundle.getClass().getResourceAsStream(dictionaryPath);
                System.out.println("looking for " + dictionaryPath + " from " + bundle.getClass() + " returned " + dictionary);
                iter = new DictionaryBasedBreakIterator(rules, dictionary);
            }
            catch(IOException e) {
                e.printStackTrace();
                errln(e.getMessage());
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.