3 * Copyright (C) 2015 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.ui
.dialogs
;
12 import java
.util
.List
;
14 import org
.junit
.Assert
;
15 import org
.junit
.Test
;
16 import org
.unitils
.UnitilsJUnit4
;
18 import eu
.etaxonomy
.taxeditor
.remoting
.server
.CDMServerException
;
19 import eu
.etaxonomy
.taxeditor
.remoting
.source
.CdmServerInfo
;
20 import eu
.etaxonomy
.taxeditor
.remoting
.source
.CdmServerInfo
.CdmInstanceInfo
;
28 public class CdmServerInfoTest
extends UnitilsJUnit4
{
31 public void pingServersTest() {
32 List
<CdmServerInfo
> servers
= CdmServerInfo
.getCdmServers();
33 for(CdmServerInfo server
: servers
) {
40 public void pingInstancesTest() {
41 CdmServerInfo csii
= new CdmServerInfo("edit-test", "test.e-taxonomy.eu", 8080);
43 csii
.refreshInstances();
44 List
<CdmInstanceInfo
> instances
= csii
.getInstances();
45 for(CdmInstanceInfo instance
: instances
) {
46 Assert
.assertTrue(csii
.pingInstance(instance
, 8080));
48 } catch (CDMServerException e
) {
49 Assert
.fail("Execption should not be thrown here");
54 public void refreshWrongInstancesTest() {
55 CdmServerInfo wrongCsii
= new CdmServerInfo("local", "local", 8080);
57 wrongCsii
.refreshInstances();
58 List
<CdmInstanceInfo
> instances
= wrongCsii
.getInstances();
59 Assert
.fail("Execption should be thrown here");
60 } catch (CDMServerException e
) {
66 public void refreshInstancesTest() throws CDMServerException
{
67 CdmServerInfo cdmServerInfo
= new CdmServerInfo("edit-test", "test.e-taxonomy.eu", 8080);
68 cdmServerInfo
.refreshInstances();
69 List
<CdmInstanceInfo
> instances
= cdmServerInfo
.getInstances();
70 Assert
.assertTrue(instances
!= null && !instances
.isEmpty());
74 public void convertToServerConfigTest() {