Search in sources :

Example 21 with ISystemSettings

use of org.pentaho.platform.api.engine.ISystemSettings in project data-access by pentaho.

the class AgileHelperTest method testGetTmpFolderPath.

@Test
public void testGetTmpFolderPath() {
    PentahoSystem.setSystemSettingsService(null);
    assertNull(AgileHelper.getTmpFolderPath(null));
    String sampleProject = AgileHelper.PLUGIN_NAME;
    String sampleFolderPath = "/etc/";
    ISystemSettings systemSettings = mock(ISystemSettings.class);
    when(systemSettings.getSystemSetting(anyString(), anyString(), anyString())).thenReturn(null).thenReturn(sampleFolderPath);
    PentahoSystem.setSystemSettingsService(systemSettings);
    assertNull(AgileHelper.getTmpFolderPath(sampleProject));
    assertTrue((sampleFolderPath + sampleProject).equals(AgileHelper.getTmpFolderPath(sampleProject)));
}
Also used : ISystemSettings(org.pentaho.platform.api.engine.ISystemSettings) Test(org.junit.Test)

Aggregations

ISystemSettings (org.pentaho.platform.api.engine.ISystemSettings)21 Test (org.junit.Test)13 IPentahoSession (org.pentaho.platform.api.engine.IPentahoSession)4 Before (org.junit.Before)3 File (java.io.File)2 Matchers.anyString (org.mockito.Matchers.anyString)2 IPentahoObjectFactory (org.pentaho.platform.api.engine.IPentahoObjectFactory)2 ISolutionEngine (org.pentaho.platform.api.engine.ISolutionEngine)2 ObjectFactoryException (org.pentaho.platform.api.engine.ObjectFactoryException)2 DatasourceDTO (org.pentaho.platform.dataaccess.datasource.wizard.models.DatasourceDTO)2 SimpleGrantedAuthority (org.springframework.security.core.authority.SimpleGrantedAuthority)2 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1 LinkedList (java.util.LinkedList)1 Map (java.util.Map)1 Properties (java.util.Properties)1 Node (org.dom4j.Node)1 Expectations (org.jmock.Expectations)1 InvocationOnMock (org.mockito.invocation.InvocationOnMock)1 IActionCompleteListener (org.pentaho.platform.api.engine.IActionCompleteListener)1