Package net.sourceforge.squirrel_sql.client.update.xmlbeans

Examples of net.sourceforge.squirrel_sql.client.update.xmlbeans.ChannelXmlBean


        String filename = f.getAbsolutePath();
        assertTrue(f.canRead());
        assertTrue(f.canWrite());
        //System.out.println("Persisting to file : "+filename);
        serializerUnderTest.write(channelBean, filename);
        ChannelXmlBean newBean = serializerUnderTest.readChannelBean(filename);
        assertEquals(channelBean, newBean);
       
        assertEquals(1, newBean.getCurrentRelease().getModules().size());
        assertEquals(2, newBean.getCurrentRelease().getModules().iterator().next().getArtifacts().size());
       
        //printFile(filename);
        if (!f.delete()) {
            System.err.println("Failed to delete file");
        }
View Full Code Here


       
        releaseBean = new ReleaseXmlBean("snapshot", release);
       
        releaseBean.addmodule(getCoreModule(release));
       
        channelBean = new ChannelXmlBean();
        channelBean.setName(channel);
        channelBean.setCurrentRelease(releaseBean);
    }
View Full Code Here

     expect(mockFileWrapperFactory.create(pathToDirectoryThatContainsReleaseXml));
     expectLastCall().andReturn(releaseXmlFileDir);
     expect(mockFileWrapperFactory.create(releaseXmlFileDir, UpdateUtil.RELEASE_XML_FILENAME));
     expectLastCall().andReturn(releaseXmlFile);
    
     ChannelXmlBean mockChannelXmlBean = mockHelper.createMock(ChannelXmlBean.class);
    expect(mockSerializer.readChannelBean(releaseXmlFile)).andReturn(mockChannelXmlBean);
    
     mockHelper.replayAll();
    underTest.loadUpdateFromFileSystem(pathToDirectoryThatContainsReleaseXml);
     mockHelper.verifyAll();    
View Full Code Here

    return mockUpdateUtil;
  }

  private ChannelXmlBean setupSnapshotChannelXmlBean(String name)
  {
    ChannelXmlBean mockChannelXmlBean =
      mockHelper.createMock("mock" + name + "ChannelXmlBean", ChannelXmlBean.class);
    ReleaseXmlBean mockReleaseXmlBean =
      mockHelper.createMock("mock" + name + "ReleaseXmlBean", ReleaseXmlBean.class);
    expect(mockChannelXmlBean.getName()).andStubReturn("Snapshot");
    expect(mockChannelXmlBean.getCurrentRelease()).andStubReturn(mockReleaseXmlBean);
    return mockChannelXmlBean;
  }
View Full Code Here

    public void testEquals() {
        ReleaseXmlBean releaseBean1 = new ReleaseXmlBean("snapshot", "Snapshot-20070922_1258");
       
        ReleaseXmlBean releaseBean2 = new ReleaseXmlBean("snapshot", "Snapshot-20070929_1300");
       
        ChannelXmlBean cb1 = new ChannelXmlBean();
        cb1.setName("snapshot");
        cb1.setCurrentRelease(releaseBean1);
       
        ChannelXmlBean cb2 = new ChannelXmlBean();
        cb2.setName("snapshot");
        cb2.setCurrentRelease(releaseBean1);       
       
        ChannelXmlBean cb3 = new ChannelXmlBean();
        cb3.setName("snapshot");
        cb3.setCurrentRelease(releaseBean2);
       
        ChannelXmlBean cb4 = new ChannelXmlBean() {
            private static final long serialVersionUID = 1L;
        };

        new EqualsTester(cb1, cb2, cb3, cb4);
    }
View Full Code Here

   *      java.lang.String, java.lang.String)
   */
  public ChannelXmlBean downloadCurrentRelease(final String host, final int port, final String path,
    final String fileToGet, final IProxySettings proxySettings) throws Exception
  {
    ChannelXmlBean result = null;
    if (s_log.isDebugEnabled())
    {
      s_log.debug("downloadCurrentRelease: host=" + host + " port=" + port + " path=" + path
        + " fileToGet=" + fileToGet);
    }
View Full Code Here

   *           the directory to find release.xml in
   * @return the ChannelXmlBean that represents the specified path.
   */
  public ChannelXmlBean loadUpdateFromFileSystem(final String path)
  {
    ChannelXmlBean result = null;
    try
    {
      FileWrapper f = _fileWrapperFactory.create(path);
      if (!f.isDirectory())
      {
View Full Code Here

  /**
   * @see net.sourceforge.squirrel_sql.client.update.UpdateUtil#getLocalReleaseInfo(java.lang.String)
   */
  public ChannelXmlBean getLocalReleaseInfo(String localReleaseFile)
  {
    ChannelXmlBean result = null;
    if (s_log.isDebugEnabled())
    {
      s_log.debug("Attempting to read local release file: " + localReleaseFile);
    }
    try
View Full Code Here

   */
  private ChannelXmlBean downloadCurrentReleaseHttp(final String host, final int port, final String path,
    final String file, final IProxySettings proxySettings) throws Exception
  {

    ChannelXmlBean result = null;
    InputStream is = null;
    try
    {
      String fileToGet = _pathUtils.buildPath(true, path, file);

View Full Code Here

      }
      return;
    }

    // 2. Load the local release.xml file as a ChannelXmlBean.
    ChannelXmlBean installedChannelBean = _util.getLocalReleaseInfo(releaseFilename);

    // 3. & 3a. Get the release.xml file as a ChannelXmlBean from the server or
    // filesystem.
    ChannelXmlBean currentChannelBean = getCurrentChannelXmlBean(installedChannelBean);

    // Record now as the last time we checked for updates.
    _settings.setLastUpdateCheckTimeMillis("" + currentTimeMillis());
    _app.getSquirrelPreferences().setUpdateSettings(_settings);

    // 5. Is it the same as the local copy, which was placed either by the
    // installer or the last update?
    if (currentChannelBean == null)
    {
      s_log.warn("run: currentChannelBean was null - it is inconclusive whether or not the software "
        + "is current : assuming that it is for now");
      if (_callback != null) {
        _callback.updateCheckFailed(null);
      }
    }
    else
    {
      isUpToDate = currentChannelBean.equals(installedChannelBean);
      if (_callback != null)
      {
        _callback.updateCheckComplete(isUpToDate, installedChannelBean, currentChannelBean);
      }
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.squirrel_sql.client.update.xmlbeans.ChannelXmlBean

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.