Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto E. Escobar2013-01-11 23:50:43 +0000
committerRoberto E. Escobar2013-01-11 23:50:43 +0000
commit9f8d155bc05e1c1488f11b50f359894b4b0393ab (patch)
tree2ffff7467470a50b27f7f55873a4245f9dd151eb /plugins/org.eclipse.osee.framework.skynet.core.test
parent1e07388ff6b99ab80d0274e2ea536b01668c61e7 (diff)
downloadorg.eclipse.osee-9f8d155bc05e1c1488f11b50f359894b4b0393ab.tar.gz
org.eclipse.osee-9f8d155bc05e1c1488f11b50f359894b4b0393ab.tar.xz
org.eclipse.osee-9f8d155bc05e1c1488f11b50f359894b4b0393ab.zip
feature[ats_DG316]: Add coverage tests to maven
Diffstat (limited to 'plugins/org.eclipse.osee.framework.skynet.core.test')
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/rule/OseeHousekeepingRule.java60
2 files changed, 1 insertions, 62 deletions
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.framework.skynet.core.test/META-INF/MANIFEST.MF
index 81e67ccd6f4..10e9b3667f1 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/META-INF/MANIFEST.MF
@@ -9,8 +9,7 @@ Require-Bundle: org.junit,
org.mockito;bundle-version="1.9.0",
org.hamcrest.core,
org.objenesis
-Export-Package: org.eclipse.osee.framework.skynet.core,
- org.eclipse.osee.framework.skynet.core.rule
+Export-Package: org.eclipse.osee.framework.skynet.core
Import-Package: org.apache.commons.lang;version="2.4.0",
org.eclipse.osee.framework.core.client,
org.eclipse.osee.framework.core.enums,
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/rule/OseeHousekeepingRule.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/rule/OseeHousekeepingRule.java
deleted file mode 100644
index 4b5ac417c74..00000000000
--- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/rule/OseeHousekeepingRule.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.framework.skynet.core.rule;
-
-import java.util.Collection;
-import junit.framework.Assert;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.artifact.ArtifactCache;
-import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
-import org.junit.rules.MethodRule;
-import org.junit.runners.model.FrameworkMethod;
-import org.junit.runners.model.Statement;
-
-/**
- * Not related to {@link org.eclipse.osee.framework.jdk.core.text.Rule}. <br/>
- * <br/>
- * Checks Artifact Cache for dirty artifacts. Executes after a passing test. Fails tests that have passed but left dirty
- * artifacts in the cache. <br/>
- * <br/>
- * In the future the behavior of this class could be modified to clean up after a test, regardless of test context.
- */
-public final class OseeHousekeepingRule implements MethodRule {
-
- private static final String MSG = "\n[%s] of type [%s] found while executing: %s.%s()\nDirty report:[%s]\r\n";
- private static final String DIRTY_ARTIFACTS_IN_ARTIFACT_CACHE =
- OseeHousekeepingRule.class.getSimpleName() + " Dirty artifacts in Artifact Cache:";
-
- @Override
- public Statement apply(final Statement base, final FrameworkMethod method, final Object target) {
- return new Statement() {
- @Override
- public void evaluate() throws Throwable {
- base.evaluate();
- verify(method.getName(), target.getClass().getName());
- }
- };
- }
-
- private void verify(String methodName, String className) throws Throwable {
- final Collection<Artifact> dirtyArtifacts = ArtifactCache.getDirtyArtifacts();
-
- if (!dirtyArtifacts.isEmpty()) {
- StringBuilder entireMessage = new StringBuilder(DIRTY_ARTIFACTS_IN_ARTIFACT_CACHE.length() + MSG.length() * 2);
- entireMessage.append(DIRTY_ARTIFACTS_IN_ARTIFACT_CACHE);
- for (Artifact artifact : dirtyArtifacts) {
- entireMessage.append(String.format(MSG, artifact.getName(), artifact.getArtifactType(), className,
- methodName, Artifacts.getDirtyReport(artifact)));
- }
- Assert.fail(entireMessage.toString());
- }
- }
-}

Back to the top