package org.cinchapi.concourse;

import org.cinchapi.concourse.thrift.TSecurityException;
import org.junit.Test;

/**
 * Test security exception which occurs when user session
 * is invalidated from concourse server and the user is kicked
 * out of CaSH session. 
 * 
 * @author knd
 *
 */
public class SecurityExceptionTest extends ConcourseIntegrationTest {
    
    @Test(expected=TSecurityException.class)
    public void testTSecurityExceptionIsThrown(){
        grantAccess("admin", "admin2");
        client.add("name", "brad", 1); // this should throw TSecurityException
    }
    
}

@@ -83,16 +83,41 @@
 eption;%0A
+import org.junit.Assert;%0A
 import o
@@ -131,16 +131,16 @@
 t.Test;%0A
-
 %0A/**%0A * 
@@ -396,43 +396,8 @@
 Test
-(expected=TSecurityException.class)
 %0A   
@@ -443,16 +443,34 @@
 rown()%7B%0A
+        try %7B%0A    
         
@@ -501,16 +501,20 @@
 min2%22);%0A
+    
         
@@ -568,27 +568,397 @@
 hrow
- TSecurityException
+%0A                                           // TSecurityException%0A            Assert.fail(%22Expecting TSecurityException%22);%0A        %7D%0A        catch (Exception e) %7B%0A            if(e.getCause() != null%0A                    & e.getCause() instanceof TSecurityException) %7B%0A                Assert.assertTrue(true);%0A            %7D%0A            else %7B%0A                throw e;%0A            %7D%0A        %7D
 %0A   

update SecurityExceptionTest to work around compatibility issue between thrift and gradle exception