Package java.util

Examples of java.util.Collection.clear()


        try {
            coll = getProxyManager().copyCollection(orig);
        } catch (Exception e) {
            coll = (Collection) _sm.newFieldProxy(vmd.getFieldMetaData().getIndex());
        }
        coll.clear();
        for (Iterator itr = orig.iterator(); itr.hasNext();)
            coll.add(embed(vmd, itr.next()));
        return coll;
    }
View Full Code Here


   */
  protected final void updateModel()
  {
    // prepare model
    Collection model = (Collection)getModelObject();
    model.clear();

    // update model
    Iterator it = getRecorderComponent().getSelectedChoices();

    while (it.hasNext())
View Full Code Here

                    return;

                    // Get the first broker only
                } else {
                    Object firstBroker = mbeans.iterator().next();
                    mbeans.clear();
                    mbeans.add(firstBroker);
                }
            } else {
                // Stop each specified broker
                String brokerName;
View Full Code Here

    // optional operation
    public void testCollectionClear() {
        Collection c = makeCollection();
        boolean cleared = false;
        try {
            c.clear();
            cleared = true;
        } catch(UnsupportedOperationException e) {
            // ignored, must not be supported
        } catch(Throwable t) {
            t.printStackTrace();
View Full Code Here

        if(added) {
            assertTrue("After element is added, Collection.isEmpty() should be false.",!c.isEmpty());
            boolean cleared2 = false;
            try {
                c.clear();
                cleared2 = true;
            } catch(UnsupportedOperationException e) {
                // ignored, must not be supported
            } catch(Throwable t) {
                t.printStackTrace();
View Full Code Here

                                    if ( c != null && !c.isEmpty() )
                                    {
                                        List originalValues = new ArrayList( c );
                                        try
                                        {
                                            c.clear();
                                        }
                                        catch( UnsupportedOperationException e )
                                        {
                                            if ( debugEnabled && logger != null )
                                            {
View Full Code Here

     */
    public void testAddConnection() throws RepositoryException {
        JDBCRepositoryImpl repository = (JDBCRepositoryImpl)
                createTestableRepository();
        Collection connections = repository.connections;
        connections.clear();
        repository.addConnection(repository.openConnection());
        assertEquals("The connections collection should contain 1 connection",
                     1, connections.size());
    }

View Full Code Here

     */
    public void testRemoveConnection() throws RepositoryException {
        JDBCRepositoryImpl repository =
                (JDBCRepositoryImpl) createTestableRepository();
        Collection connections = repository.connections;
        connections.clear();
        RepositoryConnection connection = repository.openConnection();
        connections.add(connection);
        assertEquals("The connections collection should contain 1 connection",
                     1, connections.size());
        repository.removeConnection(connection);
View Full Code Here

    public void testOpenConnectionNoConnections() throws RepositoryException {
        JDBCRepositoryImpl repository =
                (JDBCRepositoryImpl) createTestableRepository();

        Collection connections = repository.connections;
        connections.clear();
        repository.openConnection();
        assertEquals("openConnection() has added to connections",
                     0, connections.size());
    }
View Full Code Here

        JDBCRepositoryImpl repository = (JDBCRepositoryImpl)
                createTestableRepository();

        Collection connections = repository.connections;
        connections.clear();
        JDBCRepositoryConnection connection =
                new JDBCRepositoryConnectionImpl(repository, false, "user",
                                             "password", true);
        connection.getConnection();
        assertEquals("There should be one connection in the connections" +
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.