This paper describes iSensNet, an infrastructure that we designed and implemented for various research and development projects in wireless sensor networks (WSNs). iSensNet is composed of a WSN platform and an event publish/subscribe middleware. On the WSN platform, users can test their protocols of any and all non-physical layers; the platform provides real time performance evaluation of the protocols. With the provided middleware, iSensNet is able to accept event subscriptions, to decompose an event to sub-events, to build up event detection trees composed of these subevents, to collaborate in detecting the sub-events, and handle the event for various application programs. This paper focuses on the design of iSensNet, taking into consideration the severe resource constraints despite the high performance requirements of the applications.