Examples of ResourceService


Examples of ariba.util.core.ResourceService

     *
     * @return a newly constructed localized String
     */
    public static String makeParseExceptionMessage (String errorKey)
    {
        ResourceService rs = ResourceService.getService();
        return rs.getLocalizedString(UtilStringTable, errorKey);
    }
View Full Code Here

Examples of ariba.util.core.ResourceService

     *
     * @return a newly constructed localized String
     */
    public static String makeParseExceptionMessage (String errorKey, String argument)
    {
        ResourceService rs = ResourceService.getService();
        return Fmt.Sil(rs.getLocale(), UtilStringTable, errorKey, argument);
    }
View Full Code Here

Examples of ariba.util.core.ResourceService

     */
    public static ParseException makeParseException (String errorKey,
                                                     String argument,
                                                     int offset)
    {
        ResourceService rs = ResourceService.getService();
        return makeParseException(errorKey, argument, offset, rs.getLocale());
    }
View Full Code Here

Examples of ariba.util.core.ResourceService

    protected Map getLocalizedString (String stringTableName,
                                    String componentName,
                                    Locale locale)
    {
        ResourceService resourceService = ResourceService.getService();
        // restrict the locale to what we can use
        locale = resourceService.getRestrictedLocale(locale);

        Map componentTable = null;
        Map stringTable = resourceService.stringTable(stringTableName, locale, this);
        if (stringTable == null) {
                // "Null string table returned in Resource Service"
            Log.util.error(2962, stringTable);
                // prevent the same error from happening
            resourceService.cacheStringTable(stringTableName,
                                             locale,
                                             MapUtil.map(),
                                             this);
        }
        else {
View Full Code Here

Examples of ariba.util.core.ResourceService

        // Note: must init *after* line above, because super will call our resourceUrl()
        super.init();

        // Todo!  Why were we calling "couldBeNull" -- we'll blow up downstream it this isn't initialized...
        ResourceService resourceService = ResourceService.getService(); // ResourceService.serviceCouldBeNull();
        if (resourceService != null) {
            resourceService.registerStringProcessor(_localizer);
        }
        LocalizedJavaString.registerLocalizer(_localizer);
    }
View Full Code Here

Examples of com.cloud.resource.ResourceService

    }

    @Test
    public void testExecuteForNullResult() {

        ResourceService resourceService = Mockito.mock(ResourceService.class);
        addHostCmd._resourceService = resourceService;

        try {
            Mockito.when(resourceService.discoverHosts(addHostCmd)).thenReturn(
                    null);
        } catch (InvalidParameterValueException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IllegalArgumentException e) {
View Full Code Here

Examples of com.cloud.resource.ResourceService

    }

    @Test
    public void testExecuteForNullResult() {

        ResourceService resourceService = Mockito.mock(ResourceService.class);

        try {
            Mockito.when(resourceService.discoverCluster(addClusterCmd))
                    .thenReturn(null);
        } catch (ResourceInUseException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IllegalArgumentException e) {
View Full Code Here

Examples of com.cloud.resource.ResourceService

    }

    @Test
    public void testExecuteForEmptyResult() {

        ResourceService resourceService = Mockito.mock(ResourceService.class);
        addClusterCmd._resourceService = resourceService;

        try {
            addClusterCmd.execute();
        } catch (ServerApiException exception) {
View Full Code Here

Examples of de.iritgo.aktario.core.resource.ResourceService

  @Override
  public void initGUI()
  {
    try
    {
      final ResourceService resources = Engine.instance().getResourceService();
      SwingEngine swingEngine = new SwingEngine(this);

      AddressClientManager acm = (AddressClientManager) Engine.instance().getManager(AddressClientManager.ID);

      columns = acm.getAddressTableColumns();

      JPanel panel = (JPanel) swingEngine.render(getClass().getResource("/swixml/AddressQueryPane.xml"));

      content.add(panel, createConstraints(0, 0, 1, 1, GridBagConstraints.BOTH, 100, 100, null));

      search.idle();

      AddressTableCellRenderer renderer = new AddressTableCellRenderer();
      AddressTableModel model = new AddressTableModel();

      addressTable.setModel(model);
      addressTable.getColumnModel().getColumn(0).setMinWidth(0);
      addressTable.getColumnModel().getColumn(0).setMaxWidth(0);

      for (int i = 1; i < model.getColumnCount(); ++i)
      {
        addressTable.getColumnModel().getColumn(i).setCellRenderer(renderer);
      }

      addressTable.addMouseListener(new AddressTableMouseListener());

      for (int i : new IntRange(0, columns.size() - 1))
      {
        ITableColumn c = columns.get(i);

        if (StringTools.isTrimEmpty(c.getTitle().get()))
        {
          if (c.getCellIcon() != null)
          {
            addressTable.getColumnModel().getColumn(i).setMinWidth(c.getCellIcon().getIconWidth() + 4);
            addressTable.getColumnModel().getColumn(i).setMaxWidth(c.getCellIcon().getIconWidth() + 4);
          }
          else
          {
            addressTable.getColumnModel().getColumn(i).setMinWidth(4);
            addressTable.getColumnModel().getColumn(i).setMaxWidth(4);
          }
        }
      }

      TableRowSorter<TableModel> sorter = new TableRowSorter<TableModel>();

      addressTable.setRowSorter(sorter);
      sorter.setModel(model);

      addressStore.addActionListener(new ActionListener()
      {
        public void actionPerformed(ActionEvent e)
        {
          search(IComboBoxIdItem.getSelectedId(addressStore).toString(), searchText.getText());
        }
      });

      searchText.grabFocus();

      new Thread()
      {
        @Override
        public void run()
        {
          search.busy();

          AddressClientService acs = (AddressClientService) Engine.instance().getManager(
                  AddressClientService.ID);

          for (final AddressStore ads : acs.listAddressStores())
          {
            SwingUtilities.invokeLater(new Runnable()
            {
              public void run()
              {
                addressStore.addItem(new IComboBoxIdItem(ads.getName(), resources
                        .getStringWithoutException(ads.getTitle())));
              }
            });
          }
View Full Code Here

Examples of org.apache.syncope.common.services.ResourceService

        }
    }

    @Test
    public void anonymous() {
        ResourceService unauthenticated = clientFactory.createAnonymous().getService(ResourceService.class);
        try {
            unauthenticated.list();
            fail();
        } catch (AccessControlException e) {
            assertNotNull(e);
        }

        ResourceService anonymous = clientFactory.create(ANONYMOUS_UNAME, ANONYMOUS_KEY).
                getService(ResourceService.class);
        assertFalse(anonymous.list().isEmpty());
    }
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.