1 package org.apache.archiva.web.test;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
22 import org.apache.archiva.web.test.parent.AbstractRepositoryTest;
23 import org.testng.annotations.Test;
25 @Test( groups = { "networkproxies" }, dependsOnMethods = { "testWithCorrectUsernamePassword" } )
26 public class NetworkProxiesTest
27 extends AbstractRepositoryTest
29 @Test (dependsOnMethods = { "testDeleteRepositoryGroup" } )
30 public void testAddNetworkProxyNullValues()
32 goToNetworkProxiesPage();
33 addNetworkProxy( "", "", "", "", "", "");
34 assertTextPresent( "You must enter an identifier." );
35 assertTextPresent( "You must enter a protocol." );
36 assertTextPresent( "You must enter a host." );
39 @Test (dependsOnMethods = { "testAddNetworkProxyNullValues" } )
40 public void testAddNetworkProxyNullIdentifier()
42 goToNetworkProxiesPage();
43 addNetworkProxy( "", "http", "localhost", "8080", "", "");
44 assertTextPresent( "You must enter an identifier." );
47 @Test (dependsOnMethods = { "testAddNetworkProxyNullIdentifier" } )
48 public void testAddNetworkProxyNullProtocol()
50 goToNetworkProxiesPage();
51 addNetworkProxy( "testing123", "", "localhost", "8080", "", "");
52 assertTextPresent( "You must enter a protocol." );
55 @Test (dependsOnMethods = { "testAddNetworkProxyNullProtocol" } )
56 public void testAddNetworkProxiesNullHostname()
58 goToNetworkProxiesPage();
59 addNetworkProxy( "testing123", "http", "", "8080", "", "");
60 assertTextPresent( "You must enter a host." );
63 @Test (dependsOnMethods = { "testAddNetworkProxiesNullHostname" } )
64 public void testAddNetworkProxiesValidValues()
66 goToNetworkProxiesPage();
67 addNetworkProxy( "testing123", "http", "localhost", "8080", "", "");
68 assertPage( "Apache Archiva \\ Administration - Network Proxies" );
69 assertTextPresent( "testing123" );
72 @Test (dependsOnMethods = { "testAddNetworkProxiesValidValues" } )
73 public void testEditNetworkProxy()
75 editNetworkProxies( "proxy.host", "localhost" );
76 assertPage( "Apache Archiva \\ Administration - Network Proxies" );
77 assertTextPresent( "localhost" );
80 @Test (dependsOnMethods = { "testEditNetworkProxy" } )
81 public void testDeleteNetworkProxy()
84 assertPage( "Apache Archiva \\ Administration - Network Proxies" );
85 assertTextPresent( "There are no network proxies configured yet." );
88 @Test (dependsOnMethods = { "testDeleteNetworkProxy" } )
89 public void testAddNetworkProxyAfterDelete()
91 addNetworkProxy( "testing123", "http", "localhost", "8080", "", "");
92 assertPage( "Apache Archiva \\ Administration - Network Proxies" );
93 assertTextPresent( "testing123" );