Pārlūkot izejas kodu

removed subprojects

develop
Robin Thoni 8 gadus atpakaļ
vecāks
revīzija
3868e572eb
28 mainītis faili ar 64 papildinājumiem un 214 dzēšanām
  1. 0
    16
      client/client.iml
  2. 0
    22
      client/pom.xml
  3. 0
    17
      common/common.iml
  4. 0
    29
      common/pom.xml
  5. 4
    13
      pom.xml
  6. 0
    23
      server/pom.xml
  7. 0
    18
      server/server.iml
  8. 1
    1
      src/main/java/com/uqac/rthoni/java_rmi/Main.java
  9. 0
    0
      src/main/java/com/uqac/rthoni/java_rmi/client/ClientApplication.java
  10. 0
    1
      src/main/java/com/uqac/rthoni/java_rmi/common/Command.java
  11. 0
    0
      src/main/java/com/uqac/rthoni/java_rmi/common/ReflectionUtil.java
  12. 0
    1
      src/main/java/com/uqac/rthoni/java_rmi/server/ServerApplication.java
  13. 0
    0
      src/main/java/com/uqac/rthoni/java_rmi/server/executors/AbstractCommandExecutor.java
  14. 0
    3
      src/main/java/com/uqac/rthoni/java_rmi/server/executors/ClassBuilderExecutor.java
  15. 0
    0
      src/main/java/com/uqac/rthoni/java_rmi/server/executors/ClassLoaderExecutor.java
  16. 0
    0
      src/main/java/com/uqac/rthoni/java_rmi/server/executors/MethodExecutor.java
  17. 0
    0
      src/main/java/com/uqac/rthoni/java_rmi/server/executors/NewInstanceExecutor.java
  18. 0
    0
      src/main/java/com/uqac/rthoni/java_rmi/server/executors/ReadExecutor.java
  19. 0
    0
      src/main/java/com/uqac/rthoni/java_rmi/server/executors/TestExecutor.java
  20. 0
    0
      src/main/java/com/uqac/rthoni/java_rmi/server/executors/WriteExecutor.java
  21. 21
    24
      src/test/java/com/uqac/rthoni/java_rmi/common/CommandTest.java
  22. 0
    0
      src/test/java/com/uqac/rthoni/java_rmi/server/executors/AbstractTest.java
  23. 6
    7
      src/test/java/com/uqac/rthoni/java_rmi/server/executors/MethodExecutorTest.java
  24. 7
    11
      src/test/java/com/uqac/rthoni/java_rmi/server/executors/NewInstanceExecutorTest.java
  25. 7
    8
      src/test/java/com/uqac/rthoni/java_rmi/server/executors/ReadExecutorTest.java
  26. 0
    0
      src/test/java/com/uqac/rthoni/java_rmi/server/executors/TestDbo.java
  27. 16
    17
      src/test/java/com/uqac/rthoni/java_rmi/server/executors/WriteExecutorTest.java
  28. 2
    3
      uqac-java-rmi.iml

+ 0
- 16
client/client.iml Parādīt failu

@@ -1,16 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3
-  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
4
-    <output url="file://$MODULE_DIR$/target/classes" />
5
-    <output-test url="file://$MODULE_DIR$/target/test-classes" />
6
-    <content url="file://$MODULE_DIR$">
7
-      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
8
-      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
9
-      <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
10
-      <excludeFolder url="file://$MODULE_DIR$/target" />
11
-    </content>
12
-    <orderEntry type="inheritedJdk" />
13
-    <orderEntry type="sourceFolder" forTests="false" />
14
-    <orderEntry type="module" module-name="common" />
15
-  </component>
16
-</module>

+ 0
- 22
client/pom.xml Parādīt failu

@@ -1,22 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project xmlns="http://maven.apache.org/POM/4.0.0"
3
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
-    <parent>
6
-        <artifactId>java-rmi</artifactId>
7
-        <groupId>com.uqac.rthoni</groupId>
8
-        <version>0.1</version>
9
-    </parent>
10
-    <modelVersion>4.0.0</modelVersion>
11
-
12
-    <artifactId>client</artifactId>
13
-    <dependencies>
14
-        <dependency>
15
-            <groupId>com.uqac.rthoni</groupId>
16
-            <artifactId>common</artifactId>
17
-            <version>0.1</version>
18
-        </dependency>
19
-    </dependencies>
20
-
21
-
22
-</project>

