小编din*_*101的帖子

我们如何在同一台机器Windows 7上运行两个Apache Http Server实例

我们如何在同一台机器Windows 7上运行两个Apache Http Server实例

我想在window7机器上配置2个apache http服务器和3个tomcat服务器.

目前我已经完成了1个http服务器和2个或更多tomcat服务器的配置,但无法在同一台Windows机器上配置2个http服务器.每当我第二次启动http服务器(第二个实例)时,就像这样说:

httpd: Could not reliably determine the server's fully qualified domain name, 
using 172.17.124.181 for ServerName (OS 10048)Only one usage of each socket
address (protocol/network address/port) is normally permitted.:
make_sock: could not bind to address 0.0.0.0:80 no listening sockets available,
shutting down Unable to open logs
Run Code Online (Sandbox Code Playgroud)

请告诉我如何在同一台Windows机器上运行两个HTTP服务器实例.感谢帮助.提前致谢.

windows apache tomcat http

5
推荐指数
2
解决办法
3万
查看次数

使用Mockito模拟java.lang.reflect.Method

我需要模拟java.lang.reflect.Method进行测试(我有动态的东西)。我们已经使用Junit spring&mockito编写了所有测试用例。但是我在为我的方面编写Junit时遇到问题。此外,我们还编写了自定义注释,请对此提供帮助

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:spring/services-test.xml")
@ImportAutoConfiguration(RefreshAutoConfiguration.class)
public abstract class AbsServicesTest extends AbstractJUnit4SpringContextTests {

static{
    System.setProperty("LOCAL");
}
}


public class TaxValidatorAspectTest extends AbsServicesTest {

@Autowired
private ResourcesUtils resourcesUtil;

@Mock
private JoinPoint joinPoint;

@Mock
private MethodSignature methodSignature;

@Mock
private Method method;

@Before
public void setUp() throws Exception {
    MockitoAnnotations.initMocks(new TaxValidatorAspectTest());
    Mockito.when(joinPoint.getSignature()).thenReturn(methodSignature);
    Mockito.when(methodSignature.getMethod()).thenReturn(method);
}

@Test
public void testBeforeMethod() throws IOException{
    TaxValidatorAspect taxonomyValidationAspect = new TaxValidatorAspect();
    final Object[] arguments = new Object[4];
    arguments[0] = requiredParam1;
    arguments[1] = requiredParam2;
    arguments[2] = requiredParam3;
    Mockito.when(joinPoint.getArgs()).thenReturn(arguments);
    taxonomyValidationAspect.before(joinPoint);
}
} …
Run Code Online (Sandbox Code Playgroud)

final class mockito

3
推荐指数
1
解决办法
1383
查看次数

标签 统计

apache ×1

class ×1

final ×1

http ×1

mockito ×1

tomcat ×1

windows ×1