Search in sources :

Example 6 with DataGridTicket

use of com.emc.metalnx.core.domain.entity.DataGridTicket in project metalnx-web by irods-contrib.

the class TestCreateTicketWithUserRestriction method setUp.

@Before
public void setUp() throws DataGridException, JargonException {
    String parentPath = String.format("/%s/home", zone);
    targetPath = String.format("%s/%s", parentPath, username);
    ticketUtils = new TestTicketUtils(irodsServices);
    dgt = new DataGridTicket(targetPath);
    dgt.addUser(username);
}
Also used : DataGridTicket(com.emc.metalnx.core.domain.entity.DataGridTicket) Before(org.junit.Before)

Example 7 with DataGridTicket

use of com.emc.metalnx.core.domain.entity.DataGridTicket in project metalnx-web by irods-contrib.

the class TestModifyTicket method testModifyTicketWriteByteLimit.

@Test
public void testModifyTicketWriteByteLimit() throws DataGridConnectionRefusedException, DataGridTicketException {
    long newWriteByteLimit = 2 * WRITE_BYTE_LIMIT;
    DataGridTicket dgt = new DataGridTicket(targetPath);
    dgt.setTicketString(ticketString);
    dgt.setWriteByteLimit(newWriteByteLimit);
    DataGridTicket ticketModified = ticketService.modify(dgt);
    assertEquals(newWriteByteLimit, ticketModified.getWriteByteLimit());
    assertFalse(ticketModified.getTicketString().isEmpty());
    assertTrue(ticketModified.getPath().equals(targetPath));
    assertTrue(ticketModified.getOwner().equals(username));
}
Also used : DataGridTicket(com.emc.metalnx.core.domain.entity.DataGridTicket) Test(org.junit.Test)

Example 8 with DataGridTicket

use of com.emc.metalnx.core.domain.entity.DataGridTicket in project metalnx-web by irods-contrib.

the class TestModifyTicket method testModifyTicketWriteFileLimit.

@Test
public void testModifyTicketWriteFileLimit() throws DataGridConnectionRefusedException, DataGridTicketException {
    int newWriteFileLimit = WRITE_FILE_LIMIT + 1;
    DataGridTicket dgt = new DataGridTicket(targetPath);
    dgt.setTicketString(ticketString);
    dgt.setWriteFileLimit(newWriteFileLimit);
    DataGridTicket ticketModified = ticketService.modify(dgt);
    assertEquals(newWriteFileLimit, ticketModified.getWriteFileLimit());
    assertFalse(ticketModified.getTicketString().isEmpty());
    assertTrue(ticketModified.getPath().equals(targetPath));
    assertTrue(ticketModified.getOwner().equals(username));
}
Also used : DataGridTicket(com.emc.metalnx.core.domain.entity.DataGridTicket) Test(org.junit.Test)

Example 9 with DataGridTicket

use of com.emc.metalnx.core.domain.entity.DataGridTicket in project metalnx-web by irods-contrib.

the class TestModifyTicket method testModifyTicketUsers.

@Test
public void testModifyTicketUsers() throws DataGridConnectionRefusedException, DataGridTicketException {
    DataGridTicket dgt = new DataGridTicket(targetPath);
    dgt.setTicketString(ticketString);
    dgt.addUser(username);
    DataGridTicket ticketModified = ticketService.modify(dgt);
    assertEquals(1, ticketModified.getUsers().size());
    assertTrue(ticketModified.getUsers().contains(username));
    assertFalse(ticketModified.getTicketString().isEmpty());
    assertTrue(ticketModified.getPath().equals(targetPath));
    assertTrue(ticketModified.getOwner().equals(username));
}
Also used : DataGridTicket(com.emc.metalnx.core.domain.entity.DataGridTicket) Test(org.junit.Test)

Example 10 with DataGridTicket

use of com.emc.metalnx.core.domain.entity.DataGridTicket in project metalnx-web by irods-contrib.

the class TestModifyTicket method testModifyTicketGroups.

@Test
public void testModifyTicketGroups() throws DataGridConnectionRefusedException, DataGridTicketException {
    DataGridTicket dgt = new DataGridTicket(targetPath);
    dgt.setTicketString(ticketString);
    dgt.addGroup(PUBLIC_GROUP);
    DataGridTicket ticketModified = ticketService.modify(dgt);
    assertEquals(1, ticketModified.getGroups().size());
    assertTrue(ticketModified.getGroups().contains(PUBLIC_GROUP));
    assertFalse(ticketModified.getTicketString().isEmpty());
    assertTrue(ticketModified.getPath().equals(targetPath));
    assertTrue(ticketModified.getOwner().equals(username));
}
Also used : DataGridTicket(com.emc.metalnx.core.domain.entity.DataGridTicket) Test(org.junit.Test)

Aggregations

DataGridTicket (com.emc.metalnx.core.domain.entity.DataGridTicket)25 Test (org.junit.Test)10 Before (org.junit.Before)7 Ticket (org.irods.jargon.ticket.Ticket)4 UnsupportedDataGridFeatureException (com.emc.metalnx.core.domain.exceptions.UnsupportedDataGridFeatureException)3 JargonException (org.irods.jargon.core.exception.JargonException)3 TicketAdminService (org.irods.jargon.ticket.TicketAdminService)3 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)3 Date (java.util.Date)2 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)2 DataGridTicketException (com.emc.metalnx.core.domain.exceptions.DataGridTicketException)1 DataGridTicketNotFoundException (com.emc.metalnx.core.domain.exceptions.DataGridTicketNotFoundException)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 DataNotFoundException (org.irods.jargon.core.exception.DataNotFoundException)1 TicketCreateModeEnum (org.irods.jargon.ticket.packinstr.TicketCreateModeEnum)1 ResponseEntity (org.springframework.http.ResponseEntity)1