-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More tests, code tidy up, and reviewed the docs / comments.
- Loading branch information
1 parent
738c395
commit 8eba05c
Showing
16 changed files
with
589 additions
and
199 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,21 +1,27 @@ | ||
<idea-plugin version="2"> | ||
<id>JettyRunner-By-GuiKeller</id> | ||
<id>JettyRunner-GK</id> | ||
<name>IDEA Jetty Runner</name> | ||
<version>0.0.3</version> | ||
<version>0.0.4</version> | ||
<vendor email="[email protected]" url="https://github.com/guikeller/jetty-runner">IntelliJ Jetty Runner</vendor> | ||
|
||
<description><![CDATA[ | ||
A plugin that allows you to quickly run Jetty from IntelliJ IDEA. <br> | ||
If you require full Jetty support please consider buying the IntelliJ IDEA Enterprise Edition. <br> | ||
This plugin should be Win / Mac / Linux compatible - min req: JVM 5.0 <br> | ||
If you require full support please consider buying the IntelliJ IDEA Enterprise Edition. <br> | ||
This plugin should be Win / Mac / Linux compatible - min req: JVM6 <br> | ||
tags: jetty, container, webapp, runner, tomcat | ||
]]></description> | ||
|
||
<change-notes><![CDATA[ | ||
<b>0.0.4</b> - Fourth release; <br> | ||
What's new: <br> | ||
<b>1)</b> More unit tests - important bits tested (some felt in the too hard basket). <br> | ||
<b>2)</b> Compiled to be compatible with JVM6. <br> | ||
<b>3)</b> Tidied up the code and docs a bit more. <br> | ||
<br> | ||
<b>0.0.3</b> - Third release; <br> | ||
<br> | ||
What's new: <br> | ||
<b>1)</b> Run and Debug Configurations working out-of-the-box! <br> | ||
<b>1)</b> Run and Debug Configurations now work! <br> | ||
<b>2)</b> Internal code refactoring and documentation. <br> | ||
<b>3)</b> UI Layout created using IntelliJ. <br> | ||
<b>4)</b> Some Unit Tests - a starting point. <br> | ||
|
@@ -30,16 +36,16 @@ What's new:<br> | |
<br> | ||
I'm going to start writing those unit tests, soon..<br> | ||
<br><br> | ||
<b>0.0.1</b> - First release; Runs Jetty 8.1.<br> | ||
<b>0.0.1</b> - First release; Uses jetty-runner-8.1.9 <br> | ||
<b>*Note</b>: Debugging is available through 'Remote', on port 5007.<br> | ||
<br> | ||
<br> | ||
<b>TODO:</b> <br> | ||
<b>1)</b> Debugger port selector; for now its fixed on 5007. [DONE]<br> | ||
<b>2)</b> Figure out why the debugger doesn't work out of the box; JetBrains? [DONE]<br> | ||
<b>3)</b> Better UI Layout- BoxLayout is not the greatest; GridBag? [DONE]<br> | ||
<b>4)</b> Unit Tests - sorry guys I got a bit lazy here.[SOME]<br> | ||
<b>5)</b> Bug fixes / Improvements / Requests [?]<br> | ||
<b>4)</b> Unit Tests - Important bits.[DONE]<br> | ||
<b>5)</b> Bug fixes / Improvements [?]<br> | ||
<br> | ||
Thanks for dropping by. | ||
]]> | ||
|
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
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
50 changes: 50 additions & 0 deletions
50
src/test/java/com/github/guikeller/jettyrunner/model/JettyRunnerConfigurationTest.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,50 @@ | ||
package com.github.guikeller.jettyrunner.model; | ||
|
||
import com.github.guikeller.jettyrunner.runner.JettyRunnerCommandLine; | ||
import com.github.guikeller.jettyrunner.ui.JettyRunnerEditor; | ||
import com.intellij.execution.Executor; | ||
import com.intellij.execution.configurations.RunProfileState; | ||
import com.intellij.execution.runners.ExecutionEnvironment; | ||
import com.intellij.openapi.options.SettingsEditor; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.mockito.Mockito; | ||
import org.powermock.api.mockito.PowerMockito; | ||
import org.powermock.core.classloader.annotations.PrepareForTest; | ||
import org.powermock.modules.junit4.PowerMockRunner; | ||
import org.powermock.reflect.Whitebox; | ||
|
||
import static org.junit.Assert.assertNotNull; | ||
|
||
@RunWith(PowerMockRunner.class) | ||
@PrepareForTest({JettyRunnerConfiguration.class}) | ||
public class JettyRunnerConfigurationTest { | ||
|
||
@Test | ||
public void testGetConfigurationEditor() throws Exception { | ||
JettyRunnerEditor runEditor = Mockito.mock(JettyRunnerEditor.class); | ||
PowerMockito.whenNew(JettyRunnerEditor.class).withAnyArguments().thenReturn(runEditor); | ||
|
||
JettyRunnerConfiguration runnerConf = Whitebox.newInstance(JettyRunnerConfiguration.class); | ||
SettingsEditor<JettyRunnerConfiguration> editor = runnerConf.getConfigurationEditor(); | ||
assertNotNull(editor); | ||
|
||
PowerMockito.verifyNew(JettyRunnerEditor.class).withArguments(runnerConf); | ||
} | ||
|
||
@Test | ||
public void testGetState() throws Exception { | ||
JettyRunnerCommandLine commandLine = Mockito.mock(JettyRunnerCommandLine.class); | ||
PowerMockito.whenNew(JettyRunnerCommandLine.class).withAnyArguments().thenReturn(commandLine); | ||
|
||
Executor executor = Mockito.mock(Executor.class); | ||
ExecutionEnvironment environment = Mockito.mock(ExecutionEnvironment.class); | ||
|
||
JettyRunnerConfiguration runnerConf = Whitebox.newInstance(JettyRunnerConfiguration.class); | ||
RunProfileState state = runnerConf.getState(executor, environment); | ||
assertNotNull(state); | ||
|
||
PowerMockito.verifyNew(JettyRunnerCommandLine.class).withArguments(environment, runnerConf); | ||
} | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
src/test/java/com/github/guikeller/jettyrunner/runner/JettyProgramDebuggerTest.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,35 @@ | ||
package com.github.guikeller.jettyrunner.runner; | ||
|
||
import com.github.guikeller.jettyrunner.model.JettyRunnerConfiguration; | ||
import com.intellij.execution.configurations.RunProfile; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.mockito.Mockito; | ||
import org.powermock.modules.junit4.PowerMockRunner; | ||
import org.powermock.reflect.Whitebox; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
@RunWith(PowerMockRunner.class) | ||
public class JettyProgramDebuggerTest { | ||
|
||
@Test | ||
public void testGetRunnerId() throws Exception { | ||
JettyProgramDebugger debugger = Whitebox.newInstance(JettyProgramDebugger.class); | ||
String runnerId = debugger.getRunnerId(); | ||
assertEquals("JettyRunner-By-GuiKeller", runnerId); | ||
} | ||
|
||
@Test | ||
public void testCanRun() throws Exception { | ||
RunProfile profile = Mockito.mock(JettyRunnerConfiguration.class); | ||
|
||
JettyProgramDebugger debugger = Whitebox.newInstance(JettyProgramDebugger.class); | ||
boolean canRun = debugger.canRun("Debug", profile); | ||
assertTrue(canRun); | ||
|
||
RunProfile wrongProfile = Mockito.mock(RunProfile.class); | ||
boolean cannotRun = debugger.canRun("Debug", wrongProfile); | ||
assertFalse(cannotRun); | ||
} | ||
} |
Oops, something went wrong.