From f3362e0076588afa4934b8d0e335959ab723e669 Mon Sep 17 00:00:00 2001 From: pombredanne Date: Sun, 4 Nov 2007 01:04:16 +0000 Subject: [PATCH 1/1] Adding new passing tests. --- .../launching/PHPSourceLookupParticipantTest.java | 22 +++++++++++++++++++- .../xdebug/php/model/XDebugElementTest.java | 15 +++++++++++++ .../xdebug/php/model/XDebugStackFrameTest.java | 16 ++++++++++++++ 3 files changed, 52 insertions(+), 1 deletions(-) create mode 100644 net.sourceforge.phpeclipse.xdebug.test/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugElementTest.java create mode 100644 net.sourceforge.phpeclipse.xdebug.test/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugStackFrameTest.java 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(); + } + +} -- 1.7.1