Skip to content

Commit bf8287f

Browse files
committed
初次提交
0 parents  commit bf8287f

32 files changed

+755
-0
lines changed

.classpath

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" output="target/classes" path="src/main/java">
4+
<attributes>
5+
<attribute name="optional" value="true"/>
6+
<attribute name="maven.pomderived" value="true"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
10+
<attributes>
11+
<attribute name="optional" value="true"/>
12+
<attribute name="maven.pomderived" value="true"/>
13+
</attributes>
14+
</classpathentry>
15+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
16+
<attributes>
17+
<attribute name="maven.pomderived" value="true"/>
18+
</attributes>
19+
</classpathentry>
20+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
21+
<attributes>
22+
<attribute name="maven.pomderived" value="true"/>
23+
</attributes>
24+
</classpathentry>
25+
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
26+
<classpathentry kind="output" path="target/classes"/>
27+
</classpath>

.project

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>WhiteBoxTest</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.m2e.core.maven2Builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.jdt.core.javanature</nature>
21+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
22+
</natures>
23+
</projectDescription>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
eclipse.preferences.version=1
2+
encoding//src/main/java=UTF-8
3+
encoding//src/test/java=UTF-8
4+
encoding/<project>=UTF-8
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
3+
org.eclipse.jdt.core.compiler.compliance=1.5
4+
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
5+
org.eclipse.jdt.core.compiler.source=1.5

pom.xml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<groupId>cn.swust</groupId>
6+
<artifactId>software.whitebox</artifactId>
7+
<version>0.0.1-SNAPSHOT</version>
8+
<packaging>jar</packaging>
9+
10+
<name>whitebox</name>
11+
<url>http://maven.apache.org</url>
12+
13+
<properties>
14+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15+
</properties>
16+
17+
<dependencies>
18+
<dependency>
19+
<groupId>junit</groupId>
20+
<artifactId>junit</artifactId>
21+
<version>3.8.1</version>
22+
<scope>test</scope>
23+
</dependency>
24+
<dependency>
25+
<groupId>org.powermock</groupId>
26+
<artifactId>powermock-module-junit4</artifactId>
27+
<version>1.6.5</version>
28+
<scope>test</scope>
29+
</dependency>
30+
<dependency>
31+
<groupId>org.powermock</groupId>
32+
<artifactId>powermock-api-mockito</artifactId>
33+
<version>1.6.5</version>
34+
<scope>test</scope>
35+
</dependency>
36+
<dependency>
37+
<groupId>org.mockito</groupId>
38+
<artifactId>mockito-all</artifactId>
39+
<version>1.10.19</version>
40+
<scope>test</scope>
41+
</dependency>
42+
<dependency>
43+
<groupId>ca.mcgill.sable</groupId>
44+
<artifactId>soot</artifactId>
45+
<version>3.0.0-SNAPSHOT</version>
46+
<scope>system</scope>
47+
<systemPath>${project.basedir}/lib/sootclasses-trunk.jar</systemPath>
48+
</dependency>
49+
</dependencies>
50+
51+
<!-- <repositories>
52+
<repository>
53+
<id>soot-snapshot</id>
54+
<name>soot snapshots</name>
55+
<url>http://soot-build.cs.uni-paderborn.de/nexus/repository/soot-snapshot/</url>
56+
</repository>
57+
</repositories> -->
58+
</project>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package cn.swust.software.unittest.demo;
2+
3+
public class AddFun {
4+
5+
public int addThree(int a, int b, int c) {
6+
return addTwo(a, b) + c;
7+
}
8+
9+
public int addTwo(int a, int b) {
10+
return a - b;
11+
}
12+
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package cn.swust.software.unittest.demo;
2+
3+
public class AddThreeFun {
4+
5+
AddTwoFun addTwo = new AddTwoFun();
6+
7+
public int add(int a,
8+
int b, int c)
9+
{
10+
return c + addTwo.add(a, b);
11+
}
12+
13+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package cn.swust.software.unittest.demo;
2+
3+
public class AddTwoFun {
4+
public int add(int a, int b)
5+
{
6+
return a - b;
7+
}
8+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package cn.swust.software.unittest.exam1;
2+
3+
public class Addition {
4+
double currentSum = 0;
5+
6+
public double add(double figure) {
7+
currentSum += figure;
8+
return currentSum;
9+
}
10+
public double getSum()
11+
{
12+
return currentSum;
13+
}
14+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package cn.swust.software.unittest.exam1;
2+
3+
public class Cutstring {
4+
public String[] cutString(String Stence) {
5+
String[] str = Stence.split(" ");
6+
return str;
7+
}
8+
9+
public double fraction(String fractionstr) {
10+
int pos = 0;
11+
for (int i = 0; i < fractionstr.length(); i++) {
12+
if (fractionstr.charAt(i) == '/') {
13+
pos = i;
14+
}
15+
}
16+
String molecule = fractionstr.substring(0, pos);
17+
String denominator = fractionstr.substring(pos + 1, fractionstr.length());
18+
double value = Double.parseDouble(molecule) / Double.parseDouble(denominator);
19+
return value;
20+
}
21+
22+
}

0 commit comments

Comments
 (0)