reorganize to follow standard directory layout

This commit is contained in:
Renaud Pawlak 2015-11-19 10:48:45 +01:00
parent bd78de88db
commit d609bf8022
211 changed files with 13 additions and 36 deletions

View File

@ -1,18 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="test">
<attributes>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src" path="src/main/resources"/>
<classpathentry kind="src" path="src/test/java"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
@ -23,11 +13,6 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@ -42,14 +42,6 @@
</repository>
</repositories>
<build>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>test</testSourceDirectory>
<resources>
<resource>
<directory>resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>

View File

@ -11,7 +11,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
*/
package org.jsweet.test.transpiler;
import static org.junit.Assert.fail;
@ -38,6 +38,8 @@ import org.junit.rules.TestName;
public class AbstractTest {
protected static final String TEST_DIRECTORY_NAME = "src/test/java";
protected static final Logger staticLogger = Logger.getLogger(AbstractTest.class);
protected final Logger logger = Logger.getLogger(getClass());
@ -48,7 +50,7 @@ public class AbstractTest {
public final TestName testNameRule = new TestName();
protected File getTestFile(String name) {
return new File("./test/" + getClass().getPackage().getName().replace('.', '/'), name + ".d.ts");
return new File(TEST_DIRECTORY_NAME + "/" + getClass().getPackage().getName().replace('.', '/'), name + ".d.ts");
}
protected final String getCurrentTestName() {
@ -112,7 +114,7 @@ public class AbstractTest {
}
protected SourceFile getSourceFile(Class<?> mainClass) {
return new SourceFile(new File("test/" + mainClass.getName().replace(".", "/") + ".java"));
return new SourceFile(new File(TEST_DIRECTORY_NAME + "/" + mainClass.getName().replace(".", "/") + ".java"));
}
protected EvaluationResult eval(SourceFile sourceFile, JSweetProblem... expectedProblems) {

View File

@ -11,7 +11,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
*/
package org.jsweet.test.transpiler;
import java.io.File;
@ -24,7 +24,6 @@ import org.jsweet.test.transpiler.source.ambient.lib.Extension;
import org.jsweet.test.transpiler.source.ambient.lib.sub.C;
import org.jsweet.transpiler.ModuleKind;
import org.jsweet.transpiler.SourceFile;
import org.jsweet.transpiler.util.EvaluationResult;
import org.junit.Assert;
import org.junit.Test;
@ -34,7 +33,7 @@ public class AmbientTests extends AbstractTest {
public void testLibAccess() throws Exception {
File target = new File(transpiler.getTsOutputDir(), "lib.js");
FileUtils.deleteQuietly(target);
FileUtils.copyFile(new File("test/org/jsweet/test/transpiler/source/ambient/lib.js"), target);
FileUtils.copyFile(new File(TEST_DIRECTORY_NAME + "/org/jsweet/test/transpiler/source/ambient/lib.js"), target);
System.out.println("copied to " + target);
SourceFile libJs = new SourceFile(null) {
@ -64,7 +63,7 @@ public class AmbientTests extends AbstractTest {
public void testLibAccessSubModule() throws Exception {
File target = new File(transpiler.getTsOutputDir(), "libsub.js");
FileUtils.deleteQuietly(target);
FileUtils.copyFile(new File("test/org/jsweet/test/transpiler/source/ambient/libsub.js"), target);
FileUtils.copyFile(new File(TEST_DIRECTORY_NAME + "/org/jsweet/test/transpiler/source/ambient/libsub.js"), target);
System.out.println("copied to " + target);
SourceFile libJs = new SourceFile(null) {
@ -87,8 +86,7 @@ public class AmbientTests extends AbstractTest {
eval(ModuleKind.none, (logHandler, result) -> {
Assert.assertTrue("test was not executed", result.get("baseExecuted"));
Assert.assertTrue("extension was not executed", result.get("extensionExecuted"));
} , libJs, getSourceFile(LibAccessSubModule.class), getSourceFile(Base.class),
getSourceFile(Extension.class), getSourceFile(C.class));
} , libJs, getSourceFile(LibAccessSubModule.class), getSourceFile(Base.class), getSourceFile(Extension.class), getSourceFile(C.class));
}
}

View File

@ -128,7 +128,7 @@ public class TranspilerTests extends AbstractTest {
"--tsout", outDir.getPath(), //
"--jsout", outDir.getPath(), //
"--debug", //
"-i", "test/org/jsweet/test/transpiler/source/blocksgame");
"-i", TEST_DIRECTORY_NAME+"/org/jsweet/test/transpiler/source/blocksgame");
assertTrue(process.exitValue() == 0);
LinkedList<File> files = new LinkedList<>();

Some files were not shown because too many files have changed in this diff Show More