qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ai...@apache.org
Subject svn commit: r726776 - /qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/management/AMQUserManagementMBeanTest.java
Date Mon, 15 Dec 2008 19:17:58 GMT
Author: aidan
Date: Mon Dec 15 11:17:57 2008
New Revision: 726776

URL: http://svn.apache.org/viewvc?rev=726776&view=rev
Log:
QPID-1469: style fix

patch from gemmellr@dcs.gla.ac.uk

Modified:
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/management/AMQUserManagementMBeanTest.java

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/management/AMQUserManagementMBeanTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/management/AMQUserManagementMBeanTest.java?rev=726776&r1=726775&r2=726776&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/management/AMQUserManagementMBeanTest.java
(original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/management/AMQUserManagementMBeanTest.java
Mon Dec 15 11:17:57 2008
@@ -30,124 +30,123 @@
 
 import junit.framework.TestCase;
 
-public class AMQUserManagementMBeanTest extends TestCase {
+public class AMQUserManagementMBeanTest extends TestCase
+{
+    private Base64MD5PasswordFilePrincipalDatabase _database;
+    private AMQUserManagementMBean _amqumMBean;
+
+    private static final String _QPID_HOME =  System.getProperty("QPID_HOME");
+
+    private static final String USERNAME = "testuser";
+    private static final String PASSWORD = "password";
+    private static final String JMXRIGHTS = "admin";
+    private static final String TEMP_PASSWORD_FILE_NAME = "tempPasswordFile.tmp";
+    private static final String TEMP_JMXACCESS_FILE_NAME = "tempJMXAccessFile.tmp";
 
-	private Base64MD5PasswordFilePrincipalDatabase _database;
-	private AMQUserManagementMBean _amqumMBean;
+    @Override
+    protected void setUp() throws Exception
+    {
+        assertNotNull("QPID_HOME not set", _QPID_HOME);
+
+        _database = new Base64MD5PasswordFilePrincipalDatabase();
+        _amqumMBean = new AMQUserManagementMBean();
+    }
+
+    @Override
+    protected void tearDown() throws Exception
+    {
+        File testFile = new File(_QPID_HOME + File.separator + TEMP_JMXACCESS_FILE_NAME +
".tmp");
+        if (testFile.exists())
+        {
+            testFile.delete();
+        }
+
+        testFile = new File(_QPID_HOME + File.separator + TEMP_JMXACCESS_FILE_NAME + ".old");
+        if (testFile.exists())
+        {
+            testFile.delete();
+        }
+
+        testFile = new File(_QPID_HOME + File.separator + TEMP_PASSWORD_FILE_NAME + ".tmp");
+        if (testFile.exists())
+        {
+            testFile.delete();
+        }
+
+        testFile = new File(_QPID_HOME + File.separator + TEMP_PASSWORD_FILE_NAME + ".old");
+        if (testFile.exists())
+        {
+            testFile.delete();
+        }
+    }
+
+    public void testDeleteUser()
+    {
+        loadTestPasswordFile();
+        loadTestAccessFile();
+
+        boolean deleted = false;
+
+        try
+        {
+            deleted = _amqumMBean.deleteUser(USERNAME);
+        }
+        catch(Exception e){
+            fail("Unable to delete user: " + e.getMessage());
+        }
+
+        assertTrue(deleted);
+    }
+ 
+    
+    // ============================ Utility methods =========================
 
-	private static final String _QPID_HOME =  System.getProperty("QPID_HOME");
-	
-	private static final String USERNAME = "testuser";
-	private static final String PASSWORD = "password";
-	private static final String JMXRIGHTS = "admin";
-	private static final String TEMP_PASSWORD_FILE_NAME = "tempPasswordFile.tmp";
-	private static final String TEMP_JMXACCESS_FILE_NAME = "tempJMXAccessFile.tmp";
-
-	@Override
-	protected void setUp() throws Exception {
-
-		assertNotNull("QPID_HOME not set", _QPID_HOME);
-
-		_database = new Base64MD5PasswordFilePrincipalDatabase();
-		_amqumMBean = new AMQUserManagementMBean();
-	}
-	
-	@Override
-	protected void tearDown() throws Exception {
-		
-		File testFile = new File(_QPID_HOME + File.separator + TEMP_JMXACCESS_FILE_NAME + ".tmp");
-		if (testFile.exists())
-		{
-			testFile.delete();
-		}
-		
-		testFile = new File(_QPID_HOME + File.separator + TEMP_JMXACCESS_FILE_NAME + ".old");
-		if (testFile.exists())
-		{
-			testFile.delete();
-		}
-
-		testFile = new File(_QPID_HOME + File.separator + TEMP_PASSWORD_FILE_NAME + ".tmp");
-		if (testFile.exists())
-		{
-			testFile.delete();
-		}
-		
-		testFile = new File(_QPID_HOME + File.separator + TEMP_PASSWORD_FILE_NAME + ".old");
-		if (testFile.exists())
-		{
-			testFile.delete();
-		}
-	}
-
-	public void testDeleteUser() {
-		
-		loadTestPasswordFile();
-		loadTestAccessFile();
-		
-		boolean deleted = false;
-		
-		try{
-		    deleted = _amqumMBean.deleteUser(USERNAME);
-		}
-		catch(Exception e){
-			fail("Unable to delete user: " + e.getMessage());
-		}
-		
-		assertTrue(deleted);
-	}
-	
-	
-	
-	// ============================ Utility methods =========================
-	
-	private void loadTestPasswordFile()
+    private void loadTestPasswordFile()
     {
-		try{
-			File tempPasswordFile = new File(_QPID_HOME + File.separator + TEMP_PASSWORD_FILE_NAME);
-			if (tempPasswordFile.exists())
-			{
-				tempPasswordFile.delete();
-			}
-			tempPasswordFile.deleteOnExit();
-
-			BufferedWriter passwordWriter = new BufferedWriter(new FileWriter(tempPasswordFile));
-			passwordWriter.write(USERNAME + ":" + PASSWORD);
-			passwordWriter.newLine();
-			passwordWriter.flush();
-
-
-			_database.setPasswordFile(tempPasswordFile.toString());
-			_amqumMBean.setPrincipalDatabase(_database);
-		}
-		catch (IOException e)
-		{
-			fail("Unable to create test password file: " + e.getMessage());
-		}
+        try
+        {
+            File tempPasswordFile = new File(_QPID_HOME + File.separator + TEMP_PASSWORD_FILE_NAME);
+            if (tempPasswordFile.exists())
+            {
+                tempPasswordFile.delete();
+            }
+            tempPasswordFile.deleteOnExit();
+
+            BufferedWriter passwordWriter = new BufferedWriter(new FileWriter(tempPasswordFile));
+            passwordWriter.write(USERNAME + ":" + PASSWORD);
+            passwordWriter.newLine();
+            passwordWriter.flush();
+
+            _database.setPasswordFile(tempPasswordFile.toString());
+            _amqumMBean.setPrincipalDatabase(_database);
+        }
+        catch (IOException e)
+        {
+            fail("Unable to create test password file: " + e.getMessage());
+        }
     }
 
-	private void loadTestAccessFile()
+    private void loadTestAccessFile()
     {
-		try{
-			File tempAccessFile = new File(_QPID_HOME + File.separator + TEMP_JMXACCESS_FILE_NAME);
-			if (tempAccessFile.exists())
-			{
-				tempAccessFile.delete();
-			}
-			tempAccessFile.deleteOnExit();
-
-			BufferedWriter accessWriter = new BufferedWriter(new FileWriter(tempAccessFile));
-			accessWriter.write(USERNAME + "=" + JMXRIGHTS);
-			accessWriter.newLine();
-			accessWriter.flush();
-
-
-			_amqumMBean.setAccessFile(tempAccessFile.toString());
-		}	
-		catch (Exception e)
-		{
-			fail("Unable to create test access file: " + e.getMessage());
-		}
+        try
+        {
+            File tempAccessFile = new File(_QPID_HOME + File.separator + TEMP_JMXACCESS_FILE_NAME);
+            if (tempAccessFile.exists())
+            {
+                tempAccessFile.delete();
+            }
+            tempAccessFile.deleteOnExit();
+
+            BufferedWriter accessWriter = new BufferedWriter(new FileWriter(tempAccessFile));
+            accessWriter.write(USERNAME + "=" + JMXRIGHTS);
+            accessWriter.newLine();
+            accessWriter.flush();
+
+            _amqumMBean.setAccessFile(tempAccessFile.toString());
+        }
+        catch (Exception e)
+        {
+            fail("Unable to create test access file: " + e.getMessage());
+        }
     }
-	
 }



Mime
View raw message