Skip to content

Commit

Permalink
Added the testing framework
Browse files Browse the repository at this point in the history
  • Loading branch information
egonw committed Jan 17, 2012
1 parent 6cb629e commit d51aa76
Show file tree
Hide file tree
Showing 15 changed files with 359 additions and 0 deletions.
17 changes: 17 additions & 0 deletions features/net.bioclipse.bridgedb.tests_feature/.project
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>net.bioclipse.bridgedb.tests_feature</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.pde.FeatureBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.FeatureNature</nature>
</natures>
</projectDescription>
@@ -0,0 +1 @@
bin.includes = feature.xml
28 changes: 28 additions & 0 deletions features/net.bioclipse.bridgedb.tests_feature/feature.xml
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="net.bioclipse.bridgedb.tests_feature"
label="Bioclipse-BridgeDB Test Feature"
version="2.5.0.qualifier"
provider-name="The Bioclipse Team"
plugin="net.bioclipse.bridgedb.tests">

<requires>
<import feature="net.bioclipse.core_feature" />
<import feature="net.bioclipse.bridgedb_feature" />
</requires>

<plugin
id="net.bioclipse.bridgedb.tests"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>

<plugin
id="net.bioclipse.ui"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>

</feature>
7 changes: 7 additions & 0 deletions plugins/net.bioclipse.bridgedb.tests/.classpath
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
28 changes: 28 additions & 0 deletions plugins/net.bioclipse.bridgedb.tests/.project
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>net.bioclipse.bridgedb.tests</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
23 changes: 23 additions & 0 deletions plugins/net.bioclipse.bridgedb.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,23 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Bioclipse-BridgeDB Tests
Bundle-SymbolicName: net.bioclipse.bridgedb.tests
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: net.bioclipse.bridgedb.tests.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.resources,
net.bioclipse.core,
net.bioclipse.core.tests,
net.bioclipse.scripting,
org.springframework.bundle.spring.aop,
net.sf.cglib,
org.springframework.osgi.aopalliance.osgi,
net.bioclipse.bridgedb
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: org.apache.log4j,
org.junit,
org.junit.runner,
org.junit.runners,
org.hamcrest
Bundle-ActivationPolicy: lazy
5 changes: 5 additions & 0 deletions plugins/net.bioclipse.bridgedb.tests/build.properties
@@ -0,0 +1,5 @@
source.. = src/
output.. = bin/
bin.includes = plugin.xml,\
META-INF/,\
.
@@ -0,0 +1,37 @@
/*******************************************************************************
* Copyright (c) 2012 Egon Willighagen <egon.willighagen@gmail.com>
*
* 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
*
* Contact: Bioclipse Project <http://www.bioclipse.net>
******************************************************************************/
package net.bioclipse.bridgedb.tests;

import net.bioclipse.core.tests.AbstractManagerTest;
import net.bioclipse.managers.business.IBioclipseManager;
import net.bioclipse.bridgedb.business.IBridgedbManager;
import net.bioclipse.bridgedb.business.BridgedbManager;

/**
* JUnit tests for checking if the tested Manager is properly tested.
*
* @author egonw
*/
public class APITest extends AbstractManagerTest {

private static BridgedbManager manager = new BridgedbManager();

@Override
public IBioclipseManager getManager() {
return manager;
}

@Override
public Class<? extends IBioclipseManager> getManagerInterface() {
return IBridgedbManager.class;
}

}
@@ -0,0 +1,32 @@
/*******************************************************************************
* Copyright (c) 2012 Egon Willighagen <egon.willighagen@gmail.com>
*
* 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
*
* Contact: http://www.bioclipse.net/
******************************************************************************/
package net.bioclipse.bridgedb.tests;

import net.bioclipse.bridgedb.business.IBridgedbManager;
import net.bioclipse.core.tests.AbstractManagerTest;
import net.bioclipse.managers.business.IBioclipseManager;

import org.junit.Assert;
import org.junit.Test;

public abstract class AbstractBridgedbManagerPluginTest
extends AbstractManagerTest {

protected static IBridgedbManager managerNamespace;

@Test public void testDoSomething() {
Assert.fail("This method should test something.");
}

public Class<? extends IBioclipseManager> getManagerInterface() {
return IBridgedbManager.class;
}
}
@@ -0,0 +1,40 @@
/*******************************************************************************
* Copyright (c) 2012 Egon Willighagen <egon.willighagen@gmail.com>
*
* 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
*
* Contact: http://www.bioclipse.net/
******************************************************************************/
package net.bioclipse.bridgedb.tests;

