Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/mocks/MockOseeDataAccessor.java')
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/mocks/MockOseeDataAccessor.java58
1 files changed, 58 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/mocks/MockOseeDataAccessor.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/mocks/MockOseeDataAccessor.java
new file mode 100644
index 00000000000..6d6d096ac34
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/mocks/MockOseeDataAccessor.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * 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.skynet.core.mocks;
+
+import java.util.Collection;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.model.IOseeStorable;
+import org.eclipse.osee.framework.core.model.cache.IOseeCache;
+import org.eclipse.osee.framework.core.model.cache.IOseeDataAccessor;
+import org.junit.Assert;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class MockOseeDataAccessor<K, T extends IOseeStorable> implements IOseeDataAccessor<K, T> {
+
+ private boolean wasLoadCalled = false;
+ private boolean wasStoreCalled = false;
+
+ public void setLoadCalled(boolean wasLoadCalled) {
+ this.wasLoadCalled = wasLoadCalled;
+ }
+
+ public void setStoreCalled(boolean wasStoreCalled) {
+ this.wasStoreCalled = wasStoreCalled;
+ }
+
+ public boolean wasLoaded() {
+ return wasLoadCalled;
+ }
+
+ public boolean wasStoreCalled() {
+ return wasStoreCalled;
+ }
+
+ @SuppressWarnings("unused")
+ @Override
+ public void load(IOseeCache<K, T> cache) throws OseeCoreException {
+ Assert.assertNotNull(cache);
+ setLoadCalled(true);
+ }
+
+ @SuppressWarnings("unused")
+ @Override
+ public void store(Collection<T> types) throws OseeCoreException {
+ Assert.assertNotNull(types);
+ setStoreCalled(true);
+ }
+
+}

Back to the top