@Test public void testInitIdentifier() throws Exception { DroneInit simpleDrone = new DroneInit(); Assert.assertThat(simpleDrone.getIdentifier(), isUUID()); environmentVariables.set("HOSTNAME", "HOSTNAME"); simpleDrone = new DroneInit(); Assert.assertThat(simpleDrone.getIdentifier(), is("HOSTNAME")); environmentVariables.set("COMPUTERNAME", "COMPUTERNAME"); simpleDrone = new DroneInit(); Assert.assertThat(simpleDrone.getIdentifier(), is("COMPUTERNAME")); environmentVariables.set("DRONENAME", "DRONENAME"); simpleDrone = new DroneInit(); Assert.assertThat(simpleDrone.getIdentifier(), is("DRONENAME")); }
public void initIdentifier() { Map<String, String> env = System.getenv(); if (env.containsKey("DRONENAME")) this.setIdentifier(env.get("DRONENAME")); else if (env.containsKey("COMPUTERNAME")) this.setIdentifier(env.get("COMPUTERNAME")); else if (env.containsKey("HOSTNAME")) this.setIdentifier(env.get("HOSTNAME")); else this.setIdentifier(UUID.randomUUID().toString()); }
DroneInit { public void initIdentifier() { Map<String, String> env = System.getenv(); if (env.containsKey("DRONENAME")) this.setIdentifier(env.get("DRONENAME")); else if (env.containsKey("COMPUTERNAME")) this.setIdentifier(env.get("COMPUTERNAME")); else if (env.containsKey("HOSTNAME")) this.setIdentifier(env.get("HOSTNAME")); else this.setIdentifier(UUID.randomUUID().toString()); } }
DroneInit { public void initIdentifier() { Map<String, String> env = System.getenv(); if (env.containsKey("DRONENAME")) this.setIdentifier(env.get("DRONENAME")); else if (env.containsKey("COMPUTERNAME")) this.setIdentifier(env.get("COMPUTERNAME")); else if (env.containsKey("HOSTNAME")) this.setIdentifier(env.get("HOSTNAME")); else this.setIdentifier(UUID.randomUUID().toString()); } DroneInit(String identifier, Discoverer discoverer, Instance registeredInstance);  DroneInit(); }
DroneInit { public void initIdentifier() { Map<String, String> env = System.getenv(); if (env.containsKey("DRONENAME")) this.setIdentifier(env.get("DRONENAME")); else if (env.containsKey("COMPUTERNAME")) this.setIdentifier(env.get("COMPUTERNAME")); else if (env.containsKey("HOSTNAME")) this.setIdentifier(env.get("HOSTNAME")); else this.setIdentifier(UUID.randomUUID().toString()); } DroneInit(String identifier, Discoverer discoverer, Instance registeredInstance);  DroneInit(); String getIdentifier(); void setIdentifier(String identifier); static Logger getLog(); Discoverer getDiscoverer(); void setDiscoverer(Discoverer discoverer); Instance getRegisteredInstance(); void setRegisteredInstance(Instance registeredInstance); void start(); void stop(); String getTeamname(); void initIdentifier(); }
DroneInit { public void initIdentifier() { Map<String, String> env = System.getenv(); if (env.containsKey("DRONENAME")) this.setIdentifier(env.get("DRONENAME")); else if (env.containsKey("COMPUTERNAME")) this.setIdentifier(env.get("COMPUTERNAME")); else if (env.containsKey("HOSTNAME")) this.setIdentifier(env.get("HOSTNAME")); else this.setIdentifier(UUID.randomUUID().toString()); } DroneInit(String identifier, Discoverer discoverer, Instance registeredInstance);  DroneInit(); String getIdentifier(); void setIdentifier(String identifier); static Logger getLog(); Discoverer getDiscoverer(); void setDiscoverer(Discoverer discoverer); Instance getRegisteredInstance(); void setRegisteredInstance(Instance registeredInstance); void start(); void stop(); String getTeamname(); void initIdentifier();  }