Examples of makeReadOnly()


Examples of org.apache.avalon.framework.context.DefaultContext.makeReadOnly()

        catch (ContextException ce)
        {
            // Supposed to be thrown.
        }
       
        child.makeReadOnly();
       
        try
        {
            child.hide( "test" );
            fail( "hide() did not throw an exception, even though the context is supposed to be read-only." );
View Full Code Here

Examples of org.apache.avalon.framework.context.DefaultContext.makeReadOnly()

               
                threads.register(commands);
               
                setup.put(Queue.ROLE, commands.getCommandSink());
               
                setup.makeReadOnly();
            }
            catch (Exception e)
            {
                getLogger().error("Could not set up the Command Manager", e);
            }
View Full Code Here

Examples of org.apache.avalon.framework.context.DefaultContext.makeReadOnly()

                ContainerUtil.enableLogging(this.commands, getLogger().getChildLogger("thread.manager"));
                this.threads.register(this.commands);
               
                setup.put(Queue.ROLE, this.commands.getCommandSink());
               
                setup.makeReadOnly();
            } catch (Exception e) {
                getLogger().error("Could not set up the Command Manager", e);
            }
           
            this.classpath = (String)context.get(Constants.CONTEXT_CLASSPATH);
View Full Code Here

Examples of org.apache.avalon.framework.context.DefaultContext.makeReadOnly()

        assertTrue( "value1".equals( context.get( "key1" ) ) );
        context.put( "key1", "" );
        assertTrue( "".equals( context.get( "key1" ) ) );

        context.put( "key1", "value1" );
        context.makeReadOnly();

        try
        {
            context.put( "key1", "" );
            throw new AssertionFailedError( "You are not allowed to change a value after it has been made read only" );
View Full Code Here

Examples of org.apache.avalon.framework.context.DefaultContext.makeReadOnly()

        throws ContextException
    {
        final DefaultContext context = new DefaultContext();
        context.put( "key1", new ResolvableString() );
        context.put( "test", "Cool Test" );
        context.makeReadOnly();

        final Context newContext = (Context) context;
        assertTrue( "Cool Test".equals( newContext.get( "test" ) ) );
        assertTrue( ! "This is a ${test}.".equals( newContext.get( "key1" ) ) );
        assertTrue( "This is a Cool Test.".equals( newContext.get( "key1" ) ) );
View Full Code Here

Examples of org.apache.avalon.framework.context.DefaultContext.makeReadOnly()

    public void testCascadingContext()
         throws ContextException
    {
        final DefaultContext parent = new DefaultContext();
        parent.put( "test", "ok test" );
        parent.makeReadOnly();
        final DefaultContext child = new DefaultContext( parent );
        child.put( "check", new ResolvableString("This is an ${test}.") );
        child.makeReadOnly();
        final Context context = (Context) child;
View Full Code Here

Examples of org.apache.avalon.framework.context.DefaultContext.makeReadOnly()

        final DefaultContext parent = new DefaultContext();
        parent.put( "test", "ok test" );
        parent.makeReadOnly();
        final DefaultContext child = new DefaultContext( parent );
        child.put( "check", new ResolvableString("This is an ${test}.") );
        child.makeReadOnly();
        final Context context = (Context) child;

        assertTrue ( "ok test".equals( context.get( "test" ) ) );
        assertTrue ( ! "This is an ${test}.".equals( context.get( "check" ) ) );
        assertTrue ( "This is an ok test.".equals( context.get( "check" ) ) );
View Full Code Here

Examples of org.apache.avalon.framework.context.DefaultContext.makeReadOnly()

    public void testHiddenItems()
        throws ContextException
    {
        final DefaultContext parent = new DefaultContext();
        parent.put( "test", "test" );
        parent.makeReadOnly();
        final DefaultContext child = new DefaultContext( parent );
        child.put( "check", "check" );
        final Context context = (Context) child;
       
        assertTrue ( "check".equals( context.get( "check" ) ) );
View Full Code Here

Examples of org.apache.avalon.framework.context.DefaultContext.makeReadOnly()

        catch (ContextException ce)
        {
            // Supposed to be thrown.
        }
       
        child.makeReadOnly();
       
        try
        {
            child.hide( "test" );
            fail( "hide() did not throw an exception, even though the context is supposed to be read-only." );
View Full Code Here

Examples of org.apache.avalon.framework.context.DefaultContext.makeReadOnly()

        assertTrue( "value1".equals( context.get( "key1" ) ) );
        context.put( "key1", "" );
        assertTrue( "".equals( context.get( "key1" ) ) );

        context.put( "key1", "value1" );
        context.makeReadOnly();

        try
        {
            context.put( "key1", "" );
            throw new AssertionFailedError( "You are not allowed to change a value after it has been made read only" );
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.