1 package org.kuali.common.devops.status; 2 3 import static com.google.common.base.Stopwatch.createStarted; 4 import static com.google.common.collect.ImmutableList.of; 5 import static java.lang.String.format; 6 7 import java.util.List; 8 9 import org.junit.Test; 10 import org.kuali.common.devops.metadata.logic.DefaultEnvironmentMetadataService; 11 import org.kuali.common.devops.metadata.logic.EnvironmentMetadataService; 12 import org.kuali.common.devops.metadata.model.EnvironmentMetadata; 13 import org.kuali.common.util.FormatUtils; 14 import org.kuali.common.util.log.LoggerUtils; 15 import org.slf4j.Logger; 16 17 import com.google.common.base.Stopwatch; 18 19 public class MetadataServiceTest { 20 21 private static final Logger logger = LoggerUtils.make(); 22 23 @Test 24 public void test() { 25 try { 26 EnvironmentMetadataService service = new DefaultEnvironmentMetadataService(); 27 List<String> fqdns = of("env1.rice.kuali.org", "env2.rice.kuali.org", "env1.ks.kuali.org", "dev.ole.kuali.org", "dev.docstore.ole.kuali.org", "env3.rice.kuali.org"); 28 Stopwatch sw = createStarted(); 29 List<EnvironmentMetadata> metadata = service.getMetadata(fqdns); 30 logger.info(format("fqdns: %s, elapsed -> %s", metadata.size(), FormatUtils.getTime(sw))); 31 } catch (Throwable e) { 32 e.printStackTrace(); 33 } 34 } 35 36 }