Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
446 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/target/ | ||
/.settings/ | ||
/.classpath | ||
/.project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
RMRqrdbgbKFhbaVnDxHUdDQvrOQXxIBklnvcmahheubVC | ||
mh2KM35CLkwUHS4DH7QVhxy52J5hnWbyEm6Cyd3KkF<mV | ||
RmmnSVOqOMnOnMMrmMqwXomoroNrqPNRrPSsWwtUxXuUU | ||
sRONqpnmqmUUnqonmstsmmmmmUUnqonmstsmmmmmUUGfk | ||
mlfkqUUnmmmm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<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/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>com.navercorp.pinpoint</groupId> | ||
<artifactId>pinpoint-naver</artifactId> | ||
<version>1.5.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>pinpoint-java8-test</artifactId> | ||
<name>pinpoint-integration-test-java8</name> | ||
<!-- this module contains integration tests. if we set packaging to pom, | ||
tests are not run. so we set it to jar even though the project will not be | ||
packaged as a jar. --> | ||
<packaging>jar</packaging> | ||
|
||
<properties> | ||
<jdk.version>1.8</jdk.version> | ||
<jdk.home>${env.JAVA_8_HOME}</jdk.home> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-test</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-context</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<build> | ||
<resources> | ||
<resource> | ||
<directory>${basedir}/src/main/java</directory> | ||
<excludes> | ||
<exclude>**/*.java</exclude> | ||
</excludes> | ||
</resource> | ||
<resource> | ||
<filtering>true</filtering> | ||
<directory>${basedir}/src/main/resources</directory> | ||
</resource> | ||
<resource> | ||
<directory>${basedir}/src/main/resources-${env}</directory> | ||
</resource> | ||
</resources> | ||
|
||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-failsafe-plugin</artifactId> | ||
<version>2.18.1</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>integration-test</goal> | ||
<goal>verify</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<!-- AbstractPinpointPluginTestSuite needs this to resolve | ||
path of required jars --> | ||
<useSystemClassLoader>false</useSystemClassLoader> | ||
<failIfNoTests>true</failIfNoTests> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
47 changes: 47 additions & 0 deletions
47
java8-test/src/test/java/com/navercorp/pinpoint/jdk8/lambda/LambdaTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright 2014 NAVER Corp. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* 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 com.navercorp.pinpoint.jdk8.lambda; | ||
|
||
import org.junit.Test; | ||
import org.springframework.context.ApplicationContext; | ||
import org.springframework.context.support.ClassPathXmlApplicationContext; | ||
|
||
public class LambdaTest { | ||
|
||
@Test | ||
public void test() throws Exception { | ||
ApplicationContext context = new ClassPathXmlApplicationContext("lambda-test.xml"); | ||
|
||
Maru maru = context.getBean(Maru.class); | ||
Morae morae = context.getBean(Morae.class); | ||
maru.test(morae); | ||
|
||
// PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance(); | ||
// verifier.printCache(); | ||
// | ||
// verifier.verifyTrace(Expectations.event("SPRING_BEAN", Maru.class.getMethod("test", Morae.class))); | ||
// verifier.verifyTrace(Expectations.event("SPRING_BEAN", Morae.class.getMethod("test", Predicate.class))); | ||
// verifier.verifyTrace(Expectations.event("SPRING_BEAN", Mozzi.class.getMethod("getAge"))); | ||
// | ||
// verifier.verifyTraceCount(0); | ||
} | ||
|
||
public static void main(String args[]) throws Exception { | ||
new LambdaTest().test(); | ||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
java8-test/src/test/java/com/navercorp/pinpoint/jdk8/lambda/Maru.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* Copyright 2014 NAVER Corp. | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* 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 com.navercorp.pinpoint.jdk8.lambda; | ||
|
||
/** | ||
* @author Jongho Moon | ||
* | ||
*/ | ||
public class Maru { | ||
public boolean test(Morae morae) { | ||
return morae.test((m) -> m.getAge() > 1); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
java8-test/src/test/java/com/navercorp/pinpoint/jdk8/lambda/Morae.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright 2014 NAVER Corp. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* 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 com.navercorp.pinpoint.jdk8.lambda; | ||
|
||
import java.util.function.Predicate; | ||
|
||
public class Morae { | ||
|
||
private final Mozzi mozzi; | ||
|
||
public Morae(Mozzi mozzi) { | ||
this.mozzi = mozzi; | ||
} | ||
|
||
public boolean test(Predicate<Mozzi> predicate) { | ||
return predicate.test(mozzi); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
java8-test/src/test/java/com/navercorp/pinpoint/jdk8/lambda/Mozzi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright 2014 NAVER Corp. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* 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 com.navercorp.pinpoint.jdk8.lambda; | ||
|
||
import org.springframework.stereotype.Controller; | ||
|
||
@Controller | ||
public class Mozzi { | ||
private final int age; | ||
|
||
public Mozzi(int age) { | ||
this.age = age; | ||
} | ||
|
||
public int getAge() { | ||
return age; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<beans xmlns="http://www.springframework.org/schema/beans" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> | ||
|
||
<bean id="maru" class="com.navercorp.pinpoint.jdk8.lambda.Maru"/> | ||
|
||
<bean id="morae" class="com.navercorp.pinpoint.jdk8.lambda.Morae"> | ||
<constructor-arg ref="mozzi"/> | ||
</bean> | ||
|
||
<bean id="mozzi" class="com.navercorp.pinpoint.jdk8.lambda.Mozzi" scope="prototype"> | ||
<constructor-arg value="4"/> | ||
</bean> | ||
|
||
</beans> |
Oops, something went wrong.