+ 0
- 17
common/common.iml Parādīt failu

@@ -1,17 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3
-  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
4
-    <output url="file://$MODULE_DIR$/target/classes" />
5
-    <output-test url="file://$MODULE_DIR$/target/test-classes" />
6
-    <content url="file://$MODULE_DIR$">
7
-      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
8
-      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
9
-      <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
10
-      <excludeFolder url="file://$MODULE_DIR$/target" />
11
-    </content>
12
-    <orderEntry type="inheritedJdk" />
13
-    <orderEntry type="sourceFolder" forTests="false" />
14
-    <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
15
-    <orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
16
-  </component>
17
-</module>

+ 0
- 29
common/pom.xml Parādīt failu

@@ -1,29 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project xmlns="http://maven.apache.org/POM/4.0.0"
3
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
-    <parent>
6
-        <artifactId>java-rmi</artifactId>
7
-        <groupId>com.uqac.rthoni</groupId>
8
-        <version>0.1</version>
9
-    </parent>
10
-    <modelVersion>4.0.0</modelVersion>
11
-
12
-    <artifactId>common</artifactId>
13
-    <dependencies>
14
-        <dependency>
15
-            <groupId>junit</groupId>
16
-            <artifactId>junit</artifactId>
17
-            <version>4.12</version>
18
-            <scope>test</scope>
19
-        </dependency>
20
-        <dependency>
21
-            <groupId>junit</groupId>
22
-            <artifactId>junit</artifactId>
23
-            <version>4.12</version>
24
-            <scope>test</scope>
25
-        </dependency>
26
-    </dependencies>
27
-
28
-
29
-</project>

+ 4
- 13
pom.xml Parādīt failu

@@ -8,21 +8,12 @@
8 8
     <artifactId>java-rmi</artifactId>
9 9
     <packaging>pom</packaging>
10 10
     <version>0.1</version>
11
-    <modules>
12
-        <module>server</module>
13
-        <module>client</module>
14
-        <module>common</module>
15
-    </modules>
16 11
     <dependencies>
17 12
         <dependency>
18
-            <groupId>com.uqac.rthoni</groupId>
19
-            <artifactId>client</artifactId>
20
-            <version>0.1</version>
21
-        </dependency>
22
-        <dependency>
23
-            <groupId>com.uqac.rthoni</groupId>
24
-            <artifactId>server</artifactId>
25
-            <version>0.1</version>
13
+            <groupId>junit</groupId>
14
+            <artifactId>junit</artifactId>
15
+            <version>4.12</version>
16
+            <scope>test</scope>
26 17
         </dependency>
27 18
     </dependencies>
28 19
 

+ 0
- 23
server/pom.xml Parādīt failu

@@ -1,23 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project xmlns="http://maven.apache.org/POM/4.0.0"
3
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
-    <parent>
6
-        <artifactId>java-rmi</artifactId>
7
-        <groupId>com.uqac.rthoni</groupId>
8
-        <version>0.1</version>
9
-    </parent>
10
-    <modelVersion>4.0.0</modelVersion>
11
-
12
-    <artifactId>server</artifactId>
13
-    <dependencies>
14
-        <dependency>
15
-            <groupId>junit</groupId>
16
-            <artifactId>junit</artifactId>
17
-            <version>4.12</version>
18
-            <scope>test</scope>
19
-        </dependency>
20
-    </dependencies>
21
-
22
-
23
-</project>

+ 0
- 18
server/server.iml Parādīt failu

@@ -1,18 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3
-  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
4
-    <output url="file://$MODULE_DIR$/target/classes" />
5
-    <output-test url="file://$MODULE_DIR$/target/test-classes" />
6
-    <content url="file://$MODULE_DIR$">
7
-      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
8
-      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
9
-      <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
10
-      <excludeFolder url="file://$MODULE_DIR$/target" />
11
-    </content>
12
-    <orderEntry type="inheritedJdk" />
13
-    <orderEntry type="sourceFolder" forTests="false" />
14
-    <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
15
-    <orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
16
-    <orderEntry type="module" module-name="common" />
17
-  </component>
18
-</module>

