Package org.jfx4ee.adm4ee.business.appcast.entity

Examples of org.jfx4ee.adm4ee.business.appcast.entity.Appcast


                if (updateUrl != null && !updateUrl.isEmpty()) {
                    // Fetch remote version
                    String remoteVersion = null;
                    try {
                        logger.log(Level.FINE, "Fetching appcast from update URL ''{0}''...", updateUrl);
                        Appcast appcast = appcastManager.fetch(updateUrl);
                        if (appcast != null) {
                            remoteVersion = appcast.getLatestRemoteVersion();
                        }
                        if (remoteVersion == null) {
                            status = ApplicationStatus.FAILURE;
                            status.setInfo("No version information found");
                        } else {
View Full Code Here


    @Before
    public void init() throws IOException, AppcastException, Exception {
        updater = new Updater(null);
        AppcastManager appcastManagerMock = mock(AppcastManager.class);
        Appcast appcast = new Appcast();
        Channel c = new Channel();
        Item i = new Item();
        Enclosure e = new Enclosure();
        e.setVersion("2.0.4711");
        i.setEnclosure(e);
        List<Item> items = new ArrayList<>();
        items.add(i);
        c.setItems(items);
        appcast.setChannel(c);

        when(appcastManagerMock.fetch(anyString())).thenReturn(appcast);
        when(appcastManagerMock.getLatestRemoteVersion(anyString())).thenReturn("2.0.4711");
        when(appcastManagerMock.getManifestAppcastVersion(any(Path.class))).thenReturn("2.0.1322");
        when(appcastManagerMock.download(any(Appcast.class), any(Path.class))).thenCallRealMethod();
View Full Code Here

   
    @Test
    public void testUpdate() throws Exception {
        try {
            AppcastManagerTest test = new AppcastManagerTest();
            Appcast appcast = test.getAppcast();
            appcast.getChannel().getItems().get(0).getEnclosure().setUrl(getClass().getResource("/WebTest.zip").toURI().toURL().toString());
            appcast.getChannel().getItems().get(0).getEnclosure().setLength(3997);
            Path createdTempDirectory = null;
            try {
                createdTempDirectory = Files.createTempDirectory("ac-");
            } catch (IOException ex) {
                fail(ex.toString());
View Full Code Here

    AppcastManager manager = new AppcastManager();

    @Test
    public void testFetch() {
        Appcast appcast = getAppcast();

        assertNotNull(appcast);
        assertEquals("2.0", appcast.getVersion());

        Channel channel = appcast.getChannel();
        assertNotNull(channel);
        assertNotNull(channel.getLink());
        assertEquals("en", channel.getLanguage());

        List<Item> items = channel.getItems();
View Full Code Here

        assertNull(manifestAppcastUrl);
    }

    @Test
    public void testDownload() throws Exception {
        Appcast appcast = getAppcast();
        appcast.getChannel().getItems().get(0).getEnclosure().setUrl(getClass().getResource("/WebTest.zip").toURI().toURL().toString());
        Path createdTempDirectory = null;
        try {
            createdTempDirectory = Files.createTempDirectory("ac-");
        } catch (IOException ex) {
            fail(ex.toString());
View Full Code Here

        }

    }

    public Appcast getAppcast() {
        Appcast appcast = null;
        try {
            JAXBContext ctx = JAXBContext.newInstance(Appcast.class);
            Unmarshaller um = ctx.createUnmarshaller();
            appcast = (Appcast) um.unmarshal(getClass().getResource("/appcast.xml"));
        } catch (Exception ex) {
View Full Code Here

     * @return The version string
     * @throws AppcastException in case of an error
     */
    public String getLatestRemoteVersion(String url) throws AppcastException {
        String remoteVersion = null;
        Appcast appcast = fetch(url);
        if (appcast != null) {
            remoteVersion = appcast.getLatestRemoteVersion();
        }
        return remoteVersion;
    }
View Full Code Here

                    Path templateApplicationsPath = templatePath.resolve(DOMAIN_APPLICATIONS_DIR);
                    Application application = domain.getApplication(applicationName);
                    if (application != null) {
                        ApplicationStatus status = application.getStatus();
                        if (status != null) {
                            Appcast appcast = status.getAppcast();
                            if (appcast != null) {
                                Set<Path> files = updater.update(applicationName, appcast, templateApplicationsPath);
                                result.setExitCodeOk();
                                result.setResult(files.toString());
                            }
View Full Code Here

TOP

Related Classes of org.jfx4ee.adm4ee.business.appcast.entity.Appcast

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.