mirror of
https://github.com/2OOP/pism.git
synced 2026-02-04 02:44:50 +00:00
init commit
This commit is contained in:
38
.gitignore
vendored
Normal file
38
.gitignore
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea/modules.xml
|
||||
.idea/jarRepositories.xml
|
||||
.idea/compiler.xml
|
||||
.idea/libraries/
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### Eclipse ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Mac OS ###
|
||||
.DS_Store
|
||||
8
.idea/.gitignore
generated
vendored
Normal file
8
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
7
.idea/encodings.xml
generated
Normal file
7
.idea/encodings.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
||||
14
.idea/misc.xml
generated
Normal file
14
.idea/misc.xml
generated
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="MavenProjectsManager">
|
||||
<option name="originalFiles">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/pom.xml" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_X" project-jdk-name="openjdk-24" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
25
pom.xml
Normal file
25
pom.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.toop</groupId>
|
||||
<artifactId>pis</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>24</maven.compiler.source>
|
||||
<maven.compiler.target>24</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.13.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
4
src/main/java/org/toop/Client.java
Normal file
4
src/main/java/org/toop/Client.java
Normal file
@@ -0,0 +1,4 @@
|
||||
package org.toop;
|
||||
|
||||
public class Client {
|
||||
}
|
||||
7
src/main/java/org/toop/Main.java
Normal file
7
src/main/java/org/toop/Main.java
Normal file
@@ -0,0 +1,7 @@
|
||||
package org.toop;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
Server server = new Server("0.0.0.0", "5000");
|
||||
}
|
||||
}
|
||||
29
src/main/java/org/toop/Server.java
Normal file
29
src/main/java/org/toop/Server.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package org.toop;
|
||||
|
||||
public class Server {
|
||||
|
||||
String ip;
|
||||
String port;
|
||||
|
||||
public Server(String set_ip, String set_port) {
|
||||
ip = set_ip;
|
||||
port = set_port;
|
||||
}
|
||||
|
||||
public String getIp() {
|
||||
return ip;
|
||||
}
|
||||
|
||||
public void setIp(String ip) {
|
||||
this.ip = ip;
|
||||
}
|
||||
|
||||
public String getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
public void setPort(String port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
}
|
||||
37
src/test/java/ServerTest.java
Normal file
37
src/test/java/ServerTest.java
Normal file
@@ -0,0 +1,37 @@
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.toop.Server;
|
||||
|
||||
public class ServerTest {
|
||||
|
||||
private Server server;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
server = new Server("127.0.0.1", "8080");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConstructorSetsValues() {
|
||||
Assert.assertEquals("127.0.0.1", server.getIp());
|
||||
Assert.assertEquals("8080", server.getPort());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetIpUpdatesValue() {
|
||||
server.setIp("192.168.1.1");
|
||||
Assert.assertEquals("192.168.1.1", server.getIp());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetPortUpdatesValue() {
|
||||
server.setPort("9090");
|
||||
Assert.assertEquals("9090", server.getPort());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNotNullAfterConstruction() {
|
||||
Assert.assertNotNull(server);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user