@@ -0,0 +1,2368 @@
+/**%0A * Copyright (c) 2012, s3auth.com%0A * All rights reserved.%0A *%0A * Redistribution and use in source and binary forms, with or without%0A * modification, are permitted provided that the following conditions%0A * are met: 1) Redistributions of source code must retain the above%0A * copyright notice, this list of conditions and the following%0A * disclaimer. 2) Redistributions in binary form must reproduce the above%0A * copyright notice, this list of conditions and the following%0A * disclaimer in the documentation and/or other materials provided%0A * with the distribution. 3) Neither the name of the s3auth.com nor%0A * the names of its contributors may be used to endorse or promote%0A * products derived from this software without specific prior written%0A * permission.%0A *%0A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS%0A * %22AS IS%22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT%0A * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND%0A * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL%0A * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,%0A * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES%0A * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR%0A * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)%0A * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,%0A * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)%0A * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED%0A * OF THE POSSIBILITY OF SUCH DAMAGE.%0A */%0Apackage com.s3auth.hosts;%0A%0Aimport java.net.URI;%0Aimport org.hamcrest.MatcherAssert;%0Aimport org.hamcrest.Matchers;%0Aimport org.junit.Test;%0A%0A/**%0A * Test case for %7B@link SmartHost%7D.%0A * @author Yegor Bugayenko (yegor@tpc2.com)%0A * @version $Id$%0A */%0Apublic final class SmartHostTest %7B%0A%0A    /**%0A     * SmartHost can show result of .htpasswd fetching.%0A     * @throws Exception If there is some problem inside%0A     */%0A    @Test%0A    public void showsLogsOfHtpasswdFetching() throws Exception %7B%0A        final URI uri = new URI(%22/.htpasswd%22);%0A        MatcherAssert.assertThat(%0A            ResourceMocker.toString(%0A                new SmartHost(%0A                    new HostMocker().withContent(uri, %22test me%22).mock()%0A                ).fetch(uri)%0A            ),%0A            Matchers.equalTo(%227 byte(s)%22)%0A        );%0A    %7D%0A%0A%7D%0A

test added