Thread: [Java-link-svn] SF.net SVN: java-link: [8] trunk/server
Status: Pre-Alpha
Brought to you by:
welterde0
From: <wel...@us...> - 2006-05-15 18:35:09
|
Revision: 8 Author: welterde0 Date: 2006-05-15 11:34:32 -0700 (Mon, 15 May 2006) ViewCVS: http://svn.sourceforge.net/java-link/?rev=8&view=rev Log Message: ----------- updated ll net system added XMLoverSocket impl of ll net system added missing files in server Modified Paths: -------------- trunk/server/src/main/java/org/jlink/ServerNetwork.java trunk/share/src/main/java/org/jlink/net/ll/LLServerConnector.java Added Paths: ----------- trunk/server/nbproject/ trunk/server/nbproject/mavencall.xml trunk/server/nbproject/project.properties trunk/server/nbproject/project.xml trunk/server/src/main/assembly/ trunk/server/src/main/assembly/dep.xml trunk/share/src/main/java/org/jlink/net/hl/HLProtocol.java trunk/share/src/main/java/org/jlink/net/ll/xml/ trunk/share/src/main/java/org/jlink/net/ll/xml/XMLConfiguration.java trunk/share/src/main/java/org/jlink/net/ll/xml/XMLConnector.java trunk/share/src/main/java/org/jlink/net/ll/xml/XMLFactory.java trunk/share/src/test/java/ trunk/share/src/test/java/org/ trunk/share/src/test/java/org/jlink/ trunk/share/src/test/java/org/jlink/net/ trunk/share/src/test/java/org/jlink/net/ll/ trunk/share/src/test/java/org/jlink/net/ll/LLEventTest.java Added: trunk/server/nbproject/mavencall.xml =================================================================== --- trunk/server/nbproject/mavencall.xml (rev 0) +++ trunk/server/nbproject/mavencall.xml 2006-05-15 18:34:32 UTC (rev 8) @@ -0,0 +1,37 @@ +<project name="server" default="build" basedir=".."> + <target name="build" description="Build"> + <exec dir="${basedir}" executable="${mvn.path}"> + <arg line="package"/> + </exec> + </target> + <target name="clean" description="Clean"> + <exec dir="${basedir}" executable="${mvn.path}"> + <arg line="clean:clean"/> + </exec> + </target> + <target name="javadoc" description="Javadoc"> + <exec dir="${basedir}" executable="${mvn.path}"> + <arg line="site:site"/> + </exec> + </target> + <target name="run" description="Install Locally"> + <exec dir="${basedir}" executable="${mvn.path}"> + <arg line="install"/> + </exec> + </target> + <target name="test" description="Test Project"> + <exec dir="${basedir}" executable="${mvn.path}"> + <arg line="test"/> + </exec> + </target> + <target name="jalopy" description="Format Code"> + <exec dir="${basedir}" executable="${mvn.path}"> + <arg line="jalopy:format"/> + </exec> + </target> + <target name="refresh-project" description="Refresh Project"> + <exec dir="${basedir}" executable="${mvn.path}"> + <arg line="netbeans-freeform:generate-netbeans-project"/> + </exec> + </target> +</project> \ No newline at end of file Added: trunk/server/nbproject/project.properties =================================================================== --- trunk/server/nbproject/project.properties (rev 0) +++ trunk/server/nbproject/project.properties 2006-05-15 18:34:32 UTC (rev 8) @@ -0,0 +1,5 @@ +#The netbeans freeform property file +#Mon May 15 20:20:00 CEST 2006 +local.repository=/home/tassilo/.m2/repository +mvn.path=mvn +project.directory=/home/tassilo/Documents/dev/jlink/feature_maven2/server Added: trunk/server/nbproject/project.xml =================================================================== --- trunk/server/nbproject/project.xml (rev 0) +++ trunk/server/nbproject/project.xml 2006-05-15 18:34:32 UTC (rev 8) @@ -0,0 +1,134 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://www.netbeans.org/ns/project/1"> + <type>org.netbeans.modules.ant.freeform</type> + <configuration> + <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1"> + <name>JLink Server</name> + <properties> + <property name="ant.script">nbproject/mavencall.xml</property> + <property-file>nbproject/project.properties</property-file> + </properties> + <folders> + <source-folder> + <label>src/main/java</label> + <type>java</type> + <location>src/main/java</location> + </source-folder> + <source-folder> + <label>src/test/java</label> + <type>java</type> + <location>src/test/java</location> + </source-folder> + </folders> + <ide-actions> + <action name="build"> + <script>${ant.script}</script> + <target>build</target> + </action> + <action name="clean"> + <script>${ant.script}</script> + <target>clean</target> + </action> + <action name="rebuild"> + <script>${ant.script}</script> + <target>clean</target> + <target>build</target> + </action> + <action name="javadoc"> + <script>${ant.script}</script> + <target>javadoc</target> + </action> + <action name="run"> + <script>${ant.script}</script> + <target>run</target> + </action> + <action name="test"> + <script>${ant.script}</script> + <target>test</target> + </action> + </ide-actions> + <export> + <type>folder</type> + <location>target/classes</location> + <script>${ant.script}</script> + <build-target>build</build-target> + </export> + <export> + <type>folder</type> + <location>target/test-classes</location> + <script>${ant.script}</script> + <build-target>build</build-target> + </export> + <view> + <items> + <source-folder style="packages"> + <label>src/main/java</label> + <location>src/main/java</location> + </source-folder> + <source-folder style="packages"> + <label>src/test/java</label> + <location>src/test/java</location> + </source-folder> + <source-file> + <label>pom</label> + <location>pom.xml</location> + </source-file> + <source-file> + <label>mavencall</label> + <location>nbproject/mavencall.xml</location> + </source-file> + <source-folder style="tree"> + <label>src/main/resources</label> + <location>src/main/resources</location> + </source-folder> + <source-folder style="tree"> + <label>src/test/resources</label> + <location>src/test/resources</location> + </source-folder> + <source-folder style="tree"> + <label>src/site</label> + <location>src/site</location> + </source-folder> + <source-folder style="tree"> + <label>target</label> + <location>target</location> + </source-folder> + </items> + <context-menu> + <action> + <script>${ant.script}</script> + <label>Refresh Project</label> + <target>refresh-project</target> + </action> + <ide-action name="build"/> + <ide-action name="clean"/> + <ide-action name="rebuild"/> + <ide-action name="javadoc"/> + <ide-action name="run"/> + <ide-action name="test"/> + <action> + <script>${ant.script}</script> + <label>Format Code</label> + <target>jalopy</target> + </action> + </context-menu> + </view> + <subprojects/> + </general-data> + <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/2"> + <compilation-unit> + <package-root>src/main/java</package-root> + <classpath mode="compile">${local.repository}/org/jlink/share/0.0.1-SNAPSHOT/share-0.0.1-SNAPSHOT.jar:${local.repository}/log4j/log4j/1.2.13/log4j-1.2.13.jar</classpath> + <built-to>target/classes</built-to> + <source-level>1.5</source-level> + </compilation-unit> + <compilation-unit> + <package-root>src/test/java</package-root> + <unit-tests/> + <classpath mode="compile">target/classes:${local.repository}/org/jlink/share/0.0.1-SNAPSHOT/share-0.0.1-SNAPSHOT.jar:${local.repository}/junit/junit/3.8.1/junit-3.8.1.jar:${local.repository}/log4j/log4j/1.2.13/log4j-1.2.13.jar</classpath> + <built-to>target/test-classes</built-to> + <source-level>1.5</source-level> + </compilation-unit> + </java-data> + </configuration> +</project> Added: trunk/server/src/main/assembly/dep.xml =================================================================== --- trunk/server/src/main/assembly/dep.xml (rev 0) +++ trunk/server/src/main/assembly/dep.xml 2006-05-15 18:34:32 UTC (rev 8) @@ -0,0 +1,20 @@ +<assembly> + <id>deps</id> + <formats> + <format>jar</format> + </formats> + <includeBaseDirectory>false</includeBaseDirectory> + <fileSets> + <fileSet> + <directory>target/classes</directory> + <outputDirectory>/</outputDirectory> + </fileSet> + </fileSets> + <dependencySets> + <dependencySet> + <outputDirectory>/</outputDirectory> + <unpack>true</unpack> + <scope>runtime</scope> + </dependencySet> + </dependencySets> +</assembly> Modified: trunk/server/src/main/java/org/jlink/ServerNetwork.java =================================================================== --- trunk/server/src/main/java/org/jlink/ServerNetwork.java 2006-05-14 19:23:51 UTC (rev 7) +++ trunk/server/src/main/java/org/jlink/ServerNetwork.java 2006-05-15 18:34:32 UTC (rev 8) @@ -85,6 +85,11 @@ int i = 0; while(this.status_active) { + try { + Thread.sleep(100); + } catch (InterruptedException ex) { + ex.printStackTrace(); + } } log.debug("Network::Core::run() stopped"); } Added: trunk/share/src/main/java/org/jlink/net/hl/HLProtocol.java =================================================================== --- trunk/share/src/main/java/org/jlink/net/hl/HLProtocol.java (rev 0) +++ trunk/share/src/main/java/org/jlink/net/hl/HLProtocol.java 2006-05-15 18:34:32 UTC (rev 8) @@ -0,0 +1,32 @@ +/* + * HLProtocol.java + * + * Created on 15. Mai 2006, 15:12 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.net.hl; + +/** + * + * @author tassilo + */ +public interface HLProtocol { + public HLHandler getHandler(); +} Modified: trunk/share/src/main/java/org/jlink/net/ll/LLServerConnector.java =================================================================== --- trunk/share/src/main/java/org/jlink/net/ll/LLServerConnector.java 2006-05-14 19:23:51 UTC (rev 7) +++ trunk/share/src/main/java/org/jlink/net/ll/LLServerConnector.java 2006-05-15 18:34:32 UTC (rev 8) @@ -28,5 +28,9 @@ * @author tassilo */ public interface LLServerConnector { + public LLConnector accept() throws LLConnectionException; + public boolean isAlive(); + + public void close() throws LLConnectionException; } Added: trunk/share/src/main/java/org/jlink/net/ll/xml/XMLConfiguration.java =================================================================== --- trunk/share/src/main/java/org/jlink/net/ll/xml/XMLConfiguration.java (rev 0) +++ trunk/share/src/main/java/org/jlink/net/ll/xml/XMLConfiguration.java 2006-05-15 18:34:32 UTC (rev 8) @@ -0,0 +1,62 @@ +/* + * XMLConfiguration.java + * + * Created on 15. Mai 2006, 15:26 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.net.ll.xml; + +import java.util.Locale; +import org.jlink.net.ll.LLConfiguration; + +/** + * + * @author tassilo + */ +public class XMLConfiguration implements LLConfiguration { + + /** Creates a new instance of XMLConfiguration */ + public XMLConfiguration() { + } + + public String[] getNames() { + return null; + } + + public String getDefault(int id) { + return null; + } + + public String getValue(int id) { + return null; + } + + public String getDescription(int id, Locale l) { + return null; + } + + public String getDescription(int id) { + return null; + } + + public void setValue(int id, String val) { + } + +} Added: trunk/share/src/main/java/org/jlink/net/ll/xml/XMLConnector.java =================================================================== --- trunk/share/src/main/java/org/jlink/net/ll/xml/XMLConnector.java (rev 0) +++ trunk/share/src/main/java/org/jlink/net/ll/xml/XMLConnector.java 2006-05-15 18:34:32 UTC (rev 8) @@ -0,0 +1,66 @@ +/* + * XMLConnector.java + * + * Created on 15. Mai 2006, 15:21 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.net.ll.xml; + +import org.jlink.net.ll.LLConfiguration; +import org.jlink.net.ll.LLConfigurationException; +import org.jlink.net.ll.LLConnectionException; +import org.jlink.net.ll.LLConnector; +import org.jlink.net.ll.LLEvent; + +/** + * + * @author tassilo + */ +public class XMLConnector implements LLConnector { + + /** Creates a new instance of XMLConnector */ + public XMLConnector(LLConfiguration conf) throws LLConfigurationException { + } + + public void send(LLEvent evt) throws LLConnectionException { + } + + public void send(LLEvent[] evts) throws LLConnectionException { + } + + public LLEvent recive() throws LLConnectionException { + return null; + } + + public void recive(LLEvent[] evts) throws LLConnectionException { + } + + public boolean isAlive() { + return true; + } + + public void close() throws LLConnectionException { + } + + public long ping() throws LLConnectionException { + return 0L; + } + +} Added: trunk/share/src/main/java/org/jlink/net/ll/xml/XMLFactory.java =================================================================== --- trunk/share/src/main/java/org/jlink/net/ll/xml/XMLFactory.java (rev 0) +++ trunk/share/src/main/java/org/jlink/net/ll/xml/XMLFactory.java 2006-05-15 18:34:32 UTC (rev 8) @@ -0,0 +1,56 @@ +/* + * XMLFactory.java + * + * Created on 15. Mai 2006, 15:29 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink.net.ll.xml; + +import org.jlink.net.ll.LLConfiguration; +import org.jlink.net.ll.LLConfigurationException; +import org.jlink.net.ll.LLConnectionException; +import org.jlink.net.ll.LLConnector; +import org.jlink.net.ll.LLFactory; + +/** + * + * @author tassilo + */ +public class XMLFactory implements LLFactory { + + /** Creates a new instance of XMLFactory */ + public XMLFactory() { + } + + public LLConfiguration getConfig() { + return new XMLConfiguration(); + } + + public void setConfig(LLConfiguration conf) throws LLConfigurationException { + } + + public void resetConfig() { + } + + public LLConnector create() throws LLConnectionException, LLConfigurationException { + return null; + } + +} Added: trunk/share/src/test/java/org/jlink/net/ll/LLEventTest.java =================================================================== --- trunk/share/src/test/java/org/jlink/net/ll/LLEventTest.java (rev 0) +++ trunk/share/src/test/java/org/jlink/net/ll/LLEventTest.java 2006-05-15 18:34:32 UTC (rev 8) @@ -0,0 +1,222 @@ +/* + * LLEventTest.java + * JUnit based test + * + * Created on 15. Mai 2006, 15:35 + */ + +package org.jlink.net.ll; + +import junit.framework.*; +import java.util.Map; +import java.util.HashMap; + +/** + * + * @author tassilo + */ +public class LLEventTest extends TestCase { + + public LLEventTest(String testName) { + super(testName); + } + + protected void setUp() throws Exception { + } + + protected void tearDown() throws Exception { + } + + public static Test suite() { + TestSuite suite = new TestSuite(LLEventTest.class); + + return suite; + } + + /** + * Test of getMsgClass method, of class org.jlink.net.ll.LLEvent. + */ + public void testGetMsgClass() { + System.out.println("getMsgClass"); + + LLEvent instance = new LLEvent(); + + int expResult = 0; + int result = instance.getMsgClass(); + assertEquals(expResult, result); + + // TODO review the generated test code and remove the default call to fail. + fail("The test case is a prototype."); + } + + /** + * Test of setMsgClass method, of class org.jlink.net.ll.LLEvent. + */ + public void testSetMsgClass() { + System.out.println("setMsgClass"); + + int c = 0; + LLEvent instance = new LLEvent(); + + instance.setMsgClass(c); + + // TODO review the generated test code and remove the default call to fail. + fail("The test case is a prototype."); + } + + /** + * Test of getMsgID method, of class org.jlink.net.ll.LLEvent. + */ + public void testGetMsgID() { + System.out.println("getMsgID"); + + LLEvent instance = new LLEvent(); + + long expResult = 0L; + long result = instance.getMsgID(); + assertEquals(expResult, result); + + // TODO review the generated test code and remove the default call to fail. + fail("The test case is a prototype."); + } + + /** + * Test of setMsgID method, of class org.jlink.net.ll.LLEvent. + */ + public void testSetMsgID() { + System.out.println("setMsgID"); + + long id = 0L; + LLEvent instance = new LLEvent(); + + instance.setMsgID(id); + + // TODO review the generated test code and remove the default call to fail. + fail("The test case is a prototype."); + } + + /** + * Test of getMsgReply method, of class org.jlink.net.ll.LLEvent. + */ + public void testGetMsgReply() { + System.out.println("getMsgReply"); + + LLEvent instance = new LLEvent(); + + long expResult = 0L; + long result = instance.getMsgReply(); + assertEquals(expResult, result); + + // TODO review the generated test code and remove the default call to fail. + fail("The test case is a prototype."); + } + + /** + * Test of setMsgReply method, of class org.jlink.net.ll.LLEvent. + */ + public void testSetMsgReply() { + System.out.println("setMsgReply"); + + long reply = 0L; + LLEvent instance = new LLEvent(); + + instance.setMsgReply(reply); + + // TODO review the generated test code and remove the default call to fail. + fail("The test case is a prototype."); + } + + /** + * Test of getInt method, of class org.jlink.net.ll.LLEvent. + */ + public void testGetInt() { + System.out.println("getInt"); + + LLEvent instance = new LLEvent(); + + int expResult = -1; + int result = instance.getInt(); + assertEquals(expResult, result); + + instance.setInt(15); + result = instance.getInt(); + expResult = 15; + assertEquals(expResult, result); + } + + /** + * Test of setInt method, of class org.jlink.net.ll.LLEvent. + */ + public void testSetInt() { + System.out.println("setInt"); + + int val = 0; + LLEvent instance = new LLEvent(); + + instance.setInt(val); + + // TODO review the generated test code and remove the default call to fail. + fail("The test case is a prototype."); + } + + /** + * Test of getMap method, of class org.jlink.net.ll.LLEvent. + */ + public void testGetMap() { + System.out.println("getMap"); + + LLEvent instance = new LLEvent(); + + Map expResult = null; + Map result = instance.getMap(); + assertEquals(expResult, result); + + // TODO review the generated test code and remove the default call to fail. + fail("The test case is a prototype."); + } + + /** + * Test of setMap method, of class org.jlink.net.ll.LLEvent. + */ + public void testSetMap() { + System.out.println("setMap"); + + Map m = null; + LLEvent instance = new LLEvent(); + + instance.setMap(m); + + // TODO review the generated test code and remove the default call to fail. + fail("The test case is a prototype."); + } + + /** + * Test of reset method, of class org.jlink.net.ll.LLEvent. + */ + public void testReset() { + System.out.println("reset"); + + LLEvent instance = new LLEvent(); + instance.setMsgID(123L); + instance.setMsgClass(0); + instance.reset(); + assertEquals(-1, instance.getMsgID()); + assertEquals(-1, instance.getMsgClass()); + } + + /** + * Test of validate method, of class org.jlink.net.ll.LLEvent. + */ + public void testValidate() { + System.out.println("validate"); + + LLEvent instance = new LLEvent(); + + assertEquals(false, instance.validate()); + instance.setMsgID(123L); + assertEquals(false, instance.validate()); + instance.setMsgClass(0); + assertEquals(true, instance.validate()); + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |