Skip to content

Commit

Permalink
Introduce tck assertion mapper integration
Browse files Browse the repository at this point in the history
  • Loading branch information
tremes authored and antoinesd committed Jan 23, 2017
1 parent eee92e1 commit 37787b2
Show file tree
Hide file tree
Showing 11 changed files with 729 additions and 7 deletions.
37 changes: 30 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,37 @@

<description>Parent module for CDI Specification</description>

<modules>
<module>spec</module>
<module>api</module>
</modules>

<build>
<defaultGoal>clean package</defaultGoal>
</build>
<profiles>
<profile>
<id>basic</id>
<activation>
<property>
<name>!tck</name>
</property>
</activation>
<modules>
<module>spec</module>
<module>api</module>
</modules>
<build>
<defaultGoal>clean package</defaultGoal>
</build>
</profile>

<profile>
<id>spec-with-assertions</id>
<activation>
<property>
<name>tck</name>
</property>
</activation>
<modules>
<module>spec</module>
<module>tck-mapper</module>
<module>api</module>
</modules>
</profile>
</profiles>

</project>
173 changes: 173 additions & 0 deletions tck-mapper/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
<?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">

<parent>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-spec</artifactId>
<version>1.2</version>
</parent>

<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.cdi.tck</groupId>
<artifactId>cdi-tck-mapper</artifactId>
<version>1.0.0.Alpha1</version>

<properties>
<jsoup.version>1.8.1</jsoup.version>
<path.to.cdi.spec>spec/jcp/target/publish/html/cdi-spec.html</path.to.cdi.spec>
<tck.version>1.2.3.Final</tck.version>
<tck.audit.url>https://repo1.maven.org/maven2/org/jboss/cdi/tck/cdi-tck-impl/${tck.version}/cdi-tck-impl-${tck.version}-audit-cdi.xml</tck.audit.url>
<tck.coverage.url>https://repo1.maven.org/maven2/org/jboss/cdi/tck/cdi-tck-impl/${tck.version}/cdi-tck-impl-${tck.version}-coverage-cdi.html</tck.coverage.url>
</properties>

<dependencies>

<dependency>
<!-- jsoup HTML parser library @ http://jsoup.org/ -->
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>${jsoup.version}</version>
</dependency>

</dependencies>


<build>
<finalName>tck-mapper</finalName>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.5</version>
<configuration>
<archive>
<compress>true</compress>
<manifest>
<mainClass>org.jboss.cdi.tck.mapper.Mapper</mainClass>
<!--classpathPrefix>META-INF/lib/</classpathPrefix-->
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
</plugin>
<!--plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>install</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>../spec/jcp/target/publish/html/images</outputDirectory>
<resources>
<resource>
<directory>src/main/resources/images/</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.3.2</version>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>org.jboss.cdi.tck.mapper.Mapper</mainClass>
<includeProjectDependencies>true</includeProjectDependencies>
<arguments>
<argument>${tck.audit.url}</argument>
<argument>${tck.coverage.url}</argument>
<argument>${path.to.cdi.spec}</argument>
<argument>${tck.version}</argument>
</arguments>
</configuration>
</plugin-->
</plugins>
</build>

<profiles>

<profile>
<id>tck-assertions</id>
<activation>
<property>
<name>tck</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>install</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>../spec/jcp/target/publish/html/images</outputDirectory>
<resources>
<resource>
<directory>src/main/resources/images/</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.3.2</version>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>org.jboss.cdi.tck.mapper.Mapper</mainClass>
<includeProjectDependencies>true</includeProjectDependencies>
<arguments>
<argument>${tck.audit.url}</argument>
<argument>${tck.coverage.url}</argument>
<argument>${path.to.cdi.spec}</argument>
<argument>${tck.version}</argument>
</arguments>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>


</project>
62 changes: 62 additions & 0 deletions tck-mapper/src/main/java/org/jboss/cdi/tck/audit/Assertion.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package org.jboss.cdi.tck.audit;

import java.util.ArrayList;
import java.util.List;

/**
* @author Tomas Remes
*/
public class Assertion extends SectionElement {

private String id = "";
private String note;
private boolean testable = true;
private Group group;
private List<Test> tests;

public Assertion() {
this.tests = new ArrayList<>();
}

public String getId() {
return id;
}

public void setId(String id) {
this.id = id;
}

public List<Test> getTests() {
return tests;
}

public boolean isTestable() {
return testable;
}

public void setTestable(boolean testable) {
this.testable = testable;
}

public String getNote() {
return note;
}

public void setNote(String note) {
this.note = note;
}

public Group getGroup() {
return group;
}

public void setGroup(Group group) {
this.group = group;
}

@Override
public String toString() {
return this.getId() + " " + this.getText();
}

}
25 changes: 25 additions & 0 deletions tck-mapper/src/main/java/org/jboss/cdi/tck/audit/Group.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package org.jboss.cdi.tck.audit;

import java.util.ArrayList;
import java.util.List;

/**
* @author Tomas Remes
*/
public class Group extends SectionElement {


private List<Assertion> assertions;

public Group(){
this.assertions = new ArrayList<>();
}

public List<Assertion> getAssertions() {
return assertions;
}




}
54 changes: 54 additions & 0 deletions tck-mapper/src/main/java/org/jboss/cdi/tck/audit/Section.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package org.jboss.cdi.tck.audit;

import java.util.ArrayList;
import java.util.List;

/**
* @author Tomas Remes
*/
public class Section {

private String id;
private String title;
private int level;

public List<SectionElement> getSectionElements() {
return sectionElements;
}

private List<SectionElement> sectionElements;

public Section() {
this.sectionElements = new ArrayList<>();
}

public int getLevel() {
return level;
}

public void setLevel(int level) {
this.level = level;
}

public String getTitle() {
return title;
}

public void setTitle(String title) {
this.title = title;
}

public String getId() {
return id;
}

public void setId(String id) {
this.id = id;
}

@Override
public String toString() {
return this.getId() + " " + this.getTitle() + " " + this.getLevel();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.jboss.cdi.tck.audit;

/**
* @author Tomas Remes
*/
public class SectionElement {

private String text;

public String getText() {
return text;
}

public void setText(String text) {
this.text = text;
}
}

0 comments on commit 37787b2

Please sign in to comment.