View Javadoc

1   package org.ogf.saga.namespace.base;
2   
3   import org.junit.Test;
4   import org.ogf.saga.error.DoesNotExistException;
5   import org.ogf.saga.error.IncorrectStateException;
6   import org.ogf.saga.namespace.Flags;
7   import org.ogf.saga.namespace.NSFactory;
8   import org.ogf.saga.namespace.abstracts.AbstractData;
9   
10  /* ***************************************************
11  * *** Centre de Calcul de l'IN2P3 - Lyon (France) ***
12  * ***             http://cc.in2p3.fr/             ***
13  * ***************************************************
14  * File:   WriteBaseTest
15  * Author: Lionel Schwarz (lionel.schwarz@in2p3.fr)
16  * Date:   5 NOV 2013
17  * ***************************************************
18  * Description:                                      */
19  /**
20   *
21   */
22  public abstract class WriteBaseTest extends AbstractData {
23      public WriteBaseTest(String protocol) throws Exception {
24          super(protocol);
25      }
26  
27      @Test(expected = DoesNotExistException.class)
28      public void test_remove() throws Exception {
29          m_file.remove(Flags.NONE.getValue());
30          NSFactory.createNSEntry(m_session, m_fileUrl, Flags.NONE.getValue());
31      }
32  
33      @Test(expected = IncorrectStateException.class)
34      public void test_remove_notexist() throws Exception {
35          m_file.remove(Flags.NONE.getValue());
36          m_file.remove(Flags.NONE.getValue());
37      }
38  }