public RequestParser()

in src/main/java/org/apache/sling/junit/RequestParser.java [40:76]


    public RequestParser(String subpath) {
        
        if (subpath == null) {
            testNameSelector = EMPTY_STRING;
            selectedMethodName = EMPTY_STRING;
            extension = EMPTY_STRING;
        } else {
            if (subpath.startsWith("/")) {
                subpath = subpath.substring(1);
            }
            
            // Split at last dot to find extension
            String beforeExtension = null;
            {
                final int pos = subpath.lastIndexOf('.');
                if (pos >= 0) {
                    beforeExtension = subpath.substring(0, pos);
                    extension = subpath.substring(pos+1);
                } else {
                    beforeExtension = subpath;
                    extension = EMPTY_STRING;
                }
            }
            
            // And split at last / between test selector and test method name
            {
                final int pos = beforeExtension.lastIndexOf('/');
                if(pos >= 0) {
                    testNameSelector = beforeExtension.substring(0, pos);
                    selectedMethodName = beforeExtension.substring(pos+1);
                } else {
                    testNameSelector = beforeExtension;
                    selectedMethodName = EMPTY_STRING;
                }
            }
        }
    }