M
Mark Fink
I wrote a Jython class that inherits from a Java class and (thats the
plan) overrides one method. Everything should stay the same.
If I run this nothing happens whereas if I run the Java class it says:
usage: java fit.FitServer [-v] host port socketTicket
-v verbose
I think this is because I do not understand the jython mechanism for
inheritance (yet).
JyFitServer.py:
===========
import fit.FitServer
import fitnesse.components.FitProtocol
from fit.Parse import Parse
from fit.Fixture import Fixture
# Inherit from original Java FitServer Implementation by Robert C.
Martin and Micah D. Martin
class FitServer(fit.FitServer):
# call constructor of superclass
def __init__(self, host, port, verbose):
FitServer.__init__(self, host, port, verbose)
# override process method
def process(self):
self.fixture.listener = self.fixtureListener
print "hello, I am JyFitServer!"
try:
size = FitProtocol.readSize(self.socketReader)
if size > 0:
try:
document =
FitProtocol.readDocument(self.socketReader, size)
tables = Parse(document)
fixture = Fixture()
fixture.listener = self.fixtureListener;
fixture.doTables(tables)
self.counts.tally(self.fixture.counts)
except FitParseException, e:
self.exception(e)
except Exception, e:
self.exception(e)
Please help,
Mark Fink
plan) overrides one method. Everything should stay the same.
If I run this nothing happens whereas if I run the Java class it says:
usage: java fit.FitServer [-v] host port socketTicket
-v verbose
I think this is because I do not understand the jython mechanism for
inheritance (yet).
JyFitServer.py:
===========
import fit.FitServer
import fitnesse.components.FitProtocol
from fit.Parse import Parse
from fit.Fixture import Fixture
# Inherit from original Java FitServer Implementation by Robert C.
Martin and Micah D. Martin
class FitServer(fit.FitServer):
# call constructor of superclass
def __init__(self, host, port, verbose):
FitServer.__init__(self, host, port, verbose)
# override process method
def process(self):
self.fixture.listener = self.fixtureListener
print "hello, I am JyFitServer!"
try:
size = FitProtocol.readSize(self.socketReader)
if size > 0:
try:
document =
FitProtocol.readDocument(self.socketReader, size)
tables = Parse(document)
fixture = Fixture()
fixture.listener = self.fixtureListener;
fixture.doTables(tables)
self.counts.tally(self.fixture.counts)
except FitParseException, e:
self.exception(e)
except Exception, e:
self.exception(e)
Please help,
Mark Fink