Examples of AssertionFailedError


Examples of junit.framework.AssertionFailedError

         {
            Throwable problem = ctx.getProblem();
            if (e != null || expected != null)
            {
               if (expected != null && problem == null)
                  throw new AssertionFailedError("Did not get expected " + expected.getName() + " for " + ctx);
               if (expected == null && problem != null)
               {
                  if (problem instanceof Exception)
                     throw (Exception) problem;
                  if (problem instanceof Error)
                     throw (Error) problem;
                  throw new UndeclaredThrowableException(problem);
               }
               if (expected != null)
               {
                  AbstractSystemTest.checkThrowableDeep(expected, problem);
                  if (ServiceContext.FAILED != ctx.state)
                     throw new AssertionFailedError("Context is not in the FAILED state: " + ctx);
               }
            }
            return;
         }
      }
     
      throw new AssertionFailedError("Did not find " + name + " in incomplete deployments " + incomplete);
   }
View Full Code Here

Examples of junit.framework.AssertionFailedError

  
   protected void assertNoService(ObjectName name) throws Exception
   {
      ServiceContext ctx = getServiceContext(name);
      if (ctx != null && ctx.state != ServiceContext.NOTYETINSTALLED)
         throw new AssertionFailedError("Should not be a service context for " + ctx);
   }
View Full Code Here

Examples of junit.framework.AssertionFailedError

   {
      ServiceContext ctx = getServiceContext(name);
      if (registered == false && ctx == null)
         return;
      if (ctx == null)
         throw new AssertionFailedError("Incorrect state for " + name + " expected " + ServiceContext.getStateString(expectedState) + " but there is no context/state");
      if (expectedState != ctx.state)
         throw new AssertionFailedError("Incorrect state for " + name + " expected " + ServiceContext.getStateString(expectedState) + " got " + ctx.getStateString());
   }
View Full Code Here

Examples of junit.framework.AssertionFailedError

   public void assertMBeanFailed(ObjectName name, boolean registered) throws Exception
   {
      MBeanServer server = getServer();
      if (server.isRegistered(name))
         throw new AssertionFailedError(name + " should not be registered after a failure");
   }
View Full Code Here

Examples of junit.framework.AssertionFailedError

   
    public static File getTaggedFile(File directory) throws Exception {
        //File directory = Configuration.getFile("junit.format.directory");
        if (!(directory.exists() && directory.isDirectory() && directory
                .canRead())) {
            throw new AssertionFailedError(
                    "config.properties->junit.formats.directory should be a readable directory. ");
        }
        File[] files = directory.listFiles(new AudioFileFilter());
        for (int i = 0; i < files.length; i++) {
            File current = files[i];
View Full Code Here

Examples of junit.framework.AssertionFailedError

        File testDirectory = Configuration.getFile("junit.format.directory");
        this.directory = Utils.createCopyOfDirectory(testDirectory);
        setName("DirecotryTest on " + testDirectory.getAbsolutePath());
        if (!(directory.exists() && directory.isDirectory() && directory
                .canRead())) {
            throw new AssertionFailedError(
                    "config.properties->junit.formats.directory should be a readable directory. ");
        }
        File[] files = directory.listFiles(new AudioFileFilter());
        for (int i = 0; i < files.length; i++) {
            File current = files[i];
View Full Code Here

Examples of junit.framework.AssertionFailedError

            message.append("expected translated statement:\n  ").append(
                expectedTranslatedStatement).append('\n');
            message.append("actual translated statement:\n  ").append(
                actualTranslatedStatement).append('\n');

            throw new AssertionFailedError(message.toString());
        }

        if (expectedContent instanceof Object[][]) {
            ensureTableContent(viewName, (Object[][]) expectedContent);
        }
View Full Code Here

Examples of junit.framework.AssertionFailedError

   }

   public static void assertTrue(String text, boolean assertion)
   {
      if (assertion == false)
         throw new AssertionFailedError(text);
   }
View Full Code Here

Examples of junit.framework.AssertionFailedError

     * method has been called.
     */

    private void confirmSetup() {
        if (!this.isInitialized) {
            throw new AssertionFailedError(
                    "You are overriding the setUp() method without calling super.setUp().  You must call the superclass setUp() method in your TestCase subclass to ensure proper initialization."); //$NON-NLS-1$
        }
    }
View Full Code Here

Examples of junit.framework.AssertionFailedError

        digester.addCallParam("web-app/servlet/init-param/param-name", 0); //$NON-NLS-1$
        digester.addCallParam("web-app/servlet/init-param/param-value", 1); //$NON-NLS-1$
        try {
            InputStream input = this.context.getResourceAsStream(pathname);
            if (input == null)
                throw new AssertionFailedError("Invalid pathname: " + pathname); //$NON-NLS-1$
            digester.parse(input);
            input.close();
        } catch (Exception e) {
            throw new AssertionFailedError(
                    "Received an exception while loading web.xml - " //$NON-NLS-1$
                            + e.getClass() + " : " + e.getMessage()); //$NON-NLS-1$
        }

        // now the context parameters..
        digester = new Digester();
        digester.setValidating(false);
        digester.push(this.context);
        digester.addCallMethod("web-app/context-param", "setInitParameter", 2); //$NON-NLS-1$ //$NON-NLS-2$
        digester.addCallParam("web-app/context-param/param-name", 0); //$NON-NLS-1$
        digester.addCallParam("web-app/context-param/param-value", 1); //$NON-NLS-1$
        try {
            InputStream input = this.context.getResourceAsStream(pathname);
            if (input == null)
                throw new AssertionFailedError("Invalid pathname: " + pathname); //$NON-NLS-1$
            digester.parse(input);
            input.close();
        } catch (Exception e) {
            throw new AssertionFailedError(
                    "Received an exception while loading web.xml - " //$NON-NLS-1$
                            + e.getClass() + " : " + e.getMessage()); //$NON-NLS-1$
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.