001//@formatter:off
002/*
003 * All Tests - Test suite for all pattern tests.
004 * Code-Beispiel zum Buch Patterns Kompakt, Verlag Springer Vieweg
005 * Copyright 2014 Karl Eilebrecht
006 * 
007 * Licensed under the Apache License, Version 2.0 (the "License"):
008 * you may not use this file except in compliance with the License.
009 * You may obtain a copy of the License at
010 *
011 * http://www.apache.org/licenses/LICENSE-2.0
012 *
013 * Unless required by applicable law or agreed to in writing, software
014 * distributed under the License is distributed on an "AS IS" BASIS,
015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016 * See the License for the specific language governing permissions and
017 * limitations under the License.
018 */
019//@formatter:on
020package de.calamanari.pk;
021
022import org.junit.AfterClass;
023import org.junit.BeforeClass;
024import org.junit.runner.RunWith;
025import org.junit.runners.Suite;
026import org.junit.runners.Suite.SuiteClasses;
027import org.slf4j.Logger;
028import org.slf4j.LoggerFactory;
029
030import de.calamanari.pk.abstractfactory.AbstractFactoryTest;
031import de.calamanari.pk.activeobject.ActiveObjectTest;
032import de.calamanari.pk.adapter.AdapterTest;
033import de.calamanari.pk.bridge.BridgeTest;
034import de.calamanari.pk.builder.BuilderTest;
035import de.calamanari.pk.coarsegrainedlock.CoarseGrainedLockTest;
036import de.calamanari.pk.combinedmethod.CombinedMethodTest;
037import de.calamanari.pk.command.CommandTest;
038import de.calamanari.pk.commandprocessor.CommandProcessorTest;
039import de.calamanari.pk.composite.CompositeTest;
040import de.calamanari.pk.datatransferobject.DataTransferObjectTest;
041import de.calamanari.pk.decorator.DecoratorTest;
042import de.calamanari.pk.dependencyinjection.DependencyInjectionTest;
043import de.calamanari.pk.facade.FacadeTest;
044import de.calamanari.pk.factorymethod.FactoryMethodTest;
045import de.calamanari.pk.flyweight.FlyweightTest;
046import de.calamanari.pk.gateway.GatewayTest;
047import de.calamanari.pk.identityfield.IdentityFieldTest;
048import de.calamanari.pk.identitymap.IdentityMapTest;
049import de.calamanari.pk.iterator.IteratorTest;
050import de.calamanari.pk.lazyload.LazyLoadTest;
051import de.calamanari.pk.mapper.MapperTest;
052import de.calamanari.pk.masterslave.MasterSlaveTest;
053import de.calamanari.pk.modelviewcontroller.ModelViewControllerTest;
054import de.calamanari.pk.money.MoneyTest;
055import de.calamanari.pk.nullobject.NullObjectTest;
056import de.calamanari.pk.objectpool.ObjectPoolTest;
057import de.calamanari.pk.objectpool.SimpleThreadPoolTest;
058import de.calamanari.pk.observer.ObserverTest;
059import de.calamanari.pk.optimisticofflinelock.OptimisticOfflineLockTest;
060import de.calamanari.pk.pessimisticofflinelock.PessimisticOfflineLockTest;
061import de.calamanari.pk.plugin.PluginTest;
062import de.calamanari.pk.proxy.ProxyTest;
063import de.calamanari.pk.registry.RegistryTest;
064import de.calamanari.pk.sequenceblock.SequenceBlockTest;
065import de.calamanari.pk.servicestub.ServiceStubTest;
066import de.calamanari.pk.singleton.SingletonTest;
067import de.calamanari.pk.strategy.StrategyTest;
068import de.calamanari.pk.templatemethod.TemplateMethodTest;
069import de.calamanari.pk.transferobjectassembler.TransferObjectAssemblerTest;
070import de.calamanari.pk.util.IndexedTextFileAccessorTest;
071import de.calamanari.pk.util.ParallelFileInputStreamTest;
072import de.calamanari.pk.util.TimeUtils;
073import de.calamanari.pk.uuid.UUIDTest;
074import de.calamanari.pk.valueobject.ValueObjectTest;
075import de.calamanari.pk.visitor.VisitorTest;
076import de.calamanari.pk.wrapper.WrapperTest;
077
078/**
079 * All Tests - Test suite for all pattern tests.
080 * 
081 * @author <a href="mailto:Karl.Eilebrecht(a/t)calamanari.de">Karl Eilebrecht</a>
082 */
083@RunWith(Suite.class)
084@SuiteClasses({
085//@formatter:off
086    AbstractFactoryTest.class,
087    ActiveObjectTest.class,
088    AdapterTest.class,
089    BridgeTest.class,
090    BuilderTest.class,
091    CoarseGrainedLockTest.class,
092    CombinedMethodTest.class,
093    CommandProcessorTest.class,
094    CommandTest.class,
095    CompositeTest.class,
096    DataTransferObjectTest.class,
097    DecoratorTest.class,
098    DependencyInjectionTest.class,
099    FacadeTest.class,
100    FactoryMethodTest.class,
101    FlyweightTest.class,
102    GatewayTest.class,
103    IdentityFieldTest.class,
104    IdentityMapTest.class,
105    IndexedTextFileAccessorTest.class,
106    IteratorTest.class,
107    LazyLoadTest.class,
108    MapperTest.class,
109    MasterSlaveTest.class,
110    ModelViewControllerTest.class,
111    MoneyTest.class,
112    NullObjectTest.class,
113    ObjectPoolTest.class,
114    ObserverTest.class,
115    OptimisticOfflineLockTest.class,
116    ParallelFileInputStreamTest.class,
117    PessimisticOfflineLockTest.class,
118    PluginTest.class,
119    ProxyTest.class,
120    RegistryTest.class,
121    SequenceBlockTest.class,
122    ServiceStubTest.class,
123    SimpleThreadPoolTest.class,
124    SingletonTest.class,
125    StrategyTest.class,
126    TemplateMethodTest.class,
127    TransferObjectAssemblerTest.class,
128    UUIDTest.class,
129    ValueObjectTest.class,
130    VisitorTest.class,
131    WrapperTest.class
132    //@formatter:on
133})
134public final class AllTests {
135
136    private static final Logger LOGGER = LoggerFactory.getLogger(AllTests.class);
137
138    /**
139     * Time tests began
140     */
141    private static long startTimeNanos;
142
143    /**
144     * No instance required
145     */
146    private AllTests() {
147        // not required
148    }
149
150    /**
151     * configure loggers before tests
152     */
153    @BeforeClass
154    public static void beforeAll() {
155        startTimeNanos = System.nanoTime();
156        LOGGER.info("Running AllTests ...");
157    }
158
159    /**
160     * write finish message after tests
161     */
162    @AfterClass
163    public static void afterAll() {
164        String elapsedTimeString = TimeUtils.formatNanosAsSeconds(System.nanoTime() - startTimeNanos);
165        LOGGER.info("AllTests completed. Elapsed time: {} s", elapsedTimeString);
166    }
167
168}