Package org.nanocontainer.reflection

Examples of org.nanocontainer.reflection.DefaultNanoPicoContainer


        PicoContainer pico = buildContainer(new StringReader(script), parent,  new SomeAssemblyScope());
        assertNotNull(pico.getComponentInstanceOfType(B.class));
    }

    public void testBuildContainerWhenExpectedParentDependencyIsNotFound() {
        DefaultNanoPicoContainer parent = new DefaultNanoPicoContainer();

        Reader script = new StringReader("" +
                "package org.nanocontainer.script.groovy\n" +
                "nano = builder.container(parent:parent, scope:assemblyScope) {\n" +
                "  if ( assemblyScope instanceof SomeAssemblyScope ){\n "+
View Full Code Here


            // expected
        }
    }

    public void testBuildContainerWithParentAttributesPropagatesComponentAdapterFactory() {
        DefaultNanoPicoContainer parent = new DefaultNanoPicoContainer(new SetterInjectionComponentAdapterFactory() );
        Reader script = new StringReader("" +
                "package org.nanocontainer.script.groovy\n" +
                "nano = builder.container(parent:parent) {\n" +
                "}\n");
View Full Code Here

    }



    public void testExceptionThrownWhenParentAttributeDefinedWithinChild() {
        DefaultNanoPicoContainer parent = new DefaultNanoPicoContainer(new SetterInjectionComponentAdapterFactory() );
        Reader script = new StringReader("" +
                "package org.nanocontainer.script.groovy\n" +
                "nano = new GroovyNodeBuilder().container() {\n" +
                "    component(A)\n" +
                "    container(parent:parent) {\n" +
View Full Code Here

            // ignore
        }
    }

    public void testWithDynamicClassPathThatDoesNotExist() {
        DefaultNanoPicoContainer parent = new DefaultNanoPicoContainer();
        try {
            Reader script = new StringReader("" +
                    "        child = null\n" +
                    "        pico = builder.container {\n" +
                    "            classPathElement(path:'this/path/does/not/exist.jar')\n" +
View Full Code Here

    }


    public void testWithDynamicClassPath() {
        DefaultNanoPicoContainer parent = new DefaultNanoPicoContainer();
        Reader script = new StringReader(
                ""
                        + "        File testCompJar = new File(System.getProperty(\"testcomp.jar\"))\n"
                        + "        compJarPath = testCompJar.getCanonicalPath()\n"
                        + "        child = null\n"
View Full Code Here

        assertEquals("TestComp", pico.getComponentInstances().get(0).getClass()
                .getName());
    }

    public void testWithDynamicClassPathWithPermissions() {
        DefaultNanoPicoContainer parent = new DefaultNanoPicoContainer();
        Reader script = new StringReader(
                ""
                        + "        File testCompJar = new File(System.getProperty(\"testcomp.jar\"))\n"
                        + "        compJarPath = testCompJar.getCanonicalPath()\n"
                        + "        child = null\n"
View Full Code Here

        // can't actually test the permission under JUNIT control. We're just
        // testing the syntax here.
    }

    public void testGrantPermissionInWrongPlace() {
        DefaultNanoPicoContainer parent = new DefaultNanoPicoContainer();
        try {
            Reader script = new StringReader("" +
                    "        File testCompJar = new File(System.getProperty(\"testcomp.jar\"))\n" +
                    "        compJarPath = testCompJar.getCanonicalPath()\n" +
                    "        child = null\n" +
View Full Code Here

TOP

Related Classes of org.nanocontainer.reflection.DefaultNanoPicoContainer

Copyright © 2018 www.massapicom. 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.