View Javadoc
1   /*
2    * Copyright 2018 SPF4J.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.spf4j.test.log.junit4;
17  
18  import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
19  import java.util.ArrayDeque;
20  import java.util.List;
21  import org.spf4j.base.ExecutionContext;
22  import org.spf4j.test.log.LogAssert;
23  import org.spf4j.test.log.LogCollection;
24  import org.spf4j.test.log.TestLogRecord;
25  
26  /**
27   * @author Zoltan Farkas
28   */
29  public final class TestBaggage {
30    private final ExecutionContext ctx;
31    private final LogCollection<ArrayDeque<TestLogRecord>> logCollection;
32    private final List<LogAssert> assertions;
33  
34    TestBaggage(final ExecutionContext ctx,
35            final LogCollection<ArrayDeque<TestLogRecord>> logCollection, final List<LogAssert> assertions) {
36      this.ctx = ctx;
37      this.logCollection = logCollection;
38      this.assertions = assertions;
39    }
40  
41    @SuppressFBWarnings("EI_EXPOSE_REP")
42    public ExecutionContext getCtx() {
43      return ctx;
44    }
45  
46    @SuppressFBWarnings("EI_EXPOSE_REP")
47    public LogCollection<ArrayDeque<TestLogRecord>> getLogCollection() {
48      return logCollection;
49    }
50  
51    @SuppressFBWarnings("EI_EXPOSE_REP")
52    public List<LogAssert> getAssertions() {
53      return assertions;
54    }
55  
56    @Override
57    public String toString() {
58      return "TestBaggage{" + "ctx=" + ctx + ", logCollection=" + logCollection + ", assertions=" + assertions + '}';
59    }
60  
61  
62  }