-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from LoadingPleaseWait/master
Add to README.md, Add to Javadoc comments and annotations, add unit test
- Loading branch information
Showing
10 changed files
with
115 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="src" path="test"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> | ||
<classpathentry kind="var" path="wpilib" sourcepath="wpilib.sources"/> | ||
<classpathentry kind="var" path="networktables" sourcepath="networktables.sources"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,5 @@ hs_err_pid* | |
# Output Folders | ||
bin/ | ||
build/ | ||
|
||
junit/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
Lib2585 | ||
Lib2585 [![Build Status](https://travis-ci.org/Impact2585/Lib2585.svg?branch=master)](https://travis-ci.org/Impact2585/Lib2585) | ||
======= | ||
|
||
This FRC library was made from the [code for aerbot](https://github.com/2585Robophiles/aerbot-champs), team 2585's robot for 2014, which has been [unit tested](https://github.com/2585Robophiles/aerbot-junit). | ||
This FRC library is made to supplement WPILibJ and has [documentation available](https://impact2585.github.io/Lib2585). | ||
|
||
Downloads can be found on the [releases](https://github.com/2585Robophiles/Lib2585/releases) page. | ||
Downloads can be found on the [releases](https://github.com/2585Robophiles/Lib2585/releases) page. Releases are signed by one of our core developers: @LoadingPleaseWait (Michael Murphey PGP Key ID: A1CFA14B) or @KIllin-A13 (Amanuel Bayu PGP Key ID: B8AD8D5E). | ||
|
||
Lib2585 is dual licensed under the [GPL v3](http://www.gnu.org/licenses) and BSD License for WPILib. | ||
Lib2585 is free software: you can redistribute it and/or modify it under the terms of those two licenses. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
test/org/impact2585/lib2585/tests/RunnableExecuterTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package org.impact2585.lib2585.tests; | ||
|
||
import java.util.LinkedList; | ||
|
||
import org.impact2585.lib2585.RunnableExecuter; | ||
import org.junit.Assert; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
/** | ||
* Test the RunnableExecuter Class | ||
*/ | ||
public class RunnableExecuterTest { | ||
|
||
private RunnableExecuter executer; | ||
|
||
/** | ||
* Set up before test | ||
*/ | ||
@Before | ||
public void setUp() { | ||
executer = new RunnableExecuter() { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
}; | ||
} | ||
|
||
/** | ||
* Actually do the unit test | ||
*/ | ||
@Test | ||
public void test() { | ||
LinkedList<TestRunnable> testRunnables = new LinkedList<>(); | ||
for (int i = 0; i < 3; i++) | ||
testRunnables.add(new TestRunnable()); | ||
for (Runnable item : testRunnables) | ||
executer.getRunnables().add(item); | ||
executer.execute(); | ||
for (TestRunnable runnable : testRunnables) | ||
Assert.assertTrue(runnable.ran); | ||
} | ||
|
||
/** | ||
* Class that implements Runnable for testing | ||
*/ | ||
private class TestRunnable implements Runnable{ | ||
|
||
private boolean ran; | ||
|
||
/* (non-Javadoc) | ||
* @see java.lang.Runnable#run() | ||
*/ | ||
@Override | ||
public void run() { | ||
ran = true; | ||
} | ||
|
||
} | ||
} |