+ 1
- 1
src/main/java/com/uqac/rthoni/java_rmi/Main.java Parādīt failu

@@ -60,7 +60,7 @@ public class Main {
60 60
             usage(name, true);
61 61
         }
62 62
         String mode = args[0];
63
-        if (mode.equals("server")) {
63
+        if (mode.equals("com/uqac/rthoni/java_rmi/server")) {
64 64
             int port = getPort(name, args[1]);
65 65
             String sourceDir = args[2];
66 66
             String classDir = args[3];

client/src/main/java/com/uqac/rthoni/java_rmi/client/ClientApplication.java → src/main/java/com/uqac/rthoni/java_rmi/client/ClientApplication.java Parādīt failu


common/src/main/java/com/uqac/rthoni/java_rmi/common/Command.java → src/main/java/com/uqac/rthoni/java_rmi/common/Command.java Parādīt failu

@@ -2,7 +2,6 @@ package com.uqac.rthoni.java_rmi.common;
2 2
 
3 3
 import java.io.Serializable;
4 4
 import java.util.Arrays;
5
-import java.util.Collections;
6 5
 import java.util.Vector;
7 6
 import java.util.stream.Collectors;
8 7
 

common/src/main/java/com/uqac/rthoni/java_rmi/common/ReflectionUtil.java → src/main/java/com/uqac/rthoni/java_rmi/common/ReflectionUtil.java Parādīt failu


server/src/main/java/com/uqac/rthoni/java_rmi/server/ServerApplication.java → src/main/java/com/uqac/rthoni/java_rmi/server/ServerApplication.java Parādīt failu

@@ -2,7 +2,6 @@ package com.uqac.rthoni.java_rmi.server;
2 2
 
3 3
 import com.uqac.rthoni.java_rmi.server.executors.AbstractCommandExecutor;
4 4
 import com.uqac.rthoni.java_rmi.common.Command;
5
-import javafx.beans.binding.ObjectExpression;
6 5
 
7 6
 import java.io.BufferedReader;
8 7
 import java.io.IOException;

server/src/main/java/com/uqac/rthoni/java_rmi/server/executors/AbstractCommandExecutor.java → src/main/java/com/uqac/rthoni/java_rmi/server/executors/AbstractCommandExecutor.java Parādīt failu


server/src/main/java/com/uqac/rthoni/java_rmi/server/executors/ClassBuilderExecutor.java → src/main/java/com/uqac/rthoni/java_rmi/server/executors/ClassBuilderExecutor.java Parādīt failu

@@ -7,10 +7,7 @@ import javax.tools.JavaCompiler;
7 7
 import javax.tools.ToolProvider;
8 8
 import java.io.ByteArrayOutputStream;
9 9
 import java.io.File;
10
-import java.net.URL;
11
-import java.net.URLClassLoader;
12 10
 import java.nio.charset.StandardCharsets;
13
-import java.nio.file.Files;
14 11
 import java.util.List;
15 12
 import java.util.Vector;
16 13
 import java.util.stream.Collectors;

server/src/main/java/com/uqac/rthoni/java_rmi/server/executors/ClassLoaderExecutor.java → src/main/java/com/uqac/rthoni/java_rmi/server/executors/ClassLoaderExecutor.java Parādīt failu


server/src/main/java/com/uqac/rthoni/java_rmi/server/executors/MethodExecutor.java → src/main/java/com/uqac/rthoni/java_rmi/server/executors/MethodExecutor.java Parādīt failu


server/src/main/java/com/uqac/rthoni/java_rmi/server/executors/NewInstanceExecutor.java → src/main/java/com/uqac/rthoni/java_rmi/server/executors/NewInstanceExecutor.java Parādīt failu


server/src/main/java/com/uqac/rthoni/java_rmi/server/executors/ReadExecutor.java → src/main/java/com/uqac/rthoni/java_rmi/server/executors/ReadExecutor.java Parādīt failu


server/src/main/java/com/uqac/rthoni/java_rmi/server/executors/TestExecutor.java → src/main/java/com/uqac/rthoni/java_rmi/server/executors/TestExecutor.java Parādīt failu


server/src/main/java/com/uqac/rthoni/java_rmi/server/executors/WriteExecutor.java → src/main/java/com/uqac/rthoni/java_rmi/server/executors/WriteExecutor.java Parādīt failu


common/src/test/java/com/uqac/rthoni/java_rmi/common/CommandTest.java → src/test/java/com/uqac/rthoni/java_rmi/common/CommandTest.java Parādīt failu

@@ -1,12 +1,9 @@
1 1
 package com.uqac.rthoni.java_rmi.common;
2 2
 
3
-import com.sun.corba.se.impl.orbutil.ObjectWriter;
3
+import com.uqac.rthoni.java_rmi.common.Command;
4
+import org.junit.Assert;
4 5
 import org.junit.Test;
5 6
 
6
-import java.io.ByteArrayOutputStream;
7
-import java.io.ObjectOutputStream;
8
-
9
-import static org.junit.Assert.*;
10 7
 
11 8
 /**
12 9
  * Created by robin on 9/15/16.
@@ -28,7 +25,7 @@ public class CommandTest {
28 25
     {
29 26
         Command c = new Command(null);
30 27
         String result = commandToString(c);
31
-        assertEquals(result, "Unknown");
28
+        Assert.assertEquals(result, "Unknown");
32 29
     }
33 30
 
34 31
     @Test
@@ -36,7 +33,7 @@ public class CommandTest {
36 33
     {
37 34
         Command c = new Command("");
38 35
         String result = commandToString(c);
39
-        assertEquals(result, "Unknown");
36
+        Assert.assertEquals(result, "Unknown");
40 37
     }
41 38
 
42 39
     @Test
@@ -44,7 +41,7 @@ public class CommandTest {
44 41
     {
45 42
         Command c = new Command("Test");
46 43
         String result = commandToString(c);
47
-        assertEquals(result, "Test");
44
+        Assert.assertEquals(result, "Test");
48 45
     }
49 46
 
50 47
     @Test
@@ -53,7 +50,7 @@ public class CommandTest {
53 50
         Command c = new Command("Test");
54 51
         c.addArgument("an_argument");
55 52
         String result = commandToString(c);
56
-        assertEquals(result, "Test#an_argument");
53
+        Assert.assertEquals(result, "Test#an_argument");
57 54
     }
58 55
 
59 56
     @Test
@@ -63,50 +60,50 @@ public class CommandTest {
63 60
         c.addArgument("an_argument");
64 61
         c.addArgument("an_argument2");
65 62
         String result = commandToString(c);
66
-        assertEquals(result, "Test#an_argument#an_argument2");
63
+        Assert.assertEquals(result, "Test#an_argument#an_argument2");
67 64
     }
68 65
 
69 66
     @Test
70 67
     public void testCommandDeserializeNull() throws Exception
71 68
     {
72 69
         Command c = Command.fromString(null);
73
-        assertNull(c);
70
+        Assert.assertNull(c);
74 71
     }
75 72
 
76 73
     @Test
77 74
     public void testCommandDeserializeEmpty() throws Exception
78 75
     {
79 76
         Command c = Command.fromString("");
80
-        assertNull(c);
77
+        Assert.assertNull(c);
81 78
     }
82 79
 
83 80
     @Test
84 81
     public void testCommandDeserializeName() throws Exception
85 82
     {
86 83
         Command c = Command.fromString("Test");
87
-        assertNotNull(c);
88
-        assertEquals(c.getCommandName(), "Test");
89
-        assertEquals(c.getArgumentCount(), 0);
84
+        Assert.assertNotNull(c);
85
+        Assert.assertEquals(c.getCommandName(), "Test");
86
+        Assert.assertEquals(c.getArgumentCount(), 0);
90 87
     }
91 88
 
92 89
     @Test
93 90
     public void testCommandDeserializeArgument() throws Exception
94 91
     {
95 92
         Command c = Command.fromString("Test#an_argument");
96
-        assertNotNull(c);
97
-        assertEquals(c.getCommandName(), "Test");
98
-        assertEquals(c.getArgumentCount(), 1);
99
-        assertEquals(c.getArgument(0, false), "an_argument");
93
+        Assert.assertNotNull(c);
94
+        Assert.assertEquals(c.getCommandName(), "Test");
95
+        Assert.assertEquals(c.getArgumentCount(), 1);
96
+        Assert.assertEquals(c.getArgument(0, false), "an_argument");
100 97
     }
101 98
 
102 99
     @Test
103 100
     public void testCommandDeserializeArguments() throws Exception
104 101
     {
105 102
         Command c = Command.fromString("Test#an_argument#an_argument2");
106
-        assertNotNull(c);
107
-        assertEquals(c.getCommandName(), "Test");
108
-        assertEquals(c.getArgumentCount(), 2);
109
-        assertEquals(c.getArgument(0, false), "an_argument");
110
-        assertEquals(c.getArgument(1, false), "an_argument2");
103
+        Assert.assertNotNull(c);
104
+        Assert.assertEquals(c.getCommandName(), "Test");
105
+        Assert.assertEquals(c.getArgumentCount(), 2);
106
+        Assert.assertEquals(c.getArgument(0, false), "an_argument");
107
+        Assert.assertEquals(c.getArgument(1, false), "an_argument2");
111 108
     }
112 109
 }

server/src/test/java/com/uqac/rthoni/java_rmi/server/executors/AbstractTest.java → src/test/java/com/uqac/rthoni/java_rmi/server/executors/AbstractTest.java Parādīt failu


server/src/test/java/com/uqac/rthoni/java_rmi/server/executors/MethodExecutorTest.java → src/test/java/com/uqac/rthoni/java_rmi/server/executors/MethodExecutorTest.java Parādīt failu

@@ -1,10 +1,9 @@
1 1
 package com.uqac.rthoni.java_rmi.server.executors;
2 2
 
3 3
 import com.uqac.rthoni.java_rmi.server.ServerApplication;
4
+import org.junit.Assert;
4 5
 import org.junit.Test;
5 6
 
6
-import static org.junit.Assert.*;
7
-
8 7
 /**
9 8
  * Created by robin on 9/16/16.
10 9
  */
@@ -16,7 +15,7 @@ public class MethodExecutorTest extends AbstractTest {
16 15
         ServerApplication app = getServer();
17 16
         String res = runCommands(app, "creation#com.uqac.rthoni.java_rmi.server.executors.TestDbo#test",
18 17
                 "fonction#test#getMyself#java.lang.String:a_value");
19
-        assertEquals("a_value", res);
18
+        Assert.assertEquals("a_value", res);
20 19
     }
21 20
 
22 21
     @Test
@@ -25,7 +24,7 @@ public class MethodExecutorTest extends AbstractTest {
25 24
         ServerApplication app = getServer();
26 25
         String res = runCommands(app, "creation#com.uqac.rthoni.java_rmi.server.executors.TestDbo#test",
27 26
                 "fonction#test#uselessMethod#int:42,int:24,java.lang.String:a_value");
28
-        assertEquals("NULL", res);
27
+        Assert.assertEquals("NULL", res);
29 28
     }
30 29
 
31 30
     @Test
@@ -36,7 +35,7 @@ public class MethodExecutorTest extends AbstractTest {
36 35
                 "creation#com.uqac.rthoni.java_rmi.server.executors.TestDbo#test2",
37 36
                 "ecriture#test2#privateString#some_value",
38 37
                 "fonction#test#getMyString#com.uqac.rthoni.java_rmi.server.executors.TestDbo:ID(test2)");
39
-        assertEquals("some_value", res);
38
+        Assert.assertEquals("some_value", res);
40 39
     }
41 40
 
42 41
     @Test
@@ -47,7 +46,7 @@ public class MethodExecutorTest extends AbstractTest {
47 46
                 "creation#com.uqac.rthoni.java_rmi.server.executors.TestDbo#test2",
48 47
                 "fonction#test2#setPrivateString#java.lang.String:some_value",
49 48
                 "fonction#test#getMyString#com.uqac.rthoni.java_rmi.server.executors.TestDbo:ID(test2)");
50
-        assertEquals("NULL\nsome_value", res);
49
+        Assert.assertEquals("NULL\nsome_value", res);
51 50
     }
