diff options
author | rbrooks | 2010-07-24 08:02:08 +0000 |
---|---|---|
committer | rbrooks | 2010-07-24 08:02:08 +0000 |
commit | 4ed8bddc791fda93940f238c5135556a07041dc0 (patch) | |
tree | 64a118285c5006c3a38320dbb2d374e8ea72a061 /plugins/org.eclipse.osee.framework.lifecycle.test/src/org | |
parent | 542cc7344d3f129d64e47f547384297c8e1b1f43 (diff) | |
download | org.eclipse.osee-4ed8bddc791fda93940f238c5135556a07041dc0.tar.gz org.eclipse.osee-4ed8bddc791fda93940f238c5135556a07041dc0.tar.xz org.eclipse.osee-4ed8bddc791fda93940f238c5135556a07041dc0.zip |
converted all line terminators to unix style
Diffstat (limited to 'plugins/org.eclipse.osee.framework.lifecycle.test/src/org')
10 files changed, 415 insertions, 415 deletions
diff --git a/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/AllLifecycleTestSuite.java b/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/AllLifecycleTestSuite.java index 9118387bd5f..cfccf5ddf9a 100644 --- a/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/AllLifecycleTestSuite.java +++ b/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/AllLifecycleTestSuite.java @@ -8,16 +8,16 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.framework.lifecycle.test;
-
-import org.eclipse.osee.framework.lifecycle.test.internal.InternalLifecycleTestSuite;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses( { //
-InternalLifecycleTestSuite.class, //
-})
-public class AllLifecycleTestSuite {
-
-}
+package org.eclipse.osee.framework.lifecycle.test; + +import org.eclipse.osee.framework.lifecycle.test.internal.InternalLifecycleTestSuite; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +@RunWith(Suite.class) +@Suite.SuiteClasses( { // +InternalLifecycleTestSuite.class, // +}) +public class AllLifecycleTestSuite { + +} diff --git a/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/internal/InternalLifecycleTestSuite.java b/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/internal/InternalLifecycleTestSuite.java index 2f17d11c34e..4eb8d62556a 100644 --- a/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/internal/InternalLifecycleTestSuite.java +++ b/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/internal/InternalLifecycleTestSuite.java @@ -8,16 +8,16 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.framework.lifecycle.test.internal;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses({ //
-LifecycleServiceTest.class, //
- LifecycleOperationTest.class, //
-})
-public class InternalLifecycleTestSuite {
-
-}
+package org.eclipse.osee.framework.lifecycle.test.internal; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +@RunWith(Suite.class) +@Suite.SuiteClasses({ // +LifecycleServiceTest.class, // + LifecycleOperationTest.class, // +}) +public class InternalLifecycleTestSuite { + +} diff --git a/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/internal/LifecycleOperationTest.java b/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/internal/LifecycleOperationTest.java index b80121615c5..97f1a077619 100644 --- a/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/internal/LifecycleOperationTest.java +++ b/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/internal/LifecycleOperationTest.java @@ -1,59 +1,59 @@ -/*******************************************************************************
- * 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.framework.lifecycle.test.internal;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.operation.IOperation;
-import org.eclipse.osee.framework.core.operation.LogProgressMonitor;
-import org.eclipse.osee.framework.core.operation.Operations;
-import org.eclipse.osee.framework.lifecycle.AbstractLifecycleOperation;
-import org.eclipse.osee.framework.lifecycle.ILifecycleService;
-import org.eclipse.osee.framework.lifecycle.LifecycleServiceImpl;
-import org.eclipse.osee.framework.lifecycle.test.mock.MockHandler;
-import org.eclipse.osee.framework.lifecycle.test.mock.StrictMockLifecycePoint;
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- * Test Case for {@link AbstractLifecycleOperation}
- *
- * @author Roberto E. Escobar
- * @author Jeff C. Phillips
- */
-public class LifecycleOperationTest {
-
- @Test
- public void testOperation() throws OseeCoreException {
- ILifecycleService service = new LifecycleServiceImpl();
-
- service.addHandler(StrictMockLifecycePoint.TYPE, new MockHandler());
-
- IOperation op = new MockLifecycleOperation(service, "a string", "b string");
- Operations.executeWork(op, new LogProgressMonitor(), -1.0);
-
- IStatus status = op.getStatus();
- Assert.assertTrue(status.isOK());
- }
-
- private static class MockLifecycleOperation extends AbstractLifecycleOperation {
-
- public MockLifecycleOperation(ILifecycleService service, String a, String b) {
- super(service, new StrictMockLifecycePoint(a, b), "Mock Op", "TestBundle");
- }
-
- @Override
- protected void doCoreWork(IProgressMonitor monitor) throws Exception {
- }
- }
-
-}
+/******************************************************************************* + * 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.framework.lifecycle.test.internal; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.osee.framework.core.exception.OseeCoreException; +import org.eclipse.osee.framework.core.operation.IOperation; +import org.eclipse.osee.framework.core.operation.LogProgressMonitor; +import org.eclipse.osee.framework.core.operation.Operations; +import org.eclipse.osee.framework.lifecycle.AbstractLifecycleOperation; +import org.eclipse.osee.framework.lifecycle.ILifecycleService; +import org.eclipse.osee.framework.lifecycle.LifecycleServiceImpl; +import org.eclipse.osee.framework.lifecycle.test.mock.MockHandler; +import org.eclipse.osee.framework.lifecycle.test.mock.StrictMockLifecycePoint; +import org.junit.Assert; +import org.junit.Test; + +/** + * Test Case for {@link AbstractLifecycleOperation} + * + * @author Roberto E. Escobar + * @author Jeff C. Phillips + */ +public class LifecycleOperationTest { + + @Test + public void testOperation() throws OseeCoreException { + ILifecycleService service = new LifecycleServiceImpl(); + + service.addHandler(StrictMockLifecycePoint.TYPE, new MockHandler()); + + IOperation op = new MockLifecycleOperation(service, "a string", "b string"); + Operations.executeWork(op, new LogProgressMonitor(), -1.0); + + IStatus status = op.getStatus(); + Assert.assertTrue(status.isOK()); + } + + private static class MockLifecycleOperation extends AbstractLifecycleOperation { + + public MockLifecycleOperation(ILifecycleService service, String a, String b) { + super(service, new StrictMockLifecycePoint(a, b), "Mock Op", "TestBundle"); + } + + @Override + protected void doCoreWork(IProgressMonitor monitor) throws Exception { + } + } + +} diff --git a/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/internal/LifecycleServiceTest.java b/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/internal/LifecycleServiceTest.java index ccae4cca149..d6d544c5bd5 100644 --- a/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/internal/LifecycleServiceTest.java +++ b/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/internal/LifecycleServiceTest.java @@ -1,71 +1,71 @@ -/*******************************************************************************
- * 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.framework.lifecycle.test.internal;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.lifecycle.AbstractLifecycleVisitor;
-import org.eclipse.osee.framework.lifecycle.ILifecycleService;
-import org.eclipse.osee.framework.lifecycle.LifecycleServiceImpl;
-import org.eclipse.osee.framework.lifecycle.test.mock.AnotherMockHandler;
-import org.eclipse.osee.framework.lifecycle.test.mock.AnotherMockLifecycePoint;
-import org.eclipse.osee.framework.lifecycle.test.mock.MockHandler;
-import org.eclipse.osee.framework.lifecycle.test.mock.MockLifecycePoint;
-import org.eclipse.osee.framework.lifecycle.test.mock.NonRunHandler;
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- * Test Case for {@link LifecycleServiceImpl}
- *
- * @author Roberto E. Escobar
- * @author Jeff C. Phillips
- */
-public class LifecycleServiceTest {
-
- @Test
- public void testAccess() throws OseeCoreException {
- ILifecycleService lifecycleServices = new LifecycleServiceImpl();
- Assert.assertTrue(lifecycleServices.getHandlerTypes().isEmpty());
-
- MockHandler mockHandler = new MockHandler();
- AnotherMockHandler anotherMockHandler = new AnotherMockHandler();
- NonRunHandler nonRunHandler = new NonRunHandler();
-
- lifecycleServices.addHandler(MockLifecycePoint.TYPE, mockHandler);
- lifecycleServices.addHandler(MockLifecycePoint.TYPE, anotherMockHandler);
- lifecycleServices.addHandler(AnotherMockLifecycePoint.TYPE, nonRunHandler);
-
- Assert.assertEquals(2, lifecycleServices.getHandlerCount(MockLifecycePoint.TYPE));
- Assert.assertFalse(lifecycleServices.getHandlerTypes().isEmpty());
-
- Assert.assertFalse(mockHandler.hasRan());
- Assert.assertFalse(anotherMockHandler.hasRan());
- Assert.assertFalse(nonRunHandler.hasRan());
-
- //Execute the handlers
- AbstractLifecycleVisitor<?> accessPoint = new MockLifecycePoint("one", "two");
- IStatus status = lifecycleServices.dispatch(new NullProgressMonitor(), accessPoint, "");
- Assert.assertTrue(status.isOK());
-
- Assert.assertTrue(mockHandler.hasRan());
- Assert.assertTrue(anotherMockHandler.hasRan());
- Assert.assertFalse(nonRunHandler.hasRan());
-
- lifecycleServices.removeHandler(MockLifecycePoint.TYPE, mockHandler);
- lifecycleServices.removeHandler(MockLifecycePoint.TYPE, anotherMockHandler);
- lifecycleServices.removeHandler(AnotherMockLifecycePoint.TYPE, nonRunHandler);
- //Check that everything cleaned up
- Assert.assertTrue(lifecycleServices.getHandlerTypes().isEmpty());
- Assert.assertEquals(0, lifecycleServices.getHandlerCount(MockLifecycePoint.TYPE));
- }
-}
+/******************************************************************************* + * 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.framework.lifecycle.test.internal; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.osee.framework.core.exception.OseeCoreException; +import org.eclipse.osee.framework.lifecycle.AbstractLifecycleVisitor; +import org.eclipse.osee.framework.lifecycle.ILifecycleService; +import org.eclipse.osee.framework.lifecycle.LifecycleServiceImpl; +import org.eclipse.osee.framework.lifecycle.test.mock.AnotherMockHandler; +import org.eclipse.osee.framework.lifecycle.test.mock.AnotherMockLifecycePoint; +import org.eclipse.osee.framework.lifecycle.test.mock.MockHandler; +import org.eclipse.osee.framework.lifecycle.test.mock.MockLifecycePoint; +import org.eclipse.osee.framework.lifecycle.test.mock.NonRunHandler; +import org.junit.Assert; +import org.junit.Test; + +/** + * Test Case for {@link LifecycleServiceImpl} + * + * @author Roberto E. Escobar + * @author Jeff C. Phillips + */ +public class LifecycleServiceTest { + + @Test + public void testAccess() throws OseeCoreException { + ILifecycleService lifecycleServices = new LifecycleServiceImpl(); + Assert.assertTrue(lifecycleServices.getHandlerTypes().isEmpty()); + + MockHandler mockHandler = new MockHandler(); + AnotherMockHandler anotherMockHandler = new AnotherMockHandler(); + NonRunHandler nonRunHandler = new NonRunHandler(); + + lifecycleServices.addHandler(MockLifecycePoint.TYPE, mockHandler); + lifecycleServices.addHandler(MockLifecycePoint.TYPE, anotherMockHandler); + lifecycleServices.addHandler(AnotherMockLifecycePoint.TYPE, nonRunHandler); + + Assert.assertEquals(2, lifecycleServices.getHandlerCount(MockLifecycePoint.TYPE)); + Assert.assertFalse(lifecycleServices.getHandlerTypes().isEmpty()); + + Assert.assertFalse(mockHandler.hasRan()); + Assert.assertFalse(anotherMockHandler.hasRan()); + Assert.assertFalse(nonRunHandler.hasRan()); + + //Execute the handlers + AbstractLifecycleVisitor<?> accessPoint = new MockLifecycePoint("one", "two"); + IStatus status = lifecycleServices.dispatch(new NullProgressMonitor(), accessPoint, ""); + Assert.assertTrue(status.isOK()); + + Assert.assertTrue(mockHandler.hasRan()); + Assert.assertTrue(anotherMockHandler.hasRan()); + Assert.assertFalse(nonRunHandler.hasRan()); + + lifecycleServices.removeHandler(MockLifecycePoint.TYPE, mockHandler); + lifecycleServices.removeHandler(MockLifecycePoint.TYPE, anotherMockHandler); + lifecycleServices.removeHandler(AnotherMockLifecycePoint.TYPE, nonRunHandler); + //Check that everything cleaned up + Assert.assertTrue(lifecycleServices.getHandlerTypes().isEmpty()); + Assert.assertEquals(0, lifecycleServices.getHandlerCount(MockLifecycePoint.TYPE)); + } +} diff --git a/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/mock/AnotherMockHandler.java b/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/mock/AnotherMockHandler.java index 72321c028c1..1f44f2b8b8d 100644 --- a/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/mock/AnotherMockHandler.java +++ b/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/mock/AnotherMockHandler.java @@ -1,22 +1,22 @@ -/*******************************************************************************
- * 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.framework.lifecycle.test.mock;
-
-/**
- * @author Jeff C. Phillips
- */
-public class AnotherMockHandler extends MockHandler {
-
- @Override
- public void doSomething() {
- hasRan = true;
- }
-}
+/******************************************************************************* + * 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.framework.lifecycle.test.mock; + +/** + * @author Jeff C. Phillips + */ +public class AnotherMockHandler extends MockHandler { + + @Override + public void doSomething() { + hasRan = true; + } +} diff --git a/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/mock/AnotherMockLifecycePoint.java b/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/mock/AnotherMockLifecycePoint.java index 4148996c406..a266ef10767 100644 --- a/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/mock/AnotherMockLifecycePoint.java +++ b/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/mock/AnotherMockLifecycePoint.java @@ -1,34 +1,34 @@ -/*******************************************************************************
- * 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.framework.lifecycle.test.mock;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.osee.framework.lifecycle.AbstractLifecycleVisitor;
-
-/**
- * @author Roberto E. Escobar
- * @author Jeff C. Phillips
- */
-public class AnotherMockLifecycePoint extends AbstractLifecycleVisitor<NonRunHandler> {
-
- public static final Type<NonRunHandler> TYPE = new Type<NonRunHandler>();
-
- @Override
- public Type<NonRunHandler> getAssociatedType() {
- return TYPE;
- }
-
- @Override
- protected IStatus dispatch(IProgressMonitor monitor, NonRunHandler handler, String sourceId) {
- return handler.onCheck(monitor);
- }
+/******************************************************************************* + * 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.framework.lifecycle.test.mock; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.osee.framework.lifecycle.AbstractLifecycleVisitor; + +/** + * @author Roberto E. Escobar + * @author Jeff C. Phillips + */ +public class AnotherMockLifecycePoint extends AbstractLifecycleVisitor<NonRunHandler> { + + public static final Type<NonRunHandler> TYPE = new Type<NonRunHandler>(); + + @Override + public Type<NonRunHandler> getAssociatedType() { + return TYPE; + } + + @Override + protected IStatus dispatch(IProgressMonitor monitor, NonRunHandler handler, String sourceId) { + return handler.onCheck(monitor); + } }
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/mock/MockHandler.java b/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/mock/MockHandler.java index 0e8332fe42a..7fc6d934cd8 100644 --- a/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/mock/MockHandler.java +++ b/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/mock/MockHandler.java @@ -1,81 +1,81 @@ -/*******************************************************************************
- * 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.framework.lifecycle.test.mock;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.osee.framework.lifecycle.LifecycleOpHandler;
-
-/**
- * @author Roberto E. Escobar
- * @author Jeff C. Phillips
- */
-public class MockHandler implements LifecycleOpHandler {
-
- private String a;
- private String b;
- private IStatus status;
- boolean hasRan;
-
- public MockHandler() {
- this.status = Status.OK_STATUS;
- this.hasRan = false;
- }
-
- public void setData(String a, String b) {
- this.a = a;
- this.b = b;
- }
-
- public String getA() {
- return a;
- }
-
- public String getB() {
- return b;
- }
-
- public void setStatus(IStatus status) {
- this.status = status;
- }
-
- public IStatus getStatus() {
- return status;
- }
-
- @Override
- public IStatus onCheck(IProgressMonitor monitor) {
- hasRan = true;
- return status;
- }
-
- @Override
- public IStatus onPostCondition(IProgressMonitor monitor) {
- hasRan = true;
- return status;
- }
-
- @Override
- public IStatus onPreCondition(IProgressMonitor monitor) {
- hasRan = true;
- return status;
- }
-
- public void doSomething() {
- hasRan = true;
- }
-
- public boolean hasRan() {
- return hasRan;
- }
+/******************************************************************************* + * 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.framework.lifecycle.test.mock; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.osee.framework.lifecycle.LifecycleOpHandler; + +/** + * @author Roberto E. Escobar + * @author Jeff C. Phillips + */ +public class MockHandler implements LifecycleOpHandler { + + private String a; + private String b; + private IStatus status; + boolean hasRan; + + public MockHandler() { + this.status = Status.OK_STATUS; + this.hasRan = false; + } + + public void setData(String a, String b) { + this.a = a; + this.b = b; + } + + public String getA() { + return a; + } + + public String getB() { + return b; + } + + public void setStatus(IStatus status) { + this.status = status; + } + + public IStatus getStatus() { + return status; + } + + @Override + public IStatus onCheck(IProgressMonitor monitor) { + hasRan = true; + return status; + } + + @Override + public IStatus onPostCondition(IProgressMonitor monitor) { + hasRan = true; + return status; + } + + @Override + public IStatus onPreCondition(IProgressMonitor monitor) { + hasRan = true; + return status; + } + + public void doSomething() { + hasRan = true; + } + + public boolean hasRan() { + return hasRan; + } }
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/mock/MockLifecycePoint.java b/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/mock/MockLifecycePoint.java index 5b3817a93c0..540547cfd7c 100644 --- a/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/mock/MockLifecycePoint.java +++ b/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/mock/MockLifecycePoint.java @@ -1,45 +1,45 @@ -/*******************************************************************************
- * 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.framework.lifecycle.test.mock;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.osee.framework.lifecycle.AbstractLifecycleVisitor;
-
-/**
- * @author Roberto E. Escobar
- * @author Jeff C. Phillips
- */
-public class MockLifecycePoint extends AbstractLifecycleVisitor<MockHandler> {
-
- public static final Type<MockHandler> TYPE = new Type<MockHandler>();
-
- private final String a;
- private final String b;
-
- public MockLifecycePoint(String a, String b) {
- super();
- this.a = a;
- this.b = b;
- }
-
- @Override
- public Type<MockHandler> getAssociatedType() {
- return TYPE;
- }
-
- @Override
- protected IStatus dispatch(IProgressMonitor monitor, MockHandler handler, String sourceId) {
- handler.setData(a, b);
- handler.doSomething();
- return handler.getStatus();
- }
+/******************************************************************************* + * 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.framework.lifecycle.test.mock; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.osee.framework.lifecycle.AbstractLifecycleVisitor; + +/** + * @author Roberto E. Escobar + * @author Jeff C. Phillips + */ +public class MockLifecycePoint extends AbstractLifecycleVisitor<MockHandler> { + + public static final Type<MockHandler> TYPE = new Type<MockHandler>(); + + private final String a; + private final String b; + + public MockLifecycePoint(String a, String b) { + super(); + this.a = a; + this.b = b; + } + + @Override + public Type<MockHandler> getAssociatedType() { + return TYPE; + } + + @Override + protected IStatus dispatch(IProgressMonitor monitor, MockHandler handler, String sourceId) { + handler.setData(a, b); + handler.doSomething(); + return handler.getStatus(); + } }
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/mock/NonRunHandler.java b/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/mock/NonRunHandler.java index 9516a173407..aaa0626ebb2 100644 --- a/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/mock/NonRunHandler.java +++ b/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/mock/NonRunHandler.java @@ -8,42 +8,42 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.framework.lifecycle.test.mock;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.osee.framework.lifecycle.LifecycleOpHandler;
-
-public class NonRunHandler implements LifecycleOpHandler {
- private boolean hasRun;
- IStatus status;
-
- public NonRunHandler() {
- super();
- this.status = Status.OK_STATUS;
- hasRun = false;
- }
-
- @Override
- public IStatus onCheck(IProgressMonitor monitor) {
- hasRun = true;
- return status;
- }
-
- @Override
- public IStatus onPostCondition(IProgressMonitor monitor) {
- hasRun = true;
- return status;
- }
-
- @Override
- public IStatus onPreCondition(IProgressMonitor monitor) {
- hasRun = true;
- return status;
- }
-
- public boolean hasRan() {
- return hasRun;
- }
-}
+package org.eclipse.osee.framework.lifecycle.test.mock; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.osee.framework.lifecycle.LifecycleOpHandler; + +public class NonRunHandler implements LifecycleOpHandler { + private boolean hasRun; + IStatus status; + + public NonRunHandler() { + super(); + this.status = Status.OK_STATUS; + hasRun = false; + } + + @Override + public IStatus onCheck(IProgressMonitor monitor) { + hasRun = true; + return status; + } + + @Override + public IStatus onPostCondition(IProgressMonitor monitor) { + hasRun = true; + return status; + } + + @Override + public IStatus onPreCondition(IProgressMonitor monitor) { + hasRun = true; + return status; + } + + public boolean hasRan() { + return hasRun; + } +} diff --git a/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/mock/StrictMockLifecycePoint.java b/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/mock/StrictMockLifecycePoint.java index 00273865f69..e3a6333147f 100644 --- a/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/mock/StrictMockLifecycePoint.java +++ b/plugins/org.eclipse.osee.framework.lifecycle.test/src/org/eclipse/osee/framework/lifecycle/test/mock/StrictMockLifecycePoint.java @@ -1,41 +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.framework.lifecycle.test.mock;
-
-import org.eclipse.osee.framework.lifecycle.AbstractLifecyclePoint;
-
-/**
- * @author Roberto E. Escobar
- * @author Jeff C. Phillips
- */
-public class StrictMockLifecycePoint extends AbstractLifecyclePoint<MockHandler> {
-
- public static final Type<MockHandler> TYPE = new Type<MockHandler>();
-
- private final String a;
- private final String b;
-
- public StrictMockLifecycePoint(String a, String b) {
- super();
- this.a = a;
- this.b = b;
- }
-
- @Override
- public Type<MockHandler> getAssociatedType() {
- return TYPE;
- }
-
- @Override
- protected void initializeHandlerData(MockHandler handler) {
- handler.setData(a, b);
- }
-}
+/******************************************************************************* + * 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.framework.lifecycle.test.mock; + +import org.eclipse.osee.framework.lifecycle.AbstractLifecyclePoint; + +/** + * @author Roberto E. Escobar + * @author Jeff C. Phillips + */ +public class StrictMockLifecycePoint extends AbstractLifecyclePoint<MockHandler> { + + public static final Type<MockHandler> TYPE = new Type<MockHandler>(); + + private final String a; + private final String b; + + public StrictMockLifecycePoint(String a, String b) { + super(); + this.a = a; + this.b = b; + } + + @Override + public Type<MockHandler> getAssociatedType() { + return TYPE; + } + + @Override + protected void initializeHandlerData(MockHandler handler) { + handler.setData(a, b); + } +} |