Examples of URLReference


Examples of org.apache.openejb.core.ivm.naming.URLReference

                final Class<?> type = getType(referenceInfo.referenceType, referenceInfo);

                final Object reference;
                if (URL.class.equals(type)) {
                    reference = new URLReference(referenceInfo.resourceID);
                } else if (type.isAnnotationPresent(ManagedBean.class)) {
                    final ManagedBean managed = type.getAnnotation(ManagedBean.class);
                    final String name = managed.value().length() == 0 ? type.getSimpleName() : managed.value();
                    reference = new LinkRef("module/" + name);
                } else if (referenceInfo.resourceID != null) {
View Full Code Here

Examples of org.apache.openejb.core.ivm.naming.URLReference

                Class<?> type = getType(referenceInfo.referenceType, referenceInfo);

                Object reference;
                if (URL.class.equals(type)) {
                    reference = new URLReference(referenceInfo.resourceID);
                } else if (type.isAnnotationPresent(ManagedBean.class)) {
                    ManagedBean managed = type.getAnnotation(ManagedBean.class);
                    String name = managed.value().length() == 0 ? type.getSimpleName() : managed.value();
                    reference = new LinkRef("module/" + name);
                } else if (referenceInfo.resourceID != null) {
View Full Code Here

Examples of org.apache.stanbol.enhancer.servicesapi.impl.UrlReference

            +TEST_RESOURCE_NAME+" via Classpath!",testURL);
    }
   
    @Test(expected=IllegalArgumentException.class)
    public void missingReferenceString(){
        new UrlReference((String)null);
    }
View Full Code Here

Examples of org.apache.stanbol.enhancer.servicesapi.impl.UrlReference

    public void missingReferenceString(){
        new UrlReference((String)null);
    }
    @Test(expected=IllegalArgumentException.class)
    public void missingReferenceURL(){
        new UrlReference((URL)null);
    }
View Full Code Here

Examples of org.apache.stanbol.enhancer.servicesapi.impl.UrlReference

    public void missingReferenceURL(){
        new UrlReference((URL)null);
    }
    @Test(expected=IllegalArgumentException.class)
    public void emptyReferenceString(){
        new UrlReference("");
    }
View Full Code Here

Examples of org.apache.stanbol.enhancer.servicesapi.impl.UrlReference

    public void emptyReferenceString(){
        new UrlReference("");
    }
    @Test(expected=IllegalArgumentException.class)
    public void relativeReferenceString(){
        new UrlReference("relative/path/to/some.resource");
    }
View Full Code Here

Examples of org.apache.stanbol.enhancer.servicesapi.impl.UrlReference

    public void relativeReferenceString(){
        new UrlReference("relative/path/to/some.resource");
    }
    @Test(expected=IllegalArgumentException.class)
    public void unknownProtocolReferenceString(){
        new UrlReference("unknownProt://test.example.org/some.resource");
    }
View Full Code Here

Examples of org.apache.stanbol.enhancer.servicesapi.impl.UrlReference

        new UrlReference("unknownProt://test.example.org/some.resource");
    }

    @Test
    public void testUrlReference() throws IOException{
        ContentReference ref = new UrlReference(testURL);
        assertNotNull(ref);
        assertEquals(ref.getReference(), testURL.toString());
        ContentSource source = ref.dereference();
        assertNotNull(source);
        String content = IOUtils.toString(source.getStream(), "UTF-8");
        assertNotNull(content);
        assertEquals(TEST_RESOURCE_CONTENT, content);

        //same as above, but by using ContentSource.getData() instead of
        //ContentSource.getStream()
        ref = new UrlReference(testURL);
        assertNotNull(ref);
        assertEquals(ref.getReference(), testURL.toString());
        source = ref.dereference();
        assertNotNull(source);
        content = new String(source.getData(),"UTF-8");
        assertNotNull(content);
        assertEquals(TEST_RESOURCE_CONTENT, content);

        //test the constructor that takes a String
        ref = new UrlReference(testURL.toString());
        assertNotNull(ref);
        assertEquals(ref.getReference(), testURL.toString());
        source = ref.dereference();
        assertNotNull(source);
        content = IOUtils.toString(source.getStream(), "UTF-8");
        assertNotNull(content);
        assertEquals(TEST_RESOURCE_CONTENT, content);
    }
View Full Code Here

Examples of org.ops4j.pax.exam.options.UrlReference

    private void copyBootClasspathLibraries(File karafHome, ExamSystem subsystem) throws MalformedURLException,
        IOException {
        BootClasspathLibraryOption[] bootClasspathLibraryOptions =
            subsystem.getOptions(BootClasspathLibraryOption.class);
        for (BootClasspathLibraryOption bootClasspathLibraryOption : bootClasspathLibraryOptions) {
            UrlReference libraryUrl = bootClasspathLibraryOption.getLibraryUrl();
            FileUtils.copyURLToFile(
                new URL(libraryUrl.getURL()),
                createFileNameWithRandomPrefixFromUrlAtTarget(libraryUrl.getURL(), new File(karafHome + "/lib"),
                    new String[]{ "jar" }));
        }
    }
View Full Code Here

Examples of org.ops4j.pax.exam.options.UrlReference

    private void copyBootClasspathLibraries(File karafHome, ExamSystem subsystem) throws MalformedURLException,
            IOException {
        BootClasspathLibraryOption[] bootClasspathLibraryOptions =
                subsystem.getOptions(BootClasspathLibraryOption.class);
        for (BootClasspathLibraryOption bootClasspathLibraryOption : bootClasspathLibraryOptions) {
            UrlReference libraryUrl = bootClasspathLibraryOption.getLibraryUrl();
            FileUtils.copyURLToFile(
                    new URL(libraryUrl.getURL()),
                    createFileNameWithRandomPrefixFromUrlAtTarget(libraryUrl.getURL(), new File(karafHome + "/lib"),
                            new String[]{"jar"}));
        }
    }
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.