Skip to content

Commit

Permalink
7504: Fix flightrecorder.writer.test project setup
Browse files Browse the repository at this point in the history
Reviewed-by: aptmac
  • Loading branch information
thegreystone committed Jan 12, 2022
1 parent dbb3e76 commit be067ab
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#
source.. = src/main/java/,\
src/main/resources/
output.. = target/classes/
output.. = target/test-classes/
bin.includes = META-INF/,\
.
pde.match.rule.bundle=compatible
Expand Down
40 changes: 40 additions & 0 deletions core/tests/org.openjdk.jmc.flightrecorder.writer.test/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="license">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
</classpath>
34 changes: 34 additions & 0 deletions core/tests/org.openjdk.jmc.flightrecorder.writer.test/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>flightrecorder.writer.test</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ Bundle-SymbolicName: org.openjdk.jmc.flightrecorder.writer;singleton:=true
Bundle-Version: 8.2.0.qualifier
Bundle-Vendor: Oracle Corporation
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: org.openjdk.jmc.flightrecorder.writer.api
Require-Bundle: org.openjdk.jmc.common;visibility:=reexport
Automatic-Module-Name: org.openjdk.jmc.flightrecorder.writer
Export-Package: org.openjdk.jmc.flightrecorder.writer
Require-Bundle: org.junit,org.junit.jupiter.api,org.openjdk.jmc.common,org.openjdk.jmc.flightrecorder.writer;visibility:=reexport
Automatic-Module-Name: org.openjdk.jmc.flightrecorder.writer.test
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
# WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
source.. = src/main/java/,\
src/main/resources/
output.. = target/classes/
source.. = src/test/java/,\
src/test/resources/
output.. = target/test-classes/
bin.includes = META-INF/,\
.
pde.match.rule.bundle=compatible
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
</dependency>
</dependencies>
<build>
<testOutputDirectory>${project.build.directory}/classes</testOutputDirectory>
<testOutputDirectory>${project.build.directory}/test-classes</testOutputDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ void writeEvent() throws Exception {
});
});

@SuppressWarnings("unchecked")
TypedValue eventValue = eventType.asValue(access -> {
access.putField("startTime", System.nanoTime()).putField("name", EVENT_NAME).putField("message", EVENT_MSG)
.putField("eventThread", threadAccess -> {
Expand All @@ -109,7 +110,6 @@ void writeEvent() throws Exception {
groupAcess.putField("name", "Main AWT Group");
});
}).putField("stackTrace", builder -> {
//noinspection unchecked
builder.putField("truncated", false).putFields("frames", frame1 -> {
frame1.putField("type", "Interpreted").putField("method", method -> {
method.putField("type", classType -> {
Expand Down

0 comments on commit be067ab

Please sign in to comment.