From 1bbd3685a3bd141173b0e84fed61e7a026b85338 Mon Sep 17 00:00:00 2001 From: ddunne Date: Mon, 20 Jun 2011 15:47:35 -0700 Subject: refactor: Cleanup and fix production tests --- .../osee/ats/core/AtsCore_Production_Suite.java | 39 ++++++++++++++++++++ .../AtsActionableItemToTeamDefinitionTest.java | 41 +++++++++++++++++++++ .../core/config/AtsCore_Config_Demo_PT_Suite.java | 37 +++++++++++++++++++ .../config/AtsCore_Config_Production_PT_Suite.java | 37 +++++++++++++++++++ .../workdef/AtsCore_WorkDef_Demo_PT_Suite.java | 37 +++++++++++++++++++ .../AtsCore_WorkDef_Production_PT_Suite.java | 37 +++++++++++++++++++ .../workdef/AtsTeamDefintionToWorkflowTest.java | 43 ++++++++++++++++++++++ 7 files changed, 271 insertions(+) create mode 100644 plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/AtsCore_Production_Suite.java create mode 100644 plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/config/AtsActionableItemToTeamDefinitionTest.java create mode 100644 plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/config/AtsCore_Config_Demo_PT_Suite.java create mode 100644 plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/config/AtsCore_Config_Production_PT_Suite.java create mode 100644 plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workdef/AtsCore_WorkDef_Demo_PT_Suite.java create mode 100644 plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workdef/AtsCore_WorkDef_Production_PT_Suite.java create mode 100644 plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workdef/AtsTeamDefintionToWorkflowTest.java (limited to 'plugins/org.eclipse.osee.ats.core.test') diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/AtsCore_Production_Suite.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/AtsCore_Production_Suite.java new file mode 100644 index 00000000000..97d5054c3f9 --- /dev/null +++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/AtsCore_Production_Suite.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2004, 2007 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.core; + +import org.eclipse.osee.ats.core.config.AtsCore_Config_Production_PT_Suite; +import org.eclipse.osee.ats.core.workdef.AtsCore_WorkDef_Production_PT_Suite; +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; + +@RunWith(Suite.class) +@Suite.SuiteClasses({AtsCore_Config_Production_PT_Suite.class, AtsCore_WorkDef_Production_PT_Suite.class}) +/** + * This test suite contains tests that must be run as PDE Junit (PT) through test launch config + * + * @author Donald G. Dunne + */ +public class AtsCore_Production_Suite { + @BeforeClass + public static void setUp() throws Exception { + OseeProperties.setIsInTest(true); + System.out.println("\n\nBegin " + AtsCore_Production_Suite.class.getSimpleName()); + } + + @AfterClass + public static void tearDown() throws Exception { + System.out.println("End " + AtsCore_Production_Suite.class.getSimpleName()); + } +} diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/config/AtsActionableItemToTeamDefinitionTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/config/AtsActionableItemToTeamDefinitionTest.java new file mode 100644 index 00000000000..928a9cd96e6 --- /dev/null +++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/config/AtsActionableItemToTeamDefinitionTest.java @@ -0,0 +1,41 @@ +/******************************************************************************* + * Copyright (c) 2004, 2007 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.core.config; + +import static org.junit.Assert.assertFalse; +import java.util.Arrays; +import org.eclipse.osee.ats.core.type.AtsArtifactTypes; +import org.eclipse.osee.ats.core.util.AtsUtilCore; +import org.eclipse.osee.framework.skynet.core.artifact.Artifact; +import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery; + +/** + * @author Donald G. Dunne + */ +public class AtsActionableItemToTeamDefinitionTest { + + @org.junit.Test + public void testAtsActionableItemToTeamDefinition() throws Exception { + boolean error = false; + StringBuffer sb = new StringBuffer("Actionable Actionable Items with no Team Def associated:\n"); + for (Artifact artifact : ArtifactQuery.getArtifactListFromType(AtsArtifactTypes.ActionableItem, + AtsUtilCore.getAtsBranch())) { + ActionableItemArtifact aia = (ActionableItemArtifact) artifact; + if (aia.isActionable()) { + if (TeamDefinitionManagerCore.getImpactedTeamDefs(Arrays.asList(aia)).isEmpty()) { + sb.append("[" + aia + "]"); + error = true; + } + } + } + assertFalse(sb.toString(), error); + } +} diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/config/AtsCore_Config_Demo_PT_Suite.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/config/AtsCore_Config_Demo_PT_Suite.java new file mode 100644 index 00000000000..5d4c055086d --- /dev/null +++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/config/AtsCore_Config_Demo_PT_Suite.java @@ -0,0 +1,37 @@ +/******************************************************************************* + * Copyright (c) 2004, 2007 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.core.config; + +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; + +@RunWith(Suite.class) +@Suite.SuiteClasses({AtsActionableItemToTeamDefinitionTest.class}) +/** + * This test suite contains tests that must be run against demo database as Plugin JUnit (PT) + * + * @author Donald G. Dunne + */ +public class AtsCore_Config_Demo_PT_Suite { + @BeforeClass + public static void setUp() throws Exception { + OseeProperties.setIsInTest(true); + System.out.println("\n\nBegin " + AtsCore_Config_Demo_PT_Suite.class.getSimpleName()); + } + + @AfterClass + public static void tearDown() throws Exception { + System.out.println("End " + AtsCore_Config_Demo_PT_Suite.class.getSimpleName()); + } +} diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/config/AtsCore_Config_Production_PT_Suite.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/config/AtsCore_Config_Production_PT_Suite.java new file mode 100644 index 00000000000..eeb8e128ee0 --- /dev/null +++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/config/AtsCore_Config_Production_PT_Suite.java @@ -0,0 +1,37 @@ +/******************************************************************************* + * Copyright (c) 2004, 2007 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.core.config; + +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; + +@RunWith(Suite.class) +@Suite.SuiteClasses({AtsActionableItemToTeamDefinitionTest.class}) +/** + * This test suite contains tests that must be run against Production database as Plugin JUnit (PT) + * + * @author Donald G. Dunne + */ +public class AtsCore_Config_Production_PT_Suite { + @BeforeClass + public static void setUp() throws Exception { + OseeProperties.setIsInTest(true); + System.out.println("\n\nBegin " + AtsCore_Config_Production_PT_Suite.class.getSimpleName()); + } + + @AfterClass + public static void tearDown() throws Exception { + System.out.println("End " + AtsCore_Config_Production_PT_Suite.class.getSimpleName()); + } +} diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workdef/AtsCore_WorkDef_Demo_PT_Suite.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workdef/AtsCore_WorkDef_Demo_PT_Suite.java new file mode 100644 index 00000000000..7aad9743791 --- /dev/null +++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workdef/AtsCore_WorkDef_Demo_PT_Suite.java @@ -0,0 +1,37 @@ +/******************************************************************************* + * Copyright (c) 2004, 2007 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.core.workdef; + +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; + +@RunWith(Suite.class) +@Suite.SuiteClasses({AtsTeamDefintionToWorkflowTest.class}) +/** + * This test suite contains tests that must be run against demo database as Plugin JUnit (PT) + * + * @author Donald G. Dunne + */ +public class AtsCore_WorkDef_Demo_PT_Suite { + @BeforeClass + public static void setUp() throws Exception { + OseeProperties.setIsInTest(true); + System.out.println("\n\nBegin " + AtsCore_WorkDef_Demo_PT_Suite.class.getSimpleName()); + } + + @AfterClass + public static void tearDown() throws Exception { + System.out.println("End " + AtsCore_WorkDef_Demo_PT_Suite.class.getSimpleName()); + } +} diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workdef/AtsCore_WorkDef_Production_PT_Suite.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workdef/AtsCore_WorkDef_Production_PT_Suite.java new file mode 100644 index 00000000000..53994ac45b2 --- /dev/null +++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workdef/AtsCore_WorkDef_Production_PT_Suite.java @@ -0,0 +1,37 @@ +/******************************************************************************* + * Copyright (c) 2004, 2007 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.core.workdef; + +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; + +@RunWith(Suite.class) +@Suite.SuiteClasses({AtsTeamDefintionToWorkflowTest.class}) +/** + * This test suite contains tests that must be run against Production database as Plugin JUnit (PT) + * + * @author Donald G. Dunne + */ +public class AtsCore_WorkDef_Production_PT_Suite { + @BeforeClass + public static void setUp() throws Exception { + OseeProperties.setIsInTest(true); + System.out.println("\n\nBegin " + AtsCore_WorkDef_Production_PT_Suite.class.getSimpleName()); + } + + @AfterClass + public static void tearDown() throws Exception { + System.out.println("End " + AtsCore_WorkDef_Production_PT_Suite.class.getSimpleName()); + } +} diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workdef/AtsTeamDefintionToWorkflowTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workdef/AtsTeamDefintionToWorkflowTest.java new file mode 100644 index 00000000000..b52e1409316 --- /dev/null +++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workdef/AtsTeamDefintionToWorkflowTest.java @@ -0,0 +1,43 @@ +/******************************************************************************* + * Copyright (c) 2004, 2007 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.core.workdef; + +import static org.junit.Assert.assertFalse; +import org.eclipse.osee.ats.core.config.TeamDefinitionArtifact; +import org.eclipse.osee.ats.core.type.AtsArtifactTypes; +import org.eclipse.osee.ats.core.util.AtsUtilCore; +import org.eclipse.osee.framework.skynet.core.artifact.Artifact; +import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery; + +/** + * @author Donald G. Dunne + */ +public class AtsTeamDefintionToWorkflowTest { + + @org.junit.Test + public void testTeamDefinitionToWorkflow() throws Exception { + boolean error = false; + StringBuffer sb = new StringBuffer("Actionable Team Definitions with no Work Definition:\n"); + for (Artifact artifact : ArtifactQuery.getArtifactListFromType(AtsArtifactTypes.TeamDefinition, + AtsUtilCore.getAtsBranch())) { + TeamDefinitionArtifact teamDef = (TeamDefinitionArtifact) artifact; + if (teamDef.isActionable()) { + WorkDefinitionMatch match = teamDef.getWorkDefinition(); + if (!match.isMatched()) { + sb.append("[" + teamDef + "]"); + } + error = true; + } + } + assertFalse(sb.toString(), error); + } + +} -- cgit v1.2.3