Package net.sourceforge.squirrel_sql.fw.util

Examples of net.sourceforge.squirrel_sql.fw.util.FileWrapper


  }

  @Test
  public void testGetSetInstallDir()
  {
    FileWrapper mockNewInstallDir = mockHelper.createMock(FileWrapper.class);
   
    mockHelper.replayAll();
    assertEquals(mockInstallDir, classUnderTest.getInstallDir());
    classUnderTest.setInstallDir(mockNewInstallDir);
    assertEquals(mockNewInstallDir, classUnderTest.getInstallDir());
View Full Code Here


   */
  @Test
  public void testUpdateLaunchScript() throws IOException
  {
   
    FileWrapper sourceScriptFile = _fileWrapperFactory.create(SOURCE_SCRIPT_FILE_TO_TEST);
    FileWrapper targetScriptFile = _fileWrapperFactory.create(TARGET_SCRIPT_FILE_TO_TEST);
    ioutils.copyFile(sourceScriptFile, targetScriptFile);

    // Confirm that the script doesn't contain the splash screen icon setting.
    checkScriptFile(false);
   
View Full Code Here

          releasePath.toString(), RELEASE_XML_FILENAME, _app.getSquirrelPreferences().getProxySettings());
    }
    else
    {
      // 4b. Copy the release.xml file to the download directory then load the current release channel bean
      FileWrapper updateSiteReleaseXmlFilePath =
        fileWrapperFactory.create(settings.getFileSystemUpdatePath(), RELEASE_XML_FILENAME);
      FileWrapper downloadReleaseXmlFile =
        fileWrapperFactory.create(_util.getDownloadsDir(), RELEASE_XML_FILENAME);
      _util.copyFile(updateSiteReleaseXmlFilePath, downloadReleaseXmlFile);
      _currentChannelBean = _util.loadUpdateFromFileSystem(settings.getFileSystemUpdatePath());
    }
View Full Code Here

  @Test
  public final void testGetSetChangeListFile()
  {

    FileWrapper mockChangeListFile = helper.createMock(FileWrapper.class);

    helper.replayAll();
    FileWrapper result = implUnderTest.getChangeListFile();
    assertNull(result);
    implUnderTest.setChangeListFile(mockChangeListFile);
    result = implUnderTest.getChangeListFile();
    Assert.assertNotNull(result);
    helper.verifyAll();
View Full Code Here

    setupFileCopyOperationInfo(mockDownloadsDbCopyPluginZipFile, mockSquirrelPluginsDirFile,
      mockInstallDbCopyZipOperationInfo, isPlugin);
    setupFileCopyOperationInfo(mockDownloadsSquirrelSqlEsJarFile, mockSquirreLLibDirFile,
      mockInstallSquirrelSqlEsOperationInfo, isNotPlugin);

    FileWrapper mockChangeListFile = helper.createMock("mockChangeListFile", FileWrapper.class);
    mockUpdateUtil.copyFile(mockChangeListFile, mockBackupRootDirFile);
    expect(mockUpdateUtil.deleteFile(mockChangeListFile)).andReturn(true);
    expect(mockUpdateUtil.deleteFile(mockLocalReleaseFile)).andReturn(true);

    mockUpdateUtil.copyFile(mockDownloadReleaseFile, mockUpdateRootDirFile);
View Full Code Here

  {

    List<ArtifactStatus> changeList = getSquirrelSqlEsJarChangeList();
    expect(mockChangeListBean.getChanges()).andStubReturn(changeList);

    FileWrapper mockChangeListFile = helper.createMock("mockChangeListFile", FileWrapper.class);
    mockUpdateUtil.copyFile(mockChangeListFile, mockBackupRootDirFile);
    expect(mockUpdateUtil.deleteFile(mockChangeListFile)).andReturn(true);
    expect(mockUpdateUtil.getLocalReleaseFile()).andThrow(
      new FileNotFoundException("simulate local release doesn't exist"));
View Full Code Here

  }

  @Test
  public void testCreate()
  {
    FileWrapper fileToCopy = mockHelper.createMock("fileToCopy", FileWrapper.class);
    FileWrapper installDir = mockHelper.createMock("installDir", FileWrapper.class);
    InstallFileOperationInfo info = classUnderTest.create(fileToCopy, installDir);
    assertNotNull(info);
    assertEquals(fileToCopy, info.getFileToInstall());
    assertEquals(installDir, info.getInstallDir());
  }
View Full Code Here

  }

  @Test (expected = IllegalArgumentException.class)
  public void testCreate_NullFileToCopy()
  {
    FileWrapper fileToCopy = null;
    FileWrapper installDir = mockHelper.createMock("installDir", FileWrapper.class);
    classUnderTest.create(fileToCopy, installDir);
  }
View Full Code Here

    FileWrapper installDir = mockHelper.createMock("installDir", FileWrapper.class);
    classUnderTest.create(fileToCopy, installDir);
  }
 
  public void testCreate_NullInstallDir() {
    FileWrapper fileToCopy = mockHelper.createMock("fileToCopy", FileWrapper.class);
    FileWrapper installDir = null;
    classUnderTest.create(fileToCopy, installDir);
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.squirrel_sql.fw.util.FileWrapper

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.