-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#5118] Change method of create process in IT
- Loading branch information
1 parent
9e10346
commit a96b133
Showing
25 changed files
with
1,398 additions
and
222 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
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
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
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
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
59 changes: 59 additions & 0 deletions
59
profiler-test/src/main/java/com/navercorp/pinpoint/test/MockApiMetaDataService.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,59 @@ | ||
/* | ||
* Copyright 2018 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.test; | ||
|
||
import com.navercorp.pinpoint.bootstrap.context.MethodDescriptor; | ||
import com.navercorp.pinpoint.profiler.metadata.ApiMetaData; | ||
import com.navercorp.pinpoint.profiler.metadata.ApiMetaDataService; | ||
import com.navercorp.pinpoint.profiler.metadata.Result; | ||
import com.navercorp.pinpoint.profiler.metadata.SimpleCache; | ||
import com.navercorp.pinpoint.profiler.sender.EnhancedDataSender; | ||
|
||
/** | ||
* @author Taejin Koo | ||
*/ | ||
public class MockApiMetaDataService implements ApiMetaDataService { | ||
|
||
private final SimpleCache<String> apiCache = new SimpleCache<String>(); | ||
|
||
private final EnhancedDataSender<Object> enhancedDataSender; | ||
|
||
public MockApiMetaDataService(EnhancedDataSender<Object> enhancedDataSender) { | ||
if (enhancedDataSender == null) { | ||
throw new NullPointerException("enhancedDataSender must not be null"); | ||
} | ||
this.enhancedDataSender = enhancedDataSender; | ||
} | ||
|
||
@Override | ||
public int cacheApi(final MethodDescriptor methodDescriptor) { | ||
final String fullName = methodDescriptor.getFullName(); | ||
final Result result = this.apiCache.put(fullName); | ||
|
||
methodDescriptor.setApiId(result.getId()); | ||
|
||
final ApiMetaData apiMetadata = new ApiMetaData(result.getId(), methodDescriptor.getApiDescriptor()); | ||
apiMetadata.setLine(methodDescriptor.getLineNumber()); | ||
apiMetadata.setType(methodDescriptor.getType()); | ||
|
||
this.enhancedDataSender.request(apiMetadata); | ||
|
||
return result.getId(); | ||
} | ||
|
||
} | ||
|
45 changes: 45 additions & 0 deletions
45
profiler-test/src/main/java/com/navercorp/pinpoint/test/MockApiMetaDataServiceProvider.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,45 @@ | ||
/* | ||
* Copyright 2018 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.test; | ||
|
||
import com.google.inject.Inject; | ||
import com.google.inject.Provider; | ||
import com.navercorp.pinpoint.profiler.metadata.ApiMetaDataService; | ||
import com.navercorp.pinpoint.profiler.sender.EnhancedDataSender; | ||
|
||
/** | ||
* @author Taejin Koo | ||
*/ | ||
public class MockApiMetaDataServiceProvider implements Provider<ApiMetaDataService> { | ||
|
||
private final Provider<EnhancedDataSender<Object>> enhancedDataSenderProvider; | ||
|
||
@Inject | ||
public MockApiMetaDataServiceProvider(Provider<EnhancedDataSender<Object>> enhancedDataSenderProvider) { | ||
if (enhancedDataSenderProvider == null) { | ||
throw new NullPointerException("enhancedDataSenderProvider must not be null"); | ||
} | ||
this.enhancedDataSenderProvider = enhancedDataSenderProvider; | ||
} | ||
|
||
@Override | ||
public ApiMetaDataService get() { | ||
final EnhancedDataSender<Object> enhancedDataSender = this.enhancedDataSenderProvider.get(); | ||
return new MockApiMetaDataService(enhancedDataSender); | ||
} | ||
|
||
} |
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
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
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
Oops, something went wrong.