Package eu.scape_project.planning.manager

Examples of eu.scape_project.planning.manager.DigitalObjectManager


        // mock ByteStreamManager
        ByteStreamManager byteStreamManager = mock(ByteStreamManager.class);
        when(byteStreamManager.store(null, content.getBytes())).thenReturn("myPid");

        // execute test
        DigitalObjectManager digitalObjectManager = new DigitalObjectManager();
        digitalObjectManager.setByteStreamManager(byteStreamManager);
        digitalObjectManager.moveDataToStorage(object);

        // verify results
        assertNull(object.getData().getData());
        assertEquals("myPid", object.getPid());
        assertTrue(object.getSizeInBytes() > 0);
View Full Code Here


        // input object
        DigitalObject object = new DigitalObject();
        object.setPid("");

        // execute test
        DigitalObjectManager digitalObjectManager = new DigitalObjectManager();
        digitalObjectManager.getCopyOfDataFilledDigitalObject(object);
    }
View Full Code Here

        // mock ByteStreamManager
        ByteStreamManager byteStreamManager = mock(ByteStreamManager.class);
        when(byteStreamManager.load("pid")).thenReturn(content.getBytes());

        // execute test
        DigitalObjectManager digitalObjectManager = new DigitalObjectManager();
        digitalObjectManager.setByteStreamManager(byteStreamManager);
        DigitalObject resultObject = digitalObjectManager.getCopyOfDataFilledDigitalObject(object);

        // verify results
        assertFalse(object == resultObject);
        assertTrue(Arrays.equals(content.getBytes(), resultObject.getData().getData()));
        assertEquals("pid", resultObject.getPid());
View Full Code Here

TOP

Related Classes of eu.scape_project.planning.manager.DigitalObjectManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.