@@ -0,0 +1,2698 @@
+/*%0A *    Copyright 2015 West Coast Informatics, LLC%0A */%0Apackage com.wci.umls.server.test.jpa;%0A%0Aimport static org.junit.Assert.assertTrue;%0A%0Aimport org.apache.log4j.Logger;%0Aimport org.junit.After;%0Aimport org.junit.AfterClass;%0Aimport org.junit.Before;%0Aimport org.junit.BeforeClass;%0Aimport org.junit.Test;%0A%0Aimport com.wci.umls.server.ValidationResult;%0Aimport com.wci.umls.server.jpa.algo.maint.LexicalClassAssignmentAlgorithm;%0Aimport com.wci.umls.server.test.helpers.IntegrationUnitSupport;%0A%0A/**%0A * Sample test to get auto complete working.%0A */%0Apublic class LexicalClassAssignmentAlgorithmTest%0A    extends IntegrationUnitSupport %7B%0A%0A  /** The service. */%0A  LexicalClassAssignmentAlgorithm algo = null;%0A%0A  /**%0A   * Setup class.%0A   */%0A  @BeforeClass%0A  public static void setupClass() %7B%0A    // do nothing%0A  %7D%0A%0A  /**%0A   * Setup.%0A   *%0A   * @throws Exception the exception%0A   */%0A  @Before%0A  public void setup() throws Exception %7B%0A%0A    algo = new LexicalClassAssignmentAlgorithm();%0A%0A    // Configure the algorithm%0A    // algo.setActivityId - set by algorithm%0A    // algo.setWorkId - set by algorithm%0A    // algo.setUserName - use default%0A    // algo.setProperties - n/a%0A    algo.setLastModifiedBy(%22admin%22);%0A    algo.setLastModifiedFlag(true);%0A    algo.setProject(algo.getProjects().getObjects().get(0));%0A    algo.setTerminology(%22MTH%22);%0A    algo.setVersion(%22latest%22);%0A%0A  %7D%0A%0A  /**%0A   * Quick test for NCIMTH%0A   *%0A   * @throws Exception the exception%0A   */%0A  @Test%0A  public void quickTest() throws Exception %7B%0A    Logger.getLogger(getClass()).info(%22TEST %22 + name.getMethodName());%0A%0A    algo.setLastModifiedBy(%22admin%22);%0A    algo.setLastModifiedFlag(true);%0A    algo.setProject(algo.getProjects().getObjects().get(0));%0A    algo.setTerminology(%22NCIMTH%22);%0A    algo.setVersion(%22latest%22);%0A    %0A    // Send the whole project through the initializer%0A    try %7B%0A%0A      //%0A      // Check prerequisites%0A      //%0A      ValidationResult validationResult = algo.checkPreconditions();%0A      // if prerequisites fail, return validation result%0A      if (!validationResult.getErrors().isEmpty()%0A          %7C%7C (!validationResult.getWarnings().isEmpty())) %7B%0A        // rollback -- unlocks the concept and closes transaction%0A        algo.rollback();%0A      %7D%0A      assertTrue(validationResult.getErrors().isEmpty());%0A%0A      //%0A      // Perform the algorithm%0A      //%0A      algo.compute();%0A%0A    %7D catch (Exception e) %7B%0A      algo.rollback();%0A    %7D finally %7B%0A      algo.close();%0A    %7D%0A%0A  %7D%0A%0A  /**%0A   * Teardown.%0A   *%0A   * @throws Exception the exception%0A   */%0A  @After%0A  public void teardown() throws Exception %7B%0A    // n/a%0A  %7D%0A%0A  /**%0A   * Teardown class.%0A   */%0A  @AfterClass%0A  public static void teardownClass() %7B%0A    // do nothing%0A  %7D%0A%0A%7D%0A

add test for LUI assignment