52 51
 
53 52
     @Test
@@ -58,6 +57,6 @@ public class MethodExecutorTest extends AbstractTest {
58 57
                 "creation#com.uqac.rthoni.java_rmi.server.executors.TestDbo#test2",
59 58
                 "fonction#test#setPrivateString#java.lang.String:some_value",
60 59
                 "fonction#test#getPrivateString");
61
-        assertEquals("NULL\nsome_value", res);
60
+        Assert.assertEquals("NULL\nsome_value", res);
62 61
     }
63 62
 }

server/src/test/java/com/uqac/rthoni/java_rmi/server/executors/NewInstanceExecutorTest.java → src/test/java/com/uqac/rthoni/java_rmi/server/executors/NewInstanceExecutorTest.java Parādīt failu

@@ -1,13 +1,9 @@
1 1
 package com.uqac.rthoni.java_rmi.server.executors;
2 2
 
3
-import com.uqac.rthoni.java_rmi.common.Command;
4 3
 import com.uqac.rthoni.java_rmi.server.ServerApplication;
4
+import org.junit.Assert;
5 5
 import org.junit.Test;
6 6
 
7
-import java.util.Arrays;
8
-
9
-import static org.junit.Assert.*;
10
-
11 7
 /**
12 8
  * Created by robin on 9/16/16.
13 9
  */
