Package org.drools.core.io.impl

Examples of org.drools.core.io.impl.UrlResource


        StringReader reader = new StringReader( str );
        ChangeSet changeSet = xmlReader.read( reader );

        assertEquals( 1,
                      changeSet.getResourcesAdded().size() );
        UrlResource resource = ( UrlResource ) ((List)changeSet.getResourcesAdded()).get( 0 );
        assertNull( resource.getConfiguration() );
        assertEquals( "http://localhost:8081/jboss-brms/org.kie.guvnor.Guvnor/package/defaultPackage/LATEST",
                      resource.getURL().toString() );
        assertEquals( "enabled", resource.getBasicAuthentication() );
        assertEquals( "admin", resource.getUsername() );
        assertEquals( "pwd", resource.getPassword() );
        assertEquals( ResourceType.PKG,
                      resource.getResourceType() );
    }
View Full Code Here


        assertNotNull( resourceAdapter );

        Resource resource = resourceAdapter.getDroolsResource();
        assertTrue( resource instanceof UrlResource );

        UrlResource ur = (UrlResource) resource;

        assertEquals( "enabled",
                      ur.getBasicAuthentication() );
        assertEquals( "someUser",
                      ur.getUsername() );
        assertEquals( "somePassword",
                      ur.getPassword() );

        //Insecure Resource
        resourceAdapter = (DroolsResourceAdapter) context.getBean( "insecureResource" );
        assertNotNull( resourceAdapter );

        resource = resourceAdapter.getDroolsResource();
        assertTrue( resource instanceof UrlResource );

        ur = (UrlResource) resource;

        assertEquals( "disabled",
                      ur.getBasicAuthentication() );
        assertEquals( "",
                      ur.getUsername() );
        assertEquals( "",
                      ur.getPassword() );
    }
View Full Code Here

        InternalResource resource = null;
       
        if ( src.trim().startsWith( "classpath:" ) ) {
            resource = new ClassPathResource( src.substring( src.indexOf( ':' ) + 1 ), parser.getClassLoader() );
        } else {
            resource = new UrlResource( src );
            ((UrlResource)resource).setBasicAuthentication(basicAuthentication);
            ((UrlResource)resource).setUsername(username);
            ((UrlResource)resource).setPassword(password);
        }
       
View Full Code Here

TOP

Related Classes of org.drools.core.io.impl.UrlResource

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.