Package java.net

Examples of java.net.URL.toExternalForm()


        assertNull(cpi.getBean());
    }

    public void testInvalidBeanDefinitionFile() {
        URL url = ConfigurationProviderImplTest.class.getResource("resources/top-invalid.xml");
        System.setProperty(ConfigurationProviderImpl.CONFIG_FILE_PROPERTY_NAME, url.toExternalForm());
        new TopConfigurationBuilder().build("top");
        assertNull(ConfigurationProviderImpl.getBeanFactories().get(url));
    }

    public void testBeanClassNotFound() {
View Full Code Here


    }

    public void testBeanClassNotFound() {

        URL url = ConfigurationProviderImplTest.class.getResource("resources/top-wrong-class.xml");
        System.setProperty(ConfigurationProviderImpl.CONFIG_FILE_PROPERTY_NAME, url.toExternalForm());

        // The non-existing class is detected when the bean factory is initialised - not
        // later when the bean is created.

        new TopConfigurationBuilder().build("top");
View Full Code Here

    }

    public void testNoSuchBean() {

        URL url = ConfigurationProviderImplTest.class.getResource("resources/top1.xml");
        System.setProperty(ConfigurationProviderImpl.CONFIG_FILE_PROPERTY_NAME, url.toExternalForm());

        Configuration top = new TopConfigurationBuilder().build("top2");

        List<ConfigurationProvider> providers = top.getProviders();
        assertEquals(1, providers.size());
View Full Code Here

    }

    public void testDefaultBeanCreation() throws MalformedURLException {
        URL url = ConfigurationProviderImplTest.class.getResource("resources/top1.xml");
        System.setProperty(ConfigurationProviderImpl.CONFIG_FILE_PROPERTY_NAME, url.toExternalForm());

        Configuration top = new TopConfigurationBuilder().build("top1");
        List<ConfigurationProvider> providers = top.getProviders();
        assertEquals(1, providers.size());
        assertTrue(providers.get(0) instanceof ConfigurationProviderImpl);
View Full Code Here

        assertTrue(providers.get(0) instanceof ConfigurationProviderImpl);
    }

    public void testBeanCreationUsingValueAsText() throws MalformedURLException {
        URL url = ConfigurationProviderImplTest.class.getResource("resources/top2.xml");
        System.setProperty(ConfigurationProviderImpl.CONFIG_FILE_PROPERTY_NAME, url.toExternalForm());
        Configuration top = new TopConfigurationBuilder().build("top2");

        List<ConfigurationProvider> providers = top.getProviders();
        assertEquals(1, providers.size());
        assertTrue(providers.get(0) instanceof ConfigurationProviderImpl);
View Full Code Here

        }
    }

    public void testBeanCreationUsingValueAsElements() throws MalformedURLException {
        URL url = ConfigurationProviderImplTest.class.getResource("resources/top2.xml");
        System.setProperty(ConfigurationProviderImpl.CONFIG_FILE_PROPERTY_NAME, url.toExternalForm());
        Configuration top = new TopConfigurationBuilder().build("top22");

        List<ConfigurationProvider> providers = top.getProviders();
        assertEquals(1, providers.size());
        assertTrue(providers.get(0) instanceof ConfigurationProviderImpl);
View Full Code Here

    }

    public void testBeanCreationSimpleHierarchy() {
        URL url = ConfigurationProviderImplTest.class.getResource("resources/top2.xml");
        System.setProperty(ConfigurationProviderImpl.CONFIG_FILE_PROPERTY_NAME, url.toExternalForm());

        Configuration top = new TopConfigurationBuilder().build("top2");
        Configuration leaf = new LeafConfigurationBuilder().build(top, "leaf");

        List<ConfigurationProvider> providers = leaf.getProviders();
View Full Code Here

    manifestRep.initialize();
    RepositoryConnection con = manifestRep.getConnection();

    URL manifestURL = SeRQLParserTestCase.class.getResource(MANIFEST_FILE);
    RDFFormat format = RDFFormat.forFileName(MANIFEST_FILE, RDFFormat.TURTLE);
    con.add(manifestURL, base(manifestURL.toExternalForm()), format);

    String query = "SELECT testName, query, result " + "FROM {} mf:name {testName}; "
        + "        mf:action {query}; " + "        mf:result {result} " + "USING NAMESPACE "
        + "  mf = <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#>, "
        + "  mfx = <http://www.openrdf.org/test-manifest-extensions#>, "
View Full Code Here

    RepositoryConnection con = manifestRep.getConnection();

    URL manifestURL = SeRQLQueryTestCase.class.getResource(MANIFEST_FILE);
    RDFFormat format = RDFFormat.forFileName(MANIFEST_FILE, RDFFormat.TURTLE);
    con.add(manifestURL, base(manifestURL.toExternalForm()), format);

    String query = "SELECT testName, entailment, input, query, result " + "FROM {} mf:name {testName};"
        + "        mf:result {result}; " + "        tck:entailment {entailment}; "
        + "        mf:action {} qt:query {query}; " + "                     qt:data {input} "
        + "USING NAMESPACE " + "  mf = <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#>, "
View Full Code Here

    URL location = JRLoader.getResource(resource);
    if (location == null)
    {
      throw new JRRuntimeException("Could not find resource " + resource);
    }
    return location.toExternalForm();
  }

  protected void enableSchemaCaching(SAXParser parser)
  {
    String parserType = parser.getClass().getName();
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.