Adding new passing tests.
authorpombredanne <pombredanne>
Sun, 4 Nov 2007 01:04:16 +0000 (01:04 +0000)
committerpombredanne <pombredanne>
Sun, 4 Nov 2007 01:04:16 +0000 (01:04 +0000)
net.sourceforge.phpeclipse.xdebug.test/src/net/sourceforge/phpeclipse/xdebug/php/launching/PHPSourceLookupParticipantTest.java
net.sourceforge.phpeclipse.xdebug.test/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugElementTest.java [new file with mode: 0644]
net.sourceforge.phpeclipse.xdebug.test/src/net/sourceforge/phpeclipse/xdebug/php/model/XDebugStackFrameTest.java [new file with mode: 0644]

index 0b325c3..ad46b6f 100644 (file)
@@ -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 (file)
index 0000000..0a7cf2c
--- /dev/null
@@ -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 (file)
index 0000000..209fa52
--- /dev/null
@@ -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();
+       }
+
+}