Adding the basic skeleton for java src and JUnit test

This commit is contained in:
Chaitanya Shrikhande 2015-12-08 10:15:14 +05:30
Родитель ee274b58c2
Коммит 762a949f7d
8 изменённых файлов: 214 добавлений и 0 удалений

21
pom.xml Normal file
Просмотреть файл

@ -0,0 +1,21 @@
<?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>com.microsoft.vmware</groupId>
<artifactId>module-main</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<modules>
<module>src</module>
<module>tests</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

47
src/Tools/pom.xml Normal file
Просмотреть файл

@ -0,0 +1,47 @@
<?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>
<parent>
<groupId>com.microsoft.vmware.src</groupId>
<artifactId>src</artifactId>
<version>1.0</version>
</parent>
<groupId>com.microsoft.vmware.tools</groupId>
<artifactId>Tools</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<build>
<sourceDirectory>./vmware</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<includes><include>**</include></includes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<outputDirectory>../../_build</outputDirectory>
</configuration>
<executions>
<execution>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

Просмотреть файл

@ -0,0 +1,14 @@
package app1;
public class App1 {
public String addStrings(String firstStr, String secndStr)
{
return firstStr + secndStr;
}
public String anyOtherMethod(String imputStr)
{
return imputStr;
}
}

22
src/pom.xml Normal file
Просмотреть файл

@ -0,0 +1,22 @@
<?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>
<parent>
<groupId>com.microsoft.vmware</groupId>
<artifactId>module-main</artifactId>
<version>1.0</version>
</parent>
<groupId>com.microsoft.vmware.src</groupId>
<artifactId>src</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<modules>
<module>Tools</module>
</modules>
</project>

54
tests/Tools/pom.xml Normal file
Просмотреть файл

@ -0,0 +1,54 @@
<?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>
<parent>
<groupId>com.microsoft.vmware.tests</groupId>
<artifactId>tests</artifactId>
<version>1.0</version>
</parent>
<artifactId>TestTools</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.microsoft.vmware.tools</groupId>
<artifactId>Tools</artifactId>
<version>1.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>./vmware</sourceDirectory>
<testSourceDirectory>.\vmware</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<outputDirectory>../../_build</outputDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19</version>
<configuration>
<reportsDirectory>../../_build</reportsDirectory>
</configuration>
</plugin>
</plugins>
</build>
</project>

Просмотреть файл

@ -0,0 +1,21 @@
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import app1.App1;
public class App1Test {
@Test
public void TestAddApp() {
app1.App1 app = new app1.App1();
String addedStr = app.addStrings("a","bc");
assertEquals("abc1", addedStr);
}
@Test
public void Test1AddApp() {
app1.App1 app = new app1.App1();
String addedStr = app.addStrings("ab","bc");
assertEquals("abbc", addedStr);
}
}

Просмотреть файл

@ -0,0 +1,13 @@
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import app1.App1;
public class AppTest {
@Test
public void TestAddApp() {
app1.App1 app = new app1.App1();
String addedStr = app.addStrings("a","bc");
assertEquals("abc", addedStr);
}
}

22
tests/pom.xml Normal file
Просмотреть файл

@ -0,0 +1,22 @@
<?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>
<parent>
<groupId>com.microsoft.vmware</groupId>
<artifactId>module-main</artifactId>
<version>1.0</version>
</parent>
<groupId>com.microsoft.vmware.tests</groupId>
<artifactId>tests</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<modules>
<module>Tools</module>
</modules>
</project>