import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

/**
* The activator class controls the plug-in life cycle.
*/
public class Activator extends AbstractUIPlugin {

public static final String PLUGIN_ID = "net.bioclipse.bridgedb.tests";
private static Activator sharedInstance;

public Activator() {}

public void start(BundleContext context) throws Exception {
super.start(context);
sharedInstance = this;
}

public void stop(BundleContext context) throws Exception {
sharedInstance = null;
super.stop(context);
}

public static Activator getDefault() {
return sharedInstance;
}

}
@@ -0,0 +1,24 @@
/*******************************************************************************
* Copyright (c) 2012 Egon Willighagen <egon.willighagen@gmail.com>
*
* 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
* www.eclipse.org—epl-v10.html <http://www.eclipse.org/legal/epl-v10.html>
*
* Contact: http://www.bioclipse.net/
******************************************************************************/
package net.bioclipse.bridgedb.tests;

import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;

@RunWith(Suite.class)
@SuiteClasses({
JavaBridgedbManagerPluginTest.class,
JavaScriptBridgedbManagerPluginTest.class
})
public class AllBridgedbManagerPluginTests {

}
@@ -0,0 +1,24 @@
/*******************************************************************************
* Copyright (c) 2012 Egon Willighagen <egon.willighagen@gmail.com>
*
* 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
* www.eclipse.org—epl-v10.html <http://www.eclipse.org/legal/epl-v10.html>
*
* Contact: http://www.bioclipse.net/
******************************************************************************/
package net.bioclipse.bridgedb.tests;

import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;

@RunWith(Suite.class)
@SuiteClasses({
APITest.class,
CoverageTest.class
})
public class AllBridgedbManagerTests {

}
@@ -0,0 +1,35 @@
/*******************************************************************************
* Copyright (c) 2012 Egon Willighagen <egon.willighagen@gmail.com>
*
* 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
*
* Contact: Bioclipse Project <http://www.bioclipse.net>
******************************************************************************/
package net.bioclipse.bridgedb.tests;

import net.bioclipse.core.tests.coverage.AbstractCoverageTest;
import net.bioclipse.managers.business.IBioclipseManager;
import net.bioclipse.bridgedb.business.IBridgedbManager;
import net.bioclipse.bridgedb.business.BridgedbManager;

/**
* JUnit tests for checking if the tested Manager is properly tested.
*/
public class CoverageTest extends AbstractCoverageTest {

private static BridgedbManager manager = new BridgedbManager();

@Override
public IBioclipseManager getManager() {
return manager;
}

@Override
public Class<? extends IBioclipseManager> getManagerInterface() {
return IBridgedbManager.class;
}

}
@@ -0,0 +1,29 @@
/*******************************************************************************
* Copyright (c) 2012 Egon Willighagen <egon.willighagen@gmail.com>
*
* 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
* www.eclipse.org—epl-v10.html <http://www.eclipse.org/legal/epl-v10.html>
*
* Contact: http://www.bioclipse.net/
******************************************************************************/
package net.bioclipse.bridgedb.tests;

import net.bioclipse.managers.business.IBioclipseManager;

import org.junit.BeforeClass;

public class JavaBridgedbManagerPluginTest
extends AbstractBridgedbManagerPluginTest {

@BeforeClass public static void setup() {
managerNamespace = net.bioclipse.bridgedb.Activator.getDefault()
.getJavaBridgedbManager();
}

@Override
public IBioclipseManager getManager() {
return managerNamespace;
}
}
@@ -0,0 +1,29 @@
/*******************************************************************************
* Copyright (c) 2012 Egon Willighagen <egon.willighagen@gmail.com>
*
* 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
* www.eclipse.org—epl-v10.html <http://www.eclipse.org/legal/epl-v10.html>
*
* Contact: http://www.bioclipse.net/
******************************************************************************/
package net.bioclipse.bridgedb.tests;

import net.bioclipse.managers.business.IBioclipseManager;

import org.junit.BeforeClass;

public class JavaScriptBridgedbManagerPluginTest
extends AbstractBridgedbManagerPluginTest {

@BeforeClass public static void setup() {
managerNamespace = net.bioclipse.bridgedb.Activator.getDefault()
.getJavaScriptBridgedbManager();
}

@Override
public IBioclipseManager getManager() {
return managerNamespace;
}
}

0 comments on commit d51aa76

Please sign in to comment.