maven/0004-Remove-dependency-on-powermock.patch

97 lines
3.6 KiB
Diff
Raw Normal View History

2022-04-21 20:36:30 +00:00
From d0bc26194a0e432206d7f92cf0b6fbef67946cc4 Mon Sep 17 00:00:00 2001
2019-09-26 14:31:45 +00:00
From: Marian Koncek <mkoncek@redhat.com>
Date: Thu, 5 Sep 2019 15:21:04 +0200
2022-04-21 20:36:30 +00:00
Subject: [PATCH 4/6] Remove dependency on powermock
2019-09-26 14:31:45 +00:00
---
.../StringSearchModelInterpolatorTest.java | 66 -------------------
1 file changed, 66 deletions(-)
diff --git a/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/StringSearchModelInterpolatorTest.java b/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/StringSearchModelInterpolatorTest.java
2022-04-21 20:36:30 +00:00
index c95e37271..aafafa52f 100644
2019-09-26 14:31:45 +00:00
--- a/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/StringSearchModelInterpolatorTest.java
+++ b/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/StringSearchModelInterpolatorTest.java
2022-04-21 20:36:30 +00:00
@@ -36,8 +36,6 @@
2019-09-26 14:31:45 +00:00
import static org.hamcrest.CoreMatchers.anyOf;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
-import static org.powermock.reflect.Whitebox.getField;
-import static org.powermock.reflect.Whitebox.getInternalState;
/**
* @author jdcasey
2022-04-21 20:36:30 +00:00
@@ -375,70 +373,6 @@ public void testInterpolateObjectWithPomFile()
2019-09-26 14:31:45 +00:00
) ) );
}
- public void testNotInterpolateObjectWithFile()
- throws Exception
- {
- Model model = new Model();
-
- File baseDir = new File( System.getProperty( "user.dir" ) );
-
- Properties p = new Properties();
-
- ObjectWithNotInterpolatedFile obj = new ObjectWithNotInterpolatedFile( baseDir );
-
- StringSearchModelInterpolator interpolator = (StringSearchModelInterpolator) createInterpolator();
-
- ModelBuildingRequest config = createModelBuildingRequest( p );
-
- SimpleProblemCollector collector = new SimpleProblemCollector();
- interpolator.interpolateObject( obj, model, new File( "." ), config, collector );
- assertProblemFree( collector );
-
- //noinspection unchecked
- Map<Class<?>, ?> cache =
- (Map<Class<?>, ?>) getField( StringSearchModelInterpolator.class, "CACHED_ENTRIES" )
- .get( null );
-
- Object objCacheItem = cache.get( Object.class );
- Object fileCacheItem = cache.get( File.class );
-
- assertNotNull( objCacheItem );
- assertNotNull( fileCacheItem );
-
- assertThat( ( (Object[]) getInternalState( objCacheItem, "fields" ) ).length, is( 0 ) );
- assertThat( ( (Object[]) getInternalState( fileCacheItem, "fields" ) ).length, is( 0 ) );
- }
-
- public void testNotInterpolateFile()
- throws Exception
- {
- Model model = new Model();
-
- File baseDir = new File( System.getProperty( "user.dir" ) );
-
- Properties p = new Properties();
-
- StringSearchModelInterpolator interpolator = (StringSearchModelInterpolator) createInterpolator();
-
- ModelBuildingRequest config = createModelBuildingRequest( p );
-
- SimpleProblemCollector collector = new SimpleProblemCollector();
- interpolator.interpolateObject( baseDir, model, new File( "." ), config, collector );
- assertProblemFree( collector );
-
- //noinspection unchecked
- Map<Class<?>, ?> cache =
- (Map<Class<?>, ?>) getField( StringSearchModelInterpolator.class, "CACHED_ENTRIES" )
- .get( null );
-
- Object fileCacheItem = cache.get( File.class );
-
- assertNotNull( fileCacheItem );
-
- assertThat( ( (Object[]) getInternalState( fileCacheItem, "fields" ) ).length, is( 0 ) );
- }
-
-
public void testConcurrentInterpolation()
throws Exception
{
--
2022-04-21 20:36:30 +00:00
2.35.1
2019-09-26 14:31:45 +00:00