Projects >> wro4j >>dd3b7c58fc63212c5a0c9f58a43a78f63eb952ee

Chunk
Conflicting content
      LOG.debug("ETag hash detected: " + etagValue + ". Sending " + HttpServletResponse.SC_NOT_MODIFIED
        + " status code");
      response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
<<<<<<< HEAD
      // because we cannot return null, return a stream containing nothing.
      return new ByteArrayInputStream(new byte[] {});
=======
      //because we cannot return null, return a stream containing nothing.
      return EMPTY_STREAM;
>>>>>>> 7f32f5e5c686c0d310ac09935a7ed7645731bf80
    }
    if (contentHashEntry.getContent() != null) {
      // make the input stream encoding aware.
Solution content
      LOG.debug("ETag hash detected: " + etagValue + ". Sending " + HttpServletResponse.SC_NOT_MODIFIED
        + " status code");
      response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
      // because we cannot return null, return a stream containing nothing.
      return EMPTY_STREAM;
    }
    if (contentHashEntry.getContent() != null) {
      // make the input stream encoding aware.
File
WroManager.java
Developer's decision
Version 2
Kind of conflict
Attribute
Comment
Method invocation
Return statement
Chunk
Conflicting content
 * @author Alex Objelean
 * @created Created on Nov 3, 2008
 */
<<<<<<< HEAD
public class TestWroManager {
=======
public class TestWroManager
    extends AbstractWroTest {
  private static final Logger LOG = LoggerFactory.getLogger(TestWroManager.class);
>>>>>>> 7f32f5e5c686c0d310ac09935a7ed7645731bf80
  private WroManager manager;

  @Before
Solution content
 * @author Alex Objelean
 * @created Created on Nov 3, 2008
 */
public class TestWroManager {
  private static final Logger LOG = LoggerFactory.getLogger(TestWroManager.class);
  private WroManager manager;

  @Before
File
TestWroManager.java
Developer's decision
Combination
Kind of conflict
Attribute
Class signature
Method invocation
Chunk
Conflicting content
        WroTestUtils.getInputStream(expectedResourceUri));
    final InputStream actualInputStream = new BufferedInputStream(new ByteArrayInputStream(out.toByteArray()));
    expectedInputStream.reset();
<<<<<<< HEAD
    WroTestUtils.compare(expectedInputStream, actualInputStream);
=======
    WroTestUtils.compare(IOUtils.toString(expectedInputStream, encoding), IOUtils.toString(actualInputStream, encoding));
    expectedInputStream.close();
    actualInputStream.close();
>>>>>>> 7f32f5e5c686c0d310ac09935a7ed7645731bf80
  }

  @Test
Solution content
        WroTestUtils.getInputStream(expectedResourceUri));
    final InputStream actualInputStream = new BufferedInputStream(new ByteArrayInputStream(out.toByteArray()));
    expectedInputStream.reset();
    WroTestUtils.compare(expectedInputStream, actualInputStream);
    expectedInputStream.close();
    actualInputStream.close();
  }

  @Test
File
TestWroManager.java
Developer's decision
Combination
Kind of conflict
Method invocation
Chunk
Conflicting content
    final HttpServletResponse response = Mockito.mock(HttpServletResponse.class, Mockito.RETURNS_DEEP_STUBS);
    Mockito.when(request.getRequestURI()).thenReturn("/app/g1.css");

<<<<<<< HEAD
    Context.set(Context.webContext(request, Mockito.mock(HttpServletResponse.class, Mockito.RETURNS_DEEP_STUBS),
        Mockito.mock(FilterConfig.class)));

=======
    //Test also that ETag header value contains quotes
    Mockito.doAnswer(new Answer() {
      public Void answer(final InvocationOnMock invocation)
        throws Throwable {
        LOG.debug("Header: " + Arrays.toString(invocation.getArguments()));
        final Object[] arguments = invocation.getArguments();
        if (HttpHeader.ETAG.toString().equals(arguments[0])) {
          final String etagHeaderValue = (String) arguments[1];
          Assert.assertTrue(etagHeaderValue.matches("\".*?\""));
        }
        return null;
      }
    }).when(response).setHeader(Mockito.anyString(), Mockito.anyString());

    Context.set(Context.webContext(request, response, Mockito.mock(FilterConfig.class)));
>>>>>>> 7f32f5e5c686c0d310ac09935a7ed7645731bf80
    manager.process();

  }
Solution content
    final HttpServletResponse response = Mockito.mock(HttpServletResponse.class, Mockito.RETURNS_DEEP_STUBS);
    Mockito.when(request.getRequestURI()).thenReturn("/app/g1.css");

    //Test also that ETag header value contains quotes
    Mockito.doAnswer(new Answer() {
      public Void answer(final InvocationOnMock invocation)
        throws Throwable {
        LOG.debug("Header: " + Arrays.toString(invocation.getArguments()));
        final Object[] arguments = invocation.getArguments();
        if (HttpHeader.ETAG.toString().equals(arguments[0])) {
          final String etagHeaderValue = (String) arguments[1];
          Assert.assertTrue(etagHeaderValue.matches("\".*?\""));
        }
        return null;
      }
    }).when(response).setHeader(Mockito.anyString(), Mockito.anyString());

    Context.set(Context.webContext(request, response, Mockito.mock(FilterConfig.class)));

    manager.process();

  }
File
TestWroManager.java
Developer's decision
Version 2
Kind of conflict
Comment
Method invocation