Skip to content

Commit 0d7184a

Browse files
committed
Initial commit
0 parents  commit 0d7184a

File tree

14 files changed

+10406
-0
lines changed

14 files changed

+10406
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Ignore all Maven target directories
2+
**/target/
3+
4+
# Ignore everything in javaxt-core-build/src/main/java
5+
javaxt-core-build/src/main/java/

README.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# JavaXT Core Test Project
2+
3+
This project is used to test the [javaxt-core](https://github.com/javaxt-project/javaxt-core) library,
4+
providing test coverage for various components and utilities.
5+
6+
The project consists of two main modules that work together to test the javaxt-core library:
7+
8+
1. javaxt-core-build: Builds the javaxt-core library using sources from a local directory or GitHub
9+
2. javaxt-core-test: Runs test scripts
10+
11+
## Building the Project
12+
13+
### Build All Modules (Default Branch)
14+
```bash
15+
mvn clean install
16+
```
17+
18+
### Build with Specific Branch
19+
```bash
20+
# Build using a specific branch (e.g., 'dev')
21+
mvn clean install -Djavaxt.core.branch=dev
22+
23+
# Build using a feature branch
24+
mvn clean install -Djavaxt.core.branch=feat/54
25+
26+
# Build using a specific commit/tag
27+
mvn clean install -Djavaxt.core.branch=v1.11.3
28+
```
29+
30+
### Build with Local javaxt-core Directory
31+
```bash
32+
# Build using local javaxt-core source directory
33+
mvn clean install -Djavaxt.core.local.dir=/path/to/javaxt-core/src
34+
35+
# Example with Windows path (point to src directory)
36+
mvn clean install -Djavaxt.core.local.dir=C:\path\to\javaxt-core\src
37+
38+
```
39+
40+
**Note**: The local directory should point to the source directory containing the javaxt-core Java files (typically the `src` directory), not necessarily a Maven project. The files will be copied and compiled directly in the test project.
41+
42+
## Running Tests
43+
44+
### Run All Tests (Default Branch)
45+
```bash
46+
mvn test
47+
```
48+
49+
### Run Tests with Specific Branch
50+
```bash
51+
# Run tests against a specific branch
52+
mvn test -Djavaxt.core.branch=dev
53+
54+
# Run tests against a feature branch
55+
mvn test -Djavaxt.core.branch=feat/54
56+
```
57+
58+
### Run Tests with Local javaxt-core Directory
59+
```bash
60+
# Run tests against local javaxt-core source
61+
mvn test -Djavaxt.core.local.dir=/path/to/javaxt-core/src
62+
63+
# Example with Windows path (point to src directory)
64+
mvn test -Djavaxt.core.local.dir=C:\path\to\javaxt-core\src
65+
```
66+
67+
## Contributing
68+
69+
When adding new tests:
70+
1. Place test classes in the appropriate package under `javaxt-core-test/src/test/java/`
71+
2. Follow the existing naming conventions
72+
3. Include comprehensive test coverage for edge cases
73+
4. Add any additional resources to `javaxt-core-test/src/main/resources/`

javaxt-core-build/pom.xml

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
<?xml version="1.0"?>
2+
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4+
<modelVersion>4.0.0</modelVersion>
5+
<parent>
6+
<groupId>javaxt</groupId>
7+
<artifactId>javaxt-core-test</artifactId>
8+
<version>dev</version>
9+
</parent>
10+
<groupId>javaxt.core.build</groupId>
11+
<artifactId>javaxt-core-build</artifactId>
12+
<version>dev</version>
13+
<name>javaxt-core-build</name>
14+
<dependencies>
15+
<dependency>
16+
<groupId>junit</groupId>
17+
<artifactId>junit</artifactId>
18+
<version>3.8.1</version>
19+
<scope>test</scope>
20+
</dependency>
21+
</dependencies>
22+
<profiles>
23+
<profile>
24+
<id>github-sources</id>
25+
<activation>
26+
<property>
27+
<name>!javaxt.core.local.dir</name>
28+
</property>
29+
</activation>
30+
<build>
31+
<plugins>
32+
<plugin>
33+
<groupId>org.apache.maven.plugins</groupId>
34+
<artifactId>maven-scm-plugin</artifactId>
35+
<version>1.11.3</version>
36+
<configuration>
37+
<connectionType>scm:git</connectionType>
38+
<connectionUrl>scm:git:https://github.com/javaxt-project/javaxt-core.git</connectionUrl>
39+
<developerConnectionUrl>scm:git:https://github.com/javaxt-project/javaxt-core.git</developerConnectionUrl>
40+
<checkoutDirectory>${project.build.directory}/javaxt-core-src</checkoutDirectory>
41+
<branch>${javaxt.core.branch:main}</branch>
42+
</configuration>
43+
<executions>
44+
<execution>
45+
<id>checkout-javaxt-core</id>
46+
<phase>generate-sources</phase>
47+
<goals>
48+
<goal>checkout</goal>
49+
</goals>
50+
</execution>
51+
</executions>
52+
</plugin>
53+
54+
<plugin>
55+
<groupId>org.apache.maven.plugins</groupId>
56+
<artifactId>maven-antrun-plugin</artifactId>
57+
<version>3.0.0</version>
58+
<executions>
59+
<execution>
60+
<id>copy-sources</id>
61+
<phase>generate-sources</phase>
62+
<goals>
63+
<goal>run</goal>
64+
</goals>
65+
<configuration>
66+
<target>
67+
<echo message="Copying sources from git checkout to main/java"/>
68+
<copy todir="${project.basedir}/src/main/java" overwrite="true">
69+
<fileset dir="${project.build.directory}/javaxt-core-src/src"/>
70+
</copy>
71+
<echo message="Copy completed"/>
72+
</target>
73+
</configuration>
74+
</execution>
75+
</executions>
76+
</plugin>
77+
</plugins>
78+
</build>
79+
</profile>
80+
<profile>
81+
<id>local-sources</id>
82+
<activation>
83+
<property>
84+
<name>javaxt.core.local.dir</name>
85+
</property>
86+
</activation>
87+
<build>
88+
<plugins>
89+
<plugin>
90+
<groupId>org.apache.maven.plugins</groupId>
91+
<artifactId>maven-antrun-plugin</artifactId>
92+
<version>3.0.0</version>
93+
<executions>
94+
<execution>
95+
<id>copy-local-sources</id>
96+
<phase>generate-sources</phase>
97+
<goals>
98+
<goal>run</goal>
99+
</goals>
100+
<configuration>
101+
<target>
102+
<echo message="Copying from local directory: '${javaxt.core.local.dir}'"/>
103+
<copy todir="${project.basedir}/src/main/java" overwrite="true">
104+
<fileset dir="${javaxt.core.local.dir}" includes="**/*"/>
105+
</copy>
106+
<echo message="Local copy completed successfully"/>
107+
</target>
108+
</configuration>
109+
</execution>
110+
</executions>
111+
</plugin>
112+
</plugins>
113+
</build>
114+
</profile>
115+
</profiles>
116+
<build>
117+
<plugins>
118+
<plugin>
119+
<groupId>org.apache.maven.plugins</groupId>
120+
<artifactId>maven-compiler-plugin</artifactId>
121+
<version>3.8.1</version>
122+
<configuration>
123+
<source>1.8</source>
124+
<target>1.8</target>
125+
</configuration>
126+
</plugin>
127+
<plugin>
128+
<groupId>org.apache.maven.plugins</groupId>
129+
<artifactId>maven-antrun-plugin</artifactId>
130+
<version>3.0.0</version>
131+
<executions>
132+
<execution>
133+
<id>debug-property</id>
134+
<phase>validate</phase>
135+
<goals>
136+
<goal>run</goal>
137+
</goals>
138+
<configuration>
139+
<target>
140+
<echo message="DEBUG: javaxt.core.local.dir = '${javaxt.core.local.dir}'"/>
141+
<echo message="DEBUG: Property length = ${javaxt.core.local.dir.length()}"/>
142+
<echo message="DEBUG: Property is empty = ${javaxt.core.local.dir:EMPTY}"/>
143+
</target>
144+
</configuration>
145+
</execution>
146+
<execution>
147+
<id>clean-copied-sources</id>
148+
<phase>clean</phase>
149+
<goals>
150+
<goal>run</goal>
151+
</goals>
152+
<configuration>
153+
<target>
154+
<delete dir="${project.basedir}/src/main/java" failonerror="false"/>
155+
<delete dir="${project.build.directory}/javaxt-core-src" failonerror="false"/>
156+
<delete dir="${project.basedir}/dist" failonerror="false"/>
157+
</target>
158+
</configuration>
159+
</execution>
160+
</executions>
161+
</plugin>
162+
</plugins>
163+
</build>
164+
</project>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package javaxt.core.github;
2+
3+
import junit.framework.Test;
4+
import junit.framework.TestCase;
5+
import junit.framework.TestSuite;
6+
7+
/**
8+
* Unit test for simple Main.
9+
*/
10+
public class MainTest
11+
extends TestCase
12+
{
13+
/**
14+
* Create the test case
15+
*
16+
* @param testName name of the test case
17+
*/
18+
public MainTest( String testName )
19+
{
20+
super( testName );
21+
}
22+
23+
/**
24+
* @return the suite of tests being tested
25+
*/
26+
public static Test suite()
27+
{
28+
return new TestSuite( MainTest.class );
29+
}
30+
31+
/**
32+
* Rigourous Test :-)
33+
*/
34+
public void testApp()
35+
{
36+
assertTrue( true );
37+
}
38+
}

javaxt-core-test/pom.xml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<?xml version="1.0"?>
2+
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4+
<modelVersion>4.0.0</modelVersion>
5+
<parent>
6+
<groupId>javaxt</groupId>
7+
<artifactId>javaxt-core-test</artifactId>
8+
<version>dev</version>
9+
</parent>
10+
<groupId>javaxt.core.test</groupId>
11+
<artifactId>javaxt-core-test</artifactId>
12+
<version>dev</version>
13+
<name>javaxt-core-test</name>
14+
<dependencies>
15+
<dependency>
16+
<groupId>junit</groupId>
17+
<artifactId>junit</artifactId>
18+
<version>4.13.2</version>
19+
<scope>test</scope>
20+
</dependency>
21+
<dependency>
22+
<groupId>javaxt.core.build</groupId>
23+
<artifactId>javaxt-core-build</artifactId>
24+
<version>dev</version>
25+
</dependency>
26+
</dependencies>
27+
<build>
28+
<plugins>
29+
<plugin>
30+
<groupId>org.apache.maven.plugins</groupId>
31+
<artifactId>maven-compiler-plugin</artifactId>
32+
<version>3.8.1</version>
33+
<configuration>
34+
<source>1.8</source>
35+
<target>1.8</target>
36+
</configuration>
37+
</plugin>
38+
<plugin>
39+
<groupId>org.apache.maven.plugins</groupId>
40+
<artifactId>maven-antrun-plugin</artifactId>
41+
<version>3.0.0</version>
42+
<executions>
43+
<execution>
44+
<id>clean-dist</id>
45+
<phase>clean</phase>
46+
<goals>
47+
<goal>run</goal>
48+
</goals>
49+
<configuration>
50+
<target>
51+
<delete dir="${project.basedir}/dist" failonerror="false"/>
52+
</target>
53+
</configuration>
54+
</execution>
55+
</executions>
56+
</plugin>
57+
</plugins>
58+
</build>
59+
</project>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package javaxt.core.test;
2+
3+
/**
4+
* Hello world!
5+
*
6+
*/
7+
public class Main
8+
{
9+
public static void main( String[] args )
10+
{
11+
System.out.println( "Hello World!" );
12+
}
13+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# This file ensures the resources directory is created
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# This file ensures the wsdl directory is created

0 commit comments

Comments
 (0)