// Path: src/main/java/de/axxepta/oxygen/api/BaseXSource.java
// public enum BaseXSource {
// 
//     /**
//      * Database.
//      */
//     DATABASE("argon"),
// //    /**
// //     * RESTXQ.
// //     */
// //    RESTXQ("argonquery"),
//     /**
//      * Repository.
//      */
//     REPO("argonrepo");
// 
//     private final String protocol;
// 
//     BaseXSource(String protocol) {
// 
//         this.protocol = protocol;
//     }
// 
//     public String getProtocol() {
//         return protocol;
//     }
// 
//     /**
//      * Returns a source.
//      *
//      * @param string string representation
//      * @return enumeration
//      */
//     public static BaseXSource get(final String string) {
//         return BaseXSource.valueOf(string.toUpperCase(Locale.ENGLISH));
//     }
// 
//     @Override
//     public String toString() {
//         return name().toLowerCase(Locale.ENGLISH);
//     }
// }


import de.axxepta.oxygen.api.BaseXSource;
import org.junit.BeforeClass;
import org.junit.Test;
import java.io.IOException;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLStreamHandler;
import java.net.URLStreamHandlerFactory;
import static org.junit.Assert.*;
                }
                return null;
            }
        });
    }

    @Test
    public void pathFromURL() throws Exception {
        assertEquals("foo", CustomProtocolURLUtils.pathFromURL(new URL(ARGON + ":foo")));
        assertEquals("foo/bar", CustomProtocolURLUtils.pathFromURL(new URL(ARGON + ":foo/bar")));
        assertEquals("foo/bar", CustomProtocolURLUtils.pathFromURL(new URL(ARGON + ":/foo/bar")));
    }

    @Test
    public void pathFromURLString() throws Exception {
        assertEquals("foo", CustomProtocolURLUtils.pathFromURLString(ARGON + ":foo"));
        assertEquals("foo/bar", CustomProtocolURLUtils.pathFromURLString(ARGON + ":foo/bar"));
        assertEquals("foo/bar", CustomProtocolURLUtils.pathFromURLString(ARGON + ":/foo/bar"));
        assertEquals("", CustomProtocolURLUtils.pathFromURLString("/foo/bar"));
        assertEquals("", CustomProtocolURLUtils.pathFromURLString("foo/bar"));
    }

    @Test
    public void sourceFromURL() throws Exception {
        assertEquals(BaseXSource.DATABASE, CustomProtocolURLUtils.sourceFromURL(new URL(ARGON + ":foo/bar")));
        assertEquals(null, CustomProtocolURLUtils.sourceFromURL(new URL( "http://foo/bar")));
    }

    @Test
    public void sourceFromURLString() throws Exception {
// Path: src/main/java/de/axxepta/oxygen/api/BaseXSource.java
// public enum BaseXSource {
// 
//     /**
//      * Database.
//      */
//     DATABASE("argon"),
// //    /**
// //     * RESTXQ.
// //     */
// //    RESTXQ("argonquery"),
//     /**
//      * Repository.
//      */
//     REPO("argonrepo");
// 
//     private final String protocol;
// 
//     BaseXSource(String protocol) {
// 
//         this.protocol = protocol;
//     }
// 
//     public String getProtocol() {
//         return protocol;
//     }
// 
//     /**
//      * Returns a source.
//      *
//      * @param string string representation
//      * @return enumeration
//      */
//     public static BaseXSource get(final String string) {
//         return BaseXSource.valueOf(string.toUpperCase(Locale.ENGLISH));
//     }
// 
//     @Override
//     public String toString() {
//         return name().toLowerCase(Locale.ENGLISH);
//     }
// }


// Path: src/test/java/de/axxepta/oxygen/customprotocol/CustomProtocolURLUtilsTest.java
import de.axxepta.oxygen.api.BaseXSource;
import org.junit.BeforeClass;
import org.junit.Test;
import java.io.IOException;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLStreamHandler;
import java.net.URLStreamHandlerFactory;
import static org.junit.Assert.*;

                }
                return null;
            }
        });
    }

    @Test
    public void pathFromURL() throws Exception {
        assertEquals("foo", CustomProtocolURLUtils.pathFromURL(new URL(ARGON + ":foo")));
        assertEquals("foo/bar", CustomProtocolURLUtils.pathFromURL(new URL(ARGON + ":foo/bar")));
        assertEquals("foo/bar", CustomProtocolURLUtils.pathFromURL(new URL(ARGON + ":/foo/bar")));
    }

    @Test
    public void pathFromURLString() throws Exception {
        assertEquals("foo", CustomProtocolURLUtils.pathFromURLString(ARGON + ":foo"));
        assertEquals("foo/bar", CustomProtocolURLUtils.pathFromURLString(ARGON + ":foo/bar"));
        assertEquals("foo/bar", CustomProtocolURLUtils.pathFromURLString(ARGON + ":/foo/bar"));
        assertEquals("", CustomProtocolURLUtils.pathFromURLString("/foo/bar"));
        assertEquals("", CustomProtocolURLUtils.pathFromURLString("foo/bar"));
    }

    @Test
    public void sourceFromURL() throws Exception {
        assertEquals(BaseXSource.DATABASE, CustomProtocolURLUtils.sourceFromURL(new URL(ARGON + ":foo/bar")));
        assertEquals(null, CustomProtocolURLUtils.sourceFromURL(new URL( "http://foo/bar")));
    }

    @Test
    public void sourceFromURLString() throws Exception {
        assertEquals(BaseXSource.DATABASE, CustomProtocolURLUtils.sourceFromURLString(ARGON + ":foo/bar"));