Skip to content

Commit

Permalink
feat(objectionary#410): identify the problem with phi-printing
Browse files Browse the repository at this point in the history
  • Loading branch information
volodya-lombrozo committed Aug 22, 2024
1 parent 5d8c984 commit 15995dc
Show file tree
Hide file tree
Showing 5 changed files with 225 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/it/simple/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Simple Integration Test

This integration test verifies all the phases of the `opeo-maven-plugin` along
with the `jeo-maven-plugin` and `eo-maven-plugin:xmir-to-phi`.
In this test, we use a simple "Hello World" application.


To exclusively run this test, execute the command below:

```shell
mvn clean integration-test -Dinvoker.test=simple -DskipTests
```
1 change: 1 addition & 0 deletions src/it/simple/invoker.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
invoker.goals=clean package -e
150 changes: 150 additions & 0 deletions src/it/simple/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
The MIT License (MIT)
Copyright (c) 2016-2023 Objectionary.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-->
<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>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<!--
The version of 3.2.0 and similar requires rather high java
version: 17 or higher. So we intentionally use the version 2.7.18
here that requires java 11 since our plugin should be compatible with
java 11.
-->
<version>2.7.18</version>
<relativePath/>
</parent>
<groupId>org.eolang</groupId>
<artifactId>opeo-spring-it</artifactId>
<version>@project.version@</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<jeo.version>0.5.4</jeo.version>
<ineo.version>0.3.2</ineo.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.eolang</groupId>
<artifactId>jeo-maven-plugin</artifactId>
<version>${jeo.version}</version>
<executions>
<execution>
<id>bytecode-to-eo</id>
<goals>
<goal>disassemble</goal>
</goals>
<configuration>
<outputDir>${project.build.directory}/generated-sources/jeo-disassemble-xmir</outputDir>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eolang</groupId>
<artifactId>opeo-maven-plugin</artifactId>
<version>@project.version@</version>
<executions>
<execution>
<id>opeo-decompile</id>
<goals>
<goal>decompile</goal>
</goals>
<configuration>
<sourcesDir>${project.build.directory}/generated-sources/jeo-disassemble-xmir</sourcesDir>
<outputDir>${project.build.directory}/generated-sources/opeo-decompile-xmir</outputDir>
</configuration>
</execution>
<execution>
<id>opeo-compile</id>
<phase>generate-test-sources</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<sourcesDir>${project.build.directory}/generated-sources/opeo-decompile-xmir</sourcesDir>
<outputDir>${project.build.directory}/generated-sources/opeo-compile-xmir</outputDir>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eolang</groupId>
<artifactId>eo-maven-plugin</artifactId>
<version>0.39.0</version>
<executions>
<execution>
<id>convert-xmir-to-phi</id>
<phase>process-classes</phase>
<goals>
<goal>xmir-to-phi</goal>
</goals>
<configuration>
<phiInputDir>${project.build.directory}/generated-sources/opeo-decompile-xmir</phiInputDir>
<phiOutputDir>${project.build.directory}/generated-sources/phi-expressions</phiOutputDir>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.4.1</version>
<executions>
<execution>
<id>jeo-to-bytecode</id>
<phase>generate-test-sources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>mvn</executable>
<arguments combine.children="append">
<argument>org.eolang:jeo-maven-plugin:${jeo.version}:assemble</argument>
<argument>-Djeo.assemble.sourcesDir=${project.build.directory}/generated-sources/opeo-compile-xmir</argument>
<argument>-Djeo.assemble.skip.verification=true</argument>
<argument>-e</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
34 changes: 34 additions & 0 deletions src/it/simple/src/main/java/org/eolang/opeo/simple/App.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2024 Objectionary.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.eolang.opeo.simple;

/**
* App.
* @since 0.1
*/
public class App {
public static void main(String[] args) {
System.out.println("Hello, world!");
}
}
28 changes: 28 additions & 0 deletions src/it/simple/verify.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* MIT License
*
* Copyright (c) 2016-2023 Objectionary.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
//Check logs first.
String log = new File(basedir, 'build.log').text;
assert log.contains("BUILD SUCCESS")
assert log.contains("Hello, world!")
true

0 comments on commit 15995dc

Please sign in to comment.