@@ -0,0 +1,3206 @@
+/* This file is part of VoltDB.%0A * Copyright (C) 2008-2014 VoltDB Inc.%0A *%0A * Permission is hereby granted, free of charge, to any person obtaining%0A * a copy of this software and associated documentation files (the%0A * %22Software%22), to deal in the Software without restriction, including%0A * without limitation the rights to use, copy, modify, merge, publish,%0A * distribute, sublicense, and/or sell copies of the Software, and to%0A * permit persons to whom the Software is furnished to do so, subject to%0A * the following conditions:%0A *%0A * The above copyright notice and this permission notice shall be%0A * included in all copies or substantial portions of the Software.%0A *%0A * THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND,%0A * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF%0A * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.%0A * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR%0A * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,%0A * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR%0A * OTHER DEALINGS IN THE SOFTWARE.%0A */%0A%0Apackage org.voltdb.regressionsuites;%0A%0Aimport java.io.IOException;%0A%0Aimport org.voltdb.VoltTable;%0Aimport org.voltdb.VoltType;%0A%0Aimport junit.framework.Test;%0A%0Aimport org.voltdb.BackendTarget;%0Aimport org.voltdb.VoltTable.ColumnInfo;%0Aimport org.voltdb.client.Client;%0Aimport org.voltdb.client.ProcCallException;%0Aimport org.voltdb.compiler.VoltProjectBuilder;%0A%0Apublic class TestShutdown extends RegressionSuite%0A%7B%0A    public TestShutdown(String name) %7B%0A        super(name);%0A    %7D%0A%0A    static VoltProjectBuilder getBuilderForTest() throws IOException %7B%0A        VoltProjectBuilder builder = new VoltProjectBuilder();%0A        builder.addLiteralSchema(%22%22);%0A        return builder;%0A    %7D%0A%0A    public void testShutdown() throws Exception %7B%0A        final Client client = getClient();%0A        // sleep a little so that we have time for the IPC backend to actually be running%0A        // so it can screw us on empty results%0A        Thread.sleep(1000);%0A%0A        boolean lostConnect = false;%0A        try %7B%0A            client.callProcedure(%22@Shutdown%22).getResults();%0A        %7D%0A        catch (ProcCallException pce) %7B%0A            lostConnect = pce.getMessage().contains(%22was lost before a response was received%22);%0A        %7D%0A        assertTrue(lostConnect);%0A        while (!((LocalCluster)getServerConfig()).areAllNonLocalProcessesDead()) %7B%0A            Thread.sleep(500);%0A        %7D%0A    %7D%0A%0A    static public Test suite() throws IOException %7B%0A        // the suite made here will all be using the tests from this class%0A        MultiConfigSuiteBuilder builder = new MultiConfigSuiteBuilder(TestShutdown.class);%0A%0A        // build up a project builder for the workload%0A        VoltProjectBuilder project = getBuilderForTest();%0A        boolean success;%0A        LocalCluster config = new LocalCluster(%22decimal-default.jar%22, 4, 5, 3, BackendTarget.NATIVE_EE_JNI);%0A        config.setHasLocalServer(false);%0A        success = config.compile(project);%0A        assertTrue(success);%0A%0A        // add this config to the set of tests to run%0A        builder.addServerConfig(config);%0A%0A        return builder;%0A    %7D%0A%7D%0A

Add junit test for @Shutdown