notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
svn commit: r2649 - in development/main/transit/core/handler/src: main/net/dpml/transit/manager main/net/dpml/transit/model test/net/dpml/transit/manager
- From: mcconnell AT dpml.net
- To: notify-dpml AT lists.ibiblio.org
- Subject: svn commit: r2649 - in development/main/transit/core/handler/src: main/net/dpml/transit/manager main/net/dpml/transit/model test/net/dpml/transit/manager
- Date: Sun, 22 May 2005 00:41:11 +0000
Author: mcconnell AT dpml.net
Date: Sun May 22 00:40:49 2005
New Revision: 2649
Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/manager/ProxyManager.java
development/main/transit/core/handler/src/main/net/dpml/transit/model/ProxyChangeEvent.java
development/main/transit/core/handler/src/test/net/dpml/transit/manager/ProxyManagerTestCase.java
Log:
add enabled state to the proxy change event
Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/manager/ProxyManager.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/manager/ProxyManager.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/manager/ProxyManager.java
Sun May 22 00:40:49 2005
@@ -211,8 +211,9 @@
}
if( notify )
{
+ boolean enabled = isProxyEnabled();
ProxyChangeEvent event =
- new ProxyChangeEvent( this, m_identifier, m_authentication,
m_excludes );
+ new ProxyChangeEvent( this, enabled, m_identifier,
m_authentication, m_excludes );
super.enqueueEvent( event );
}
}
Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/model/ProxyChangeEvent.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/model/ProxyChangeEvent.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/model/ProxyChangeEvent.java
Sun May 22 00:40:49 2005
@@ -29,14 +29,17 @@
*/
public class ProxyChangeEvent extends EventObject
{
+ private final boolean m_enabled;
private final RequestIdentifier m_identifier;
private final PasswordAuthentication m_authentication;
private final String m_excludes;
public ProxyChangeEvent(
- ProxyModel model, RequestIdentifier identifier, PasswordAuthentication
auth, String excludes )
+ ProxyModel model, boolean enabled, RequestIdentifier identifier,
+ PasswordAuthentication auth, String excludes )
{
super( model );
+ m_enabled = enabled;
m_identifier = identifier;
m_authentication = auth;
m_excludes = excludes;
@@ -46,7 +49,12 @@
{
return (ProxyModel) super.getSource();
}
-
+
+ public boolean isProxyEnabled()
+ {
+ return m_enabled;
+ }
+
public RequestIdentifier getRequestIdentifier()
{
return m_identifier;
Modified:
development/main/transit/core/handler/src/test/net/dpml/transit/manager/ProxyManagerTestCase.java
==============================================================================
---
development/main/transit/core/handler/src/test/net/dpml/transit/manager/ProxyManagerTestCase.java
(original)
+++
development/main/transit/core/handler/src/test/net/dpml/transit/manager/ProxyManagerTestCase.java
Sun May 22 00:40:49 2005
@@ -77,6 +77,8 @@
public void testProxyEnabled() throws Exception
{
Preferences prefs = m_prefs.node( "proxy" );
+ TestProxyEnabledListener listener = new TestProxyEnabledListener();
+ m_manager.getProxyModel().addProxyListener( listener );
try
{
prefs.put( "host", "http://proxy.dpml.net" );
@@ -84,7 +86,6 @@
prefs.put( "prompt", "a-prompt" );
prefs.putLong( "modified", new Date().getTime() );
prefs.flush();
- boolean enabled = m_manager.getProxyModel().isProxyEnabled();
}
finally
{
@@ -140,6 +141,15 @@
}
}
+ public class TestProxyEnabledListener implements ProxyListener
+ {
+ public void proxySettingsChanged( ProxyChangeEvent event )
+ {
+ m_manager.getProxyModel().removeProxyListener( this );
+ assertTrue( "enabled", event.isProxyEnabled() );
+ }
+ }
+
public class TestProxyExcludesListener implements ProxyListener
{
public void proxySettingsChanged( ProxyChangeEvent event )
- svn commit: r2649 - in development/main/transit/core/handler/src: main/net/dpml/transit/manager main/net/dpml/transit/model test/net/dpml/transit/manager, mcconnell, 05/21/2005
Archive powered by MHonArc 2.6.24.