From 591224f3d1942c0f9baffac2f954d66ced185833 Mon Sep 17 00:00:00 2001 From: donald.g.dunne Date: Tue, 8 Oct 2013 11:05:15 -0700 Subject: feature[ats_S5JDQ]: Move AtsLog to ats.core Change-Id: Ic6db75135a67fe2ab433ba9dd1aeed1e3d7ad450 --- .../AtsClient_Integration_TestSuite.launch | 6 +- .../integration/tests/ats/AtsTest_Ats_Suite.java | 2 - .../tests/ats/artifact/log/AtsLogTest.java | 70 ----------------- .../tests/ats/artifact/log/AtsTest_Log_Suite.java | 38 ---------- .../tests/ats/artifact/log/LogItemTest.java | 88 ---------------------- 5 files changed, 3 insertions(+), 201 deletions(-) delete mode 100644 plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/artifact/log/AtsLogTest.java delete mode 100644 plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/artifact/log/AtsTest_Log_Suite.java delete mode 100644 plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/artifact/log/LogItemTest.java (limited to 'plugins/org.eclipse.osee.ats.client.integration.tests') diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/AtsClient_Integration_TestSuite.launch b/plugins/org.eclipse.osee.ats.client.integration.tests/AtsClient_Integration_TestSuite.launch index 0e3be9f995b..6ce7ed42690 100644 --- a/plugins/org.eclipse.osee.ats.client.integration.tests/AtsClient_Integration_TestSuite.launch +++ b/plugins/org.eclipse.osee.ats.client.integration.tests/AtsClient_Integration_TestSuite.launch @@ -1,9 +1,9 @@ - - - + + + diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/AtsTest_Ats_Suite.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/AtsTest_Ats_Suite.java index 9b7d53e6e69..efc426216ef 100644 --- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/AtsTest_Ats_Suite.java +++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/AtsTest_Ats_Suite.java @@ -12,7 +12,6 @@ package org.eclipse.osee.ats.client.integration.tests.ats; import org.eclipse.osee.ats.client.integration.tests.ats.access.AtsTest_Access_Suite; import org.eclipse.osee.ats.client.integration.tests.ats.actions.AtsTest_Action_Suite; -import org.eclipse.osee.ats.client.integration.tests.ats.artifact.log.AtsTest_Log_Suite; import org.eclipse.osee.ats.client.integration.tests.ats.column.AtsTest_Column_Suite; import org.eclipse.osee.ats.client.integration.tests.ats.config.AtsTest_Config_Suite; import org.eclipse.osee.ats.client.integration.tests.ats.editor.AtsTest_Editor_Suite; @@ -38,7 +37,6 @@ import org.junit.runners.Suite; @Suite.SuiteClasses({ AtsTest_Access_Suite.class, AtsTest_Action_Suite.class, - AtsTest_Log_Suite.class, AtsTest_Column_Suite.class, AtsTest_Config_Suite.class, AtsTest_Editor_Suite.class, diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/artifact/log/AtsLogTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/artifact/log/AtsLogTest.java deleted file mode 100644 index 0ff02fe4dc2..00000000000 --- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/artifact/log/AtsLogTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ats.client.integration.tests.ats.artifact.log; - -import java.util.Date; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.osee.ats.core.client.workflow.log.AtsLog; -import org.eclipse.osee.ats.core.client.workflow.log.ILogStorageProvider; -import org.eclipse.osee.ats.core.client.workflow.log.LogItem; -import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.jdk.core.util.GUID; -import org.junit.Assert; -import org.junit.Test; - -/** - * @author Donald G. Dunne - */ -public class AtsLogTest { - - @Test - public void testToAndFromStore() throws OseeCoreException { - Date date = new Date(); - SimpleLogStore store = new SimpleLogStore(); - AtsLog log = new AtsLog(store); - LogItem item = LogItemTest.getTestLogItem(date); - log.addLogItem(item); - - AtsLog log2 = new AtsLog(store); - Assert.assertEquals(1, log2.getLogItems().size()); - LogItem loadItem = log2.getLogItems().iterator().next(); - LogItemTest.validateItem(loadItem, date); - } - - public class SimpleLogStore implements ILogStorageProvider { - - String store = ""; - - @Override - public String getLogXml() { - return store; - } - - @Override - public IStatus saveLogXml(String xml) { - store = xml; - return Status.OK_STATUS; - } - - @Override - public String getLogTitle() { - return "This is the title"; - } - - @Override - public String getLogId() { - return GUID.create(); - } - - } - -} diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/artifact/log/AtsTest_Log_Suite.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/artifact/log/AtsTest_Log_Suite.java deleted file mode 100644 index 62bcb154110..00000000000 --- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/artifact/log/AtsTest_Log_Suite.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ats.client.integration.tests.ats.artifact.log; - -import org.eclipse.osee.ats.client.integration.tests.util.DemoTestUtil; -import org.eclipse.osee.framework.jdk.core.util.OseeProperties; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * @author Roberto E. Escobar - */ -@RunWith(Suite.class) -@Suite.SuiteClasses({AtsLogTest.class, LogItemTest.class}) -public class AtsTest_Log_Suite { - - @BeforeClass - public static void setUp() throws Exception { - OseeProperties.setIsInTest(true); - System.out.println("\n\nBegin " + AtsTest_Log_Suite.class.getSimpleName()); - DemoTestUtil.setUpTest(); - } - - @AfterClass - public static void tearDown() throws Exception { - System.out.println("End " + AtsTest_Log_Suite.class.getSimpleName()); - } -} diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/artifact/log/LogItemTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/artifact/log/LogItemTest.java deleted file mode 100644 index ba5bc08b16a..00000000000 --- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/artifact/log/LogItemTest.java +++ /dev/null @@ -1,88 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ats.client.integration.tests.ats.artifact.log; - -import java.util.Date; -import org.eclipse.osee.ats.client.integration.tests.AtsClientService; -import org.eclipse.osee.ats.core.client.workflow.log.LogItem; -import org.eclipse.osee.ats.core.client.workflow.log.LogType; -import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.jdk.core.util.AHTML; -import org.eclipse.osee.framework.jdk.core.util.DateUtil; -import org.junit.Assert; -import org.junit.Test; - -/** - * @author Donald G. Dunne - */ -public class LogItemTest { - - @Test - public void testLogItemLogTypeDateUserStringStringString() throws OseeCoreException { - Date date = new Date(); - LogItem item = getTestLogItem(date); - - validateItem(item, date); - } - - public static void validateItem(LogItem item, Date date) throws OseeCoreException { - Assert.assertEquals(LogType.Error, item.getType()); - Assert.assertEquals(date, item.getDate()); - Assert.assertEquals(AtsClientService.get().getUserAdmin().getCurrentUser(), item.getUser()); - Assert.assertEquals(AtsClientService.get().getUserAdmin().getCurrentUser().getUserId(), item.getUserId()); - Assert.assertEquals("Analyze", item.getState()); - Assert.assertEquals("my msg", item.getMsg()); - } - - @Test - public void testLogItemLogTypeStringStringStringStringString() throws OseeCoreException { - Date date = new Date(); - LogItem item = - new LogItem(LogType.Error, String.valueOf(date.getTime()), AtsClientService.get().getUserAdmin().getCurrentUser().getUserId(), "Analyze", - "my msg", "ASDF4"); - - validateItem(item, date); - } - - @Test - public void testLogItemStringStringStringStringStringString() throws OseeCoreException { - Date date = new Date(); - LogItem item = - new LogItem(LogType.Error.name(), String.valueOf(date.getTime()), AtsClientService.get().getUserAdmin().getCurrentUser().getUserId(), - "Analyze", "my msg", "ASDF4"); - - validateItem(item, date); - } - - public static LogItem getTestLogItem(Date date) throws OseeCoreException { - return new LogItem(LogType.Error, date, AtsClientService.get().getUserAdmin().getCurrentUser(), "Analyze", "my msg", "ASDF4"); - } - - @Test - public void testToString() throws OseeCoreException { - Date date = new Date(); - LogItem item = getTestLogItem(date); - - Assert.assertEquals( - "my msg (Error)from Analyze by " + AtsClientService.get().getUserAdmin().getCurrentUser().getName() + " on " + DateUtil.getMMDDYYHHMM(date), - item.toString()); - } - - @Test - public void testToHTML() throws OseeCoreException { - Date date = new Date(); - LogItem item = getTestLogItem(date); - - Assert.assertEquals("NOTE (Error): my msg (" + AtsClientService.get().getUserAdmin().getCurrentUser().getName() + ")", - item.toHTML(AHTML.LABEL_FONT)); - } - -} -- cgit v1.2.3