@@ -0,0 +1,1948 @@
+/**%0A * Copyright (C) 2013 - present by OpenGamma Inc. and the OpenGamma group of companies%0A * %0A * Please see distribution for license.%0A */%0Apackage com.opengamma.integration.viewer.status;%0A%0Aimport static org.testng.AssertJUnit.assertEquals;%0Aimport static org.testng.AssertJUnit.assertNotNull;%0A%0Aimport org.apache.commons.cli.CommandLineParser;%0Aimport org.apache.commons.cli.Options;%0Aimport org.apache.commons.cli.PosixParser;%0Aimport org.testng.annotations.Test;%0A%0Aimport com.opengamma.OpenGammaRuntimeException;%0Aimport com.opengamma.livedata.UserPrincipal;%0Aimport com.opengamma.util.test.TestGroup;%0A%0A/**%0A * Tests %7B@link ViewStatusOption%7D%0A */%0A@Test(groups = TestGroup.UNIT)%0Apublic class ViewStatusOptionTest %7B%0A  %0A  private static final Options s_options = ViewStatusOption.createOptions();%0A  private static final CommandLineParser s_parser = new PosixParser();%0A%0A  public void defaultUser() throws Exception %7B%0A    String%5B%5D args = %7B%22-n%22, %22PORTFOLIO_NAME%22%7D;%0A    %0A    ViewStatusOption statusOption = ViewStatusOption.getViewStatusReporterOption(s_parser.parse(s_options, args));%0A    assertNotNull(statusOption);%0A    assertNotNull(statusOption.getUser());%0A    assertEquals(UserPrincipal.getLocalUser(), statusOption.getUser());%0A  %7D%0A  %0A  public void userOption() throws Exception %7B%0A    String%5B%5D args = %7B%22-n%22, %22PORTFOLIO_NAME%22, %22-u%22, %22test/127.0.0.1%22%7D;%0A    ViewStatusOption statusOption = ViewStatusOption.getViewStatusReporterOption(s_parser.parse(s_options, args));%0A    assertNotNull(statusOption);%0A    assertNotNull(statusOption.getUser());%0A    assertEquals(%22test%22, statusOption.getUser().getUserName());%0A    assertEquals(%22127.0.0.1%22, statusOption.getUser().getIpAddress());%0A  %7D%0A  %0A  @Test(expectedExceptions = OpenGammaRuntimeException.class)%0A  public void invalidUserOption() throws Exception %7B%0A    String%5B%5D args = %7B%22-n%22, %22PORTFOLIO_NAME%22, %22-u%22, %22test~127.0.0.1%22%7D;%0A    ViewStatusOption.getViewStatusReporterOption(s_parser.parse(s_options, args));%0A  %7D%0A%7D%0A

Add unit testcase for ViewStatusOption