From: pombredanne Date: Sun, 4 Nov 2007 01:04:16 +0000 (+0000) Subject: Adding new passing tests. X-Git-Url: http://git.phpeclipse.com?hp=a08b4c90d961670d8312a958e40f636b84d02a13 Adding new passing tests. --- diff --git a/net.sourceforge.phpeclipse.xdebug.test/src/net/sourceforge/phpeclipse/xdebug/php/launching/PHPSourceLookupParticipantTest.java b/net.sourceforge.phpeclipse.xdebug.test/src/net/sourceforge/phpeclipse/xdebug/php/launching/PHPSourceLookupParticipantTest.java index 0b325c3..ad46b6f 100644 --- a/net.sourceforge.phpeclipse.xdebug.test/src/net/sourceforge/phpeclipse/xdebug/php/launching/PHPSourceLookupParticipantTest.java +++ b/net.sourceforge.phpeclipse.xdebug.test/src/net/sourceforge/phpeclipse/xdebug/php/launching/PHPSourceLookupParticipantTest.java @@ -1,5 +1,8 @@ package net.sourceforge.phpeclipse.xdebug.php.launching; +import net.sourceforge.phpeclipse.xdebug.php.model.XDebugStackFrame; +import net.sourceforge.phpeclipse.xdebug.php.model.XDebugThread; + import org.eclipse.core.runtime.CoreException; import junit.framework.TestCase; @@ -17,5 +20,22 @@ public class PHPSourceLookupParticipantTest extends TestCase { Object[] findSourceElements = psp.findSourceElements(null); assertTrue("array should be empty",findSourceElements.length == 0); } - + public void testFindSourceElementsObject_WithXdebugStackFrame() throws CoreException { + PHPSourceLookupParticipant psp = new PHPSourceLookupParticipant(); + XDebugStackFrame frame = new MockXDebugStackFrame(); + Object[] findSourceElements = psp.findSourceElements(frame); + assertTrue("array should be empty",findSourceElements.length == 0); + } + + class MockXDebugStackFrame extends XDebugStackFrame { + public MockXDebugStackFrame() { + super(null, 0); + } + } + + public void testGetSourceName() throws CoreException { + PHPSourceLookupParticipant psp = new PHPSourceLookupParticipant(); + psp.getSourceName(null); + } } + diff --git a/net.sourceforge.phpeclipse.xdebug.test/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugElementTest.java b/net.sourceforge.phpeclipse.xdebug.test/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugElementTest.java new file mode 100644 index 0000000..0a7cf2c --- /dev/null +++ b/net.sourceforge.phpeclipse.xdebug.test/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugElementTest.java @@ -0,0 +1,15 @@ +package net.sourceforge.phpeclipse.xdebug.php.model; + +import junit.framework.TestCase; + +public class XDebugElementTest extends TestCase { + + public void testXDebugElement_XDebugTarget() { + new XDebugElement(null); + } + + public void testXDebugElement() { + new XDebugElement(); + } + +} diff --git a/net.sourceforge.phpeclipse.xdebug.test/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugStackFrameTest.java b/net.sourceforge.phpeclipse.xdebug.test/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugStackFrameTest.java new file mode 100644 index 0000000..209fa52 --- /dev/null +++ b/net.sourceforge.phpeclipse.xdebug.test/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugStackFrameTest.java @@ -0,0 +1,16 @@ +package net.sourceforge.phpeclipse.xdebug.php.model; + +import junit.framework.TestCase; + +public class XDebugStackFrameTest extends TestCase { + + public void testXDebugStackFrame_Constructor_Should_NOt_Fail_With_NPE() { + new XDebugStackFrame(null,0); + } + + public void testXDebugStackFrame_GetSourceName() { + XDebugStackFrame frame = new XDebugStackFrame(null,0); + frame.getSourceName(); + } + +}