FileDocCategorySizeDatePackage
TestProvidedServiceConfig.javaAPI DocApache Lucene 2.1.03829Wed Feb 14 10:46:02 GMT 2007org.apache.lucene.gdata.server.registry

TestProvidedServiceConfig

public class TestProvidedServiceConfig extends TestCase
Copyright 2004 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Fields Summary
ProvidedServiceConfig
instance
Constructors Summary
Methods Summary
protected voidsetUp()

        instance = new ProvidedServiceConfig();
        instance.setExtensionProfileClass(ExtensionProfile.class);
        instance.setFeedType(Feed.class);
        instance.setEntryType(Entry.class);
    
protected voidtearDown()

        super.tearDown();
        instance.destroy();
    
public voidtestGetExtensionProfile()

        try{
        this.instance.setExtensionProfile(null);
        fail("value must not be null");
        }catch (IllegalArgumentException e) {

        }
        ExtensionProfile profile = this.instance.getExtensionProfile();
        assertNotNull(profile);
        assertSame(profile,this.instance.getExtensionProfile());
        this.instance.visiteInitialize();
        assertSame(profile,this.instance.getExtensionProfile());
        assertNull(new ProvidedServiceConfig().getExtensionProfile());
    
public voidtestSetPoolSize()

        assertEquals(5,instance.getPoolSize());
        instance.destroy();
        instance = new ProvidedServiceConfig();
        instance.setExtensionProfileClass(ExtensionProfile.class);
        instance.setFeedType(Feed.class);
        instance.setEntryType(Entry.class);
        instance.setPoolSize(30);
        instance.visiteInitialize();
        assertEquals(30,instance.getPoolSize());
        instance.destroy();
        instance = new ProvidedServiceConfig();
        instance.setExtensionProfileClass(ExtensionProfile.class);
        instance.setFeedType(Feed.class);
        instance.setEntryType(Entry.class);
        instance.setPoolSize(-5);
        instance.visiteInitialize();
        assertEquals(5,instance.getPoolSize());
    
public voidtestVisiteDestroy()

        ExtensionProfile profile = this.instance.getExtensionProfile();
        assertNotNull(profile);
        assertNotNull(instance.extProfThreadLocal.get());
        instance.visiteDestroy();
        assertNull(instance.extProfThreadLocal.get());
        instance.visiteDestroy();
        assertNull(instance.extProfThreadLocal.get());
    
public voidtestVisiteInitialize()

        instance.visiteInitialize();
        assertNull(instance.extProfThreadLocal.get());
        instance.getExtensionProfile();
        assertNotNull(instance.extProfThreadLocal.get());