15dd69ba4a3f928d5d21561454347831c33a2249
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
;
27 public class CdmServerInfoTest
extends UnitilsJUnit4
{
30 public void pingServersTest() {
31 List
<CdmServerInfo
> servers
= CdmServerInfo
.getCdmServers();
32 for(CdmServerInfo server
: servers
) {
38 public void pingInstancesTest() {
39 CdmServerInfo csii
= new CdmServerInfo("localhost", "localhost", 8080);
41 csii
.refreshInstances();
42 List
<CdmInstanceInfo
> instances
= csii
.getInstances();
43 for(CdmInstanceInfo instance
: instances
) {
44 Assert
.assertTrue(csii
.pingInstance(instance
));
46 } catch (CDMServerException e
) {
47 Assert
.fail("Execption should not be thrown here");
52 public void refreshWrongInstancesTest() {
53 CdmServerInfo wrongCsii
= new CdmServerInfo("local", "local", 8080);
55 wrongCsii
.refreshInstances();
56 List
<CdmInstanceInfo
> instances
= wrongCsii
.getInstances();
57 Assert
.fail("Execption should be thrown here");
58 } catch (CDMServerException e
) {
59 // TODO Auto-generated catch block