/*******************************************************************************
 * Copyright (c) 2015 Jens Reimann.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Jens Reimann - initial API and implementation
 *******************************************************************************/
package de.dentrassi.pm.testing;

import java.io.InputStream;
import java.net.URL;

import org.junit.Test;

public class BasicTest extends AbstractServerTest
{
    @Test
    public void test1 () throws Exception
    {
        testUrl ( "/" );
    }

    @Test
    public void test2 () throws Exception
    {
        testUrl ( "/p2" );
    }

    @Test
    public void test3 () throws Exception
    {
        testUrl ( "/r5" );
    }

    @Test
    public void test4 () throws Exception
    {
        testUrl ( "/maven" );
    }

    protected void testUrl ( final String suffix ) throws Exception
    {
        final URL url = new URL ( resolve ( suffix ) );
        try ( InputStream is = url.openStream () )
        {
        }
    }
}

@@ -593,13 +593,73 @@
 net.
-URL;%0A
+HttpURLConnection;%0Aimport java.net.URL;%0A%0Aimport org.junit.Assert;
 %0Aimp
@@ -761,17 +761,20 @@
 oid test
-1
+Main
  () thro
@@ -854,16 +854,17 @@
 oid test
+P
 2 () thr
@@ -951,9 +951,10 @@
 test
-3
+R5
  () 
@@ -1044,9 +1044,13 @@
 test
-4
+Maven
  () 
@@ -1316,10 +1316,1050 @@
 %7D%0A    %7D%0A
+%0A    @Test%0A    public void testUser () throws Exception%0A    %7B%0A        testNotAuth ( %22/user%22 );%0A    %7D%0A%0A    @Test%0A    public void testConfig () throws Exception%0A    %7B%0A        testNotAuth ( %22/config%22 );%0A    %7D%0A%0A    @Test%0A    public void testSetup () throws Exception%0A    %7B%0A        testNotAuth ( %22/setup%22 );%0A    %7D%0A%0A    @Test%0A    public void testConfigCoreList () throws Exception%0A    %7B%0A        testNotAuth ( %22/config/core/list%22 );%0A    %7D%0A%0A    @Test%0A    public void testConfigCoreSite () throws Exception%0A    %7B%0A        testNotAuth ( %22/config/core/site%22 );%0A    %7D%0A%0A    @Test%0A    public void testMailConfig () throws Exception%0A    %7B%0A        testNotAuth ( %22/default.mail/config%22 );%0A    %7D%0A%0A    protected void testNotAuth ( final String suffix ) throws Exception%0A    %7B%0A        final URL url = new URL ( resolve ( suffix ) );%0A%0A        final HttpURLConnection con = (HttpURLConnection)url.openConnection ();%0A        con.connect ();%0A        final int rc = con.getResponseCode ();%0A        con.disconnect ();%0A%0A        Assert.assertEquals ( 403, rc );%0A    %7D%0A%0A
 %7D%0A

add a view access control tests