Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * @(#) $Id: AppManagerTest.java 2647 2008-08-26 13:53:08Z webok $
   *
   * Copyright 2004/2005 by SPARDAT Sparkassen-Datendienst Ges.m.b.H.,
   * A-1110 Wien, Geiselbergstr.21-25.
   * All rights reserved.
   *
   */
  package at.spardat.xma.boot.comp;
 
 
 import  junit.framework.TestCase;
 
 public class AppManagerTest extends TestCase {
 
     public AppManagerTest() {
         super();
     }
 
     public AppManagerTest(String name) {
         super(name);
     }
 
     protected void setUp() throws Exception {
         super.setUp();
     }
 
     public static void main(String[] args) {
         junit.awtui.TestRunner.run(AppManagerTest.class);
     }
 
     public void testAcceptXMA_URI_AllIntern() throws Exception {
         AppManager appManager;
 
         Properties prop = new Properties();
         prop.setProperty(.,"localhost;127.0.0.1;10.*;*.server.lan.at;*.imcplus.net");
         prop.setProperty(.,"");
         appManager = AppManager.initialize(prop);
 
         XMA_URI uri = new XMA_URI("http://localhost:8080/xma_samplespar/Kundensuche");
         assertTrue("desired: all internal URLS accepted"appManager.acceptXMA_URI(uri));
     }
 
     public void testAcceptXMA_URI_NoLocal() throws Exception {
         AppManager appManager;
 
         Properties prop = new Properties();
         prop.setProperty(.,"10.*;*.server.lan.at;*.imcplus.net");
         prop.setProperty(.,"");
         appManager = AppManager.initialize(prop);
 
         XMA_URI uri = new XMA_URI("http://localhost:8080/xma_samplespar/Kundensuche");
         assertFalse("desired: local URLS not accepted"appManager.acceptXMA_URI(uri));
     }
 
     public void testAcceptXMA_URI_AcceptServerLanATBy10() throws Exception {
         AppManager appManager;
 
         Properties prop = new Properties();
         prop.setProperty(.,"localhost;127.0.0.1;10.*;*.imcplus.net");
         prop.setProperty(.,"");
         appManager = AppManager.initialize(prop);
 
         XMA_URI uri = new XMA_URI("http://baal2.server.lan.at:8080/depneu2/Main");
         assertTrue("desired: *.server.lan.at URL accepetd by 10.*"appManager.acceptXMA_URI(uri));
     }
 
     public void testAcceptXMA_URI_NoServerLanAT() throws Exception {
         AppManager appManager;
 
         Properties prop = new Properties();
         prop.setProperty(.,"localhost;127.0.0.1;*.imcplus.net");
         prop.setProperty(.,"");
         appManager = AppManager.initialize(prop);
 
         XMA_URI uri = new XMA_URI("http://baal2.server.lan.at:8080/depneu2/Main");
         assertFalse("desired: *.server.lan.at URL blocked"appManager.acceptXMA_URI(uri));
     }
 
     public void testAcceptXMA_URI_BlockLocal() throws Exception {
         AppManager appManager;
 
         Properties prop = new Properties();
         prop.setProperty(.,"localhost;127.0.0.1;10.*;*.server.lan.at;*.imcplus.net");
         prop.setProperty(.,"localhost");
         appManager = AppManager.initialize(prop);
 
         XMA_URI uri = new XMA_URI("http://localhost:8080/xma_samplespar/Kundensuche");
         assertFalse("desired: local URLS blocked"appManager.acceptXMA_URI(uri));
     }
 
     public void testAcceptXMA_URI_Block127() throws Exception {
         AppManager appManager;
 
         Properties prop = new Properties();
         prop.setProperty(.,"localhost;127.0.0.1;10.*;*.server.lan.at;*.imcplus.net");
        prop.setProperty(.,"127.0.0.1");
        appManager = AppManager.initialize(prop);
        XMA_URI uri = new XMA_URI("http://localhost:8080/xma_samplespar/Kundensuche");
        assertFalse("desired: 127.0.0.1 URL blocked"appManager.acceptXMA_URI(uri));
    }
    public void testAcceptXMA_URI_Block10() throws Exception {
        AppManager appManager;
        Properties prop = new Properties();
        prop.setProperty(.,"localhost;127.0.0.1;10.*;*.server.lan.at;*.imcplus.net");
        prop.setProperty(.,"10.*");
        appManager = AppManager.initialize(prop);
        XMA_URI uri = new XMA_URI("http://10.18.93.132:8080/xma_samplespar/Kundensuche");
        assertFalse("desired: 10.* URL blocked"appManager.acceptXMA_URI(uri));
    }
    public void testAcceptXMA_URI_BlockServerLanAT1() throws Exception {
        AppManager appManager;
        Properties prop = new Properties();
        prop.setProperty(.,"localhost;127.0.0.1;10.*;*.server.lan.at;*.imcplus.net");
        prop.setProperty(.,"*.server.lan.at");
        appManager = AppManager.initialize(prop);
        XMA_URI uri = new XMA_URI("http://baal2.server.lan.at:8080/depneu2/Main");
        assertFalse("desired: *.server.lan.at URL blocked"appManager.acceptXMA_URI(uri));
    }
    public void testAcceptXMA_URI_BlockServerLanATBy10() throws Exception {
        AppManager appManager;
        Properties prop = new Properties();
        prop.setProperty(.,"localhost;127.0.0.1;10.*;*.server.lan.at;*.imcplus.net");
        prop.setProperty(.,"10.*");
        appManager = AppManager.initialize(prop);
        XMA_URI uri = new XMA_URI("http://baal2.server.lan.at:8080/depneu2/Main");
        assertFalse("desired: *.server.lan.at URL blocked"appManager.acceptXMA_URI(uri));
    }
New to GrepCode? Check out our FAQ X