/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.forrest.test.core.readers;

import java.net.URI;
import java.net.URISyntaxException;

import org.apache.forrest.core.document.AbstractSourceDocument;
import org.apache.forrest.core.document.DefaultSourceDocument;
import org.apache.forrest.core.locationMap.Location;
import org.apache.forrest.reader.FileReader;

public class HelloReader extends FileReader {

	@Override
	public AbstractSourceDocument read(final Location location) {
		DefaultSourceDocument doc = null;
		final URI psudeoURI = location.getSourceURI();
		final String ssp = psudeoURI.getSchemeSpecificPart();
		URI uri;
		try {
			uri = new URI(ssp);
			location.setSourceURI(uri);
			doc = (DefaultSourceDocument) super.read(location);
			doc.setType("org.apache.forrest.helloWorld");
		} catch (final URISyntaxException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return doc;
	}

}

@@ -842,16 +842,55 @@
 aders;%0A%0A
+import java.net.MalformedURLException;%0A
 import j
@@ -1163,16 +1163,132 @@
 eReader;
+%0Aimport org.apache.forrest.reader.IReader;%0Aimport org.springframework.context.support.AbstractXmlApplicationContext;
 %0A%0Apublic
@@ -1375,16 +1375,55 @@
 nt read(
+AbstractXmlApplicationContext context, 
 final Lo
@@ -1655,16 +1655,91 @@
 I(uri);%0A
+%09%09%09IReader reader;%0A%09%09%09reader = (IReader) context.getBean(uri.getScheme());%0A
 %09%09%09doc =
@@ -1767,19 +1767,20 @@
 nt) 
-sup
+read
 er.read(
 loca
@@ -1775,16 +1775,25 @@
 er.read(
+context, 
 location
@@ -1947,16 +1947,116 @@
 race();%0A
+%09%09%7D catch (MalformedURLException e) %7B%0A%09%09%09// TODO Auto-generated catch block%0A%09%09%09e.printStackTrace();%0A
 %09%09%7D%0A%09%09re

Test new reader chaiing feature