Package net.sourceforge.squirrel_sql.client.update.gui

Examples of net.sourceforge.squirrel_sql.client.update.gui.ArtifactStatus


   }
  
   @Test
   public void testGetDownloadFileLocation_core() {
     String coreJarFilename = "somecore.jar";
     ArtifactStatus mockArtifactStatus = mockHelper.createMock(ArtifactStatus.class);
     expect(mockArtifactStatus.getType()).andReturn(UpdateUtil.CORE_ARTIFACT_ID).atLeastOnce();
     expect(mockArtifactStatus.getName()).andReturn(coreJarFilename);
//     FileWrapper mockDownloadsDirectory = mockHelper.createMock("mockDownloadsDirectory", FileWrapper.class);
//     expect(mockDownloadsDirectory.isDirectory()).andStubReturn(true);
//     expect(mockFileWrapperFactory.create(mockUpdateDirectory, UpdateUtil.DOWNLOADS_DIR_NAME));
//     expectLastCall().andReturn(mockDownloadsDirectory);
     FileWrapper mockDownloadsCoreDirectory = mockHelper.createMock("mockDownloadsCoreDirectory", FileWrapper.class);
View Full Code Here


     String pluginFilename = "aPluginName.zip";
     String pluginFileAbsPath = "path/to/plugin/file/"+pluginFilename;
     long pluginFileCheckSum = 10L;
     long pluginFileByteSize = 20L;
    
     ArtifactStatus status = mockHelper.createMock(ArtifactStatus.class);
     expect(status.getType()).andStubReturn(UpdateUtil.PLUGIN_ARTIFACT_ID);
     expect(status.getName()).andReturn(pluginFilename);
    expect(status.getChecksum()).andReturn(pluginFileCheckSum);
    expect(status.getSize()).andReturn(pluginFileByteSize);
   
     FileWrapper fileInDownlodDir = mockHelper.createMock("fileInDownlodDir", FileWrapper.class);    
    expect(fileInDownlodDir.getAbsolutePath()).andReturn(pluginFileAbsPath);
     expect(fileInDownlodDir.exists()).andReturn(true);
     expect(fileInDownlodDir.length()).andReturn(pluginFileByteSize);
View Full Code Here

  @Test
  public void testPullDownUpdateFiles_remoteSite()
  {

    List<ArtifactStatus> artifactStatusList = new ArrayList<ArtifactStatus>();
    ArtifactStatus mockArtifactStatus = mockHelper.createMock("mockArtifactStatus", ArtifactStatus.class);

    DownloadStatusEventHandler mockDownloadStatusListener =
      mockHelper.createMock("mockDownloadStatusEventHandler", DownloadStatusEventHandler.class);
    ProxySettings mockProxySettings = mockHelper.createMock("mockProxySettings", ProxySettings.class);
    ArtifactDownloaderFactory mockArtifactDownloaderFactory =
      mockHelper.createMock("ArtifactDownloaderFactory", ArtifactDownloaderFactory.class);
    ArtifactDownloader mockArtifactDownloader =
      mockHelper.createMock("mockArtifactDownloader", ArtifactDownloader.class);

    expect(mockArtifactStatus.getArtifactAction()).andStubReturn(ArtifactAction.INSTALL);

    artifactStatusList.add(mockArtifactStatus);

    expect(mockArtifactDownloaderFactory.create(artifactStatusList)).andStubReturn(mockArtifactDownloader);
View Full Code Here

  }

  @Test
  public final void testCreate() {
   
    ArtifactStatus mockArtifactStatus = mockHelper.createMock(ArtifactStatus.class);
    List<ArtifactStatus> artifactStatusList = new ArrayList<ArtifactStatus>();
    artifactStatusList.add(mockArtifactStatus);
    ArtifactDownloader result = classUnderTest.create(artifactStatusList);
    List<ArtifactStatus> actualArtifactStatusList = result.getArtifactStatus();
    assertEquals(artifactStatusList.size(), actualArtifactStatusList.size());
View Full Code Here

    {
      Set<ArtifactXmlBean> artifactBeans = module.getArtifacts();
      String moduleName = module.getName();
      for (ArtifactXmlBean artifact : artifactBeans)
      {
        ArtifactStatus status = new ArtifactStatus(artifact);
        status.setType(moduleName);
        if (status.isCoreArtifact())
        {
          status.setInstalled(true);
        }
        if (status.isPluginArtifact() && installedPlugins.contains(artifact.getName()))
        {
          status.setInstalled(true);
        }
        if (status.isTranslationArtifact() && installedTranslations.contains(artifact.getName()))
        {
          status.setInstalled(true);
        }
        result.add(status);
      }
    }
    return result;
View Full Code Here

  private List<ArtifactStatus> buildRemoveCoreFileChangeList()
  {
    ArrayList<ArtifactStatus> result = new ArrayList<ArtifactStatus>();
    final String coreType = UpdateUtil.CORE_ARTIFACT_ID;
    final boolean installed = true;
    ArtifactStatus squirrelSqlJarToRemove =
      getArtifactToRemove(SQUIRREL_SQL_JAR_FILENAME, installed, coreType);
    result.add(squirrelSqlJarToRemove);
    return result;
  }
View Full Code Here

    final boolean notInstalled = false;
    final String coreType = UpdateUtil.CORE_ARTIFACT_ID;
    final String pluginType = UpdateUtil.PLUGIN_ARTIFACT_ID;
    final String i18nType = UpdateUtil.TRANSLATION_ARTIFACT_ID;

    ArtifactStatus newSquirrelSqlJar = getArtifactToInstall(SQUIRREL_SQL_JAR_FILENAME, true, coreType);
    ArtifactStatus newFrameworkJar = getArtifactToInstall(FW_JAR_FILENAME, installed, coreType);
    ArtifactStatus newSpringJar = getArtifactToInstall(SPRING_JAR_FILENAME, notInstalled, coreType);
    ArtifactStatus newDbcopyZip = getArtifactToInstall(DBCOPY_ZIP_FILENAME, installed, pluginType);
    ArtifactStatus newSquirrelSqlEsJar =
      getArtifactToInstall(SQUIRREL_SQL_ES_JAR_FILENAME, installed, i18nType);

    result.add(newSquirrelSqlJar);
    result.add(newFrameworkJar);
    result.add(newSpringJar);
View Full Code Here

    return result;
  }

  private ArtifactStatus getArtifactToInstall(String name, boolean installed, String type)
  {
    ArtifactStatus result = new ArtifactStatus();
    result.setArtifactAction(ArtifactAction.INSTALL);
    result.setName(name);
    result.setInstalled(installed);
    result.setType(type);
    return result;
  }
View Full Code Here

    return result;
  }

  private ArtifactStatus getArtifactToRemove(String name, boolean installed, String type)
  {
    ArtifactStatus result = new ArtifactStatus();
    result.setArtifactAction(ArtifactAction.REMOVE);
    result.setName(name);
    result.setInstalled(installed);
    result.setType(type);
    return result;
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.squirrel_sql.client.update.gui.ArtifactStatus

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.