@@ -18,10 +14,10 @@ public class NewInstanceExecutorTest extends AbstractTest {
18 14
     {
19 15
         ServerApplication app = getServer();
20 16
         String res = runCommand(app, "creation#com.uqac.rthoni.java_rmi.server.executors.TestDbo#test");
21
-        assertNull(res);
17
+        Assert.assertNull(res);
22 18
         Object obj = app.getObject("test");
23
-        assertNotNull(obj);
24
-        assertEquals(obj.toString(), "privateString=default_value, privateInt=24, publicInt=42, aPrivateField=0, publicFloat=0.420000, publicDouble=0.125000, publicBool=true");
19
+        Assert.assertNotNull(obj);
20
+        Assert.assertEquals(obj.toString(), "privateString=default_value, privateInt=24, publicInt=42, aPrivateField=0, publicFloat=0.420000, publicDouble=0.125000, publicBool=true");
25 21
     }
26 22
 
27 23
     @Test
@@ -29,10 +25,10 @@ public class NewInstanceExecutorTest extends AbstractTest {
29 25
     {
30 26
         ServerApplication app = getServer();
31 27
         String res = runCommand(app, "creation#java.lang.String#mystr");
32
-        assertNull(res);
28
+        Assert.assertNull(res);
33 29
         Object obj = app.getObject("mystr");
34
-        assertNotNull(obj);
35
-        assertEquals(obj.toString(), "");
30
+        Assert.assertNotNull(obj);
31
+        Assert.assertEquals(obj.toString(), "");
36 32
     }
37 33
 
38 34
     @Test(expected = ClassNotFoundException.class)

server/src/test/java/com/uqac/rthoni/java_rmi/server/executors/ReadExecutorTest.java → src/test/java/com/uqac/rthoni/java_rmi/server/executors/ReadExecutorTest.java Parādīt failu

@@ -1,10 +1,9 @@
1 1
 package com.uqac.rthoni.java_rmi.server.executors;
2 2
 
3 3
 import com.uqac.rthoni.java_rmi.server.ServerApplication;
4
+import org.junit.Assert;
4 5
 import org.junit.Test;
5 6
 
6
-import static org.junit.Assert.*;
7
-
8 7
 /**
9 8
  * Created by robin on 9/16/16.
10 9
  */
@@ -16,7 +15,7 @@ public class ReadExecutorTest extends AbstractTest {
16 15
         ServerApplication app = getServer();
17 16
         String res = runCommands(app, "creation#com.uqac.rthoni.java_rmi.server.executors.TestDbo#test",
18 17
                 "lecture#test#publicInt");
19
-        assertEquals("42", res);
18
+        Assert.assertEquals("42", res);
20 19
     }
21 20
 
22 21
     @Test
@@ -25,7 +24,7 @@ public class ReadExecutorTest extends AbstractTest {
25 24
         ServerApplication app = getServer();
26 25
         String res = runCommands(app, "creation#com.uqac.rthoni.java_rmi.server.executors.TestDbo#test",
27 26
                 "lecture#test#privateInt");
28
-        assertEquals("24", res);
27
+        Assert.assertEquals("24", res);
29 28
     }
30 29
 
31 30
     @Test
@@ -34,7 +33,7 @@ public class ReadExecutorTest extends AbstractTest {
34 33
         ServerApplication app = getServer();
35 34
         String res = runCommands(app, "creation#com.uqac.rthoni.java_rmi.server.executors.TestDbo#test",
36 35
                 "lecture#test#privateString");
37
-        assertEquals("default_value", res);
36
+        Assert.assertEquals("default_value", res);
38 37
     }
39 38
 
40 39
     @Test(expected = NoSuchMethodException.class)
@@ -59,7 +58,7 @@ public class ReadExecutorTest extends AbstractTest {
59 58
         ServerApplication app = getServer();
60 59
         String res = runCommands(app, "creation#com.uqac.rthoni.java_rmi.server.executors.TestDbo#test",
61 60
                 "lecture#test#publicFloat");
62
-        assertEquals("0.42", res);
61
+        Assert.assertEquals("0.42", res);
63 62
     }
64 63
 
65 64
     @Test
@@ -68,7 +67,7 @@ public class ReadExecutorTest extends AbstractTest {
68 67
         ServerApplication app = getServer();
69 68
         String res = runCommands(app, "creation#com.uqac.rthoni.java_rmi.server.executors.TestDbo#test",
70 69
                 "lecture#test#publicDouble");
71
-        assertEquals("0.125", res);
70
+        Assert.assertEquals("0.125", res);
72 71
     }
73 72
 
74 73
     @Test
@@ -77,6 +76,6 @@ public class ReadExecutorTest extends AbstractTest {
77 76
         ServerApplication app = getServer();
78 77
         String res = runCommands(app, "creation#com.uqac.rthoni.java_rmi.server.executors.TestDbo#test",
79 78
                 "lecture#test#publicBool");
80
-        assertEquals("true", res);
79
+        Assert.assertEquals("true", res);
81 80
     }
82 81
 }

server/src/test/java/com/uqac/rthoni/java_rmi/server/executors/TestDbo.java → src/test/java/com/uqac/rthoni/java_rmi/server/executors/TestDbo.java Parādīt failu


server/src/test/java/com/uqac/rthoni/java_rmi/server/executors/WriteExecutorTest.java → src/test/java/com/uqac/rthoni/java_rmi/server/executors/WriteExecutorTest.java Parādīt failu

@@ -1,10 +1,9 @@
1 1
 package com.uqac.rthoni.java_rmi.server.executors;
2 2
 
3 3
 import com.uqac.rthoni.java_rmi.server.ServerApplication;
4
+import org.junit.Assert;
4 5
 import org.junit.Test;
5 6
 
6
-import static org.junit.Assert.*;
7
-
8 7
 /**
9 8
  * Created by robin on 9/16/16.
10 9
  */
@@ -17,10 +16,10 @@ public class WriteExecutorTest extends AbstractTest {
17 16
         String res = runCommands(app, "creation#com.uqac.rthoni.java_rmi.server.executors.TestDbo#test",
18 17
                 "ecriture#test#publicInt#24",
19 18
                 "lecture#test#publicInt");
20
-        assertEquals(res, "24");
19
+        Assert.assertEquals(res, "24");
21 20
         Object obj = app.getObject("test");
22
-        assertNotNull(obj);
23
-        assertEquals("privateString=default_value, privateInt=24, publicInt=24, aPrivateField=0, publicFloat=0.420000, publicDouble=0.125000, publicBool=true", obj.toString());
21
+        Assert.assertNotNull(obj);
22
+        Assert.assertEquals("privateString=default_value, privateInt=24, publicInt=24, aPrivateField=0, publicFloat=0.420000, publicDouble=0.125000, publicBool=true", obj.toString());
24 23
     }
25 24
 
26 25
     @Test
@@ -30,10 +29,10 @@ public class WriteExecutorTest extends AbstractTest {
30 29
         String res = runCommands(app, "creation#com.uqac.rthoni.java_rmi.server.executors.TestDbo#test",
31 30
                 "ecriture#test#privateInt#42",
32 31
                 "lecture#test#privateInt");
33
-        assertEquals(res, "42");
32
+        Assert.assertEquals(res, "42");
34 33
         Object obj = app.getObject("test");
35
-        assertNotNull(obj);
36
-        assertEquals("privateString=default_value, privateInt=42, publicInt=42, aPrivateField=0, publicFloat=0.420000, publicDouble=0.125000, publicBool=true", obj.toString());
34
+        Assert.assertNotNull(obj);
35
+        Assert.assertEquals("privateString=default_value, privateInt=42, publicInt=42, aPrivateField=0, publicFloat=0.420000, publicDouble=0.125000, publicBool=true", obj.toString());
37 36
     }
38 37
 
39 38
     @Test
@@ -43,10 +42,10 @@ public class WriteExecutorTest extends AbstractTest {
43 42
         String res = runCommands(app, "creation#com.uqac.rthoni.java_rmi.server.executors.TestDbo#test",
44 43
                 "ecriture#test#privateString#a_value",
45 44
                 "lecture#test#privateString");
46
-        assertEquals(res, "a_value");
45
+        Assert.assertEquals(res, "a_value");
47 46
         Object obj = app.getObject("test");
48
-        assertNotNull(obj);
49
-        assertEquals("privateString=a_value, privateInt=24, publicInt=42, aPrivateField=0, publicFloat=0.420000, publicDouble=0.125000, publicBool=true", obj.toString());
47
+        Assert.assertNotNull(obj);
48
+        Assert.assertEquals("privateString=a_value, privateInt=24, publicInt=42, aPrivateField=0, publicFloat=0.420000, publicDouble=0.125000, publicBool=true", obj.toString());
50 49
     }
51 50
 
52 51
     @Test
@@ -56,10 +55,10 @@ public class WriteExecutorTest extends AbstractTest {
56 55
         String res = runCommands(app, "creation#com.uqac.rthoni.java_rmi.server.executors.TestDbo#test",
57 56
                 "ecriture#test#publicFloat#4242.5",
58 57
                 "lecture#test#publicFloat");
59
-        assertEquals(res, "4242.5");
58
+        Assert.assertEquals(res, "4242.5");
60 59
         Object obj = app.getObject("test");
61
-        assertNotNull(obj);
62
-        assertEquals("privateString=default_value, privateInt=24, publicInt=42, aPrivateField=0, publicFloat=4242.500000, publicDouble=0.125000, publicBool=true", obj.toString());
60
+        Assert.assertNotNull(obj);
61
+        Assert.assertEquals("privateString=default_value, privateInt=24, publicInt=42, aPrivateField=0, publicFloat=4242.500000, publicDouble=0.125000, publicBool=true", obj.toString());
63 62
     }
64 63
 
65 64
     @Test
@@ -69,9 +68,9 @@ public class WriteExecutorTest extends AbstractTest {
69 68
         String res = runCommands(app, "creation#com.uqac.rthoni.java_rmi.server.executors.TestDbo#test",
70 69
                 "ecriture#test#publicBool#false",
71 70
                 "lecture#test#publicBool");
72
-        assertEquals(res, "false");
71
+        Assert.assertEquals(res, "false");
73 72
         Object obj = app.getObject("test");
74
-        assertNotNull(obj);
75
-        assertEquals("privateString=default_value, privateInt=24, publicInt=42, aPrivateField=0, publicFloat=0.420000, publicDouble=0.125000, publicBool=false", obj.toString());
73
+        Assert.assertNotNull(obj);
74
+        Assert.assertEquals("privateString=default_value, privateInt=24, publicInt=42, aPrivateField=0, publicFloat=0.420000, publicDouble=0.125000, publicBool=false", obj.toString());
76 75
     }
77 76
 }

+ 2
- 3
uqac-java-rmi.iml Parādīt failu

@@ -11,8 +11,7 @@
11 11
     </content>
12 12
     <orderEntry type="inheritedJdk" />
13 13
     <orderEntry type="sourceFolder" forTests="false" />
14
-    <orderEntry type="module" module-name="client" />
15
-    <orderEntry type="module" module-name="common" />
16
-    <orderEntry type="module" module-name="server" />
14
+    <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
15
+    <orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
17 16
   </component>
18 17
 </module>

Notiek ielāde…
Atcelt
Saglabāt